ion-picker.cjs.entry.js 25 KB

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