@swiftwc/ui 0.0.0-dev.38 → 0.0.0-dev.39
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 -3
- package/generated/components/alert-dialog.js +17 -9
- package/generated/components/body-view.js +5 -3
- package/generated/components/bordered-button.js +7 -4
- package/generated/components/bordered-prominent-button.js +7 -4
- package/generated/components/borderless-button.js +7 -4
- package/generated/components/confirmation-dialog.js +17 -9
- package/generated/components/content-unavailable-view.js +7 -4
- package/generated/components/date-picker.js +32 -19
- package/generated/components/disclosure-group.js +9 -5
- package/generated/components/fine-tooltip.js +7 -4
- package/generated/components/form-view.js +5 -3
- package/generated/components/glass-button.js +7 -4
- package/generated/components/glass-prominent-button.js +7 -4
- package/generated/components/label-view.js +7 -4
- package/generated/components/list-view.js +5 -3
- package/generated/components/menu-view.js +19 -10
- package/generated/components/navigation-large-title.js +9 -5
- package/generated/components/navigation-split-view.js +7 -4
- package/generated/components/navigation-stack.js +7 -4
- package/generated/components/navigation-title.js +7 -4
- package/generated/components/picker-view.d.ts +1 -0
- package/generated/components/picker-view.js +181 -77
- package/generated/components/plain-button.js +5 -3
- package/generated/components/progress-view.js +11 -6
- package/generated/components/screen-view.js +3 -2
- package/generated/components/scroll-view-proxy.js +5 -3
- package/generated/components/scroll-view.js +17 -9
- package/generated/components/search-view.js +7 -4
- package/generated/components/section-view.js +7 -4
- package/generated/components/sheet-view.js +11 -6
- package/generated/components/sidebar-toggle.js +9 -5
- package/generated/components/sidebar-view.js +3 -2
- package/generated/components/sticky-container.js +5 -3
- package/generated/components/tab-bar.js +7 -4
- package/generated/components/tab-item.js +15 -8
- package/generated/components/tab-view.js +14 -8
- package/generated/components/table-view.js +11 -6
- package/generated/components/text-field.js +25 -15
- package/generated/components/tool-bar-item-group.js +5 -3
- package/generated/components/tool-bar-item.js +7 -4
- package/generated/components/tool-bar.js +7 -4
- package/generated/components/v-keyboard.js +9 -5
- package/generated/components/v-stack.js +5 -3
- package/generated/css/index.css +6 -2
- package/generated/events/picker-view.d.ts +1 -0
- package/generated/internal/class/css-style-observer.js +3 -2
- package/generated/internal/class/form-associated-base.js +7 -5
- package/generated/internal/class/navigation-view.js +5 -3
- package/generated/internal/decorators/adaptive-slot.js +7 -4
- package/generated/internal/privateNamespace.js +22 -13
- package/generated/internal/utils/dev-flags.d.ts +3 -0
- package/generated/internal/utils/dev-flags.js +5 -0
- package/generated/internal/utils/index.d.ts +1 -1
- package/generated/internal/utils/index.js +1 -1
- package/generated/snapshot/index.js +5 -3
- package/package.json +1 -1
- package/scss/base/_layout.scss +6 -7
- package/generated/internal/utils/debug.d.ts +0 -1
- package/generated/internal/utils/debug.js +0 -3
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { lifecycleObserver } from '../buses';
|
|
3
3
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
4
|
import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
|
|
5
|
-
import { $,
|
|
5
|
+
import { $, devFlags, frame, onoff, slowHideShow } from '../internal/utils';
|
|
6
6
|
const observers = new ResizeObserverSingleton();
|
|
7
7
|
export class ScrollView extends HTMLElement {
|
|
8
8
|
static get observedAttributes() {
|
|
@@ -41,13 +41,15 @@ export class ScrollView extends HTMLElement {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
disconnectedCallback() {
|
|
44
|
-
|
|
44
|
+
if (devFlags.debug)
|
|
45
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
45
46
|
CleanupRegistry.unregister(this);
|
|
46
47
|
observers.unobserve(this);
|
|
47
48
|
frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('pagehide', { detail: { page: this }, bubbles: true, composed: true })));
|
|
48
49
|
}
|
|
49
50
|
connectedCallback() {
|
|
50
|
-
|
|
51
|
+
if (devFlags.debug)
|
|
52
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
51
53
|
CleanupRegistry.register(this, onoff([
|
|
52
54
|
// { types: 'tabreveal', listener: this.#handleTabReveal as EventListener },
|
|
53
55
|
{ types: 'beforetabswap', listener: this.#handleTabBeforeswap },
|
|
@@ -71,7 +73,8 @@ export class ScrollView extends HTMLElement {
|
|
|
71
73
|
// })
|
|
72
74
|
}
|
|
73
75
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
74
|
-
|
|
76
|
+
if (devFlags.debug)
|
|
77
|
+
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
75
78
|
switch (name) {
|
|
76
79
|
case 'navigation-inline-title':
|
|
77
80
|
this.#renderNavTitle(newValue, this.getAttribute('navigation-inline-subtitle'));
|
|
@@ -95,7 +98,8 @@ export class ScrollView extends HTMLElement {
|
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
#handleScroll = ({ target, type }) => {
|
|
98
|
-
|
|
101
|
+
if (devFlags.debug)
|
|
102
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
99
103
|
if (!this.#isMidScroll)
|
|
100
104
|
this.#isMidScroll = true;
|
|
101
105
|
// if (this.#stopRecordingScrollTop) return
|
|
@@ -104,12 +108,14 @@ export class ScrollView extends HTMLElement {
|
|
|
104
108
|
this.#lastScrollTop = target.scrollTop;
|
|
105
109
|
};
|
|
106
110
|
#handleScrollend = (evt) => {
|
|
107
|
-
|
|
111
|
+
if (devFlags.debug)
|
|
112
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
108
113
|
if (this.#isMidScroll)
|
|
109
114
|
this.#isMidScroll = false;
|
|
110
115
|
};
|
|
111
116
|
#handleMeasure = (entry) => {
|
|
112
|
-
|
|
117
|
+
if (devFlags.debug)
|
|
118
|
+
console.debug(`${_a.name} ⚡️ measure`);
|
|
113
119
|
if (0 === entry.contentRect.width + entry.contentRect.height)
|
|
114
120
|
return;
|
|
115
121
|
if (undefined === this.#beforeTabSwapLastScrolltop)
|
|
@@ -126,7 +132,8 @@ export class ScrollView extends HTMLElement {
|
|
|
126
132
|
this.#beforeTabSwapLastScrolltop = undefined;
|
|
127
133
|
};
|
|
128
134
|
#handleTabReveal = ({ type, target }) => {
|
|
129
|
-
|
|
135
|
+
if (devFlags.debug)
|
|
136
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
130
137
|
if (!(target instanceof HTMLElement && target))
|
|
131
138
|
return;
|
|
132
139
|
if (!target.contains(this))
|
|
@@ -157,7 +164,8 @@ export class ScrollView extends HTMLElement {
|
|
|
157
164
|
// })
|
|
158
165
|
};
|
|
159
166
|
#handleTabBeforeswap = ({ type, target }) => {
|
|
160
|
-
|
|
167
|
+
if (devFlags.debug)
|
|
168
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
161
169
|
if (!(target instanceof HTMLElement && target))
|
|
162
170
|
return;
|
|
163
171
|
if (!target.contains(this))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { InputBase } from '../namespace-browser/base';
|
|
4
4
|
export class SearchView extends InputBase {
|
|
5
5
|
static get observedAttributes() {
|
|
@@ -9,16 +9,19 @@ export class SearchView extends InputBase {
|
|
|
9
9
|
super();
|
|
10
10
|
}
|
|
11
11
|
static polyfillDisconnectedCallback(el) {
|
|
12
|
-
|
|
12
|
+
if (devFlags.debug)
|
|
13
|
+
console.debug(`${SearchView.name} ⚡️ disconnect`);
|
|
13
14
|
CleanupRegistry.unregister(el);
|
|
14
15
|
}
|
|
15
16
|
static polyfillConnectedCallback(el) {
|
|
16
|
-
|
|
17
|
+
if (devFlags.debug)
|
|
18
|
+
console.debug(`${SearchView.name} ⚡️ connect`);
|
|
17
19
|
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
18
20
|
el.type = 'search';
|
|
19
21
|
}
|
|
20
22
|
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
21
|
-
|
|
23
|
+
if (devFlags.debug)
|
|
24
|
+
console.debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
22
25
|
const node = target instanceof HTMLInputElement && target;
|
|
23
26
|
if (!node)
|
|
24
27
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $,
|
|
1
|
+
import { $, devFlags } from '../internal/utils';
|
|
2
2
|
export class SectionView extends HTMLElement {
|
|
3
3
|
static get observedAttributes() {
|
|
4
4
|
return ['header', 'footer'];
|
|
@@ -32,12 +32,14 @@ export class SectionView extends HTMLElement {
|
|
|
32
32
|
// })
|
|
33
33
|
}
|
|
34
34
|
disconnectedCallback() {
|
|
35
|
-
|
|
35
|
+
if (devFlags.debug)
|
|
36
|
+
console.debug(`${SectionView.name} ⚡️ disconnect`);
|
|
36
37
|
// if (this.#sentinel) this.#observer?.unobserve(this.#sentinel)
|
|
37
38
|
// this.#observer?.unobserve(this)
|
|
38
39
|
}
|
|
39
40
|
connectedCallback() {
|
|
40
|
-
|
|
41
|
+
if (devFlags.debug)
|
|
42
|
+
console.debug(`${SectionView.name} ⚡️ connect`);
|
|
41
43
|
// this.#sibling = this.closest('scroll-view') ?? undefined
|
|
42
44
|
// Snapshot.waitReady.then(() => {
|
|
43
45
|
// if (!(await frame(this))) return // NOTE: Required or BREAKS transitions // self.requestAnimationFrame(() => {
|
|
@@ -53,7 +55,8 @@ export class SectionView extends HTMLElement {
|
|
|
53
55
|
// })
|
|
54
56
|
}
|
|
55
57
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
56
|
-
|
|
58
|
+
if (devFlags.debug)
|
|
59
|
+
console.debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
57
60
|
// Snapshot.waitReady.then(() => {
|
|
58
61
|
switch (name) {
|
|
59
62
|
case 'header':
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff } from '../internal/utils';
|
|
3
3
|
import { DialogBase } from '../namespace-browser/base';
|
|
4
4
|
export class SheetView extends DialogBase {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
8
8
|
static polyfillDisconnectedCallback(el) {
|
|
9
|
-
|
|
9
|
+
if (devFlags.debug)
|
|
10
|
+
console.debug(`${SheetView.name} ⚡️ disconnect`);
|
|
10
11
|
CleanupRegistry.unregister(el);
|
|
11
12
|
}
|
|
12
13
|
static polyfillConnectedCallback(el) {
|
|
13
|
-
|
|
14
|
+
if (devFlags.debug)
|
|
15
|
+
console.debug(`${SheetView.name} ⚡️ connect`);
|
|
14
16
|
CleanupRegistry.register(el, onoff([
|
|
15
17
|
{ types: 'cancel', listener: this.#handleCancel },
|
|
16
18
|
{ types: 'keydown', listener: SheetView.#handleKeydown },
|
|
@@ -18,7 +20,8 @@ export class SheetView extends DialogBase {
|
|
|
18
20
|
el.autofocus = true;
|
|
19
21
|
}
|
|
20
22
|
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
21
|
-
|
|
23
|
+
if (devFlags.debug)
|
|
24
|
+
console.debug(`${SheetView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
22
25
|
// // NOTE: wait for config
|
|
23
26
|
// Snapshot.waitReady.then(() => {
|
|
24
27
|
// switch (attributeName) {
|
|
@@ -41,7 +44,8 @@ export class SheetView extends DialogBase {
|
|
|
41
44
|
// })
|
|
42
45
|
}
|
|
43
46
|
static #handleKeydown = (evt) => {
|
|
44
|
-
|
|
47
|
+
if (devFlags.debug)
|
|
48
|
+
console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.key})`);
|
|
45
49
|
if ('Escape' !== evt.key)
|
|
46
50
|
return;
|
|
47
51
|
evt.preventDefault();
|
|
@@ -49,7 +53,8 @@ export class SheetView extends DialogBase {
|
|
|
49
53
|
evt.stopPropagation();
|
|
50
54
|
};
|
|
51
55
|
static #handleCancel = (evt) => {
|
|
52
|
-
|
|
56
|
+
if (devFlags.debug)
|
|
57
|
+
console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.cancelable})`);
|
|
53
58
|
if (!evt.cancelable)
|
|
54
59
|
return;
|
|
55
60
|
evt.preventDefault();
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
|
|
4
|
-
import { debounce,
|
|
4
|
+
import { debounce, devFlags, onoff } from '../internal/utils';
|
|
5
5
|
const observers = new ResizeObserverSingleton();
|
|
6
6
|
export class SidebarToggle extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
}
|
|
10
10
|
connectedCallback() {
|
|
11
|
-
|
|
11
|
+
if (devFlags.debug)
|
|
12
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
12
13
|
CleanupRegistry.register(this, onoff('click', this.#handleClick, this).on());
|
|
13
14
|
const entry = {
|
|
14
15
|
target: this,
|
|
@@ -18,7 +19,8 @@ export class SidebarToggle extends HTMLElement {
|
|
|
18
19
|
_a.#handleMeasure([entry]);
|
|
19
20
|
}
|
|
20
21
|
disconnectedCallback() {
|
|
21
|
-
|
|
22
|
+
if (devFlags.debug)
|
|
23
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
22
24
|
observers.unobserve(this);
|
|
23
25
|
CleanupRegistry.unregister(this);
|
|
24
26
|
}
|
|
@@ -28,7 +30,8 @@ export class SidebarToggle extends HTMLElement {
|
|
|
28
30
|
}
|
|
29
31
|
// This triggers on show/hide of any of sidebar-toggle elements
|
|
30
32
|
static #handleMeasure(entry) {
|
|
31
|
-
|
|
33
|
+
if (devFlags.debug)
|
|
34
|
+
console.debug(`${_a.name} ⚡️ measure`);
|
|
32
35
|
const { target } = entry ?? {};
|
|
33
36
|
if (!(target instanceof HTMLElement && target))
|
|
34
37
|
return;
|
|
@@ -66,7 +69,8 @@ export class SidebarToggle extends HTMLElement {
|
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
71
|
#handleClick({ target, type }) {
|
|
69
|
-
|
|
72
|
+
if (devFlags.debug)
|
|
73
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
70
74
|
if (!(target instanceof HTMLElement && target))
|
|
71
75
|
return;
|
|
72
76
|
if (!target?.closest('button'))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { DialogBase } from '../namespace-browser/base';
|
|
4
4
|
export class SidebarView extends DialogBase {
|
|
5
5
|
constructor() {
|
|
@@ -24,7 +24,8 @@ export class SidebarView extends DialogBase {
|
|
|
24
24
|
}
|
|
25
25
|
/** Autoclose on click outside. */
|
|
26
26
|
static #handleClick = async ({ target, type }) => {
|
|
27
|
-
|
|
27
|
+
if (devFlags.debug)
|
|
28
|
+
console.debug(`${SidebarView.name} ⚡️ ${type}`);
|
|
28
29
|
if (!(target instanceof HTMLElement && target))
|
|
29
30
|
return;
|
|
30
31
|
if (target instanceof HTMLDialogElement && 'sidebar-view' === target.getAttribute('is'))
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff } from '../internal/utils';
|
|
3
3
|
export class StickyContainer extends HTMLElement {
|
|
4
4
|
constructor() {
|
|
5
5
|
super();
|
|
6
6
|
}
|
|
7
7
|
connectedCallback() {
|
|
8
|
-
|
|
8
|
+
if (devFlags.debug)
|
|
9
|
+
console.debug(`${StickyContainer.name} ⚡️ connect`);
|
|
9
10
|
// CleanupRegistry.register(this, onoff('transitionend transitionstart transitioncancel', this.#handleTransitionrun as unknown as EventListener, this).on())
|
|
10
11
|
CleanupRegistry.register(this, onoff('transitionrun', this.#handleTransitionrun, this).on());
|
|
11
12
|
}
|
|
12
13
|
disconnectedCallback() {
|
|
13
|
-
|
|
14
|
+
if (devFlags.debug)
|
|
15
|
+
console.debug(`${StickyContainer.name} ⚡️ disconnect`);
|
|
14
16
|
CleanupRegistry.unregister(this);
|
|
15
17
|
}
|
|
16
18
|
#handleTransitionrun = ({ target, propertyName, pseudoElement }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { DialogBase } from '../namespace-browser/base';
|
|
4
4
|
/**
|
|
5
5
|
* @summary A screen that lets users switch between different views using buttons, tabs, or other controls.
|
|
@@ -9,12 +9,14 @@ export class TabBar extends DialogBase {
|
|
|
9
9
|
super();
|
|
10
10
|
}
|
|
11
11
|
static polyfillDisconnectedCallback(el) {
|
|
12
|
-
|
|
12
|
+
if (devFlags.debug)
|
|
13
|
+
console.debug(`${TabBar.name} ⚡️ disconnect`);
|
|
13
14
|
el.removeEventListener('click', TabBar.#handleClick);
|
|
14
15
|
CleanupRegistry.unregister(el);
|
|
15
16
|
}
|
|
16
17
|
static polyfillConnectedCallback(el) {
|
|
17
|
-
|
|
18
|
+
if (devFlags.debug)
|
|
19
|
+
console.debug(`${TabBar.name} ⚡️ connect`);
|
|
18
20
|
el.autofocus = true;
|
|
19
21
|
// Snapshot.waitReadyFor(el).then((r) => {
|
|
20
22
|
// if (!r) return
|
|
@@ -31,7 +33,8 @@ export class TabBar extends DialogBase {
|
|
|
31
33
|
// })
|
|
32
34
|
}
|
|
33
35
|
static #handleClick = async ({ target, type }) => {
|
|
34
|
-
|
|
36
|
+
if (devFlags.debug)
|
|
37
|
+
console.debug(`${TabBar.name} ⚡️ ${type}`);
|
|
35
38
|
if (!(target instanceof HTMLElement && target))
|
|
36
39
|
return;
|
|
37
40
|
if (target instanceof HTMLDialogElement && 'tab-bar' === target.getAttribute('is'))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { devFlags, onoff } from '../internal/utils';
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { TabView } from './tab-view';
|
|
5
5
|
export class TabItem extends ButtonBase {
|
|
@@ -7,11 +7,13 @@ export class TabItem extends ButtonBase {
|
|
|
7
7
|
super();
|
|
8
8
|
}
|
|
9
9
|
static polyfillDisconnectedCallback(btn) {
|
|
10
|
-
|
|
10
|
+
if (devFlags.debug)
|
|
11
|
+
console.debug(`${TabItem.name} ⚡️ disconnect`);
|
|
11
12
|
CleanupRegistry.unregister(btn);
|
|
12
13
|
}
|
|
13
14
|
static polyfillConnectedCallback(btn) {
|
|
14
|
-
|
|
15
|
+
if (devFlags.debug)
|
|
16
|
+
console.debug(`${TabItem.name} ⚡️ connect`);
|
|
15
17
|
Object.assign(btn, {
|
|
16
18
|
tabIndex: 0,
|
|
17
19
|
ariaSelected: 'false',
|
|
@@ -31,7 +33,8 @@ export class TabItem extends ButtonBase {
|
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
static #handleTabMoreStackAllowance = async (btn, evt) => {
|
|
34
|
-
|
|
36
|
+
if (devFlags.debug)
|
|
37
|
+
console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
|
|
35
38
|
const tv = btn.closest('tab-view');
|
|
36
39
|
if (!tv)
|
|
37
40
|
return;
|
|
@@ -40,7 +43,8 @@ export class TabItem extends ButtonBase {
|
|
|
40
43
|
btn.hidden = 'bottom-bar' !== tv.tabBarPlacement;
|
|
41
44
|
};
|
|
42
45
|
static #handleTabRevealOrSwap = async (btn, evt) => {
|
|
43
|
-
|
|
46
|
+
if (devFlags.debug)
|
|
47
|
+
console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
|
|
44
48
|
const tv = btn?.closest('tab-view');
|
|
45
49
|
if (!tv)
|
|
46
50
|
return;
|
|
@@ -62,7 +66,8 @@ export class TabItem extends ButtonBase {
|
|
|
62
66
|
}, 100);
|
|
63
67
|
};
|
|
64
68
|
static #handleClick = async (evt) => {
|
|
65
|
-
|
|
69
|
+
if (devFlags.debug)
|
|
70
|
+
console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
|
|
66
71
|
const btn = evt.currentTarget instanceof HTMLElement && evt.currentTarget;
|
|
67
72
|
if (!btn)
|
|
68
73
|
return;
|
|
@@ -109,14 +114,16 @@ export class TabItem extends ButtonBase {
|
|
|
109
114
|
for (const tab of tabs.reverse())
|
|
110
115
|
if (tv.selectedTab.includes(tab)) {
|
|
111
116
|
const eventType = 'tabroot';
|
|
112
|
-
|
|
117
|
+
if (devFlags.debug)
|
|
118
|
+
console.debug(`${TabItem.name} 💡 ${eventType}`);
|
|
113
119
|
tab?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
|
|
114
120
|
return; // skip rest no selection!
|
|
115
121
|
}
|
|
116
122
|
}
|
|
117
123
|
else if ('->' === dir) {
|
|
118
124
|
const eventType = 'tabroot';
|
|
119
|
-
|
|
125
|
+
if (devFlags.debug)
|
|
126
|
+
console.debug(`${TabItem.name} 💡 ${eventType}`);
|
|
120
127
|
tabs.at(0)?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
|
|
121
128
|
}
|
|
122
129
|
// SECTION: finally, submit new tabs
|
|
@@ -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 { $, cssTime, debounce,
|
|
5
|
+
import { $, cssTime, debounce, devFlags, frame, onoff, timeout } from '../internal/utils';
|
|
6
6
|
import { Snapshot } from '../snapshot';
|
|
7
7
|
const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
|
|
8
8
|
/**
|
|
@@ -25,7 +25,8 @@ export class TabView extends HTMLElement {
|
|
|
25
25
|
this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
|
|
26
26
|
}
|
|
27
27
|
disconnectedCallback() {
|
|
28
|
-
|
|
28
|
+
if (devFlags.debug)
|
|
29
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
29
30
|
this.#afterTabRevealDelay.cancel();
|
|
30
31
|
this.#cssStyleObserver?.disconnect();
|
|
31
32
|
CleanupRegistry.unregister(this);
|
|
@@ -37,7 +38,8 @@ export class TabView extends HTMLElement {
|
|
|
37
38
|
return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
|
|
38
39
|
}
|
|
39
40
|
connectedCallback() {
|
|
40
|
-
|
|
41
|
+
if (devFlags.debug)
|
|
42
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
41
43
|
this.#cssStyleObserver = new CSSStyleObserver({
|
|
42
44
|
properties: ['--adaptable-tab-bar-placement-index'],
|
|
43
45
|
});
|
|
@@ -91,11 +93,13 @@ export class TabView extends HTMLElement {
|
|
|
91
93
|
this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
|
|
92
94
|
};
|
|
93
95
|
#handleTabViewPagereveal = (evt) => {
|
|
94
|
-
|
|
96
|
+
if (devFlags.debug)
|
|
97
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
95
98
|
void this.#syncBodyFace();
|
|
96
99
|
};
|
|
97
100
|
#handleStyleChange = () => {
|
|
98
|
-
|
|
101
|
+
if (devFlags.debug)
|
|
102
|
+
console.debug(`${_a.name} ⚡️ style`);
|
|
99
103
|
const style = self.getComputedStyle(this);
|
|
100
104
|
const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
|
|
101
105
|
newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
|
|
@@ -110,7 +114,7 @@ export class TabView extends HTMLElement {
|
|
|
110
114
|
}
|
|
111
115
|
};
|
|
112
116
|
// #handleMediaChange: (evt: MediaQueryListEvent) => void = (evt) => {
|
|
113
|
-
// debug(`${TabView.name} ⚡️ ${evt?.type}`)
|
|
117
|
+
// if (devFlags.debug) console.debug(`${TabView.name} ⚡️ ${evt?.type}`)
|
|
114
118
|
// if (!evt.matches) return
|
|
115
119
|
// this.#handleStyleChange()
|
|
116
120
|
// // if (evt.matches) {
|
|
@@ -161,7 +165,8 @@ export class TabView extends HTMLElement {
|
|
|
161
165
|
// // }
|
|
162
166
|
// }
|
|
163
167
|
#handleAdaptableTabBarPlacementChange = (evt) => {
|
|
164
|
-
|
|
168
|
+
if (devFlags.debug)
|
|
169
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
165
170
|
if ('bottom-bar' !== evt.detail.oldValue)
|
|
166
171
|
return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
|
|
167
172
|
const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
|
|
@@ -230,7 +235,8 @@ export class TabView extends HTMLElement {
|
|
|
230
235
|
#triggerToggleEvent = (evt) => {
|
|
231
236
|
const eventType = 'tab-view:toggle';
|
|
232
237
|
void this.#syncBodyFace();
|
|
233
|
-
|
|
238
|
+
if (devFlags.debug)
|
|
239
|
+
console.debug(`${_a.name} 💡 ${eventType}`);
|
|
234
240
|
this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
|
|
235
241
|
};
|
|
236
242
|
#syncBodyFace = async () => {
|
|
@@ -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 { $, devFlags, listActive, onoff } from '../internal/utils';
|
|
6
6
|
import { Snapshot } from '../snapshot';
|
|
7
7
|
export class TableView extends HTMLElement {
|
|
8
8
|
#styleObserver;
|
|
@@ -82,14 +82,16 @@ export class TableView extends HTMLElement {
|
|
|
82
82
|
// )
|
|
83
83
|
}
|
|
84
84
|
disconnectedCallback() {
|
|
85
|
-
|
|
85
|
+
if (devFlags.debug)
|
|
86
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
86
87
|
CleanupRegistry.unregister(this);
|
|
87
88
|
this.#styleObserver?.disconnect();
|
|
88
89
|
this.#observers.unobserveAll();
|
|
89
90
|
this.#compactToolbarItem = undefined;
|
|
90
91
|
}
|
|
91
92
|
connectedCallback() {
|
|
92
|
-
|
|
93
|
+
if (devFlags.debug)
|
|
94
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
93
95
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
94
96
|
// console.log(999, this.#shadowRoot.querySelector('[part*=table-column-stack]'))
|
|
95
97
|
this.#styleObserver = new CSSStyleObserver({
|
|
@@ -102,7 +104,8 @@ export class TableView extends HTMLElement {
|
|
|
102
104
|
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
|
|
103
105
|
}
|
|
104
106
|
#handleColumnSlotchange = ({ type, target: slot }) => {
|
|
105
|
-
|
|
107
|
+
if (devFlags.debug)
|
|
108
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
106
109
|
if (!(slot instanceof HTMLSlotElement && slot))
|
|
107
110
|
return;
|
|
108
111
|
const assigned = slot.assignedElements();
|
|
@@ -111,7 +114,8 @@ export class TableView extends HTMLElement {
|
|
|
111
114
|
this.#renderColumns([]);
|
|
112
115
|
};
|
|
113
116
|
#renderColumns = (entries) => {
|
|
114
|
-
|
|
117
|
+
if (devFlags.debug)
|
|
118
|
+
console.debug(`${_a.name} ⚡️ mutation`);
|
|
115
119
|
if (!this.#compactToolbarItem) {
|
|
116
120
|
this.#compactToolbarItem = $(`<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
|
|
117
121
|
CleanupRegistry.unregister(this, 'compact_toolbar');
|
|
@@ -134,7 +138,8 @@ export class TableView extends HTMLElement {
|
|
|
134
138
|
};
|
|
135
139
|
#observers = new MutationObserverSet(this.#renderColumns);
|
|
136
140
|
#handleStyleChange = () => {
|
|
137
|
-
|
|
141
|
+
if (devFlags.debug)
|
|
142
|
+
console.debug(`${_a.name} ⚡️ style`);
|
|
138
143
|
const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
|
|
139
144
|
if (!target)
|
|
140
145
|
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, devFlags, kebabCase, onoff, set } from '../internal/utils';
|
|
7
7
|
const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
|
|
8
8
|
/**
|
|
9
9
|
* @slot label
|
|
@@ -27,7 +27,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
27
27
|
</label>`));
|
|
28
28
|
}
|
|
29
29
|
#renderValidityMsgs = (entries) => {
|
|
30
|
-
|
|
30
|
+
if (devFlags.debug)
|
|
31
|
+
console.debug(`${_a.name} ⚡️ mutation`);
|
|
31
32
|
this.setValidity(this.validity, this.validationMessage);
|
|
32
33
|
};
|
|
33
34
|
#shadowRoot;
|
|
@@ -76,7 +77,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
76
77
|
this.#validityObservers.unobserveAll();
|
|
77
78
|
}
|
|
78
79
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
79
|
-
|
|
80
|
+
if (devFlags.debug)
|
|
81
|
+
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
80
82
|
switch (name) {
|
|
81
83
|
case 'keyboard-type':
|
|
82
84
|
switch (newValue) {
|
|
@@ -124,7 +126,7 @@ export class TextField extends FormAssociatedBase {
|
|
|
124
126
|
break;
|
|
125
127
|
case 'text':
|
|
126
128
|
// if (this.#input) this.#input.value = newValue ?? ''
|
|
127
|
-
this.text = newValue ?? ''
|
|
129
|
+
// nothing happens //this.text = newValue ?? ''
|
|
128
130
|
break;
|
|
129
131
|
case 'required':
|
|
130
132
|
this.#input?.setAttribute(name, newValue ?? ''); // else this.#input?.removeAttribute(name)
|
|
@@ -147,14 +149,15 @@ export class TextField extends FormAssociatedBase {
|
|
|
147
149
|
this.#sendValueToForm();
|
|
148
150
|
break;
|
|
149
151
|
case 'label':
|
|
150
|
-
let label = this.querySelector(':scope>[slot=label]');
|
|
152
|
+
let label = this.querySelector(':scope>label-view[slot=label]');
|
|
151
153
|
if (newValue) {
|
|
152
|
-
label ??= this.appendChild($(`<
|
|
153
|
-
label.
|
|
154
|
+
label ??= this.appendChild($(`<label-view slot="label"></label-view>`, '>1'));
|
|
155
|
+
label.setAttribute('foreground', 'secondary');
|
|
156
|
+
label.setAttribute('title', newValue);
|
|
154
157
|
}
|
|
155
158
|
else
|
|
156
159
|
label?.remove();
|
|
157
|
-
this.#sendValueToForm()
|
|
160
|
+
// this.#sendValueToForm()
|
|
158
161
|
break;
|
|
159
162
|
case 'disabled':
|
|
160
163
|
for (const el of this.#shadowRoot.querySelectorAll('input'))
|
|
@@ -197,7 +200,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
202
|
#handleValiditiesSlotchange = ({ type, target: slot }) => {
|
|
200
|
-
|
|
203
|
+
if (devFlags.debug)
|
|
204
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
201
205
|
if (!(slot instanceof HTMLSlotElement && slot))
|
|
202
206
|
return;
|
|
203
207
|
const assigned = slot.assignedElements();
|
|
@@ -206,7 +210,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
206
210
|
this.#renderValidityMsgs([]);
|
|
207
211
|
};
|
|
208
212
|
#handleFocusin = (evt) => {
|
|
209
|
-
|
|
213
|
+
if (devFlags.debug)
|
|
214
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
210
215
|
if (evt.target === this)
|
|
211
216
|
this.#input?.focus();
|
|
212
217
|
};
|
|
@@ -237,7 +242,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
237
242
|
this.dispatchEvent(new CustomEvent('commit', { detail: { text: this.text }, bubbles: true, composed: true }));
|
|
238
243
|
};
|
|
239
244
|
#handleInputPaste = (evt) => {
|
|
240
|
-
|
|
245
|
+
if (devFlags.debug)
|
|
246
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
241
247
|
const { target: input } = evt;
|
|
242
248
|
if (!(input instanceof HTMLInputElement && input))
|
|
243
249
|
return;
|
|
@@ -340,7 +346,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
340
346
|
}
|
|
341
347
|
};
|
|
342
348
|
#handleInputBeforeinput = (evt) => {
|
|
343
|
-
|
|
349
|
+
if (devFlags.debug)
|
|
350
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
344
351
|
const { target: input } = evt;
|
|
345
352
|
if (!(input instanceof HTMLInputElement && input))
|
|
346
353
|
return;
|
|
@@ -375,7 +382,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
375
382
|
}
|
|
376
383
|
};
|
|
377
384
|
#handleInputBlur = ({ type, target: input }) => {
|
|
378
|
-
|
|
385
|
+
if (devFlags.debug)
|
|
386
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
379
387
|
if (!(input instanceof HTMLInputElement && input))
|
|
380
388
|
return;
|
|
381
389
|
if (0 === input.value.length)
|
|
@@ -386,7 +394,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
386
394
|
this.#sendValueToForm();
|
|
387
395
|
};
|
|
388
396
|
#handleInputInput = (evt) => {
|
|
389
|
-
|
|
397
|
+
if (devFlags.debug)
|
|
398
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
390
399
|
this.#sendValueToForm();
|
|
391
400
|
};
|
|
392
401
|
// Optional: form participation properties
|
|
@@ -468,7 +477,8 @@ export class TextField extends FormAssociatedBase {
|
|
|
468
477
|
message = kebabCase(key);
|
|
469
478
|
break;
|
|
470
479
|
}
|
|
471
|
-
|
|
480
|
+
if (devFlags.debug)
|
|
481
|
+
console.debug(`${_a.name} ⚡️ validity-change`);
|
|
472
482
|
return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
|
|
473
483
|
};
|
|
474
484
|
setCustomValidity = (message) => {
|