@ionic/core 7.5.5-dev.11699910223.156d984c → 7.5.5-dev.11699920122.1b01d13b
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-accordion-group.js +10 -0
- package/components/ion-datetime.js +1 -11
- package/dist/cjs/ion-accordion_2.cjs.entry.js +10 -0
- package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -11
- package/dist/collection/components/accordion-group/accordion-group.js +10 -0
- package/dist/collection/components/datetime/datetime.js +1 -11
- package/dist/docs.json +1 -1
- package/dist/esm/ion-accordion_2.entry.js +10 -0
- package/dist/esm/ion-datetime_3.entry.js +1 -11
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-26094a27.entry.js +4 -0
- package/dist/ionic/{p-70bf6086.system.entry.js → p-59f4fa22.system.entry.js} +1 -1
- package/dist/ionic/p-9a1f6169.system.entry.js +4 -0
- package/dist/ionic/p-a18ba684.entry.js +4 -0
- package/dist/ionic/p-c1db8914.system.js +1 -1
- package/hydrate/index.js +11 -11
- package/package.json +2 -2
- package/dist/ionic/p-12d62aa9.entry.js +0 -4
- package/dist/ionic/p-5daabbb5.system.entry.js +0 -4
- package/dist/ionic/p-cacfa6f6.entry.js +0 -4
|
@@ -112,6 +112,16 @@ const AccordionGroup = /*@__PURE__*/ proxyCustomElement(class AccordionGroup ext
|
|
|
112
112
|
if (this.readonly) {
|
|
113
113
|
this.readonlyChanged();
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* When binding values in frameworks such as Angular
|
|
117
|
+
* it is possible for the value to be set after the Web Component
|
|
118
|
+
* initializes but before the value watcher is set up in Stencil.
|
|
119
|
+
* As a result, the watcher callback may not be fired.
|
|
120
|
+
* We work around this by manually calling the watcher
|
|
121
|
+
* callback when the component has loaded and the watcher
|
|
122
|
+
* is configured.
|
|
123
|
+
*/
|
|
124
|
+
this.valueChanged();
|
|
115
125
|
}
|
|
116
126
|
/**
|
|
117
127
|
* Sets the value property and emits ionChange.
|
|
@@ -874,17 +874,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
874
874
|
if (activeParts !== undefined || !isCalendarPicker) {
|
|
875
875
|
const activePartsIsArray = Array.isArray(activeParts);
|
|
876
876
|
if (activePartsIsArray && activeParts.length === 0) {
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* If the datetime is using a wheel picker, but there
|
|
880
|
-
* is no active parts, then the user has confirmed the
|
|
881
|
-
* initial value (working parts) presented to them.
|
|
882
|
-
*/
|
|
883
|
-
this.setValue(convertDataToISO(this.workingParts));
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
this.setValue(undefined);
|
|
887
|
-
}
|
|
877
|
+
this.setValue(undefined);
|
|
888
878
|
}
|
|
889
879
|
else {
|
|
890
880
|
this.setValue(convertDataToISO(activeParts));
|
|
@@ -428,6 +428,16 @@ const AccordionGroup = class {
|
|
|
428
428
|
if (this.readonly) {
|
|
429
429
|
this.readonlyChanged();
|
|
430
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* When binding values in frameworks such as Angular
|
|
433
|
+
* it is possible for the value to be set after the Web Component
|
|
434
|
+
* initializes but before the value watcher is set up in Stencil.
|
|
435
|
+
* As a result, the watcher callback may not be fired.
|
|
436
|
+
* We work around this by manually calling the watcher
|
|
437
|
+
* callback when the component has loaded and the watcher
|
|
438
|
+
* is configured.
|
|
439
|
+
*/
|
|
440
|
+
this.valueChanged();
|
|
431
441
|
}
|
|
432
442
|
/**
|
|
433
443
|
* Sets the value property and emits ionChange.
|
|
@@ -873,17 +873,7 @@ const Datetime = class {
|
|
|
873
873
|
if (activeParts !== undefined || !isCalendarPicker) {
|
|
874
874
|
const activePartsIsArray = Array.isArray(activeParts);
|
|
875
875
|
if (activePartsIsArray && activeParts.length === 0) {
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* If the datetime is using a wheel picker, but there
|
|
879
|
-
* is no active parts, then the user has confirmed the
|
|
880
|
-
* initial value (working parts) presented to them.
|
|
881
|
-
*/
|
|
882
|
-
this.setValue(data.convertDataToISO(this.workingParts));
|
|
883
|
-
}
|
|
884
|
-
else {
|
|
885
|
-
this.setValue(undefined);
|
|
886
|
-
}
|
|
876
|
+
this.setValue(undefined);
|
|
887
877
|
}
|
|
888
878
|
else {
|
|
889
879
|
this.setValue(data.convertDataToISO(activeParts));
|
|
@@ -105,6 +105,16 @@ export class AccordionGroup {
|
|
|
105
105
|
if (this.readonly) {
|
|
106
106
|
this.readonlyChanged();
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* When binding values in frameworks such as Angular
|
|
110
|
+
* it is possible for the value to be set after the Web Component
|
|
111
|
+
* initializes but before the value watcher is set up in Stencil.
|
|
112
|
+
* As a result, the watcher callback may not be fired.
|
|
113
|
+
* We work around this by manually calling the watcher
|
|
114
|
+
* callback when the component has loaded and the watcher
|
|
115
|
+
* is configured.
|
|
116
|
+
*/
|
|
117
|
+
this.valueChanged();
|
|
108
118
|
}
|
|
109
119
|
/**
|
|
110
120
|
* Sets the value property and emits ionChange.
|
|
@@ -711,17 +711,7 @@ export class Datetime {
|
|
|
711
711
|
if (activeParts !== undefined || !isCalendarPicker) {
|
|
712
712
|
const activePartsIsArray = Array.isArray(activeParts);
|
|
713
713
|
if (activePartsIsArray && activeParts.length === 0) {
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* If the datetime is using a wheel picker, but there
|
|
717
|
-
* is no active parts, then the user has confirmed the
|
|
718
|
-
* initial value (working parts) presented to them.
|
|
719
|
-
*/
|
|
720
|
-
this.setValue(convertDataToISO(this.workingParts));
|
|
721
|
-
}
|
|
722
|
-
else {
|
|
723
|
-
this.setValue(undefined);
|
|
724
|
-
}
|
|
714
|
+
this.setValue(undefined);
|
|
725
715
|
}
|
|
726
716
|
else {
|
|
727
717
|
this.setValue(convertDataToISO(activeParts));
|
package/dist/docs.json
CHANGED
|
@@ -424,6 +424,16 @@ const AccordionGroup = class {
|
|
|
424
424
|
if (this.readonly) {
|
|
425
425
|
this.readonlyChanged();
|
|
426
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* When binding values in frameworks such as Angular
|
|
429
|
+
* it is possible for the value to be set after the Web Component
|
|
430
|
+
* initializes but before the value watcher is set up in Stencil.
|
|
431
|
+
* As a result, the watcher callback may not be fired.
|
|
432
|
+
* We work around this by manually calling the watcher
|
|
433
|
+
* callback when the component has loaded and the watcher
|
|
434
|
+
* is configured.
|
|
435
|
+
*/
|
|
436
|
+
this.valueChanged();
|
|
427
437
|
}
|
|
428
438
|
/**
|
|
429
439
|
* Sets the value property and emits ionChange.
|
|
@@ -869,17 +869,7 @@ const Datetime = class {
|
|
|
869
869
|
if (activeParts !== undefined || !isCalendarPicker) {
|
|
870
870
|
const activePartsIsArray = Array.isArray(activeParts);
|
|
871
871
|
if (activePartsIsArray && activeParts.length === 0) {
|
|
872
|
-
|
|
873
|
-
/**
|
|
874
|
-
* If the datetime is using a wheel picker, but there
|
|
875
|
-
* is no active parts, then the user has confirmed the
|
|
876
|
-
* initial value (working parts) presented to them.
|
|
877
|
-
*/
|
|
878
|
-
this.setValue(convertDataToISO(this.workingParts));
|
|
879
|
-
}
|
|
880
|
-
else {
|
|
881
|
-
this.setValue(undefined);
|
|
882
|
-
}
|
|
872
|
+
this.setValue(undefined);
|
|
883
873
|
}
|
|
884
874
|
else {
|
|
885
875
|
this.setValue(convertDataToISO(activeParts));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator,__spreadArray}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,h,H as Host,f as getElement,d as createEvent}from"./index-4392ebcb.js";import{r as raf,t as transitionEndAsync,a as addEventListener,b as removeEventListener,g as getElementRoot}from"./helpers-3379ba19.js";import{l as chevronDown}from"./index-c132c5f1.js";import{c as config,b as getIonMode}from"./ionic-global-7efdecd0.js";import{p as printIonWarning}from"./index-595d62c9.js";var accordionIosCss=":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}";var accordionMdCss=":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}";var Accordion=function(){function n(n){var t=this;registerInstance(this,n);this.updateListener=function(){return t.updateState(false)};this.setItemDefaults=function(){var n=t.getSlottedHeaderIonItem();if(!n){return}n.button=true;n.detail=false;if(n.lines===undefined){n.lines="full"}};this.getSlottedHeaderIonItem=function(){var n=t.headerEl;if(!n){return}var i=n.querySelector("slot");if(!i){return}if(i.assignedElements===undefined)return;return i.assignedElements().find((function(n){return n.tagName==="ION-ITEM"}))};this.setAria=function(n){if(n===void 0){n=false}var i=t.getSlottedHeaderIonItem();if(!i){return}var o=getElementRoot(i);var r=o.querySelector("button");if(!r){return}r.setAttribute("aria-expanded","".concat(n))};this.slotToggleIcon=function(){var n=t.getSlottedHeaderIonItem();if(!n){return}var i=t,o=i.toggleIconSlot,r=i.toggleIcon;var e=n.querySelector(".ion-accordion-toggle-icon");if(e){return}var a=document.createElement("ion-icon");a.slot=o;a.lazy=false;a.classList.add("ion-accordion-toggle-icon");a.icon=r;a.setAttribute("aria-hidden","true");n.appendChild(a)};this.expandAccordion=function(n){if(n===void 0){n=false}var i=t,o=i.contentEl,r=i.contentElWrapper;if(n||o===undefined||r===undefined){t.state=4;return}if(t.state===4){return}if(t.currentRaf!==undefined){cancelAnimationFrame(t.currentRaf)}if(t.shouldAnimate()){raf((function(){t.state=8;t.currentRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){var n,t;return __generator(this,(function(i){switch(i.label){case 0:n=r.offsetHeight;t=transitionEndAsync(o,2e3);o.style.setProperty("max-height","".concat(n,"px"));return[4,t];case 1:i.sent();this.state=4;o.style.removeProperty("max-height");return[2]}}))}))}))}))}else{t.state=4}};this.collapseAccordion=function(n){if(n===void 0){n=false}var i=t.contentEl;if(n||i===undefined){t.state=1;return}if(t.state===1){return}if(t.currentRaf!==undefined){cancelAnimationFrame(t.currentRaf)}if(t.shouldAnimate()){t.currentRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){var n;var t=this;return __generator(this,(function(o){n=i.offsetHeight;i.style.setProperty("max-height","".concat(n,"px"));raf((function(){return __awaiter(t,void 0,void 0,(function(){var n;return __generator(this,(function(t){switch(t.label){case 0:n=transitionEndAsync(i,2e3);this.state=2;return[4,n];case 1:t.sent();this.state=1;i.style.removeProperty("max-height");return[2]}}))}))}));return[2]}))}))}))}else{t.state=1}};this.shouldAnimate=function(){if(typeof window==="undefined"){return false}var n=matchMedia("(prefers-reduced-motion: reduce)").matches;if(n){return false}var i=config.get("animated",true);if(!i){return false}if(t.accordionGroupEl&&!t.accordionGroupEl.animated){return false}return true};this.updateState=function(n){if(n===void 0){n=false}return __awaiter(t,void 0,void 0,(function(){var t,i,o,r,e,a,s,d;return __generator(this,(function(c){t=this.accordionGroupEl;i=this.value;if(!t){return[2]}o=t.value;r=Array.isArray(o)?o.includes(i):o===i;if(r){this.expandAccordion(n);this.isNext=this.isPrevious=false}else{this.collapseAccordion(n);e=this.getNextSibling();a=e===null||e===void 0?void 0:e.value;if(a!==undefined){this.isPrevious=Array.isArray(o)?o.includes(a):o===a}s=this.getPreviousSibling();d=s===null||s===void 0?void 0:s.value;if(d!==undefined){this.isNext=Array.isArray(o)?o.includes(d):o===d}}return[2]}))}))};this.getNextSibling=function(){if(!t.el){return}var n=t.el.nextElementSibling;if((n===null||n===void 0?void 0:n.tagName)!=="ION-ACCORDION"){return}return n};this.getPreviousSibling=function(){if(!t.el){return}var n=t.el.previousElementSibling;if((n===null||n===void 0?void 0:n.tagName)!=="ION-ACCORDION"){return}return n};this.state=1;this.isNext=false;this.isPrevious=false;this.value="ion-accordion-".concat(accordionIds++);this.disabled=false;this.readonly=false;this.toggleIcon=chevronDown;this.toggleIconSlot="end"}n.prototype.valueChanged=function(){this.updateState()};n.prototype.connectedCallback=function(){var n;var t=this.accordionGroupEl=(n=this.el)===null||n===void 0?void 0:n.closest("ion-accordion-group");if(t){this.updateState(true);addEventListener(t,"ionValueChange",this.updateListener)}};n.prototype.disconnectedCallback=function(){var n=this.accordionGroupEl;if(n){removeEventListener(n,"ionValueChange",this.updateListener)}};n.prototype.componentDidLoad=function(){var n=this;this.setItemDefaults();this.slotToggleIcon();raf((function(){var t=n.state===4||n.state===8;n.setAria(t)}))};n.prototype.toggleExpanded=function(){var n=this,t=n.accordionGroupEl,i=n.value,o=n.state;if(t){var r=o===1||o===2;t.requestAccordionToggle(i,r)}};n.prototype.render=function(){var n;var t=this;var i=this,o=i.disabled,r=i.readonly;var e=getIonMode(this);var a=this.state===4||this.state===8;var s=a?"header expanded":"header";var d=a?"content expanded":"content";this.setAria(a);return h(Host,{class:(n={},n[e]=true,n["accordion-expanding"]=this.state===8,n["accordion-expanded"]=this.state===4,n["accordion-collapsing"]=this.state===2,n["accordion-collapsed"]=this.state===1,n["accordion-next"]=this.isNext,n["accordion-previous"]=this.isPrevious,n["accordion-disabled"]=o,n["accordion-readonly"]=r,n["accordion-animated"]=this.shouldAnimate(),n)},h("div",{onClick:function(){return t.toggleExpanded()},id:"header",part:s,"aria-controls":"content",ref:function(n){return t.headerEl=n}},h("slot",{name:"header"})),h("div",{id:"content",part:d,role:"region","aria-labelledby":"header",ref:function(n){return t.contentEl=n}},h("div",{id:"content-wrapper",ref:function(n){return t.contentElWrapper=n}},h("slot",{name:"content"}))))};Object.defineProperty(n,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return n}();var accordionIds=0;Accordion.style={ios:accordionIosCss,md:accordionMdCss};var accordionGroupIosCss=":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){border-bottom:none}";var accordionGroupMdCss=":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion){-webkit-box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){margin-left:0;margin-right:0;margin-top:16px;margin-bottom:16px;border-radius:6px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion):first-of-type{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";var AccordionGroup=function(){function n(n){registerInstance(this,n);this.ionChange=createEvent(this,"ionChange",7);this.ionValueChange=createEvent(this,"ionValueChange",7);this.animated=true;this.multiple=undefined;this.value=undefined;this.disabled=false;this.readonly=false;this.expand="compact"}n.prototype.valueChanged=function(){var n=this,t=n.value,i=n.multiple;if(!i&&Array.isArray(t)){printIonWarning('ion-accordion-group was passed an array of values, but multiple="false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: ['.concat(t.map((function(n){return"'".concat(n,"'")})).join(", "),"]\n"),this.el)}this.ionValueChange.emit({value:this.value})};n.prototype.disabledChanged=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,i,o,r;return __generator(this,(function(e){switch(e.label){case 0:n=this.disabled;return[4,this.getAccordions()];case 1:t=e.sent();for(i=0,o=t;i<o.length;i++){r=o[i];r.disabled=n}return[2]}}))}))};n.prototype.readonlyChanged=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,i,o,r;return __generator(this,(function(e){switch(e.label){case 0:n=this.readonly;return[4,this.getAccordions()];case 1:t=e.sent();for(i=0,o=t;i<o.length;i++){r=o[i];r.readonly=n}return[2]}}))}))};n.prototype.onKeydown=function(n){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,e,a,s;return __generator(this,(function(d){switch(d.label){case 0:t=document.activeElement;if(!t){return[2]}i=t.closest('ion-accordion [slot="header"]');if(!i){return[2]}o=t.tagName==="ION-ACCORDION"?t:t.closest("ion-accordion");if(!o){return[2]}r=o.closest("ion-accordion-group");if(r!==this.el){return[2]}return[4,this.getAccordions()];case 1:e=d.sent();a=e.findIndex((function(n){return n===o}));if(a===-1){return[2]}if(n.key==="ArrowDown"){s=this.findNextAccordion(e,a)}else if(n.key==="ArrowUp"){s=this.findPreviousAccordion(e,a)}else if(n.key==="Home"){s=e[0]}else if(n.key==="End"){s=e[e.length-1]}if(s!==undefined&&s!==t){s.focus()}return[2]}}))}))};n.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(this.disabled){this.disabledChanged()}if(this.readonly){this.readonlyChanged()}return[2]}))}))};n.prototype.setValue=function(n){var t=this.value=n;this.ionChange.emit({value:t})};n.prototype.requestAccordionToggle=function(n,t){return __awaiter(this,void 0,void 0,(function(){var i,o,r,e,a,s,d,c,s,d;return __generator(this,(function(u){i=this,o=i.multiple,r=i.value,e=i.readonly,a=i.disabled;if(e||a){return[2]}if(t){if(o){s=r!==null&&r!==void 0?r:[];d=Array.isArray(s)?s:[s];c=d.find((function(t){return t===n}));if(c===undefined&&n!==undefined){this.setValue(__spreadArray(__spreadArray([],d,true),[n],false))}}else{this.setValue(n)}}else{if(o){s=r!==null&&r!==void 0?r:[];d=Array.isArray(s)?s:[s];this.setValue(d.filter((function(t){return t!==n})))}else{this.setValue(undefined)}}return[2]}))}))};n.prototype.findNextAccordion=function(n,t){var i=n[t+1];if(i===undefined){return n[0]}return i};n.prototype.findPreviousAccordion=function(n,t){var i=n[t-1];if(i===undefined){return n[n.length-1]}return i};n.prototype.getAccordions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,Array.from(this.el.querySelectorAll(":scope > ion-accordion"))]}))}))};n.prototype.render=function(){var n;var t=this,i=t.disabled,o=t.readonly,r=t.expand;var e=getIonMode(this);return h(Host,{class:(n={},n[e]=true,n["accordion-group-disabled"]=i,n["accordion-group-readonly"]=o,n["accordion-group-expand-".concat(r)]=true,n),role:"presentation"},h("slot",null))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],disabled:["disabledChanged"],readonly:["readonlyChanged"]}},enumerable:false,configurable:true});return n}();AccordionGroup.style={ios:accordionGroupIosCss,md:accordionGroupMdCss};export{Accordion as ion_accordion,AccordionGroup as ion_accordion_group};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,f as getElement,d as createEvent}from"./index-4392ebcb.js";import{r as raf,t as transitionEndAsync,a as addEventListener,b as removeEventListener,g as getElementRoot}from"./helpers-3379ba19.js";import{l as chevronDown}from"./index-c132c5f1.js";import{c as config,b as getIonMode}from"./ionic-global-7efdecd0.js";import{p as printIonWarning}from"./index-595d62c9.js";var accordionIosCss=":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}";var accordionMdCss=":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}";var Accordion=function(){function n(n){var t=this;registerInstance(this,n);this.updateListener=function(){return t.updateState(false)};this.setItemDefaults=function(){var n=t.getSlottedHeaderIonItem();if(!n){return}n.button=true;n.detail=false;if(n.lines===undefined){n.lines="full"}};this.getSlottedHeaderIonItem=function(){var n=t.headerEl;if(!n){return}var i=n.querySelector("slot");if(!i){return}if(i.assignedElements===undefined)return;return i.assignedElements().find((function(n){return n.tagName==="ION-ITEM"}))};this.setAria=function(n){if(n===void 0){n=false}var i=t.getSlottedHeaderIonItem();if(!i){return}var o=getElementRoot(i);var r=o.querySelector("button");if(!r){return}r.setAttribute("aria-expanded","".concat(n))};this.slotToggleIcon=function(){var n=t.getSlottedHeaderIonItem();if(!n){return}var i=t,o=i.toggleIconSlot,r=i.toggleIcon;var e=n.querySelector(".ion-accordion-toggle-icon");if(e){return}var a=document.createElement("ion-icon");a.slot=o;a.lazy=false;a.classList.add("ion-accordion-toggle-icon");a.icon=r;a.setAttribute("aria-hidden","true");n.appendChild(a)};this.expandAccordion=function(n){if(n===void 0){n=false}var i=t,o=i.contentEl,r=i.contentElWrapper;if(n||o===undefined||r===undefined){t.state=4;return}if(t.state===4){return}if(t.currentRaf!==undefined){cancelAnimationFrame(t.currentRaf)}if(t.shouldAnimate()){raf((function(){t.state=8;t.currentRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){var n,t;return __generator(this,(function(i){switch(i.label){case 0:n=r.offsetHeight;t=transitionEndAsync(o,2e3);o.style.setProperty("max-height","".concat(n,"px"));return[4,t];case 1:i.sent();this.state=4;o.style.removeProperty("max-height");return[2]}}))}))}))}))}else{t.state=4}};this.collapseAccordion=function(n){if(n===void 0){n=false}var i=t.contentEl;if(n||i===undefined){t.state=1;return}if(t.state===1){return}if(t.currentRaf!==undefined){cancelAnimationFrame(t.currentRaf)}if(t.shouldAnimate()){t.currentRaf=raf((function(){return __awaiter(t,void 0,void 0,(function(){var n;var t=this;return __generator(this,(function(o){n=i.offsetHeight;i.style.setProperty("max-height","".concat(n,"px"));raf((function(){return __awaiter(t,void 0,void 0,(function(){var n;return __generator(this,(function(t){switch(t.label){case 0:n=transitionEndAsync(i,2e3);this.state=2;return[4,n];case 1:t.sent();this.state=1;i.style.removeProperty("max-height");return[2]}}))}))}));return[2]}))}))}))}else{t.state=1}};this.shouldAnimate=function(){if(typeof window==="undefined"){return false}var n=matchMedia("(prefers-reduced-motion: reduce)").matches;if(n){return false}var i=config.get("animated",true);if(!i){return false}if(t.accordionGroupEl&&!t.accordionGroupEl.animated){return false}return true};this.updateState=function(n){if(n===void 0){n=false}return __awaiter(t,void 0,void 0,(function(){var t,i,o,r,e,a,s,d;return __generator(this,(function(c){t=this.accordionGroupEl;i=this.value;if(!t){return[2]}o=t.value;r=Array.isArray(o)?o.includes(i):o===i;if(r){this.expandAccordion(n);this.isNext=this.isPrevious=false}else{this.collapseAccordion(n);e=this.getNextSibling();a=e===null||e===void 0?void 0:e.value;if(a!==undefined){this.isPrevious=Array.isArray(o)?o.includes(a):o===a}s=this.getPreviousSibling();d=s===null||s===void 0?void 0:s.value;if(d!==undefined){this.isNext=Array.isArray(o)?o.includes(d):o===d}}return[2]}))}))};this.getNextSibling=function(){if(!t.el){return}var n=t.el.nextElementSibling;if((n===null||n===void 0?void 0:n.tagName)!=="ION-ACCORDION"){return}return n};this.getPreviousSibling=function(){if(!t.el){return}var n=t.el.previousElementSibling;if((n===null||n===void 0?void 0:n.tagName)!=="ION-ACCORDION"){return}return n};this.state=1;this.isNext=false;this.isPrevious=false;this.value="ion-accordion-".concat(accordionIds++);this.disabled=false;this.readonly=false;this.toggleIcon=chevronDown;this.toggleIconSlot="end"}n.prototype.valueChanged=function(){this.updateState()};n.prototype.connectedCallback=function(){var n;var t=this.accordionGroupEl=(n=this.el)===null||n===void 0?void 0:n.closest("ion-accordion-group");if(t){this.updateState(true);addEventListener(t,"ionValueChange",this.updateListener)}};n.prototype.disconnectedCallback=function(){var n=this.accordionGroupEl;if(n){removeEventListener(n,"ionValueChange",this.updateListener)}};n.prototype.componentDidLoad=function(){var n=this;this.setItemDefaults();this.slotToggleIcon();raf((function(){var t=n.state===4||n.state===8;n.setAria(t)}))};n.prototype.toggleExpanded=function(){var n=this,t=n.accordionGroupEl,i=n.value,o=n.state;if(t){var r=o===1||o===2;t.requestAccordionToggle(i,r)}};n.prototype.render=function(){var n;var t=this;var i=this,o=i.disabled,r=i.readonly;var e=getIonMode(this);var a=this.state===4||this.state===8;var s=a?"header expanded":"header";var d=a?"content expanded":"content";this.setAria(a);return h(Host,{class:(n={},n[e]=true,n["accordion-expanding"]=this.state===8,n["accordion-expanded"]=this.state===4,n["accordion-collapsing"]=this.state===2,n["accordion-collapsed"]=this.state===1,n["accordion-next"]=this.isNext,n["accordion-previous"]=this.isPrevious,n["accordion-disabled"]=o,n["accordion-readonly"]=r,n["accordion-animated"]=this.shouldAnimate(),n)},h("div",{onClick:function(){return t.toggleExpanded()},id:"header",part:s,"aria-controls":"content",ref:function(n){return t.headerEl=n}},h("slot",{name:"header"})),h("div",{id:"content",part:d,role:"region","aria-labelledby":"header",ref:function(n){return t.contentEl=n}},h("div",{id:"content-wrapper",ref:function(n){return t.contentElWrapper=n}},h("slot",{name:"content"}))))};Object.defineProperty(n,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return n}();var accordionIds=0;Accordion.style={ios:accordionIosCss,md:accordionMdCss};var accordionGroupIosCss=":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){border-bottom:none}";var accordionGroupMdCss=":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion){-webkit-box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){margin-left:0;margin-right:0;margin-top:16px;margin-bottom:16px;border-radius:6px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion):first-of-type{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";var AccordionGroup=function(){function n(n){registerInstance(this,n);this.ionChange=createEvent(this,"ionChange",7);this.ionValueChange=createEvent(this,"ionValueChange",7);this.animated=true;this.multiple=undefined;this.value=undefined;this.disabled=false;this.readonly=false;this.expand="compact"}n.prototype.valueChanged=function(){var n=this,t=n.value,i=n.multiple;if(!i&&Array.isArray(t)){printIonWarning('ion-accordion-group was passed an array of values, but multiple="false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: ['.concat(t.map((function(n){return"'".concat(n,"'")})).join(", "),"]\n"),this.el)}this.ionValueChange.emit({value:this.value})};n.prototype.disabledChanged=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,i,o,r;return __generator(this,(function(e){switch(e.label){case 0:n=this.disabled;return[4,this.getAccordions()];case 1:t=e.sent();for(i=0,o=t;i<o.length;i++){r=o[i];r.disabled=n}return[2]}}))}))};n.prototype.readonlyChanged=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,i,o,r;return __generator(this,(function(e){switch(e.label){case 0:n=this.readonly;return[4,this.getAccordions()];case 1:t=e.sent();for(i=0,o=t;i<o.length;i++){r=o[i];r.readonly=n}return[2]}}))}))};n.prototype.onKeydown=function(n){return __awaiter(this,void 0,void 0,(function(){var t,i,o,r,e,a,s;return __generator(this,(function(d){switch(d.label){case 0:t=document.activeElement;if(!t){return[2]}i=t.closest('ion-accordion [slot="header"]');if(!i){return[2]}o=t.tagName==="ION-ACCORDION"?t:t.closest("ion-accordion");if(!o){return[2]}r=o.closest("ion-accordion-group");if(r!==this.el){return[2]}return[4,this.getAccordions()];case 1:e=d.sent();a=e.findIndex((function(n){return n===o}));if(a===-1){return[2]}if(n.key==="ArrowDown"){s=this.findNextAccordion(e,a)}else if(n.key==="ArrowUp"){s=this.findPreviousAccordion(e,a)}else if(n.key==="Home"){s=e[0]}else if(n.key==="End"){s=e[e.length-1]}if(s!==undefined&&s!==t){s.focus()}return[2]}}))}))};n.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(this.disabled){this.disabledChanged()}if(this.readonly){this.readonlyChanged()}this.valueChanged();return[2]}))}))};n.prototype.setValue=function(n){var t=this.value=n;this.ionChange.emit({value:t})};n.prototype.requestAccordionToggle=function(n,t){return __awaiter(this,void 0,void 0,(function(){var i,o,r,e,a,s,d,c,s,d;return __generator(this,(function(u){i=this,o=i.multiple,r=i.value,e=i.readonly,a=i.disabled;if(e||a){return[2]}if(t){if(o){s=r!==null&&r!==void 0?r:[];d=Array.isArray(s)?s:[s];c=d.find((function(t){return t===n}));if(c===undefined&&n!==undefined){this.setValue(__spreadArray(__spreadArray([],d,true),[n],false))}}else{this.setValue(n)}}else{if(o){s=r!==null&&r!==void 0?r:[];d=Array.isArray(s)?s:[s];this.setValue(d.filter((function(t){return t!==n})))}else{this.setValue(undefined)}}return[2]}))}))};n.prototype.findNextAccordion=function(n,t){var i=n[t+1];if(i===undefined){return n[0]}return i};n.prototype.findPreviousAccordion=function(n,t){var i=n[t-1];if(i===undefined){return n[n.length-1]}return i};n.prototype.getAccordions=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,Array.from(this.el.querySelectorAll(":scope > ion-accordion"))]}))}))};n.prototype.render=function(){var n;var t=this,i=t.disabled,o=t.readonly,r=t.expand;var e=getIonMode(this);return h(Host,{class:(n={},n[e]=true,n["accordion-group-disabled"]=i,n["accordion-group-readonly"]=o,n["accordion-group-expand-".concat(r)]=true,n),role:"presentation"},h("slot",null))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],disabled:["disabledChanged"],readonly:["readonlyChanged"]}},enumerable:false,configurable:true});return n}();AccordionGroup.style={ios:accordionGroupIosCss,md:accordionGroupMdCss};export{Accordion as ion_accordion,AccordionGroup as ion_accordion_group};
|