ion-picker-column.cjs.entry.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  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 index$1 = require('./index-c8d52405.js');
  8. const helpers = require('./helpers-8a48fdea.js');
  9. const haptic = require('./haptic-f6b37aa3.js');
  10. const ionicGlobal = require('./ionic-global-6dea5a96.js');
  11. const theme = require('./theme-d1c573d2.js');
  12. require('./index-cc858e97.js');
  13. require('./capacitor-c04564bf.js');
  14. const pickerColumnCss = ":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;height:200px;font-size:22px;text-align:center}.assistive-focusable{left:0;right:0;top:0;bottom:0;position:absolute;z-index:1;pointer-events:none}.assistive-focusable:focus{outline:none}.picker-opts{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-width:26px;max-height:200px;outline:none;text-align:inherit;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none}.picker-item-empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.picker-opts::-webkit-scrollbar{display:none}::slotted(ion-picker-column-option){display:block;scroll-snap-align:center}.picker-item-empty,:host(:not([disabled])) ::slotted(ion-picker-column-option.option-disabled){scroll-snap-align:none}::slotted([slot=prefix]),::slotted([slot=suffix]){max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}::slotted([slot=prefix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:end;justify-content:end}::slotted([slot=suffix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:start;justify-content:start}:host(.picker-column-disabled) .picker-opts{overflow-y:hidden}:host(.picker-column-disabled) ::slotted(ion-picker-column-option){cursor:default;opacity:0.4;pointer-events:none}@media (any-hover: hover){:host(:focus) .picker-opts{outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}";
  15. const IonPickerColumnStyle0 = pickerColumnCss;
  16. const PickerColumn = class {
  17. constructor(hostRef) {
  18. index.registerInstance(this, hostRef);
  19. this.ionChange = index.createEvent(this, "ionChange", 7);
  20. this.isScrolling = false;
  21. this.isColumnVisible = false;
  22. this.canExitInputMode = true;
  23. this.updateValueTextOnScroll = false;
  24. this.centerPickerItemInView = (target, smooth = true, canExitInputMode = true) => {
  25. const { isColumnVisible, scrollEl } = this;
  26. if (isColumnVisible && scrollEl) {
  27. // (Vertical offset from parent) - (three empty picker rows) + (half the height of the target to ensure the scroll triggers)
  28. const top = target.offsetTop - 3 * target.clientHeight + target.clientHeight / 2;
  29. if (scrollEl.scrollTop !== top) {
  30. /**
  31. * Setting this flag prevents input
  32. * mode from exiting in the picker column's
  33. * scroll callback. This is useful when the user manually
  34. * taps an item or types on the keyboard as both
  35. * of these can cause a scroll to occur.
  36. */
  37. this.canExitInputMode = canExitInputMode;
  38. this.updateValueTextOnScroll = false;
  39. scrollEl.scroll({
  40. top,
  41. left: 0,
  42. behavior: smooth ? 'smooth' : undefined,
  43. });
  44. }
  45. }
  46. };
  47. this.setPickerItemActiveState = (item, isActive) => {
  48. if (isActive) {
  49. item.classList.add(PICKER_ITEM_ACTIVE_CLASS);
  50. }
  51. else {
  52. item.classList.remove(PICKER_ITEM_ACTIVE_CLASS);
  53. }
  54. };
  55. /**
  56. * When ionInputModeChange is emitted, each column
  57. * needs to check if it is the one being made available
  58. * for text entry.
  59. */
  60. this.inputModeChange = (ev) => {
  61. if (!this.numericInput) {
  62. return;
  63. }
  64. const { useInputMode, inputModeColumn } = ev.detail;
  65. /**
  66. * If inputModeColumn is undefined then this means
  67. * all numericInput columns are being selected.
  68. */
  69. const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
  70. if (!useInputMode || !isColumnActive) {
  71. this.setInputModeActive(false);
  72. return;
  73. }
  74. this.setInputModeActive(true);
  75. };
  76. /**
  77. * Setting isActive will cause a re-render.
  78. * As a result, we do not want to cause the
  79. * re-render mid scroll as this will cause
  80. * the picker column to jump back to
  81. * whatever value was selected at the
  82. * start of the scroll interaction.
  83. */
  84. this.setInputModeActive = (state) => {
  85. if (this.isScrolling) {
  86. this.scrollEndCallback = () => {
  87. this.isActive = state;
  88. };
  89. return;
  90. }
  91. this.isActive = state;
  92. };
  93. /**
  94. * When the column scrolls, the component
  95. * needs to determine which item is centered
  96. * in the view and will emit an ionChange with
  97. * the item object.
  98. */
  99. this.initializeScrollListener = () => {
  100. /**
  101. * The haptics for the wheel picker are
  102. * an iOS-only feature. As a result, they should
  103. * be disabled on Android.
  104. */
  105. const enableHaptics = ionicGlobal.isPlatform('ios');
  106. const { el, scrollEl } = this;
  107. let timeout;
  108. let activeEl = this.activeItem;
  109. const scrollCallback = () => {
  110. helpers.raf(() => {
  111. var _a;
  112. if (!scrollEl)
  113. return;
  114. if (timeout) {
  115. clearTimeout(timeout);
  116. timeout = undefined;
  117. }
  118. if (!this.isScrolling) {
  119. enableHaptics && haptic.hapticSelectionStart();
  120. this.isScrolling = true;
  121. }
  122. /**
  123. * Select item in the center of the column
  124. * which is the month/year that we want to select
  125. */
  126. const bbox = scrollEl.getBoundingClientRect();
  127. const centerX = bbox.x + bbox.width / 2;
  128. const centerY = bbox.y + bbox.height / 2;
  129. /**
  130. * elementFromPoint returns the top-most element.
  131. * This means that if an ion-backdrop is overlaying the
  132. * picker then the appropriate picker column option will
  133. * not be selected. To account for this, we use elementsFromPoint
  134. * and use an Array.find to find the appropriate column option
  135. * at that point.
  136. *
  137. * Additionally, the picker column could be used in the
  138. * Shadow DOM (i.e. in ion-datetime) so we need to make
  139. * sure we are choosing the correct host otherwise
  140. * the elements returns by elementsFromPoint will be
  141. * retargeted. To account for this, we check to see
  142. * if the picker column has a parent shadow root. If
  143. * so, we use that shadow root when doing elementsFromPoint.
  144. * Otherwise, we just use the document.
  145. */
  146. const rootNode = el.getRootNode();
  147. const hasParentShadow = rootNode instanceof ShadowRoot;
  148. const referenceNode = hasParentShadow ? rootNode : index$1.doc;
  149. /**
  150. * If the reference node is undefined
  151. * then it's likely that doc is undefined
  152. * due to being in an SSR environment.
  153. */
  154. if (referenceNode === undefined) {
  155. return;
  156. }
  157. const elementsAtPoint = referenceNode.elementsFromPoint(centerX, centerY);
  158. /**
  159. * elementsFromPoint can returns multiple elements
  160. * so find the relevant picker column option if one exists.
  161. */
  162. const newActiveElement = elementsAtPoint.find((el) => el.tagName === 'ION-PICKER-COLUMN-OPTION');
  163. if (activeEl !== undefined) {
  164. this.setPickerItemActiveState(activeEl, false);
  165. }
  166. if (newActiveElement === undefined || newActiveElement.disabled) {
  167. return;
  168. }
  169. /**
  170. * If we are selecting a new value,
  171. * we need to run haptics again.
  172. */
  173. if (newActiveElement !== activeEl) {
  174. enableHaptics && haptic.hapticSelectionChanged();
  175. if (this.canExitInputMode) {
  176. /**
  177. * The native iOS wheel picker
  178. * only dismisses the keyboard
  179. * once the selected item has changed
  180. * as a result of a swipe
  181. * from the user. If `canExitInputMode` is
  182. * `false` then this means that the
  183. * scroll is happening as a result of
  184. * the `value` property programmatically changing
  185. * either by an application or by the user via the keyboard.
  186. */
  187. this.exitInputMode();
  188. }
  189. }
  190. activeEl = newActiveElement;
  191. this.setPickerItemActiveState(newActiveElement, true);
  192. /**
  193. * Set the aria-valuetext even though the value prop has not been updated yet.
  194. * This enables some screen readers to announce the value as the users drag
  195. * as opposed to when their release their pointer from the screen.
  196. *
  197. * When the value is programmatically updated, we will smoothly scroll
  198. * to the new option. However, we do not want to update aria-valuetext mid-scroll
  199. * as that can cause the old value to be briefly set before being set to the
  200. * correct option. This will cause some screen readers to announce the old value
  201. * again before announcing the new value. The correct valuetext will be set on render.
  202. */
  203. if (this.updateValueTextOnScroll) {
  204. (_a = this.assistiveFocusable) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-valuetext', this.getOptionValueText(newActiveElement));
  205. }
  206. timeout = setTimeout(() => {
  207. this.isScrolling = false;
  208. this.updateValueTextOnScroll = true;
  209. enableHaptics && haptic.hapticSelectionEnd();
  210. /**
  211. * Certain tasks (such as those that
  212. * cause re-renders) should only be done
  213. * once scrolling has finished, otherwise
  214. * flickering may occur.
  215. */
  216. const { scrollEndCallback } = this;
  217. if (scrollEndCallback) {
  218. scrollEndCallback();
  219. this.scrollEndCallback = undefined;
  220. }
  221. /**
  222. * Reset this flag as the
  223. * next scroll interaction could
  224. * be a scroll from the user. In this
  225. * case, we should exit input mode.
  226. */
  227. this.canExitInputMode = true;
  228. this.setValue(newActiveElement.value);
  229. }, 250);
  230. });
  231. };
  232. /**
  233. * Wrap this in an raf so that the scroll callback
  234. * does not fire when component is initially shown.
  235. */
  236. helpers.raf(() => {
  237. if (!scrollEl)
  238. return;
  239. scrollEl.addEventListener('scroll', scrollCallback);
  240. this.destroyScrollListener = () => {
  241. scrollEl.removeEventListener('scroll', scrollCallback);
  242. };
  243. });
  244. };
  245. /**
  246. * Tells the parent picker to
  247. * exit text entry mode. This is only called
  248. * when the selected item changes during scroll, so
  249. * we know that the user likely wants to scroll
  250. * instead of type.
  251. */
  252. this.exitInputMode = () => {
  253. const { parentEl } = this;
  254. if (parentEl == null)
  255. return;
  256. parentEl.exitInputMode();
  257. /**
  258. * setInputModeActive only takes
  259. * effect once scrolling stops to avoid
  260. * a component re-render while scrolling.
  261. * However, we want the visual active
  262. * indicator to go away immediately, so
  263. * we call classList.remove here.
  264. */
  265. this.el.classList.remove('picker-column-active');
  266. };
  267. /**
  268. * Find the next enabled option after the active option.
  269. * @param stride - How many options to "jump" over in order to select the next option.
  270. * This can be used to implement PageUp/PageDown behaviors where pressing these keys
  271. * scrolls the picker by more than 1 option. For example, a stride of 5 means select
  272. * the enabled option 5 options after the active one. Note that the actual option selected
  273. * may be past the stride if the option at the stride is disabled.
  274. */
  275. this.findNextOption = (stride = 1) => {
  276. const { activeItem } = this;
  277. if (!activeItem)
  278. return null;
  279. let prevNode = activeItem;
  280. let node = activeItem.nextElementSibling;
  281. while (node != null) {
  282. if (stride > 0) {
  283. stride--;
  284. }
  285. if (node.tagName === 'ION-PICKER-COLUMN-OPTION' && !node.disabled && stride === 0) {
  286. return node;
  287. }
  288. prevNode = node;
  289. // Use nextElementSibling instead of nextSibling to avoid text/comment nodes
  290. node = node.nextElementSibling;
  291. }
  292. return prevNode;
  293. };
  294. /**
  295. * Find the next enabled option after the active option.
  296. * @param stride - How many options to "jump" over in order to select the next option.
  297. * This can be used to implement PageUp/PageDown behaviors where pressing these keys
  298. * scrolls the picker by more than 1 option. For example, a stride of 5 means select
  299. * the enabled option 5 options before the active one. Note that the actual option selected
  300. * may be past the stride if the option at the stride is disabled.
  301. */
  302. this.findPreviousOption = (stride = 1) => {
  303. const { activeItem } = this;
  304. if (!activeItem)
  305. return null;
  306. let nextNode = activeItem;
  307. let node = activeItem.previousElementSibling;
  308. while (node != null) {
  309. if (stride > 0) {
  310. stride--;
  311. }
  312. if (node.tagName === 'ION-PICKER-COLUMN-OPTION' && !node.disabled && stride === 0) {
  313. return node;
  314. }
  315. nextNode = node;
  316. // Use previousElementSibling instead of previousSibling to avoid text/comment nodes
  317. node = node.previousElementSibling;
  318. }
  319. return nextNode;
  320. };
  321. this.onKeyDown = (ev) => {
  322. /**
  323. * The below operations should be inverted when running on a mobile device.
  324. * For example, swiping up will dispatch an "ArrowUp" event. On desktop,
  325. * this should cause the previous option to be selected. On mobile, swiping
  326. * up causes a view to scroll down. As a result, swiping up on mobile should
  327. * cause the next option to be selected. The Home/End operations remain
  328. * unchanged because those always represent the first/last options, respectively.
  329. */
  330. const mobile = ionicGlobal.isPlatform('mobile');
  331. let newOption = null;
  332. switch (ev.key) {
  333. case 'ArrowDown':
  334. newOption = mobile ? this.findPreviousOption() : this.findNextOption();
  335. break;
  336. case 'ArrowUp':
  337. newOption = mobile ? this.findNextOption() : this.findPreviousOption();
  338. break;
  339. case 'PageUp':
  340. newOption = mobile ? this.findNextOption(5) : this.findPreviousOption(5);
  341. break;
  342. case 'PageDown':
  343. newOption = mobile ? this.findPreviousOption(5) : this.findNextOption(5);
  344. break;
  345. case 'Home':
  346. /**
  347. * There is no guarantee that the first child will be an ion-picker-column-option,
  348. * so we do not use firstElementChild.
  349. */
  350. newOption = this.el.querySelector('ion-picker-column-option:first-of-type');
  351. break;
  352. case 'End':
  353. /**
  354. * There is no guarantee that the last child will be an ion-picker-column-option,
  355. * so we do not use lastElementChild.
  356. */
  357. newOption = this.el.querySelector('ion-picker-column-option:last-of-type');
  358. break;
  359. }
  360. if (newOption !== null) {
  361. this.setValue(newOption.value);
  362. // This stops any default browser behavior such as scrolling
  363. ev.preventDefault();
  364. }
  365. };
  366. /**
  367. * Utility to generate the correct text for aria-valuetext.
  368. */
  369. this.getOptionValueText = (el) => {
  370. var _a;
  371. return el ? (_a = el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : el.innerText : '';
  372. };
  373. /**
  374. * Render an element that overlays the column. This element is for assistive
  375. * tech to allow users to navigate the column up/down. This element should receive
  376. * focus as it listens for synthesized keyboard events as required by the
  377. * slider role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role
  378. */
  379. this.renderAssistiveFocusable = () => {
  380. const { activeItem } = this;
  381. const valueText = this.getOptionValueText(activeItem);
  382. /**
  383. * When using the picker, the valuetext provides important context that valuenow
  384. * does not. Additionally, using non-zero valuemin/valuemax values can cause
  385. * WebKit to incorrectly announce numeric valuetext values (such as a year
  386. * like "2024") as percentages: https://bugs.webkit.org/show_bug.cgi?id=273126
  387. */
  388. return (index.h("div", { ref: (el) => (this.assistiveFocusable = el), class: "assistive-focusable", role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": valueText, "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }));
  389. };
  390. this.ariaLabel = null;
  391. this.isActive = false;
  392. this.disabled = false;
  393. this.value = undefined;
  394. this.color = 'primary';
  395. this.numericInput = false;
  396. }
  397. ariaLabelChanged(newValue) {
  398. this.ariaLabel = newValue;
  399. }
  400. valueChange() {
  401. if (this.isColumnVisible) {
  402. /**
  403. * Only scroll the active item into view when the picker column
  404. * is actively visible to the user.
  405. */
  406. this.scrollActiveItemIntoView(true);
  407. }
  408. }
  409. /**
  410. * Only setup scroll listeners
  411. * when the picker is visible, otherwise
  412. * the container will have a scroll
  413. * height of 0px.
  414. */
  415. componentWillLoad() {
  416. /**
  417. * We cache parentEl in a local variable
  418. * so we don't need to keep accessing
  419. * the class variable (which comes with
  420. * a small performance hit)
  421. */
  422. const parentEl = (this.parentEl = this.el.closest('ion-picker'));
  423. const visibleCallback = (entries) => {
  424. /**
  425. * Browsers will sometimes group multiple IO events into a single callback.
  426. * As a result, we want to grab the last/most recent event in case there are multiple events.
  427. */
  428. const ev = entries[entries.length - 1];
  429. if (ev.isIntersecting) {
  430. const { activeItem, el } = this;
  431. this.isColumnVisible = true;
  432. /**
  433. * Because this initial call to scrollActiveItemIntoView has to fire before
  434. * the scroll listener is set up, we need to manage the active class manually.
  435. */
  436. const oldActive = helpers.getElementRoot(el).querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
  437. if (oldActive) {
  438. this.setPickerItemActiveState(oldActive, false);
  439. }
  440. this.scrollActiveItemIntoView();
  441. if (activeItem) {
  442. this.setPickerItemActiveState(activeItem, true);
  443. }
  444. this.initializeScrollListener();
  445. }
  446. else {
  447. this.isColumnVisible = false;
  448. if (this.destroyScrollListener) {
  449. this.destroyScrollListener();
  450. this.destroyScrollListener = undefined;
  451. }
  452. }
  453. };
  454. /**
  455. * Set the root to be the parent picker element
  456. * This causes the IO callback
  457. * to be fired in WebKit as soon as the element
  458. * is visible. If we used the default root value
  459. * then WebKit would only fire the IO callback
  460. * after any animations (such as a modal transition)
  461. * finished, and there would potentially be a flicker.
  462. */
  463. new IntersectionObserver(visibleCallback, { threshold: 0.001, root: this.parentEl }).observe(this.el);
  464. if (parentEl !== null) {
  465. // TODO(FW-2832): type
  466. parentEl.addEventListener('ionInputModeChange', (ev) => this.inputModeChange(ev));
  467. }
  468. }
  469. componentDidRender() {
  470. const { el, activeItem, isColumnVisible, value } = this;
  471. if (isColumnVisible && !activeItem) {
  472. const firstOption = el.querySelector('ion-picker-column-option');
  473. /**
  474. * If the picker column does not have an active item and the current value
  475. * does not match the first item in the picker column, that means
  476. * the value is out of bounds. In this case, we assign the value to the
  477. * first item to match the scroll position of the column.
  478. *
  479. */
  480. if (firstOption !== null && firstOption.value !== value) {
  481. this.setValue(firstOption.value);
  482. }
  483. }
  484. }
  485. /** @internal */
  486. async scrollActiveItemIntoView(smooth = false) {
  487. const activeEl = this.activeItem;
  488. if (activeEl) {
  489. this.centerPickerItemInView(activeEl, smooth, false);
  490. }
  491. }
  492. /**
  493. * Sets the value prop and fires the ionChange event.
  494. * This is used when we need to fire ionChange from
  495. * user-generated events that cannot be caught with normal
  496. * input/change event listeners.
  497. * @internal
  498. */
  499. async setValue(value) {
  500. if (this.disabled === true || this.value === value) {
  501. return;
  502. }
  503. this.value = value;
  504. this.ionChange.emit({ value });
  505. }
  506. /**
  507. * Sets focus on the scrollable container within the picker column.
  508. * Use this method instead of the global `pickerColumn.focus()`.
  509. */
  510. async setFocus() {
  511. if (this.assistiveFocusable) {
  512. this.assistiveFocusable.focus();
  513. }
  514. }
  515. connectedCallback() {
  516. var _a;
  517. this.ariaLabel = (_a = this.el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : 'Select a value';
  518. }
  519. get activeItem() {
  520. const { value } = this;
  521. const options = Array.from(this.el.querySelectorAll('ion-picker-column-option'));
  522. return options.find((option) => {
  523. /**
  524. * If the whole picker column is disabled, the current value should appear active
  525. * If the current value item is specifically disabled, it should not appear active
  526. */
  527. if (!this.disabled && option.disabled) {
  528. return false;
  529. }
  530. return option.value === value;
  531. });
  532. }
  533. render() {
  534. const { color, disabled, isActive, numericInput } = this;
  535. const mode = ionicGlobal.getIonMode(this);
  536. return (index.h(index.Host, { key: 'a221dc10f1eb7c41637a16d2c7167c16939822fd', class: theme.createColorClasses(color, {
  537. [mode]: true,
  538. ['picker-column-active']: isActive,
  539. ['picker-column-numeric-input']: numericInput,
  540. ['picker-column-disabled']: disabled,
  541. }) }, this.renderAssistiveFocusable(), index.h("slot", { key: '81b0656f606856f3dc0a657bf167d81a5011405e', name: "prefix" }), index.h("div", { key: '71b9de67c04150255dd66592601c9d926db0c31c', "aria-hidden": "true", class: "picker-opts", ref: (el) => {
  542. this.scrollEl = el;
  543. },
  544. /**
  545. * When an element has an overlay scroll style and
  546. * a fixed height, Firefox will focus the scrollable
  547. * container if the content exceeds the container's
  548. * dimensions.
  549. *
  550. * This causes keyboard navigation to focus to this
  551. * element instead of going to the next element in
  552. * the tab order.
  553. *
  554. * The desired behavior is for the user to be able to
  555. * focus the assistive focusable element and tab to
  556. * the next element in the tab order. Instead of tabbing
  557. * to this element.
  558. *
  559. * To prevent this, we set the tabIndex to -1. This
  560. * will match the behavior of the other browsers.
  561. */
  562. tabIndex: -1 }, index.h("div", { key: 'ebdc2f08c83db0cf17b4be29f28fcb00f529601e', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '04ab56fcb8e6a7d6af00204c4560feb99ff34a56', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '6cf8f538903faf0fe1e4130f3eaf7b4e2e17cb52', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("slot", { key: '1cc392307b70c576be5b81b5226ceba735957f0f' }), index.h("div", { key: '23e3f28e2a99b9aa8b7c8f68ad9583e3ca63e9e2', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '8a0563f09780c3116af0caebe4f40587ec1f041f', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '13207e248fc0009f37e0c90a3ee2bac2f130b856', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), index.h("slot", { key: '55ecf2ab5f214f936c2468cbdb7952daf89416b8', name: "suffix" })));
  563. }
  564. get el() { return index.getElement(this); }
  565. static get watchers() { return {
  566. "aria-label": ["ariaLabelChanged"],
  567. "value": ["valueChange"]
  568. }; }
  569. };
  570. const PICKER_ITEM_ACTIVE_CLASS = 'option-active';
  571. PickerColumn.style = IonPickerColumnStyle0;
  572. exports.ion_picker_column = PickerColumn;