picker.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
  5. import { g as getElementRoot } from './helpers.js';
  6. const pickerIosCss = ":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}:host .picker-before,:host .picker-after{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}:host .picker-before{top:0;height:83px}:host .picker-before{inset-inline-start:0}:host .picker-after{top:116px;height:84px}:host .picker-after{inset-inline-start:0}:host .picker-highlight{border-radius:var(--highlight-border-radius, 8px);left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--highlight-background);z-index:-1}:host input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host ::slotted(ion-picker-column:first-of-type){text-align:start}:host ::slotted(ion-picker-column:last-of-type){text-align:end}:host ::slotted(ion-picker-column:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to bottom, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}:host .picker-after{background:-webkit-gradient(linear, left bottom, left top, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to top, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}:host .picker-highlight{background:var(--highlight-background, var(--ion-color-step-150, var(--ion-background-color-step-150, #eeeeef)))}";
  7. const IonPickerIosStyle0 = pickerIosCss;
  8. const pickerMdCss = ":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}:host .picker-before,:host .picker-after{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}:host .picker-before{top:0;height:83px}:host .picker-before{inset-inline-start:0}:host .picker-after{top:116px;height:84px}:host .picker-after{inset-inline-start:0}:host .picker-highlight{border-radius:var(--highlight-border-radius, 8px);left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--highlight-background);z-index:-1}:host input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host ::slotted(ion-picker-column:first-of-type){text-align:start}:host ::slotted(ion-picker-column:last-of-type){text-align:end}:host ::slotted(ion-picker-column:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to bottom, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}:host .picker-after{background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to top, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 30%, rgba(var(--fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}";
  9. const IonPickerMdStyle0 = pickerMdCss;
  10. const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement {
  11. constructor() {
  12. super();
  13. this.__registerHost();
  14. this.__attachShadow();
  15. this.ionInputModeChange = createEvent(this, "ionInputModeChange", 7);
  16. this.useInputMode = false;
  17. this.isInHighlightBounds = (ev) => {
  18. const { highlightEl } = this;
  19. if (!highlightEl) {
  20. return false;
  21. }
  22. const bbox = highlightEl.getBoundingClientRect();
  23. /**
  24. * Check to see if the user clicked
  25. * outside the bounds of the highlight.
  26. */
  27. const outsideX = ev.clientX < bbox.left || ev.clientX > bbox.right;
  28. const outsideY = ev.clientY < bbox.top || ev.clientY > bbox.bottom;
  29. if (outsideX || outsideY) {
  30. return false;
  31. }
  32. return true;
  33. };
  34. /**
  35. * If we are no longer focused
  36. * on a picker column, then we should
  37. * exit input mode. An exception is made
  38. * for the input in the picker since having
  39. * that focused means we are still in input mode.
  40. */
  41. this.onFocusOut = (ev) => {
  42. // TODO(FW-2832): type
  43. const { relatedTarget } = ev;
  44. if (!relatedTarget || (relatedTarget.tagName !== 'ION-PICKER-COLUMN' && relatedTarget !== this.inputEl)) {
  45. this.exitInputMode();
  46. }
  47. };
  48. /**
  49. * When picker columns receive focus
  50. * the parent picker needs to determine
  51. * whether to enter/exit input mode.
  52. */
  53. this.onFocusIn = (ev) => {
  54. // TODO(FW-2832): type
  55. const { target } = ev;
  56. /**
  57. * Due to browser differences in how/when focus
  58. * is dispatched on certain elements, we need to
  59. * make sure that this function only ever runs when
  60. * focusing a picker column.
  61. */
  62. if (target.tagName !== 'ION-PICKER-COLUMN') {
  63. return;
  64. }
  65. /**
  66. * If we have actionOnClick
  67. * then this means the user focused
  68. * a picker column via mouse or
  69. * touch (i.e. a PointerEvent). As a result,
  70. * we should not enter/exit input mode
  71. * until the click event has fired, which happens
  72. * after the `focusin` event.
  73. *
  74. * Otherwise, the user likely focused
  75. * the column using their keyboard and
  76. * we should enter/exit input mode automatically.
  77. */
  78. if (!this.actionOnClick) {
  79. const columnEl = target;
  80. const allowInput = columnEl.numericInput;
  81. if (allowInput) {
  82. this.enterInputMode(columnEl, false);
  83. }
  84. else {
  85. this.exitInputMode();
  86. }
  87. }
  88. };
  89. /**
  90. * On click we need to run an actionOnClick
  91. * function that has been set in onPointerDown
  92. * so that we enter/exit input mode correctly.
  93. */
  94. this.onClick = () => {
  95. const { actionOnClick } = this;
  96. if (actionOnClick) {
  97. actionOnClick();
  98. this.actionOnClick = undefined;
  99. }
  100. };
  101. /**
  102. * Clicking a column also focuses the column on
  103. * certain browsers, so we use onPointerDown
  104. * to tell the onFocusIn function that users
  105. * are trying to click the column rather than
  106. * focus the column using the keyboard. When the
  107. * user completes the click, the onClick function
  108. * runs and runs the actionOnClick callback.
  109. */
  110. this.onPointerDown = (ev) => {
  111. const { useInputMode, inputModeColumn, el } = this;
  112. if (this.isInHighlightBounds(ev)) {
  113. /**
  114. * If we were already in
  115. * input mode, then we should determine
  116. * if we tapped a particular column and
  117. * should switch to input mode for
  118. * that specific column.
  119. */
  120. if (useInputMode) {
  121. /**
  122. * If we tapped a picker column
  123. * then we should either switch to input
  124. * mode for that column or all columns.
  125. * Otherwise we should exit input mode
  126. * since we just tapped the highlight and
  127. * not a column.
  128. */
  129. if (ev.target.tagName === 'ION-PICKER-COLUMN') {
  130. /**
  131. * If user taps 2 different columns
  132. * then we should just switch to input mode
  133. * for the new column rather than switching to
  134. * input mode for all columns.
  135. */
  136. if (inputModeColumn && inputModeColumn === ev.target) {
  137. this.actionOnClick = () => {
  138. this.enterInputMode();
  139. };
  140. }
  141. else {
  142. this.actionOnClick = () => {
  143. this.enterInputMode(ev.target);
  144. };
  145. }
  146. }
  147. else {
  148. this.actionOnClick = () => {
  149. this.exitInputMode();
  150. };
  151. }
  152. /**
  153. * If we were not already in
  154. * input mode, then we should
  155. * enter input mode for all columns.
  156. */
  157. }
  158. else {
  159. /**
  160. * If there is only 1 numeric input column
  161. * then we should skip multi column input.
  162. */
  163. const columns = el.querySelectorAll('ion-picker-column.picker-column-numeric-input');
  164. const columnEl = columns.length === 1 ? ev.target : undefined;
  165. this.actionOnClick = () => {
  166. this.enterInputMode(columnEl);
  167. };
  168. }
  169. return;
  170. }
  171. this.actionOnClick = () => {
  172. this.exitInputMode();
  173. };
  174. };
  175. /**
  176. * Enters input mode to allow
  177. * for text entry of numeric values.
  178. * If on mobile, we focus a hidden input
  179. * field so that the on screen keyboard
  180. * is brought up. When tabbing using a
  181. * keyboard, picker columns receive an outline
  182. * to indicate they are focused. As a result,
  183. * we should not focus the hidden input as it
  184. * would cause the outline to go away, preventing
  185. * users from having any visual indication of which
  186. * column is focused.
  187. */
  188. this.enterInputMode = (columnEl, focusInput = true) => {
  189. const { inputEl, el } = this;
  190. if (!inputEl) {
  191. return;
  192. }
  193. /**
  194. * Only active input mode if there is at
  195. * least one column that accepts numeric input.
  196. */
  197. const hasInputColumn = el.querySelector('ion-picker-column.picker-column-numeric-input');
  198. if (!hasInputColumn) {
  199. return;
  200. }
  201. /**
  202. * If columnEl is undefined then
  203. * it is assumed that all numeric pickers
  204. * are eligible for text entry.
  205. * (i.e. hour and minute columns)
  206. */
  207. this.useInputMode = true;
  208. this.inputModeColumn = columnEl;
  209. /**
  210. * Users with a keyboard and mouse can
  211. * activate input mode where the input is
  212. * focused as well as when it is not focused,
  213. * so we need to make sure we clean up any
  214. * old listeners.
  215. */
  216. if (focusInput) {
  217. if (this.destroyKeypressListener) {
  218. this.destroyKeypressListener();
  219. this.destroyKeypressListener = undefined;
  220. }
  221. inputEl.focus();
  222. }
  223. else {
  224. // TODO FW-5900 Use keydown instead
  225. el.addEventListener('keypress', this.onKeyPress);
  226. this.destroyKeypressListener = () => {
  227. el.removeEventListener('keypress', this.onKeyPress);
  228. };
  229. }
  230. this.emitInputModeChange();
  231. };
  232. this.onKeyPress = (ev) => {
  233. const { inputEl } = this;
  234. if (!inputEl) {
  235. return;
  236. }
  237. const parsedValue = parseInt(ev.key, 10);
  238. /**
  239. * Only numbers should be allowed
  240. */
  241. if (!Number.isNaN(parsedValue)) {
  242. inputEl.value += ev.key;
  243. this.onInputChange();
  244. }
  245. };
  246. this.selectSingleColumn = () => {
  247. const { inputEl, inputModeColumn, singleColumnSearchTimeout } = this;
  248. if (!inputEl || !inputModeColumn) {
  249. return;
  250. }
  251. const options = Array.from(inputModeColumn.querySelectorAll('ion-picker-column-option')).filter((el) => el.disabled !== true);
  252. /**
  253. * If users pause for a bit, the search
  254. * value should be reset similar to how a
  255. * <select> behaves. So typing "34", waiting,
  256. * then typing "5" should select "05".
  257. */
  258. if (singleColumnSearchTimeout) {
  259. clearTimeout(singleColumnSearchTimeout);
  260. }
  261. this.singleColumnSearchTimeout = setTimeout(() => {
  262. inputEl.value = '';
  263. this.singleColumnSearchTimeout = undefined;
  264. }, 1000);
  265. /**
  266. * For values that are longer than 2 digits long
  267. * we should shift the value over 1 character
  268. * to the left. So typing "456" would result in "56".
  269. * TODO: If we want to support more than just
  270. * time entry, we should update this value to be
  271. * the max length of all of the picker items.
  272. */
  273. if (inputEl.value.length >= 3) {
  274. const startIndex = inputEl.value.length - 2;
  275. const newString = inputEl.value.substring(startIndex);
  276. inputEl.value = newString;
  277. this.selectSingleColumn();
  278. return;
  279. }
  280. /**
  281. * Checking the value of the input gets priority
  282. * first. For example, if the value of the input
  283. * is "1" and we entered "2", then the complete value
  284. * is "12" and we should select hour 12.
  285. *
  286. * Regex removes any leading zeros from values like "02",
  287. * but it keeps a single zero if there are only zeros in the string.
  288. * 0+(?=[1-9]) --> Match 1 or more zeros that are followed by 1-9
  289. * 0+(?=0$) --> Match 1 or more zeros that must be followed by one 0 and end.
  290. */
  291. const findItemFromCompleteValue = options.find(({ textContent }) => {
  292. /**
  293. * Keyboard entry is currently only used inside of Datetime
  294. * where we guarantee textContent is set.
  295. * If we end up exposing this feature publicly we should revisit this assumption.
  296. */
  297. const parsedText = textContent.replace(/^0+(?=[1-9])|0+(?=0$)/, '');
  298. return parsedText === inputEl.value;
  299. });
  300. if (findItemFromCompleteValue) {
  301. inputModeColumn.setValue(findItemFromCompleteValue.value);
  302. return;
  303. }
  304. /**
  305. * If we typed "56" to get minute 56, then typed "7",
  306. * we should select "07" as "567" is not a valid minute.
  307. */
  308. if (inputEl.value.length === 2) {
  309. const changedCharacter = inputEl.value.substring(inputEl.value.length - 1);
  310. inputEl.value = changedCharacter;
  311. this.selectSingleColumn();
  312. }
  313. };
  314. /**
  315. * Searches a list of column items for a particular
  316. * value. This is currently used for numeric values.
  317. * The zeroBehavior can be set to account for leading
  318. * or trailing zeros when looking at the item text.
  319. */
  320. this.searchColumn = (colEl, value, zeroBehavior = 'start') => {
  321. if (!value) {
  322. return false;
  323. }
  324. const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
  325. value = value.replace(behavior, '');
  326. const option = Array.from(colEl.querySelectorAll('ion-picker-column-option')).find((el) => {
  327. return el.disabled !== true && el.textContent.replace(behavior, '') === value;
  328. });
  329. if (option) {
  330. colEl.setValue(option.value);
  331. }
  332. return !!option;
  333. };
  334. /**
  335. * Attempts to intelligently search the first and second
  336. * column as if they're number columns for the provided numbers
  337. * where the first two numbers are the first column
  338. * and the last 2 are the last column. Tries to allow for the first
  339. * number to be ignored for situations where typos occurred.
  340. */
  341. this.multiColumnSearch = (firstColumn, secondColumn, input) => {
  342. if (input.length === 0) {
  343. return;
  344. }
  345. const inputArray = input.split('');
  346. const hourValue = inputArray.slice(0, 2).join('');
  347. // Try to find a match for the first two digits in the first column
  348. const foundHour = this.searchColumn(firstColumn, hourValue);
  349. // If we have more than 2 digits and found a match for hours,
  350. // use the remaining digits for the second column (minutes)
  351. if (inputArray.length > 2 && foundHour) {
  352. const minuteValue = inputArray.slice(2, 4).join('');
  353. this.searchColumn(secondColumn, minuteValue);
  354. }
  355. // If we couldn't find a match for the two-digit hour, try single digit approaches
  356. else if (!foundHour && inputArray.length >= 1) {
  357. // First try the first digit as a single-digit hour
  358. let singleDigitHour = inputArray[0];
  359. let singleDigitFound = this.searchColumn(firstColumn, singleDigitHour);
  360. // If that didn't work, try the second digit as a single-digit hour
  361. // (handles case where user made a typo in the first digit, or they typed over themselves)
  362. if (!singleDigitFound) {
  363. inputArray.shift();
  364. singleDigitHour = inputArray[0];
  365. singleDigitFound = this.searchColumn(firstColumn, singleDigitHour);
  366. }
  367. // If we found a single-digit hour and have remaining digits,
  368. // use up to 2 of the remaining digits for the second column
  369. if (singleDigitFound && inputArray.length > 1) {
  370. const remainingDigits = inputArray.slice(1, 3).join('');
  371. this.searchColumn(secondColumn, remainingDigits);
  372. }
  373. }
  374. };
  375. this.selectMultiColumn = () => {
  376. const { inputEl, el } = this;
  377. if (!inputEl) {
  378. return;
  379. }
  380. const numericPickers = Array.from(el.querySelectorAll('ion-picker-column')).filter((col) => col.numericInput);
  381. const firstColumn = numericPickers[0];
  382. const lastColumn = numericPickers[1];
  383. let value = inputEl.value;
  384. if (value.length > 4) {
  385. const startIndex = inputEl.value.length - 4;
  386. const newString = inputEl.value.substring(startIndex);
  387. inputEl.value = newString;
  388. value = newString;
  389. }
  390. this.multiColumnSearch(firstColumn, lastColumn, value);
  391. };
  392. /**
  393. * Searches the value of the active column
  394. * to determine which value users are trying
  395. * to select
  396. */
  397. this.onInputChange = () => {
  398. const { useInputMode, inputEl, inputModeColumn } = this;
  399. if (!useInputMode || !inputEl) {
  400. return;
  401. }
  402. if (inputModeColumn) {
  403. this.selectSingleColumn();
  404. }
  405. else {
  406. this.selectMultiColumn();
  407. }
  408. };
  409. /**
  410. * Emit ionInputModeChange. Picker columns
  411. * listen for this event to determine whether
  412. * or not their column is "active" for text input.
  413. */
  414. this.emitInputModeChange = () => {
  415. const { useInputMode, inputModeColumn } = this;
  416. this.ionInputModeChange.emit({
  417. useInputMode,
  418. inputModeColumn,
  419. });
  420. };
  421. }
  422. /**
  423. * When the picker is interacted with
  424. * we need to prevent touchstart so other
  425. * gestures do not fire. For example,
  426. * scrolling on the wheel picker
  427. * in ion-datetime should not cause
  428. * a card modal to swipe to close.
  429. */
  430. preventTouchStartPropagation(ev) {
  431. ev.stopPropagation();
  432. }
  433. componentWillLoad() {
  434. getElementRoot(this.el).addEventListener('focusin', this.onFocusIn);
  435. getElementRoot(this.el).addEventListener('focusout', this.onFocusOut);
  436. }
  437. /**
  438. * @internal
  439. * Exits text entry mode for the picker
  440. * This method blurs the hidden input
  441. * and cause the keyboard to dismiss.
  442. */
  443. async exitInputMode() {
  444. const { inputEl, useInputMode } = this;
  445. if (!useInputMode || !inputEl) {
  446. return;
  447. }
  448. this.useInputMode = false;
  449. this.inputModeColumn = undefined;
  450. inputEl.blur();
  451. inputEl.value = '';
  452. if (this.destroyKeypressListener) {
  453. this.destroyKeypressListener();
  454. this.destroyKeypressListener = undefined;
  455. }
  456. this.emitInputModeChange();
  457. }
  458. render() {
  459. return (h(Host, { key: '28f81e4ed44a633178561757c5199c2c98f94b74', onPointerDown: (ev) => this.onPointerDown(ev), onClick: () => this.onClick() }, h("input", { key: 'abb3d1ad25ef63856af7804111175a4d50008bc0', "aria-hidden": "true", tabindex: -1, inputmode: "numeric", type: "number", onKeyDown: (ev) => {
  460. var _a;
  461. /**
  462. * The "Enter" key represents
  463. * the user submitting their time
  464. * selection, so we should blur the
  465. * input (and therefore close the keyboard)
  466. *
  467. * Updating the picker's state to no longer
  468. * be in input mode is handled in the onBlur
  469. * callback below.
  470. */
  471. if (ev.key === 'Enter') {
  472. (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.blur();
  473. }
  474. }, ref: (el) => (this.inputEl = el), onInput: () => this.onInputChange(), onBlur: () => this.exitInputMode() }), h("div", { key: '334a5abdc02e6b127c57177f626d7e4ff5526183', class: "picker-before" }), h("div", { key: 'ffd6271931129e88fc7c820e919d684899e420c5', class: "picker-after" }), h("div", { key: '78d1d95fd09e04f154ea59f24a1cece72c47ed7b', class: "picker-highlight", ref: (el) => (this.highlightEl = el) }), h("slot", { key: '0bd5b9f875d3c71f6cbbde2054baeb1b0a2e8cd5' })));
  475. }
  476. get el() { return this; }
  477. static get style() { return {
  478. ios: IonPickerIosStyle0,
  479. md: IonPickerMdStyle0
  480. }; }
  481. }, [33, "ion-picker", {
  482. "exitInputMode": [64]
  483. }, [[1, "touchstart", "preventTouchStartPropagation"]]]);
  484. function defineCustomElement() {
  485. if (typeof customElements === "undefined") {
  486. return;
  487. }
  488. const components = ["ion-picker"];
  489. components.forEach(tagName => { switch (tagName) {
  490. case "ion-picker":
  491. if (!customElements.get(tagName)) {
  492. customElements.define(tagName, Picker);
  493. }
  494. break;
  495. } });
  496. }
  497. export { Picker as P, defineCustomElement as d };