@swiftwc/ui 0.0.0-dev.105 → 0.0.0-dev.107
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 +6 -7
- package/generated/components/alert-dialog.js +9 -10
- package/generated/components/body-view.js +3 -3
- package/generated/components/bordered-button.js +4 -5
- package/generated/components/bordered-prominent-button.js +4 -5
- package/generated/components/borderless-button.js +4 -5
- package/generated/components/color-scheme.js +4 -4
- package/generated/components/confirmation-dialog.js +9 -10
- package/generated/components/content-unavailable.js +4 -5
- package/generated/components/date-picker.js +13 -14
- package/generated/components/detail-placeholder.js +4 -4
- package/generated/components/disclosure-group.js +5 -6
- package/generated/components/fine-tooltip.js +4 -5
- package/generated/components/form-view.js +3 -4
- package/generated/components/glass-button.js +4 -5
- package/generated/components/glass-prominent-button.js +4 -5
- package/generated/components/h-divider.js +4 -4
- package/generated/components/h-stack.js +3 -3
- package/generated/components/image-view.js +4 -5
- package/generated/components/label-view.js +4 -5
- package/generated/components/labeled-content.js +4 -5
- package/generated/components/list-view.d.ts +1 -0
- package/generated/components/list-view.js +4 -4
- package/generated/components/menu-view.js +10 -11
- package/generated/components/navigation-large-title.d.ts +0 -1
- package/generated/components/navigation-large-title.js +5 -7
- package/generated/components/navigation-split-view.js +4 -4
- package/generated/components/navigation-stack.js +4 -4
- package/generated/components/navigation-title.js +4 -4
- package/generated/components/picker-view.js +31 -32
- package/generated/components/plain-button.js +3 -4
- package/generated/components/progress-view.js +6 -7
- package/generated/components/screen-view.js +2 -2
- package/generated/components/scroll-view-proxy.js +3 -3
- package/generated/components/scroll-view.js +9 -10
- package/generated/components/search-view.js +4 -5
- package/generated/components/section-view.js +4 -5
- package/generated/components/sheet-view.js +6 -7
- package/generated/components/sidebar-toggle.js +5 -6
- package/generated/components/sidebar-view.js +2 -3
- package/generated/components/sticky-container.js +3 -4
- package/generated/components/tab-bar.js +4 -5
- package/generated/components/tab-item.js +8 -9
- package/generated/components/tab-view.js +7 -8
- package/generated/components/table-view.js +6 -7
- package/generated/components/text-field.js +10 -11
- package/generated/components/text-view.js +4 -4
- package/generated/components/toggle-view.js +21 -15
- package/generated/components/tool-bar-item-group.js +3 -3
- package/generated/components/tool-bar-item.js +4 -5
- package/generated/components/tool-bar.js +4 -5
- package/generated/components/v-divider.js +4 -4
- package/generated/components/v-keyboard.js +5 -6
- package/generated/components/v-stack.js +3 -3
- package/generated/css/index.css +76 -11
- package/generated/internal/class/css-style-observer.js +2 -3
- package/generated/internal/class/form-associated-base.js +5 -5
- package/generated/internal/class/navigation-view.js +3 -4
- package/generated/internal/decorators/adaptive-slot.js +4 -5
- package/generated/internal/privateNamespace.d.ts +1 -1
- package/generated/internal/privateNamespace.js +12 -12
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/index.d.ts +2 -2
- package/generated/internal/utils/index.js +2 -2
- package/generated/internal/utils/is-inside.js +1 -1
- package/generated/snapshot/index.js +3 -4
- package/package.json +2 -1
- package/scss/_utils.scss +2 -0
- package/scss/base/_root.scss +6 -3
- package/scss/colors/_index.scss +11 -0
- package/scss/components/_navigation-large-title.scss +14 -8
- package/scss/components/_scroll-view.scss +12 -0
- package/scss/components/_toggle-view.scss +10 -0
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_index.scss +20 -17
- package/web-components.html-data/en.json +11 -11
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
2
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { onoff } from '../internal/utils';
|
|
2
|
+
import { debug, onoff } from '../internal/utils';
|
|
4
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
5
4
|
import { TabView } from './tab-view';
|
|
6
5
|
/**
|
|
@@ -11,11 +10,11 @@ export class TabItem extends ButtonBase {
|
|
|
11
10
|
super();
|
|
12
11
|
}
|
|
13
12
|
static polyfillDisconnectedCallback(btn) {
|
|
14
|
-
|
|
13
|
+
debug(`${TabItem.name} ⚡️ disconnect`);
|
|
15
14
|
CleanupRegistry.unregister(btn);
|
|
16
15
|
}
|
|
17
16
|
static polyfillConnectedCallback(btn) {
|
|
18
|
-
|
|
17
|
+
debug(`${TabItem.name} ⚡️ connect`);
|
|
19
18
|
Object.assign(btn, {
|
|
20
19
|
tabIndex: 0,
|
|
21
20
|
ariaSelected: 'false',
|
|
@@ -35,7 +34,7 @@ export class TabItem extends ButtonBase {
|
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
static #handleTabMoreStackAllowance = async (btn, evt) => {
|
|
38
|
-
|
|
37
|
+
debug(`${TabItem.name} ⚡️ ${evt?.type}`);
|
|
39
38
|
const tv = btn.closest('tab-view');
|
|
40
39
|
if (!tv)
|
|
41
40
|
return;
|
|
@@ -44,7 +43,7 @@ export class TabItem extends ButtonBase {
|
|
|
44
43
|
btn.hidden = 'bottom-bar' !== tv.tabBarPlacement;
|
|
45
44
|
};
|
|
46
45
|
static #handleTabRevealOrSwap = async (btn, evt) => {
|
|
47
|
-
|
|
46
|
+
debug(`${TabItem.name} ⚡️ ${evt?.type}`);
|
|
48
47
|
const tv = btn?.closest('tab-view');
|
|
49
48
|
if (!tv)
|
|
50
49
|
return;
|
|
@@ -66,7 +65,7 @@ export class TabItem extends ButtonBase {
|
|
|
66
65
|
}, 100);
|
|
67
66
|
};
|
|
68
67
|
static #handleClick = async ({ type, currentTarget: btn }) => {
|
|
69
|
-
|
|
68
|
+
debug(`${TabItem.name} ⚡️ ${type}`);
|
|
70
69
|
if (!(btn instanceof HTMLElement))
|
|
71
70
|
return;
|
|
72
71
|
// const tag = btn.getAttribute('value')
|
|
@@ -112,14 +111,14 @@ export class TabItem extends ButtonBase {
|
|
|
112
111
|
for (const tab of tabs.reverse())
|
|
113
112
|
if (tv.selectedTab.includes(tab)) {
|
|
114
113
|
const eventType = 'tabroot';
|
|
115
|
-
|
|
114
|
+
debug(`${TabItem.name} 💡 ${eventType}`);
|
|
116
115
|
tab?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
|
|
117
116
|
return; // skip rest no selection!
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
else if ('->' === dir) {
|
|
121
120
|
const eventType = 'tabroot';
|
|
122
|
-
|
|
121
|
+
debug(`${TabItem.name} 💡 ${eventType}`);
|
|
123
122
|
tabs.at(0)?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
|
|
124
123
|
}
|
|
125
124
|
// SECTION: finally, submit new tabs
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
5
4
|
import { NavigationPath } from '../internal/class/navigation-path';
|
|
6
|
-
import { cssTime, debounce, frame, onoff, siblings, timeout } from '../internal/utils';
|
|
5
|
+
import { cssTime, debounce, debug, frame, onoff, siblings, timeout } from '../internal/utils';
|
|
7
6
|
import { Snapshot } from '../snapshot';
|
|
8
7
|
const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
|
|
9
8
|
/**
|
|
@@ -30,7 +29,7 @@ export class TabView extends HTMLElement {
|
|
|
30
29
|
this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
|
|
31
30
|
}
|
|
32
31
|
disconnectedCallback() {
|
|
33
|
-
|
|
32
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
34
33
|
this.#afterTabRevealDelay.cancel();
|
|
35
34
|
this.#cssStyleObserver?.disconnect();
|
|
36
35
|
CleanupRegistry.unregister(this);
|
|
@@ -42,7 +41,7 @@ export class TabView extends HTMLElement {
|
|
|
42
41
|
return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
|
|
43
42
|
}
|
|
44
43
|
connectedCallback() {
|
|
45
|
-
|
|
44
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
46
45
|
this.#cssStyleObserver = new CSSStyleObserver({
|
|
47
46
|
properties: ['--adaptable-tab-bar-placement-index'],
|
|
48
47
|
});
|
|
@@ -78,11 +77,11 @@ export class TabView extends HTMLElement {
|
|
|
78
77
|
this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
|
|
79
78
|
};
|
|
80
79
|
#handleTabViewPagereveal = (evt) => {
|
|
81
|
-
|
|
80
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
82
81
|
void this.#syncBodyFace();
|
|
83
82
|
};
|
|
84
83
|
#handleStyleChange = () => {
|
|
85
|
-
|
|
84
|
+
debug(`${_a.name} ⚡️ style`);
|
|
86
85
|
const style = self.getComputedStyle(this);
|
|
87
86
|
const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
|
|
88
87
|
newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
|
|
@@ -97,7 +96,7 @@ export class TabView extends HTMLElement {
|
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
#handleAdaptableTabBarPlacementChange = (evt) => {
|
|
100
|
-
|
|
99
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
101
100
|
if ('bottom-bar' !== evt.detail.oldValue)
|
|
102
101
|
return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
|
|
103
102
|
const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
|
|
@@ -165,7 +164,7 @@ export class TabView extends HTMLElement {
|
|
|
165
164
|
#triggerToggleEvent = (evt) => {
|
|
166
165
|
const eventType = 'tab-view:toggle';
|
|
167
166
|
void this.#syncBodyFace();
|
|
168
|
-
|
|
167
|
+
debug(`${_a.name} 💡 ${eventType}`);
|
|
169
168
|
this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
|
|
170
169
|
};
|
|
171
170
|
#syncBodyFace = async () => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
5
4
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
6
|
-
import { $, listActive, onoff } from '../internal/utils';
|
|
5
|
+
import { $, debug, listActive, onoff } from '../internal/utils';
|
|
7
6
|
import { queryMorph } from '../morphdom';
|
|
8
7
|
import { Snapshot } from '../snapshot';
|
|
9
8
|
import { html } from '../tpl';
|
|
@@ -69,14 +68,14 @@ export class TableView extends HTMLElement {
|
|
|
69
68
|
this.#slots?.get('column')?.addEventListener('slotchange', this.#handleColumnSlotchange);
|
|
70
69
|
}
|
|
71
70
|
disconnectedCallback() {
|
|
72
|
-
|
|
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
|
-
|
|
78
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
80
79
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
81
80
|
this.#styleObserver = new CSSStyleObserver({
|
|
82
81
|
properties: ['--adaptable-table-style-index'],
|
|
@@ -88,7 +87,7 @@ export class TableView extends HTMLElement {
|
|
|
88
87
|
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
|
|
89
88
|
}
|
|
90
89
|
#handleColumnSlotchange = ({ type, target: slot }) => {
|
|
91
|
-
|
|
90
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
92
91
|
if (!(slot instanceof HTMLSlotElement))
|
|
93
92
|
return;
|
|
94
93
|
const assigned = slot.assignedElements();
|
|
@@ -97,7 +96,7 @@ export class TableView extends HTMLElement {
|
|
|
97
96
|
this.#renderColumns([]);
|
|
98
97
|
};
|
|
99
98
|
#renderColumns = (entries) => {
|
|
100
|
-
|
|
99
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
101
100
|
if (!this.#compactToolbarItem) {
|
|
102
101
|
this.#compactToolbarItem = $(html `<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
|
|
103
102
|
CleanupRegistry.unregister(this, 'compact_toolbar');
|
|
@@ -120,7 +119,7 @@ export class TableView extends HTMLElement {
|
|
|
120
119
|
};
|
|
121
120
|
#observers = new MutationObserverSet(this.#renderColumns);
|
|
122
121
|
#handleStyleChange = () => {
|
|
123
|
-
|
|
122
|
+
debug(`${_a.name} ⚡️ style`);
|
|
124
123
|
const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
|
|
125
124
|
if (!target)
|
|
126
125
|
return;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { I18n } from '../i18n';
|
|
4
3
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
5
4
|
import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
|
|
6
5
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
7
|
-
import { $, compareBigDecimals, kebabCase, onoff, set } from '../internal/utils';
|
|
6
|
+
import { $, compareBigDecimals, debug, kebabCase, onoff, set } from '../internal/utils';
|
|
8
7
|
import { queryMorph } from '../morphdom';
|
|
9
8
|
import { html } from '../tpl';
|
|
10
9
|
const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
|
|
@@ -59,7 +58,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
59
58
|
</label>`));
|
|
60
59
|
}
|
|
61
60
|
#renderValidityMsgs = (entries) => {
|
|
62
|
-
|
|
61
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
63
62
|
this.setValidity(this.validity, this.validationMessage);
|
|
64
63
|
};
|
|
65
64
|
#shadowRoot;
|
|
@@ -96,7 +95,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
96
95
|
}, I18n.on).on());
|
|
97
96
|
}
|
|
98
97
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
99
|
-
|
|
98
|
+
debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
100
99
|
switch (name) {
|
|
101
100
|
case 'keyboard-type':
|
|
102
101
|
switch (newValue) {
|
|
@@ -223,7 +222,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
#handleValiditiesSlotchange = ({ type, target: slot }) => {
|
|
226
|
-
|
|
225
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
227
226
|
if (!(slot instanceof HTMLSlotElement))
|
|
228
227
|
return;
|
|
229
228
|
const assigned = slot.assignedElements();
|
|
@@ -232,7 +231,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
232
231
|
this.#renderValidityMsgs([]);
|
|
233
232
|
};
|
|
234
233
|
#handleFocusin = (evt) => {
|
|
235
|
-
|
|
234
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
236
235
|
if (evt.target === this)
|
|
237
236
|
this.#input?.focus();
|
|
238
237
|
};
|
|
@@ -263,7 +262,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
263
262
|
this.dispatchEvent(new CustomEvent('commit', { detail: { text: this.text }, bubbles: true, composed: true }));
|
|
264
263
|
};
|
|
265
264
|
#handleInputPaste = (evt) => {
|
|
266
|
-
|
|
265
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
267
266
|
const { target: input } = evt;
|
|
268
267
|
if (!(input instanceof HTMLInputElement))
|
|
269
268
|
return;
|
|
@@ -366,7 +365,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
366
365
|
}
|
|
367
366
|
};
|
|
368
367
|
#handleInputBeforeinput = (evt) => {
|
|
369
|
-
|
|
368
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
370
369
|
const { target: input } = evt;
|
|
371
370
|
if (!(input instanceof HTMLInputElement))
|
|
372
371
|
return;
|
|
@@ -401,7 +400,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
401
400
|
}
|
|
402
401
|
};
|
|
403
402
|
#handleInputBlur = ({ type, target: input }) => {
|
|
404
|
-
|
|
403
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
405
404
|
if (!(input instanceof HTMLInputElement))
|
|
406
405
|
return;
|
|
407
406
|
if (0 === input.value.length)
|
|
@@ -412,7 +411,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
412
411
|
this.#sendValueToForm();
|
|
413
412
|
};
|
|
414
413
|
#handleInputInput = (evt) => {
|
|
415
|
-
|
|
414
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
416
415
|
this.#sendValueToForm();
|
|
417
416
|
};
|
|
418
417
|
/**
|
|
@@ -490,7 +489,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
490
489
|
message = kebabCase(key);
|
|
491
490
|
break;
|
|
492
491
|
}
|
|
493
|
-
|
|
492
|
+
debug(`${_a.name} ⚡️ validity-change`);
|
|
494
493
|
return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
|
|
495
494
|
};
|
|
496
495
|
setCustomValidity = (message) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
2
|
export class TextView extends HTMLElement {
|
|
3
3
|
constructor() {
|
|
4
4
|
super();
|
|
5
5
|
}
|
|
6
6
|
connectedCallback() {
|
|
7
|
-
|
|
7
|
+
debug(`${TextView.name} ⚡️ connect`);
|
|
8
8
|
}
|
|
9
9
|
disconnectedCallback() {
|
|
10
|
-
|
|
10
|
+
debug(`${TextView.name} ⚡️ disconnect`);
|
|
11
11
|
}
|
|
12
12
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
13
|
-
|
|
13
|
+
debug(`${TextView.name} ⚡️ attr-change [${name}]`);
|
|
14
14
|
//
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
3
|
import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
|
|
5
4
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
6
|
-
import { $, kebabCase, onoff, touchGlass } from '../internal/utils';
|
|
5
|
+
import { $, debug, kebabCase, onoff, touchGlass } from '../internal/utils';
|
|
7
6
|
import { queryMorph } from '../morphdom';
|
|
8
7
|
import { html } from '../tpl';
|
|
9
8
|
const toggleStyles = ['switch', 'button'];
|
|
@@ -50,7 +49,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
50
49
|
</label>`));
|
|
51
50
|
}
|
|
52
51
|
#renderValidityMsgs = (entries) => {
|
|
53
|
-
|
|
52
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
54
53
|
this.setValidity(this.validity, this.validationMessage);
|
|
55
54
|
};
|
|
56
55
|
#shadowRoot;
|
|
@@ -70,7 +69,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
70
69
|
return this.#trackWidth - this.#dotSize;
|
|
71
70
|
}
|
|
72
71
|
#handleMeasure = ([{ target, borderBoxSize }]) => {
|
|
73
|
-
|
|
72
|
+
debug(`${_a.name} ⚡️ measure`);
|
|
74
73
|
if (!(target instanceof HTMLElement))
|
|
75
74
|
return;
|
|
76
75
|
this.#trackWidth = borderBoxSize.at(0)?.inlineSize ?? 0;
|
|
@@ -106,10 +105,13 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
106
105
|
{ types: 'pointermove', listener: this.#handleTrackPointermove },
|
|
107
106
|
{ types: 'lostpointercapture', listener: this.#handleTrackPointercancel },
|
|
108
107
|
], this.#track).on());
|
|
109
|
-
CleanupRegistry.register(this, onoff([
|
|
108
|
+
CleanupRegistry.register(this, onoff([
|
|
109
|
+
{ types: 'blur', listener: this.#handleWindowBlur },
|
|
110
|
+
{ types: 'focus', listener: this.#handleWindowFocus },
|
|
111
|
+
], self).on());
|
|
110
112
|
}
|
|
111
113
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
112
|
-
|
|
114
|
+
debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
113
115
|
switch (name) {
|
|
114
116
|
case 'value':
|
|
115
117
|
this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
|
|
@@ -162,7 +164,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
162
164
|
this.ariaChecked = `${this.#isOn}`;
|
|
163
165
|
}
|
|
164
166
|
#handleValiditiesSlotchange = ({ type, target: slot }) => {
|
|
165
|
-
|
|
167
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
166
168
|
if (!(slot instanceof HTMLSlotElement))
|
|
167
169
|
return;
|
|
168
170
|
const assigned = slot.assignedElements();
|
|
@@ -170,12 +172,12 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
170
172
|
this.#renderValidityMsgs([]);
|
|
171
173
|
};
|
|
172
174
|
#handleFocusin = ({ type, target }) => {
|
|
173
|
-
|
|
175
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
174
176
|
if (target === this)
|
|
175
177
|
this.#track?.focus();
|
|
176
178
|
};
|
|
177
179
|
#handleTrackClick = ({ type }) => {
|
|
178
|
-
|
|
180
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
179
181
|
if (this.#didDrag)
|
|
180
182
|
return (this.#didDrag = false);
|
|
181
183
|
this.#applyIsOnWithFlip(!this.isOn);
|
|
@@ -194,7 +196,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
194
196
|
return this.isOn ? this.#trackMaxX : this.#trackMinX;
|
|
195
197
|
}
|
|
196
198
|
#handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
|
|
197
|
-
|
|
199
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
198
200
|
if (!this.#track)
|
|
199
201
|
return;
|
|
200
202
|
if (!this.#measurePointerIsOverDot(clientX, clientY))
|
|
@@ -206,13 +208,13 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
206
208
|
this.#track.setPointerCapture(pointerId);
|
|
207
209
|
};
|
|
208
210
|
#handleTrackPointermove = ({ type, clientX }) => {
|
|
209
|
-
|
|
211
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
210
212
|
if (!this.#isDragging)
|
|
211
213
|
return;
|
|
212
214
|
this.#updateFromEvent(clientX);
|
|
213
215
|
};
|
|
214
216
|
#handleTrackPointerup = ({ type, pointerId }) => {
|
|
215
|
-
|
|
217
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
216
218
|
if (!this.#isDragging)
|
|
217
219
|
return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
|
|
218
220
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
@@ -220,18 +222,22 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
220
222
|
this.#settle();
|
|
221
223
|
};
|
|
222
224
|
#handleTrackPointercancel = ({ type }) => {
|
|
223
|
-
|
|
225
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
224
226
|
if (!this.#isDragging)
|
|
225
227
|
return; // already settled via pointerup, or nothing to settle
|
|
226
228
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
227
229
|
this.#settle();
|
|
228
230
|
};
|
|
229
231
|
#handleWindowBlur = () => {
|
|
232
|
+
this.toggleAttribute('js-window-inactive', true);
|
|
230
233
|
if (!this.#isDragging)
|
|
231
234
|
return;
|
|
232
235
|
this.#track?.style.removeProperty('--toggle--dot-transition-duration');
|
|
233
236
|
this.#settle();
|
|
234
237
|
};
|
|
238
|
+
#handleWindowFocus = async () => {
|
|
239
|
+
this.toggleAttribute('js-window-inactive', false);
|
|
240
|
+
};
|
|
235
241
|
#updateFromEvent = (clientX) => {
|
|
236
242
|
if (!this.#track)
|
|
237
243
|
return;
|
|
@@ -252,7 +258,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
252
258
|
this.#sendValueToForm(true);
|
|
253
259
|
};
|
|
254
260
|
#handleTrackKeydown = (evt) => {
|
|
255
|
-
|
|
261
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
256
262
|
if (' ' !== evt.key)
|
|
257
263
|
return;
|
|
258
264
|
evt.preventDefault();
|
|
@@ -332,7 +338,7 @@ export class ToggleView extends FormAssociatedBase {
|
|
|
332
338
|
message = kebabCase(key);
|
|
333
339
|
break;
|
|
334
340
|
}
|
|
335
|
-
|
|
341
|
+
debug(`${_a.name} ⚡️ validity-change`);
|
|
336
342
|
return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
|
|
337
343
|
};
|
|
338
344
|
setCustomValidity = (message) => {
|
|
@@ -5,9 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var ToolBarItemGroup_1;
|
|
8
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
9
8
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
10
9
|
import { adaptiveSlot } from '../internal/decorators';
|
|
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,10 +16,10 @@ let ToolBarItemGroup = ToolBarItemGroup_1 = class ToolBarItemGroup extends HTMLE
|
|
|
16
16
|
super();
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
19
|
+
debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
|
|
20
20
|
}
|
|
21
21
|
disconnectedCallback() {
|
|
22
|
-
|
|
22
|
+
debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
|
|
23
23
|
CleanupRegistry.unregister(this);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
@@ -5,10 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var ToolBarItem_1;
|
|
8
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
9
8
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
10
9
|
import { adaptiveSlot } from '../internal/decorators';
|
|
11
|
-
import { ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
10
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
12
11
|
import { Snapshot } from '../snapshot';
|
|
13
12
|
/**
|
|
14
13
|
* @summary A view placed in the toolbar or navigation bar.
|
|
@@ -22,7 +21,7 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
|
|
|
22
21
|
super();
|
|
23
22
|
}
|
|
24
23
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
25
|
-
|
|
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,12 +45,12 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
disconnectedCallback() {
|
|
49
|
-
|
|
48
|
+
debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
|
|
50
49
|
this.#mutationObserver?.disconnect();
|
|
51
50
|
CleanupRegistry.unregister(this);
|
|
52
51
|
}
|
|
53
52
|
connectedCallback() {
|
|
54
|
-
|
|
53
|
+
debug(`${ToolBarItem_1.name} ⚡️ connect`);
|
|
55
54
|
CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, ({ target }) => {
|
|
56
55
|
if (!(target instanceof HTMLElement))
|
|
57
56
|
return true;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
|
|
4
|
-
import {
|
|
3
|
+
import { $, debug } from '../internal/utils';
|
|
5
4
|
import { html } from '../tpl';
|
|
6
5
|
const observers = new ResizeObserverSingleton();
|
|
7
6
|
/**
|
|
@@ -59,7 +58,7 @@ export class ToolBar extends HTMLElement {
|
|
|
59
58
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
60
59
|
}
|
|
61
60
|
connectedCallback() {
|
|
62
|
-
|
|
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,11 +66,11 @@ export class ToolBar extends HTMLElement {
|
|
|
67
66
|
// })
|
|
68
67
|
}
|
|
69
68
|
disconnectedCallback() {
|
|
70
|
-
|
|
69
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
71
70
|
observers.unobserve(this);
|
|
72
71
|
}
|
|
73
72
|
#measureStacks(entry) {
|
|
74
|
-
|
|
73
|
+
debug(`${_a.name} ⚡️ measure`);
|
|
75
74
|
if (this.closest('[hidden]'))
|
|
76
75
|
return;
|
|
77
76
|
const leading = 'toolbar-leading-stack', trailing = 'toolbar-trailing-stack';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
2
|
export class VDivider extends HTMLElement {
|
|
3
3
|
constructor() {
|
|
4
4
|
super();
|
|
5
5
|
}
|
|
6
6
|
connectedCallback() {
|
|
7
|
-
|
|
7
|
+
debug(`${VDivider.name} ⚡️ connect`);
|
|
8
8
|
}
|
|
9
9
|
disconnectedCallback() {
|
|
10
|
-
|
|
10
|
+
debug(`${VDivider.name} ⚡️ disconnect`);
|
|
11
11
|
}
|
|
12
12
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
13
|
-
|
|
13
|
+
debug(`${VDivider.name} ⚡️ attr-change [${name}]`);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import { DEBUG } from '../internal/flags.json' with { type: 'json' };
|
|
3
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
|
-
import { frame, onoff, prop, sleep } from '../internal/utils';
|
|
3
|
+
import { debug, frame, onoff, prop, sleep } from '../internal/utils';
|
|
5
4
|
import { Snapshot } from '../snapshot';
|
|
6
5
|
/**
|
|
7
6
|
* BUG: Safari on IOS reports inaccurate innerHeight (which is what we really want) on orientationchange.
|
|
@@ -23,11 +22,11 @@ export class VKeyboard extends HTMLElement {
|
|
|
23
22
|
super();
|
|
24
23
|
}
|
|
25
24
|
disconnectedCallback() {
|
|
26
|
-
|
|
25
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
27
26
|
CleanupRegistry.unregister(this);
|
|
28
27
|
}
|
|
29
28
|
connectedCallback() {
|
|
30
|
-
|
|
29
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
31
30
|
this.inert = true;
|
|
32
31
|
CleanupRegistry.register(this, onoff([
|
|
33
32
|
{ types: 'scroll', listener: this.#handleWindowScroll },
|
|
@@ -59,13 +58,13 @@ export class VKeyboard extends HTMLElement {
|
|
|
59
58
|
self.scrollTo(0, 0);
|
|
60
59
|
};
|
|
61
60
|
#handleWindowOrientationchange = async () => {
|
|
62
|
-
|
|
61
|
+
debug(`${_a.name} ⚡️ orientationchange`);
|
|
63
62
|
if (!(await frame(this)))
|
|
64
63
|
return; //self.requestAnimationFrame(this.#ifKeyboardScrollIntoActiveElement)
|
|
65
64
|
this.#ifKeyboardScrollIntoActiveElement();
|
|
66
65
|
};
|
|
67
66
|
#handleBodyFocusin = async () => {
|
|
68
|
-
|
|
67
|
+
debug(`${_a.name} ⚡️ focusin`);
|
|
69
68
|
await sleep(100); // self.setTimeout(this.#ifKeyboardScrollIntoActiveElement, 100)
|
|
70
69
|
if (!this.isConnected)
|
|
71
70
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @summary A view that arranges its children one on top of the other.
|
|
4
4
|
*
|
|
@@ -19,9 +19,9 @@ export class VStack extends HTMLElement {
|
|
|
19
19
|
super();
|
|
20
20
|
}
|
|
21
21
|
connectedCallback() {
|
|
22
|
-
|
|
22
|
+
debug(`${VStack.name} ⚡️ connect`);
|
|
23
23
|
}
|
|
24
24
|
disconnectedCallback() {
|
|
25
|
-
|
|
25
|
+
debug(`${VStack.name} ⚡️ disconnect`);
|
|
26
26
|
}
|
|
27
27
|
}
|