@swiftwc/ui 1.0.0-canary.0 → 1.0.0-canary.2
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 +30 -0
- package/generated/client/index.js +278 -0
- package/generated/components/alert-dialog.d.ts +11 -0
- package/generated/components/alert-dialog.js +94 -0
- package/generated/components/bordered-button.d.ts +17 -0
- package/generated/components/bordered-button.js +53 -0
- package/generated/components/bordered-prominent-button.d.ts +17 -0
- package/generated/components/bordered-prominent-button.js +53 -0
- package/generated/components/borderless-button.d.ts +17 -0
- package/generated/components/borderless-button.js +53 -0
- package/generated/components/color-scheme.d.ts +12 -0
- package/generated/components/color-scheme.js +51 -0
- package/generated/components/confirmation-dialog.d.ts +12 -0
- package/generated/components/confirmation-dialog.js +108 -0
- package/generated/components/content-unavailable.d.ts +30 -0
- package/generated/components/content-unavailable.js +79 -0
- package/generated/components/content-view.d.ts +13 -0
- package/generated/components/content-view.js +15 -0
- package/generated/components/date-picker.d.ts +52 -0
- package/generated/components/date-picker.js +468 -0
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- package/generated/components/disclosure-group.d.ts +17 -0
- package/generated/components/disclosure-group.js +62 -0
- package/generated/components/fine-tooltip.d.ts +15 -0
- package/generated/components/fine-tooltip.js +108 -0
- package/generated/components/form-view.d.ts +16 -0
- package/generated/components/form-view.js +63 -0
- package/generated/components/glass-button.d.ts +16 -0
- package/generated/components/glass-button.js +50 -0
- package/generated/components/glass-prominent-button.d.ts +16 -0
- package/generated/components/glass-prominent-button.js +50 -0
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-flex-stack.d.ts +16 -0
- package/generated/components/h-flex-stack.js +18 -0
- package/generated/components/h-stack.d.ts +22 -0
- package/generated/components/h-stack.js +24 -0
- package/generated/components/image-view.d.ts +18 -0
- package/generated/components/image-view.js +65 -0
- package/generated/components/index.d.ts +53 -0
- package/generated/components/index.js +53 -0
- package/generated/components/label-view.d.ts +27 -0
- package/generated/components/label-view.js +84 -0
- package/generated/components/labeled-content.d.ts +33 -0
- package/generated/components/labeled-content.js +160 -0
- package/generated/components/list-view.d.ts +19 -0
- package/generated/components/list-view.js +24 -0
- package/generated/components/menu-view.d.ts +20 -0
- package/generated/components/menu-view.js +131 -0
- package/generated/components/navigation-large-title.d.ts +17 -0
- package/generated/components/navigation-large-title.js +183 -0
- package/generated/components/navigation-split-view.d.ts +15 -0
- package/generated/components/navigation-split-view.js +22 -0
- package/generated/components/navigation-stack.d.ts +15 -0
- package/generated/components/navigation-stack.js +26 -0
- package/generated/components/navigation-title.d.ts +18 -0
- package/generated/components/navigation-title.js +69 -0
- package/generated/components/picker-view.d.ts +51 -0
- package/generated/components/picker-view.js +1201 -0
- package/generated/components/plain-button.d.ts +7 -0
- package/generated/components/plain-button.js +20 -0
- package/generated/components/progress-view.d.ts +20 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.d.ts +5 -0
- package/generated/components/screen-view.js +10 -0
- package/generated/components/scroll-view-proxy.d.ts +13 -0
- package/generated/components/scroll-view-proxy.js +15 -0
- package/generated/components/scroll-view.d.ts +22 -0
- package/generated/components/scroll-view.js +230 -0
- package/generated/components/search-view.d.ts +12 -0
- package/generated/components/search-view.js +24 -0
- package/generated/components/section-view.d.ts +21 -0
- package/generated/components/section-view.js +61 -0
- package/generated/components/sheet-view.d.ts +11 -0
- package/generated/components/sheet-view.js +40 -0
- package/generated/components/sidebar-toggle.d.ts +15 -0
- package/generated/components/sidebar-toggle.js +84 -0
- package/generated/components/sidebar-view.d.ts +10 -0
- package/generated/components/sidebar-view.js +36 -0
- package/generated/components/sticky-container.d.ts +11 -0
- package/generated/components/sticky-container.js +24 -0
- package/generated/components/tab-bar.d.ts +10 -0
- package/generated/components/tab-bar.js +37 -0
- package/generated/components/tab-item.d.ts +10 -0
- package/generated/components/tab-item.js +127 -0
- package/generated/components/tab-view.d.ts +31 -0
- package/generated/components/tab-view.js +194 -0
- package/generated/components/table-view.d.ts +26 -0
- package/generated/components/table-view.js +156 -0
- package/generated/components/text-field.d.ts +42 -0
- package/generated/components/text-field.js +517 -0
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +43 -0
- package/generated/components/toggle-view.js +366 -0
- package/generated/components/tool-bar-item-group.d.ts +13 -0
- package/generated/components/tool-bar-item-group.js +29 -0
- package/generated/components/tool-bar-item.d.ts +16 -0
- package/generated/components/tool-bar-item.js +66 -0
- package/generated/components/tool-bar.d.ts +26 -0
- package/generated/components/tool-bar.js +92 -0
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-flex-stack.d.ts +16 -0
- package/generated/components/v-flex-stack.js +18 -0
- package/generated/components/v-keyboard.d.ts +20 -0
- package/generated/components/v-keyboard.js +85 -0
- package/generated/components/v-stack.d.ts +25 -0
- package/generated/components/v-stack.js +27 -0
- package/generated/css/index.css +10964 -0
- package/generated/events/alert-dialog.d.ts +13 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +14 -0
- package/generated/events/confirmation-dialog.js +1 -0
- package/generated/events/date-picker.d.ts +13 -0
- package/generated/events/date-picker.js +1 -0
- package/generated/events/index.d.ts +9 -0
- package/generated/events/index.js +9 -0
- package/generated/events/lifecycle-observer.d.ts +18 -0
- package/generated/events/lifecycle-observer.js +1 -0
- package/generated/events/picker-view.d.ts +29 -0
- package/generated/events/picker-view.js +1 -0
- package/generated/events/scroll-view.d.ts +18 -0
- package/generated/events/scroll-view.js +1 -0
- package/generated/events/tab-view.d.ts +54 -0
- package/generated/events/tab-view.js +1 -0
- package/generated/events/text-field.d.ts +13 -0
- package/generated/events/text-field.js +1 -0
- package/generated/events/toggle-view.d.ts +14 -0
- package/generated/events/toggle-view.js +1 -0
- package/generated/i18n/index.d.ts +33 -0
- package/generated/i18n/index.js +164 -0
- 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/index.d.ts +2 -0
- package/generated/index.js +3 -0
- package/generated/internal/class/cleanup-registry.d.ts +5 -0
- package/generated/internal/class/cleanup-registry.js +38 -0
- package/generated/internal/class/css-style-observer.d.ts +8 -0
- package/generated/internal/class/css-style-observer.js +25 -0
- package/generated/internal/class/form-associated-base.d.ts +16 -0
- package/generated/internal/class/form-associated-base.js +76 -0
- 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.d.ts +10 -0
- package/generated/internal/class/mutation-observer-singleton.js +64 -0
- package/generated/internal/class/navigation-path.d.ts +15 -0
- package/generated/internal/class/navigation-path.js +84 -0
- package/generated/internal/class/navigation-view.d.ts +8 -0
- package/generated/internal/class/navigation-view.js +70 -0
- package/generated/internal/class/resize-observer-singleton.d.ts +7 -0
- package/generated/internal/class/resize-observer-singleton.js +22 -0
- package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
- package/generated/internal/decorators/adaptive-slot.js +47 -0
- package/generated/internal/decorators/custom-element.d.ts +5 -0
- package/generated/internal/decorators/custom-element.js +5 -0
- 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/dev-flags.d.ts +4 -0
- package/generated/internal/dev-flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +14 -0
- package/generated/internal/privateNamespace.js +159 -0
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/add.d.ts +1 -0
- package/generated/internal/utils/add.js +7 -0
- package/generated/internal/utils/ancestors.d.ts +1 -0
- package/generated/internal/utils/ancestors.js +27 -0
- package/generated/internal/utils/clamp.d.ts +1 -0
- package/generated/internal/utils/clamp.js +4 -0
- package/generated/internal/utils/compare-big-decimals.d.ts +1 -0
- package/generated/internal/utils/compare-big-decimals.js +80 -0
- package/generated/internal/utils/css-time.d.ts +1 -0
- package/generated/internal/utils/css-time.js +3 -0
- package/generated/internal/utils/debounce.d.ts +1 -0
- package/generated/internal/utils/debounce.js +13 -0
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/define-translations.d.ts +1 -0
- package/generated/internal/utils/define-translations.js +3 -0
- package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
- package/generated/internal/utils/ensure-placeholder.js +41 -0
- package/generated/internal/utils/frame.d.ts +1 -0
- package/generated/internal/utils/frame.js +6 -0
- package/generated/internal/utils/index.d.ts +54 -0
- package/generated/internal/utils/index.js +54 -0
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/kebab-case.d.ts +1 -0
- package/generated/internal/utils/kebab-case.js +8 -0
- package/generated/internal/utils/list-active.d.ts +7 -0
- package/generated/internal/utils/list-active.js +83 -0
- package/generated/internal/utils/microtask.d.ts +1 -0
- package/generated/internal/utils/microtask.js +3 -0
- package/generated/internal/utils/next-all.d.ts +1 -0
- package/generated/internal/utils/next-all.js +10 -0
- package/generated/internal/utils/next.d.ts +1 -0
- package/generated/internal/utils/next.js +9 -0
- package/generated/internal/utils/onoff.d.ts +45 -0
- package/generated/internal/utils/onoff.js +31 -0
- package/generated/internal/utils/prev-all.d.ts +1 -0
- package/generated/internal/utils/prev-all.js +10 -0
- package/generated/internal/utils/prev.d.ts +1 -0
- package/generated/internal/utils/prev.js +9 -0
- package/generated/internal/utils/prop.d.ts +18 -0
- package/generated/internal/utils/prop.js +30 -0
- package/generated/internal/utils/set.d.ts +1 -0
- package/generated/internal/utils/set.js +7 -0
- package/generated/internal/utils/siblings.d.ts +1 -0
- package/generated/internal/utils/siblings.js +10 -0
- package/generated/internal/utils/sleep.d.ts +1 -0
- package/generated/internal/utils/sleep.js +3 -0
- package/generated/internal/utils/slow-hide-show.d.ts +1 -0
- package/generated/internal/utils/slow-hide-show.js +16 -0
- package/generated/internal/utils/timeout.d.ts +5 -0
- package/generated/internal/utils/timeout.js +16 -0
- package/generated/internal/utils/touch-glass.d.ts +7 -0
- package/generated/internal/utils/touch-glass.js +19 -0
- package/generated/internal/vendor/morphdom.d.ts +6 -0
- package/generated/internal/vendor/morphdom.js +720 -0
- package/generated/morphdom/index.d.ts +8 -0
- package/generated/morphdom/index.js +8 -0
- package/generated/morphdom/morph.d.ts +4 -0
- package/generated/morphdom/morph.js +10 -0
- package/generated/morphdom/query-morph.d.ts +5 -0
- package/generated/morphdom/query-morph.js +12 -0
- package/generated/morphdom/render-to-string.d.ts +12 -0
- package/generated/morphdom/render-to-string.js +48 -0
- package/generated/morphdom/unsafe-html.d.ts +2 -0
- package/generated/morphdom/unsafe-html.js +4 -0
- package/generated/namespace-browser/base.d.ts +45 -0
- package/generated/namespace-browser/base.js +115 -0
- package/generated/namespace-browser/event.d.ts +10 -0
- package/generated/namespace-browser/event.js +1 -0
- package/generated/namespace-browser/index.d.ts +7 -0
- package/generated/namespace-browser/index.js +1 -0
- package/generated/snapshot/index.d.ts +9 -0
- package/generated/snapshot/index.js +58 -0
- package/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +7 -0
- package/generated/tpl/index.d.ts +6 -0
- package/generated/tpl/index.js +6 -0
- package/generated/tpl/is-template-result.d.ts +3 -0
- package/generated/tpl/is-template-result.js +1 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +132 -0
- package/package.json +19 -18
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
+
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
|
+
import { add, debug, frame, onoff, slowHideShow, timeout } from '../internal/utils';
|
|
5
|
+
import { Snapshot } from '../snapshot';
|
|
6
|
+
const observing = new WeakSet();
|
|
7
|
+
function observeResizeEnd(el, callback, stableFrames = 4) {
|
|
8
|
+
let rafId = null;
|
|
9
|
+
let lastRect = el.getBoundingClientRect();
|
|
10
|
+
let stableCount = 0;
|
|
11
|
+
function check() {
|
|
12
|
+
const rect = el.getBoundingClientRect();
|
|
13
|
+
if (rect.width === lastRect.width && rect.height === lastRect.height) {
|
|
14
|
+
stableCount++;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
stableCount = 0;
|
|
18
|
+
lastRect = rect;
|
|
19
|
+
}
|
|
20
|
+
if (stableCount >= stableFrames) {
|
|
21
|
+
rafId = null;
|
|
22
|
+
callback(rect);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
rafId = self.requestAnimationFrame(check);
|
|
26
|
+
}
|
|
27
|
+
const observer = new ResizeObserver(() => {
|
|
28
|
+
stableCount = 0;
|
|
29
|
+
if (rafId === null) {
|
|
30
|
+
lastRect = el.getBoundingClientRect();
|
|
31
|
+
rafId = self.requestAnimationFrame(check);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
observer.observe(el);
|
|
35
|
+
return () => {
|
|
36
|
+
observer.disconnect();
|
|
37
|
+
if (rafId)
|
|
38
|
+
self.cancelAnimationFrame(rafId);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function parseRootMargin(rootMargin = '0px 0px 0px 0px') {
|
|
42
|
+
const parts = rootMargin.split(/\s+/).map((v) => parseInt(v));
|
|
43
|
+
switch (parts.length) {
|
|
44
|
+
case 1:
|
|
45
|
+
return [parts[0], parts[0], parts[0], parts[0]];
|
|
46
|
+
case 2:
|
|
47
|
+
return [parts[0], parts[1], parts[0], parts[1]];
|
|
48
|
+
case 3:
|
|
49
|
+
return [parts[0], parts[1], parts[2], parts[1]];
|
|
50
|
+
case 4:
|
|
51
|
+
return parts;
|
|
52
|
+
default:
|
|
53
|
+
return [0, 0, 0, 0];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function isIntersectingWithContainer(el, container, rootMargin = '0px 0px 0px 0px') {
|
|
57
|
+
if (!(el instanceof Element) || !(container instanceof Element))
|
|
58
|
+
return false;
|
|
59
|
+
const elRect = el.getBoundingClientRect();
|
|
60
|
+
const contRect = container.getBoundingClientRect();
|
|
61
|
+
const [topMargin, rightMargin, bottomMargin, leftMargin] = parseRootMargin(rootMargin);
|
|
62
|
+
const marginRect = {
|
|
63
|
+
top: contRect.top + topMargin,
|
|
64
|
+
right: contRect.right - rightMargin,
|
|
65
|
+
bottom: contRect.bottom - bottomMargin,
|
|
66
|
+
left: contRect.left + leftMargin,
|
|
67
|
+
};
|
|
68
|
+
return !(elRect.bottom < marginRect.top || elRect.top > marginRect.bottom || elRect.right < marginRect.left || elRect.left > marginRect.right);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @attr {boolean} padding
|
|
73
|
+
* @attr {boolean} navigation-bar-auto-hide
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
export class NavigationLargeTitle extends HTMLElement {
|
|
77
|
+
#styleObserver;
|
|
78
|
+
#scrollObserver;
|
|
79
|
+
#scrollSafetyTimer = timeout();
|
|
80
|
+
#rootMarginTop = '0px';
|
|
81
|
+
constructor() {
|
|
82
|
+
super();
|
|
83
|
+
}
|
|
84
|
+
disconnectedCallback() {
|
|
85
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
86
|
+
this.#clearScrollState();
|
|
87
|
+
this.#styleObserver?.disconnect();
|
|
88
|
+
CleanupRegistry.unregister(this);
|
|
89
|
+
}
|
|
90
|
+
connectedCallback() {
|
|
91
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
92
|
+
const root = this.closest('scroll-view') ?? undefined;
|
|
93
|
+
if (!root)
|
|
94
|
+
return;
|
|
95
|
+
if (!root?.hasAttribute('navigation-bar-title-display-mode'))
|
|
96
|
+
root?.setAttribute('navigation-bar-title-display-mode', 'large');
|
|
97
|
+
frame(this).then(() => {
|
|
98
|
+
// if (!r) return // NOTE: Required or BREAKS transitions // self.requestAnimationFrame(() => {
|
|
99
|
+
this.#styleObserver = new CSSStyleObserver();
|
|
100
|
+
this.#styleObserver.observe(this, this.#handleStyleChange);
|
|
101
|
+
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange)); //Snapshot.waitReady.then(this.#handleStyleChange)
|
|
102
|
+
// this.#observer?.observe(this)
|
|
103
|
+
CleanupRegistry.register(this, onoff([
|
|
104
|
+
{ types: 'scroll', listener: this.#handleScroll, addOptions: { passive: true } },
|
|
105
|
+
{ types: 'scrollend', listener: this.#handleScrollend, addOptions: { passive: true } },
|
|
106
|
+
], root).on());
|
|
107
|
+
observeResizeEnd(root, () => {
|
|
108
|
+
const isIntersecting = isIntersectingWithContainer(this, root, `${this.#rootMarginTop} 0px 0px 0px`);
|
|
109
|
+
this.#applySlowness(root, isIntersecting);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
#handleStyleChange = () => {
|
|
114
|
+
debug(`${_a.name} ⚡️ style`);
|
|
115
|
+
const root = this.closest('scroll-view') ?? undefined;
|
|
116
|
+
if (!root)
|
|
117
|
+
return;
|
|
118
|
+
const style = self.getComputedStyle(this);
|
|
119
|
+
const blockSizeProp = style.getPropertyValue('--navigation-bar-block-size') || '0', //`${document.documentElement.computedStyleMap().get(`--navigation-bar-block-size`) ?? '0'}`, //
|
|
120
|
+
blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(style.getPropertyValue('--root-font-size')) || 16 : 1);
|
|
121
|
+
// blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(self.getComputedStyle(document.documentElement).fontSize) : 1)
|
|
122
|
+
const rootMarginTop = `${blockSize}px`;
|
|
123
|
+
if (this.#rootMarginTop === rootMarginTop)
|
|
124
|
+
return;
|
|
125
|
+
this.#rootMarginTop = rootMarginTop;
|
|
126
|
+
// Tear down old observer cleanly before replacing it
|
|
127
|
+
const wasObserving = observing.delete(this);
|
|
128
|
+
this.#scrollObserver?.disconnect();
|
|
129
|
+
this.#scrollObserver = new IntersectionObserver(this.#handleIntersect, {
|
|
130
|
+
root,
|
|
131
|
+
rootMargin: `-${this.#rootMarginTop} 0px 0px 0px`,
|
|
132
|
+
threshold: [0, 1],
|
|
133
|
+
});
|
|
134
|
+
// Re-observe immediately if we were mid-scroll
|
|
135
|
+
if (wasObserving) {
|
|
136
|
+
observing.add(this);
|
|
137
|
+
this.#scrollObserver.observe(this);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
#clearScrollState = () => {
|
|
141
|
+
if (observing.delete(this))
|
|
142
|
+
this.#scrollObserver?.unobserve(this);
|
|
143
|
+
this.#scrollSafetyTimer.cancel();
|
|
144
|
+
};
|
|
145
|
+
#handleScroll = (evt) => {
|
|
146
|
+
if (add(observing, this))
|
|
147
|
+
this.#scrollObserver?.observe(this);
|
|
148
|
+
this.#scrollSafetyTimer.next(() => this.#clearScrollState(), 2000); // reset watchdog every scroll event
|
|
149
|
+
};
|
|
150
|
+
#handleScrollend = (evt) => {
|
|
151
|
+
this.#clearScrollState();
|
|
152
|
+
};
|
|
153
|
+
// #handleResizeend: EventListener = (evt: Event) => {
|
|
154
|
+
// const root = evt.target as HTMLElement
|
|
155
|
+
// const isIntersecting = isIntersectingWithContainer(this, root, `${this.#rootMarginTop} 0px 0px 0px`)
|
|
156
|
+
// this.#applySlowness(root, isIntersecting)
|
|
157
|
+
// }
|
|
158
|
+
#handleIntersect = (entries, { root }) => {
|
|
159
|
+
debug(`${_a.name} ⚡️ intersect (${entries?.at(0)?.isIntersecting})`);
|
|
160
|
+
if (!(root instanceof HTMLElement))
|
|
161
|
+
return;
|
|
162
|
+
for (const { isIntersecting } of entries)
|
|
163
|
+
this.#applySlowness(root, isIntersecting);
|
|
164
|
+
// for (const { isIntersecting } of entries) {
|
|
165
|
+
// const value = isIntersecting ? 'large' : 'inline'
|
|
166
|
+
// if (value === root?.getAttribute('navigation-bar-title-display-mode')) continue
|
|
167
|
+
// root?.setAttribute('navigation-bar-title-display-mode', value)
|
|
168
|
+
// if (this.closest('[hidden]')) continue // if (0 === this.offsetHeight + this.offsetWidth) continue
|
|
169
|
+
// if (this.hasAttribute('navigation-bar-auto-hide')) slowHideShow(isIntersecting ? 'show' : 'hide', this)
|
|
170
|
+
// }
|
|
171
|
+
};
|
|
172
|
+
#applySlowness = (root, isIntersecting) => {
|
|
173
|
+
const value = isIntersecting ? 'large' : 'inline';
|
|
174
|
+
if (this.closest('[hidden]'))
|
|
175
|
+
return; // if (0 === this.offsetHeight + this.offsetWidth) continue
|
|
176
|
+
if (value === root?.getAttribute('navigation-bar-title-display-mode'))
|
|
177
|
+
return;
|
|
178
|
+
root?.setAttribute('navigation-bar-title-display-mode', value);
|
|
179
|
+
if (this.hasAttribute('navigation-bar-auto-hide'))
|
|
180
|
+
slowHideShow(isIntersecting ? 'show' : 'hide', this);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
_a = NavigationLargeTitle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A container view with two or three side-by-side screens, where what the user chooses in the left screen changes what appears in the next screen.
|
|
4
|
+
*/
|
|
5
|
+
export declare class NavigationSplitView extends NavigationView {
|
|
6
|
+
constructor();
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'navigation-split-view': NavigationSplitView;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
import { debug } from '../internal/utils';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A container view with two or three side-by-side screens, where what the user chooses in the left screen changes what appears in the next screen.
|
|
5
|
+
*/
|
|
6
|
+
export class NavigationSplitView extends NavigationView {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
}
|
|
10
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
11
|
+
debug(`${NavigationSplitView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
12
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
13
|
+
}
|
|
14
|
+
disconnectedCallback() {
|
|
15
|
+
debug(`${NavigationSplitView.name} ⚡️ disconnect`);
|
|
16
|
+
super.disconnectedCallback();
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
debug(`${NavigationSplitView.name} ⚡️ connect`);
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A container view that shows a main screen and lets the user open other screens on top of it.
|
|
4
|
+
*/
|
|
5
|
+
export declare class NavigationStack extends NavigationView {
|
|
6
|
+
constructor();
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'navigation-stack': NavigationStack;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
+
import { debug } from '../internal/utils';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A container view that shows a main screen and lets the user open other screens on top of it.
|
|
5
|
+
*/
|
|
6
|
+
export class NavigationStack extends NavigationView {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
}
|
|
10
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
11
|
+
debug(`${NavigationStack.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
12
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
13
|
+
switch (name) {
|
|
14
|
+
case 'hidden':
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
disconnectedCallback() {
|
|
19
|
+
debug(`${NavigationStack.name} ⚡️ disconnect`);
|
|
20
|
+
super.disconnectedCallback();
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
debug(`${NavigationStack.name} ⚡️ connect`);
|
|
24
|
+
super.connectedCallback();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A container view.
|
|
3
|
+
*
|
|
4
|
+
* @attr {boolean} padding
|
|
5
|
+
*/
|
|
6
|
+
export declare class NavigationTitle extends HTMLElement {
|
|
7
|
+
#private;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
constructor();
|
|
10
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'navigation-title': NavigationTitle;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { debug } from '../internal/utils';
|
|
10
|
+
import { queryMorph } from '../morphdom';
|
|
11
|
+
import { html } from '../tpl';
|
|
12
|
+
/**
|
|
13
|
+
* @summary A container view.
|
|
14
|
+
*
|
|
15
|
+
* @attr {boolean} padding
|
|
16
|
+
*/
|
|
17
|
+
let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElement {
|
|
18
|
+
static get observedAttributes() {
|
|
19
|
+
return ['value', 'subtitle', 'system-image', 'system-image-weight'];
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
}
|
|
24
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
25
|
+
debug(`${NavigationTitle_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
26
|
+
this.#render(this.getAttribute('value'), this.getAttribute('subtitle'), this.getAttribute('system-image'), this.getAttribute('system-image-weight'));
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
debug(`${NavigationTitle_1.name} ⚡️ disconnect`);
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
debug(`${NavigationTitle_1.name} ⚡️ connect`);
|
|
33
|
+
}
|
|
34
|
+
#render = (title, subtitle, systemImage, systemImageWeight) => {
|
|
35
|
+
queryMorph(':not([slot])', html `
|
|
36
|
+
<navigation-large-title>
|
|
37
|
+
<v-stack alignment="fill">
|
|
38
|
+
${systemImage ? html `<image-view system-name="${systemImage}" system-weight="${systemImageWeight}" foreground="blue"></image-view>` : null}
|
|
39
|
+
<v-stack spacing="0" alignment="fill">
|
|
40
|
+
${title
|
|
41
|
+
? html `<label-view line-limit="1" truncation-mode="tail" font="headline">
|
|
42
|
+
<span>${title}</span>
|
|
43
|
+
</label-view>`
|
|
44
|
+
: null}
|
|
45
|
+
${subtitle
|
|
46
|
+
? html `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout">
|
|
47
|
+
<span>${subtitle}</span>
|
|
48
|
+
</label-view>`
|
|
49
|
+
: null}
|
|
50
|
+
</v-stack>
|
|
51
|
+
</v-stack>
|
|
52
|
+
</navigation-large-title>
|
|
53
|
+
`, this);
|
|
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');
|
|
61
|
+
else
|
|
62
|
+
sibling?.setAttribute('navigation-inline-title', value);
|
|
63
|
+
if (null === subtitle)
|
|
64
|
+
sibling?.removeAttribute('navigation-inline-subtitle');
|
|
65
|
+
else
|
|
66
|
+
sibling?.setAttribute('navigation-inline-subtitle', subtitle);
|
|
67
|
+
})
|
|
68
|
+
], NavigationTitle);
|
|
69
|
+
export { NavigationTitle };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
2
|
+
declare const pickerStyles: readonly ["menu", "inline", "navigation-link", "sheet", "radio-group", "automatic"];
|
|
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
|
+
* @summary A control that selects one value from a set of options.
|
|
14
|
+
*
|
|
15
|
+
* @attr {vertical|horizontal|auto} label-value-placement
|
|
16
|
+
*
|
|
17
|
+
* @attr {boolean} horizontal-radio-group-layout
|
|
18
|
+
*
|
|
19
|
+
* @slot — The default slot
|
|
20
|
+
* @slot label
|
|
21
|
+
* @slot list
|
|
22
|
+
* @slot {HTMLOptionElement[]} validity-options
|
|
23
|
+
*/
|
|
24
|
+
export declare class PickerView extends FormAssociatedBase {
|
|
25
|
+
#private;
|
|
26
|
+
static get observedAttributes(): string[];
|
|
27
|
+
get selection(): string;
|
|
28
|
+
set selection(v: string);
|
|
29
|
+
get template(): DocumentFragment;
|
|
30
|
+
constructor();
|
|
31
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
connectedCallback(): void;
|
|
34
|
+
get pickerStyle(): PickerStyle;
|
|
35
|
+
/**
|
|
36
|
+
* Form participation property
|
|
37
|
+
*/
|
|
38
|
+
get name(): string;
|
|
39
|
+
setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
|
|
40
|
+
setCustomValidity: (message: string) => void;
|
|
41
|
+
formStateRestoreCallback(state: string, reason: string): void;
|
|
42
|
+
formAssociatedCallback(form: HTMLFormElement): void;
|
|
43
|
+
formDisabledCallback(disabled: boolean): void;
|
|
44
|
+
formResetCallback(): void;
|
|
45
|
+
}
|
|
46
|
+
declare global {
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
'picker-view': PickerView;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {};
|