@ionic/core 8.1.1-nightly.20240503 → 8.1.1-nightly.20240507
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-select.js +18 -5
- package/components/radio.js +14 -3
- package/dist/cjs/ion-radio_2.cjs.entry.js +14 -3
- package/dist/cjs/ion-select_3.cjs.entry.js +18 -5
- package/dist/collection/components/radio/radio.js +14 -3
- package/dist/collection/components/select/select.js +18 -5
- package/dist/docs.json +1 -1
- package/dist/esm/ion-radio_2.entry.js +14 -3
- package/dist/esm/ion-select_3.entry.js +18 -5
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-30baae57.system.js +1 -1
- package/dist/ionic/p-4b7ef1e0.entry.js +4 -0
- package/dist/ionic/{p-6df12af0.system.entry.js → p-84001b0c.system.entry.js} +1 -1
- package/dist/ionic/p-9e43d542.entry.js +4 -0
- package/dist/ionic/{p-a2e94ade.system.entry.js → p-dfc57836.system.entry.js} +1 -1
- package/dist/types/components/radio/radio.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +2 -1
- package/hydrate/index.js +32 -8
- package/package.json +1 -1
- package/dist/ionic/p-b04c27d8.entry.js +0 -4
- package/dist/ionic/p-fa8f2e62.entry.js +0 -4
package/components/ion-select.js
CHANGED
|
@@ -115,9 +115,6 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
115
115
|
this.value = value;
|
|
116
116
|
this.ionChange.emit({ value });
|
|
117
117
|
}
|
|
118
|
-
componentWillLoad() {
|
|
119
|
-
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
120
|
-
}
|
|
121
118
|
async connectedCallback() {
|
|
122
119
|
const { el } = this;
|
|
123
120
|
this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
@@ -134,6 +131,22 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
134
131
|
forceUpdate(this);
|
|
135
132
|
});
|
|
136
133
|
}
|
|
134
|
+
componentWillLoad() {
|
|
135
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
136
|
+
}
|
|
137
|
+
componentDidLoad() {
|
|
138
|
+
/**
|
|
139
|
+
* If any of the conditions that trigger the styleChanged callback
|
|
140
|
+
* are met on component load, it is possible the event emitted
|
|
141
|
+
* prior to a parent web component registering an event listener.
|
|
142
|
+
*
|
|
143
|
+
* To ensure the parent web component receives the event, we
|
|
144
|
+
* emit the style event again after the component has loaded.
|
|
145
|
+
*
|
|
146
|
+
* This is often seen in Angular with the `dist` output target.
|
|
147
|
+
*/
|
|
148
|
+
this.emitStyle();
|
|
149
|
+
}
|
|
137
150
|
disconnectedCallback() {
|
|
138
151
|
if (this.mutationO) {
|
|
139
152
|
this.mutationO.disconnect();
|
|
@@ -592,7 +605,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
592
605
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
593
606
|
*/
|
|
594
607
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
595
|
-
return (h(Host, { key: '
|
|
608
|
+
return (h(Host, { key: 'e14586e887c0b73457b9f1e8f0585dfc7d590051', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
596
609
|
[mode]: true,
|
|
597
610
|
'in-item': inItem,
|
|
598
611
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -608,7 +621,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
608
621
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
609
622
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
610
623
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
611
|
-
}) }, h("label", { key: '
|
|
624
|
+
}) }, h("label", { key: 'b44929542c809f2dca25afc588701762a083edd1', class: "select-wrapper", id: "select-label" }, this.renderLabelContainer(), h("div", { key: '195e3fad9cea0363ff00bf257ec2975fe5aa6887', class: "select-wrapper-inner" }, h("slot", { key: '9da7161a69b92d6fd124a478348d3fa420092f26', name: "start" }), h("div", { key: '49c589c164d167de0ba5741a0c80fba58ea0bec6', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'de1536d910fceb8e2dbdda13abcf88ee969888b8', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: 'e821b7b32cd1996eaa6d471df9b531ad0d491098', class: "select-highlight" }))));
|
|
612
625
|
}
|
|
613
626
|
get el() { return this; }
|
|
614
627
|
static get watchers() { return {
|
package/components/radio.js
CHANGED
|
@@ -109,6 +109,17 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
|
|
|
109
109
|
*/
|
|
110
110
|
this.updateState();
|
|
111
111
|
}
|
|
112
|
+
componentDidLoad() {
|
|
113
|
+
/**
|
|
114
|
+
* The value may be `undefined` if it
|
|
115
|
+
* gets set before the radio is
|
|
116
|
+
* rendered. This ensures that the radio
|
|
117
|
+
* is checked if the value matches. This
|
|
118
|
+
* happens most often when Angular is
|
|
119
|
+
* rendering the radio.
|
|
120
|
+
*/
|
|
121
|
+
this.updateState();
|
|
122
|
+
}
|
|
112
123
|
/** @internal */
|
|
113
124
|
async setFocus(ev) {
|
|
114
125
|
ev.stopPropagation();
|
|
@@ -146,7 +157,7 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
|
|
|
146
157
|
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex, alignment } = this;
|
|
147
158
|
const mode = getIonMode(this);
|
|
148
159
|
const inItem = hostContext('ion-item', el);
|
|
149
|
-
return (h(Host, { key: '
|
|
160
|
+
return (h(Host, { key: '43c95effb6acb119733270e8a5e02fe18b47ee4b', onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: createColorClasses(color, {
|
|
150
161
|
[mode]: true,
|
|
151
162
|
'in-item': inItem,
|
|
152
163
|
'radio-checked': checked,
|
|
@@ -157,10 +168,10 @@ const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
|
|
|
157
168
|
// Focus and active styling should not apply when the radio is in an item
|
|
158
169
|
'ion-activatable': !inItem,
|
|
159
170
|
'ion-focusable': !inItem,
|
|
160
|
-
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '
|
|
171
|
+
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '168ea77c08fde9832077d617662b93dc9986b544', class: "radio-wrapper" }, h("div", { key: 'ce1e6eee63fbab1e5a66b18f767f4eecc2a227f1', class: {
|
|
161
172
|
'label-text-wrapper': true,
|
|
162
173
|
'label-text-wrapper-hidden': !hasLabel,
|
|
163
|
-
}, part: "label" }, h("slot", { key: '
|
|
174
|
+
}, part: "label" }, h("slot", { key: '7d849e43d4356b5c3978c2bba9a6fba5d21ca69d' })), h("div", { key: 'e741f7822364958b050a232bdfccdc413095c244', class: "native-wrapper" }, this.renderRadioControl()))));
|
|
164
175
|
}
|
|
165
176
|
get el() { return this; }
|
|
166
177
|
static get watchers() { return {
|
|
@@ -75,6 +75,17 @@ const Radio = class {
|
|
|
75
75
|
*/
|
|
76
76
|
this.updateState();
|
|
77
77
|
}
|
|
78
|
+
componentDidLoad() {
|
|
79
|
+
/**
|
|
80
|
+
* The value may be `undefined` if it
|
|
81
|
+
* gets set before the radio is
|
|
82
|
+
* rendered. This ensures that the radio
|
|
83
|
+
* is checked if the value matches. This
|
|
84
|
+
* happens most often when Angular is
|
|
85
|
+
* rendering the radio.
|
|
86
|
+
*/
|
|
87
|
+
this.updateState();
|
|
88
|
+
}
|
|
78
89
|
/** @internal */
|
|
79
90
|
async setFocus(ev) {
|
|
80
91
|
ev.stopPropagation();
|
|
@@ -112,7 +123,7 @@ const Radio = class {
|
|
|
112
123
|
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex, alignment } = this;
|
|
113
124
|
const mode = ionicGlobal.getIonMode(this);
|
|
114
125
|
const inItem = theme.hostContext('ion-item', el);
|
|
115
|
-
return (index.h(index.Host, { key: '
|
|
126
|
+
return (index.h(index.Host, { key: '43c95effb6acb119733270e8a5e02fe18b47ee4b', onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: theme.createColorClasses(color, {
|
|
116
127
|
[mode]: true,
|
|
117
128
|
'in-item': inItem,
|
|
118
129
|
'radio-checked': checked,
|
|
@@ -123,10 +134,10 @@ const Radio = class {
|
|
|
123
134
|
// Focus and active styling should not apply when the radio is in an item
|
|
124
135
|
'ion-activatable': !inItem,
|
|
125
136
|
'ion-focusable': !inItem,
|
|
126
|
-
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, index.h("label", { key: '
|
|
137
|
+
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, index.h("label", { key: '168ea77c08fde9832077d617662b93dc9986b544', class: "radio-wrapper" }, index.h("div", { key: 'ce1e6eee63fbab1e5a66b18f767f4eecc2a227f1', class: {
|
|
127
138
|
'label-text-wrapper': true,
|
|
128
139
|
'label-text-wrapper-hidden': !hasLabel,
|
|
129
|
-
}, part: "label" }, index.h("slot", { key: '
|
|
140
|
+
}, part: "label" }, index.h("slot", { key: '7d849e43d4356b5c3978c2bba9a6fba5d21ca69d' })), index.h("div", { key: 'e741f7822364958b050a232bdfccdc413095c244', class: "native-wrapper" }, this.renderRadioControl()))));
|
|
130
141
|
}
|
|
131
142
|
get el() { return index.getElement(this); }
|
|
132
143
|
static get watchers() { return {
|
|
@@ -109,9 +109,6 @@ const Select = class {
|
|
|
109
109
|
this.value = value;
|
|
110
110
|
this.ionChange.emit({ value });
|
|
111
111
|
}
|
|
112
|
-
componentWillLoad() {
|
|
113
|
-
this.inheritedAttributes = helpers.inheritAttributes(this.el, ['aria-label']);
|
|
114
|
-
}
|
|
115
112
|
async connectedCallback() {
|
|
116
113
|
const { el } = this;
|
|
117
114
|
this.notchController = notchController.createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
@@ -128,6 +125,22 @@ const Select = class {
|
|
|
128
125
|
index.forceUpdate(this);
|
|
129
126
|
});
|
|
130
127
|
}
|
|
128
|
+
componentWillLoad() {
|
|
129
|
+
this.inheritedAttributes = helpers.inheritAttributes(this.el, ['aria-label']);
|
|
130
|
+
}
|
|
131
|
+
componentDidLoad() {
|
|
132
|
+
/**
|
|
133
|
+
* If any of the conditions that trigger the styleChanged callback
|
|
134
|
+
* are met on component load, it is possible the event emitted
|
|
135
|
+
* prior to a parent web component registering an event listener.
|
|
136
|
+
*
|
|
137
|
+
* To ensure the parent web component receives the event, we
|
|
138
|
+
* emit the style event again after the component has loaded.
|
|
139
|
+
*
|
|
140
|
+
* This is often seen in Angular with the `dist` output target.
|
|
141
|
+
*/
|
|
142
|
+
this.emitStyle();
|
|
143
|
+
}
|
|
131
144
|
disconnectedCallback() {
|
|
132
145
|
if (this.mutationO) {
|
|
133
146
|
this.mutationO.disconnect();
|
|
@@ -586,7 +599,7 @@ const Select = class {
|
|
|
586
599
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
587
600
|
*/
|
|
588
601
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
589
|
-
return (index.h(index.Host, { key: '
|
|
602
|
+
return (index.h(index.Host, { key: 'e14586e887c0b73457b9f1e8f0585dfc7d590051', onClick: this.onClick, class: theme.createColorClasses(this.color, {
|
|
590
603
|
[mode]: true,
|
|
591
604
|
'in-item': inItem,
|
|
592
605
|
'in-item-color': theme.hostContext('ion-item.ion-color', el),
|
|
@@ -602,7 +615,7 @@ const Select = class {
|
|
|
602
615
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
603
616
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
604
617
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
605
|
-
}) }, index.h("label", { key: '
|
|
618
|
+
}) }, index.h("label", { key: 'b44929542c809f2dca25afc588701762a083edd1', class: "select-wrapper", id: "select-label" }, this.renderLabelContainer(), index.h("div", { key: '195e3fad9cea0363ff00bf257ec2975fe5aa6887', class: "select-wrapper-inner" }, index.h("slot", { key: '9da7161a69b92d6fd124a478348d3fa420092f26', name: "start" }), index.h("div", { key: '49c589c164d167de0ba5741a0c80fba58ea0bec6', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), index.h("slot", { key: 'de1536d910fceb8e2dbdda13abcf88ee969888b8', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && index.h("div", { key: 'e821b7b32cd1996eaa6d471df9b531ad0d491098', class: "select-highlight" }))));
|
|
606
619
|
}
|
|
607
620
|
get el() { return index.getElement(this); }
|
|
608
621
|
static get watchers() { return {
|
|
@@ -70,6 +70,17 @@ export class Radio {
|
|
|
70
70
|
*/
|
|
71
71
|
this.updateState();
|
|
72
72
|
}
|
|
73
|
+
componentDidLoad() {
|
|
74
|
+
/**
|
|
75
|
+
* The value may be `undefined` if it
|
|
76
|
+
* gets set before the radio is
|
|
77
|
+
* rendered. This ensures that the radio
|
|
78
|
+
* is checked if the value matches. This
|
|
79
|
+
* happens most often when Angular is
|
|
80
|
+
* rendering the radio.
|
|
81
|
+
*/
|
|
82
|
+
this.updateState();
|
|
83
|
+
}
|
|
73
84
|
/** @internal */
|
|
74
85
|
async setFocus(ev) {
|
|
75
86
|
ev.stopPropagation();
|
|
@@ -107,7 +118,7 @@ export class Radio {
|
|
|
107
118
|
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex, alignment } = this;
|
|
108
119
|
const mode = getIonMode(this);
|
|
109
120
|
const inItem = hostContext('ion-item', el);
|
|
110
|
-
return (h(Host, { key: '
|
|
121
|
+
return (h(Host, { key: '43c95effb6acb119733270e8a5e02fe18b47ee4b', onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: createColorClasses(color, {
|
|
111
122
|
[mode]: true,
|
|
112
123
|
'in-item': inItem,
|
|
113
124
|
'radio-checked': checked,
|
|
@@ -118,10 +129,10 @@ export class Radio {
|
|
|
118
129
|
// Focus and active styling should not apply when the radio is in an item
|
|
119
130
|
'ion-activatable': !inItem,
|
|
120
131
|
'ion-focusable': !inItem,
|
|
121
|
-
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '
|
|
132
|
+
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '168ea77c08fde9832077d617662b93dc9986b544', class: "radio-wrapper" }, h("div", { key: 'ce1e6eee63fbab1e5a66b18f767f4eecc2a227f1', class: {
|
|
122
133
|
'label-text-wrapper': true,
|
|
123
134
|
'label-text-wrapper-hidden': !hasLabel,
|
|
124
|
-
}, part: "label" }, h("slot", { key: '
|
|
135
|
+
}, part: "label" }, h("slot", { key: '7d849e43d4356b5c3978c2bba9a6fba5d21ca69d' })), h("div", { key: 'e741f7822364958b050a232bdfccdc413095c244', class: "native-wrapper" }, this.renderRadioControl()))));
|
|
125
136
|
}
|
|
126
137
|
static get is() { return "ion-radio"; }
|
|
127
138
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,9 +99,6 @@ export class Select {
|
|
|
99
99
|
this.value = value;
|
|
100
100
|
this.ionChange.emit({ value });
|
|
101
101
|
}
|
|
102
|
-
componentWillLoad() {
|
|
103
|
-
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
104
|
-
}
|
|
105
102
|
async connectedCallback() {
|
|
106
103
|
const { el } = this;
|
|
107
104
|
this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
@@ -118,6 +115,22 @@ export class Select {
|
|
|
118
115
|
forceUpdate(this);
|
|
119
116
|
});
|
|
120
117
|
}
|
|
118
|
+
componentWillLoad() {
|
|
119
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
120
|
+
}
|
|
121
|
+
componentDidLoad() {
|
|
122
|
+
/**
|
|
123
|
+
* If any of the conditions that trigger the styleChanged callback
|
|
124
|
+
* are met on component load, it is possible the event emitted
|
|
125
|
+
* prior to a parent web component registering an event listener.
|
|
126
|
+
*
|
|
127
|
+
* To ensure the parent web component receives the event, we
|
|
128
|
+
* emit the style event again after the component has loaded.
|
|
129
|
+
*
|
|
130
|
+
* This is often seen in Angular with the `dist` output target.
|
|
131
|
+
*/
|
|
132
|
+
this.emitStyle();
|
|
133
|
+
}
|
|
121
134
|
disconnectedCallback() {
|
|
122
135
|
if (this.mutationO) {
|
|
123
136
|
this.mutationO.disconnect();
|
|
@@ -610,7 +623,7 @@ export class Select {
|
|
|
610
623
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
611
624
|
*/
|
|
612
625
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
613
|
-
return (h(Host, { key: '
|
|
626
|
+
return (h(Host, { key: 'e14586e887c0b73457b9f1e8f0585dfc7d590051', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
614
627
|
[mode]: true,
|
|
615
628
|
'in-item': inItem,
|
|
616
629
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -626,7 +639,7 @@ export class Select {
|
|
|
626
639
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
627
640
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
628
641
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
629
|
-
}) }, h("label", { key: '
|
|
642
|
+
}) }, h("label", { key: 'b44929542c809f2dca25afc588701762a083edd1', class: "select-wrapper", id: "select-label" }, this.renderLabelContainer(), h("div", { key: '195e3fad9cea0363ff00bf257ec2975fe5aa6887', class: "select-wrapper-inner" }, h("slot", { key: '9da7161a69b92d6fd124a478348d3fa420092f26', name: "start" }), h("div", { key: '49c589c164d167de0ba5741a0c80fba58ea0bec6', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'de1536d910fceb8e2dbdda13abcf88ee969888b8', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: 'e821b7b32cd1996eaa6d471df9b531ad0d491098', class: "select-highlight" }))));
|
|
630
643
|
}
|
|
631
644
|
static get is() { return "ion-select"; }
|
|
632
645
|
static get encapsulation() { return "shadow"; }
|
package/dist/docs.json
CHANGED
|
@@ -71,6 +71,17 @@ const Radio = class {
|
|
|
71
71
|
*/
|
|
72
72
|
this.updateState();
|
|
73
73
|
}
|
|
74
|
+
componentDidLoad() {
|
|
75
|
+
/**
|
|
76
|
+
* The value may be `undefined` if it
|
|
77
|
+
* gets set before the radio is
|
|
78
|
+
* rendered. This ensures that the radio
|
|
79
|
+
* is checked if the value matches. This
|
|
80
|
+
* happens most often when Angular is
|
|
81
|
+
* rendering the radio.
|
|
82
|
+
*/
|
|
83
|
+
this.updateState();
|
|
84
|
+
}
|
|
74
85
|
/** @internal */
|
|
75
86
|
async setFocus(ev) {
|
|
76
87
|
ev.stopPropagation();
|
|
@@ -108,7 +119,7 @@ const Radio = class {
|
|
|
108
119
|
const { checked, disabled, color, el, justify, labelPlacement, hasLabel, buttonTabindex, alignment } = this;
|
|
109
120
|
const mode = getIonMode(this);
|
|
110
121
|
const inItem = hostContext('ion-item', el);
|
|
111
|
-
return (h(Host, { key: '
|
|
122
|
+
return (h(Host, { key: '43c95effb6acb119733270e8a5e02fe18b47ee4b', onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.onClick, class: createColorClasses(color, {
|
|
112
123
|
[mode]: true,
|
|
113
124
|
'in-item': inItem,
|
|
114
125
|
'radio-checked': checked,
|
|
@@ -119,10 +130,10 @@ const Radio = class {
|
|
|
119
130
|
// Focus and active styling should not apply when the radio is in an item
|
|
120
131
|
'ion-activatable': !inItem,
|
|
121
132
|
'ion-focusable': !inItem,
|
|
122
|
-
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '
|
|
133
|
+
}), role: "radio", "aria-checked": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabindex: buttonTabindex }, h("label", { key: '168ea77c08fde9832077d617662b93dc9986b544', class: "radio-wrapper" }, h("div", { key: 'ce1e6eee63fbab1e5a66b18f767f4eecc2a227f1', class: {
|
|
123
134
|
'label-text-wrapper': true,
|
|
124
135
|
'label-text-wrapper-hidden': !hasLabel,
|
|
125
|
-
}, part: "label" }, h("slot", { key: '
|
|
136
|
+
}, part: "label" }, h("slot", { key: '7d849e43d4356b5c3978c2bba9a6fba5d21ca69d' })), h("div", { key: 'e741f7822364958b050a232bdfccdc413095c244', class: "native-wrapper" }, this.renderRadioControl()))));
|
|
126
137
|
}
|
|
127
138
|
get el() { return getElement(this); }
|
|
128
139
|
static get watchers() { return {
|
|
@@ -105,9 +105,6 @@ const Select = class {
|
|
|
105
105
|
this.value = value;
|
|
106
106
|
this.ionChange.emit({ value });
|
|
107
107
|
}
|
|
108
|
-
componentWillLoad() {
|
|
109
|
-
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
110
|
-
}
|
|
111
108
|
async connectedCallback() {
|
|
112
109
|
const { el } = this;
|
|
113
110
|
this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
@@ -124,6 +121,22 @@ const Select = class {
|
|
|
124
121
|
forceUpdate(this);
|
|
125
122
|
});
|
|
126
123
|
}
|
|
124
|
+
componentWillLoad() {
|
|
125
|
+
this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
|
126
|
+
}
|
|
127
|
+
componentDidLoad() {
|
|
128
|
+
/**
|
|
129
|
+
* If any of the conditions that trigger the styleChanged callback
|
|
130
|
+
* are met on component load, it is possible the event emitted
|
|
131
|
+
* prior to a parent web component registering an event listener.
|
|
132
|
+
*
|
|
133
|
+
* To ensure the parent web component receives the event, we
|
|
134
|
+
* emit the style event again after the component has loaded.
|
|
135
|
+
*
|
|
136
|
+
* This is often seen in Angular with the `dist` output target.
|
|
137
|
+
*/
|
|
138
|
+
this.emitStyle();
|
|
139
|
+
}
|
|
127
140
|
disconnectedCallback() {
|
|
128
141
|
if (this.mutationO) {
|
|
129
142
|
this.mutationO.disconnect();
|
|
@@ -582,7 +595,7 @@ const Select = class {
|
|
|
582
595
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
583
596
|
*/
|
|
584
597
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
585
|
-
return (h(Host, { key: '
|
|
598
|
+
return (h(Host, { key: 'e14586e887c0b73457b9f1e8f0585dfc7d590051', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
586
599
|
[mode]: true,
|
|
587
600
|
'in-item': inItem,
|
|
588
601
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -598,7 +611,7 @@ const Select = class {
|
|
|
598
611
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
599
612
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
600
613
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
601
|
-
}) }, h("label", { key: '
|
|
614
|
+
}) }, h("label", { key: 'b44929542c809f2dca25afc588701762a083edd1', class: "select-wrapper", id: "select-label" }, this.renderLabelContainer(), h("div", { key: '195e3fad9cea0363ff00bf257ec2975fe5aa6887', class: "select-wrapper-inner" }, h("slot", { key: '9da7161a69b92d6fd124a478348d3fa420092f26', name: "start" }), h("div", { key: '49c589c164d167de0ba5741a0c80fba58ea0bec6', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'de1536d910fceb8e2dbdda13abcf88ee969888b8', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: 'e821b7b32cd1996eaa6d471df9b531ad0d491098', class: "select-highlight" }))));
|
|
602
615
|
}
|
|
603
616
|
get el() { return getElement(this); }
|
|
604
617
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,d as createEvent,h,f as Host,i as getElement}from"./index-9aab3bcf.js";import{a as addEventListener,b as removeEventListener,d as renderHiddenInput}from"./helpers-da915de8.js";import{i as isOptionSelected}from"./compare-with-utils-a96ff2ea.js";import{h as hostContext,c as createColorClasses}from"./theme-01f3f29c.js";import{b as getIonMode}from"./ionic-global-4528d288.js";var radioIosCss=':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]){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;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-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}';var IonRadioIosStyle0=radioIosCss;var radioMdCss=':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]){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;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-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}';var IonRadioMdStyle0=radioMdCss;var Radio=function(){function e(e){var t=this;registerInstance(this,e);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.inputId="ion-rb-".concat(radioButtonIds++);this.radioGroup=null;this.updateState=function(){if(t.radioGroup){var e=t.radioGroup,r=e.compareWith,i=e.value;t.checked=isOptionSelected(i,t.value,r)}};this.onClick=function(){var e=t,r=e.radioGroup,i=e.checked,a=e.disabled;if(a){return}if(i&&(r===null||r===void 0?void 0:r.allowEmptySelection)){t.checked=false}else{t.checked=true}};this.onFocus=function(){t.ionFocus.emit()};this.onBlur=function(){t.ionBlur.emit()};this.checked=false;this.buttonTabindex=-1;this.color=undefined;this.name=this.inputId;this.disabled=false;this.value=undefined;this.labelPlacement="start";this.justify="space-between";this.alignment="center"}e.prototype.valueChanged=function(){this.updateState()};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){e.stopPropagation();e.preventDefault();this.el.focus();return[2]}))}))};e.prototype.setButtonTabindex=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.buttonTabindex=e;return[2]}))}))};e.prototype.connectedCallback=function(){if(this.value===undefined){this.value=this.inputId}var e=this.radioGroup=this.el.closest("ion-radio-group");if(e){this.updateState();addEventListener(e,"ionValueChange",this.updateState)}};e.prototype.disconnectedCallback=function(){var e=this.radioGroup;if(e){removeEventListener(e,"ionValueChange",this.updateState);this.radioGroup=null}};Object.defineProperty(e.prototype,"hasLabel",{get:function(){return this.el.textContent!==""},enumerable:false,configurable:true});e.prototype.renderRadioControl=function(){return h("div",{class:"radio-icon",part:"container"},h("div",{class:"radio-inner",part:"mark"}),h("div",{class:"radio-ripple"}))};e.prototype.render=function(){var e;var t=this,r=t.checked,i=t.disabled,a=t.color,o=t.el,n=t.justify,s=t.labelPlacement,l=t.hasLabel,d=t.buttonTabindex,c=t.alignment;var p=getIonMode(this);var m=hostContext("ion-item",o);return h(Host,{key:"e44cade8aa8415bdc825f9d17fc8562487cf5d35",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,class:createColorClasses(a,(e={},e[p]=true,e["in-item"]=m,e["radio-checked"]=r,e["radio-disabled"]=i,e["radio-justify-".concat(n)]=true,e["radio-alignment-".concat(c)]=true,e["radio-label-placement-".concat(s)]=true,e["ion-activatable"]=!m,e["ion-focusable"]=!m,e)),role:"radio","aria-checked":r?"true":"false","aria-disabled":i?"true":null,tabindex:d},h("label",{key:"48a99aa80a7d7b4085ef26faf3167903c975517c",class:"radio-wrapper"},h("div",{key:"a8d74e0603b41215ea3e867356a9be0dcf3722d8",class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!l},part:"label"},h("slot",{key:"9e3cce6254e70b02d50381537438a70435b031cc"})),h("div",{key:"bfa3ee188d911e056a3e60178eac41362efb94b3",class:"native-wrapper"},this.renderRadioControl())))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var radioButtonIds=0;Radio.style={ios:IonRadioIosStyle0,md:IonRadioMdStyle0};var RadioGroup=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionValueChange=createEvent(this,"ionValueChange",7);this.inputId="ion-rg-".concat(radioGroupIds++);this.labelId="".concat(this.inputId,"-lbl");this.setRadioTabindex=function(e){var r=t.getRadios();var i=r.find((function(e){return!e.disabled}));var a=r.find((function(t){return t.value===e&&!t.disabled}));if(!i&&!a){return}var o=a||i;for(var n=0,s=r;n<s.length;n++){var l=s[n];var d=l===o?0:-1;l.setButtonTabindex(d)}};this.onClick=function(e){e.preventDefault();var r=e.target&&e.target.closest("ion-radio");if(r&&!r.disabled){var i=t.value;var a=r.value;if(a!==i){t.value=a;t.emitValueChange(e)}else if(t.allowEmptySelection){t.value=undefined;t.emitValueChange(e)}}};this.allowEmptySelection=false;this.compareWith=undefined;this.name=this.inputId;this.value=undefined}e.prototype.valueChanged=function(e){this.setRadioTabindex(e);this.ionValueChange.emit({value:e})};e.prototype.componentDidLoad=function(){this.valueChanged(this.value)};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){e=this.el.querySelector("ion-list-header")||this.el.querySelector("ion-item-divider");if(e){t=this.label=e.querySelector("ion-label");if(t){this.labelId=t.id=this.name+"-lbl"}}return[2]}))}))};e.prototype.getRadios=function(){return Array.from(this.el.querySelectorAll("ion-radio"))};e.prototype.emitValueChange=function(e){var t=this.value;this.ionChange.emit({value:t,event:e})};e.prototype.onKeydown=function(e){var t=!!this.el.closest("ion-select-popover");if(e.target&&!this.el.contains(e.target)){return}var r=this.getRadios().filter((function(e){return!e.disabled}));if(e.target&&r.includes(e.target)){var i=r.findIndex((function(t){return t===e.target}));var a=r[i];var o=void 0;if(["ArrowDown","ArrowRight"].includes(e.key)){o=i===r.length-1?r[0]:r[i+1]}if(["ArrowUp","ArrowLeft"].includes(e.key)){o=i===0?r[r.length-1]:r[i-1]}if(o&&r.includes(o)){o.setFocus(e);if(!t){this.value=o.value;this.emitValueChange(e)}}if([" "].includes(e.key)){var n=this.value;this.value=this.allowEmptySelection&&this.value!==undefined?undefined:a.value;if(n!==this.value||this.allowEmptySelection){this.emitValueChange(e)}e.preventDefault()}}};e.prototype.render=function(){var e=this,t=e.label,r=e.labelId,i=e.el,a=e.name,o=e.value;var n=getIonMode(this);renderHiddenInput(true,i,a,o,false);return h(Host,{key:"7a8ad7eb6a05c6f96a348dcf30fd0c610a95688c",role:"radiogroup","aria-labelledby":t?r:null,onClick:this.onClick,class:n})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var radioGroupIds=0;export{Radio as ion_radio,RadioGroup as ion_radio_group};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,f as Host,i as getElement}from"./index-9aab3bcf.js";import{a as addEventListener,b as removeEventListener,d as renderHiddenInput}from"./helpers-da915de8.js";import{i as isOptionSelected}from"./compare-with-utils-a96ff2ea.js";import{h as hostContext,c as createColorClasses}from"./theme-01f3f29c.js";import{b as getIonMode}from"./ionic-global-4528d288.js";var radioIosCss=':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]){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;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-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}';var IonRadioIosStyle0=radioIosCss;var radioMdCss=':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]){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;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-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}';var IonRadioMdStyle0=radioMdCss;var Radio=function(){function e(e){var t=this;registerInstance(this,e);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.inputId="ion-rb-".concat(radioButtonIds++);this.radioGroup=null;this.updateState=function(){if(t.radioGroup){var e=t.radioGroup,r=e.compareWith,i=e.value;t.checked=isOptionSelected(i,t.value,r)}};this.onClick=function(){var e=t,r=e.radioGroup,i=e.checked,a=e.disabled;if(a){return}if(i&&(r===null||r===void 0?void 0:r.allowEmptySelection)){t.checked=false}else{t.checked=true}};this.onFocus=function(){t.ionFocus.emit()};this.onBlur=function(){t.ionBlur.emit()};this.checked=false;this.buttonTabindex=-1;this.color=undefined;this.name=this.inputId;this.disabled=false;this.value=undefined;this.labelPlacement="start";this.justify="space-between";this.alignment="center"}e.prototype.valueChanged=function(){this.updateState()};e.prototype.componentDidLoad=function(){this.updateState()};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){e.stopPropagation();e.preventDefault();this.el.focus();return[2]}))}))};e.prototype.setButtonTabindex=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.buttonTabindex=e;return[2]}))}))};e.prototype.connectedCallback=function(){if(this.value===undefined){this.value=this.inputId}var e=this.radioGroup=this.el.closest("ion-radio-group");if(e){this.updateState();addEventListener(e,"ionValueChange",this.updateState)}};e.prototype.disconnectedCallback=function(){var e=this.radioGroup;if(e){removeEventListener(e,"ionValueChange",this.updateState);this.radioGroup=null}};Object.defineProperty(e.prototype,"hasLabel",{get:function(){return this.el.textContent!==""},enumerable:false,configurable:true});e.prototype.renderRadioControl=function(){return h("div",{class:"radio-icon",part:"container"},h("div",{class:"radio-inner",part:"mark"}),h("div",{class:"radio-ripple"}))};e.prototype.render=function(){var e;var t=this,r=t.checked,i=t.disabled,a=t.color,o=t.el,n=t.justify,s=t.labelPlacement,l=t.hasLabel,d=t.buttonTabindex,c=t.alignment;var p=getIonMode(this);var b=hostContext("ion-item",o);return h(Host,{key:"43c95effb6acb119733270e8a5e02fe18b47ee4b",onFocus:this.onFocus,onBlur:this.onBlur,onClick:this.onClick,class:createColorClasses(a,(e={},e[p]=true,e["in-item"]=b,e["radio-checked"]=r,e["radio-disabled"]=i,e["radio-justify-".concat(n)]=true,e["radio-alignment-".concat(c)]=true,e["radio-label-placement-".concat(s)]=true,e["ion-activatable"]=!b,e["ion-focusable"]=!b,e)),role:"radio","aria-checked":r?"true":"false","aria-disabled":i?"true":null,tabindex:d},h("label",{key:"168ea77c08fde9832077d617662b93dc9986b544",class:"radio-wrapper"},h("div",{key:"ce1e6eee63fbab1e5a66b18f767f4eecc2a227f1",class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!l},part:"label"},h("slot",{key:"7d849e43d4356b5c3978c2bba9a6fba5d21ca69d"})),h("div",{key:"e741f7822364958b050a232bdfccdc413095c244",class:"native-wrapper"},this.renderRadioControl())))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var radioButtonIds=0;Radio.style={ios:IonRadioIosStyle0,md:IonRadioMdStyle0};var RadioGroup=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionValueChange=createEvent(this,"ionValueChange",7);this.inputId="ion-rg-".concat(radioGroupIds++);this.labelId="".concat(this.inputId,"-lbl");this.setRadioTabindex=function(e){var r=t.getRadios();var i=r.find((function(e){return!e.disabled}));var a=r.find((function(t){return t.value===e&&!t.disabled}));if(!i&&!a){return}var o=a||i;for(var n=0,s=r;n<s.length;n++){var l=s[n];var d=l===o?0:-1;l.setButtonTabindex(d)}};this.onClick=function(e){e.preventDefault();var r=e.target&&e.target.closest("ion-radio");if(r&&!r.disabled){var i=t.value;var a=r.value;if(a!==i){t.value=a;t.emitValueChange(e)}else if(t.allowEmptySelection){t.value=undefined;t.emitValueChange(e)}}};this.allowEmptySelection=false;this.compareWith=undefined;this.name=this.inputId;this.value=undefined}e.prototype.valueChanged=function(e){this.setRadioTabindex(e);this.ionValueChange.emit({value:e})};e.prototype.componentDidLoad=function(){this.valueChanged(this.value)};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){e=this.el.querySelector("ion-list-header")||this.el.querySelector("ion-item-divider");if(e){t=this.label=e.querySelector("ion-label");if(t){this.labelId=t.id=this.name+"-lbl"}}return[2]}))}))};e.prototype.getRadios=function(){return Array.from(this.el.querySelectorAll("ion-radio"))};e.prototype.emitValueChange=function(e){var t=this.value;this.ionChange.emit({value:t,event:e})};e.prototype.onKeydown=function(e){var t=!!this.el.closest("ion-select-popover");if(e.target&&!this.el.contains(e.target)){return}var r=this.getRadios().filter((function(e){return!e.disabled}));if(e.target&&r.includes(e.target)){var i=r.findIndex((function(t){return t===e.target}));var a=r[i];var o=void 0;if(["ArrowDown","ArrowRight"].includes(e.key)){o=i===r.length-1?r[0]:r[i+1]}if(["ArrowUp","ArrowLeft"].includes(e.key)){o=i===0?r[r.length-1]:r[i-1]}if(o&&r.includes(o)){o.setFocus(e);if(!t){this.value=o.value;this.emitValueChange(e)}}if([" "].includes(e.key)){var n=this.value;this.value=this.allowEmptySelection&&this.value!==undefined?undefined:a.value;if(n!==this.value||this.allowEmptySelection){this.emitValueChange(e)}e.preventDefault()}}};e.prototype.render=function(){var e=this,t=e.label,r=e.labelId,i=e.el,a=e.name,o=e.value;var n=getIonMode(this);renderHiddenInput(true,i,a,o,false);return h(Host,{key:"7a8ad7eb6a05c6f96a348dcf30fd0c610a95688c",role:"radiogroup","aria-labelledby":t?r:null,onClick:this.onClick,class:n})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var radioGroupIds=0;export{Radio as ion_radio,RadioGroup as ion_radio_group};
|