@ionic/core 9.0.11-dev.11794224641.1ae810e7 → 9.0.11-dev.11794308212.1f37a3b7
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-modal.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-toolbar.js +1 -1
- package/components/{p-py1vB-7U.js → p-BYZ5u8F9.js} +1 -1
- package/components/p-BmqDE55I.js +4 -0
- package/dist/cjs/ion-app_8.cjs.entry.js +82 -27
- package/dist/collection/components/toolbar/toolbar.js +82 -27
- package/dist/docs.json +1 -1
- package/dist/esm/ion-app_8.entry.js +82 -27
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-39e3be74.entry.js → p-1e0f0513.entry.js} +1 -1
- package/dist/types/components/toolbar/toolbar.d.ts +24 -2
- package/hydrate/index.js +83 -28
- package/hydrate/index.mjs +83 -28
- package/package.json +1 -1
- package/components/p-DdOVnjsY.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -47092,6 +47092,7 @@ class Toolbar {
|
|
|
47092
47092
|
constructor(hostRef) {
|
|
47093
47093
|
registerInstance(this, hostRef);
|
|
47094
47094
|
this.childrenStyles = new Map();
|
|
47095
|
+
this.slotNames = ['start', 'end', 'primary', 'secondary'];
|
|
47095
47096
|
this.slotClasses = [
|
|
47096
47097
|
'has-start-content',
|
|
47097
47098
|
'has-end-content',
|
|
@@ -47100,6 +47101,7 @@ class Toolbar {
|
|
|
47100
47101
|
];
|
|
47101
47102
|
this.showClasses = ['show-start', 'show-end', 'show-primary', 'show-secondary'];
|
|
47102
47103
|
this.slotSizeVars = ['--start-end-size', '--primary-secondary-size'];
|
|
47104
|
+
this.didLoad = false;
|
|
47103
47105
|
}
|
|
47104
47106
|
componentWillLoad() {
|
|
47105
47107
|
const buttons = Array.from(this.el.querySelectorAll('ion-buttons'));
|
|
@@ -47118,9 +47120,23 @@ class Toolbar {
|
|
|
47118
47120
|
}
|
|
47119
47121
|
this.updateSlotClasses();
|
|
47120
47122
|
}
|
|
47123
|
+
connectedCallback() {
|
|
47124
|
+
/**
|
|
47125
|
+
* The resize observer is stopped when the toolbar is removed from the DOM.
|
|
47126
|
+
* If the toolbar is added back (for example, when it is moved), start it again.
|
|
47127
|
+
* On the first connection the toolbar has not rendered yet, so this is left
|
|
47128
|
+
* to componentDidLoad.
|
|
47129
|
+
*/
|
|
47130
|
+
if (this.didLoad) {
|
|
47131
|
+
this.updateSlotClasses();
|
|
47132
|
+
}
|
|
47133
|
+
}
|
|
47121
47134
|
componentDidLoad() {
|
|
47135
|
+
this.didLoad = true;
|
|
47122
47136
|
this.updateSlotClasses();
|
|
47123
|
-
|
|
47137
|
+
}
|
|
47138
|
+
disconnectedCallback() {
|
|
47139
|
+
this.stopObservingSlotSizes();
|
|
47124
47140
|
}
|
|
47125
47141
|
titlePlacementChanged() {
|
|
47126
47142
|
this.updateSlotClasses();
|
|
@@ -47140,26 +47156,60 @@ class Toolbar {
|
|
|
47140
47156
|
* Updates the CSS custom properties for slot widths
|
|
47141
47157
|
* This ensures that slots shown by their met conditions
|
|
47142
47158
|
* have a minimum width matching their required slot
|
|
47143
|
-
|
|
47144
|
-
|
|
47145
|
-
|
|
47146
|
-
|
|
47147
|
-
|
|
47148
|
-
|
|
47149
|
-
|
|
47150
|
-
|
|
47151
|
-
|
|
47152
|
-
|
|
47153
|
-
|
|
47154
|
-
|
|
47159
|
+
*
|
|
47160
|
+
* The slotted content is watched with a ResizeObserver, which runs
|
|
47161
|
+
* before paint and again whenever the content changes size, so the
|
|
47162
|
+
* title is centered on first paint and stays centered.
|
|
47163
|
+
*/
|
|
47164
|
+
updateSlotWidths() {
|
|
47165
|
+
// Stop watching the previous content before watching the current one.
|
|
47166
|
+
this.stopObservingSlotSizes();
|
|
47167
|
+
// Browsers without ResizeObserver can only measure once.
|
|
47168
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
47169
|
+
this.measureAndUpdateSlots();
|
|
47170
|
+
return;
|
|
47171
|
+
}
|
|
47172
|
+
const elementsToObserve = [];
|
|
47173
|
+
this.slotNames.forEach((slot) => {
|
|
47174
|
+
if (this.el.classList.contains(`has-${slot}-content`)) {
|
|
47175
|
+
elementsToObserve.push(...this.getSlottedElements(slot));
|
|
47155
47176
|
}
|
|
47156
47177
|
});
|
|
47178
|
+
if (elementsToObserve.length === 0) {
|
|
47179
|
+
return;
|
|
47180
|
+
}
|
|
47181
|
+
/**
|
|
47182
|
+
* The observer also calls the callback once right after observing
|
|
47183
|
+
* an element, which takes care of the first measurement.
|
|
47184
|
+
*/
|
|
47185
|
+
const observer = new ResizeObserver(() => this.measureAndUpdateSlots());
|
|
47186
|
+
elementsToObserve.forEach((element) => observer.observe(element));
|
|
47187
|
+
this.slotResizeObserver = observer;
|
|
47188
|
+
}
|
|
47189
|
+
/**
|
|
47190
|
+
* Stops watching the slotted content for size changes.
|
|
47191
|
+
*/
|
|
47192
|
+
stopObservingSlotSizes() {
|
|
47193
|
+
if (this.slotResizeObserver) {
|
|
47194
|
+
this.slotResizeObserver.disconnect();
|
|
47195
|
+
this.slotResizeObserver = undefined;
|
|
47196
|
+
}
|
|
47197
|
+
}
|
|
47198
|
+
/**
|
|
47199
|
+
* Returns the elements assigned to the given slot of the toolbar.
|
|
47200
|
+
*/
|
|
47201
|
+
getSlottedElements(slotName) {
|
|
47202
|
+
const slotElement = this.getSlotElement(slotName);
|
|
47203
|
+
if (!slotElement) {
|
|
47204
|
+
return [];
|
|
47205
|
+
}
|
|
47206
|
+
return slotElement.assignedElements({ flatten: true });
|
|
47157
47207
|
}
|
|
47158
47208
|
/**
|
|
47159
47209
|
* Measure the widths of the slots and update the CSS custom properties
|
|
47160
47210
|
* for the minimum width of each pair of slots based on the largest width in each pair.
|
|
47161
|
-
*
|
|
47162
|
-
*
|
|
47211
|
+
* Slots that measure 0 (for example, in a hidden toolbar) are skipped. The
|
|
47212
|
+
* ResizeObserver measures them again when their content changes size.
|
|
47163
47213
|
*/
|
|
47164
47214
|
measureAndUpdateSlots() {
|
|
47165
47215
|
// Define the relationship between slots based on the conditions array
|
|
@@ -47168,14 +47218,19 @@ class Toolbar {
|
|
|
47168
47218
|
{ name: 'start-end', slots: ['start', 'end'] },
|
|
47169
47219
|
{ name: 'primary-secondary', slots: ['primary', 'secondary'] },
|
|
47170
47220
|
];
|
|
47221
|
+
/**
|
|
47222
|
+
* Once a size property is set, the slots cannot be narrower than it.
|
|
47223
|
+
* Remove the properties first so each slot is measured at the width of
|
|
47224
|
+
* its content, which lets the slots shrink when their content does.
|
|
47225
|
+
* This runs before paint, so the slots are never painted without a size.
|
|
47226
|
+
*/
|
|
47227
|
+
this.slotSizeVars.forEach((cssVar) => this.el.style.removeProperty(cssVar));
|
|
47171
47228
|
// First, measure all slot widths
|
|
47172
47229
|
const slotWidths = new Map();
|
|
47173
|
-
let allMeasurementsSuccessful = true;
|
|
47174
47230
|
// Measure all slots with content
|
|
47175
|
-
|
|
47176
|
-
slots.forEach((slot) => {
|
|
47231
|
+
this.slotNames.forEach((slot) => {
|
|
47177
47232
|
if (this.el.classList.contains(`has-${slot}-content`)) {
|
|
47178
|
-
const slotElement = this.
|
|
47233
|
+
const slotElement = this.getSlotElement(slot);
|
|
47179
47234
|
if (slotElement) {
|
|
47180
47235
|
// Check if the slot contains an img or ion-img
|
|
47181
47236
|
const assignedElements = slotElement.assignedElements({ flatten: true });
|
|
@@ -47197,9 +47252,6 @@ class Toolbar {
|
|
|
47197
47252
|
if (width > 0) {
|
|
47198
47253
|
slotWidths.set(slot, width);
|
|
47199
47254
|
}
|
|
47200
|
-
else {
|
|
47201
|
-
allMeasurementsSuccessful = false;
|
|
47202
|
-
}
|
|
47203
47255
|
}
|
|
47204
47256
|
}
|
|
47205
47257
|
});
|
|
@@ -47220,12 +47272,13 @@ class Toolbar {
|
|
|
47220
47272
|
this.el.style.setProperty(`--${name}-size`, `${maxWidth}px`);
|
|
47221
47273
|
}
|
|
47222
47274
|
});
|
|
47223
|
-
return allMeasurementsSuccessful;
|
|
47224
47275
|
}
|
|
47225
47276
|
/**
|
|
47226
47277
|
* Removes all slot visibility classes and slot width CSS variables.
|
|
47227
47278
|
*/
|
|
47228
47279
|
removeSlotClasses() {
|
|
47280
|
+
// The slot widths are no longer used, so there is nothing to watch.
|
|
47281
|
+
this.stopObservingSlotSizes();
|
|
47229
47282
|
this.el.classList.remove(...this.slotClasses, ...this.showClasses);
|
|
47230
47283
|
this.slotSizeVars.forEach((cssVar) => this.el.style.removeProperty(cssVar));
|
|
47231
47284
|
}
|
|
@@ -47236,10 +47289,9 @@ class Toolbar {
|
|
|
47236
47289
|
return;
|
|
47237
47290
|
}
|
|
47238
47291
|
// Check if slots have content
|
|
47239
|
-
const slots = ['start', 'end', 'primary', 'secondary'];
|
|
47240
47292
|
const classesToAdd = [];
|
|
47241
47293
|
const classesToRemove = [];
|
|
47242
|
-
|
|
47294
|
+
this.slotNames.forEach((slot) => {
|
|
47243
47295
|
const slotHasContent = this.hasSlotContent(slot);
|
|
47244
47296
|
const slotClass = `has-${slot}-content`;
|
|
47245
47297
|
if (slotHasContent) {
|
|
@@ -47278,9 +47330,12 @@ class Toolbar {
|
|
|
47278
47330
|
this.updateSlotWidths();
|
|
47279
47331
|
}
|
|
47280
47332
|
hasSlotContent(slotName) {
|
|
47281
|
-
const slotNode = this.
|
|
47333
|
+
const slotNode = this.getSlotElement(slotName);
|
|
47282
47334
|
return !!slotNode && slotNode.assignedNodes().length > 0;
|
|
47283
47335
|
}
|
|
47336
|
+
getSlotElement(slotName) {
|
|
47337
|
+
return this.el.shadowRoot?.querySelector(`slot[name="${slotName}"]`) ?? null;
|
|
47338
|
+
}
|
|
47284
47339
|
childrenStyle(ev) {
|
|
47285
47340
|
ev.stopPropagation();
|
|
47286
47341
|
const tagName = ev.target.tagName;
|
|
@@ -47309,14 +47364,14 @@ class Toolbar {
|
|
|
47309
47364
|
Object.assign(childStyles, style);
|
|
47310
47365
|
});
|
|
47311
47366
|
const titlePlacement = this.getTitlePlacement();
|
|
47312
|
-
return (hAsync(Host, { key: '
|
|
47367
|
+
return (hAsync(Host, { key: '003f41d137af84bdf99fb40415925b3eee6404df', class: {
|
|
47313
47368
|
...createColorClasses$1(this.color, {
|
|
47314
47369
|
[theme]: true,
|
|
47315
47370
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
47316
47371
|
[`toolbar-title-placement-${titlePlacement}`]: true,
|
|
47317
47372
|
}),
|
|
47318
47373
|
...childStyles,
|
|
47319
|
-
} }, hAsync("div", { key: '
|
|
47374
|
+
} }, hAsync("div", { key: 'c4699e28eeb587f46e334fe6c28f027328035637', class: "toolbar-background", part: "background" }), hAsync("div", { key: '1205f1292f892f689d6254f6bef2e8e29ab24737', class: "toolbar-container", part: "container" }, hAsync("slot", { key: 'fd96057417db7d4c6bb5cbee1df2944c4566b99e', name: "start", onSlotchange: () => this.updateSlotClasses() }), hAsync("slot", { key: '7ea7e907c0d1935683b662a5898692d3986f2090', name: "secondary", onSlotchange: () => this.updateSlotClasses() }), hAsync("div", { key: 'e78ba31dbad2d9a7be9a336d7a81a1f8bedae34b', class: "toolbar-content", part: "content" }, hAsync("slot", { key: 'dfe3ad669d9a6dfbdbd04fb6f81792dce8446866' })), hAsync("slot", { key: '6de21658d26cd479114b44c16f1f921c0d7b3753', name: "primary", onSlotchange: () => this.updateSlotClasses() }), hAsync("slot", { key: '176e7c6d4522f1dbc7ab2f390a4075b7a66307e9', name: "end", onSlotchange: () => this.updateSlotClasses() }))));
|
|
47320
47375
|
}
|
|
47321
47376
|
get el() { return getElement(this); }
|
|
47322
47377
|
static get watchers() { return {
|
package/hydrate/index.mjs
CHANGED
|
@@ -47090,6 +47090,7 @@ class Toolbar {
|
|
|
47090
47090
|
constructor(hostRef) {
|
|
47091
47091
|
registerInstance(this, hostRef);
|
|
47092
47092
|
this.childrenStyles = new Map();
|
|
47093
|
+
this.slotNames = ['start', 'end', 'primary', 'secondary'];
|
|
47093
47094
|
this.slotClasses = [
|
|
47094
47095
|
'has-start-content',
|
|
47095
47096
|
'has-end-content',
|
|
@@ -47098,6 +47099,7 @@ class Toolbar {
|
|
|
47098
47099
|
];
|
|
47099
47100
|
this.showClasses = ['show-start', 'show-end', 'show-primary', 'show-secondary'];
|
|
47100
47101
|
this.slotSizeVars = ['--start-end-size', '--primary-secondary-size'];
|
|
47102
|
+
this.didLoad = false;
|
|
47101
47103
|
}
|
|
47102
47104
|
componentWillLoad() {
|
|
47103
47105
|
const buttons = Array.from(this.el.querySelectorAll('ion-buttons'));
|
|
@@ -47116,9 +47118,23 @@ class Toolbar {
|
|
|
47116
47118
|
}
|
|
47117
47119
|
this.updateSlotClasses();
|
|
47118
47120
|
}
|
|
47121
|
+
connectedCallback() {
|
|
47122
|
+
/**
|
|
47123
|
+
* The resize observer is stopped when the toolbar is removed from the DOM.
|
|
47124
|
+
* If the toolbar is added back (for example, when it is moved), start it again.
|
|
47125
|
+
* On the first connection the toolbar has not rendered yet, so this is left
|
|
47126
|
+
* to componentDidLoad.
|
|
47127
|
+
*/
|
|
47128
|
+
if (this.didLoad) {
|
|
47129
|
+
this.updateSlotClasses();
|
|
47130
|
+
}
|
|
47131
|
+
}
|
|
47119
47132
|
componentDidLoad() {
|
|
47133
|
+
this.didLoad = true;
|
|
47120
47134
|
this.updateSlotClasses();
|
|
47121
|
-
|
|
47135
|
+
}
|
|
47136
|
+
disconnectedCallback() {
|
|
47137
|
+
this.stopObservingSlotSizes();
|
|
47122
47138
|
}
|
|
47123
47139
|
titlePlacementChanged() {
|
|
47124
47140
|
this.updateSlotClasses();
|
|
@@ -47138,26 +47154,60 @@ class Toolbar {
|
|
|
47138
47154
|
* Updates the CSS custom properties for slot widths
|
|
47139
47155
|
* This ensures that slots shown by their met conditions
|
|
47140
47156
|
* have a minimum width matching their required slot
|
|
47141
|
-
|
|
47142
|
-
|
|
47143
|
-
|
|
47144
|
-
|
|
47145
|
-
|
|
47146
|
-
|
|
47147
|
-
|
|
47148
|
-
|
|
47149
|
-
|
|
47150
|
-
|
|
47151
|
-
|
|
47152
|
-
|
|
47157
|
+
*
|
|
47158
|
+
* The slotted content is watched with a ResizeObserver, which runs
|
|
47159
|
+
* before paint and again whenever the content changes size, so the
|
|
47160
|
+
* title is centered on first paint and stays centered.
|
|
47161
|
+
*/
|
|
47162
|
+
updateSlotWidths() {
|
|
47163
|
+
// Stop watching the previous content before watching the current one.
|
|
47164
|
+
this.stopObservingSlotSizes();
|
|
47165
|
+
// Browsers without ResizeObserver can only measure once.
|
|
47166
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
47167
|
+
this.measureAndUpdateSlots();
|
|
47168
|
+
return;
|
|
47169
|
+
}
|
|
47170
|
+
const elementsToObserve = [];
|
|
47171
|
+
this.slotNames.forEach((slot) => {
|
|
47172
|
+
if (this.el.classList.contains(`has-${slot}-content`)) {
|
|
47173
|
+
elementsToObserve.push(...this.getSlottedElements(slot));
|
|
47153
47174
|
}
|
|
47154
47175
|
});
|
|
47176
|
+
if (elementsToObserve.length === 0) {
|
|
47177
|
+
return;
|
|
47178
|
+
}
|
|
47179
|
+
/**
|
|
47180
|
+
* The observer also calls the callback once right after observing
|
|
47181
|
+
* an element, which takes care of the first measurement.
|
|
47182
|
+
*/
|
|
47183
|
+
const observer = new ResizeObserver(() => this.measureAndUpdateSlots());
|
|
47184
|
+
elementsToObserve.forEach((element) => observer.observe(element));
|
|
47185
|
+
this.slotResizeObserver = observer;
|
|
47186
|
+
}
|
|
47187
|
+
/**
|
|
47188
|
+
* Stops watching the slotted content for size changes.
|
|
47189
|
+
*/
|
|
47190
|
+
stopObservingSlotSizes() {
|
|
47191
|
+
if (this.slotResizeObserver) {
|
|
47192
|
+
this.slotResizeObserver.disconnect();
|
|
47193
|
+
this.slotResizeObserver = undefined;
|
|
47194
|
+
}
|
|
47195
|
+
}
|
|
47196
|
+
/**
|
|
47197
|
+
* Returns the elements assigned to the given slot of the toolbar.
|
|
47198
|
+
*/
|
|
47199
|
+
getSlottedElements(slotName) {
|
|
47200
|
+
const slotElement = this.getSlotElement(slotName);
|
|
47201
|
+
if (!slotElement) {
|
|
47202
|
+
return [];
|
|
47203
|
+
}
|
|
47204
|
+
return slotElement.assignedElements({ flatten: true });
|
|
47155
47205
|
}
|
|
47156
47206
|
/**
|
|
47157
47207
|
* Measure the widths of the slots and update the CSS custom properties
|
|
47158
47208
|
* for the minimum width of each pair of slots based on the largest width in each pair.
|
|
47159
|
-
*
|
|
47160
|
-
*
|
|
47209
|
+
* Slots that measure 0 (for example, in a hidden toolbar) are skipped. The
|
|
47210
|
+
* ResizeObserver measures them again when their content changes size.
|
|
47161
47211
|
*/
|
|
47162
47212
|
measureAndUpdateSlots() {
|
|
47163
47213
|
// Define the relationship between slots based on the conditions array
|
|
@@ -47166,14 +47216,19 @@ class Toolbar {
|
|
|
47166
47216
|
{ name: 'start-end', slots: ['start', 'end'] },
|
|
47167
47217
|
{ name: 'primary-secondary', slots: ['primary', 'secondary'] },
|
|
47168
47218
|
];
|
|
47219
|
+
/**
|
|
47220
|
+
* Once a size property is set, the slots cannot be narrower than it.
|
|
47221
|
+
* Remove the properties first so each slot is measured at the width of
|
|
47222
|
+
* its content, which lets the slots shrink when their content does.
|
|
47223
|
+
* This runs before paint, so the slots are never painted without a size.
|
|
47224
|
+
*/
|
|
47225
|
+
this.slotSizeVars.forEach((cssVar) => this.el.style.removeProperty(cssVar));
|
|
47169
47226
|
// First, measure all slot widths
|
|
47170
47227
|
const slotWidths = new Map();
|
|
47171
|
-
let allMeasurementsSuccessful = true;
|
|
47172
47228
|
// Measure all slots with content
|
|
47173
|
-
|
|
47174
|
-
slots.forEach((slot) => {
|
|
47229
|
+
this.slotNames.forEach((slot) => {
|
|
47175
47230
|
if (this.el.classList.contains(`has-${slot}-content`)) {
|
|
47176
|
-
const slotElement = this.
|
|
47231
|
+
const slotElement = this.getSlotElement(slot);
|
|
47177
47232
|
if (slotElement) {
|
|
47178
47233
|
// Check if the slot contains an img or ion-img
|
|
47179
47234
|
const assignedElements = slotElement.assignedElements({ flatten: true });
|
|
@@ -47195,9 +47250,6 @@ class Toolbar {
|
|
|
47195
47250
|
if (width > 0) {
|
|
47196
47251
|
slotWidths.set(slot, width);
|
|
47197
47252
|
}
|
|
47198
|
-
else {
|
|
47199
|
-
allMeasurementsSuccessful = false;
|
|
47200
|
-
}
|
|
47201
47253
|
}
|
|
47202
47254
|
}
|
|
47203
47255
|
});
|
|
@@ -47218,12 +47270,13 @@ class Toolbar {
|
|
|
47218
47270
|
this.el.style.setProperty(`--${name}-size`, `${maxWidth}px`);
|
|
47219
47271
|
}
|
|
47220
47272
|
});
|
|
47221
|
-
return allMeasurementsSuccessful;
|
|
47222
47273
|
}
|
|
47223
47274
|
/**
|
|
47224
47275
|
* Removes all slot visibility classes and slot width CSS variables.
|
|
47225
47276
|
*/
|
|
47226
47277
|
removeSlotClasses() {
|
|
47278
|
+
// The slot widths are no longer used, so there is nothing to watch.
|
|
47279
|
+
this.stopObservingSlotSizes();
|
|
47227
47280
|
this.el.classList.remove(...this.slotClasses, ...this.showClasses);
|
|
47228
47281
|
this.slotSizeVars.forEach((cssVar) => this.el.style.removeProperty(cssVar));
|
|
47229
47282
|
}
|
|
@@ -47234,10 +47287,9 @@ class Toolbar {
|
|
|
47234
47287
|
return;
|
|
47235
47288
|
}
|
|
47236
47289
|
// Check if slots have content
|
|
47237
|
-
const slots = ['start', 'end', 'primary', 'secondary'];
|
|
47238
47290
|
const classesToAdd = [];
|
|
47239
47291
|
const classesToRemove = [];
|
|
47240
|
-
|
|
47292
|
+
this.slotNames.forEach((slot) => {
|
|
47241
47293
|
const slotHasContent = this.hasSlotContent(slot);
|
|
47242
47294
|
const slotClass = `has-${slot}-content`;
|
|
47243
47295
|
if (slotHasContent) {
|
|
@@ -47276,9 +47328,12 @@ class Toolbar {
|
|
|
47276
47328
|
this.updateSlotWidths();
|
|
47277
47329
|
}
|
|
47278
47330
|
hasSlotContent(slotName) {
|
|
47279
|
-
const slotNode = this.
|
|
47331
|
+
const slotNode = this.getSlotElement(slotName);
|
|
47280
47332
|
return !!slotNode && slotNode.assignedNodes().length > 0;
|
|
47281
47333
|
}
|
|
47334
|
+
getSlotElement(slotName) {
|
|
47335
|
+
return this.el.shadowRoot?.querySelector(`slot[name="${slotName}"]`) ?? null;
|
|
47336
|
+
}
|
|
47282
47337
|
childrenStyle(ev) {
|
|
47283
47338
|
ev.stopPropagation();
|
|
47284
47339
|
const tagName = ev.target.tagName;
|
|
@@ -47307,14 +47362,14 @@ class Toolbar {
|
|
|
47307
47362
|
Object.assign(childStyles, style);
|
|
47308
47363
|
});
|
|
47309
47364
|
const titlePlacement = this.getTitlePlacement();
|
|
47310
|
-
return (hAsync(Host, { key: '
|
|
47365
|
+
return (hAsync(Host, { key: '003f41d137af84bdf99fb40415925b3eee6404df', class: {
|
|
47311
47366
|
...createColorClasses$1(this.color, {
|
|
47312
47367
|
[theme]: true,
|
|
47313
47368
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
47314
47369
|
[`toolbar-title-placement-${titlePlacement}`]: true,
|
|
47315
47370
|
}),
|
|
47316
47371
|
...childStyles,
|
|
47317
|
-
} }, hAsync("div", { key: '
|
|
47372
|
+
} }, hAsync("div", { key: 'c4699e28eeb587f46e334fe6c28f027328035637', class: "toolbar-background", part: "background" }), hAsync("div", { key: '1205f1292f892f689d6254f6bef2e8e29ab24737', class: "toolbar-container", part: "container" }, hAsync("slot", { key: 'fd96057417db7d4c6bb5cbee1df2944c4566b99e', name: "start", onSlotchange: () => this.updateSlotClasses() }), hAsync("slot", { key: '7ea7e907c0d1935683b662a5898692d3986f2090', name: "secondary", onSlotchange: () => this.updateSlotClasses() }), hAsync("div", { key: 'e78ba31dbad2d9a7be9a336d7a81a1f8bedae34b', class: "toolbar-content", part: "content" }, hAsync("slot", { key: 'dfe3ad669d9a6dfbdbd04fb6f81792dce8446866' })), hAsync("slot", { key: '6de21658d26cd479114b44c16f1f921c0d7b3753', name: "primary", onSlotchange: () => this.updateSlotClasses() }), hAsync("slot", { key: '176e7c6d4522f1dbc7ab2f390a4075b7a66307e9', name: "end", onSlotchange: () => this.updateSlotClasses() }))));
|
|
47318
47373
|
}
|
|
47319
47374
|
get el() { return getElement(this); }
|
|
47320
47375
|
static get watchers() { return {
|
package/package.json
CHANGED
package/components/p-DdOVnjsY.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{d as t,H as o,j as e,h as a,f as r,t as n}from"./p-DFBWAYvo.js";import{c as i,h as s}from"./p-BUF_V-Kg.js";import{b as d}from"./p-C93i7QCU.js";const l=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.childrenStyles=new Map,this.slotClasses=["has-start-content","has-end-content","has-primary-content","has-secondary-content"],this.showClasses=["show-start","show-end","show-primary","show-secondary"],this.slotSizeVars=["--start-end-size","--primary-secondary-size"]}componentWillLoad(){const t=Array.from(this.el.querySelectorAll("ion-buttons")),o=t.find((t=>"start"===t.slot));o&&o.classList.add("buttons-first-slot");const e=t.reverse(),a=e.find((t=>"end"===t.slot))||e.find((t=>"primary"===t.slot))||e.find((t=>"secondary"===t.slot));a&&a.classList.add("buttons-last-slot"),this.updateSlotClasses()}componentDidLoad(){this.updateSlotClasses(),this.updateSlotWidths()}titlePlacementChanged(){this.updateSlotClasses()}getTitlePlacement(){return void 0!==this.titlePlacement?this.titlePlacement:"ionic"===d(this)||"ios"===d(this)?"center":"start"}updateSlotWidths(t=0){setTimeout((()=>{!this.measureAndUpdateSlots()&&t<5&&setTimeout((()=>{this.updateSlotWidths(t+1)}),100)}))}measureAndUpdateSlots(){const t=[{name:"start-end",slots:["start","end"]},{name:"primary-secondary",slots:["primary","secondary"]}],o=new Map;let e=!0;return["start","end","primary","secondary"].forEach((a=>{if(this.el.classList.contains(`has-${a}-content`)){const r=this.el.shadowRoot?.querySelector(`slot[name="${a}"]`);if(r){if(r.assignedElements({flatten:!0}).some((t=>"IMG"===t.tagName||"ION-IMG"===t.tagName||null!==t.querySelector("img, ion-img")))){const{name:o}=t.find((t=>t.slots.includes(a)));this.el.style.setProperty(`--${o}-size`,"auto")}const n=r.offsetWidth;n>0?o.set(a,n):e=!1}}})),t.forEach((({name:t,slots:e})=>{let a=0,r=!1;e.forEach((t=>{o.has(t)&&(r=!0,a=Math.max(a,o.get(t)??0))})),r&&a>0&&this.el.style.setProperty(`--${t}-size`,`${a}px`)})),e}removeSlotClasses(){this.el.classList.remove(...this.slotClasses,...this.showClasses),this.slotSizeVars.forEach((t=>this.el.style.removeProperty(t)))}updateSlotClasses(){if("center"!==this.getTitlePlacement())return void this.removeSlotClasses();const t=[],o=[];["start","end","primary","secondary"].forEach((e=>{const a=`has-${e}-content`;this.hasSlotContent(e)?t.push(a):o.push(a)})),[{name:"end",requiredSlots:["start"],excludeSlots:["end","primary"]},{name:"start",requiredSlots:["end"],excludeSlots:["start","secondary"]},{name:"secondary",requiredSlots:["primary"],excludeSlots:["secondary","start"]},{name:"primary",requiredSlots:["secondary"],excludeSlots:["primary","end"]}].forEach((e=>{const a=e.requiredSlots.every((o=>t.includes(`has-${o}-content`))),r=e.excludeSlots.some((o=>t.includes(`has-${o}-content`))),n=`show-${e.name}`;a&&!r?t.push(n):o.push(n)})),this.el.classList.add(...t),this.el.classList.remove(...o),this.updateSlotWidths()}hasSlotContent(t){const o=this.el.shadowRoot?.querySelector(`slot[name="${t}"]`);return!!o&&o.assignedNodes().length>0}childrenStyle(t){t.stopPropagation();const o=t.target.tagName,a=t.detail,r={},n=this.childrenStyles.get(o)||{};let i=!1;Object.keys(a).forEach((t=>{const o=`toolbar-${t}`,e=a[t];e!==n[o]&&(i=!0),e&&(r[o]=!0)})),i&&(this.childrenStyles.set(o,r),e(this))}render(){const t=d(this),o={};this.childrenStyles.forEach((t=>{Object.assign(o,t)}));const e=this.getTitlePlacement();return a(r,{key:"3b97d3de5b1910257170355995eb7a50a2b6dcc4",class:{...i(this.color,{[t]:!0,"in-toolbar":s("ion-toolbar",this.el),[`toolbar-title-placement-${e}`]:!0}),...o}},a("div",{key:"26f85390aa62f118e585fd8560fba0620b30fd51",class:"toolbar-background",part:"background"}),a("div",{key:"57e32773d5642dde7f5d7cca9aaceb41b4d800bd",class:"toolbar-container",part:"container"},a("slot",{key:"5429b3f898703339749a55af6bb28d7e4d969679",name:"start",onSlotchange:()=>this.updateSlotClasses}),a("slot",{key:"c5565f7020f52a1f075d9c6908ace042d488642f",name:"secondary",onSlotchange:()=>this.updateSlotClasses}),a("div",{key:"2d083bcd57512041321a68b43d6b90144eb20166",class:"toolbar-content",part:"content"},a("slot",{key:"eb8abc0b9b96c699355891fbd0d284094cde7632"})),a("slot",{key:"ca66f2dcce1f5382ed40a120cf32f759597a11ad",name:"primary",onSlotchange:()=>this.updateSlotClasses}),a("slot",{key:"19e3eb792d45c21404fe48f119d68248b5d7dca7",name:"end",onSlotchange:()=>this.updateSlotClasses})))}get el(){return this}static get watchers(){return{titlePlacement:[{titlePlacementChanged:0}]}}static get style(){return{ionic:":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;width:100%;padding-right:var(--ion-safe-area-right);padding-left:var(--ion-safe-area-left);color:var(--color);contain:content;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-container{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-background{right:0;left:0;top:0;bottom:0;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));pointer-events:none}::slotted(ion-progress-bar){right:0;left:0;bottom:0;position:absolute}:host{--background:var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));--color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528));--border-color:currentColor;--padding-top:var(--token-space-200, var(--token-scale-200, 8px));--padding-bottom:var(--token-space-200, var(--token-scale-200, 8px));--padding-start:var(--token-space-200, var(--token-scale-200, 8px));--padding-end:var(--token-space-200, var(--token-scale-200, 8px));--min-height:var(--token-scale-1400, 56px)}.toolbar-container{gap:var(--token-space-400, var(--token-scale-400, 16px));z-index:10}.toolbar-background{z-index:-1}.toolbar-content{-ms-flex:1 1 auto;flex:1 1 auto;min-width:0}:host(.toolbar-searchbar) ::slotted(ion-searchbar){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}::slotted(ion-buttons){gap:var(--token-space-200, var(--token-scale-200, 8px))}::slotted(ion-title){-webkit-padding-start:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-start:var(--token-space-200, var(--token-scale-200, 8px));-webkit-padding-end:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-end:var(--token-space-200, var(--token-scale-200, 8px))}:host(.toolbar-title-large) ::slotted(ion-title){-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px))}:host(.has-end-content) slot[name=end],:host(.show-end) slot[name=end]{display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--start-end-size, 0);flex:0 0 var(--start-end-size, 0);-ms-flex-pack:end;justify-content:flex-end;text-align:end}:host(.has-start-content) slot[name=start],:host(.show-start) slot[name=start]{display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--start-end-size, 0);flex:0 0 var(--start-end-size, 0)}:host(.has-primary-content) slot[name=primary],:host(.show-primary) slot[name=primary]{display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--primary-secondary-size, 0);flex:0 0 var(--primary-secondary-size, 0);-ms-flex-pack:end;justify-content:flex-end;text-align:end}:host(.has-secondary-content) slot[name=secondary],:host(.show-secondary) slot[name=secondary]{display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--primary-secondary-size, 0);flex:0 0 var(--primary-secondary-size, 0)}:host(.toolbar-title-placement-start) ::slotted(ion-title){text-align:start}:host(.toolbar-title-placement-center) ::slotted(ion-title){text-align:center}:host(.toolbar-title-placement-end) ::slotted(ion-title){text-align:end}",ios:":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;width:100%;padding-right:var(--ion-safe-area-right);padding-left:var(--ion-safe-area-left);color:var(--color);contain:content;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-container{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-background{right:0;left:0;top:0;bottom:0;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));pointer-events:none}::slotted(ion-progress-bar){right:0;left:0;bottom:0;position:absolute}:host{font-family:var(--ion-font-family, inherit);z-index:10}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{z-index:10}.toolbar-background{z-index:-1}:host{--background:var(--ion-toolbar-background, var(--ion-color-step-50, var(--ion-background-color-step-50, #f7f7f7)));--color:var(--ion-toolbar-color, var(--ion-text-color, #000));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.2)))));--padding-top:3px;--padding-bottom:3px;--padding-start:4px;--padding-end:4px;--min-height:44px}.toolbar-content{-ms-flex:1;flex:1;-ms-flex-order:4;order:4;min-width:0}:host(.toolbar-segment) .toolbar-content{display:-ms-inline-flexbox;display:inline-flex}:host(.toolbar-searchbar) .toolbar-container{padding-top:0;padding-bottom:0}:host(.toolbar-searchbar) ::slotted(*){-ms-flex-item-align:start;align-self:start}:host(.toolbar-searchbar) ::slotted(ion-chip){margin-top:3px}::slotted(ion-buttons){min-height:38px}::slotted([slot=start]){-ms-flex-order:2;order:2}::slotted([slot=secondary]){-ms-flex-order:3;order:3}::slotted([slot=primary]){-ms-flex-order:5;order:5;text-align:end}::slotted([slot=end]){-ms-flex-order:6;order:6;text-align:end}:host(.toolbar-title-large) .toolbar-container{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:start;align-items:flex-start}:host(.toolbar-title-large) .toolbar-content ion-title{-ms-flex:1;flex:1;-ms-flex-order:8;order:8;min-width:100%}",md:":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;width:100%;padding-right:var(--ion-safe-area-right);padding-left:var(--ion-safe-area-left);color:var(--color);contain:content;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-container{-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.toolbar-background{right:0;left:0;top:0;bottom:0;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));pointer-events:none}::slotted(ion-progress-bar){right:0;left:0;bottom:0;position:absolute}:host{font-family:var(--ion-font-family, inherit);z-index:10}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{z-index:10}.toolbar-background{z-index:-1}:host{--background:var(--ion-toolbar-background, var(--ion-background-color, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #424242));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, #c1c4cd))));--padding-top:0;--padding-bottom:0;--padding-start:0;--padding-end:0;--min-height:56px}.toolbar-content{-ms-flex:1;flex:1;-ms-flex-order:3;order:3;min-width:0;max-width:100%}::slotted(.buttons-first-slot){-webkit-margin-start:4px;margin-inline-start:4px}::slotted(.buttons-last-slot){-webkit-margin-end:4px;margin-inline-end:4px}::slotted([slot=start]){-ms-flex-order:2;order:2}::slotted([slot=secondary]){-ms-flex-order:4;order:4}::slotted([slot=primary]){-ms-flex-order:5;order:5;text-align:end}::slotted([slot=end]){-ms-flex-order:6;order:6;text-align:end}"}}},[289,"ion-toolbar",{color:[513],titlePlacement:[1,"title-placement"]},[[0,"ionStyle","childrenStyle"]],{titlePlacement:[{titlePlacementChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["ion-toolbar"].forEach((t=>{"ion-toolbar"===t&&(customElements.get(n(t))||customElements.define(n(t),l))}))}export{l as T,c as d}
|