@ionic/core 8.8.5-nightly.20260429 → 8.8.5
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/ion-radio-group.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/p-BlNv564p.js +4 -0
- package/components/p-D-cP12ZN.js +4 -0
- package/components/{p-Bk2zuNWT.js → p-DvOO1fxp.js} +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +13 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +18 -7
- package/dist/cjs/ion-select_3.cjs.entry.js +18 -7
- package/dist/collection/components/radio-group/radio-group.js +13 -1
- package/dist/collection/components/radio-group/test/fixtures.js +2 -2
- package/dist/collection/components/select-modal/select-modal.js +18 -7
- package/dist/collection/components/select-modal/test/fixtures.js +4 -0
- package/dist/collection/components/select-popover/select-popover.js +18 -7
- package/dist/collection/components/select-popover/test/fixtures.js +4 -0
- package/dist/docs.json +1 -1
- package/dist/esm/ion-radio_2.entry.js +13 -1
- package/dist/esm/ion-select-modal.entry.js +18 -7
- package/dist/esm/ion-select_3.entry.js +18 -7
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-28a9e720.entry.js +4 -0
- package/dist/ionic/{p-4dd5e8e0.entry.js → p-8fda6a62.entry.js} +1 -1
- package/dist/ionic/{p-9eac4eb1.entry.js → p-aa812c4b.entry.js} +1 -1
- package/dist/types/components/radio-group/test/fixtures.d.ts +1 -1
- package/dist/types/components/select-modal/select-modal.d.ts +1 -0
- package/dist/types/components/select-modal/test/fixtures.d.ts +1 -0
- package/dist/types/components/select-popover/select-popover.d.ts +1 -0
- package/dist/types/components/select-popover/test/fixtures.d.ts +1 -0
- package/hydrate/index.js +49 -15
- package/hydrate/index.mjs +49 -15
- package/package.json +1 -1
- package/components/p-EK4xUz-q.js +0 -4
- package/components/p-MlJRD6E1.js +0 -4
- package/dist/ionic/p-e6c5f060.entry.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,c as t,h as i,d as r,g as a}from"./p-IGIE5vDm.js";import{f as o,m as n,a as s}from"./p-CGmVTdWh.js";import{i as l}from"./p-sObYyvOy.js";import{h as d,c}from"./p-DiVJyqlX.js";import{b as p}from"./p-NFFyoJ4Q.js";import{c as h}from"./p-DJztqcrH.js";const b=class{constructor(i){e(this,i),this.ionFocus=t(this,"ionFocus",7),this.ionBlur=t(this,"ionBlur",7),this.inputId="ion-rb-"+m++,this.radioGroup=null,this.checked=!1,this.buttonTabindex=-1,this.name=this.inputId,this.disabled=!1,this.labelPlacement="start",this.updateState=()=>{if(this.radioGroup){const{compareWith:e,value:t}=this.radioGroup;this.checked=l(t,this.value,e)}},this.onClick=()=>{const{radioGroup:e,checked:t,disabled:i}=this;i||(this.checked=!t||!(null==e?void 0:e.allowEmptySelection))},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()}}valueChanged(){this.updateState()}componentDidLoad(){this.updateState()}async setFocus(e){void 0!==e&&(e.stopPropagation(),e.preventDefault()),this.el.focus()}async setButtonTabindex(e){this.buttonTabindex=e}connectedCallback(){void 0===this.value&&(this.value=this.inputId);const e=this.radioGroup=this.el.closest("ion-radio-group");e&&(this.updateState(),o(e,"ionValueChange",this.updateState))}disconnectedCallback(){const e=this.radioGroup;e&&(n(e,"ionValueChange",this.updateState),this.radioGroup=null)}get hasLabel(){return""!==this.el.textContent}renderRadioControl(){return i("div",{class:"radio-icon",part:"container"},i("div",{class:"radio-inner",part:"mark"}),i("div",{class:"radio-ripple"}))}render(){const{checked:e,disabled:t,color:a,el:o,justify:n,labelPlacement:s,hasLabel:l,buttonTabindex:h,alignment:b}=this,m=p(this),g=d("ion-item",o);return i(r,{key:"af5dc59ed528150872e907ed1036e3e2decba939",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,class:c(a,{[m]:!0,"in-item":g,"radio-checked":e,"radio-disabled":t,[`radio-justify-${n}`]:void 0!==n,[`radio-alignment-${b}`]:void 0!==b,[`radio-label-placement-${s}`]:!0,"ion-activatable":!g,"ion-focusable":!g}),role:"radio","aria-checked":e?"true":"false","aria-disabled":t?"true":null,tabindex:h},i("label",{key:"1312aba3259a87fe23a6911cdfa477e309469c8b",class:"radio-wrapper"},i("div",{key:"b342aa27e240a300836d2a135658d346b95daf09",class:{"label-text-wrapper":!0,"label-text-wrapper-hidden":!l},part:"label"},i("slot",{key:"0a4613d29aa783d1882cf889377f7e4fd4fea51d"})),i("div",{key:"191faea79dc4cd8befc4b873f5bd9f5af8ca2acc",class:"native-wrapper"},this.renderRadioControl())))}get el(){return a(this)}static get watchers(){return{value:[{valueChanged:0}]}}};let m=0;b.style={ios:':host{--inner-border-radius:50%;display:inline-block;position:relative;max-width:100%;min-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}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(:focus){outline:none}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}.radio-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;min-height:inherit;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.radio-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.radio-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between) .radio-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.radio-justify-start) .radio-wrapper{-ms-flex-pack:start;justify-content:start}:host(.radio-justify-end) .radio-wrapper{-ms-flex-pack:end;justify-content:end}:host(.radio-alignment-start) .radio-wrapper{-ms-flex-align:start;align-items:start}:host(.radio-alignment-center) .radio-wrapper{-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between),:host(.radio-justify-start),:host(.radio-justify-end),:host(.radio-alignment-start),:host(.radio-alignment-center){display:block}:host(.radio-label-placement-start) .radio-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.radio-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-end) .radio-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.radio-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.radio-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px}:host(.radio-label-placement-stacked) .radio-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.radio-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host{--color-checked:var(--ion-color-primary, #0054e9)}:host(.ion-color.radio-checked) .radio-inner{border-color:var(--ion-color-base)}.item-radio.item-ios ion-label{-webkit-margin-start:0;margin-inline-start:0}.radio-inner{width:33%;height:50%}:host(.radio-checked) .radio-inner{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:0.125rem;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}:host(.radio-disabled){opacity:0.3}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #1a65eb);content:"";opacity:0.2}:host(.ion-focused) .radio-icon::after{inset-inline-start:-9px}.native-wrapper .radio-icon{width:0.9375rem;height:1.5rem}',md:':host{--inner-border-radius:50%;display:inline-block;position:relative;max-width:100%;min-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}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(:focus){outline:none}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}.radio-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;min-height:inherit;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.radio-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.radio-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between) .radio-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.radio-justify-start) .radio-wrapper{-ms-flex-pack:start;justify-content:start}:host(.radio-justify-end) .radio-wrapper{-ms-flex-pack:end;justify-content:end}:host(.radio-alignment-start) .radio-wrapper{-ms-flex-align:start;align-items:start}:host(.radio-alignment-center) .radio-wrapper{-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between),:host(.radio-justify-start),:host(.radio-justify-end),:host(.radio-alignment-start),:host(.radio-alignment-center){display:block}:host(.radio-label-placement-start) .radio-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.radio-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-end) .radio-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.radio-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.radio-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px}:host(.radio-label-placement-stacked) .radio-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.radio-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host{--color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #0054e9);--border-width:0.125rem;--border-style:solid;--border-radius:50%}:host(.ion-color) .radio-inner{background:var(--ion-color-base)}:host(.ion-color.radio-checked) .radio-icon{border-color:var(--ion-color-base)}.radio-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--color)}.radio-inner{border-radius:var(--inner-border-radius);width:calc(50% + var(--border-width));height:calc(50% + var(--border-width));-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background:var(--color-checked)}:host(.radio-checked) .radio-icon{border-color:var(--color-checked)}:host(.radio-checked) .radio-inner{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}:host(.radio-disabled) .label-text-wrapper{opacity:0.38}:host(.radio-disabled) .native-wrapper{opacity:0.63}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #1a65eb);content:"";opacity:0.2}.native-wrapper .radio-icon{width:1.25rem;height:1.25rem}'};const g=class{constructor(i){e(this,i),this.ionChange=t(this,"ionChange",7),this.ionValueChange=t(this,"ionValueChange",7),this.inputId="ion-rg-"+x++,this.helperTextId=`${this.inputId}-helper-text`,this.errorTextId=`${this.inputId}-error-text`,this.labelId=`${this.inputId}-lbl`,this.isInvalid=!1,this.allowEmptySelection=!1,this.name=this.inputId,this.setRadioTabindex=e=>{const t=this.getRadios(),i=t.find((e=>!e.disabled)),r=t.find((t=>t.value===e&&!t.disabled));if(!i&&!r)return;const a=r||i;for(const e of t)e.setButtonTabindex(e===a?0:-1)},this.onClick=e=>{e.preventDefault();const t=e.target&&e.target.closest("ion-radio");if(t&&!t.disabled){const i=t.value;i!==this.value?(this.value=i,this.emitValueChange(e)):this.allowEmptySelection&&(this.value=void 0,this.emitValueChange(e))}}}valueChanged(e){this.setRadioTabindex(e),this.ionValueChange.emit({value:e})}componentDidLoad(){this.valueChanged(this.value)}async connectedCallback(){const e=this.el.querySelector("ion-list-header")||this.el.querySelector("ion-item-divider");if(e){const t=this.label=e.querySelector("ion-label");t&&(this.labelId=t.id=this.name+"-lbl")}"undefined"!=typeof MutationObserver&&(this.validationObserver=new MutationObserver((()=>{const e=h(this.el);this.isInvalid!==e&&(this.isInvalid=e,Promise.resolve().then((()=>{this.hintTextId=this.getHintTextId()})))})),this.validationObserver.observe(this.el,{attributes:!0,attributeFilter:["class"]})),this.isInvalid=h(this.el)}componentWillLoad(){this.hintTextId=this.getHintTextId()}disconnectedCallback(){this.validationObserver&&(this.validationObserver.disconnect(),this.validationObserver=void 0)}getRadios(){return Array.from(this.el.querySelectorAll("ion-radio"))}emitValueChange(e){const{value:t}=this;this.ionChange.emit({value:t,event:e})}onKeydown(e){const t=!!this.el.closest("ion-select-popover")||!!this.el.closest("ion-select-modal");if(e.target&&!this.el.contains(e.target))return;const i=this.getRadios().filter((e=>!e.disabled));if(e.target&&i.includes(e.target)){const r=i.findIndex((t=>t===e.target)),a=i[r];let o;if(["ArrowDown","ArrowRight"].includes(e.key)&&(o=r===i.length-1?i[0]:i[r+1]),["ArrowUp","ArrowLeft"].includes(e.key)&&(o=0===r?i[i.length-1]:i[r-1]),o&&i.includes(o)&&(o.setFocus(e),t||(this.value=o.value,this.emitValueChange(e))),[" "].includes(e.key)){const t=this.value;this.value=this.allowEmptySelection&&void 0!==this.value?void 0:a.value,(t!==this.value||this.allowEmptySelection)&&this.emitValueChange(e),e.preventDefault()}}}async setFocus(){const e=this.getRadios().find((e=>-1!==e.tabIndex));null==e||e.setFocus()}renderHintText(){const{helperText:e,errorText:t,helperTextId:r,errorTextId:a,isInvalid:o}=this;if(e||t)return i("div",{class:"radio-group-top"},i("div",{id:r,class:"helper-text","aria-live":"polite"},o?null:e),i("div",{id:a,class:"error-text",role:"alert"},o?t:null))}getHintTextId(){const{helperText:e,errorText:t,helperTextId:i,errorTextId:r,isInvalid:a}=this;return a&&t?r:e?i:void 0}render(){const{label:e,labelId:t,el:a,name:o,value:n}=this,l=p(this);return s(!0,a,o,n,!1),i(r,{key:"db593b3ed511e9395e3c7bfd91b787328692cd6d",role:"radiogroup","aria-labelledby":e?t:null,"aria-describedby":this.hintTextId,"aria-invalid":this.isInvalid?"true":void 0,onClick:this.onClick,class:l},this.renderHintText(),i("slot",{key:"d683b01c1ba34fe843c4b320bce4661a117472a5"}))}get el(){return a(this)}static get watchers(){return{value:[{valueChanged:0}]}}};let x=0;g.style={ios:"ion-radio-group{vertical-align:top}.radio-group-top{line-height:1.5}.radio-group-top .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.radio-group-top .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid .radio-group-top .error-text{display:block}.ion-touched.ion-invalid .radio-group-top .helper-text{display:none}ion-list .radio-group-top{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}",md:"ion-radio-group{vertical-align:top}.radio-group-top{line-height:1.5}.radio-group-top .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.radio-group-top .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid .radio-group-top .error-text{display:block}.ion-touched.ion-invalid .radio-group-top .helper-text{display:none}ion-list .radio-group-top{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}"};export{b as ion_radio,g as ion_radio_group}
|
|
4
|
+
import{r as e,c as t,h as i,d as r,g as a}from"./p-IGIE5vDm.js";import{f as o,m as n,a as s}from"./p-CGmVTdWh.js";import{i as l}from"./p-sObYyvOy.js";import{h as d,c}from"./p-DiVJyqlX.js";import{b as p}from"./p-NFFyoJ4Q.js";import{c as h}from"./p-DJztqcrH.js";const b=class{constructor(i){e(this,i),this.ionFocus=t(this,"ionFocus",7),this.ionBlur=t(this,"ionBlur",7),this.inputId="ion-rb-"+m++,this.radioGroup=null,this.checked=!1,this.buttonTabindex=-1,this.name=this.inputId,this.disabled=!1,this.labelPlacement="start",this.updateState=()=>{if(this.radioGroup){const{compareWith:e,value:t}=this.radioGroup;this.checked=l(t,this.value,e)}},this.onClick=()=>{const{radioGroup:e,checked:t,disabled:i}=this;i||(this.checked=!t||!(null==e?void 0:e.allowEmptySelection))},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()}}valueChanged(){this.updateState()}componentDidLoad(){this.updateState()}async setFocus(e){void 0!==e&&(e.stopPropagation(),e.preventDefault()),this.el.focus()}async setButtonTabindex(e){this.buttonTabindex=e}connectedCallback(){void 0===this.value&&(this.value=this.inputId);const e=this.radioGroup=this.el.closest("ion-radio-group");e&&(this.updateState(),o(e,"ionValueChange",this.updateState))}disconnectedCallback(){const e=this.radioGroup;e&&(n(e,"ionValueChange",this.updateState),this.radioGroup=null)}get hasLabel(){return""!==this.el.textContent}renderRadioControl(){return i("div",{class:"radio-icon",part:"container"},i("div",{class:"radio-inner",part:"mark"}),i("div",{class:"radio-ripple"}))}render(){const{checked:e,disabled:t,color:a,el:o,justify:n,labelPlacement:s,hasLabel:l,buttonTabindex:h,alignment:b}=this,m=p(this),g=d("ion-item",o);return i(r,{key:"af5dc59ed528150872e907ed1036e3e2decba939",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,class:c(a,{[m]:!0,"in-item":g,"radio-checked":e,"radio-disabled":t,[`radio-justify-${n}`]:void 0!==n,[`radio-alignment-${b}`]:void 0!==b,[`radio-label-placement-${s}`]:!0,"ion-activatable":!g,"ion-focusable":!g}),role:"radio","aria-checked":e?"true":"false","aria-disabled":t?"true":null,tabindex:h},i("label",{key:"1312aba3259a87fe23a6911cdfa477e309469c8b",class:"radio-wrapper"},i("div",{key:"b342aa27e240a300836d2a135658d346b95daf09",class:{"label-text-wrapper":!0,"label-text-wrapper-hidden":!l},part:"label"},i("slot",{key:"0a4613d29aa783d1882cf889377f7e4fd4fea51d"})),i("div",{key:"191faea79dc4cd8befc4b873f5bd9f5af8ca2acc",class:"native-wrapper"},this.renderRadioControl())))}get el(){return a(this)}static get watchers(){return{value:[{valueChanged:0}]}}};let m=0;b.style={ios:':host{--inner-border-radius:50%;display:inline-block;position:relative;max-width:100%;min-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}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(:focus){outline:none}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}.radio-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;min-height:inherit;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.radio-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.radio-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between) .radio-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.radio-justify-start) .radio-wrapper{-ms-flex-pack:start;justify-content:start}:host(.radio-justify-end) .radio-wrapper{-ms-flex-pack:end;justify-content:end}:host(.radio-alignment-start) .radio-wrapper{-ms-flex-align:start;align-items:start}:host(.radio-alignment-center) .radio-wrapper{-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between),:host(.radio-justify-start),:host(.radio-justify-end),:host(.radio-alignment-start),:host(.radio-alignment-center){display:block}:host(.radio-label-placement-start) .radio-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.radio-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-end) .radio-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.radio-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.radio-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px}:host(.radio-label-placement-stacked) .radio-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.radio-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host{--color-checked:var(--ion-color-primary, #0054e9)}:host(.ion-color.radio-checked) .radio-inner{border-color:var(--ion-color-base)}.item-radio.item-ios ion-label{-webkit-margin-start:0;margin-inline-start:0}.radio-inner{width:33%;height:50%}:host(.radio-checked) .radio-inner{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:0.125rem;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}:host(.radio-disabled){opacity:0.3}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #1a65eb);content:"";opacity:0.2}:host(.ion-focused) .radio-icon::after{inset-inline-start:-9px}.native-wrapper .radio-icon{width:0.9375rem;height:1.5rem}',md:':host{--inner-border-radius:50%;display:inline-block;position:relative;max-width:100%;min-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}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(:focus){outline:none}:host(.in-item){-ms-flex:1 1 0px;flex:1 1 0;width:100%;height:100%}:host([slot=start]),:host([slot=end]){-ms-flex:initial;flex:initial;width:auto}.radio-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:inherit;min-height:inherit;cursor:inherit}.label-text-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(.in-item) .label-text-wrapper{margin-top:10px;margin-bottom:10px}:host(.in-item.radio-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.radio-label-placement-stacked) .native-wrapper{margin-bottom:10px}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between) .radio-wrapper{-ms-flex-pack:justify;justify-content:space-between}:host(.radio-justify-start) .radio-wrapper{-ms-flex-pack:start;justify-content:start}:host(.radio-justify-end) .radio-wrapper{-ms-flex-pack:end;justify-content:end}:host(.radio-alignment-start) .radio-wrapper{-ms-flex-align:start;align-items:start}:host(.radio-alignment-center) .radio-wrapper{-ms-flex-align:center;align-items:center}:host(.radio-justify-space-between),:host(.radio-justify-start),:host(.radio-justify-end),:host(.radio-alignment-start),:host(.radio-alignment-center){display:block}:host(.radio-label-placement-start) .radio-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.radio-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-end) .radio-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.radio-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}:host(.radio-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}:host(.radio-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px}:host(.radio-label-placement-stacked) .radio-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.radio-label-placement-stacked) .label-text-wrapper{-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-start) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-start .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-start:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper{-webkit-transform-origin:center top;transform-origin:center top}:host-context([dir=rtl]):host(.radio-label-placement-stacked.radio-alignment-center) .label-text-wrapper,:host-context([dir=rtl]).radio-label-placement-stacked.radio-alignment-center .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}@supports selector(:dir(rtl)){:host(.radio-label-placement-stacked.radio-alignment-center:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:calc(100% - center) top;transform-origin:calc(100% - center) top}}:host{--color:rgb(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #0054e9);--border-width:0.125rem;--border-style:solid;--border-radius:50%}:host(.ion-color) .radio-inner{background:var(--ion-color-base)}:host(.ion-color.radio-checked) .radio-icon{border-color:var(--ion-color-base)}.radio-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--color)}.radio-inner{border-radius:var(--inner-border-radius);width:calc(50% + var(--border-width));height:calc(50% + var(--border-width));-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background:var(--color-checked)}:host(.radio-checked) .radio-icon{border-color:var(--color-checked)}:host(.radio-checked) .radio-inner{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}:host(.radio-disabled) .label-text-wrapper{opacity:0.38}:host(.radio-disabled) .native-wrapper{opacity:0.63}:host(.ion-focused) .radio-icon::after{border-radius:var(--inner-border-radius);display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #1a65eb);content:"";opacity:0.2}.native-wrapper .radio-icon{width:1.25rem;height:1.25rem}'};const g=class{constructor(i){e(this,i),this.ionChange=t(this,"ionChange",7),this.ionValueChange=t(this,"ionValueChange",7),this.inputId="ion-rg-"+x++,this.helperTextId=`${this.inputId}-helper-text`,this.errorTextId=`${this.inputId}-error-text`,this.labelId=`${this.inputId}-lbl`,this.isInvalid=!1,this.allowEmptySelection=!1,this.name=this.inputId,this.setRadioTabindex=e=>{const t=this.getRadios(),i=t.find((e=>!e.disabled)),r=t.find((t=>t.value===e&&!t.disabled));if(!i&&!r)return;const a=r||i;for(const e of t)e.setButtonTabindex(e===a?0:-1)},this.onClick=e=>{e.preventDefault();const t=e.target&&e.target.closest("ion-radio");if(t&&!t.disabled){const i=t.value;i!==this.value?(this.value=i,this.emitValueChange(e)):this.allowEmptySelection&&(this.value=void 0,this.emitValueChange(e))}}}valueChanged(e){this.setRadioTabindex(e),this.ionValueChange.emit({value:e})}componentDidLoad(){this.valueChanged(this.value)}async connectedCallback(){const e=this.el.querySelector("ion-list-header")||this.el.querySelector("ion-item-divider");if(e){const t=this.label=e.querySelector("ion-label");t&&(this.labelId=t.id=this.name+"-lbl")}"undefined"!=typeof MutationObserver&&(this.validationObserver=new MutationObserver((()=>{const e=h(this.el);this.isInvalid!==e&&(this.isInvalid=e,Promise.resolve().then((()=>{this.hintTextId=this.getHintTextId()})))})),this.validationObserver.observe(this.el,{attributes:!0,attributeFilter:["class"]})),this.isInvalid=h(this.el)}componentWillLoad(){this.hintTextId=this.getHintTextId()}disconnectedCallback(){this.validationObserver&&(this.validationObserver.disconnect(),this.validationObserver=void 0)}getRadios(){return Array.from(this.el.querySelectorAll("ion-radio"))}emitValueChange(e){const{value:t}=this;this.ionChange.emit({value:t,event:e})}onKeydown(e){const t=!!this.el.closest("ion-select-popover")||!!this.el.closest("ion-select-modal");if(e.target&&!this.el.contains(e.target))return;const i=this.getRadios().filter((e=>!e.disabled));if(e.target&&i.includes(e.target)){const r=i.findIndex((t=>t===e.target)),a=i[r];let o;if(["ArrowDown","ArrowRight"].includes(e.key)&&(o=r===i.length-1?i[0]:i[r+1]),["ArrowUp","ArrowLeft"].includes(e.key)&&(o=0===r?i[i.length-1]:i[r-1]),o&&i.includes(o)&&(o.setFocus(e),t||(this.value=o.value,this.emitValueChange(e))),[" "].includes(e.key)){const t=this.value;this.value=this.allowEmptySelection&&void 0!==this.value?void 0:a.value,(t!==this.value||this.allowEmptySelection)&&this.emitValueChange(e),e.preventDefault()}if("Enter"===e.key&&t&&!e.repeat){const t=this.value;this.value=a.value,t!==this.value&&this.emitValueChange(e),e.preventDefault()}}}async setFocus(){const e=this.getRadios().find((e=>-1!==e.tabIndex));null==e||e.setFocus()}renderHintText(){const{helperText:e,errorText:t,helperTextId:r,errorTextId:a,isInvalid:o}=this;if(e||t)return i("div",{class:"radio-group-top"},i("div",{id:r,class:"helper-text","aria-live":"polite"},o?null:e),i("div",{id:a,class:"error-text",role:"alert"},o?t:null))}getHintTextId(){const{helperText:e,errorText:t,helperTextId:i,errorTextId:r,isInvalid:a}=this;return a&&t?r:e?i:void 0}render(){const{label:e,labelId:t,el:a,name:o,value:n}=this,l=p(this);return s(!0,a,o,n,!1),i(r,{key:"377e4aa3a656cc84b742f9d7a7d4be65d20c69f5",role:"radiogroup","aria-labelledby":e?t:null,"aria-describedby":this.hintTextId,"aria-invalid":this.isInvalid?"true":void 0,onClick:this.onClick,class:l},this.renderHintText(),i("slot",{key:"c3187a2497773b4f15cea3b413b036502bcec8c0"}))}get el(){return a(this)}static get watchers(){return{value:[{valueChanged:0}]}}};let x=0;g.style={ios:"ion-radio-group{vertical-align:top}.radio-group-top{line-height:1.5}.radio-group-top .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.radio-group-top .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid .radio-group-top .error-text{display:block}.ion-touched.ion-invalid .radio-group-top .helper-text{display:none}ion-list .radio-group-top{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}",md:"ion-radio-group{vertical-align:top}.radio-group-top{line-height:1.5}.radio-group-top .error-text{display:none;color:var(--ion-color-danger, #c5000f)}.radio-group-top .helper-text{display:block;color:var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d))}.ion-touched.ion-invalid .radio-group-top .error-text{display:block}.ion-touched.ion-invalid .radio-group-top .helper-text{display:none}ion-list .radio-group-top{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}"};export{b as ion_radio,g as ion_radio_group}
|
|
@@ -3,6 +3,6 @@ export declare class RadioFixture {
|
|
|
3
3
|
readonly page: E2EPage;
|
|
4
4
|
private radio;
|
|
5
5
|
constructor(page: E2EPage);
|
|
6
|
-
checkRadio(method: 'keyboard' | 'mouse', selector?: string): Promise<import("@utils/test/playwright").E2ELocator>;
|
|
6
|
+
checkRadio(method: 'keyboard' | 'mouse', selector?: string, key?: 'Space' | 'Enter'): Promise<import("@utils/test/playwright").E2ELocator>;
|
|
7
7
|
expectChecked(state: boolean): Promise<void>;
|
|
8
8
|
}
|
|
@@ -2,6 +2,7 @@ import type { ComponentInterface } from '../../stencil-public-runtime';
|
|
|
2
2
|
import type { SelectModalOption } from './select-modal-interface';
|
|
3
3
|
export declare class SelectModal implements ComponentInterface {
|
|
4
4
|
el: HTMLIonSelectModalElement;
|
|
5
|
+
private pendingEnterTarget;
|
|
5
6
|
header?: string;
|
|
6
7
|
/**
|
|
7
8
|
* The text to display on the cancel button.
|
|
@@ -12,5 +12,6 @@ export declare class SelectModalPage {
|
|
|
12
12
|
screenshot(screenshot: ScreenshotFn, name: string): Promise<void>;
|
|
13
13
|
clickOption(value: string): Promise<void>;
|
|
14
14
|
pressSpaceOnOption(value: string): Promise<void>;
|
|
15
|
+
pressEnterOnOption(value: string): Promise<void>;
|
|
15
16
|
private getOption;
|
|
16
17
|
}
|
|
@@ -12,5 +12,6 @@ export declare class SelectPopoverPage {
|
|
|
12
12
|
screenshot(screenshot: ScreenshotFn, name: string): Promise<void>;
|
|
13
13
|
clickOption(value: string): Promise<void>;
|
|
14
14
|
pressSpaceOnOption(value: string): Promise<void>;
|
|
15
|
+
pressEnterOnOption(value: string): Promise<void>;
|
|
15
16
|
private getOption;
|
|
16
17
|
}
|
package/hydrate/index.js
CHANGED
|
@@ -31354,6 +31354,18 @@ class RadioGroup {
|
|
|
31354
31354
|
// to the bottom of the screen
|
|
31355
31355
|
ev.preventDefault();
|
|
31356
31356
|
}
|
|
31357
|
+
// Inside a select interface, Enter commits the focused radio
|
|
31358
|
+
// value (matching native <select>). The !ev.repeat guard stops
|
|
31359
|
+
// a held Enter on the triggering ion-select from re-committing
|
|
31360
|
+
// once focus lands in the opened popover/modal.
|
|
31361
|
+
if (ev.key === 'Enter' && inSelectInterface && !ev.repeat) {
|
|
31362
|
+
const previousValue = this.value;
|
|
31363
|
+
this.value = current.value;
|
|
31364
|
+
if (previousValue !== this.value) {
|
|
31365
|
+
this.emitValueChange(ev);
|
|
31366
|
+
}
|
|
31367
|
+
ev.preventDefault();
|
|
31368
|
+
}
|
|
31357
31369
|
}
|
|
31358
31370
|
}
|
|
31359
31371
|
/** @internal */
|
|
@@ -31386,7 +31398,7 @@ class RadioGroup {
|
|
|
31386
31398
|
const { label, labelId, el, name, value } = this;
|
|
31387
31399
|
const mode = getIonMode$1(this);
|
|
31388
31400
|
renderHiddenInput(true, el, name, value, false);
|
|
31389
|
-
return (hAsync(Host, { key: '
|
|
31401
|
+
return (hAsync(Host, { key: '377e4aa3a656cc84b742f9d7a7d4be65d20c69f5', role: "radiogroup", "aria-labelledby": label ? labelId : null, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, class: mode }, this.renderHintText(), hAsync("slot", { key: 'c3187a2497773b4f15cea3b413b036502bcec8c0' })));
|
|
31390
31402
|
}
|
|
31391
31403
|
get el() { return getElement(this); }
|
|
31392
31404
|
static get watchers() { return {
|
|
@@ -37475,6 +37487,10 @@ const selectModalMdCss = () => `.sc-ion-select-modal-md-h{height:100%}ion-list.s
|
|
|
37475
37487
|
class SelectModal {
|
|
37476
37488
|
constructor(hostRef) {
|
|
37477
37489
|
registerInstance(this, hostRef);
|
|
37490
|
+
// Tracks the option that received Enter-keydown so keyup only
|
|
37491
|
+
// dismisses when the press started on the same option. Prevents
|
|
37492
|
+
// Enter on the triggering ion-select from auto-dismissing.
|
|
37493
|
+
this.pendingEnterTarget = null;
|
|
37478
37494
|
/**
|
|
37479
37495
|
* The text to display on the cancel button.
|
|
37480
37496
|
*/
|
|
@@ -37524,15 +37540,22 @@ class SelectModal {
|
|
|
37524
37540
|
return (hAsync("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, this.options.map((option) => (hAsync("ion-item", { lines: "none", class: Object.assign({
|
|
37525
37541
|
// TODO FW-4784
|
|
37526
37542
|
'item-radio-checked': option.value === checked
|
|
37527
|
-
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, justify: "start", labelPlacement: "end", onClick: () => this.closeModal(),
|
|
37543
|
+
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, justify: "start", labelPlacement: "end", onClick: () => this.closeModal(), onKeyDown: (ev) => {
|
|
37544
|
+
if (ev.key === 'Enter' && !ev.repeat) {
|
|
37545
|
+
this.pendingEnterTarget = ev.currentTarget;
|
|
37546
|
+
}
|
|
37547
|
+
}, onKeyUp: (ev) => {
|
|
37528
37548
|
if (ev.key === ' ') {
|
|
37529
|
-
|
|
37530
|
-
* Selecting a radio option with keyboard navigation,
|
|
37531
|
-
* either through the Enter or Space keys, should
|
|
37532
|
-
* dismiss the modal.
|
|
37533
|
-
*/
|
|
37549
|
+
// Space selects and dismisses in one press.
|
|
37534
37550
|
this.closeModal();
|
|
37535
37551
|
}
|
|
37552
|
+
else if (ev.key === 'Enter') {
|
|
37553
|
+
const shouldClose = this.pendingEnterTarget === ev.currentTarget;
|
|
37554
|
+
this.pendingEnterTarget = null;
|
|
37555
|
+
if (shouldClose) {
|
|
37556
|
+
this.closeModal();
|
|
37557
|
+
}
|
|
37558
|
+
}
|
|
37536
37559
|
} }, option.text))))));
|
|
37537
37560
|
}
|
|
37538
37561
|
renderCheckboxOptions() {
|
|
@@ -37545,7 +37568,7 @@ class SelectModal {
|
|
|
37545
37568
|
} }, option.text))));
|
|
37546
37569
|
}
|
|
37547
37570
|
render() {
|
|
37548
|
-
return (hAsync(Host, { key: '
|
|
37571
|
+
return (hAsync(Host, { key: 'fda0bf6f93cd5ec9f3c64f88a52de849e0e140a2', class: getIonMode$1(this) }, hAsync("ion-header", { key: '27c0b17175a53db9ff159feeeb96451a3f011dab' }, hAsync("ion-toolbar", { key: '91a4155ebc317fbc9f1bb3e26a7e94754b953c9b' }, this.header !== undefined && hAsync("ion-title", { key: 'f6dae8e4e381f322cc90efefd9bb6ef81d4d2f3e' }, this.header), hAsync("ion-buttons", { key: 'e7760532fb2e7e7385ed6e62097d92d96ff20148', slot: "end" }, hAsync("ion-button", { key: '4999b6fc46cba138186546dca67b7950855e6fb7', onClick: () => this.closeModal() }, this.cancelText)))), hAsync("ion-content", { key: 'c73f80a4bc25b9061ea65cf11e5d811c1a4d8704' }, hAsync("ion-list", { key: 'b21905d15b36ad5eb45845e768918d2763cf48b1' }, this.multiple === true ? this.renderCheckboxOptions() : this.renderRadioOptions()))));
|
|
37549
37572
|
}
|
|
37550
37573
|
get el() { return getElement(this); }
|
|
37551
37574
|
static get style() { return {
|
|
@@ -37608,6 +37631,10 @@ const selectPopoverMdCss = () => `.sc-ion-select-popover-md-h ion-list.sc-ion-se
|
|
|
37608
37631
|
class SelectPopover {
|
|
37609
37632
|
constructor(hostRef) {
|
|
37610
37633
|
registerInstance(this, hostRef);
|
|
37634
|
+
// Tracks the option that received Enter-keydown so keyup only
|
|
37635
|
+
// dismisses when the press started on the same option. Prevents
|
|
37636
|
+
// Enter on the triggering ion-select from auto-dismissing.
|
|
37637
|
+
this.pendingEnterTarget = null;
|
|
37611
37638
|
/**
|
|
37612
37639
|
* An array of options for the popover
|
|
37613
37640
|
*/
|
|
@@ -37683,21 +37710,28 @@ class SelectPopover {
|
|
|
37683
37710
|
return (hAsync("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, options.map((option) => (hAsync("ion-item", { class: Object.assign({
|
|
37684
37711
|
// TODO FW-4784
|
|
37685
37712
|
'item-radio-checked': option.value === checked
|
|
37686
|
-
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, onClick: () => this.dismissParentPopover(),
|
|
37713
|
+
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, onClick: () => this.dismissParentPopover(), onKeyDown: (ev) => {
|
|
37714
|
+
if (ev.key === 'Enter' && !ev.repeat) {
|
|
37715
|
+
this.pendingEnterTarget = ev.currentTarget;
|
|
37716
|
+
}
|
|
37717
|
+
}, onKeyUp: (ev) => {
|
|
37687
37718
|
if (ev.key === ' ') {
|
|
37688
|
-
|
|
37689
|
-
* Selecting a radio option with keyboard navigation,
|
|
37690
|
-
* either through the Enter or Space keys, should
|
|
37691
|
-
* dismiss the popover.
|
|
37692
|
-
*/
|
|
37719
|
+
// Space selects and dismisses in one press.
|
|
37693
37720
|
this.dismissParentPopover();
|
|
37694
37721
|
}
|
|
37722
|
+
else if (ev.key === 'Enter') {
|
|
37723
|
+
const shouldDismiss = this.pendingEnterTarget === ev.currentTarget;
|
|
37724
|
+
this.pendingEnterTarget = null;
|
|
37725
|
+
if (shouldDismiss) {
|
|
37726
|
+
this.dismissParentPopover();
|
|
37727
|
+
}
|
|
37728
|
+
}
|
|
37695
37729
|
} }, option.text))))));
|
|
37696
37730
|
}
|
|
37697
37731
|
render() {
|
|
37698
37732
|
const { header, message, options, subHeader } = this;
|
|
37699
37733
|
const hasSubHeaderOrMessage = subHeader !== undefined || message !== undefined;
|
|
37700
|
-
return (hAsync(Host, { key: '
|
|
37734
|
+
return (hAsync(Host, { key: 'e7449a1ecfcdbf45a79f8e26a00253c4e146448a', class: getIonMode$1(this) }, hAsync("ion-list", { key: '52abdfc8668c3429a0dcefef8ddedb6647fdd894' }, header !== undefined && hAsync("ion-list-header", { key: '978e5c03728756feafcc60a0e10e6ec59bf2ae11' }, header), hasSubHeaderOrMessage && (hAsync("ion-item", { key: 'e93c44e7f07a76def16e4b11f0fb4780d84ed402' }, hAsync("ion-label", { key: 'bba1aac43b0bc7f4f00978dd8301985233f3725c', class: "ion-text-wrap" }, subHeader !== undefined && hAsync("h3", { key: 'ad96f6017cf2cc5219540bded2c4f1ca3b532de2' }, subHeader), message !== undefined && hAsync("p", { key: '3fd038921dc40c4d0c29734433984b279ccaeec3' }, message)))), this.renderOptions(options))));
|
|
37701
37735
|
}
|
|
37702
37736
|
get el() { return getElement(this); }
|
|
37703
37737
|
static get style() { return {
|
package/hydrate/index.mjs
CHANGED
|
@@ -31352,6 +31352,18 @@ class RadioGroup {
|
|
|
31352
31352
|
// to the bottom of the screen
|
|
31353
31353
|
ev.preventDefault();
|
|
31354
31354
|
}
|
|
31355
|
+
// Inside a select interface, Enter commits the focused radio
|
|
31356
|
+
// value (matching native <select>). The !ev.repeat guard stops
|
|
31357
|
+
// a held Enter on the triggering ion-select from re-committing
|
|
31358
|
+
// once focus lands in the opened popover/modal.
|
|
31359
|
+
if (ev.key === 'Enter' && inSelectInterface && !ev.repeat) {
|
|
31360
|
+
const previousValue = this.value;
|
|
31361
|
+
this.value = current.value;
|
|
31362
|
+
if (previousValue !== this.value) {
|
|
31363
|
+
this.emitValueChange(ev);
|
|
31364
|
+
}
|
|
31365
|
+
ev.preventDefault();
|
|
31366
|
+
}
|
|
31355
31367
|
}
|
|
31356
31368
|
}
|
|
31357
31369
|
/** @internal */
|
|
@@ -31384,7 +31396,7 @@ class RadioGroup {
|
|
|
31384
31396
|
const { label, labelId, el, name, value } = this;
|
|
31385
31397
|
const mode = getIonMode$1(this);
|
|
31386
31398
|
renderHiddenInput(true, el, name, value, false);
|
|
31387
|
-
return (hAsync(Host, { key: '
|
|
31399
|
+
return (hAsync(Host, { key: '377e4aa3a656cc84b742f9d7a7d4be65d20c69f5', role: "radiogroup", "aria-labelledby": label ? labelId : null, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, class: mode }, this.renderHintText(), hAsync("slot", { key: 'c3187a2497773b4f15cea3b413b036502bcec8c0' })));
|
|
31388
31400
|
}
|
|
31389
31401
|
get el() { return getElement(this); }
|
|
31390
31402
|
static get watchers() { return {
|
|
@@ -37473,6 +37485,10 @@ const selectModalMdCss = () => `.sc-ion-select-modal-md-h{height:100%}ion-list.s
|
|
|
37473
37485
|
class SelectModal {
|
|
37474
37486
|
constructor(hostRef) {
|
|
37475
37487
|
registerInstance(this, hostRef);
|
|
37488
|
+
// Tracks the option that received Enter-keydown so keyup only
|
|
37489
|
+
// dismisses when the press started on the same option. Prevents
|
|
37490
|
+
// Enter on the triggering ion-select from auto-dismissing.
|
|
37491
|
+
this.pendingEnterTarget = null;
|
|
37476
37492
|
/**
|
|
37477
37493
|
* The text to display on the cancel button.
|
|
37478
37494
|
*/
|
|
@@ -37522,15 +37538,22 @@ class SelectModal {
|
|
|
37522
37538
|
return (hAsync("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, this.options.map((option) => (hAsync("ion-item", { lines: "none", class: Object.assign({
|
|
37523
37539
|
// TODO FW-4784
|
|
37524
37540
|
'item-radio-checked': option.value === checked
|
|
37525
|
-
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, justify: "start", labelPlacement: "end", onClick: () => this.closeModal(),
|
|
37541
|
+
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, justify: "start", labelPlacement: "end", onClick: () => this.closeModal(), onKeyDown: (ev) => {
|
|
37542
|
+
if (ev.key === 'Enter' && !ev.repeat) {
|
|
37543
|
+
this.pendingEnterTarget = ev.currentTarget;
|
|
37544
|
+
}
|
|
37545
|
+
}, onKeyUp: (ev) => {
|
|
37526
37546
|
if (ev.key === ' ') {
|
|
37527
|
-
|
|
37528
|
-
* Selecting a radio option with keyboard navigation,
|
|
37529
|
-
* either through the Enter or Space keys, should
|
|
37530
|
-
* dismiss the modal.
|
|
37531
|
-
*/
|
|
37547
|
+
// Space selects and dismisses in one press.
|
|
37532
37548
|
this.closeModal();
|
|
37533
37549
|
}
|
|
37550
|
+
else if (ev.key === 'Enter') {
|
|
37551
|
+
const shouldClose = this.pendingEnterTarget === ev.currentTarget;
|
|
37552
|
+
this.pendingEnterTarget = null;
|
|
37553
|
+
if (shouldClose) {
|
|
37554
|
+
this.closeModal();
|
|
37555
|
+
}
|
|
37556
|
+
}
|
|
37534
37557
|
} }, option.text))))));
|
|
37535
37558
|
}
|
|
37536
37559
|
renderCheckboxOptions() {
|
|
@@ -37543,7 +37566,7 @@ class SelectModal {
|
|
|
37543
37566
|
} }, option.text))));
|
|
37544
37567
|
}
|
|
37545
37568
|
render() {
|
|
37546
|
-
return (hAsync(Host, { key: '
|
|
37569
|
+
return (hAsync(Host, { key: 'fda0bf6f93cd5ec9f3c64f88a52de849e0e140a2', class: getIonMode$1(this) }, hAsync("ion-header", { key: '27c0b17175a53db9ff159feeeb96451a3f011dab' }, hAsync("ion-toolbar", { key: '91a4155ebc317fbc9f1bb3e26a7e94754b953c9b' }, this.header !== undefined && hAsync("ion-title", { key: 'f6dae8e4e381f322cc90efefd9bb6ef81d4d2f3e' }, this.header), hAsync("ion-buttons", { key: 'e7760532fb2e7e7385ed6e62097d92d96ff20148', slot: "end" }, hAsync("ion-button", { key: '4999b6fc46cba138186546dca67b7950855e6fb7', onClick: () => this.closeModal() }, this.cancelText)))), hAsync("ion-content", { key: 'c73f80a4bc25b9061ea65cf11e5d811c1a4d8704' }, hAsync("ion-list", { key: 'b21905d15b36ad5eb45845e768918d2763cf48b1' }, this.multiple === true ? this.renderCheckboxOptions() : this.renderRadioOptions()))));
|
|
37547
37570
|
}
|
|
37548
37571
|
get el() { return getElement(this); }
|
|
37549
37572
|
static get style() { return {
|
|
@@ -37606,6 +37629,10 @@ const selectPopoverMdCss = () => `.sc-ion-select-popover-md-h ion-list.sc-ion-se
|
|
|
37606
37629
|
class SelectPopover {
|
|
37607
37630
|
constructor(hostRef) {
|
|
37608
37631
|
registerInstance(this, hostRef);
|
|
37632
|
+
// Tracks the option that received Enter-keydown so keyup only
|
|
37633
|
+
// dismisses when the press started on the same option. Prevents
|
|
37634
|
+
// Enter on the triggering ion-select from auto-dismissing.
|
|
37635
|
+
this.pendingEnterTarget = null;
|
|
37609
37636
|
/**
|
|
37610
37637
|
* An array of options for the popover
|
|
37611
37638
|
*/
|
|
@@ -37681,21 +37708,28 @@ class SelectPopover {
|
|
|
37681
37708
|
return (hAsync("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, options.map((option) => (hAsync("ion-item", { class: Object.assign({
|
|
37682
37709
|
// TODO FW-4784
|
|
37683
37710
|
'item-radio-checked': option.value === checked
|
|
37684
|
-
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, onClick: () => this.dismissParentPopover(),
|
|
37711
|
+
}, getClassMap(option.cssClass)) }, hAsync("ion-radio", { value: option.value, disabled: option.disabled, onClick: () => this.dismissParentPopover(), onKeyDown: (ev) => {
|
|
37712
|
+
if (ev.key === 'Enter' && !ev.repeat) {
|
|
37713
|
+
this.pendingEnterTarget = ev.currentTarget;
|
|
37714
|
+
}
|
|
37715
|
+
}, onKeyUp: (ev) => {
|
|
37685
37716
|
if (ev.key === ' ') {
|
|
37686
|
-
|
|
37687
|
-
* Selecting a radio option with keyboard navigation,
|
|
37688
|
-
* either through the Enter or Space keys, should
|
|
37689
|
-
* dismiss the popover.
|
|
37690
|
-
*/
|
|
37717
|
+
// Space selects and dismisses in one press.
|
|
37691
37718
|
this.dismissParentPopover();
|
|
37692
37719
|
}
|
|
37720
|
+
else if (ev.key === 'Enter') {
|
|
37721
|
+
const shouldDismiss = this.pendingEnterTarget === ev.currentTarget;
|
|
37722
|
+
this.pendingEnterTarget = null;
|
|
37723
|
+
if (shouldDismiss) {
|
|
37724
|
+
this.dismissParentPopover();
|
|
37725
|
+
}
|
|
37726
|
+
}
|
|
37693
37727
|
} }, option.text))))));
|
|
37694
37728
|
}
|
|
37695
37729
|
render() {
|
|
37696
37730
|
const { header, message, options, subHeader } = this;
|
|
37697
37731
|
const hasSubHeaderOrMessage = subHeader !== undefined || message !== undefined;
|
|
37698
|
-
return (hAsync(Host, { key: '
|
|
37732
|
+
return (hAsync(Host, { key: 'e7449a1ecfcdbf45a79f8e26a00253c4e146448a', class: getIonMode$1(this) }, hAsync("ion-list", { key: '52abdfc8668c3429a0dcefef8ddedb6647fdd894' }, header !== undefined && hAsync("ion-list-header", { key: '978e5c03728756feafcc60a0e10e6ec59bf2ae11' }, header), hasSubHeaderOrMessage && (hAsync("ion-item", { key: 'e93c44e7f07a76def16e4b11f0fb4780d84ed402' }, hAsync("ion-label", { key: 'bba1aac43b0bc7f4f00978dd8301985233f3725c', class: "ion-text-wrap" }, subHeader !== undefined && hAsync("h3", { key: 'ad96f6017cf2cc5219540bded2c4f1ca3b532de2' }, subHeader), message !== undefined && hAsync("p", { key: '3fd038921dc40c4d0c29734433984b279ccaeec3' }, message)))), this.renderOptions(options))));
|
|
37699
37733
|
}
|
|
37700
37734
|
get el() { return getElement(this); }
|
|
37701
37735
|
static get style() { return {
|
package/package.json
CHANGED
package/components/p-EK4xUz-q.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{p as o,H as e,h as i,i as t,d as s,t as r}from"./p-BJoMtgfR.js";import{s as n}from"./p-Cq8cQ0NL.js";import{g as a}from"./p-DiVJyqlX.js";import{b as c}from"./p-CDfQnFrd.js";import{d as p}from"./p-SBseW5KJ.js";import{d as m}from"./p-YLXPWgVj.js";import{d as l}from"./p-kvaDs24J.js";import{d}from"./p-B6FQ0cKR.js";import{d as b}from"./p-DYdpXONG.js";import{d as h}from"./p-BagjAGC0.js";import{d as f}from"./p-BSB38Tek.js";import{d as u}from"./p-Bk2zuNWT.js";import{d as v}from"./p-fpbh6w3f.js";const g=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.options=[]}findOptionFromEvent(o){const{options:e}=this;return e.find((e=>e.value===o.target.value))}callOptionHandler(o){const e=this.findOptionFromEvent(o),i=this.getValues(o);(null==e?void 0:e.handler)&&n(e.handler,i)}dismissParentPopover(){const o=this.el.closest("ion-popover");o&&o.dismiss()}setChecked(o){const{multiple:e}=this,i=this.findOptionFromEvent(o);e&&i&&(i.checked=o.detail.checked)}getValues(o){const{multiple:e,options:i}=this;if(e)return i.filter((o=>o.checked)).map((o=>o.value));const t=this.findOptionFromEvent(o);return t?t.value:void 0}renderOptions(o){const{multiple:e}=this;return!0===e?this.renderCheckboxOptions(o):this.renderRadioOptions(o)}renderCheckboxOptions(o){return o.map((o=>i("ion-item",{class:Object.assign({"item-checkbox-checked":o.checked},a(o.cssClass))},i("ion-checkbox",{value:o.value,disabled:o.disabled,checked:o.checked,justify:"start",labelPlacement:"end",onIonChange:o=>{this.setChecked(o),this.callOptionHandler(o),t(this)}},o.text))))}renderRadioOptions(o){const e=o.filter((o=>o.checked)).map((o=>o.value))[0];return i("ion-radio-group",{value:e,onIonChange:o=>this.callOptionHandler(o)},o.map((o=>i("ion-item",{class:Object.assign({"item-radio-checked":o.value===e},a(o.cssClass))},i("ion-radio",{value:o.value,disabled:o.disabled,onClick:()=>this.dismissParentPopover(),onKeyUp:o=>{" "===o.key&&this.dismissParentPopover()}},o.text)))))}render(){const{header:o,message:e,options:t,subHeader:r}=this,n=void 0!==r||void 0!==e;return i(s,{key:"0c9845a40d3fc392b0a7d64e2a6ed27d94bb7634",class:c(this)},i("ion-list",{key:"84a30f6661b0f8c00e6fa199658ed2adbcf27358"},void 0!==o&&i("ion-list-header",{key:"13f5f56bbfbc06751fa516291a2da72629b60ece"},o),n&&i("ion-item",{key:"3d39d18e720e798bbde334e79e6832091c7dfb81"},i("ion-label",{key:"d3051b0d140120b44bf5e79572f6f287e7cfb03a",class:"ion-text-wrap"},void 0!==r&&i("h3",{key:"b16805956f3316f8ec703c123b76f717488e8637"},r),void 0!==e&&i("p",{key:"2215ac4ab4146a14e75a79192e319a8016286b5f"},e))),this.renderOptions(t)))}get el(){return this}static get style(){return{ios:".sc-ion-select-popover-ios-h ion-list.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-ios,ion-label.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-select-popover-ios-h{overflow-y:auto}",md:'.sc-ion-select-popover-md-h ion-list.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-md,ion-label.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-select-popover-md-h{overflow-y:auto}ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md::part(container),ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md [part~="container"]{display:none}ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md::part(label),ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md [part~="label"]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-item.sc-ion-select-popover-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-popover-md{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-popover-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}'}}},[34,"ion-select-popover",{header:[1],subHeader:[1,"sub-header"],message:[1],multiple:[4],options:[16]}]);function k(){"undefined"!=typeof customElements&&["ion-select-popover","ion-checkbox","ion-icon","ion-item","ion-label","ion-list","ion-list-header","ion-radio","ion-radio-group","ion-ripple-effect"].forEach((o=>{switch(o){case"ion-select-popover":customElements.get(r(o))||customElements.define(r(o),g);break;case"ion-checkbox":customElements.get(r(o))||p();break;case"ion-icon":customElements.get(r(o))||m();break;case"ion-item":customElements.get(r(o))||l();break;case"ion-label":customElements.get(r(o))||d();break;case"ion-list":customElements.get(r(o))||b();break;case"ion-list-header":customElements.get(r(o))||h();break;case"ion-radio":customElements.get(r(o))||f();break;case"ion-radio-group":customElements.get(r(o))||u();break;case"ion-ripple-effect":customElements.get(r(o))||v()}}))}export{g as S,k as d}
|
package/components/p-MlJRD6E1.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{p as o,H as e,h as i,i as t,d as n,t as c}from"./p-BJoMtgfR.js";import{b as a}from"./p-CDfQnFrd.js";import{s}from"./p-Cq8cQ0NL.js";import{g as r}from"./p-DiVJyqlX.js";import{d as l}from"./p-BTeL5HCK.js";import{d}from"./p-B8b1Ukl9.js";import{d as m}from"./p-SBseW5KJ.js";import{d as b}from"./p-BGHGpkPX.js";import{d as p}from"./p-BYDc3hSE.js";import{d as h}from"./p-YLXPWgVj.js";import{d as u}from"./p-kvaDs24J.js";import{d as f}from"./p-DYdpXONG.js";import{d as k}from"./p-BSB38Tek.js";import{d as g}from"./p-Bk2zuNWT.js";import{d as v}from"./p-fpbh6w3f.js";import{d as y}from"./p-CgfaEEem.js";import{d as x}from"./p-DJMZehmW.js";const j=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.cancelText="Close",this.options=[]}closeModal(){const o=this.el.closest("ion-modal");o&&o.dismiss()}findOptionFromEvent(o){const{options:e}=this;return e.find((e=>e.value===o.target.value))}getValues(o){const{multiple:e,options:i}=this;if(e)return i.filter((o=>o.checked)).map((o=>o.value));const t=o?this.findOptionFromEvent(o):null;return t?t.value:void 0}callOptionHandler(o){const e=this.findOptionFromEvent(o),i=this.getValues(o);(null==e?void 0:e.handler)&&s(e.handler,i)}setChecked(o){const{multiple:e}=this,i=this.findOptionFromEvent(o);e&&i&&(i.checked=o.detail.checked)}renderRadioOptions(){const o=this.options.filter((o=>o.checked)).map((o=>o.value))[0];return i("ion-radio-group",{value:o,onIonChange:o=>this.callOptionHandler(o)},this.options.map((e=>i("ion-item",{lines:"none",class:Object.assign({"item-radio-checked":e.value===o},r(e.cssClass))},i("ion-radio",{value:e.value,disabled:e.disabled,justify:"start",labelPlacement:"end",onClick:()=>this.closeModal(),onKeyUp:o=>{" "===o.key&&this.closeModal()}},e.text)))))}renderCheckboxOptions(){return this.options.map((o=>i("ion-item",{class:Object.assign({"item-checkbox-checked":o.checked},r(o.cssClass))},i("ion-checkbox",{value:o.value,disabled:o.disabled,checked:o.checked,justify:"start",labelPlacement:"end",onIonChange:o=>{this.setChecked(o),this.callOptionHandler(o),t(this)}},o.text))))}render(){return i(n,{key:"f8a4cd6ff23ff01eaa1bdaf3c046814e7b30b23b",class:a(this)},i("ion-header",{key:"9e29a7e57ad5cf332641111882f16852187ec8ba"},i("ion-toolbar",{key:"e6af5d6eabbf4b10799fc8a0b8f91d29b12d41f5"},void 0!==this.header&&i("ion-title",{key:"6056e52d15dbf307571d25e0305d67228a79237d"},this.header),i("ion-buttons",{key:"c9aa4fb2e21a93f3a95c5a8f0ba8b7d5553c5a72",slot:"end"},i("ion-button",{key:"5ffbf512719bcb053b652fc96b1b6154d0593095",onClick:()=>this.closeModal()},this.cancelText)))),i("ion-content",{key:"0ec9098798a4e6de7a83a0a7e9d10bdcd7c98a78"},i("ion-list",{key:"d60b1700d3c2f8655951632de810900707a101f0"},!0===this.multiple?this.renderCheckboxOptions():this.renderRadioOptions())))}get el(){return this}static get style(){return{ionic:'.sc-ion-select-modal-ionic-h{height:100%}ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic::part(container),ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic [part~="container"]{display:none}ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic::part(label),ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic [part~="label"]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-item.sc-ion-select-modal-ionic{--inner-border-width:0}.item-radio-checked.sc-ion-select-modal-ionic{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-modal-ionic{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}',ios:'.sc-ion-select-modal-ios-h{height:100%}ion-item.sc-ion-select-modal-ios{--inner-padding-end:0}ion-radio.sc-ion-select-modal-ios::after{bottom:0;position:absolute;width:calc(100% - 0.9375rem - 16px);border-width:0px 0px 0.55px 0px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));content:""}ion-radio.sc-ion-select-modal-ios::after{inset-inline-start:calc(0.9375rem + 16px)}',md:'.sc-ion-select-modal-md-h{height:100%}ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md::part(container),ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md [part~="container"]{display:none}ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md::part(label),ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md [part~="label"]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-item.sc-ion-select-modal-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-modal-md{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-modal-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}'}}},[34,"ion-select-modal",{header:[1],cancelText:[1,"cancel-text"],multiple:[4],options:[16]}]);function E(){"undefined"!=typeof customElements&&["ion-select-modal","ion-button","ion-buttons","ion-checkbox","ion-content","ion-header","ion-icon","ion-item","ion-list","ion-radio","ion-radio-group","ion-ripple-effect","ion-title","ion-toolbar"].forEach((o=>{switch(o){case"ion-select-modal":customElements.get(c(o))||customElements.define(c(o),j);break;case"ion-button":customElements.get(c(o))||l();break;case"ion-buttons":customElements.get(c(o))||d();break;case"ion-checkbox":customElements.get(c(o))||m();break;case"ion-content":customElements.get(c(o))||b();break;case"ion-header":customElements.get(c(o))||p();break;case"ion-icon":customElements.get(c(o))||h();break;case"ion-item":customElements.get(c(o))||u();break;case"ion-list":customElements.get(c(o))||f();break;case"ion-radio":customElements.get(c(o))||k();break;case"ion-radio-group":customElements.get(c(o))||g();break;case"ion-ripple-effect":customElements.get(c(o))||v();break;case"ion-title":customElements.get(c(o))||y();break;case"ion-toolbar":customElements.get(c(o))||x()}}))}export{j as S,E as d}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as o,h as i,i as e,d as t,g as n}from"./p-IGIE5vDm.js";import{b as c}from"./p-NFFyoJ4Q.js";import{s as r}from"./p-DTPR1Wpn.js";import{g as a}from"./p-DiVJyqlX.js";import"./p-ZjP4CjeZ.js";import"./p-CGmVTdWh.js";import"./p-DB_iPQC-.js";import"./p-CmFz1Mjc.js";import"./p-BTEOs1at.js";const s=class{constructor(i){o(this,i),this.cancelText="Close",this.options=[]}closeModal(){const o=this.el.closest("ion-modal");o&&o.dismiss()}findOptionFromEvent(o){const{options:i}=this;return i.find((i=>i.value===o.target.value))}getValues(o){const{multiple:i,options:e}=this;if(i)return e.filter((o=>o.checked)).map((o=>o.value));const t=o?this.findOptionFromEvent(o):null;return t?t.value:void 0}callOptionHandler(o){const i=this.findOptionFromEvent(o),e=this.getValues(o);(null==i?void 0:i.handler)&&r(i.handler,e)}setChecked(o){const{multiple:i}=this,e=this.findOptionFromEvent(o);i&&e&&(e.checked=o.detail.checked)}renderRadioOptions(){const o=this.options.filter((o=>o.checked)).map((o=>o.value))[0];return i("ion-radio-group",{value:o,onIonChange:o=>this.callOptionHandler(o)},this.options.map((e=>i("ion-item",{lines:"none",class:Object.assign({"item-radio-checked":e.value===o},a(e.cssClass))},i("ion-radio",{value:e.value,disabled:e.disabled,justify:"start",labelPlacement:"end",onClick:()=>this.closeModal(),onKeyUp:o=>{" "===o.key&&this.closeModal()}},e.text)))))}renderCheckboxOptions(){return this.options.map((o=>i("ion-item",{class:Object.assign({"item-checkbox-checked":o.checked},a(o.cssClass))},i("ion-checkbox",{value:o.value,disabled:o.disabled,checked:o.checked,justify:"start",labelPlacement:"end",onIonChange:o=>{this.setChecked(o),this.callOptionHandler(o),e(this)}},o.text))))}render(){return i(t,{key:"f8a4cd6ff23ff01eaa1bdaf3c046814e7b30b23b",class:c(this)},i("ion-header",{key:"9e29a7e57ad5cf332641111882f16852187ec8ba"},i("ion-toolbar",{key:"e6af5d6eabbf4b10799fc8a0b8f91d29b12d41f5"},void 0!==this.header&&i("ion-title",{key:"6056e52d15dbf307571d25e0305d67228a79237d"},this.header),i("ion-buttons",{key:"c9aa4fb2e21a93f3a95c5a8f0ba8b7d5553c5a72",slot:"end"},i("ion-button",{key:"5ffbf512719bcb053b652fc96b1b6154d0593095",onClick:()=>this.closeModal()},this.cancelText)))),i("ion-content",{key:"0ec9098798a4e6de7a83a0a7e9d10bdcd7c98a78"},i("ion-list",{key:"d60b1700d3c2f8655951632de810900707a101f0"},!0===this.multiple?this.renderCheckboxOptions():this.renderRadioOptions())))}get el(){return n(this)}};s.style={ionic:'.sc-ion-select-modal-ionic-h{height:100%}ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic::part(container),ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic [part~="container"]{display:none}ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic::part(label),ion-list.sc-ion-select-modal-ionic ion-radio.sc-ion-select-modal-ionic [part~="label"]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-item.sc-ion-select-modal-ionic{--inner-border-width:0}.item-radio-checked.sc-ion-select-modal-ionic{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-modal-ionic{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}',ios:'.sc-ion-select-modal-ios-h{height:100%}ion-item.sc-ion-select-modal-ios{--inner-padding-end:0}ion-radio.sc-ion-select-modal-ios::after{bottom:0;position:absolute;width:calc(100% - 0.9375rem - 16px);border-width:0px 0px 0.55px 0px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));content:""}ion-radio.sc-ion-select-modal-ios::after{inset-inline-start:calc(0.9375rem + 16px)}',md:'.sc-ion-select-modal-md-h{height:100%}ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md::part(container),ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md [part~="container"]{display:none}ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md::part(label),ion-list.sc-ion-select-modal-md ion-radio.sc-ion-select-modal-md [part~="label"]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-item.sc-ion-select-modal-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-modal-md{--background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08);--background-focused:var(--ion-color-primary, #0054e9);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #0054e9);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-modal-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #0054e9)}'};export{s as ion_select_modal}
|