@ionic/core 8.8.4-dev.11776178970.14763043 → 8.8.4-dev.11776186452.1cc0af05
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-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-infinite-scroll-content.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-refresher-content.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-option.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-skeleton-text.js +1 -1
- package/components/ion-spinner.js +1 -1
- package/components/ion-split-pane.js +1 -1
- package/components/ion-tab-bar.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +1 -1
- package/components/ion-tabs.js +1 -1
- package/components/ion-text.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-thumbnail.js +1 -1
- package/components/ion-title.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/ion-toolbar.js +1 -1
- package/components/{p-C-_EGKki.js → p-B0orUoaV.js} +1 -1
- package/components/p-BObmvbuR.js +4 -0
- package/components/p-C8Dne7pI.js +4 -0
- package/components/p-Cm7hjN9B.js +4 -0
- package/components/p-DQY5lHUa.js +4 -0
- package/components/p-D_uMZULz.js +4 -0
- package/components/{p-CoarhFWH.js → p-ZRp3l6Dk.js} +1 -1
- package/components/{p-C2cZvGcF.js → p-qhBzWoOF.js} +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +23 -8
- package/dist/cjs/ion-alert.cjs.entry.js +42 -24
- package/dist/cjs/ion-app_8.cjs.entry.js +4 -4
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-range.cjs.entry.js +1 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +59 -26
- package/dist/cjs/ion-select_3.cjs.entry.js +190 -47
- package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +3 -3
- package/dist/cjs/ion-toast.cjs.entry.js +2 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/select-option-render-qQf4xz8P.js +67 -0
- package/dist/collection/components/action-sheet/action-sheet.ionic.css +834 -0
- package/dist/collection/components/action-sheet/action-sheet.ios.css +84 -0
- package/dist/collection/components/action-sheet/action-sheet.js +21 -6
- package/dist/collection/components/action-sheet/action-sheet.md.css +84 -0
- package/dist/collection/components/alert/alert.ionic.css +1165 -0
- package/dist/collection/components/alert/alert.ios.css +83 -0
- package/dist/collection/components/alert/alert.js +40 -22
- package/dist/collection/components/alert/alert.md.css +83 -0
- package/dist/collection/components/range/range.ionic.css +6 -9
- package/dist/collection/components/select/select.ionic.css +31 -0
- package/dist/collection/components/select/select.ios.css +31 -0
- package/dist/collection/components/select/select.js +125 -14
- package/dist/collection/components/select/select.md.css +31 -0
- package/dist/collection/components/select-modal/select-modal.ionic.css +24 -0
- package/dist/collection/components/select-modal/select-modal.ios.css +77 -0
- package/dist/collection/components/select-modal/select-modal.js +56 -23
- package/dist/collection/components/select-modal/select-modal.md.css +80 -1
- package/dist/collection/components/select-option/select-option.js +21 -2
- package/dist/collection/components/select-popover/select-popover.ionic.css +489 -0
- package/dist/collection/components/select-popover/select-popover.ios.css +77 -0
- package/dist/collection/components/select-popover/select-popover.js +59 -26
- package/dist/collection/components/select-popover/select-popover.md.css +77 -0
- package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-pane/split-pane.js +2 -2
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-button/tab-button.js +2 -2
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/text/text.js +2 -2
- package/dist/collection/components/textarea/textarea.js +3 -3
- package/dist/collection/components/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/title/title.js +2 -2
- package/dist/collection/components/toast/toast.js +2 -2
- package/dist/collection/components/toggle/toggle.js +3 -3
- package/dist/collection/components/toolbar/toolbar.js +2 -2
- package/dist/collection/utils/select-option-render.js +62 -0
- package/dist/docs.json +135 -1
- package/dist/esm/ion-action-sheet.entry.js +23 -8
- package/dist/esm/ion-alert.entry.js +42 -24
- package/dist/esm/ion-app_8.entry.js +4 -4
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-item_8.entry.js +2 -2
- package/dist/esm/ion-range.entry.js +1 -1
- package/dist/esm/ion-select-modal.entry.js +59 -26
- package/dist/esm/ion-select_3.entry.js +191 -48
- package/dist/esm/ion-spinner.entry.js +1 -1
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar_2.entry.js +4 -4
- package/dist/esm/ion-tab_2.entry.js +3 -3
- package/dist/esm/ion-text.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +3 -3
- package/dist/esm/ion-toast.entry.js +2 -2
- package/dist/esm/ion-toggle.entry.js +3 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select-option-render-BQUT9Aqa.js +65 -0
- package/dist/html.html-data.json +4 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-003b40fc.entry.js +4 -0
- package/dist/ionic/{p-3bf01c2c.entry.js → p-26595044.entry.js} +1 -1
- package/dist/ionic/p-27edb91a.entry.js +4 -0
- package/dist/ionic/p-35aa95dc.entry.js +4 -0
- package/dist/ionic/{p-e9d6ce67.entry.js → p-37f895a8.entry.js} +1 -1
- package/dist/ionic/p-38897781.entry.js +4 -0
- package/dist/ionic/p-575061c0.entry.js +4 -0
- package/dist/ionic/{p-2bf931ae.entry.js → p-69033ad6.entry.js} +1 -1
- package/dist/ionic/{p-cdfbe4cc.entry.js → p-71f28573.entry.js} +1 -1
- package/dist/ionic/{p-9b9b1450.entry.js → p-96ec9a10.entry.js} +1 -1
- package/dist/ionic/{p-49799a34.entry.js → p-9e71982e.entry.js} +1 -1
- package/dist/ionic/p-Dr3N4o63.js +4 -0
- package/dist/ionic/{p-bc5713f7.entry.js → p-a1c8ba8c.entry.js} +1 -1
- package/dist/ionic/{p-91e242e4.entry.js → p-a94016be.entry.js} +1 -1
- package/dist/ionic/{p-6c8c37c2.entry.js → p-aa8c1e64.entry.js} +1 -1
- package/dist/ionic/p-c3335fe0.entry.js +4 -0
- package/dist/ionic/{p-2193e875.entry.js → p-d2fe6791.entry.js} +1 -1
- package/dist/types/components/select/select-interface.d.ts +21 -0
- package/dist/types/components/select/select.d.ts +7 -0
- package/dist/types/components/select-option/select-option.d.ts +4 -0
- package/dist/types/components.d.ts +9 -0
- package/dist/types/utils/select-option-render.d.ts +26 -0
- package/hydrate/index.js +396 -132
- package/hydrate/index.mjs +396 -132
- package/package.json +1 -1
- package/components/p-BGHaEUgp.js +0 -4
- package/components/p-BR9Yxas9.js +0 -4
- package/components/p-Ch9P0ikq.js +0 -4
- package/components/p-iwGbwewM.js +0 -4
- package/dist/ionic/p-227744b8.entry.js +0 -4
- package/dist/ionic/p-4b0f5ffd.entry.js +0 -4
- package/dist/ionic/p-64341e32.entry.js +0 -4
- package/dist/ionic/p-6be2b2d3.entry.js +0 -4
- package/dist/ionic/p-9acd3fd3.entry.js +0 -4
- package/dist/ionic/p-a283aa4d.entry.js +0 -4
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h, forceUpdate } from "@stencil/core";
|
|
5
5
|
import { safeCall } from "../../utils/overlays";
|
|
6
|
+
import { renderOptionLabel } from "../../utils/select-option-render";
|
|
6
7
|
import { getClassMap } from "../../utils/theme";
|
|
7
8
|
import { getIonTheme } from "../../global/ionic-global";
|
|
8
9
|
/**
|
|
@@ -75,39 +76,71 @@ export class SelectPopover {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
renderCheckboxOptions(options) {
|
|
78
|
-
return options.map((option) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
return options.map((option, index) => {
|
|
80
|
+
/**
|
|
81
|
+
* Cast to `SelectOverlayOption` to access rich content
|
|
82
|
+
* fields (`startContent`, `endContent`, `description`)
|
|
83
|
+
* that are passed through from `ion-select` but not
|
|
84
|
+
* part of the public `SelectPopoverOption` interface.
|
|
85
|
+
*/
|
|
86
|
+
const richOption = option;
|
|
87
|
+
const optionLabelOptions = {
|
|
88
|
+
id: `popover-option-${index}`,
|
|
89
|
+
label: richOption.text,
|
|
90
|
+
startContent: richOption.startContent,
|
|
91
|
+
endContent: richOption.endContent,
|
|
92
|
+
description: richOption.description,
|
|
93
|
+
};
|
|
94
|
+
return (h("ion-item", { class: Object.assign({
|
|
95
|
+
// TODO FW-4784
|
|
96
|
+
'item-checkbox-checked': option.checked
|
|
97
|
+
}, getClassMap(option.cssClass)) }, h("ion-checkbox", { value: option.value, disabled: option.disabled, checked: option.checked, justify: "start", labelPlacement: "end", onIonChange: (ev) => {
|
|
98
|
+
this.setChecked(ev);
|
|
99
|
+
this.callOptionHandler(ev);
|
|
100
|
+
// TODO FW-4784
|
|
101
|
+
forceUpdate(this);
|
|
102
|
+
} }, renderOptionLabel(optionLabelOptions, 'select-option-label'))));
|
|
103
|
+
});
|
|
87
104
|
}
|
|
88
105
|
renderRadioOptions(options) {
|
|
89
106
|
const checked = options.filter((o) => o.checked).map((o) => o.value)[0];
|
|
90
|
-
return (h("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, options.map((option) =>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
return (h("ion-radio-group", { value: checked, onIonChange: (ev) => this.callOptionHandler(ev) }, options.map((option, index) => {
|
|
108
|
+
/**
|
|
109
|
+
* Cast to `SelectOverlayOption` to access rich content
|
|
110
|
+
* fields (`startContent`, `endContent`, `description`)
|
|
111
|
+
* that are passed through from `ion-select` but not
|
|
112
|
+
* part of the public `SelectPopoverOption` interface.
|
|
113
|
+
*/
|
|
114
|
+
const richOption = option;
|
|
115
|
+
const optionLabelOptions = {
|
|
116
|
+
id: `popover-option-${index}`,
|
|
117
|
+
label: richOption.text,
|
|
118
|
+
startContent: richOption.startContent,
|
|
119
|
+
endContent: richOption.endContent,
|
|
120
|
+
description: richOption.description,
|
|
121
|
+
};
|
|
122
|
+
return (h("ion-item", { class: Object.assign({
|
|
123
|
+
// TODO FW-4784
|
|
124
|
+
'item-radio-checked': option.value === checked
|
|
125
|
+
}, getClassMap(option.cssClass)) }, h("ion-radio", { value: option.value, disabled: option.disabled, onClick: () => this.dismissParentPopover(), onKeyUp: (ev) => {
|
|
126
|
+
if (ev.key === ' ') {
|
|
127
|
+
/**
|
|
128
|
+
* Selecting a radio option with keyboard navigation,
|
|
129
|
+
* either through the Enter or Space keys, should
|
|
130
|
+
* dismiss the popover.
|
|
131
|
+
*/
|
|
132
|
+
this.dismissParentPopover();
|
|
133
|
+
}
|
|
134
|
+
} }, renderOptionLabel(optionLabelOptions, 'select-option-label'))));
|
|
135
|
+
})));
|
|
103
136
|
}
|
|
104
137
|
render() {
|
|
105
138
|
const { header, message, options, subHeader } = this;
|
|
106
139
|
const hasSubHeaderOrMessage = subHeader !== undefined || message !== undefined;
|
|
107
140
|
const theme = getIonTheme(this);
|
|
108
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: 'cf05dabe58fcd71a74ac46ab8cb3da7dd687068f', class: {
|
|
109
142
|
[theme]: true,
|
|
110
|
-
} }, h("ion-list", { key: '
|
|
143
|
+
} }, h("ion-list", { key: 'a8367a02dd063da5b55ab133ccfa914990e86023' }, header !== undefined && h("ion-list-header", { key: 'a5c1442720cc3e4a7c629f459c34d7a70f7ee913' }, header), hasSubHeaderOrMessage && (h("ion-item", { key: '282735c1127096b1b0bf85b3fd20f26fe4535849' }, h("ion-label", { key: '42aa5709d92f7d0232ef07d607cf4ef19f9ad633', class: "ion-text-wrap" }, subHeader !== undefined && h("h3", { key: 'f89fee59d120604bc141ec5cc0a872e9c46fd059' }, subHeader), message !== undefined && h("p", { key: '4778170bb58e781570c448d5d5d485b7ac2c9a7a' }, message)))), this.renderOptions(options))));
|
|
111
144
|
}
|
|
112
145
|
static get is() { return "ion-select-popover"; }
|
|
113
146
|
static get encapsulation() { return "scoped"; }
|
|
@@ -115,14 +148,14 @@ export class SelectPopover {
|
|
|
115
148
|
return {
|
|
116
149
|
"ios": ["select-popover.ios.scss"],
|
|
117
150
|
"md": ["select-popover.md.scss"],
|
|
118
|
-
"ionic": ["select-popover.
|
|
151
|
+
"ionic": ["select-popover.ionic.scss"]
|
|
119
152
|
};
|
|
120
153
|
}
|
|
121
154
|
static get styleUrls() {
|
|
122
155
|
return {
|
|
123
156
|
"ios": ["select-popover.ios.css"],
|
|
124
157
|
"md": ["select-popover.md.css"],
|
|
125
|
-
"ionic": ["select-popover.
|
|
158
|
+
"ionic": ["select-popover.ionic.css"]
|
|
126
159
|
};
|
|
127
160
|
}
|
|
128
161
|
static get properties() {
|
|
@@ -1,3 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A heuristic that applies CSS to tablet
|
|
3
|
+
* viewports.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* @include tablet-viewport() {
|
|
7
|
+
* :host {
|
|
8
|
+
* background-color: green;
|
|
9
|
+
* }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A heuristic that applies CSS to mobile
|
|
14
|
+
* viewports (i.e. phones, not tablets).
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* @include mobile-viewport() {
|
|
18
|
+
* :host {
|
|
19
|
+
* background-color: blue;
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Convert a font size to a dynamic font size.
|
|
25
|
+
* Fonts that participate in Dynamic Type should use
|
|
26
|
+
* dynamic font sizes.
|
|
27
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
28
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
29
|
+
* convert to a unit other than $baselineUnit.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Convert a font size to a dynamic font size but impose
|
|
33
|
+
* a maximum font size.
|
|
34
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
35
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
36
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
37
|
+
* convert to a unit other than $baselineUnit.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Convert a font size to a dynamic font size but impose
|
|
41
|
+
* a minimum font size.
|
|
42
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
43
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
44
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
45
|
+
* convert to a unit other than $baselineUnit.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Convert a font size to a dynamic font size but impose
|
|
49
|
+
* maximum and minimum font sizes.
|
|
50
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
51
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
52
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
53
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
54
|
+
* convert to a unit other than $baselineUnit.
|
|
55
|
+
*/
|
|
1
56
|
/**
|
|
2
57
|
* Convert a pixels given value into rem
|
|
3
58
|
*
|
|
@@ -84,6 +139,28 @@ ion-label {
|
|
|
84
139
|
overflow-y: auto;
|
|
85
140
|
}
|
|
86
141
|
|
|
142
|
+
.select-option-label {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.select-option-description {
|
|
148
|
+
display: block;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.select-option-label {
|
|
152
|
+
gap: 12px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.select-option-description {
|
|
156
|
+
padding-left: 0;
|
|
157
|
+
padding-right: 0;
|
|
158
|
+
padding-top: 5px;
|
|
159
|
+
padding-bottom: 0;
|
|
160
|
+
color: var(--ion-color-step-700, var(--ion-text-color-step-300, #4d4d4d));
|
|
161
|
+
font-size: 0.75rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
87
164
|
/**
|
|
88
165
|
* Convert a pixels given value into rem
|
|
89
166
|
*
|
|
@@ -32,11 +32,11 @@ export class SkeletonText {
|
|
|
32
32
|
const animated = this.animated && config.getBoolean('animated', true);
|
|
33
33
|
const inMedia = hostContext('ion-avatar', this.el) || hostContext('ion-thumbnail', this.el);
|
|
34
34
|
const theme = getIonTheme(this);
|
|
35
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '7ecf3ae7e75872c65ba0620eecba500c7e75efd9', class: {
|
|
36
36
|
[theme]: true,
|
|
37
37
|
'skeleton-text-animated': animated,
|
|
38
38
|
'in-media': inMedia,
|
|
39
|
-
} }, h("span", { key: '
|
|
39
|
+
} }, h("span", { key: '5d0cd4fec873b8874cbc61eeb14cc3332948714c' }, "\u00A0")));
|
|
40
40
|
}
|
|
41
41
|
static get is() { return "ion-skeleton-text"; }
|
|
42
42
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,7 +56,7 @@ export class Spinner {
|
|
|
56
56
|
svgs.push(buildLine(spinner, duration, i, spinner.lines));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: 'ffa2aff2489b312e7fe5ed12367a8e7a5a0c9e84', class: createColorClasses(self.color, {
|
|
60
60
|
[theme]: true,
|
|
61
61
|
[`spinner-${spinnerName}`]: true,
|
|
62
62
|
'spinner-paused': self.paused || config.getBoolean('_testing'),
|
|
@@ -130,12 +130,12 @@ export class SplitPane {
|
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
132
|
const theme = getIonTheme(this);
|
|
133
|
-
return (h(Host, { key: '
|
|
133
|
+
return (h(Host, { key: 'ba071f752105c205268870e6a6c56ff9bd526b58', class: {
|
|
134
134
|
[theme]: true,
|
|
135
135
|
// Used internally for styling
|
|
136
136
|
[`split-pane-${theme}`]: true,
|
|
137
137
|
'split-pane-visible': this.visible,
|
|
138
|
-
} }, h("slot", { key: '
|
|
138
|
+
} }, h("slot", { key: '32717b94ab9f2e35d8e8e078916e17b2f537a36c' })));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "ion-split-pane"; }
|
|
141
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,10 +51,10 @@ export class Tab {
|
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
53
|
const { tab, active, component } = this;
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: 'd0f187723395ce3a1b8bca0532ef5debbc937112', role: "tabpanel", "aria-hidden": !active ? 'true' : null, "aria-labelledby": `tab-button-${tab}`, class: {
|
|
55
55
|
'ion-page': component === undefined,
|
|
56
56
|
'tab-hidden': !active,
|
|
57
|
-
} }, h("slot", { key: '
|
|
57
|
+
} }, h("slot", { key: '101dbf0b24d10663caac383cc55e00e7d8b69075' })));
|
|
58
58
|
}
|
|
59
59
|
static get is() { return "ion-tab"; }
|
|
60
60
|
static get encapsulation() { return "shadow"; }
|
|
@@ -111,13 +111,13 @@ export class TabBar {
|
|
|
111
111
|
const theme = getIonTheme(this);
|
|
112
112
|
const shape = this.getShape();
|
|
113
113
|
const shouldHide = keyboardVisible && this.el.getAttribute('slot') !== 'top';
|
|
114
|
-
return (h(Host, { key: '
|
|
114
|
+
return (h(Host, { key: 'c611d612cadde5ccd785bca07044dd6d4b6ab7d8', role: "tablist", "aria-hidden": shouldHide ? 'true' : null, class: createColorClasses(color, {
|
|
115
115
|
[theme]: true,
|
|
116
116
|
'tab-bar-translucent': translucent,
|
|
117
117
|
'tab-bar-hidden': shouldHide,
|
|
118
118
|
[`tab-bar-${expand}`]: true,
|
|
119
119
|
[`tab-bar-${shape}`]: shape !== undefined,
|
|
120
|
-
}) }, h("slot", { key: '
|
|
120
|
+
}) }, h("slot", { key: 'e2a59593a95658fe2b4960900922525e180ff0b3' })));
|
|
121
121
|
}
|
|
122
122
|
static get is() { return "ion-tab-bar"; }
|
|
123
123
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,7 +93,7 @@ export class TabButton {
|
|
|
93
93
|
rel,
|
|
94
94
|
target,
|
|
95
95
|
};
|
|
96
|
-
return (h(Host, { key: '
|
|
96
|
+
return (h(Host, { key: 'bcb528b6ff33f94949450e5dfd68e4d960cf5423', onClick: this.onClick, onKeyup: this.onKeyUp, id: tab !== undefined ? `tab-button-${tab}` : null, class: {
|
|
97
97
|
[theme]: true,
|
|
98
98
|
'tab-selected': selected,
|
|
99
99
|
'tab-disabled': disabled,
|
|
@@ -106,7 +106,7 @@ export class TabButton {
|
|
|
106
106
|
'ion-selectable': true,
|
|
107
107
|
[`tab-button-shape-${shape}`]: shape !== undefined,
|
|
108
108
|
'ion-focusable': true,
|
|
109
|
-
} }, h("a", Object.assign({ key: '
|
|
109
|
+
} }, h("a", Object.assign({ key: '25b6a211e06c352c77e01d66f4158fc3a08431c1' }, attrs, { class: "button-native", part: "native", role: "tab", "aria-selected": selected ? 'true' : null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? '-1' : undefined }, inheritedAttributes), h("span", { key: 'eb7a8ec7ff898fd69adc41e9d9bda04c72c8751c', class: "button-inner" }, h("slot", { key: 'b5e0aaebcc81dd3d306f9bf079033e956117700e' })), theme === 'md' && h("ion-ripple-effect", { key: '5f236205851b6512f2a4cd187950ca7b88e6622f', type: "unbounded" }))));
|
|
110
110
|
}
|
|
111
111
|
static get is() { return "ion-tab-button"; }
|
|
112
112
|
static get encapsulation() { return "shadow"; }
|
|
@@ -165,7 +165,7 @@ export class Tabs {
|
|
|
165
165
|
return Array.from(this.el.querySelectorAll('ion-tab'));
|
|
166
166
|
}
|
|
167
167
|
render() {
|
|
168
|
-
return (h(Host, { key: '
|
|
168
|
+
return (h(Host, { key: '349bb9ccaaa04426ea24f5dad1386a7876d9abdf', onIonTabButtonClick: this.onTabClicked }, h("slot", { key: '2ee0972213087203ebe442be897a95877d7c45f4', name: "top" }), h("div", { key: '15d7938fd4220c276d450eb277ae01fff6a82446', class: "tabs-inner" }, h("slot", { key: 'fb9005ecedc09ff3b4e90837806ace918c121dff' })), h("slot", { key: '0471aa1559469c9416d53ff4a1526b9cc2efde4b', name: "bottom" })));
|
|
169
169
|
}
|
|
170
170
|
static get is() { return "ion-tabs"; }
|
|
171
171
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,9 +11,9 @@ import { getIonTheme } from "../../global/ionic-global";
|
|
|
11
11
|
export class Text {
|
|
12
12
|
render() {
|
|
13
13
|
const theme = getIonTheme(this);
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '5b28c2e9965f6d9f5b25ba6c77f29e4c1de2da3c', class: createColorClasses(this.color, {
|
|
15
15
|
[theme]: true,
|
|
16
|
-
}) }, h("slot", { key: '
|
|
16
|
+
}) }, h("slot", { key: 'cbe285130bb096c5f3f4a7345a71db49d8bdef82' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "ion-text"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -565,7 +565,7 @@ export class Textarea {
|
|
|
565
565
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
566
566
|
*/
|
|
567
567
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
568
|
-
return (h(Host, { key: '
|
|
568
|
+
return (h(Host, { key: '83736da2d61c935a71121245858009adef0b9d80', class: createColorClasses(this.color, {
|
|
569
569
|
[theme]: true,
|
|
570
570
|
'has-value': hasValue,
|
|
571
571
|
'has-focus': hasFocus,
|
|
@@ -577,7 +577,7 @@ export class Textarea {
|
|
|
577
577
|
'in-item': inItem,
|
|
578
578
|
'textarea-disabled': disabled,
|
|
579
579
|
'textarea-readonly': readonly,
|
|
580
|
-
}) }, h("label", { key: '
|
|
580
|
+
}) }, h("label", { key: '808ab4bcee4e76cc3e156fd50246a0b55010afae', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick, part: "wrapper" }, this.renderLabelContainer(), h("div", { key: 'f18d3890414a2807df4ad853e5788b5ab6d43117', class: "textarea-wrapper-inner" },
|
|
581
581
|
/**
|
|
582
582
|
* For the ionic theme, we render the outline container here
|
|
583
583
|
* instead of higher up, so it can be positioned relative to
|
|
@@ -587,7 +587,7 @@ export class Textarea {
|
|
|
587
587
|
* <label> element, ensuring that clicking the label text
|
|
588
588
|
* focuses the textarea.
|
|
589
589
|
*/
|
|
590
|
-
theme === 'ionic' && fill === 'outline' && h("div", { key: '
|
|
590
|
+
theme === 'ionic' && fill === 'outline' && h("div", { key: '9f6e88c47eb3535c2aec69e340fdcbe85ab62252', class: "textarea-outline" }), h("div", { key: 'd475f7f4aee2ec5e03f4926de20f31269a8fa822', class: "start-slot-wrapper" }, h("slot", { key: '3a73320f79fba2a1ea0570e10897d047320bf0a4', name: "start" })), h("div", { key: '4a6d0e4ca328435d537b814c052ba083e9470d6d', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el), part: "container" }, h("textarea", Object.assign({ key: 'afb9bad3b1cb2e904cad008abdc5a7145a2c2e0b', class: "native-textarea", part: "native", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.isInvalid ? 'true' : undefined }, this.inheritedAttributes), value)), h("div", { key: '5de4fa3ef8c3b06b78f30fe5d7569df1012345a7', class: "end-slot-wrapper" }, h("slot", { key: 'fec86a4fdd3a3bafc34e63e51ee52be45f2d9203', name: "end" }))), shouldRenderHighlight && h("div", { key: 'd6414e625a41de93eb44670c2b26300c4c1c0470', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
591
591
|
}
|
|
592
592
|
static get is() { return "ion-textarea"; }
|
|
593
593
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,9 +10,9 @@ import { getIonTheme } from "../../global/ionic-global";
|
|
|
10
10
|
export class Thumbnail {
|
|
11
11
|
render() {
|
|
12
12
|
const theme = getIonTheme(this);
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: '4e648ac7ee9586cb95ee5bba2cce9f36eb831763', class: {
|
|
14
14
|
[theme]: true,
|
|
15
|
-
} }, h("slot", { key: '
|
|
15
|
+
} }, h("slot", { key: '2f249fca7ef22eb02a7a7a59a77dc3414aaca2ae' })));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "ion-thumbnail"; }
|
|
18
18
|
static get encapsulation() { return "shadow"; }
|
|
@@ -27,11 +27,11 @@ export class ToolbarTitle {
|
|
|
27
27
|
render() {
|
|
28
28
|
const theme = getIonTheme(this);
|
|
29
29
|
const size = this.getSize();
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '1878dd41dc0bae351513c0fe0a2513b19860e2ca', class: createColorClasses(this.color, {
|
|
31
31
|
[theme]: true,
|
|
32
32
|
[`title-${size}`]: true,
|
|
33
33
|
'title-rtl': document.dir === 'rtl',
|
|
34
|
-
}) }, h("div", { key: '
|
|
34
|
+
}) }, h("div", { key: '6a901d75e397beb1392efe9369a0c1006267fc3b', class: "toolbar-title" }, h("slot", { key: 'd024f2dd88be52409be89df1e05aecfd31f851ee' }))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "ion-title"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -439,9 +439,9 @@ export class Toast {
|
|
|
439
439
|
if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
|
|
440
440
|
printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
|
|
441
441
|
}
|
|
442
|
-
return (h(Host, Object.assign({ key: '
|
|
442
|
+
return (h(Host, Object.assign({ key: '8f2a7964ecbc74d57a7743475f51abba45ec5302', tabindex: "-1" }, this.htmlAttributes, { style: {
|
|
443
443
|
zIndex: `${60000 + this.overlayIndex}`,
|
|
444
|
-
}, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true, [theme]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent, [`toast-shape-${shape}`]: shape !== undefined, [`toast-hue-${hue}`]: hue !== undefined })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '
|
|
444
|
+
}, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true, [theme]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent, [`toast-shape-${shape}`]: shape !== undefined, [`toast-hue-${hue}`]: hue !== undefined })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: 'bb637ccbcda0c68c34d0a9efc8bd5c0ee9da49f9', class: wrapperClass, part: "wrapper" }, h("div", { key: '3779659eb5d855dd360503b336090c7e0b569975', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '768a222c9b188978afeda83119d71bde8fb6e2b3', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: '4a5fc7d5f374f5a7de1a916351143d5a31d939cf', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
|
|
445
445
|
}
|
|
446
446
|
static get is() { return "ion-toast"; }
|
|
447
447
|
static get encapsulation() { return "shadow"; }
|
|
@@ -338,7 +338,7 @@ export class Toggle {
|
|
|
338
338
|
const rtl = isRTL(el) ? 'rtl' : 'ltr';
|
|
339
339
|
const isIonicTheme = theme === 'ionic';
|
|
340
340
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
341
|
-
return (h(Host, { key: '
|
|
341
|
+
return (h(Host, { key: 'c6cb748b63423fee5ec8a20c971da76a789565be', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, "aria-required": required ? 'true' : undefined, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses(color, {
|
|
342
342
|
[theme]: true,
|
|
343
343
|
'in-item': hostContext('ion-item', el),
|
|
344
344
|
'toggle-activated': activated,
|
|
@@ -350,10 +350,10 @@ export class Toggle {
|
|
|
350
350
|
[`toggle-${rtl}`]: true,
|
|
351
351
|
'ion-activatable': isIonicTheme,
|
|
352
352
|
'ion-focusable': isIonicTheme,
|
|
353
|
-
}) }, h("label", { key: '
|
|
353
|
+
}) }, h("label", { key: '74cfa7dff2e55a9a7a921c1eb2b2d32429c8468c', class: "toggle-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: 'c08526492a357cee5485895a72292c7530ed5503', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, required: required }, inheritedAttributes)), h("div", { key: 'bd59cd8dab463e12125da45e43f9b6251240f158', class: {
|
|
354
354
|
'label-text-wrapper': true,
|
|
355
355
|
'label-text-wrapper-hidden': !hasLabel,
|
|
356
|
-
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '
|
|
356
|
+
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '548804cb29efb86561074081acb7a3ebc4a20615' }), this.renderHintText()), h("div", { key: '4de487ca61f42687072b7b67541c4abefd1665f6', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
357
357
|
}
|
|
358
358
|
static get is() { return "ion-toggle"; }
|
|
359
359
|
static get encapsulation() { return "shadow"; }
|
|
@@ -242,11 +242,11 @@ export class Toolbar {
|
|
|
242
242
|
Object.assign(childStyles, style);
|
|
243
243
|
});
|
|
244
244
|
const titlePlacement = this.getTitlePlacement();
|
|
245
|
-
return (h(Host, { key: '
|
|
245
|
+
return (h(Host, { key: 'f0aeb982054f92d5f78f5ad199252e4b5f30da2a', class: Object.assign(Object.assign({}, createColorClasses(this.color, {
|
|
246
246
|
[theme]: true,
|
|
247
247
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
248
248
|
[`toolbar-title-placement-${titlePlacement}`]: true,
|
|
249
|
-
})), childStyles) }, h("div", { key: '
|
|
249
|
+
})), childStyles) }, h("div", { key: '171fb03d11af753e7a5d8f0852cc4d6c7a83e659', class: "toolbar-background", part: "background" }), h("div", { key: 'bcdc3556337c68f225b6cb714c54dad0ef5a8573', class: "toolbar-container", part: "container" }, h("slot", { key: '76475d634be06e07f552bfe68d304336402a9d26', name: "start", onSlotchange: () => this.updateSlotClasses }), h("slot", { key: 'd1585926018c983010a56014c076f0c1120b893f', name: "secondary", onSlotchange: () => this.updateSlotClasses }), h("div", { key: 'bb2609e1282304595f9770f4a14ff5c64b91c1fa', class: "toolbar-content", part: "content" }, h("slot", { key: '0c06057b148d82f9741387f843ea4b4a8a3c96b6' })), h("slot", { key: '78e91de1d9157e493b8742dd137f3dbf985166a2', name: "primary", onSlotchange: () => this.updateSlotClasses }), h("slot", { key: '58b0271fb1a4b0739d0aa6336599727c0f411d3b', name: "end", onSlotchange: () => this.updateSlotClasses }))));
|
|
250
250
|
}
|
|
251
251
|
static get is() { return "ion-toolbar"; }
|
|
252
252
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
/**
|
|
6
|
+
* Cache that maps rendered span elements to the source HTMLElement
|
|
7
|
+
* they were cloned from. This prevents flickering when a user
|
|
8
|
+
* selects an option that has rich content, as the content will only be
|
|
9
|
+
* re-rendered if the source HTMLElement changes.
|
|
10
|
+
*/
|
|
11
|
+
const contentCache = new WeakMap();
|
|
12
|
+
/**
|
|
13
|
+
* Renders cloned DOM content into a span element via a ref callback.
|
|
14
|
+
* The content is only cloned when the source element changes,
|
|
15
|
+
* preventing flicker caused by destroying and recreating web
|
|
16
|
+
* components (e.g., ion-avatar) on every re-render cycle.
|
|
17
|
+
*
|
|
18
|
+
* Uses span elements because this content may render within buttons,
|
|
19
|
+
* depending on the select interface. Buttons can only have phrasing
|
|
20
|
+
* content to prevent accessibility issues.
|
|
21
|
+
*
|
|
22
|
+
* @param id - Unique identifier for generating stable virtual DOM keys.
|
|
23
|
+
* @param content - The HTMLElement container whose child nodes will be cloned.
|
|
24
|
+
* @param className - CSS class applied to the wrapper span.
|
|
25
|
+
*/
|
|
26
|
+
const renderClonedContent = (id, content, className) => {
|
|
27
|
+
return (h("span", { class: className, key: `${className}-${id}`, ref: (el) => {
|
|
28
|
+
if (el) {
|
|
29
|
+
const cached = contentCache.get(el);
|
|
30
|
+
// Skip if this element already has clones from the same source
|
|
31
|
+
if (cached === content) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Clear previous content and clone new nodes
|
|
35
|
+
el.innerHTML = '';
|
|
36
|
+
Array.from(content.childNodes).forEach((n) => el.appendChild(n.cloneNode(true)));
|
|
37
|
+
contentCache.set(el, content);
|
|
38
|
+
}
|
|
39
|
+
} }));
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Renders the label content for a select option within an overlay
|
|
43
|
+
* interface based on the presence of rich content.
|
|
44
|
+
*
|
|
45
|
+
* Uses span elements because this content may render within buttons,
|
|
46
|
+
* depending on the select interface. Buttons can only have phrasing
|
|
47
|
+
* content to prevent accessibility issues.
|
|
48
|
+
*
|
|
49
|
+
* @param option - The content option data containing label, slots,
|
|
50
|
+
* and description.
|
|
51
|
+
* @param className - The base CSS class for the label element.
|
|
52
|
+
*/
|
|
53
|
+
export const renderOptionLabel = (option, className) => {
|
|
54
|
+
const { id, label, startContent, endContent, description } = option;
|
|
55
|
+
const hasRichContent = !!startContent || !!endContent || !!description;
|
|
56
|
+
// Render the main label
|
|
57
|
+
const labelEl = typeof label === 'string' || !label ? (h("span", { key: `${className}-label-${id}` }, label)) : (renderClonedContent(id, label, `${className}-text`));
|
|
58
|
+
if (!hasRichContent) {
|
|
59
|
+
return (h("span", { class: className, key: `${className}-${id}` }, labelEl));
|
|
60
|
+
}
|
|
61
|
+
return (h("span", { class: className, key: `${className}-${id}` }, startContent && renderClonedContent(id, startContent, 'select-option-start'), h("span", { class: "select-option-content", key: `${className}-content-${id}` }, labelEl, description && (h("span", { class: "select-option-description", key: `${className}-desc-${id}` }, description))), endContent && renderClonedContent(id, endContent, 'select-option-end')));
|
|
62
|
+
};
|