@swiftwc/ui 0.0.0-dev.8 → 0.0.0-dev.81
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/buses/alert-dialog.d.ts +2 -0
- package/generated/buses/alert-dialog.js +1 -0
- package/generated/buses/confirmation-dialog.d.ts +2 -0
- package/generated/buses/confirmation-dialog.js +1 -0
- package/generated/buses/index.d.ts +6 -0
- package/generated/buses/index.js +6 -0
- package/generated/buses/lifecycle-observer.d.ts +2 -0
- package/generated/buses/lifecycle-observer.js +1 -0
- package/generated/client/index.d.ts +21 -10
- package/generated/client/index.js +177 -194
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +99 -0
- package/generated/components/body-view.js +5 -2
- package/generated/components/bordered-button.d.ts +10 -0
- package/generated/components/bordered-button.js +39 -3
- package/generated/components/bordered-prominent-button.d.ts +10 -0
- package/generated/components/bordered-prominent-button.js +39 -3
- package/generated/components/borderless-button.d.ts +9 -1
- package/generated/components/borderless-button.js +32 -11
- package/generated/components/color-scheme.d.ts +7 -0
- package/generated/components/color-scheme.js +54 -0
- package/generated/components/confirmation-dialog.d.ts +1 -1
- package/generated/components/confirmation-dialog.js +43 -32
- package/generated/components/content-unavailable-view.d.ts +24 -0
- package/generated/components/content-unavailable-view.js +81 -0
- package/generated/components/date-picker.d.ts +2 -12
- package/generated/components/date-picker.js +96 -65
- package/generated/components/disclosure-group.d.ts +5 -0
- package/generated/components/disclosure-group.js +18 -7
- package/generated/components/fine-tooltip.d.ts +7 -0
- package/generated/components/fine-tooltip.js +107 -0
- package/generated/components/form-view.d.ts +3 -0
- package/generated/components/form-view.js +8 -3
- package/generated/components/glass-button.d.ts +10 -0
- package/generated/components/glass-button.js +39 -3
- package/generated/components/glass-prominent-button.d.ts +10 -0
- package/generated/components/glass-prominent-button.js +39 -3
- package/generated/components/h-stack.d.ts +14 -0
- package/generated/components/h-stack.js +23 -0
- package/generated/components/image-view.d.ts +9 -0
- package/generated/components/image-view.js +64 -0
- package/generated/components/index.d.ts +11 -3
- package/generated/components/index.js +11 -3
- package/generated/components/label-view.d.ts +6 -1
- package/generated/components/label-view.js +40 -60
- package/generated/components/labeled-content.d.ts +9 -0
- package/generated/components/labeled-content.js +116 -0
- package/generated/components/list-view.d.ts +3 -0
- package/generated/components/list-view.js +20 -17
- package/generated/components/menu-view.d.ts +4 -1
- package/generated/components/menu-view.js +60 -51
- package/generated/components/navigation-large-title.js +9 -5
- package/generated/components/navigation-split-view.d.ts +4 -1
- package/generated/components/navigation-split-view.js +13 -6
- package/generated/components/navigation-stack.d.ts +4 -1
- package/generated/components/navigation-stack.js +16 -9
- package/generated/components/navigation-title.d.ts +1 -1
- package/generated/components/navigation-title.js +58 -55
- package/generated/components/picker-view.d.ts +32 -4
- package/generated/components/picker-view.js +924 -234
- package/generated/components/plain-button.js +5 -3
- package/generated/components/progress-view.d.ts +13 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.js +3 -1
- package/generated/components/scroll-view-proxy.d.ts +8 -0
- package/generated/components/scroll-view-proxy.js +17 -0
- package/generated/components/scroll-view.d.ts +1 -1
- package/generated/components/scroll-view.js +101 -85
- package/generated/components/search-view.d.ts +7 -0
- package/generated/components/search-view.js +30 -0
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +35 -30
- package/generated/components/sheet-view.d.ts +1 -2
- package/generated/components/sheet-view.js +32 -39
- package/generated/components/sidebar-toggle.js +44 -66
- package/generated/components/sidebar-view.js +13 -8
- package/generated/components/sticky-container.js +8 -4
- package/generated/components/tab-bar.d.ts +3 -0
- package/generated/components/tab-bar.js +20 -10
- package/generated/components/tab-item.js +24 -13
- package/generated/components/tab-view.js +25 -17
- package/generated/components/table-view.d.ts +5 -0
- package/generated/components/table-view.js +55 -77
- package/generated/components/text-field.d.ts +2 -2
- package/generated/components/text-field.js +95 -88
- package/generated/components/toggle-view.d.ts +28 -0
- package/generated/components/toggle-view.js +224 -0
- package/generated/components/tool-bar-item-group.js +21 -4
- package/generated/components/tool-bar-item.d.ts +4 -1
- package/generated/components/tool-bar-item.js +57 -10
- package/generated/components/tool-bar.d.ts +12 -0
- package/generated/components/tool-bar.js +27 -11
- package/generated/components/v-keyboard.d.ts +3 -1
- package/generated/components/v-keyboard.js +12 -6
- package/generated/components/v-stack.d.ts +12 -0
- package/generated/components/v-stack.js +17 -2
- package/generated/css/index.css +2533 -941
- package/generated/events/alert-dialog.d.ts +8 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +2 -2
- package/generated/events/index.d.ts +2 -0
- package/generated/events/index.js +2 -0
- package/generated/events/picker-view.d.ts +7 -0
- package/generated/events/scroll-view.js +4 -0
- package/generated/events/tab-view.d.ts +6 -2
- package/generated/events/text-field.js +3 -0
- package/generated/events/toggle-view.d.ts +9 -0
- package/generated/events/toggle-view.js +4 -0
- package/generated/i18n/index.d.ts +20 -10
- package/generated/i18n/index.js +82 -54
- package/generated/i18n/locales/el.d.ts +16 -0
- package/generated/i18n/locales/el.js +16 -0
- package/generated/i18n/locales/en.d.ts +16 -0
- package/generated/i18n/locales/en.js +16 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/generated/internal/class/css-style-observer.js +3 -2
- package/generated/internal/class/form-associated-base.d.ts +0 -4
- package/generated/internal/class/form-associated-base.js +23 -38
- package/generated/internal/class/mutation-observer-set.d.ts +9 -0
- package/generated/internal/class/mutation-observer-set.js +42 -0
- package/generated/internal/class/mutation-observer-singleton.js +18 -0
- package/generated/internal/class/navigation-view.d.ts +1 -1
- package/generated/internal/class/navigation-view.js +38 -43
- package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
- package/generated/internal/decorators/adaptive-slot.js +50 -0
- package/generated/internal/decorators/custom-element.d.ts +1 -1
- package/generated/internal/decorators/custom-element.js +2 -1
- package/generated/internal/decorators/index.d.ts +6 -0
- package/generated/internal/decorators/index.js +6 -0
- package/generated/internal/decorators/microtask-on-connected.d.ts +39 -0
- package/generated/internal/decorators/microtask-on-connected.js +67 -0
- package/generated/internal/privateNamespace.d.ts +10 -0
- package/generated/internal/privateNamespace.js +168 -1
- package/generated/internal/utils/cash/index.d.ts +4 -3
- package/generated/internal/utils/cash/index.js +6 -4
- package/generated/internal/utils/dev-flags.d.ts +3 -0
- package/generated/internal/utils/dev-flags.js +5 -0
- package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
- package/generated/internal/utils/ensure-placeholder.js +55 -0
- package/generated/internal/utils/index.d.ts +7 -2
- package/generated/internal/utils/index.js +9 -2
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/list-active.js +67 -12
- package/generated/internal/utils/render-label-icon.d.ts +2 -0
- package/generated/internal/utils/render-label-icon.js +19 -0
- package/generated/internal/utils/render-label-title.d.ts +2 -0
- package/generated/internal/utils/render-label-title.js +16 -0
- package/generated/internal/utils/render-label.d.ts +1 -0
- package/generated/internal/utils/render-label.js +19 -0
- package/generated/internal/utils/touch-glass.js +5 -5
- package/generated/namespace-browser/base.d.ts +12 -3
- package/generated/namespace-browser/base.js +41 -18
- package/generated/namespace-browser/event.d.ts +10 -0
- package/generated/namespace-browser/event.js +1 -0
- package/generated/snapshot/index.d.ts +3 -1
- package/generated/snapshot/index.js +25 -2
- package/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +3 -0
- package/generated/tpl/index.d.ts +4 -0
- package/generated/tpl/index.js +4 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +132 -0
- package/package.json +18 -4
- package/scss/_components.scss +14 -0
- package/scss/_functions.scss +10 -0
- package/scss/_mixins.scss +4 -0
- package/scss/_transitions.scss +6 -1
- package/scss/_vars.scss +9 -2
- package/scss/base/_layout.scss +17 -7
- package/scss/base/_reboot.scss +34 -1
- package/scss/base/_root.scss +117 -114
- package/scss/colors/_index.scss +304 -85
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_bordered-button.scss +35 -0
- package/scss/components/_bordered-prominent-button.scss +45 -0
- package/scss/components/_borderless-button.scss +25 -0
- package/scss/components/_confirmation-dialog.scss +41 -49
- package/scss/components/_content-unavailable-view.scss +56 -0
- package/scss/components/_date-picker.scss +15 -15
- package/scss/components/_detail-placeholder.scss +1 -3
- package/scss/components/_disclosure-group.scss +84 -33
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +58 -20
- package/scss/components/_glass-button.scss +35 -0
- package/scss/components/_glass-prominent-button.scss +46 -0
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +21 -15
- package/scss/components/_image-view.scss +20 -0
- package/scss/components/_index.scss +40 -20
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +94 -110
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +59 -1
- package/scss/components/_list-view.scss +65 -25
- package/scss/components/_menu-view.scss +95 -60
- package/scss/components/_navigation-large-title.scss +17 -0
- package/scss/components/_navigation-split-view.scss +3 -3
- package/scss/components/_picker-view.scss +259 -59
- package/scss/components/_plain-button.scss +7 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +22 -20
- package/scss/components/_scroll-view.scss +4 -0
- package/scss/components/_search-view.scss +22 -0
- package/scss/components/_section-view.scss +23 -22
- package/scss/components/_sheet-view.scss +16 -6
- package/scss/components/_sidebar-toggle.scss +1 -4
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +17 -3
- package/scss/components/_tab-view.scss +4 -2
- package/scss/components/_table-column.scss +2 -0
- package/scss/components/_table-row.scss +69 -1
- package/scss/components/_table-view.scss +22 -14
- package/scss/components/_text-field.scss +37 -17
- package/scss/components/_toggle-view.scss +112 -0
- package/scss/components/_tool-bar-item.scss +34 -82
- package/scss/components/_tool-bar.scss +77 -57
- package/scss/components/_v-stack.scss +9 -2
- package/scss/final/_touch-glass.scss +24 -0
- package/scss/mixins/_button.scss +44 -0
- package/scss/mixins/_color.scss +16 -0
- package/scss/mixins/_dialog.scss +1 -0
- package/scss/mixins/_index.scss +64 -2
- package/scss/placeholders/_buttons.scss +44 -10
- package/scss/placeholders/_lists.scss +133 -126
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_confirmation-dialog.scss +8 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_menu-view.scss +17 -15
- package/scss/transitions/_progress-view.scss +23 -0
- package/scss/transitions/_sheet-view.scss +30 -0
- package/scss/transitions/_tab-bar.scss +6 -5
- package/scss/utils/_frame.scss +42 -0
- package/scss/utils/_index.scss +67 -52
- package/scss/utils/_stacks.scss +56 -73
- package/web-components.html-data/en.json +623 -24
- package/generated/confirmation-dialog/index.d.ts +0 -1
- package/generated/confirmation-dialog/index.js +0 -1
- package/generated/lifecycle-observer/index.d.ts +0 -1
- package/generated/lifecycle-observer/index.js +0 -1
- package/scss/transitions/_dialog.scss +0 -28
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { $, onoff, touchGlass } from '../internal/utils';
|
|
3
|
+
import { $, devFlags, onoff, renderLabel, touchGlass } from '../internal/utils';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A control for presenting a menu of actions.
|
|
6
|
+
*/
|
|
4
7
|
export class MenuView extends HTMLElement {
|
|
5
8
|
static get observedAttributes() {
|
|
6
9
|
return ['open', 'closing', 'label'];
|
|
@@ -17,7 +20,7 @@ export class MenuView extends HTMLElement {
|
|
|
17
20
|
<slot></slot>
|
|
18
21
|
</div>
|
|
19
22
|
</form>
|
|
20
|
-
</dialog
|
|
23
|
+
</dialog>`));
|
|
21
24
|
}
|
|
22
25
|
#shadowRoot;
|
|
23
26
|
#dialog;
|
|
@@ -26,8 +29,42 @@ export class MenuView extends HTMLElement {
|
|
|
26
29
|
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
27
30
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
28
31
|
}
|
|
32
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
33
|
+
if (devFlags.debug)
|
|
34
|
+
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
35
|
+
switch (name) {
|
|
36
|
+
case 'open':
|
|
37
|
+
if (!this.#dialog)
|
|
38
|
+
break;
|
|
39
|
+
this.#dialog.inert = null === newValue;
|
|
40
|
+
if (null === newValue && this.#dialog.open) {
|
|
41
|
+
if (devFlags.debug)
|
|
42
|
+
console.debug(`${_a.name} ⚡️ will-close`);
|
|
43
|
+
this.setAttribute('closing', '');
|
|
44
|
+
Promise.allSettled(this.#dialog.getAnimations().map(({ finished }) => finished)).then(() => {
|
|
45
|
+
if (!this.hasAttribute('closing'))
|
|
46
|
+
return;
|
|
47
|
+
this.#dialog?.close();
|
|
48
|
+
this.removeAttribute('closing');
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if ('' === newValue && !this.#dialog.open) {
|
|
52
|
+
if (devFlags.debug)
|
|
53
|
+
console.debug(`${_a.name} ⚡️ will-open`);
|
|
54
|
+
this.removeAttribute('closing');
|
|
55
|
+
const form = this.#shadowRoot.querySelector('form');
|
|
56
|
+
form.scrollTop = 0;
|
|
57
|
+
this.#dialog.showModal();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'label':
|
|
61
|
+
renderLabel(':scope>[slot=label]', `<label-view slot="label"><span></span></label-view>`, this, newValue);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
29
65
|
disconnectedCallback() {
|
|
30
|
-
|
|
66
|
+
if (devFlags.debug)
|
|
67
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
31
68
|
// const dialog = this.#shadowRoot.querySelector('dialog'),
|
|
32
69
|
// trigger = this.#shadowRoot.querySelector('button')
|
|
33
70
|
// trigger?.removeEventListener('click', this.#handleTriggerClick)
|
|
@@ -40,7 +77,8 @@ export class MenuView extends HTMLElement {
|
|
|
40
77
|
CleanupRegistry.unregister(this);
|
|
41
78
|
}
|
|
42
79
|
connectedCallback() {
|
|
43
|
-
|
|
80
|
+
if (devFlags.debug)
|
|
81
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
44
82
|
this.#dialog = this.#shadowRoot.querySelector('dialog') ?? undefined;
|
|
45
83
|
const trigger = this.#shadowRoot.querySelector('button') ?? undefined;
|
|
46
84
|
CleanupRegistry.register(this, onoff('click', this.#handleTriggerClick, trigger).on());
|
|
@@ -49,10 +87,12 @@ export class MenuView extends HTMLElement {
|
|
|
49
87
|
{ types: 'close', listener: this.#handleDialogClose },
|
|
50
88
|
{ types: 'cancel', listener: this.#handleDialogCancel },
|
|
51
89
|
], this.#dialog).on());
|
|
52
|
-
CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t, (
|
|
53
|
-
if (
|
|
90
|
+
CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t, ({ target }) => {
|
|
91
|
+
if (!(target instanceof HTMLElement))
|
|
92
|
+
return true;
|
|
93
|
+
if (target.matches('menu-view'))
|
|
54
94
|
return false;
|
|
55
|
-
if (!
|
|
95
|
+
if (!target.closest('menu-view[open]'))
|
|
56
96
|
return false;
|
|
57
97
|
return true;
|
|
58
98
|
}), this).on());
|
|
@@ -61,72 +101,41 @@ export class MenuView extends HTMLElement {
|
|
|
61
101
|
summaryPart?.style.setProperty('anchor-name', newAnchorName, 'important'); // override unset:all // $.prop('anchor-name', newAnchorName, summaryPart, 'important') //
|
|
62
102
|
dialogPart?.style.setProperty('position-anchor', newAnchorName); // $.prop('position-anchor', newAnchorName, dialogPart) //
|
|
63
103
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.#dialog.inert = null === newValue;
|
|
71
|
-
if (null === newValue && this.#dialog.open) {
|
|
72
|
-
console.debug(`${_a.name} ⚡️ will-close`);
|
|
73
|
-
this.setAttribute('closing', '');
|
|
74
|
-
Promise.allSettled(this.#dialog.getAnimations().map(({ finished }) => finished)).then(() => {
|
|
75
|
-
if (!this.hasAttribute('closing'))
|
|
76
|
-
return;
|
|
77
|
-
this.#dialog?.close();
|
|
78
|
-
this.removeAttribute('closing');
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
if ('' === newValue && !this.#dialog.open) {
|
|
82
|
-
console.debug(`${_a.name} ⚡️ will-open`);
|
|
83
|
-
this.removeAttribute('closing');
|
|
84
|
-
const form = this.#shadowRoot.querySelector('form');
|
|
85
|
-
form.scrollTop = 0;
|
|
86
|
-
this.#dialog.showModal();
|
|
87
|
-
}
|
|
88
|
-
break;
|
|
89
|
-
case 'label':
|
|
90
|
-
let label = this.querySelector(':scope>[slot=label]');
|
|
91
|
-
if (newValue) {
|
|
92
|
-
label ??= this.appendChild($(`<label-view slot="label"></label-view>`));
|
|
93
|
-
label.setAttribute('title', newValue);
|
|
94
|
-
}
|
|
95
|
-
else
|
|
96
|
-
label?.remove();
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
#handleDialogClick = (evt) => {
|
|
101
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
102
|
-
if (evt.target.matches('dialog'))
|
|
104
|
+
#handleDialogClick = ({ type, target }) => {
|
|
105
|
+
if (devFlags.debug)
|
|
106
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
107
|
+
if (!(target instanceof HTMLElement))
|
|
108
|
+
return;
|
|
109
|
+
if (target.matches('dialog'))
|
|
103
110
|
return this.toggleAttribute('open', false); // click outside
|
|
104
|
-
const target = evt.target;
|
|
105
111
|
target.scrollIntoView({
|
|
106
112
|
behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
|
|
107
113
|
block: 'nearest',
|
|
108
114
|
inline: 'nearest',
|
|
109
115
|
});
|
|
110
|
-
if (!
|
|
116
|
+
if (!target.closest('button'))
|
|
111
117
|
return;
|
|
112
118
|
// TODO: Handle btns this.toggleAttribute('open', false)
|
|
113
119
|
this.toggleAttribute('open', false);
|
|
114
120
|
// event.stopPropagation() //NOTE: add this only if not nested, disposes all nicely if ommited
|
|
115
121
|
};
|
|
116
122
|
#handleTriggerClick = (evt) => {
|
|
117
|
-
|
|
123
|
+
if (devFlags.debug)
|
|
124
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
118
125
|
this.toggleAttribute('open', true);
|
|
119
126
|
};
|
|
120
127
|
// intercept to modify open attr
|
|
121
128
|
#handleDialogCancel = (evt) => {
|
|
122
|
-
|
|
129
|
+
if (devFlags.debug)
|
|
130
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
123
131
|
if (!evt.cancelable)
|
|
124
132
|
return;
|
|
125
133
|
evt.preventDefault();
|
|
126
134
|
this.toggleAttribute('open', false);
|
|
127
135
|
};
|
|
128
136
|
#handleDialogClose = (evt) => {
|
|
129
|
-
|
|
137
|
+
if (devFlags.debug)
|
|
138
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
130
139
|
this.toggleAttribute('open', this.#shadowRoot.querySelector('dialog')?.open ?? false);
|
|
131
140
|
};
|
|
132
141
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
|
-
import { add, frame, onoff, slowHideShow, timeout } from '../internal/utils';
|
|
4
|
+
import { add, devFlags, frame, onoff, slowHideShow, timeout } from '../internal/utils';
|
|
5
5
|
import { Snapshot } from '../snapshot';
|
|
6
6
|
const observing = new WeakSet();
|
|
7
7
|
function observeResizeEnd(el, callback, stableFrames = 4) {
|
|
@@ -76,13 +76,15 @@ export class NavigationLargeTitle extends HTMLElement {
|
|
|
76
76
|
super();
|
|
77
77
|
}
|
|
78
78
|
disconnectedCallback() {
|
|
79
|
-
|
|
79
|
+
if (devFlags.debug)
|
|
80
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
80
81
|
this.#clearScrollState();
|
|
81
82
|
this.#styleObserver?.disconnect();
|
|
82
83
|
CleanupRegistry.unregister(this);
|
|
83
84
|
}
|
|
84
85
|
connectedCallback() {
|
|
85
|
-
|
|
86
|
+
if (devFlags.debug)
|
|
87
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
86
88
|
const root = this.closest('scroll-view') ?? undefined;
|
|
87
89
|
if (!root)
|
|
88
90
|
return;
|
|
@@ -105,7 +107,8 @@ export class NavigationLargeTitle extends HTMLElement {
|
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
109
|
#handleStyleChange = () => {
|
|
108
|
-
|
|
110
|
+
if (devFlags.debug)
|
|
111
|
+
console.debug(`${_a.name} ⚡️ style`);
|
|
109
112
|
const root = this.closest('scroll-view') ?? undefined;
|
|
110
113
|
if (!root)
|
|
111
114
|
return;
|
|
@@ -150,7 +153,8 @@ export class NavigationLargeTitle extends HTMLElement {
|
|
|
150
153
|
// this.#applySlowness(root, isIntersecting)
|
|
151
154
|
// }
|
|
152
155
|
#handleIntersect = (entries, { root }) => {
|
|
153
|
-
|
|
156
|
+
if (devFlags.debug)
|
|
157
|
+
console.debug(`${_a.name} ⚡️ intersect (${entries?.at(0)?.isIntersecting})`);
|
|
154
158
|
if (!(root instanceof HTMLElement))
|
|
155
159
|
return;
|
|
156
160
|
for (const { isIntersecting } of entries)
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A view with two or three side-by-side sections, where what you choose in the left section changes what appears in the next section.
|
|
4
|
+
*/
|
|
2
5
|
export declare class NavigationSplitView extends NavigationView {
|
|
3
6
|
constructor();
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
4
8
|
disconnectedCallback(): void;
|
|
5
9
|
connectedCallback(): void;
|
|
6
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
7
10
|
}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
import { devFlags } from '../internal/utils';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A view with two or three side-by-side sections, where what you choose in the left section changes what appears in the next section.
|
|
5
|
+
*/
|
|
2
6
|
export class NavigationSplitView extends NavigationView {
|
|
3
7
|
constructor() {
|
|
4
8
|
super();
|
|
5
9
|
}
|
|
10
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
11
|
+
if (devFlags.debug)
|
|
12
|
+
console.debug(`${NavigationSplitView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
13
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
14
|
+
}
|
|
6
15
|
disconnectedCallback() {
|
|
7
|
-
|
|
16
|
+
if (devFlags.debug)
|
|
17
|
+
console.debug(`${NavigationSplitView.name} ⚡️ disconnect`);
|
|
8
18
|
super.disconnectedCallback();
|
|
9
19
|
}
|
|
10
20
|
connectedCallback() {
|
|
11
|
-
|
|
21
|
+
if (devFlags.debug)
|
|
22
|
+
console.debug(`${NavigationSplitView.name} ⚡️ connect`);
|
|
12
23
|
super.connectedCallback();
|
|
13
24
|
}
|
|
14
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
15
|
-
console.debug(`${NavigationSplitView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
16
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
17
|
-
}
|
|
18
25
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A view that shows a main screen and lets you open other screens on top of it.
|
|
4
|
+
*/
|
|
2
5
|
export declare class NavigationStack extends NavigationView {
|
|
3
6
|
constructor();
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
4
8
|
disconnectedCallback(): void;
|
|
5
9
|
connectedCallback(): void;
|
|
6
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
7
10
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
import { devFlags } from '../internal/utils';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A view that shows a main screen and lets you open other screens on top of it.
|
|
5
|
+
*/
|
|
2
6
|
export class NavigationStack extends NavigationView {
|
|
3
7
|
constructor() {
|
|
4
8
|
super();
|
|
5
9
|
}
|
|
6
|
-
disconnectedCallback() {
|
|
7
|
-
console.debug(`${NavigationStack.name} ⚡️ disconnect`);
|
|
8
|
-
super.disconnectedCallback();
|
|
9
|
-
}
|
|
10
|
-
connectedCallback() {
|
|
11
|
-
console.debug(`${NavigationStack.name} ⚡️ connect`);
|
|
12
|
-
super.connectedCallback();
|
|
13
|
-
}
|
|
14
10
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
15
|
-
|
|
11
|
+
if (devFlags.debug)
|
|
12
|
+
console.debug(`${NavigationStack.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
16
13
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
17
14
|
// Snapshot.waitReady.then(() => {
|
|
18
15
|
switch (name) {
|
|
@@ -21,4 +18,14 @@ export class NavigationStack extends NavigationView {
|
|
|
21
18
|
}
|
|
22
19
|
// })
|
|
23
20
|
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
if (devFlags.debug)
|
|
23
|
+
console.debug(`${NavigationStack.name} ⚡️ disconnect`);
|
|
24
|
+
super.disconnectedCallback();
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
if (devFlags.debug)
|
|
28
|
+
console.debug(`${NavigationStack.name} ⚡️ connect`);
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
}
|
|
24
31
|
}
|
|
@@ -2,7 +2,7 @@ export declare class NavigationTitle extends HTMLElement {
|
|
|
2
2
|
#private;
|
|
3
3
|
static get observedAttributes(): string[];
|
|
4
4
|
constructor();
|
|
5
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
5
6
|
disconnectedCallback(): void;
|
|
6
7
|
connectedCallback(): void;
|
|
7
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
8
8
|
}
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var NavigationTitle_1;
|
|
8
|
+
import { microtaskOnConnected } from '../internal/decorators';
|
|
9
|
+
import { devFlags } from '../internal/utils';
|
|
10
|
+
import { html, render } from '../tpl';
|
|
11
|
+
let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElement {
|
|
3
12
|
static get observedAttributes() {
|
|
4
|
-
return ['value', 'subtitle'];
|
|
13
|
+
return ['value', 'subtitle', 'system-image', 'system-image-weight'];
|
|
5
14
|
}
|
|
6
15
|
constructor() {
|
|
7
16
|
super();
|
|
8
17
|
}
|
|
18
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
19
|
+
if (devFlags.debug)
|
|
20
|
+
console.debug(`${NavigationTitle_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
21
|
+
this.#render(this.getAttribute('value'), this.getAttribute('subtitle'), this.getAttribute('system-image'), this.getAttribute('system-image-weight'));
|
|
22
|
+
}
|
|
9
23
|
disconnectedCallback() {
|
|
10
|
-
|
|
24
|
+
if (devFlags.debug)
|
|
25
|
+
console.debug(`${NavigationTitle_1.name} ⚡️ disconnect`);
|
|
11
26
|
}
|
|
12
27
|
connectedCallback() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
16
|
-
console.debug(`${NavigationTitle.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
17
|
-
const sibling = this.closest('scroll-view') ?? undefined;
|
|
18
|
-
switch (name) {
|
|
19
|
-
case 'value':
|
|
20
|
-
if (null === newValue)
|
|
21
|
-
sibling?.removeAttribute('navigation-inline-title');
|
|
22
|
-
else
|
|
23
|
-
sibling?.setAttribute('navigation-inline-title', newValue);
|
|
24
|
-
this.#render(newValue, this.getAttribute('subtitle'));
|
|
25
|
-
break;
|
|
26
|
-
case 'subtitle':
|
|
27
|
-
if (null === newValue)
|
|
28
|
-
sibling?.removeAttribute('navigation-inline-subtitle');
|
|
29
|
-
else
|
|
30
|
-
sibling?.setAttribute('navigation-inline-subtitle', newValue);
|
|
31
|
-
this.#render(this.getAttribute('value'), newValue);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
28
|
+
if (devFlags.debug)
|
|
29
|
+
console.debug(`${NavigationTitle_1.name} ⚡️ connect`);
|
|
34
30
|
}
|
|
35
|
-
#render = (title, subtitle) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
#render = (title, subtitle, systemImage, systemImageWeight) => {
|
|
32
|
+
const template = html `
|
|
33
|
+
<v-stack alignment="fill">
|
|
34
|
+
${systemImage ? html `<image-view system-name="${systemImage}" system-weight="${systemImageWeight}" foreground="blue"></image-view>` : null}
|
|
35
|
+
<v-stack spacing="0" alignment="fill">
|
|
36
|
+
<label-view line-limit="1" truncation-mode="tail" font="headline">
|
|
37
|
+
<span>${title ?? ''}</span>
|
|
38
|
+
</label-view>
|
|
39
|
+
<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout">
|
|
40
|
+
<span>${subtitle ?? ''}</span>
|
|
41
|
+
</label-view>
|
|
42
|
+
</v-stack>
|
|
43
|
+
</v-stack>
|
|
44
|
+
`;
|
|
45
|
+
const container = this.querySelector(':scope>:not([slot])') ?? this.appendChild(document.createElement('navigation-large-title'));
|
|
46
|
+
render(template, container);
|
|
47
|
+
// const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`,
|
|
48
|
+
// subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`,
|
|
49
|
+
// vStactTemplate = `<v-stack spacing="0" alignment="fill">${titleTemplate}${subtitleTemplate}</v-stack>`
|
|
50
|
+
// const el = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<navigation-large-title>${vStactTemplate}</navigation-large-title>`, '>1')),
|
|
51
|
+
// vStack = el.querySelector(':scope>v-stack') ?? el.appendChild($(vStactTemplate, '>1'))
|
|
52
|
+
// renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title)
|
|
53
|
+
// renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle)
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
NavigationTitle = NavigationTitle_1 = __decorate([
|
|
57
|
+
microtaskOnConnected((el) => {
|
|
58
|
+
const sibling = el.closest('scroll-view'), value = el.getAttribute('value'), subtitle = el.getAttribute('subtitle');
|
|
59
|
+
if (null === value)
|
|
60
|
+
sibling?.removeAttribute('navigation-inline-title');
|
|
44
61
|
else
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
subtitleLabel ??= vStack.appendChild($(`<label-view line-limit="1" truncation-mode="tail" font="callout"></label-view>`));
|
|
49
|
-
subtitleLabel.setAttribute('title', subtitle);
|
|
50
|
-
}
|
|
62
|
+
sibling?.setAttribute('navigation-inline-title', value);
|
|
63
|
+
if (null === subtitle)
|
|
64
|
+
sibling?.removeAttribute('navigation-inline-subtitle');
|
|
51
65
|
else
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// innerHTML: `<navigation-large-title><v-stack spacing="0" alignment="fill" slot="top-bar-principal"><label-view line-limit="1" truncation-mode="tail" font="headline"></label-view><label-view line-limit="1" truncation-mode="tail" font="callout"></label-view></v-stack></navigation-large-title>`,
|
|
57
|
-
// }).content.firstElementChild!
|
|
58
|
-
// ),
|
|
59
|
-
// titleLabel = el.querySelector('label-view:nth-child(1)'),
|
|
60
|
-
// subtitleLabel = el.querySelector('label-view:nth-child(2)')
|
|
61
|
-
// if (title) titleLabel?.setAttribute('label', title)
|
|
62
|
-
// else titleLabel?.remove()
|
|
63
|
-
// if (subtitle) subtitleLabel?.setAttribute('label', subtitle)
|
|
64
|
-
// else subtitleLabel?.remove()
|
|
65
|
-
};
|
|
66
|
-
}
|
|
66
|
+
sibling?.setAttribute('navigation-inline-subtitle', subtitle);
|
|
67
|
+
})
|
|
68
|
+
], NavigationTitle);
|
|
69
|
+
export { NavigationTitle };
|
|
@@ -1,22 +1,50 @@
|
|
|
1
1
|
import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
2
|
-
declare const pickerStyles: readonly ["menu", "inline", "automatic"];
|
|
2
|
+
declare const pickerStyles: readonly ["menu", "inline", "navigation-link", "sheet", "automatic"];
|
|
3
3
|
export type PickerStyle = (typeof pickerStyles)[number];
|
|
4
|
+
export type DictEntry = {
|
|
5
|
+
value: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
systemImage?: string;
|
|
9
|
+
children: DictEntry[];
|
|
10
|
+
};
|
|
11
|
+
export type Dictionary = DictEntry[];
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @attr {menu|inline|navigation-link|sheet|automatic} picker-style
|
|
15
|
+
*
|
|
16
|
+
* @attr {string} help - Adds a help tooltip to the trigger of the picker, if style supports one
|
|
17
|
+
*
|
|
18
|
+
* @attr {DictEntry[]} dictionary - Renders all options using this array
|
|
19
|
+
*
|
|
20
|
+
* @attr {vertical|horizontal|auto} label-value-placement
|
|
21
|
+
*
|
|
22
|
+
* @slot list
|
|
23
|
+
*/
|
|
4
24
|
export declare class PickerView extends FormAssociatedBase {
|
|
5
25
|
#private;
|
|
6
26
|
static get ATTR(): {
|
|
7
27
|
PLACEHOLDER: string;
|
|
28
|
+
PLACEHOLDER_ICON: string;
|
|
8
29
|
LABEL: string;
|
|
9
30
|
PICKER_STYLE: string;
|
|
10
31
|
SELECTION: string;
|
|
32
|
+
SEARCHABLE: string;
|
|
33
|
+
CURRENT_VALUE_LABEL: string;
|
|
34
|
+
CURRENT_VALUE_ICON: string;
|
|
35
|
+
TRIGGER_HELP: string;
|
|
36
|
+
DICTIONARY: string;
|
|
37
|
+
REQUIRED: string;
|
|
11
38
|
};
|
|
12
39
|
static get observedAttributes(): string[];
|
|
40
|
+
get selection(): string;
|
|
41
|
+
set selection(v: string);
|
|
13
42
|
get template(): DocumentFragment;
|
|
14
43
|
constructor();
|
|
15
|
-
connectedCallback(): void;
|
|
16
|
-
disconnectedCallback(): void;
|
|
17
44
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
45
|
+
disconnectedCallback(): void;
|
|
46
|
+
connectedCallback(): void;
|
|
18
47
|
get pickerStyle(): PickerStyle;
|
|
19
|
-
static wrapTag(node: Element, slotName?: string): Element;
|
|
20
48
|
get name(): string;
|
|
21
49
|
setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
|
|
22
50
|
setCustomValidity: (message: string) => void;
|