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