@ionic/core 7.5.1-dev.11697139276.10eb94b8 → 7.5.1-dev.11697212309.1448948d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/picker-column-internal.js +27 -26
- package/components/picker-internal.js +12 -8
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +26 -24
- package/dist/cjs/ion-picker-internal.cjs.entry.js +11 -7
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/picker-column-internal/picker-column-internal.js +26 -54
- package/dist/collection/components/picker-internal/picker-internal-interfaces.js +1 -0
- package/dist/collection/components/picker-internal/picker-internal.js +34 -7
- package/dist/docs.json +6 -1
- package/dist/esm/ion-picker-column-internal.entry.js +26 -24
- package/dist/esm/ion-picker-internal.entry.js +12 -8
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm-es5/ion-picker-internal.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0b7c25ee.system.entry.js +4 -0
- package/dist/ionic/p-3a58e3a4.system.entry.js +4 -0
- package/dist/ionic/p-5c3e72a8.system.js +1 -1
- package/dist/ionic/p-818b2e75.entry.js +4 -0
- package/dist/ionic/p-afb6658f.entry.js +4 -0
- package/dist/types/components/menu/menu-interface.d.ts +15 -4
- package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +1 -3
- package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +8 -0
- package/dist/types/components/picker-internal/picker-internal.d.ts +6 -4
- package/dist/types/components.d.ts +7 -4
- package/dist/types/utils/menu-controller/index.d.ts +2 -21
- package/hydrate/index.js +38 -33
- package/package.json +1 -1
- package/dist/ionic/p-129bc265.system.entry.js +0 -4
- package/dist/ionic/p-c0190e6d.system.entry.js +0 -4
- package/dist/ionic/p-d021cd8c.entry.js +0 -4
- package/dist/ionic/p-eed2c96d.entry.js +0 -4
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,h as r,H as e,f as i}from"./p-06ac429a.js";import{g as o}from"./p-63eb0acd.js";const n=class{constructor(r){t(this,r),this.useInputMode=!1,this.isInHighlightBounds=t=>{const{highlightEl:r}=this;if(!r)return!1;const e=r.getBoundingClientRect();return!(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)},this.onFocusOut=t=>{const{relatedTarget:r}=t;(!r||"ION-PICKER-COLUMN-INTERNAL"!==r.tagName&&r!==this.inputEl)&&this.exitInputMode()},this.onFocusIn=t=>{const{target:r}=t;"ION-PICKER-COLUMN-INTERNAL"!==r.tagName||this.actionOnClick||(r.numericInput?this.enterInputMode(r,!1):this.exitInputMode())},this.onClick=()=>{const{actionOnClick:t}=this;t&&(t(),this.actionOnClick=void 0)},this.onPointerDown=t=>{const{useInputMode:r,inputModeColumn:e,el:i}=this;if(this.isInHighlightBounds(t))if(r)this.actionOnClick="ION-PICKER-COLUMN-INTERNAL"===t.target.tagName?e&&e===t.target?()=>{this.enterInputMode()}:()=>{this.enterInputMode(t.target)}:()=>{this.exitInputMode()};else{const r=1===i.querySelectorAll("ion-picker-column-internal.picker-column-numeric-input").length?t.target:void 0;this.actionOnClick=()=>{this.enterInputMode(r)}}else this.actionOnClick=()=>{this.exitInputMode()}},this.enterInputMode=(t,r=!0)=>{const{inputEl:e,el:i}=this;e&&i.querySelector("ion-picker-column-internal.picker-column-numeric-input")&&(this.useInputMode=!0,this.inputModeColumn=t,r?(this.destroyKeypressListener&&(this.destroyKeypressListener(),this.destroyKeypressListener=void 0),e.focus()):(i.addEventListener("keypress",this.onKeyPress),this.destroyKeypressListener=()=>{i.removeEventListener("keypress",this.onKeyPress)}),this.triggerInputModeChange())},this.onKeyPress=t=>{const{inputEl:r}=this;if(!r)return;const e=parseInt(t.key,10);Number.isNaN(e)||(r.value+=t.key,this.onInputChange())},this.selectSingleColumn=()=>{const{inputEl:t,inputModeColumn:r,singleColumnSearchTimeout:e}=this;if(!t||!r)return;const i=r.items.filter((t=>!0!==t.disabled));if(e&&clearTimeout(e),this.singleColumnSearchTimeout=setTimeout((()=>{t.value="",this.singleColumnSearchTimeout=void 0}),1e3),t.value.length>=3){const r=t.value.substring(t.value.length-2);return t.value=r,void this.selectSingleColumn()}const o=i.find((({text:r})=>r.replace(/^0+(?=[1-9])|0+(?=0$)/,"")===t.value));if(o)r.setValue(o.value);else if(2===t.value.length){const r=t.value.substring(t.value.length-1);t.value=r,this.selectSingleColumn()}},this.searchColumn=(t,r,e="start")=>{const i="start"===e?/^0+/:/0$/,o=t.items.find((({text:t,disabled:e})=>!0!==e&&t.replace(i,"")===r));o&&t.setValue(o.value)},this.selectMultiColumn=()=>{const{inputEl:t,el:r}=this;if(!t)return;const e=Array.from(r.querySelectorAll("ion-picker-column-internal")).filter((t=>t.numericInput)),i=e[0],o=e[1];let n,a=t.value;switch(a.length){case 1:this.searchColumn(i,a);break;case 2:const r=t.value.substring(0,1);a="0"===r||"1"===r?t.value:r,this.searchColumn(i,a),1===a.length&&(n=t.value.substring(t.value.length-1),this.searchColumn(o,n,"end"));break;case 3:const e=t.value.substring(0,1);a="0"===e||"1"===e?t.value.substring(0,2):e,this.searchColumn(i,a),n=t.value.substring(1===a.length?1:2),this.searchColumn(o,n,"end");break;case 4:const s=t.value.substring(0,1);a="0"===s||"1"===s?t.value.substring(0,2):s,this.searchColumn(i,a);const c=t.value.substring(1===a.length?1:2,t.value.length);this.searchColumn(o,c,"end");break;default:const l=t.value.substring(t.value.length-4);t.value=l,this.selectMultiColumn()}},this.onInputChange=()=>{const{useInputMode:t,inputEl:r,inputModeColumn:e}=this;t&&r&&(e?this.selectSingleColumn():this.selectMultiColumn())},this.triggerInputModeChange=()=>{this.el.querySelectorAll("ion-picker-column-internal").forEach((t=>t.inputModeChange(this.useInputMode,this.inputModeColumn)))}}preventTouchStartPropagation(t){t.stopPropagation()}componentWillLoad(){o(this.el).addEventListener("focusin",this.onFocusIn),o(this.el).addEventListener("focusout",this.onFocusOut)}async exitInputMode(){const{inputEl:t,useInputMode:r}=this;r&&t&&(this.useInputMode=!1,this.inputModeColumn=void 0,t.blur(),t.value="",this.destroyKeypressListener&&(this.destroyKeypressListener(),this.destroyKeypressListener=void 0),this.triggerInputModeChange())}render(){return r(e,{onPointerDown:t=>this.onPointerDown(t),onClick:()=>this.onClick()},r("input",{"aria-hidden":"true",tabindex:-1,inputmode:"numeric",type:"number",ref:t=>this.inputEl=t,onInput:()=>this.onInputChange(),onBlur:()=>this.exitInputMode()}),r("div",{class:"picker-before"}),r("div",{class:"picker-after"}),r("div",{class:"picker-highlight",ref:t=>this.highlightEl=t}),r("slot",null))}get el(){return i(this)}};n.style={ios:":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 .picker-before:dir(rtl){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 .picker-after:dir(rtl){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))}",md:":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 .picker-before:dir(rtl){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 .picker-after:dir(rtl){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)));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%)}"};export{n as ion_picker_internal}
|