1import { 2 Host, 3 createEvent, 4 getElement, 5 h, 6 registerInstance 7} from "./chunk-LPF5FBSP.js"; 8import { 9 getElementRoot 10} from "./chunk-3MMB2GIP.js"; 11import { 12 __async 13} from "./chunk-KLIBT2SQ.js"; 14 15// node_modules/@ionic/core/dist/esm/ion-picker-internal.entry.js 16var pickerInternalIosCss = ":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}@supports (inset-inline-start: 0){:host .picker-before{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-before{left:0}:host-context([dir=rtl]) .picker-before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)) .picker-before{left:unset;right:unset;right:0}}}:host .picker-after{top:116px;height:84px}@supports (inset-inline-start: 0){:host .picker-after{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-after{left:0}:host-context([dir=rtl]) .picker-after{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)) .picker-after{left:unset;right:unset;right:0}}}:host .picker-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(--wheel-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-internal:first-of-type){text-align:start}:host ::slotted(ion-picker-column-internal:last-of-type){text-align:end}:host ::slotted(ion-picker-column-internal:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to bottom, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-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(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to top, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}:host .picker-highlight{background:var(--wheel-highlight-background, var(--ion-color-step-150, #eeeeef))}"; 17var pickerInternalMdCss = ":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}@supports (inset-inline-start: 0){:host .picker-before{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-before{left:0}:host-context([dir=rtl]) .picker-before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)) .picker-before{left:unset;right:unset;right:0}}}:host .picker-after{top:116px;height:84px}@supports (inset-inline-start: 0){:host .picker-after{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-after{left:0}:host-context([dir=rtl]) .picker-after{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)) .picker-after{left:unset;right:unset;right:0}}}:host .picker-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(--wheel-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-internal:first-of-type){text-align:start}:host ::slotted(ion-picker-column-internal:last-of-type){text-align:end}:host ::slotted(ion-picker-column-internal:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0
17)));background:linear-gradient(to bottom, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-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(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to top, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 30%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}"; 18var PickerInternal = class { 19 constructor(hostRef) { 20 registerInstance(this, hostRef); 21 this.ionInputModeChange = createEvent(this, "ionInputModeChange", 7); 22 this.useInputMode = false; 23 this.isInHighlightBounds = (ev) => { 24 const { highlightEl } = this; 25 if (!highlightEl) { 26 return false; 27 } 28 const bbox = highlightEl.getBoundingClientRect(); 29 const outsideX = ev.clientX < bbox.left || ev.clientX > bbox.right; 30 const outsideY = ev.clientY < bbox.top || ev.clientY > bbox.bottom; 31 if (outsideX || outsideY) { 32 return false; 33 } 34 return true; 35 }; 36 this.onFocusOut = (ev) => { 37 const { relatedTarget } = ev; 38 if (!relatedTarget || relatedTarget.tagName !== "ION-PICKER-COLUMN-INTERNAL" && relatedTarget !== this.inputEl) { 39 this.exitInputMode(); 40 } 41 }; 42 this.onFocusIn = (ev) => { 43 const { target } = ev; 44 if (target.tagName !== "ION-PICKER-COLUMN-INTERNAL") { 45 return; 46 } 47 if (!this.actionOnClick) { 48 const columnEl = target; 49 const allowInput = columnEl.numericInput; 50 if (allowInput) { 51 this.enterInputMode(columnEl, false); 52 } else { 53 this.exitInputMode(); 54 } 55 } 56 }; 57 this.onClick = () => { 58 const { actionOnClick } = this; 59 if (actionOnClick) { 60 actionOnClick(); 61 this.actionOnClick = void 0; 62 } 63 }; 64 this.onPointerDown = (ev) => { 65 const { useInputMode, inputModeColumn, el } = this; 66 if (this.isInHighlightBounds(ev)) { 67 if (useInputMode) { 68 if (ev.target.tagName === "ION-PICKER-COLUMN-INTERNAL") { 69 if (inputModeColumn && inputModeColumn === ev.target) { 70 this.actionOnClick = () => { 71 this.enterInputMode(); 72 }; 73 } else { 74 this.actionOnClick = () => { 75 this.enterInputMode(ev.target); 76 }; 77 } 78 } else { 79 this.actionOnClick = () => { 80 this.exitInputMode(); 81 }; 82 } 83 } else { 84 const columns = el.querySelectorAll("ion-picker-column-internal.picker-column-numeric-input"); 85 const columnEl = columns.length === 1 ? ev.target : void 0; 86 this.actionOnClick = () => { 87 this.enterInputMode(columnEl); 88 }; 89 } 90 return; 91 } 92 this.actionOnClick = () => { 93 this.exitInputMode(); 94 }; 95 }; 96 this.enterInputMode = (columnEl, focusInput = true) => { 97 const { inputEl, el } = this; 98 if (!inputEl) { 99 return; 100 } 101 const hasInputColumn = el.querySelector("ion-picker-column-internal.picker-column-numeric-input"); 102 if (!hasInputColumn) { 103 return; 104 } 105 this.useInputMode = true; 106 this.inputModeColumn = columnEl; 107 if (focusInput) { 108 if (this.destroyKeypressListener) { 109 this.destroyKeypressListener(); 110 this.destroyKeypressListener = void 0; 111 } 112 inputEl.focus(); 113 } else { 114 el.addEventListener("keypress", this.onKeyPress); 115 this.destroyKeypressListener = () => { 116 el.removeEventListener("keypress", this.onKeyPress); 117 }; 118 } 119 this.emitInputModeChange(); 120 }; 121 this.onKeyPress = (ev) => { 122 const { inputEl } = this; 123 if (!inputEl) { 124 return; 125 } 126 const parsedValue = parseInt(ev.key, 10); 127 if (!Number.isNaN(parsedValue)) { 128 inputEl.value += ev.key; 129 this.onInputChange(); 130 } 131 }; 132 this.selectSingleColumn = () => { 133 const { inputEl, inputModeColumn, singleColumnSearchTimeout } = this; 134 if (!inputEl || !inputModeColumn) { 135 return; 136 } 137 const values = inputModeColumn.items.filter((item) => item.disabled !== true); 138 if (singleColumnSearchTimeout) { 139 clearTimeout(singleColumnSearchTimeout); 140 } 141 this.singleColumnSearchTimeout = setTimeout(() => { 142 inputEl.value = ""; 143 this.singleColumnSearchTimeout = void 0; 144 }, 1e3); 145 if (inputEl.value.length >= 3) { 146 const startIndex = inputEl.value.length - 2; 147 const newString = inputEl.value.substring(startIndex); 148 inputEl.value = newString; 149 this.selectSingleColumn(); 150 return; 151 } 152 const findItemFromCompleteValue = values.find(({ text }) => { 153 const parsedText = text.replace(/^0+(?=[1-9])|0+(?=0$)/, ""); 154 return parsedText === inputEl.value; 155 }); 156 if (findItemFromCompleteValue) { 157 inputModeColumn.setValue(findItemFromCompleteValue.value); 158 return; 159 } 160 if (inputEl.value.length === 2) { 161 const changedCharacter = inputEl.value.substring(inputEl.value.length - 1); 162 inputEl.value = changedCharacter; 163 this.selectSingleColumn(); 164 } 165 }; 166 this.searchColumn = (colEl, value, zeroBehavior = "start") => { 167 const behavior = zeroBehavior === "start" ? /^0+/ : /0$/; 168 const item = colEl.items.find(({ text, disabled }) => disabled !== true && text.replace(behavior, "") === value); 169 if (item) { 170 colEl.setValue(item.value); 171 } 172 }; 173 this.selectMultiColumn = () => { 174 const { inputEl, el } = this; 175 if (!inputEl) { 176 return; 177 } 178 const numericPickers = Array.from(el.querySelectorAll("ion-picker-column-internal")).filter((col) => col.numericInput); 179 const firstColumn = numericPickers[0]; 180 const lastColumn = numericPickers[1]; 181 let value = inputEl.value; 182 let minuteValue; 183 switch (value.length) { 184 case 1: 185 this.searchColumn(firstColumn, value); 186 break; 187 case 2: 188 const firstCharacter = inputEl.value.substring(0, 1); 189 value = firstCharacter === "0" || firstCharacter === "1" ? inputEl.value : firstCharacter; 190 this.searchColumn(firstColumn, value); 191 if (value.length === 1) { 192 minuteValue = inputEl.value.substring(inputEl.value.length - 1); 193 this.searchColumn(lastColumn, minuteValue, "end"); 194 } 195 break; 196 case 3: 197 const firstCharacterAgain = inputEl.value.substring(0, 1); 198 value = firstCharacterAgain === "0" || firstCharacterAgain === "1" ? inputEl.value.substring(0, 2) : firstCharacterAgain; 199 this.searchColumn(firstColumn, value); 200 minuteValue = value.length === 1 ? inputEl.value.substring(1) : inputEl.value.substring(2); 201 this.searchColumn(lastColumn, minuteValue, "end"); 202 break; 203 case 4: 204 const firstCharacterAgainAgain = inputEl.value.substring(0, 1); 205 value = firstCharacterAgainAgain === "0" || firstCharacterAgainAgain === "1" ? inputEl.value.substring(0, 2) : firstCharacterAgainAgain; 206 this.searchColumn(firstColumn, value); 207 const minuteValueAgain = value.length === 1 ? inputEl.value.substring(1, inputEl.value.length) : inputEl.value.substring(2, inputEl.value.length); 208 this.searchColumn(lastColumn, minuteValueAgain, "end"); 209 break; 210 default: 211 const startIndex = inputEl.value.length - 4; 212 const newString = inputEl.value.substring(startIndex); 213 inputEl.value = newString; 214 this.selectMultiColumn(); 215 break; 216 } 217 }; 218 this.onInputChange = () => { 219 const { useInputMode, inputEl, inputModeColumn } = this; 220 if (!useInputMode || !inputEl) { 221 return; 222 } 223 if (inputModeColumn) { 224 this.selectSingleColumn(); 225 } else { 226 this.selectMultiColumn(); 227 } 228 }; 229 this.emitInputModeChange = () => { 230 const { useInputMode, inputModeColumn } = this; 231 this.ionInputModeChange.emit({ 232 useInputMode, 233 inputModeColumn 234 }); 235 }; 236 } 237 /** 238 * When the picker is interacted with 239 * we need to prevent touchstart so other 240 * gestures do not fire. For example, 241 * scrolling on the wheel picker 242 * in ion-datetime should not cause 243 * a card modal to swipe to close. 244 */ 245 preventTouchStartPropagation(ev) { 246 ev.stopPropagation(); 247 } 248 componentWillLoad() { 249 getElementRoot(this.el).addEventListener("focusin", this.onFocusIn); 250 getElementRoot(this.el).addEventListener("focusout", this.onFocusOut); 251 } 252 /** 253 * @internal 254 * Exits text entry mode for the picker 255 * This method blurs the hidden input 256 * and cause the keyboard to dismiss. 257 */ 258 exitInputMode() { 259 return __async(this, null, function* () { 260 const { inputEl, useInputMode } = this; 261 if (!useInputMode || !inputEl) { 262 return; 263 } 264 this.useInputMode = false;
265 this.inputModeColumn = void 0; 266 inputEl.blur(); 267 inputEl.value = ""; 268 if (this.destroyKeypressListener) { 269 this.destroyKeypressListener(); 270 this.destroyKeypressListener = void 0; 271 } 272 this.emitInputModeChange(); 273 }); 274 } 275 render() { 276 return h(Host, { onPointerDown: (ev) => this.onPointerDown(ev), onClick: () => this.onClick() }, h("input", { "aria-hidden": "true", tabindex: -1, inputmode: "numeric", type: "number", ref: (el) => this.inputEl = el, onInput: () => this.onInputChange(), onBlur: () => this.exitInputMode() }), h("div", { class: "picker-before" }), h("div", { class: "picker-after" }), h("div", { class: "picker-highlight", ref: (el) => this.highlightEl = el }), h("slot", null)); 277 } 278 get el() { 279 return getElement(this); 280 } 281}; 282PickerInternal.style = { 283 ios: pickerInternalIosCss, 284 md: pickerInternalMdCss 285}; 286export { 287 PickerInternal as ion_picker_internal 288};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.