@swiftwc/ui 0.0.0-dev.99 → 1.0.0-canary.1
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/generated/client/index.js +8 -9
- package/generated/components/alert-dialog.js +9 -17
- package/generated/components/bordered-button.js +4 -7
- package/generated/components/bordered-prominent-button.js +4 -7
- package/generated/components/borderless-button.js +4 -7
- package/generated/components/color-scheme.js +4 -7
- package/generated/components/confirmation-dialog.js +9 -17
- package/generated/components/content-unavailable.d.ts +1 -1
- package/generated/components/content-unavailable.js +5 -8
- package/generated/components/{body-view.d.ts → content-view.d.ts} +2 -2
- package/generated/components/content-view.js +15 -0
- package/generated/components/date-picker.js +13 -25
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- package/generated/components/disclosure-group.js +5 -9
- package/generated/components/fine-tooltip.js +4 -7
- package/generated/components/form-view.js +3 -5
- package/generated/components/glass-button.js +4 -7
- package/generated/components/glass-prominent-button.js +4 -7
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-flex-stack.d.ts +16 -0
- package/generated/components/h-flex-stack.js +18 -0
- package/generated/components/h-stack.js +3 -5
- package/generated/components/image-view.js +4 -7
- package/generated/components/index.d.ts +7 -1
- package/generated/components/index.js +7 -1
- package/generated/components/label-view.d.ts +2 -2
- package/generated/components/label-view.js +6 -9
- package/generated/components/labeled-content.d.ts +7 -1
- package/generated/components/labeled-content.js +32 -32
- package/generated/components/list-view.d.ts +5 -1
- package/generated/components/list-view.js +8 -6
- package/generated/components/menu-view.d.ts +1 -1
- package/generated/components/menu-view.js +11 -20
- package/generated/components/navigation-large-title.d.ts +0 -1
- package/generated/components/navigation-large-title.js +5 -10
- package/generated/components/navigation-split-view.js +4 -7
- package/generated/components/navigation-stack.js +4 -7
- package/generated/components/navigation-title.js +4 -7
- package/generated/components/picker-view.d.ts +4 -21
- package/generated/components/picker-view.js +374 -326
- package/generated/components/plain-button.js +3 -5
- package/generated/components/progress-view.d.ts +1 -1
- package/generated/components/progress-view.js +7 -12
- package/generated/components/screen-view.js +2 -3
- package/generated/components/scroll-view-proxy.js +3 -5
- package/generated/components/scroll-view.d.ts +1 -1
- package/generated/components/scroll-view.js +10 -17
- package/generated/components/search-view.js +4 -7
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +5 -8
- package/generated/components/sheet-view.js +6 -11
- package/generated/components/sidebar-toggle.js +5 -9
- package/generated/components/sidebar-view.js +2 -3
- package/generated/components/sticky-container.js +3 -5
- package/generated/components/tab-bar.js +4 -7
- package/generated/components/tab-item.js +8 -15
- package/generated/components/tab-view.js +19 -23
- package/generated/components/table-view.d.ts +1 -1
- package/generated/components/table-view.js +7 -12
- package/generated/components/text-field.js +10 -19
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +2 -0
- package/generated/components/toggle-view.js +33 -37
- package/generated/components/tool-bar-item-group.js +3 -5
- package/generated/components/tool-bar-item.js +4 -7
- package/generated/components/tool-bar.js +4 -7
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-flex-stack.d.ts +16 -0
- package/generated/components/v-flex-stack.js +18 -0
- package/generated/components/v-keyboard.js +8 -12
- package/generated/components/v-stack.js +3 -5
- package/generated/css/index.css +762 -418
- package/generated/internal/class/css-style-observer.js +2 -3
- package/generated/internal/class/form-associated-base.js +6 -8
- package/generated/internal/class/navigation-path.js +2 -2
- package/generated/internal/class/navigation-view.js +3 -5
- package/generated/internal/decorators/adaptive-slot.js +4 -7
- package/generated/internal/decorators/microtask-on-connected.d.ts +2 -2
- package/generated/internal/decorators/microtask-on-connected.js +2 -2
- package/generated/internal/dev-flags.d.ts +4 -0
- package/generated/internal/dev-flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +2 -2
- package/generated/internal/privateNamespace.js +15 -24
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/index.d.ts +36 -2
- package/generated/internal/utils/index.js +36 -5
- package/generated/internal/utils/is-inside.js +1 -1
- package/generated/snapshot/index.js +3 -5
- package/{web-components.html-data → html-data}/en.json +155 -54
- package/package.json +24 -20
- package/scss/_components.scss +1 -1
- package/scss/_maps.scss +3 -1
- package/scss/_utils.scss +3 -1
- package/scss/_vars.scss +1 -0
- package/scss/base/_layout.scss +8 -8
- package/scss/base/_reboot.scss +4 -29
- package/scss/base/_root.scss +27 -12
- package/scss/colors/_index.scss +66 -1
- package/scss/components/_alert-dialog.scss +3 -3
- package/scss/components/_bordered-button.scss +2 -2
- package/scss/components/_bordered-prominent-button.scss +3 -3
- package/scss/components/_borderless-button.scss +2 -2
- package/scss/components/_confirmation-dialog.scss +1 -1
- package/scss/components/_content-unavailable.scss +1 -1
- package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
- package/scss/components/_date-picker.scss +1 -1
- package/scss/components/_detail-placeholder.scss +5 -5
- package/scss/components/_disclosure-group.scss +2 -2
- package/scss/components/_fine-tooltip.scss +1 -1
- package/scss/components/_form-view.scss +3 -3
- package/scss/components/_full-screen.scss +1 -1
- package/scss/components/_glass-button.scss +2 -2
- package/scss/components/_glass-prominent-button.scss +3 -3
- package/scss/components/_group-box.scss +1 -1
- package/scss/components/_h-divider.scss +1 -1
- package/scss/components/_h-flex-stack.scss +3 -1
- package/scss/components/_h-stack.scss +1 -1
- package/scss/components/_image-view.scss +1 -1
- package/scss/components/_index.scss +34 -24
- package/scss/components/_label-view.scss +1 -1
- package/scss/components/_labeled-content.scss +1 -1
- package/scss/components/_list-view.scss +3 -3
- package/scss/components/_menu-view.scss +3 -3
- package/scss/components/_navigation-large-title.scss +15 -9
- package/scss/components/_navigation-split-view.scss +18 -18
- package/scss/components/_navigation-stack.scss +1 -1
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +159 -119
- package/scss/components/_plain-button.scss +2 -2
- package/scss/components/_progress-view.scss +1 -1
- package/scss/components/_scroll-view-proxy.scss +1 -1
- package/scss/components/_scroll-view-toolbars.scss +1 -1
- package/scss/components/_scroll-view.scss +2 -2
- package/scss/components/_search-view.scss +1 -1
- package/scss/components/_section-view.scss +1 -1
- package/scss/components/_sheet-view.scss +2 -2
- package/scss/components/_sidebar-toggle.scss +1 -1
- package/scss/components/_sidebar-view.scss +2 -2
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +1 -1
- package/scss/components/_tab-item.scss +1 -1
- package/scss/components/_tab-view.scss +23 -15
- package/scss/components/_table-column.scss +1 -1
- package/scss/components/_table-row.scss +1 -1
- package/scss/components/_table-view.scss +1 -1
- package/scss/components/_text-field.scss +1 -1
- package/scss/components/_text-view.scss +1 -1
- package/scss/components/_toggle-view.scss +41 -21
- package/scss/components/_tool-bar-item-group.scss +1 -1
- package/scss/components/_tool-bar-item.scss +2 -2
- package/scss/components/_tool-bar.scss +2 -2
- package/scss/components/_v-divider.scss +1 -1
- package/scss/components/_v-flex-stack.scss +3 -1
- package/scss/components/_v-keyboard.scss +1 -1
- package/scss/components/_v-stack.scss +1 -1
- package/scss/final/_touch-glass.scss +2 -2
- package/scss/mixins/_index.scss +2 -2
- package/scss/placeholders/_buttons.scss +5 -5
- package/scss/placeholders/_lists.scss +3 -3
- package/scss/transitions/_alert-dialog.scss +1 -1
- package/scss/transitions/_bwd.navbar.scss +1 -1
- package/scss/transitions/_bwd.scss +3 -3
- package/scss/transitions/_confirmation-dialog.scss +1 -1
- package/scss/transitions/_disclosure-group.scss +1 -1
- package/scss/transitions/_fine-tooltip.scss +1 -1
- package/scss/transitions/_fwd.navbar.scss +1 -1
- package/scss/transitions/_fwd.scss +1 -1
- package/scss/transitions/_glass-button.scss +1 -1
- package/scss/transitions/_glass-prominent-button.scss +1 -1
- package/scss/transitions/_index.scss +1 -1
- package/scss/transitions/_menu-view.scss +1 -1
- package/scss/transitions/_navigation-split-view.scss +1 -1
- package/scss/transitions/_progress-view.scss +1 -1
- package/scss/transitions/_sheet-view.scss +1 -1
- package/scss/transitions/_sidebar-view.scss +1 -1
- package/scss/transitions/_tab-bar.scss +1 -1
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +2 -2
- package/scss/utils/_index.scss +33 -8
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +5 -3
- package/generated/components/body-view.js +0 -17
- package/generated/internal/utils/cash/index.d.ts +0 -24
- package/generated/internal/utils/cash/index.js +0 -27
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
- /package/{web-components.css-data → css-data}/en.json +0 -0
- /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
- /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
- /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
- /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
- /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
- /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
- /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
- /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
- /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
- /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
4
|
import { NavigationPath } from '../internal/class/navigation-path';
|
|
5
|
-
import {
|
|
5
|
+
import { cssTime, debounce, debug, frame, onoff, siblings, timeout } from '../internal/utils';
|
|
6
6
|
import { Snapshot } from '../snapshot';
|
|
7
7
|
const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
|
|
8
8
|
/**
|
|
@@ -29,8 +29,7 @@ export class TabView extends HTMLElement {
|
|
|
29
29
|
this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
|
|
30
30
|
}
|
|
31
31
|
disconnectedCallback() {
|
|
32
|
-
|
|
33
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
32
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
34
33
|
this.#afterTabRevealDelay.cancel();
|
|
35
34
|
this.#cssStyleObserver?.disconnect();
|
|
36
35
|
CleanupRegistry.unregister(this);
|
|
@@ -39,11 +38,15 @@ export class TabView extends HTMLElement {
|
|
|
39
38
|
return this.#cachedAdaptableTabBarPlacement;
|
|
40
39
|
}
|
|
41
40
|
get moreTab() {
|
|
42
|
-
|
|
41
|
+
try {
|
|
42
|
+
return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return this.querySelector(':scope>navigation-stack:has(> navigation-stack)') ?? this.querySelector(':scope>navigation-stack:has(> navigation-split-view)');
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
connectedCallback() {
|
|
45
|
-
|
|
46
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
49
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
47
50
|
this.#cssStyleObserver = new CSSStyleObserver({
|
|
48
51
|
properties: ['--adaptable-tab-bar-placement-index'],
|
|
49
52
|
});
|
|
@@ -54,10 +57,7 @@ export class TabView extends HTMLElement {
|
|
|
54
57
|
{ types: 'beforetabreveal beforetabswap', listener: this.#addAnimations },
|
|
55
58
|
{ types: 'tab-view:adaptable-tab-bar-placement-change', listener: this.#handleAdaptableTabBarPlacementChange },
|
|
56
59
|
{ types: 'pagereveal', listener: this.#handleTabViewPagereveal },
|
|
57
|
-
{
|
|
58
|
-
types: 'click',
|
|
59
|
-
listener: this.#handleSummaryClick,
|
|
60
|
-
},
|
|
60
|
+
{ types: 'click', listener: this.#handleSummaryClick },
|
|
61
61
|
], this).on());
|
|
62
62
|
}
|
|
63
63
|
#handleSummaryClick = ({ target }) => {
|
|
@@ -66,7 +66,7 @@ export class TabView extends HTMLElement {
|
|
|
66
66
|
const summary = target.closest('summary');
|
|
67
67
|
if (!summary)
|
|
68
68
|
return;
|
|
69
|
-
if (0 ===
|
|
69
|
+
if (0 === siblings('[aria-selected=true]', summary).length)
|
|
70
70
|
return;
|
|
71
71
|
if (!summary.closest('scroll-view')?.matches('tab-view > [is=sidebar-view] > scroll-view'))
|
|
72
72
|
return;
|
|
@@ -79,13 +79,11 @@ export class TabView extends HTMLElement {
|
|
|
79
79
|
this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
|
|
80
80
|
};
|
|
81
81
|
#handleTabViewPagereveal = (evt) => {
|
|
82
|
-
|
|
83
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
82
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
84
83
|
void this.#syncBodyFace();
|
|
85
84
|
};
|
|
86
85
|
#handleStyleChange = () => {
|
|
87
|
-
|
|
88
|
-
console.debug(`${_a.name} ⚡️ style`);
|
|
86
|
+
debug(`${_a.name} ⚡️ style`);
|
|
89
87
|
const style = self.getComputedStyle(this);
|
|
90
88
|
const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
|
|
91
89
|
newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
|
|
@@ -99,10 +97,9 @@ export class TabView extends HTMLElement {
|
|
|
99
97
|
}));
|
|
100
98
|
}
|
|
101
99
|
};
|
|
102
|
-
#handleAdaptableTabBarPlacementChange = (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if ('bottom-bar' !== evt.detail.oldValue)
|
|
100
|
+
#handleAdaptableTabBarPlacementChange = ({ type, detail }) => {
|
|
101
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
102
|
+
if ('bottom-bar' !== detail.oldValue)
|
|
106
103
|
return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
|
|
107
104
|
const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
|
|
108
105
|
if (innerSelection) {
|
|
@@ -156,12 +153,12 @@ export class TabView extends HTMLElement {
|
|
|
156
153
|
ns.hidden = false; // triggers
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
|
-
#addAnimations = (
|
|
156
|
+
#addAnimations = ({ detail }) => {
|
|
160
157
|
this.setAttribute('js-aftertabreveal', '');
|
|
161
158
|
// const ms = cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`)
|
|
162
159
|
this.#afterTabRevealDelay.next(() => {
|
|
163
160
|
this.removeAttribute('js-aftertabreveal');
|
|
164
|
-
},
|
|
161
|
+
}, detail.ms);
|
|
165
162
|
};
|
|
166
163
|
#handleSelectionChange = (evt) => {
|
|
167
164
|
this.#triggerToggleEvent(evt);
|
|
@@ -169,8 +166,7 @@ export class TabView extends HTMLElement {
|
|
|
169
166
|
#triggerToggleEvent = (evt) => {
|
|
170
167
|
const eventType = 'tab-view:toggle';
|
|
171
168
|
void this.#syncBodyFace();
|
|
172
|
-
|
|
173
|
-
console.debug(`${_a.name} 💡 ${eventType}`);
|
|
169
|
+
debug(`${_a.name} 💡 ${eventType}`);
|
|
174
170
|
this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
|
|
175
171
|
};
|
|
176
172
|
#syncBodyFace = async () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template — Sets the template areas when the table is in compact mode
|
|
5
5
|
*
|
|
6
|
-
* @slot — The default slot
|
|
6
|
+
* @slot — The default slot
|
|
7
7
|
* @slot header-leading
|
|
8
8
|
* @slot header-principal
|
|
9
9
|
* @slot header-trailing
|
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
4
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
5
|
-
import { $,
|
|
5
|
+
import { $, debug, listActive, onoff } from '../internal/utils';
|
|
6
6
|
import { queryMorph } from '../morphdom';
|
|
7
7
|
import { Snapshot } from '../snapshot';
|
|
8
8
|
import { html } from '../tpl';
|
|
@@ -11,7 +11,7 @@ import { html } from '../tpl';
|
|
|
11
11
|
*
|
|
12
12
|
* @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template — Sets the template areas when the table is in compact mode
|
|
13
13
|
*
|
|
14
|
-
* @slot — The default slot
|
|
14
|
+
* @slot — The default slot
|
|
15
15
|
* @slot header-leading
|
|
16
16
|
* @slot header-principal
|
|
17
17
|
* @slot header-trailing
|
|
@@ -68,16 +68,14 @@ export class TableView extends HTMLElement {
|
|
|
68
68
|
this.#slots?.get('column')?.addEventListener('slotchange', this.#handleColumnSlotchange);
|
|
69
69
|
}
|
|
70
70
|
disconnectedCallback() {
|
|
71
|
-
|
|
72
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
71
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
73
72
|
CleanupRegistry.unregister(this);
|
|
74
73
|
this.#styleObserver?.disconnect();
|
|
75
74
|
this.#observers.unobserveAll();
|
|
76
75
|
this.#compactToolbarItem = undefined;
|
|
77
76
|
}
|
|
78
77
|
connectedCallback() {
|
|
79
|
-
|
|
80
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
78
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
81
79
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
82
80
|
this.#styleObserver = new CSSStyleObserver({
|
|
83
81
|
properties: ['--adaptable-table-style-index'],
|
|
@@ -89,8 +87,7 @@ export class TableView extends HTMLElement {
|
|
|
89
87
|
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
|
|
90
88
|
}
|
|
91
89
|
#handleColumnSlotchange = ({ type, target: slot }) => {
|
|
92
|
-
|
|
93
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
90
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
94
91
|
if (!(slot instanceof HTMLSlotElement))
|
|
95
92
|
return;
|
|
96
93
|
const assigned = slot.assignedElements();
|
|
@@ -99,8 +96,7 @@ export class TableView extends HTMLElement {
|
|
|
99
96
|
this.#renderColumns([]);
|
|
100
97
|
};
|
|
101
98
|
#renderColumns = (entries) => {
|
|
102
|
-
|
|
103
|
-
console.debug(`${_a.name} ⚡️ mutation`);
|
|
99
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
104
100
|
if (!this.#compactToolbarItem) {
|
|
105
101
|
this.#compactToolbarItem = $(html `<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
|
|
106
102
|
CleanupRegistry.unregister(this, 'compact_toolbar');
|
|
@@ -123,8 +119,7 @@ export class TableView extends HTMLElement {
|
|
|
123
119
|
};
|
|
124
120
|
#observers = new MutationObserverSet(this.#renderColumns);
|
|
125
121
|
#handleStyleChange = () => {
|
|
126
|
-
|
|
127
|
-
console.debug(`${_a.name} ⚡️ style`);
|
|
122
|
+
debug(`${_a.name} ⚡️ style`);
|
|
128
123
|
const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
|
|
129
124
|
if (!target)
|
|
130
125
|
return;
|
|
@@ -3,7 +3,7 @@ import { I18n } from '../i18n';
|
|
|
3
3
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
4
|
import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
|
|
5
5
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
6
|
-
import { $, compareBigDecimals,
|
|
6
|
+
import { $, compareBigDecimals, debug, kebabCase, onoff, set } from '../internal/utils';
|
|
7
7
|
import { queryMorph } from '../morphdom';
|
|
8
8
|
import { html } from '../tpl';
|
|
9
9
|
const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
|
|
@@ -58,8 +58,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
58
58
|
</label>`));
|
|
59
59
|
}
|
|
60
60
|
#renderValidityMsgs = (entries) => {
|
|
61
|
-
|
|
62
|
-
console.debug(`${_a.name} ⚡️ mutation`);
|
|
61
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
63
62
|
this.setValidity(this.validity, this.validationMessage);
|
|
64
63
|
};
|
|
65
64
|
#shadowRoot;
|
|
@@ -96,8 +95,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
96
95
|
}, I18n.on).on());
|
|
97
96
|
}
|
|
98
97
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
99
|
-
|
|
100
|
-
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
98
|
+
debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
101
99
|
switch (name) {
|
|
102
100
|
case 'keyboard-type':
|
|
103
101
|
switch (newValue) {
|
|
@@ -224,8 +222,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
224
222
|
}
|
|
225
223
|
}
|
|
226
224
|
#handleValiditiesSlotchange = ({ type, target: slot }) => {
|
|
227
|
-
|
|
228
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
225
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
229
226
|
if (!(slot instanceof HTMLSlotElement))
|
|
230
227
|
return;
|
|
231
228
|
const assigned = slot.assignedElements();
|
|
@@ -234,8 +231,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
234
231
|
this.#renderValidityMsgs([]);
|
|
235
232
|
};
|
|
236
233
|
#handleFocusin = (evt) => {
|
|
237
|
-
|
|
238
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
234
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
239
235
|
if (evt.target === this)
|
|
240
236
|
this.#input?.focus();
|
|
241
237
|
};
|
|
@@ -266,8 +262,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
266
262
|
this.dispatchEvent(new CustomEvent('commit', { detail: { text: this.text }, bubbles: true, composed: true }));
|
|
267
263
|
};
|
|
268
264
|
#handleInputPaste = (evt) => {
|
|
269
|
-
|
|
270
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
265
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
271
266
|
const { target: input } = evt;
|
|
272
267
|
if (!(input instanceof HTMLInputElement))
|
|
273
268
|
return;
|
|
@@ -370,8 +365,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
370
365
|
}
|
|
371
366
|
};
|
|
372
367
|
#handleInputBeforeinput = (evt) => {
|
|
373
|
-
|
|
374
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
368
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
375
369
|
const { target: input } = evt;
|
|
376
370
|
if (!(input instanceof HTMLInputElement))
|
|
377
371
|
return;
|
|
@@ -406,8 +400,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
406
400
|
}
|
|
407
401
|
};
|
|
408
402
|
#handleInputBlur = ({ type, target: input }) => {
|
|
409
|
-
|
|
410
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
403
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
411
404
|
if (!(input instanceof HTMLInputElement))
|
|
412
405
|
return;
|
|
413
406
|
if (0 === input.value.length)
|
|
@@ -418,8 +411,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
418
411
|
this.#sendValueToForm();
|
|
419
412
|
};
|
|
420
413
|
#handleInputInput = (evt) => {
|
|
421
|
-
|
|
422
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
414
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
423
415
|
this.#sendValueToForm();
|
|
424
416
|
};
|
|
425
417
|
/**
|
|
@@ -497,8 +489,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
497
489
|
message = kebabCase(key);
|
|
498
490
|
break;
|
|
499
491
|
}
|
|
500
|
-
|
|
501
|
-
console.debug(`${_a.name} ⚡️ validity-change`);
|
|
492
|
+
debug(`${_a.name} ⚡️ validity-change`);
|
|
502
493
|
return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
|
|
503
494
|
};
|
|
504
495
|
setCustomValidity = (message) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class TextView extends HTMLElement {
|
|
2
|
+
constructor();
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
disconnectedCallback(): void;
|
|
5
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'text-view': TextView;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
|
+
export class TextView extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
}
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
debug(`${TextView.name} ⚡️ connect`);
|
|
8
|
+
}
|
|
9
|
+
disconnectedCallback() {
|
|
10
|
+
debug(`${TextView.name} ⚡️ disconnect`);
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
13
|
+
debug(`${TextView.name} ⚡️ attr-change [${name}]`);
|
|
14
|
+
//
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -4,6 +4,8 @@ export type ToggleStyle = (typeof toggleStyles)[number];
|
|
|
4
4
|
/**
|
|
5
5
|
* @summary A control that switches between on and off states.
|
|
6
6
|
*
|
|
7
|
+
* @example <toggle-view label="Custom Label"></toggle-view> — Creates a toggle that displays a custom label
|
|
8
|
+
*
|
|
7
9
|
* @fires toggle:change — User toggled the control
|
|
8
10
|
*
|
|
9
11
|
* @slot label
|
|
@@ -2,13 +2,15 @@ var _a;
|
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
|
|
4
4
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
5
|
-
import { $,
|
|
5
|
+
import { $, debug, kebabCase, onoff, touchGlass } from '../internal/utils';
|
|
6
6
|
import { queryMorph } from '../morphdom';
|
|
7
7
|
import { html } from '../tpl';
|
|
8
8
|
const toggleStyles = ['switch', 'button'];
|
|
9
9
|
/**
|
|
10
10
|
* @summary A control that switches between on and off states.
|
|
11
11
|
*
|
|
12
|
+
* @example <toggle-view label="Custom Label"></toggle-view> — Creates a toggle that displays a custom label
|
|
13
|
+
*
|
|
12
14
|
* @fires toggle:change — User toggled the control
|
|
13
15
|
*
|
|
14
16
|
* @slot label
|
|
@@ -47,8 +49,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
47
49
|
</label>`));
|
|
48
50
|
}
|
|
49
51
|
#renderValidityMsgs = (entries) => {
|
|
50
|
-
|
|
51
|
-
console.debug(`${_a.name} ⚡️ mutation`);
|
|
52
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
52
53
|
this.setValidity(this.validity, this.validationMessage);
|
|
53
54
|
};
|
|
54
55
|
#shadowRoot;
|
|
@@ -68,14 +69,14 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
68
69
|
return this.#trackWidth - this.#dotSize;
|
|
69
70
|
}
|
|
70
71
|
#handleMeasure = ([{ target, borderBoxSize }]) => {
|
|
71
|
-
|
|
72
|
-
console.debug(`${_a.name} ⚡️ measure`);
|
|
72
|
+
debug(`${_a.name} ⚡️ measure`);
|
|
73
73
|
if (!(target instanceof HTMLElement))
|
|
74
74
|
return;
|
|
75
75
|
this.#trackWidth = borderBoxSize.at(0)?.inlineSize ?? 0;
|
|
76
76
|
this.#dotSize = borderBoxSize.at(0)?.blockSize ?? 0;
|
|
77
77
|
};
|
|
78
78
|
#resizeObserver = new ResizeObserver(this.#handleMeasure);
|
|
79
|
+
#dragOffsetX = 0;
|
|
79
80
|
get #isDragging() {
|
|
80
81
|
return '0ms' === this.#track?.style.getPropertyValue('--toggle--dot-transition-duration');
|
|
81
82
|
}
|
|
@@ -104,11 +105,13 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
104
105
|
{ types: 'pointermove', listener: this.#handleTrackPointermove },
|
|
105
106
|
{ types: 'lostpointercapture', listener: this.#handleTrackPointercancel },
|
|
106
107
|
], this.#track).on());
|
|
107
|
-
CleanupRegistry.register(this, onoff([
|
|
108
|
+
CleanupRegistry.register(this, onoff([
|
|
109
|
+
{ types: 'blur', listener: this.#handleWindowBlur },
|
|
110
|
+
{ types: 'focus', listener: this.#handleWindowFocus },
|
|
111
|
+
], self).on());
|
|
108
112
|
}
|
|
109
113
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
110
|
-
|
|
111
|
-
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
114
|
+
debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
112
115
|
switch (name) {
|
|
113
116
|
case 'value':
|
|
114
117
|
this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
|
|
@@ -161,8 +164,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
161
164
|
this.ariaChecked = `${this.#isOn}`;
|
|
162
165
|
}
|
|
163
166
|
#handleValiditiesSlotchange = ({ type, target: slot }) => {
|
|
164
|
-
|
|
165
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
167
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
166
168
|
if (!(slot instanceof HTMLSlotElement))
|
|
167
169
|
return;
|
|
168
170
|
const assigned = slot.assignedElements();
|
|
@@ -170,14 +172,12 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
170
172
|
this.#renderValidityMsgs([]);
|
|
171
173
|
};
|
|
172
174
|
#handleFocusin = ({ type, target }) => {
|
|
173
|
-
|
|
174
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
175
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
175
176
|
if (target === this)
|
|
176
177
|
this.#track?.focus();
|
|
177
178
|
};
|
|
178
179
|
#handleTrackClick = ({ type }) => {
|
|
179
|
-
|
|
180
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
180
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
181
181
|
if (this.#didDrag)
|
|
182
182
|
return (this.#didDrag = false);
|
|
183
183
|
this.#applyIsOnWithFlip(!this.isOn);
|
|
@@ -192,35 +192,29 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
192
192
|
const dotCenterY = top + height / 2;
|
|
193
193
|
return Math.hypot(clientX - dotCenterX, clientY - dotCenterY) <= this.#dotSize / 2;
|
|
194
194
|
};
|
|
195
|
-
#dragOffsetX = 0;
|
|
196
195
|
get #baseX() {
|
|
197
196
|
return this.isOn ? this.#trackMaxX : this.#trackMinX;
|
|
198
197
|
}
|
|
199
198
|
#handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
|
|
200
|
-
|
|
201
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
199
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
202
200
|
if (!this.#track)
|
|
203
201
|
return;
|
|
204
202
|
if (!this.#measurePointerIsOverDot(clientX, clientY))
|
|
205
203
|
return; // ignore taps elsewhere on the track
|
|
206
204
|
this.#didDrag = true; // dot was engaged — settle() will own the outcome, click must be swallowed
|
|
207
|
-
const currentDelta = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0;
|
|
208
|
-
const currentAbsoluteX = this.#baseX + currentDelta;
|
|
205
|
+
const currentDelta = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-translate-x')) || 0, currentAbsoluteX = this.#baseX + currentDelta;
|
|
209
206
|
this.#dragOffsetX = clientX - this.#track.getBoundingClientRect().left - currentAbsoluteX;
|
|
210
207
|
this.#track.style.setProperty('--toggle--dot-transition-duration', '0ms');
|
|
211
208
|
this.#track.setPointerCapture(pointerId);
|
|
212
|
-
// this.#updateFromEvent(clientX)
|
|
213
209
|
};
|
|
214
210
|
#handleTrackPointermove = ({ type, clientX }) => {
|
|
215
|
-
|
|
216
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
211
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
217
212
|
if (!this.#isDragging)
|
|
218
213
|
return;
|
|
219
214
|
this.#updateFromEvent(clientX);
|
|
220
215
|
};
|
|
221
216
|
#handleTrackPointerup = ({ type, pointerId }) => {
|
|
222
|
-
|
|
223
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
217
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
224
218
|
if (!this.#isDragging)
|
|
225
219
|
return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
|
|
226
220
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
@@ -228,40 +222,43 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
228
222
|
this.#settle();
|
|
229
223
|
};
|
|
230
224
|
#handleTrackPointercancel = ({ type }) => {
|
|
231
|
-
|
|
232
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
225
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
233
226
|
if (!this.#isDragging)
|
|
234
227
|
return; // already settled via pointerup, or nothing to settle
|
|
235
228
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
236
229
|
this.#settle();
|
|
237
230
|
};
|
|
238
231
|
#handleWindowBlur = () => {
|
|
232
|
+
this.toggleAttribute('js-window-inactive', true);
|
|
239
233
|
if (!this.#isDragging)
|
|
240
234
|
return;
|
|
241
235
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
242
236
|
this.#settle();
|
|
243
237
|
};
|
|
238
|
+
#handleWindowFocus = async () => {
|
|
239
|
+
this.toggleAttribute('js-window-inactive', false);
|
|
240
|
+
};
|
|
244
241
|
#updateFromEvent = (clientX) => {
|
|
245
242
|
if (!this.#track)
|
|
246
243
|
return;
|
|
247
244
|
const { left } = this.#track.getBoundingClientRect();
|
|
248
|
-
const
|
|
249
|
-
|
|
245
|
+
const scaleShiftStart = this.#isOn ? 5 : 0, scaleShiftEnd = this.#isOn ? 0 : 4;
|
|
246
|
+
const absoluteX = Math.min(Math.max(clientX - left - this.#dragOffsetX, this.#trackMinX + scaleShiftStart), this.#trackMaxX - scaleShiftEnd);
|
|
247
|
+
this.#track.style.setProperty('--toggle--dot-translate-x', `${Math.round(absoluteX - this.#baseX)}px`);
|
|
250
248
|
};
|
|
251
249
|
#settle = () => {
|
|
252
250
|
if (!this.#track)
|
|
253
251
|
return;
|
|
254
|
-
const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0;
|
|
252
|
+
const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-translate-x')) || 0;
|
|
255
253
|
const absoluteX = this.#baseX + deltaX;
|
|
256
254
|
const nextIsOn = absoluteX > this.#trackMaxX / 2;
|
|
257
255
|
if (nextIsOn === this.isOn)
|
|
258
|
-
return this.#track.style.removeProperty('--toggle--dot-x'); // pure transform animation back to rest, inset untouched
|
|
256
|
+
return this.#track.style.removeProperty('--toggle--dot-translate-x'); // pure transform animation back to rest, inset untouched
|
|
259
257
|
this.#applyIsOnWithFlip(nextIsOn);
|
|
260
258
|
this.#sendValueToForm(true);
|
|
261
259
|
};
|
|
262
260
|
#handleTrackKeydown = (evt) => {
|
|
263
|
-
|
|
264
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
261
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
265
262
|
if (' ' !== evt.key)
|
|
266
263
|
return;
|
|
267
264
|
evt.preventDefault();
|
|
@@ -272,16 +269,16 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
272
269
|
if (!this.#track || nextIsOn === this.isOn)
|
|
273
270
|
return;
|
|
274
271
|
// capture current visual position under the OLD base, before flipping state
|
|
275
|
-
const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0, oldAbsoluteX = this.#baseX + deltaX;
|
|
272
|
+
const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-translate-x')) || 0, oldAbsoluteX = this.#baseX + deltaX;
|
|
276
273
|
this.isOn = nextIsOn; // changes --toggle--dot-inset-inline-start/-end via aria-checked
|
|
277
274
|
const compensationX = oldAbsoluteX - this.#baseX; // baseX now reflects the NEW state
|
|
278
275
|
// make inset + transform jump together, instantly, so nothing is visibly out of sync
|
|
279
276
|
this.#track.style.setProperty('--toggle--dot-transition-duration', '0ms');
|
|
280
|
-
this.#track.style.setProperty('--toggle--dot-x', `${Math.round(compensationX)}px`);
|
|
277
|
+
this.#track.style.setProperty('--toggle--dot-translate-x', `${Math.round(compensationX)}px`);
|
|
281
278
|
void this.#track.offsetWidth; // force reflow so the instant jump is committed before re-enabling transitions
|
|
282
279
|
this.#track.style.removeProperty('--toggle--dot-transition-duration');
|
|
283
280
|
self.requestAnimationFrame(() => {
|
|
284
|
-
this.#track?.style.removeProperty('--toggle--dot-x'); // only transform animates from here — single source of motion
|
|
281
|
+
this.#track?.style.removeProperty('--toggle--dot-translate-x'); // only transform animates from here — single source of motion
|
|
285
282
|
});
|
|
286
283
|
};
|
|
287
284
|
#sendValueToForm = (dispatchEvent = true) => {
|
|
@@ -341,8 +338,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
341
338
|
message = kebabCase(key);
|
|
342
339
|
break;
|
|
343
340
|
}
|
|
344
|
-
|
|
345
|
-
console.debug(`${_a.name} ⚡️ validity-change`);
|
|
341
|
+
debug(`${_a.name} ⚡️ validity-change`);
|
|
346
342
|
return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
|
|
347
343
|
};
|
|
348
344
|
setCustomValidity = (message) => {
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var ToolBarItemGroup_1;
|
|
8
8
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
9
9
|
import { adaptiveSlot } from '../internal/decorators';
|
|
10
|
-
import {
|
|
10
|
+
import { debug } from '../internal/utils';
|
|
11
11
|
/**
|
|
12
12
|
* @summary A container view that groups items together in the toolbar or navigation bar.
|
|
13
13
|
*/
|
|
@@ -16,12 +16,10 @@ let ToolBarItemGroup = ToolBarItemGroup_1 = class ToolBarItemGroup extends HTMLE
|
|
|
16
16
|
super();
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
20
|
-
console.debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
|
|
19
|
+
debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
|
|
21
20
|
}
|
|
22
21
|
disconnectedCallback() {
|
|
23
|
-
|
|
24
|
-
console.debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
|
|
22
|
+
debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
|
|
25
23
|
CleanupRegistry.unregister(this);
|
|
26
24
|
}
|
|
27
25
|
};
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var ToolBarItem_1;
|
|
8
8
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
9
9
|
import { adaptiveSlot } from '../internal/decorators';
|
|
10
|
-
import {
|
|
10
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
11
11
|
import { Snapshot } from '../snapshot';
|
|
12
12
|
/**
|
|
13
13
|
* @summary A view placed in the toolbar or navigation bar.
|
|
@@ -21,8 +21,7 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
|
|
|
21
21
|
super();
|
|
22
22
|
}
|
|
23
23
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
24
|
-
|
|
25
|
-
console.debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
24
|
+
debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
26
25
|
switch (name) {
|
|
27
26
|
case 'slot':
|
|
28
27
|
case 'data-previous-slot':
|
|
@@ -46,14 +45,12 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
disconnectedCallback() {
|
|
49
|
-
|
|
50
|
-
console.debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
|
|
48
|
+
debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
|
|
51
49
|
this.#mutationObserver?.disconnect();
|
|
52
50
|
CleanupRegistry.unregister(this);
|
|
53
51
|
}
|
|
54
52
|
connectedCallback() {
|
|
55
|
-
|
|
56
|
-
console.debug(`${ToolBarItem_1.name} ⚡️ connect`);
|
|
53
|
+
debug(`${ToolBarItem_1.name} ⚡️ connect`);
|
|
57
54
|
CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, ({ target }) => {
|
|
58
55
|
if (!(target instanceof HTMLElement))
|
|
59
56
|
return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
|
|
3
|
-
import { $,
|
|
3
|
+
import { $, debug } from '../internal/utils';
|
|
4
4
|
import { html } from '../tpl';
|
|
5
5
|
const observers = new ResizeObserverSingleton();
|
|
6
6
|
/**
|
|
@@ -58,8 +58,7 @@ export class ToolBar extends HTMLElement {
|
|
|
58
58
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
59
59
|
}
|
|
60
60
|
connectedCallback() {
|
|
61
|
-
|
|
62
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
61
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
63
62
|
// NOTE: wait for config
|
|
64
63
|
// Snapshot.waitReady.then(() => {
|
|
65
64
|
for (const el of this.#shadowRoot.querySelectorAll(`[part*="toolbar-leading-stack"],[part*="toolbar-trailing-stack"]`))
|
|
@@ -67,13 +66,11 @@ export class ToolBar extends HTMLElement {
|
|
|
67
66
|
// })
|
|
68
67
|
}
|
|
69
68
|
disconnectedCallback() {
|
|
70
|
-
|
|
71
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
69
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
72
70
|
observers.unobserve(this);
|
|
73
71
|
}
|
|
74
72
|
#measureStacks(entry) {
|
|
75
|
-
|
|
76
|
-
console.debug(`${_a.name} ⚡️ measure`);
|
|
73
|
+
debug(`${_a.name} ⚡️ measure`);
|
|
77
74
|
if (this.closest('[hidden]'))
|
|
78
75
|
return;
|
|
79
76
|
const leading = 'toolbar-leading-stack', trailing = 'toolbar-trailing-stack';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class VDivider extends HTMLElement {
|
|
2
|
+
constructor();
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
disconnectedCallback(): void;
|
|
5
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'v-divider': VDivider;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
|
+
export class VDivider extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
}
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
debug(`${VDivider.name} ⚡️ connect`);
|
|
8
|
+
}
|
|
9
|
+
disconnectedCallback() {
|
|
10
|
+
debug(`${VDivider.name} ⚡️ disconnect`);
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
13
|
+
debug(`${VDivider.name} ⚡️ attr-change [${name}]`);
|
|
14
|
+
}
|
|
15
|
+
}
|