1 line
133 KiB
Plaintext
1 line
133 KiB
Plaintext
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-datetime_3.entry.js"],"names":["getDateValue","date","format","getValue","getValueFromFormat","undefined","defaultDate","parseDate","Date","toISOString","renderDatetime","template","value","locale","tokens","hasText","FORMAT_KEYS","forEach","index","indexOf","f","token","text","renderTextFormat","k","push","replace","i","length","FORMAT_DDDD","FORMAT_DDD","year","month","day","getDay","dayNames","DAY_NAMES","dayShortNames","DAY_SHORT_NAMES","e","FORMAT_A","hour","toUpperCase","FORMAT_a","FORMAT_YY","FORMAT_MM","FORMAT_DD","FORMAT_HH","FORMAT_mm","FORMAT_ss","twoDigit","FORMAT_YYYY","fourDigit","FORMAT_MMMM","monthNames","MONTH_NAMES","FORMAT_MMM","monthShortNames","MONTH_SHORT_NAMES","FORMAT_hh","FORMAT_h","toString","dateValueRange","min","max","opts","Error","FORMAT_M","FORMAT_D","FORMAT_H","FORMAT_m","FORMAT_s","dateSortValue","minute","parseInt","dateDataSortValue","data","daysInMonth","isLeapYear","ISO_8601_REGEXP","TIME_REGEXP","val","parse","exec","unshift","tzOffset","second","millisecond","ampm","getDateTime","dateString","timeZone","localDateTime","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","getTime","getTimezoneOffset","localDate","utcDateTime","toLocaleString","tzDateTime","updateDate","existingData","newData","displayTimezone","dateTime","Number","isNaN","Object","assign","keys","key","console","warn","hasOwnProperty","parseTemplate","formats","charAt","words","split","filter","w","word","VALID_AMPM_PREFIX","convertFormatToKey","convertDataToISO","rtn","threeDigit","Math","floor","abs","convertToArrayOfStrings","input","type","values","Array","isArray","map","trim","convertToArrayOfNumbers","num","isFinite","slice","datetimeIosCss","datetimeMdCss","Datetime","hostRef","ionCancel","ionChange","ionFocus","ionBlur","ionStyle","inputId","datetimeIds","datetimeMin","datetimeMax","datetimeValue","isExpanded","name","disabled","readonly","displayFormat","cancelText","doneText","onClick","setFocus","open","onFocus","emit","onBlur","emitStyle","updateDatetimeValue","pickerOptions","generatePickerOptions","create","picker","onDidDismiss","then","addEventListener","event","detail","colSelectedIndex","selectedIndex","colOptions","options","changeData","columns","generateColumns","present","placeholder","hasValue","mode","buttons","role","handler","pickerFormat","DEFAULT_FORMAT","calcMinMax","self","optValue","findIndex","opt","find","column","validateColumns","divyColumns","today","minCompareVal","maxCompareVal","yearCol","c","selectedYear","col","yearOpt","selectedMonth","validateColumn","numDaysInMonth","selectedDay","selectedHour","todaysYear","yearValues","years","error","lowerBounds","upperBounds","lb","ub","indexMin","indexMax","buttonEl","focus","el","labelId","label","addPlaceholderClass","datetimeText","datetimeTextPart","id","part","ref","btnEl","columnsWidth","width","option","align","optionsWidth","columnWidth","style","ios","md","iosEnterAnimation","baseEl","baseAnimation","backdropAnimation","wrapperAnimation","addElement","querySelector","fromTo","beforeStyles","afterClearStyles","easing","duration","addAnimation","iosLeaveAnimation","pickerIosCss","pickerMdCss","Picker","didPresent","willPresent","willDismiss","didDismiss","presented","keyboardClose","showBackdrop","backdropDismiss","animated","onBackdropTap","dismiss","dispatchCancelHandler","ev","cancelButton","b","callButtonHandler","durationTimeout","setTimeout","clearTimeout","Promise","resolve","button","shouldDismiss","getSelected","selected","selectedColumn","columnIndex","tabindex","cssClass","zIndex","overlayIndex","onIonBackdropTap","onIonPickerWillDismiss","visible","tappable","buttonWrapperClass","buttonClick","buttonClass","pickerColumnIosCss","pickerColumnMdCss","PickerColumnCmp","ionPickerColChange","optHeight","rotateFactor","scaleFactor","velocity","y","noAnimate","refresh","pickerRotateFactor","pickerScaleFactor","gesture","createGesture","gestureName","gesturePriority","threshold","passive","onStart","onMove","onEnd","enable","tmrId","colEl","optsEl","firstElementChild","clientHeight","cancelAnimationFrame","rafId","destroy","update","emitColChange","saveY","translateY","translateZ","indexForY","durationStr","scaleStr","children","optOffset","transform","rotateX","transitionDuration","classList","add","PICKER_OPT_SELECTED","remove","prevSelected","lastIndex","DECELERATION_FRICTION","minY","maxY","notLockedIn","round","requestAnimationFrame","decelerate","currentPos","cancelable","preventDefault","stopPropagation","deltaY","pow","bounceFrom","MAX_PICKER_SPEED","velocityY","target","closest","hasAttribute","setSelected","getAttribute","TRANSITION_DURATION","isScrollingUp","optHeightFraction","forceRefresh","Button","prefix","prefixWidth","maxWidth","o","suffix","suffixWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AASA;;;;;;;AAKA,UAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,IAAD,EAAOC,MAAP,EAAkB;AACnC,YAAMC,QAAQ,GAAGC,kBAAkB,CAACH,IAAD,EAAOC,MAAP,CAAnC;;AACA,YAAIC,QAAQ,KAAKE,SAAjB,EAA4B;AACxB,iBAAOF,QAAP;AACH;;AACD,YAAMG,WAAW,GAAGC,SAAS,CAAC,IAAIC,IAAJ,GAAWC,WAAX,EAAD,CAA7B;AACA,eAAOL,kBAAkB,CAACE,WAAD,EAAcJ,MAAd,CAAzB;AACH,OAPD;;AAQA,UAAMQ,cAAc,GAAG,SAAjBA,cAAiB,CAACC,QAAD,EAAWC,KAAX,EAAkBC,MAAlB,EAA6B;AAChD,YAAID,KAAK,KAAKP,SAAd,EAAyB;AACrB,iBAAOA,SAAP;AACH;;AACD,YAAMS,MAAM,GAAG,EAAf;AACA,YAAIC,OAAO,GAAG,KAAd;AACAC,mBAAW,CAACC,OAAZ,CAAoB,UAACf,MAAD,EAASgB,KAAT,EAAmB;AACnC,cAAIP,QAAQ,CAACQ,O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3K,GAAG,CAACiC;AAAhB,eAA/B;AAA+DN,iBAAG,EAAE,aAAAR,EAAE;AAAA,uBAAI,OAAI,CAACmG,MAAL,GAAcnG,EAAlB;AAAA;AAAtE,aAAT,EAAuGnB,GAAG,CAAC5B,OAAJ,CAAY/C,GAAZ,CAAgB,UAACuP,CAAD,EAAIpX,KAAJ;AAAA,qBAAc,6DAAEgX,MAAF,EAAU;AAAEvP,oBAAI,EAAE,QAAR;AAAkB,yBAAO;AAAE,gCAAc,IAAhB;AAAsB,yCAAuB,CAAC,CAAC2P,CAAC,CAACjO;AAAjD,iBAAzB;AAAsF,6BAAanJ;AAAnG,eAAV,EAAsHoX,CAAC,CAAChX,IAAxH,CAAd;AAAA,aAAhB,CAAvG,CAPtG,EAO4WoM,GAAG,CAAC6K,MAAJ,IAAe,6DAAE,KAAF,EAAS;AAAE,uBAAO,eAAT;AAA0B1I,mBAAK,EAAE;AAAEL,qBAAK,EAAE9B,GAAG,CAAC8K;AAAb;AAAjC,aAAT,EAAwE9K,GAAG,CAAC6K,MAA5E,CAP3X,CAAR;AAQH;AAhTgB;AAAA;AAAA,8BAiTR;AAAE,mBAAO,6DAAW,IAAX,CAAP;AAA0B;AAjTpB;AAAA;AAAA,8BAkTK;AAAE,mBAAO;AAC3B,qBAAO,CAAC,YAAD;AADoB,aAAP;AAEpB;AApTa;;AAAA;AAAA,SAArB;;AAsTA,UAAMlC,mBAAmB,GAAG,qBAA5B;AACA,UAAMI,qBAAqB,GAAG,IAA9B;AACA,UAAMc,gBAAgB,GAAG,EAAzB;AACA,UAAMO,mBAAmB,GAAG,GAA5B;AACArE,qBAAe,CAAC5D,KAAhB,GAAwB;AACpBC,WAAG,EAAEyD,kBADe;AAEpBxD,UAAE,EAAEyD;AAFgB,OAAxB","file":"11-es5.js","sourcesContent":["import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from './index-92848855.js';\nimport { b as getIonMode } from './ionic-global-23e7365a.js';\nimport { c as clamp, f as findItemLabel, a as renderHiddenInput } from './helpers-5c745fbd.js';\nimport { c as createAnimation } from './animation-a635a2fc.js';\nimport './hardware-back-button-7b6ede21.js';\nimport { p as pickerController, B as BACKDROP, i as isCancel, e as prepareOverlay, d as present, f as dismiss, g as eventMethod, s as safeCall } from './overlays-c5d9d644.js';\nimport { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-7b8ba70a.js';\nimport { h as hostContext, g as getClassMap } from './theme-5641d27f.js';\n\n/**\n * Gets a date value given a format\n * Defaults to the current date if\n * no date given\n */\nconst getDateValue = (date, format) => {\n const getValue = getValueFromFormat(date, format);\n if (getValue !== undefined) {\n return getValue;\n }\n const defaultDate = parseDate(new Date().toISOString());\n return getValueFromFormat(defaultDate, format);\n};\nconst renderDatetime = (template, value, locale) => {\n if (value === undefined) {\n return undefined;\n }\n const tokens = [];\n let hasText = false;\n FORMAT_KEYS.forEach((format, index) => {\n if (template.indexOf(format.f) > -1) {\n const token = '{' + index + '}';\n const text = renderTextFormat(format.f, value[format.k], value, locale);\n if (!hasText && text !== undefined && value[format.k] != null) {\n hasText = true;\n }\n tokens.push(token, text || '');\n template = template.replace(format.f, token);\n }\n });\n if (!hasText) {\n return undefined;\n }\n for (let i = 0; i < tokens.length; i += 2) {\n template = template.replace(tokens[i], tokens[i + 1]);\n }\n return template;\n};\nconst renderTextFormat = (format, value, date, locale) => {\n if ((format === FORMAT_DDDD || format === FORMAT_DDD)) {\n try {\n value = (new Date(date.year, date.month - 1, date.day)).getDay();\n if (format === FORMAT_DDDD) {\n return (locale.dayNames ? locale.dayNames : DAY_NAMES)[value];\n }\n return (locale.dayShortNames ? locale.dayShortNames : DAY_SHORT_NAMES)[value];\n }\n catch (e) {\n // ignore\n }\n return undefined;\n }\n if (format === FORMAT_A) {\n return date !== undefined && date.hour !== undefined\n ? (date.hour < 12 ? 'AM' : 'PM')\n : value ? value.toUpperCase() : '';\n }\n if (format === FORMAT_a) {\n return date !== undefined && date.hour !== undefined\n ? (date.hour < 12 ? 'am' : 'pm')\n : value || '';\n }\n if (value == null) {\n return '';\n }\n if (format === FORMAT_YY || format === FORMAT_MM ||\n format === FORMAT_DD || format === FORMAT_HH ||\n format === FORMAT_mm || format === FORMAT_ss) {\n return twoDigit(value);\n }\n if (format === FORMAT_YYYY) {\n return fourDigit(value);\n }\n if (format === FORMAT_MMMM) {\n return (locale.monthNames ? locale.monthNames : MONTH_NAMES)[value - 1];\n }\n if (format === FORMAT_MMM) {\n return (locale.monthShortNames ? locale.monthShortNames : MONTH_SHORT_NAMES)[value - 1];\n }\n if (format === FORMAT_hh || format === FORMAT_h) {\n if (value === 0) {\n return '12';\n }\n if (value > 12) {\n value -= 12;\n }\n if (format === FORMAT_hh && value < 10) {\n return ('0' + value);\n }\n }\n return value.toString();\n};\nconst dateValueRange = (format, min, max) => {\n const opts = [];\n if (format === FORMAT_YYYY || format === FORMAT_YY) {\n // year\n if (max.year === undefined || min.year === undefined) {\n throw new Error('min and max year is undefined');\n }\n for (let i = max.year; i >= min.year; i--) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_MMMM || format === FORMAT_MMM ||\n format === FORMAT_MM || format === FORMAT_M ||\n format === FORMAT_hh || format === FORMAT_h) {\n // month or 12-hour\n for (let i = 1; i < 13; i++) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_DDDD || format === FORMAT_DDD ||\n format === FORMAT_DD || format === FORMAT_D) {\n // day\n for (let i = 1; i < 32; i++) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_HH || format === FORMAT_H) {\n // 24-hour\n for (let i = 0; i < 24; i++) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_mm || format === FORMAT_m) {\n // minutes\n for (let i = 0; i < 60; i++) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_ss || format === FORMAT_s) {\n // seconds\n for (let i = 0; i < 60; i++) {\n opts.push(i);\n }\n }\n else if (format === FORMAT_A || format === FORMAT_a) {\n // AM/PM\n opts.push('am', 'pm');\n }\n return opts;\n};\nconst dateSortValue = (year, month, day, hour = 0, minute = 0) => {\n return parseInt(`1${fourDigit(year)}${twoDigit(month)}${twoDigit(day)}${twoDigit(hour)}${twoDigit(minute)}`, 10);\n};\nconst dateDataSortValue = (data) => {\n return dateSortValue(data.year, data.month, data.day, data.hour, data.minute);\n};\nconst daysInMonth = (month, year) => {\n return (month === 4 || month === 6 || month === 9 || month === 11) ? 30 : (month === 2) ? isLeapYear(year) ? 29 : 28 : 31;\n};\nconst isLeapYear = (year) => {\n return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0);\n};\nconst ISO_8601_REGEXP = /^(\\d{4}|[+\\-]\\d{6})(?:-(\\d{2})(?:-(\\d{2}))?)?(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:(Z)|([+\\-])(\\d{2})(?::(\\d{2}))?)?)?$/;\nconst TIME_REGEXP = /^((\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:(Z)|([+\\-])(\\d{2})(?::(\\d{2}))?)?)?$/;\nconst parseDate = (val) => {\n // manually parse IS0 cuz Date.parse cannot be trusted\n // ISO 8601 format: 1994-12-15T13:47:20Z\n let parse = null;\n if (val != null && val !== '') {\n // try parsing for just time first, HH:MM\n parse = TIME_REGEXP.exec(val);\n if (parse) {\n // adjust the array so it fits nicely with the datetime parse\n parse.unshift(undefined, undefined);\n parse[2] = parse[3] = undefined;\n }\n else {\n // try parsing for full ISO datetime\n parse = ISO_8601_REGEXP.exec(val);\n }\n }\n if (parse === null) {\n // wasn't able to parse the ISO datetime\n return undefined;\n }\n // ensure all the parse values exist with at least 0\n for (let i = 1; i < 8; i++) {\n parse[i] = parse[i] !== undefined ? parseInt(parse[i], 10) : undefined;\n }\n let tzOffset = 0;\n if (parse[9] && parse[10]) {\n // hours\n tzOffset = parseInt(parse[10], 10) * 60;\n if (parse[11]) {\n // minutes\n tzOffset += parseInt(parse[11], 10);\n }\n if (parse[9] === '-') {\n // + or -\n tzOffset *= -1;\n }\n }\n return {\n year: parse[1],\n month: parse[2],\n day: parse[3],\n hour: parse[4],\n minute: parse[5],\n second: parse[6],\n millisecond: parse[7],\n tzOffset,\n ampm: parse[4] >= 12 ? 'pm' : 'am'\n };\n};\n/**\n * Converts a valid UTC datetime string to JS Date time object.\n * By default uses the users local timezone, but an optional\n * timezone can be provided.\n * Note: This is not meant for time strings\n * such as \"01:47\"\n */\nconst getDateTime = (dateString = '', timeZone = '') => {\n /**\n * If user passed in undefined\n * or null, convert it to the\n * empty string since the rest\n * of this functions expects\n * a string\n */\n if (dateString === undefined || dateString === null) {\n dateString = '';\n }\n /**\n * Ensures that YYYY-MM-DD, YYYY-MM,\n * YYYY-DD, YYYY, etc does not get affected\n * by timezones and stays on the day/month\n * that the user provided\n */\n if (dateString.length === 10 ||\n dateString.length === 7 ||\n dateString.length === 4) {\n dateString += ' ';\n }\n const date = (typeof dateString === 'string' && dateString.length > 0) ? new Date(dateString) : new Date();\n const localDateTime = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n if (timeZone && timeZone.length > 0) {\n return new Date(date.getTime() - getTimezoneOffset(localDateTime, timeZone));\n }\n return localDateTime;\n};\nconst getTimezoneOffset = (localDate, timeZone) => {\n const utcDateTime = new Date(localDate.toLocaleString('en-US', { timeZone: 'utc' }));\n const tzDateTime = new Date(localDate.toLocaleString('en-US', { timeZone }));\n return utcDateTime.getTime() - tzDateTime.getTime();\n};\nconst updateDate = (existingData, newData, displayTimezone) => {\n if (!newData || typeof newData === 'string') {\n const dateTime = getDateTime(newData, displayTimezone);\n if (!Number.isNaN(dateTime.getTime())) {\n newData = dateTime.toISOString();\n }\n }\n if (newData && newData !== '') {\n if (typeof newData === 'string') {\n // new date is a string, and hopefully in the ISO format\n // convert it to our DatetimeData if a valid ISO\n newData = parseDate(newData);\n if (newData) {\n // successfully parsed the ISO string to our DatetimeData\n Object.assign(existingData, newData);\n return true;\n }\n }\n else if ((newData.year || newData.hour || newData.month || newData.day || newData.minute || newData.second)) {\n // newData is from the datetime picker's selected values\n // update the existing datetimeValue with the new values\n if (newData.ampm !== undefined && newData.hour !== undefined) {\n // If the date we came from exists, we need to change the meridiem value when\n // going to and from 12\n if (existingData.ampm !== undefined && existingData.hour !== undefined) {\n // If the existing meridiem is am, we want to switch to pm if it is either\n // A) coming from 0 (12 am)\n // B) going to 12 (12 pm)\n if (existingData.ampm === 'am' && (existingData.hour === 0 || newData.hour.value === 12)) {\n newData.ampm.value = 'pm';\n }\n // If the existing meridiem is pm, we want to switch to am if it is either\n // A) coming from 12 (12 pm)\n // B) going to 12 (12 am)\n if (existingData.ampm === 'pm' && (existingData.hour === 12 || newData.hour.value === 12)) {\n newData.ampm.value = 'am';\n }\n }\n // change the value of the hour based on whether or not it is am or pm\n // if the meridiem is pm and equal to 12, it remains 12\n // otherwise we add 12 to the hour value\n // if the meridiem is am and equal to 12, we change it to 0\n // otherwise we use its current hour value\n // for example: 8 pm becomes 20, 12 am becomes 0, 4 am becomes 4\n newData.hour.value = (newData.ampm.value === 'pm')\n ? (newData.hour.value === 12 ? 12 : newData.hour.value + 12)\n : (newData.hour.value === 12 ? 0 : newData.hour.value);\n }\n // merge new values from the picker's selection\n // to the existing DatetimeData values\n for (const key of Object.keys(newData)) {\n existingData[key] = newData[key].value;\n }\n return true;\n }\n else if (newData.ampm) {\n // Even though in the picker column hour values are between 1 and 12, the hour value is actually normalized\n // to [0, 23] interval. Because of this when changing between AM and PM we have to update the hour so it points\n // to the correct HH hour\n newData.hour = {\n value: newData.hour\n ? newData.hour.value\n : (newData.ampm.value === 'pm'\n ? (existingData.hour < 12 ? existingData.hour + 12 : existingData.hour)\n : (existingData.hour >= 12 ? existingData.hour - 12 : existingData.hour))\n };\n existingData['hour'] = newData['hour'].value;\n existingData['ampm'] = newData['ampm'].value;\n return true;\n }\n // eww, invalid data\n console.warn(`Error parsing date: \"${newData}\". Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime`);\n }\n else {\n // blank data, clear everything out\n for (const k in existingData) {\n if (existingData.hasOwnProperty(k)) {\n delete existingData[k];\n }\n }\n }\n return false;\n};\nconst parseTemplate = (template) => {\n const formats = [];\n template = template.replace(/[^\\w\\s]/gi, ' ');\n FORMAT_KEYS.forEach(format => {\n if (format.f.length > 1 && template.indexOf(format.f) > -1 && template.indexOf(format.f + format.f.charAt(0)) < 0) {\n template = template.replace(format.f, ' ' + format.f + ' ');\n }\n });\n const words = template.split(' ').filter(w => w.length > 0);\n words.forEach((word, i) => {\n FORMAT_KEYS.forEach(format => {\n if (word === format.f) {\n if (word === FORMAT_A || word === FORMAT_a) {\n // this format is an am/pm format, so it's an \"a\" or \"A\"\n if ((formats.indexOf(FORMAT_h) < 0 && formats.indexOf(FORMAT_hh) < 0) ||\n VALID_AMPM_PREFIX.indexOf(words[i - 1]) === -1) {\n // template does not already have a 12-hour format\n // or this am/pm format doesn't have a hour, minute, or second format immediately before it\n // so do not treat this word \"a\" or \"A\" as the am/pm format\n return;\n }\n }\n formats.push(word);\n }\n });\n });\n return formats;\n};\nconst getValueFromFormat = (date, format) => {\n if (format === FORMAT_A || format === FORMAT_a) {\n return (date.hour < 12 ? 'am' : 'pm');\n }\n if (format === FORMAT_hh || format === FORMAT_h) {\n return (date.hour > 12 ? date.hour - 12 : (date.hour === 0 ? 12 : date.hour));\n }\n return date[convertFormatToKey(format)];\n};\nconst convertFormatToKey = (format) => {\n for (const k in FORMAT_KEYS) {\n if (FORMAT_KEYS[k].f === format) {\n return FORMAT_KEYS[k].k;\n }\n }\n return undefined;\n};\nconst convertDataToISO = (data) => {\n // https://www.w3.org/TR/NOTE-datetime\n let rtn = '';\n if (data.year !== undefined) {\n // YYYY\n rtn = fourDigit(data.year);\n if (data.month !== undefined) {\n // YYYY-MM\n rtn += '-' + twoDigit(data.month);\n if (data.day !== undefined) {\n // YYYY-MM-DD\n rtn += '-' + twoDigit(data.day);\n if (data.hour !== undefined) {\n // YYYY-MM-DDTHH:mm:SS\n rtn += `T${twoDigit(data.hour)}:${twoDigit(data.minute)}:${twoDigit(data.second)}`;\n if (data.millisecond > 0) {\n // YYYY-MM-DDTHH:mm:SS.SSS\n rtn += '.' + threeDigit(data.millisecond);\n }\n if (data.tzOffset === undefined) {\n // YYYY-MM-DDTHH:mm:SSZ\n rtn += 'Z';\n }\n else {\n // YYYY-MM-DDTHH:mm:SS+/-HH:mm\n rtn += (data.tzOffset > 0 ? '+' : '-') + twoDigit(Math.floor(Math.abs(data.tzOffset / 60))) + ':' + twoDigit(data.tzOffset % 60);\n }\n }\n }\n }\n }\n else if (data.hour !== undefined) {\n // HH:mm\n rtn = twoDigit(data.hour) + ':' + twoDigit(data.minute);\n if (data.second !== undefined) {\n // HH:mm:SS\n rtn += ':' + twoDigit(data.second);\n if (data.millisecond !== undefined) {\n // HH:mm:SS.SSS\n rtn += '.' + threeDigit(data.millisecond);\n }\n }\n }\n return rtn;\n};\n/**\n * Use to convert a string of comma separated strings or\n * an array of strings, and clean up any user input\n */\nconst convertToArrayOfStrings = (input, type) => {\n if (input == null) {\n return undefined;\n }\n if (typeof input === 'string') {\n // convert the string to an array of strings\n // auto remove any [] characters\n input = input.replace(/\\[|\\]/g, '').split(',');\n }\n let values;\n if (Array.isArray(input)) {\n // trim up each string value\n values = input.map(val => val.toString().trim());\n }\n if (values === undefined || values.length === 0) {\n console.warn(`Invalid \"${type}Names\". Must be an array of strings, or a comma separated string.`);\n }\n return values;\n};\n/**\n * Use to convert a string of comma separated numbers or\n * an array of numbers, and clean up any user input\n */\nconst convertToArrayOfNumbers = (input, type) => {\n if (typeof input === 'string') {\n // convert the string to an array of strings\n // auto remove any whitespace and [] characters\n input = input.replace(/\\[|\\]|\\s/g, '').split(',');\n }\n let values;\n if (Array.isArray(input)) {\n // ensure each value is an actual number in the returned array\n values = input\n .map((num) => parseInt(num, 10))\n .filter(isFinite);\n }\n else {\n values = [input];\n }\n if (values.length === 0) {\n console.warn(`Invalid \"${type}Values\". Must be an array of numbers, or a comma separated string of numbers.`);\n }\n return values;\n};\nconst twoDigit = (val) => {\n return ('0' + (val !== undefined ? Math.abs(val) : '0')).slice(-2);\n};\nconst threeDigit = (val) => {\n return ('00' + (val !== undefined ? Math.abs(val) : '0')).slice(-3);\n};\nconst fourDigit = (val) => {\n return ('000' + (val !== undefined ? Math.abs(val) : '0')).slice(-4);\n};\nconst FORMAT_YYYY = 'YYYY';\nconst FORMAT_YY = 'YY';\nconst FORMAT_MMMM = 'MMMM';\nconst FORMAT_MMM = 'MMM';\nconst FORMAT_MM = 'MM';\nconst FORMAT_M = 'M';\nconst FORMAT_DDDD = 'DDDD';\nconst FORMAT_DDD = 'DDD';\nconst FORMAT_DD = 'DD';\nconst FORMAT_D = 'D';\nconst FORMAT_HH = 'HH';\nconst FORMAT_H = 'H';\nconst FORMAT_hh = 'hh';\nconst FORMAT_h = 'h';\nconst FORMAT_mm = 'mm';\nconst FORMAT_m = 'm';\nconst FORMAT_ss = 'ss';\nconst FORMAT_s = 's';\nconst FORMAT_A = 'A';\nconst FORMAT_a = 'a';\nconst FORMAT_KEYS = [\n { f: FORMAT_YYYY, k: 'year' },\n { f: FORMAT_MMMM, k: 'month' },\n { f: FORMAT_DDDD, k: 'day' },\n { f: FORMAT_MMM, k: 'month' },\n { f: FORMAT_DDD, k: 'day' },\n { f: FORMAT_YY, k: 'year' },\n { f: FORMAT_MM, k: 'month' },\n { f: FORMAT_DD, k: 'day' },\n { f: FORMAT_HH, k: 'hour' },\n { f: FORMAT_hh, k: 'hour' },\n { f: FORMAT_mm, k: 'minute' },\n { f: FORMAT_ss, k: 'second' },\n { f: FORMAT_M, k: 'month' },\n { f: FORMAT_D, k: 'day' },\n { f: FORMAT_H, k: 'hour' },\n { f: FORMAT_h, k: 'hour' },\n { f: FORMAT_m, k: 'minute' },\n { f: FORMAT_s, k: 'second' },\n { f: FORMAT_A, k: 'ampm' },\n { f: FORMAT_a, k: 'ampm' },\n];\nconst DAY_NAMES = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n];\nconst DAY_SHORT_NAMES = [\n 'Sun',\n 'Mon',\n 'Tue',\n 'Wed',\n 'Thu',\n 'Fri',\n 'Sat',\n];\nconst MONTH_NAMES = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\nconst MONTH_SHORT_NAMES = [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec',\n];\nconst VALID_AMPM_PREFIX = [\n FORMAT_hh, FORMAT_h, FORMAT_mm, FORMAT_m, FORMAT_ss, FORMAT_s\n];\n\nconst datetimeIosCss = \":host{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static}:host(.datetime-placeholder){color:var(--placeholder-color)}:host(.datetime-disabled){opacity:0.3;pointer-events:none}:host(.datetime-readonly){pointer-events:none}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}[dir=rtl] button,:host-context([dir=rtl]) button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.datetime-text{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}[dir=rtl] .datetime-text,:host-context([dir=rtl]) .datetime-text{direction:rtl}:host{--placeholder-color:var(--ion-color-step-400, #999999);--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:20px}\";\n\nconst datetimeMdCss = \":host{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static}:host(.datetime-placeholder){color:var(--placeholder-color)}:host(.datetime-disabled){opacity:0.3;pointer-events:none}:host(.datetime-readonly){pointer-events:none}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}[dir=rtl] button,:host-context([dir=rtl]) button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.datetime-text{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}[dir=rtl] .datetime-text,:host-context([dir=rtl]) .datetime-text{direction:rtl}:host{--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:16px}\";\n\nconst Datetime = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionCancel = createEvent(this, \"ionCancel\", 7);\n this.ionChange = createEvent(this, \"ionChange\", 7);\n this.ionFocus = createEvent(this, \"ionFocus\", 7);\n this.ionBlur = createEvent(this, \"ionBlur\", 7);\n this.ionStyle = createEvent(this, \"ionStyle\", 7);\n this.inputId = `ion-dt-${datetimeIds++}`;\n this.locale = {};\n this.datetimeMin = {};\n this.datetimeMax = {};\n this.datetimeValue = {};\n this.isExpanded = false;\n /**\n * The name of the control, which is submitted with the form data.\n */\n this.name = this.inputId;\n /**\n * If `true`, the user cannot interact with the datetime.\n */\n this.disabled = false;\n /**\n * If `true`, the datetime appears normal but is not interactive.\n */\n this.readonly = false;\n /**\n * The display format of the date and time as text that shows\n * within the item. When the `pickerFormat` input is not used, then the\n * `displayFormat` is used for both display the formatted text, and determining\n * the datetime picker's columns. See the `pickerFormat` input description for\n * more info. Defaults to `MMM D, YYYY`.\n */\n this.displayFormat = 'MMM D, YYYY';\n /**\n * The text to display on the picker's cancel button.\n */\n this.cancelText = 'Cancel';\n /**\n * The text to display on the picker's \"Done\" button.\n */\n this.doneText = 'Done';\n this.onClick = () => {\n this.setFocus();\n this.open();\n };\n this.onFocus = () => {\n this.ionFocus.emit();\n };\n this.onBlur = () => {\n this.ionBlur.emit();\n };\n }\n disabledChanged() {\n this.emitStyle();\n }\n /**\n * Update the datetime value when the value changes\n */\n valueChanged() {\n this.updateDatetimeValue(this.value);\n this.emitStyle();\n this.ionChange.emit({\n value: this.value\n });\n }\n componentWillLoad() {\n // first see if locale names were provided in the inputs\n // then check to see if they're in the config\n // if neither were provided then it will use default English names\n this.locale = {\n // this.locale[type] = convertToArrayOfStrings((this[type] ? this[type] : this.config.get(type), type);\n monthNames: convertToArrayOfStrings(this.monthNames, 'monthNames'),\n monthShortNames: convertToArrayOfStrings(this.monthShortNames, 'monthShortNames'),\n dayNames: convertToArrayOfStrings(this.dayNames, 'dayNames'),\n dayShortNames: convertToArrayOfStrings(this.dayShortNames, 'dayShortNames')\n };\n this.updateDatetimeValue(this.value);\n this.emitStyle();\n }\n /**\n * Opens the datetime overlay.\n */\n async open() {\n if (this.disabled || this.isExpanded) {\n return;\n }\n const pickerOptions = this.generatePickerOptions();\n const picker = await pickerController.create(pickerOptions);\n this.isExpanded = true;\n picker.onDidDismiss().then(() => {\n this.isExpanded = false;\n this.setFocus();\n });\n picker.addEventListener('ionPickerColChange', async (event) => {\n const data = event.detail;\n const colSelectedIndex = data.selectedIndex;\n const colOptions = data.options;\n const changeData = {};\n changeData[data.name] = {\n value: colOptions[colSelectedIndex].value\n };\n if (data.name !== 'ampm' && this.datetimeValue.ampm !== undefined) {\n changeData['ampm'] = {\n value: this.datetimeValue.ampm\n };\n }\n this.updateDatetimeValue(changeData);\n picker.columns = this.generateColumns();\n });\n await picker.present();\n }\n emitStyle() {\n this.ionStyle.emit({\n 'interactive': true,\n 'datetime': true,\n 'has-placeholder': this.placeholder != null,\n 'has-value': this.hasValue(),\n 'interactive-disabled': this.disabled,\n });\n }\n updateDatetimeValue(value) {\n updateDate(this.datetimeValue, value, this.displayTimezone);\n }\n generatePickerOptions() {\n const mode = getIonMode(this);\n this.locale = {\n monthNames: convertToArrayOfStrings(this.monthNames, 'monthNames'),\n monthShortNames: convertToArrayOfStrings(this.monthShortNames, 'monthShortNames'),\n dayNames: convertToArrayOfStrings(this.dayNames, 'dayNames'),\n dayShortNames: convertToArrayOfStrings(this.dayShortNames, 'dayShortNames')\n };\n const pickerOptions = Object.assign(Object.assign({ mode }, this.pickerOptions), { columns: this.generateColumns() });\n // If the user has not passed in picker buttons,\n // add a cancel and ok button to the picker\n const buttons = pickerOptions.buttons;\n if (!buttons || buttons.length === 0) {\n pickerOptions.buttons = [\n {\n text: this.cancelText,\n role: 'cancel',\n handler: () => {\n this.updateDatetimeValue(this.value);\n this.ionCancel.emit();\n }\n },\n {\n text: this.doneText,\n handler: (data) => {\n this.updateDatetimeValue(data);\n /**\n * Prevent convertDataToISO from doing any\n * kind of transformation based on timezone\n * This cancels out any change it attempts to make\n *\n * Important: Take the timezone offset based on\n * the date that is currently selected, otherwise\n * there can be 1 hr difference when dealing w/ DST\n */\n const date = new Date(convertDataToISO(this.datetimeValue));\n // If a custom display timezone is provided, use that tzOffset value instead\n this.datetimeValue.tzOffset = (this.displayTimezone !== undefined && this.displayTimezone.length > 0)\n ? ((getTimezoneOffset(date, this.displayTimezone)) / 1000 / 60) * -1\n : date.getTimezoneOffset() * -1;\n this.value = convertDataToISO(this.datetimeValue);\n }\n }\n ];\n }\n return pickerOptions;\n }\n generateColumns() {\n // if a picker format wasn't provided, then fallback\n // to use the display format\n let template = this.pickerFormat || this.displayFormat || DEFAULT_FORMAT;\n if (template.length === 0) {\n return [];\n }\n // make sure we've got up to date sizing information\n this.calcMinMax();\n // does not support selecting by day name\n // automatically remove any day name formats\n template = template.replace('DDDD', '{~}').replace('DDD', '{~}');\n if (template.indexOf('D') === -1) {\n // there is not a day in the template\n // replace the day name with a numeric one if it exists\n template = template.replace('{~}', 'D');\n }\n // make sure no day name replacer is left in the string\n template = template.replace(/{~}/g, '');\n // parse apart the given template into an array of \"formats\"\n const columns = parseTemplate(template).map((format) => {\n // loop through each format in the template\n // create a new picker column to build up with data\n const key = convertFormatToKey(format);\n let values;\n // check if they have exact values to use for this date part\n // otherwise use the default date part values\n const self = this;\n values = self[key + 'Values']\n ? convertToArrayOfNumbers(self[key + 'Values'], key)\n : dateValueRange(format, this.datetimeMin, this.datetimeMax);\n const colOptions = values.map(val => {\n return {\n value: val,\n text: renderTextFormat(format, val, undefined, this.locale),\n };\n });\n // cool, we've loaded up the columns with options\n // preselect the option for this column\n const optValue = getDateValue(this.datetimeValue, format);\n const selectedIndex = colOptions.findIndex(opt => opt.value === optValue);\n return {\n name: key,\n selectedIndex: selectedIndex >= 0 ? selectedIndex : 0,\n options: colOptions\n };\n });\n // Normalize min/max\n const min = this.datetimeMin;\n const max = this.datetimeMax;\n ['month', 'day', 'hour', 'minute']\n .filter(name => !columns.find(column => column.name === name))\n .forEach(name => {\n min[name] = 0;\n max[name] = 0;\n });\n return this.validateColumns(divyColumns(columns));\n }\n validateColumns(columns) {\n const today = new Date();\n const minCompareVal = dateDataSortValue(this.datetimeMin);\n const maxCompareVal = dateDataSortValue(this.datetimeMax);\n const yearCol = columns.find(c => c.name === 'year');\n let selectedYear = today.getFullYear();\n if (yearCol) {\n // default to the first value if the current year doesn't exist in the options\n if (!yearCol.options.find(col => col.value === today.getFullYear())) {\n selectedYear = yearCol.options[0].value;\n }\n const selectedIndex = yearCol.selectedIndex;\n if (selectedIndex !== undefined) {\n const yearOpt = yearCol.options[selectedIndex];\n if (yearOpt) {\n // they have a selected year value\n selectedYear = yearOpt.value;\n }\n }\n }\n const selectedMonth = this.validateColumn(columns, 'month', 1, minCompareVal, maxCompareVal, [selectedYear, 0, 0, 0, 0], [selectedYear, 12, 31, 23, 59]);\n const numDaysInMonth = daysInMonth(selectedMonth, selectedYear);\n const selectedDay = this.validateColumn(columns, 'day', 2, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, 0, 0, 0], [selectedYear, selectedMonth, numDaysInMonth, 23, 59]);\n const selectedHour = this.validateColumn(columns, 'hour', 3, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, 0, 0], [selectedYear, selectedMonth, selectedDay, 23, 59]);\n this.validateColumn(columns, 'minute', 4, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, selectedHour, 0], [selectedYear, selectedMonth, selectedDay, selectedHour, 59]);\n return columns;\n }\n calcMinMax() {\n const todaysYear = new Date().getFullYear();\n if (this.yearValues !== undefined) {\n const years = convertToArrayOfNumbers(this.yearValues, 'year');\n if (this.min === undefined) {\n this.min = Math.min(...years).toString();\n }\n if (this.max === undefined) {\n this.max = Math.max(...years).toString();\n }\n }\n else {\n if (this.min === undefined) {\n this.min = (todaysYear - 100).toString();\n }\n if (this.max === undefined) {\n this.max = todaysYear.toString();\n }\n }\n const min = this.datetimeMin = parseDate(this.min);\n const max = this.datetimeMax = parseDate(this.max);\n min.year = min.year || todaysYear;\n max.year = max.year || todaysYear;\n min.month = min.month || 1;\n max.month = max.month || 12;\n min.day = min.day || 1;\n max.day = max.day || 31;\n min.hour = min.hour || 0;\n max.hour = max.hour === undefined ? 23 : max.hour;\n min.minute = min.minute || 0;\n max.minute = max.minute === undefined ? 59 : max.minute;\n min.second = min.second || 0;\n max.second = max.second === undefined ? 59 : max.second;\n // Ensure min/max constraints\n if (min.year > max.year) {\n console.error('min.year > max.year');\n min.year = max.year - 100;\n }\n if (min.year === max.year) {\n if (min.month > max.month) {\n console.error('min.month > max.month');\n min.month = 1;\n }\n else if (min.month === max.month && min.day > max.day) {\n console.error('min.day > max.day');\n min.day = 1;\n }\n }\n }\n validateColumn(columns, name, index, min, max, lowerBounds, upperBounds) {\n const column = columns.find(c => c.name === name);\n if (!column) {\n return 0;\n }\n const lb = lowerBounds.slice();\n const ub = upperBounds.slice();\n const options = column.options;\n let indexMin = options.length - 1;\n let indexMax = 0;\n for (let i = 0; i < options.length; i++) {\n const opts = options[i];\n const value = opts.value;\n lb[index] = opts.value;\n ub[index] = opts.value;\n const disabled = opts.disabled = (value < lowerBounds[index] ||\n value > upperBounds[index] ||\n dateSortValue(ub[0], ub[1], ub[2], ub[3], ub[4]) < min ||\n dateSortValue(lb[0], lb[1], lb[2], lb[3], lb[4]) > max);\n if (!disabled) {\n indexMin = Math.min(indexMin, i);\n indexMax = Math.max(indexMax, i);\n }\n }\n const selectedIndex = column.selectedIndex = clamp(indexMin, column.selectedIndex, indexMax);\n const opt = column.options[selectedIndex];\n if (opt) {\n return opt.value;\n }\n return 0;\n }\n get text() {\n // create the text of the formatted data\n const template = this.displayFormat || this.pickerFormat || DEFAULT_FORMAT;\n if (this.value === undefined ||\n this.value === null ||\n this.value.length === 0) {\n return;\n }\n return renderDatetime(template, this.datetimeValue, this.locale);\n }\n hasValue() {\n return this.text !== undefined;\n }\n setFocus() {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n render() {\n const { inputId, text, disabled, readonly, isExpanded, el, placeholder } = this;\n const mode = getIonMode(this);\n const labelId = inputId + '-lbl';\n const label = findItemLabel(el);\n const addPlaceholderClass = (text === undefined && placeholder != null) ? true : false;\n // If selected text has been passed in, use that first\n // otherwise use the placeholder\n const datetimeText = text === undefined\n ? (placeholder != null ? placeholder : '')\n : text;\n const datetimeTextPart = text === undefined\n ? (placeholder != null ? 'placeholder' : undefined)\n : 'text';\n if (label) {\n label.id = labelId;\n }\n renderHiddenInput(true, el, this.name, this.value, this.disabled);\n return (h(Host, { onClick: this.onClick, \"aria-disabled\": disabled ? 'true' : null, \"aria-expanded\": `${isExpanded}`, \"aria-haspopup\": \"true\", \"aria-labelledby\": labelId, class: {\n [mode]: true,\n 'datetime-disabled': disabled,\n 'datetime-readonly': readonly,\n 'datetime-placeholder': addPlaceholderClass,\n 'in-item': hostContext('ion-item', el)\n } }, h(\"div\", { class: \"datetime-text\", part: datetimeTextPart }, datetimeText), h(\"button\", { type: \"button\", onFocus: this.onFocus, onBlur: this.onBlur, disabled: this.disabled, ref: btnEl => this.buttonEl = btnEl })));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"disabled\": [\"disabledChanged\"],\n \"value\": [\"valueChanged\"]\n }; }\n};\nconst divyColumns = (columns) => {\n const columnsWidth = [];\n let col;\n let width;\n for (let i = 0; i < columns.length; i++) {\n col = columns[i];\n columnsWidth.push(0);\n for (const option of col.options) {\n width = option.text.length;\n if (width > columnsWidth[i]) {\n columnsWidth[i] = width;\n }\n }\n }\n if (columnsWidth.length === 2) {\n width = Math.max(columnsWidth[0], columnsWidth[1]);\n columns[0].align = 'right';\n columns[1].align = 'left';\n columns[0].optionsWidth = columns[1].optionsWidth = `${width * 17}px`;\n }\n else if (columnsWidth.length === 3) {\n width = Math.max(columnsWidth[0], columnsWidth[2]);\n columns[0].align = 'right';\n columns[1].columnWidth = `${columnsWidth[1] * 17}px`;\n columns[0].optionsWidth = columns[2].optionsWidth = `${width * 17}px`;\n columns[2].align = 'left';\n }\n return columns;\n};\nconst DEFAULT_FORMAT = 'MMM D, YYYY';\nlet datetimeIds = 0;\nDatetime.style = {\n ios: datetimeIosCss,\n md: datetimeMdCss\n};\n\n/**\n * iOS Picker Enter Animation\n */\nconst iosEnterAnimation = (baseEl) => {\n const baseAnimation = createAnimation();\n const backdropAnimation = createAnimation();\n const wrapperAnimation = createAnimation();\n backdropAnimation\n .addElement(baseEl.querySelector('ion-backdrop'))\n .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')\n .beforeStyles({\n 'pointer-events': 'none'\n })\n .afterClearStyles(['pointer-events']);\n wrapperAnimation\n .addElement(baseEl.querySelector('.picker-wrapper'))\n .fromTo('transform', 'translateY(100%)', 'translateY(0%)');\n return baseAnimation\n .addElement(baseEl)\n .easing('cubic-bezier(.36,.66,.04,1)')\n .duration(400)\n .addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\n/**\n * iOS Picker Leave Animation\n */\nconst iosLeaveAnimation = (baseEl) => {\n const baseAnimation = createAnimation();\n const backdropAnimation = createAnimation();\n const wrapperAnimation = createAnimation();\n backdropAnimation\n .addElement(baseEl.querySelector('ion-backdrop'))\n .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);\n wrapperAnimation\n .addElement(baseEl.querySelector('.picker-wrapper'))\n .fromTo('transform', 'translateY(0%)', 'translateY(100%)');\n return baseAnimation\n .addElement(baseEl)\n .easing('cubic-bezier(.36,.66,.04,1)')\n .duration(400)\n .addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\nconst pickerIosCss = \".sc-ion-picker-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-ios-h,[dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active,.picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-ios,.picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1em;padding-right:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em}}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-ios{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-ios{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}\";\n\nconst pickerMdCss = \".sc-ion-picker-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-md-h,[dir=rtl] .sc-ion-picker-md-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-md-h{display:none}.picker-wrapper.sc-ion-picker-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-md:active,.picker-button.sc-ion-picker-md:focus{outline:none}.picker-columns.sc-ion-picker-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-md,.picker-below-highlight.sc-ion-picker-md{display:none;pointer-events:none}.sc-ion-picker-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1.1em;padding-right:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{padding-left:unset;padding-right:unset;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em}}.picker-columns.sc-ion-picker-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-md{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-md .picker-above-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-md{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-md .picker-below-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}\";\n\nconst Picker = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.didPresent = createEvent(this, \"ionPickerDidPresent\", 7);\n this.willPresent = createEvent(this, \"ionPickerWillPresent\", 7);\n this.willDismiss = createEvent(this, \"ionPickerWillDismiss\", 7);\n this.didDismiss = createEvent(this, \"ionPickerDidDismiss\", 7);\n this.presented = false;\n /**\n * If `true`, the keyboard will be automatically dismissed when the overlay is presented.\n */\n this.keyboardClose = true;\n /**\n * Array of buttons to be displayed at the top of the picker.\n */\n this.buttons = [];\n /**\n * Array of columns to be displayed in the picker.\n */\n this.columns = [];\n /**\n * Number of milliseconds to wait before dismissing the picker.\n */\n this.duration = 0;\n /**\n * If `true`, a backdrop will be displayed behind the picker.\n */\n this.showBackdrop = true;\n /**\n * If `true`, the picker will be dismissed when the backdrop is clicked.\n */\n this.backdropDismiss = true;\n /**\n * If `true`, the picker will animate.\n */\n this.animated = true;\n this.onBackdropTap = () => {\n this.dismiss(undefined, BACKDROP);\n };\n this.dispatchCancelHandler = (ev) => {\n const role = ev.detail.role;\n if (isCancel(role)) {\n const cancelButton = this.buttons.find(b => b.role === 'cancel');\n this.callButtonHandler(cancelButton);\n }\n };\n }\n connectedCallback() {\n prepareOverlay(this.el);\n }\n /**\n * Present the picker overlay after it has been created.\n */\n async present() {\n await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);\n if (this.duration > 0) {\n this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);\n }\n }\n /**\n * Dismiss the picker overlay after it has been presented.\n *\n * @param data Any data to emit in the dismiss events.\n * @param role The role of the element that is dismissing the picker.\n * This can be useful in a button handler for determining which button was\n * clicked to dismiss the picker.\n * Some examples include: ``\"cancel\"`, `\"destructive\"`, \"selected\"`, and `\"backdrop\"`.\n */\n dismiss(data, role) {\n if (this.durationTimeout) {\n clearTimeout(this.durationTimeout);\n }\n return dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);\n }\n /**\n * Returns a promise that resolves when the picker did dismiss.\n */\n onDidDismiss() {\n return eventMethod(this.el, 'ionPickerDidDismiss');\n }\n /**\n * Returns a promise that resolves when the picker will dismiss.\n */\n onWillDismiss() {\n return eventMethod(this.el, 'ionPickerWillDismiss');\n }\n /**\n * Get the column that matches the specified name.\n *\n * @param name The name of the column.\n */\n getColumn(name) {\n return Promise.resolve(this.columns.find(column => column.name === name));\n }\n async buttonClick(button) {\n const role = button.role;\n if (isCancel(role)) {\n return this.dismiss(undefined, role);\n }\n const shouldDismiss = await this.callButtonHandler(button);\n if (shouldDismiss) {\n return this.dismiss(this.getSelected(), button.role);\n }\n return Promise.resolve();\n }\n async callButtonHandler(button) {\n if (button) {\n // a handler has been provided, execute it\n // pass the handler the values from the inputs\n const rtn = await safeCall(button.handler, this.getSelected());\n if (rtn === false) {\n // if the return value of the handler is false then do not dismiss\n return false;\n }\n }\n return true;\n }\n getSelected() {\n const selected = {};\n this.columns.forEach((col, index) => {\n const selectedColumn = col.selectedIndex !== undefined\n ? col.options[col.selectedIndex]\n : undefined;\n selected[col.name] = {\n text: selectedColumn ? selectedColumn.text : undefined,\n value: selectedColumn ? selectedColumn.value : undefined,\n columnIndex: index\n };\n });\n return selected;\n }\n render() {\n const mode = getIonMode(this);\n return (h(Host, { \"aria-modal\": \"true\", tabindex: \"-1\", class: Object.assign({ [mode]: true,\n // Used internally for styling\n [`picker-${mode}`]: true }, getClassMap(this.cssClass)), style: {\n zIndex: `${20000 + this.overlayIndex}`\n }, onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }, h(\"ion-backdrop\", { visible: this.showBackdrop, tappable: this.backdropDismiss }), h(\"div\", { tabindex: \"0\" }), h(\"div\", { class: \"picker-wrapper ion-overlay-wrapper\", role: \"dialog\" }, h(\"div\", { class: \"picker-toolbar\" }, this.buttons.map(b => (h(\"div\", { class: buttonWrapperClass(b) }, h(\"button\", { type: \"button\", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h(\"div\", { class: \"picker-columns\" }, h(\"div\", { class: \"picker-above-highlight\" }), this.presented && this.columns.map(c => h(\"ion-picker-column\", { col: c })), h(\"div\", { class: \"picker-below-highlight\" }))), h(\"div\", { tabindex: \"0\" })));\n }\n get el() { return getElement(this); }\n};\nconst buttonWrapperClass = (button) => {\n return {\n [`picker-toolbar-${button.role}`]: button.role !== undefined,\n 'picker-toolbar-button': true\n };\n};\nconst buttonClass = (button) => {\n return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));\n};\nPicker.style = {\n ios: pickerIosCss,\n md: pickerMdCss\n};\n\nconst pickerColumnIosCss = \".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:4px;padding-right:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}\";\n\nconst pickerColumnMdCss = \".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #3880ff)}\";\n\nconst PickerColumnCmp = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionPickerColChange = createEvent(this, \"ionPickerColChange\", 7);\n this.optHeight = 0;\n this.rotateFactor = 0;\n this.scaleFactor = 1;\n this.velocity = 0;\n this.y = 0;\n this.noAnimate = true;\n }\n colChanged() {\n this.refresh();\n }\n async connectedCallback() {\n let pickerRotateFactor = 0;\n let pickerScaleFactor = 0.81;\n const mode = getIonMode(this);\n if (mode === 'ios') {\n pickerRotateFactor = -0.46;\n pickerScaleFactor = 1;\n }\n this.rotateFactor = pickerRotateFactor;\n this.scaleFactor = pickerScaleFactor;\n this.gesture = (await import('./index-eea61379.js')).createGesture({\n el: this.el,\n gestureName: 'picker-swipe',\n gesturePriority: 100,\n threshold: 0,\n passive: false,\n onStart: ev => this.onStart(ev),\n onMove: ev => this.onMove(ev),\n onEnd: ev => this.onEnd(ev),\n });\n this.gesture.enable();\n this.tmrId = setTimeout(() => {\n this.noAnimate = false;\n this.refresh(true);\n }, 250);\n }\n componentDidLoad() {\n const colEl = this.optsEl;\n if (colEl) {\n // DOM READ\n // We perfom a DOM read over a rendered item, this needs to happen after the first render\n this.optHeight = (colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0);\n }\n this.refresh();\n }\n disconnectedCallback() {\n cancelAnimationFrame(this.rafId);\n clearTimeout(this.tmrId);\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n }\n emitColChange() {\n this.ionPickerColChange.emit(this.col);\n }\n setSelected(selectedIndex, duration) {\n // if there is a selected index, then figure out it's y position\n // if there isn't a selected index, then just use the top y position\n const y = (selectedIndex > -1) ? -(selectedIndex * this.optHeight) : 0;\n this.velocity = 0;\n // set what y position we're at\n cancelAnimationFrame(this.rafId);\n this.update(y, duration, true);\n this.emitColChange();\n }\n update(y, duration, saveY) {\n if (!this.optsEl) {\n return;\n }\n // ensure we've got a good round number :)\n let translateY = 0;\n let translateZ = 0;\n const { col, rotateFactor } = this;\n const selectedIndex = col.selectedIndex = this.indexForY(-y);\n const durationStr = (duration === 0) ? '' : duration + 'ms';\n const scaleStr = `scale(${this.scaleFactor})`;\n const children = this.optsEl.children;\n for (let i = 0; i < children.length; i++) {\n const button = children[i];\n const opt = col.options[i];\n const optOffset = (i * this.optHeight) + y;\n let transform = '';\n if (rotateFactor !== 0) {\n const rotateX = optOffset * rotateFactor;\n if (Math.abs(rotateX) <= 90) {\n translateY = 0;\n translateZ = 90;\n transform = `rotateX(${rotateX}deg) `;\n }\n else {\n translateY = -9999;\n }\n }\n else {\n translateZ = 0;\n translateY = optOffset;\n }\n const selected = selectedIndex === i;\n transform += `translate3d(0px,${translateY}px,${translateZ}px) `;\n if (this.scaleFactor !== 1 && !selected) {\n transform += scaleStr;\n }\n // Update transition duration\n if (this.noAnimate) {\n opt.duration = 0;\n button.style.transitionDuration = '';\n }\n else if (duration !== opt.duration) {\n opt.duration = duration;\n button.style.transitionDuration = durationStr;\n }\n // Update transform\n if (transform !== opt.transform) {\n opt.transform = transform;\n button.style.transform = transform;\n }\n // Update selected item\n if (selected !== opt.selected) {\n opt.selected = selected;\n if (selected) {\n button.classList.add(PICKER_OPT_SELECTED);\n }\n else {\n button.classList.remove(PICKER_OPT_SELECTED);\n }\n }\n }\n this.col.prevSelected = selectedIndex;\n if (saveY) {\n this.y = y;\n }\n if (this.lastIndex !== selectedIndex) {\n // have not set a last index yet\n hapticSelectionChanged();\n this.lastIndex = selectedIndex;\n }\n }\n decelerate() {\n if (this.velocity !== 0) {\n // still decelerating\n this.velocity *= DECELERATION_FRICTION;\n // do not let it go slower than a velocity of 1\n this.velocity = (this.velocity > 0)\n ? Math.max(this.velocity, 1)\n : Math.min(this.velocity, -1);\n let y = this.y + this.velocity;\n if (y > this.minY) {\n // whoops, it's trying to scroll up farther than the options we have!\n y = this.minY;\n this.velocity = 0;\n }\n else if (y < this.maxY) {\n // gahh, it's trying to scroll down farther than we can!\n y = this.maxY;\n this.velocity = 0;\n }\n this.update(y, 0, true);\n const notLockedIn = (Math.round(y) % this.optHeight !== 0) || (Math.abs(this.velocity) > 1);\n if (notLockedIn) {\n // isn't locked in yet, keep decelerating until it is\n this.rafId = requestAnimationFrame(() => this.decelerate());\n }\n else {\n this.velocity = 0;\n this.emitColChange();\n hapticSelectionEnd();\n }\n }\n else if (this.y % this.optHeight !== 0) {\n // needs to still get locked into a position so options line up\n const currentPos = Math.abs(this.y % this.optHeight);\n // create a velocity in the direction it needs to scroll\n this.velocity = (currentPos > (this.optHeight / 2) ? 1 : -1);\n this.decelerate();\n }\n }\n indexForY(y) {\n return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);\n }\n // TODO should this check disabled?\n onStart(detail) {\n // We have to prevent default in order to block scrolling under the picker\n // but we DO NOT have to stop propagation, since we still want\n // some \"click\" events to capture\n if (detail.event.cancelable) {\n detail.event.preventDefault();\n }\n detail.event.stopPropagation();\n hapticSelectionStart();\n // reset everything\n cancelAnimationFrame(this.rafId);\n const options = this.col.options;\n let minY = (options.length - 1);\n let maxY = 0;\n for (let i = 0; i < options.length; i++) {\n if (!options[i].disabled) {\n minY = Math.min(minY, i);\n maxY = Math.max(maxY, i);\n }\n }\n this.minY = -(minY * this.optHeight);\n this.maxY = -(maxY * this.optHeight);\n }\n onMove(detail) {\n if (detail.event.cancelable) {\n detail.event.preventDefault();\n }\n detail.event.stopPropagation();\n // update the scroll position relative to pointer start position\n let y = this.y + detail.deltaY;\n if (y > this.minY) {\n // scrolling up higher than scroll area\n y = Math.pow(y, 0.8);\n this.bounceFrom = y;\n }\n else if (y < this.maxY) {\n // scrolling down below scroll area\n y += Math.pow(this.maxY - y, 0.9);\n this.bounceFrom = y;\n }\n else {\n this.bounceFrom = 0;\n }\n this.update(y, 0, false);\n }\n onEnd(detail) {\n if (this.bounceFrom > 0) {\n // bounce back up\n this.update(this.minY, 100, true);\n this.emitColChange();\n return;\n }\n else if (this.bounceFrom < 0) {\n // bounce back down\n this.update(this.maxY, 100, true);\n this.emitColChange();\n return;\n }\n this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);\n if (this.velocity === 0 && detail.deltaY === 0) {\n const opt = detail.event.target.closest('.picker-opt');\n if (opt && opt.hasAttribute('opt-index')) {\n this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);\n }\n }\n else {\n this.y += detail.deltaY;\n if (Math.abs(detail.velocityY) < 0.05) {\n const isScrollingUp = detail.deltaY > 0;\n const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;\n if (isScrollingUp && optHeightFraction > 0.5) {\n this.velocity = Math.abs(this.velocity) * -1;\n }\n else if (!isScrollingUp && optHeightFraction <= 0.5) {\n this.velocity = Math.abs(this.velocity);\n }\n }\n this.decelerate();\n }\n }\n refresh(forceRefresh) {\n let min = this.col.options.length - 1;\n let max = 0;\n const options = this.col.options;\n for (let i = 0; i < options.length; i++) {\n if (!options[i].disabled) {\n min = Math.min(min, i);\n max = Math.max(max, i);\n }\n }\n /**\n * Only update selected value if column has a\n * velocity of 0. If it does not, then the\n * column is animating might land on\n * a value different than the value at\n * selectedIndex\n */\n if (this.velocity !== 0) {\n return;\n }\n const selectedIndex = clamp(min, this.col.selectedIndex || 0, max);\n if (this.col.prevSelected !== selectedIndex || forceRefresh) {\n const y = (selectedIndex * this.optHeight) * -1;\n this.velocity = 0;\n this.update(y, TRANSITION_DURATION, true);\n }\n }\n render() {\n const col = this.col;\n const Button = 'button';\n const mode = getIonMode(this);\n return (h(Host, { class: {\n [mode]: true,\n 'picker-col': true,\n 'picker-opts-left': this.col.align === 'left',\n 'picker-opts-right': this.col.align === 'right'\n }, style: {\n 'max-width': this.col.columnWidth\n } }, col.prefix && (h(\"div\", { class: \"picker-prefix\", style: { width: col.prefixWidth } }, col.prefix)), h(\"div\", { class: \"picker-opts\", style: { maxWidth: col.optionsWidth }, ref: el => this.optsEl = el }, col.options.map((o, index) => h(Button, { type: \"button\", class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, \"opt-index\": index }, o.text))), col.suffix && (h(\"div\", { class: \"picker-suffix\", style: { width: col.suffixWidth } }, col.suffix))));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"col\": [\"colChanged\"]\n }; }\n};\nconst PICKER_OPT_SELECTED = 'picker-opt-selected';\nconst DECELERATION_FRICTION = 0.97;\nconst MAX_PICKER_SPEED = 90;\nconst TRANSITION_DURATION = 150;\nPickerColumnCmp.style = {\n ios: pickerColumnIosCss,\n md: pickerColumnMdCss\n};\n\nexport { Datetime as ion_datetime, Picker as ion_picker, PickerColumnCmp as ion_picker_column };\n"]} |