@swiftwc/ui 0.0.0-dev.99 → 1.0.0-canary.0
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/{web-components.html-data → html-data}/en.json +155 -54
- package/package.json +14 -11
- package/scss/_components.scss +1 -1
- package/scss/_maps.scss +3 -1
- package/scss/_utils.scss +3 -1
- package/scss/_vars.scss +1 -0
- package/scss/base/_layout.scss +8 -8
- package/scss/base/_reboot.scss +4 -29
- package/scss/base/_root.scss +27 -12
- package/scss/colors/_index.scss +66 -1
- package/scss/components/_alert-dialog.scss +3 -3
- package/scss/components/_bordered-button.scss +2 -2
- package/scss/components/_bordered-prominent-button.scss +3 -3
- package/scss/components/_borderless-button.scss +2 -2
- package/scss/components/_confirmation-dialog.scss +1 -1
- package/scss/components/_content-unavailable.scss +1 -1
- package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
- package/scss/components/_date-picker.scss +1 -1
- package/scss/components/_detail-placeholder.scss +5 -5
- package/scss/components/_disclosure-group.scss +2 -2
- package/scss/components/_fine-tooltip.scss +1 -1
- package/scss/components/_form-view.scss +3 -3
- package/scss/components/_full-screen.scss +1 -1
- package/scss/components/_glass-button.scss +2 -2
- package/scss/components/_glass-prominent-button.scss +3 -3
- package/scss/components/_group-box.scss +1 -1
- package/scss/components/_h-divider.scss +1 -1
- package/scss/components/_h-flex-stack.scss +3 -1
- package/scss/components/_h-stack.scss +1 -1
- package/scss/components/_image-view.scss +1 -1
- package/scss/components/_index.scss +34 -24
- package/scss/components/_label-view.scss +1 -1
- package/scss/components/_labeled-content.scss +1 -1
- package/scss/components/_list-view.scss +3 -3
- package/scss/components/_menu-view.scss +3 -3
- package/scss/components/_navigation-large-title.scss +15 -9
- package/scss/components/_navigation-split-view.scss +18 -18
- package/scss/components/_navigation-stack.scss +1 -1
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +159 -119
- package/scss/components/_plain-button.scss +2 -2
- package/scss/components/_progress-view.scss +1 -1
- package/scss/components/_scroll-view-proxy.scss +1 -1
- package/scss/components/_scroll-view-toolbars.scss +1 -1
- package/scss/components/_scroll-view.scss +2 -2
- package/scss/components/_search-view.scss +1 -1
- package/scss/components/_section-view.scss +1 -1
- package/scss/components/_sheet-view.scss +2 -2
- package/scss/components/_sidebar-toggle.scss +1 -1
- package/scss/components/_sidebar-view.scss +2 -2
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +1 -1
- package/scss/components/_tab-item.scss +1 -1
- package/scss/components/_tab-view.scss +23 -15
- package/scss/components/_table-column.scss +1 -1
- package/scss/components/_table-row.scss +1 -1
- package/scss/components/_table-view.scss +1 -1
- package/scss/components/_text-field.scss +1 -1
- package/scss/components/_text-view.scss +1 -1
- package/scss/components/_toggle-view.scss +41 -21
- package/scss/components/_tool-bar-item-group.scss +1 -1
- package/scss/components/_tool-bar-item.scss +2 -2
- package/scss/components/_tool-bar.scss +2 -2
- package/scss/components/_v-divider.scss +1 -1
- package/scss/components/_v-flex-stack.scss +3 -1
- package/scss/components/_v-keyboard.scss +1 -1
- package/scss/components/_v-stack.scss +1 -1
- package/scss/final/_touch-glass.scss +2 -2
- package/scss/mixins/_index.scss +2 -2
- package/scss/placeholders/_buttons.scss +5 -5
- package/scss/placeholders/_lists.scss +3 -3
- package/scss/transitions/_alert-dialog.scss +1 -1
- package/scss/transitions/_bwd.navbar.scss +1 -1
- package/scss/transitions/_bwd.scss +3 -3
- package/scss/transitions/_confirmation-dialog.scss +1 -1
- package/scss/transitions/_disclosure-group.scss +1 -1
- package/scss/transitions/_fine-tooltip.scss +1 -1
- package/scss/transitions/_fwd.navbar.scss +1 -1
- package/scss/transitions/_fwd.scss +1 -1
- package/scss/transitions/_glass-button.scss +1 -1
- package/scss/transitions/_glass-prominent-button.scss +1 -1
- package/scss/transitions/_index.scss +1 -1
- package/scss/transitions/_menu-view.scss +1 -1
- package/scss/transitions/_navigation-split-view.scss +1 -1
- package/scss/transitions/_progress-view.scss +1 -1
- package/scss/transitions/_sheet-view.scss +1 -1
- package/scss/transitions/_sidebar-view.scss +1 -1
- package/scss/transitions/_tab-bar.scss +1 -1
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +2 -2
- package/scss/utils/_index.scss +33 -8
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +5 -3
- package/generated/buses/alert-dialog.d.ts +0 -2
- package/generated/buses/alert-dialog.js +0 -1
- package/generated/buses/confirmation-dialog.d.ts +0 -2
- package/generated/buses/confirmation-dialog.js +0 -1
- package/generated/buses/index.d.ts +0 -6
- package/generated/buses/index.js +0 -6
- package/generated/buses/lifecycle-observer.d.ts +0 -2
- package/generated/buses/lifecycle-observer.js +0 -1
- package/generated/client/index.d.ts +0 -30
- package/generated/client/index.js +0 -279
- package/generated/components/alert-dialog.d.ts +0 -11
- package/generated/components/alert-dialog.js +0 -102
- package/generated/components/body-view.d.ts +0 -13
- package/generated/components/body-view.js +0 -17
- package/generated/components/bordered-button.d.ts +0 -17
- package/generated/components/bordered-button.js +0 -56
- package/generated/components/bordered-prominent-button.d.ts +0 -17
- package/generated/components/bordered-prominent-button.js +0 -56
- package/generated/components/borderless-button.d.ts +0 -17
- package/generated/components/borderless-button.js +0 -56
- package/generated/components/color-scheme.d.ts +0 -12
- package/generated/components/color-scheme.js +0 -54
- package/generated/components/confirmation-dialog.d.ts +0 -12
- package/generated/components/confirmation-dialog.js +0 -116
- package/generated/components/content-unavailable.d.ts +0 -30
- package/generated/components/content-unavailable.js +0 -82
- package/generated/components/date-picker.d.ts +0 -52
- package/generated/components/date-picker.js +0 -480
- package/generated/components/disclosure-group.d.ts +0 -17
- package/generated/components/disclosure-group.js +0 -66
- package/generated/components/fine-tooltip.d.ts +0 -15
- package/generated/components/fine-tooltip.js +0 -111
- package/generated/components/form-view.d.ts +0 -16
- package/generated/components/form-view.js +0 -65
- package/generated/components/glass-button.d.ts +0 -16
- package/generated/components/glass-button.js +0 -53
- package/generated/components/glass-prominent-button.d.ts +0 -16
- package/generated/components/glass-prominent-button.js +0 -53
- package/generated/components/h-stack.d.ts +0 -22
- package/generated/components/h-stack.js +0 -26
- package/generated/components/image-view.d.ts +0 -18
- package/generated/components/image-view.js +0 -68
- package/generated/components/index.d.ts +0 -47
- package/generated/components/index.js +0 -47
- package/generated/components/label-view.d.ts +0 -27
- package/generated/components/label-view.js +0 -87
- package/generated/components/labeled-content.d.ts +0 -27
- package/generated/components/labeled-content.js +0 -160
- package/generated/components/list-view.d.ts +0 -15
- package/generated/components/list-view.js +0 -22
- package/generated/components/menu-view.d.ts +0 -20
- package/generated/components/menu-view.js +0 -140
- package/generated/components/navigation-large-title.d.ts +0 -18
- package/generated/components/navigation-large-title.js +0 -188
- package/generated/components/navigation-split-view.d.ts +0 -15
- package/generated/components/navigation-split-view.js +0 -25
- package/generated/components/navigation-stack.d.ts +0 -15
- package/generated/components/navigation-stack.js +0 -29
- package/generated/components/navigation-title.d.ts +0 -18
- package/generated/components/navigation-title.js +0 -72
- package/generated/components/picker-view.d.ts +0 -68
- package/generated/components/picker-view.js +0 -1153
- package/generated/components/plain-button.d.ts +0 -7
- package/generated/components/plain-button.js +0 -22
- package/generated/components/progress-view.d.ts +0 -20
- package/generated/components/progress-view.js +0 -125
- package/generated/components/screen-view.d.ts +0 -5
- package/generated/components/screen-view.js +0 -11
- package/generated/components/scroll-view-proxy.d.ts +0 -13
- package/generated/components/scroll-view-proxy.js +0 -17
- package/generated/components/scroll-view.d.ts +0 -22
- package/generated/components/scroll-view.js +0 -237
- package/generated/components/search-view.d.ts +0 -12
- package/generated/components/search-view.js +0 -27
- package/generated/components/section-view.d.ts +0 -21
- package/generated/components/section-view.js +0 -64
- package/generated/components/sheet-view.d.ts +0 -11
- package/generated/components/sheet-view.js +0 -45
- package/generated/components/sidebar-toggle.d.ts +0 -15
- package/generated/components/sidebar-toggle.js +0 -88
- package/generated/components/sidebar-view.d.ts +0 -10
- package/generated/components/sidebar-view.js +0 -37
- package/generated/components/sticky-container.d.ts +0 -11
- package/generated/components/sticky-container.js +0 -26
- package/generated/components/tab-bar.d.ts +0 -10
- package/generated/components/tab-bar.js +0 -40
- package/generated/components/tab-item.d.ts +0 -10
- package/generated/components/tab-item.js +0 -134
- package/generated/components/tab-view.d.ts +0 -31
- package/generated/components/tab-view.js +0 -198
- package/generated/components/table-view.d.ts +0 -26
- package/generated/components/table-view.js +0 -161
- package/generated/components/text-field.d.ts +0 -42
- package/generated/components/text-field.js +0 -526
- package/generated/components/toggle-view.d.ts +0 -41
- package/generated/components/toggle-view.js +0 -370
- package/generated/components/tool-bar-item-group.d.ts +0 -13
- package/generated/components/tool-bar-item-group.js +0 -31
- package/generated/components/tool-bar-item.d.ts +0 -16
- package/generated/components/tool-bar-item.js +0 -69
- package/generated/components/tool-bar.d.ts +0 -26
- package/generated/components/tool-bar.js +0 -95
- package/generated/components/v-keyboard.d.ts +0 -20
- package/generated/components/v-keyboard.js +0 -89
- package/generated/components/v-stack.d.ts +0 -25
- package/generated/components/v-stack.js +0 -29
- package/generated/css/index.css +0 -10620
- package/generated/events/alert-dialog.d.ts +0 -13
- package/generated/events/alert-dialog.js +0 -1
- package/generated/events/confirmation-dialog.d.ts +0 -14
- package/generated/events/confirmation-dialog.js +0 -1
- package/generated/events/date-picker.d.ts +0 -13
- package/generated/events/date-picker.js +0 -1
- package/generated/events/index.d.ts +0 -9
- package/generated/events/index.js +0 -9
- package/generated/events/lifecycle-observer.d.ts +0 -18
- package/generated/events/lifecycle-observer.js +0 -1
- package/generated/events/picker-view.d.ts +0 -29
- package/generated/events/picker-view.js +0 -1
- package/generated/events/scroll-view.d.ts +0 -18
- package/generated/events/scroll-view.js +0 -1
- package/generated/events/tab-view.d.ts +0 -54
- package/generated/events/tab-view.js +0 -1
- package/generated/events/text-field.d.ts +0 -13
- package/generated/events/text-field.js +0 -1
- package/generated/events/toggle-view.d.ts +0 -14
- package/generated/events/toggle-view.js +0 -1
- package/generated/i18n/index.d.ts +0 -33
- package/generated/i18n/index.js +0 -164
- package/generated/i18n/locales/el.d.ts +0 -16
- package/generated/i18n/locales/el.js +0 -16
- package/generated/i18n/locales/en.d.ts +0 -16
- package/generated/i18n/locales/en.js +0 -16
- package/generated/i18n/locales/index.d.ts +0 -4
- package/generated/i18n/locales/index.js +0 -4
- package/generated/index.d.ts +0 -2
- package/generated/index.js +0 -3
- package/generated/internal/class/cleanup-registry.d.ts +0 -5
- package/generated/internal/class/cleanup-registry.js +0 -38
- package/generated/internal/class/css-style-observer.d.ts +0 -8
- package/generated/internal/class/css-style-observer.js +0 -26
- package/generated/internal/class/form-associated-base.d.ts +0 -16
- package/generated/internal/class/form-associated-base.js +0 -78
- package/generated/internal/class/mutation-observer-set.d.ts +0 -9
- package/generated/internal/class/mutation-observer-set.js +0 -42
- package/generated/internal/class/mutation-observer-singleton.d.ts +0 -10
- package/generated/internal/class/mutation-observer-singleton.js +0 -64
- package/generated/internal/class/navigation-path.d.ts +0 -15
- package/generated/internal/class/navigation-path.js +0 -84
- package/generated/internal/class/navigation-view.d.ts +0 -8
- package/generated/internal/class/navigation-view.js +0 -72
- package/generated/internal/class/resize-observer-singleton.d.ts +0 -7
- package/generated/internal/class/resize-observer-singleton.js +0 -22
- package/generated/internal/decorators/adaptive-slot.d.ts +0 -1
- package/generated/internal/decorators/adaptive-slot.js +0 -50
- package/generated/internal/decorators/custom-element.d.ts +0 -5
- package/generated/internal/decorators/custom-element.js +0 -5
- package/generated/internal/decorators/index.d.ts +0 -6
- package/generated/internal/decorators/index.js +0 -6
- package/generated/internal/decorators/microtask-on-connected.d.ts +0 -39
- package/generated/internal/decorators/microtask-on-connected.js +0 -67
- package/generated/internal/privateNamespace.d.ts +0 -14
- package/generated/internal/privateNamespace.js +0 -168
- package/generated/internal/utils/add.d.ts +0 -1
- package/generated/internal/utils/add.js +0 -7
- package/generated/internal/utils/cash/ancestors.d.ts +0 -1
- package/generated/internal/utils/cash/ancestors.js +0 -27
- package/generated/internal/utils/cash/index.d.ts +0 -24
- package/generated/internal/utils/cash/index.js +0 -27
- package/generated/internal/utils/cash/next-all.d.ts +0 -1
- package/generated/internal/utils/cash/next-all.js +0 -10
- package/generated/internal/utils/cash/next.d.ts +0 -1
- package/generated/internal/utils/cash/next.js +0 -9
- package/generated/internal/utils/cash/prev-all.d.ts +0 -1
- package/generated/internal/utils/cash/prev-all.js +0 -10
- package/generated/internal/utils/cash/prev.d.ts +0 -1
- package/generated/internal/utils/cash/prev.js +0 -9
- package/generated/internal/utils/cash/prop.d.ts +0 -18
- package/generated/internal/utils/cash/prop.js +0 -30
- package/generated/internal/utils/cash/siblings.d.ts +0 -1
- package/generated/internal/utils/cash/siblings.js +0 -10
- package/generated/internal/utils/clamp.d.ts +0 -1
- package/generated/internal/utils/clamp.js +0 -4
- package/generated/internal/utils/compare-big-decimals.d.ts +0 -1
- package/generated/internal/utils/compare-big-decimals.js +0 -80
- package/generated/internal/utils/css-time.d.ts +0 -1
- package/generated/internal/utils/css-time.js +0 -3
- package/generated/internal/utils/debounce.d.ts +0 -1
- package/generated/internal/utils/debounce.js +0 -13
- package/generated/internal/utils/define-translations.d.ts +0 -1
- package/generated/internal/utils/define-translations.js +0 -3
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
- package/generated/internal/utils/ensure-placeholder.d.ts +0 -1
- package/generated/internal/utils/ensure-placeholder.js +0 -41
- package/generated/internal/utils/frame.d.ts +0 -1
- package/generated/internal/utils/frame.js +0 -6
- package/generated/internal/utils/index.d.ts +0 -20
- package/generated/internal/utils/index.js +0 -23
- package/generated/internal/utils/is-inside.d.ts +0 -1
- package/generated/internal/utils/is-inside.js +0 -4
- package/generated/internal/utils/kebab-case.d.ts +0 -1
- package/generated/internal/utils/kebab-case.js +0 -8
- package/generated/internal/utils/list-active.d.ts +0 -7
- package/generated/internal/utils/list-active.js +0 -83
- package/generated/internal/utils/microtask.d.ts +0 -1
- package/generated/internal/utils/microtask.js +0 -3
- package/generated/internal/utils/onoff.d.ts +0 -45
- package/generated/internal/utils/onoff.js +0 -31
- package/generated/internal/utils/set.d.ts +0 -1
- package/generated/internal/utils/set.js +0 -7
- package/generated/internal/utils/sleep.d.ts +0 -1
- package/generated/internal/utils/sleep.js +0 -3
- package/generated/internal/utils/slow-hide-show.d.ts +0 -1
- package/generated/internal/utils/slow-hide-show.js +0 -16
- package/generated/internal/utils/timeout.d.ts +0 -5
- package/generated/internal/utils/timeout.js +0 -16
- package/generated/internal/utils/touch-glass.d.ts +0 -7
- package/generated/internal/utils/touch-glass.js +0 -19
- package/generated/internal/vendor/morphdom.d.ts +0 -6
- package/generated/internal/vendor/morphdom.js +0 -720
- package/generated/morphdom/index.d.ts +0 -8
- package/generated/morphdom/index.js +0 -8
- package/generated/morphdom/morph.d.ts +0 -4
- package/generated/morphdom/morph.js +0 -10
- package/generated/morphdom/query-morph.d.ts +0 -5
- package/generated/morphdom/query-morph.js +0 -12
- package/generated/morphdom/render-to-string.d.ts +0 -12
- package/generated/morphdom/render-to-string.js +0 -48
- package/generated/morphdom/unsafe-html.d.ts +0 -2
- package/generated/morphdom/unsafe-html.js +0 -4
- package/generated/namespace-browser/base.d.ts +0 -45
- package/generated/namespace-browser/base.js +0 -115
- package/generated/namespace-browser/event.d.ts +0 -10
- package/generated/namespace-browser/event.js +0 -1
- package/generated/namespace-browser/index.d.ts +0 -7
- package/generated/namespace-browser/index.js +0 -1
- package/generated/snapshot/index.d.ts +0 -9
- package/generated/snapshot/index.js +0 -60
- package/generated/tpl/html.d.ts +0 -5
- package/generated/tpl/html.js +0 -7
- package/generated/tpl/index.d.ts +0 -6
- package/generated/tpl/index.js +0 -6
- package/generated/tpl/is-template-result.d.ts +0 -3
- package/generated/tpl/is-template-result.js +0 -1
- package/generated/tpl/render.d.ts +0 -2
- package/generated/tpl/render.js +0 -132
- /package/{web-components.css-data → css-data}/en.json +0 -0
- /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
|
-
import { add, devFlags, 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 {grouped} background-style
|
|
73
|
-
* @attr {boolean} padding
|
|
74
|
-
* @attr {boolean} navigation-bar-auto-hide
|
|
75
|
-
*
|
|
76
|
-
*/
|
|
77
|
-
export class NavigationLargeTitle extends HTMLElement {
|
|
78
|
-
#styleObserver;
|
|
79
|
-
#scrollObserver;
|
|
80
|
-
#scrollSafetyTimer = timeout();
|
|
81
|
-
#rootMarginTop = '0px';
|
|
82
|
-
constructor() {
|
|
83
|
-
super();
|
|
84
|
-
}
|
|
85
|
-
disconnectedCallback() {
|
|
86
|
-
if (devFlags.debug)
|
|
87
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
88
|
-
this.#clearScrollState();
|
|
89
|
-
this.#styleObserver?.disconnect();
|
|
90
|
-
CleanupRegistry.unregister(this);
|
|
91
|
-
}
|
|
92
|
-
connectedCallback() {
|
|
93
|
-
if (devFlags.debug)
|
|
94
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
95
|
-
const root = this.closest('scroll-view') ?? undefined;
|
|
96
|
-
if (!root)
|
|
97
|
-
return;
|
|
98
|
-
if (!root?.hasAttribute('navigation-bar-title-display-mode'))
|
|
99
|
-
root?.setAttribute('navigation-bar-title-display-mode', 'large');
|
|
100
|
-
frame(this).then(() => {
|
|
101
|
-
// if (!r) return // NOTE: Required or BREAKS transitions // self.requestAnimationFrame(() => {
|
|
102
|
-
this.#styleObserver = new CSSStyleObserver();
|
|
103
|
-
this.#styleObserver.observe(this, this.#handleStyleChange);
|
|
104
|
-
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange)); //Snapshot.waitReady.then(this.#handleStyleChange)
|
|
105
|
-
// this.#observer?.observe(this)
|
|
106
|
-
CleanupRegistry.register(this, onoff([
|
|
107
|
-
{ types: 'scroll', listener: this.#handleScroll, addOptions: { passive: true } },
|
|
108
|
-
{ types: 'scrollend', listener: this.#handleScrollend, addOptions: { passive: true } },
|
|
109
|
-
], root).on());
|
|
110
|
-
observeResizeEnd(root, () => {
|
|
111
|
-
const isIntersecting = isIntersectingWithContainer(this, root, `${this.#rootMarginTop} 0px 0px 0px`);
|
|
112
|
-
this.#applySlowness(root, isIntersecting);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
#handleStyleChange = () => {
|
|
117
|
-
if (devFlags.debug)
|
|
118
|
-
console.debug(`${_a.name} ⚡️ style`);
|
|
119
|
-
const root = this.closest('scroll-view') ?? undefined;
|
|
120
|
-
if (!root)
|
|
121
|
-
return;
|
|
122
|
-
const style = self.getComputedStyle(this);
|
|
123
|
-
const blockSizeProp = style.getPropertyValue('--navigation-bar-block-size') || '0', //`${document.documentElement.computedStyleMap().get(`--navigation-bar-block-size`) ?? '0'}`, //
|
|
124
|
-
blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(style.getPropertyValue('--root-font-size')) || 16 : 1);
|
|
125
|
-
// blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(self.getComputedStyle(document.documentElement).fontSize) : 1)
|
|
126
|
-
const rootMarginTop = `${blockSize}px`;
|
|
127
|
-
if (this.#rootMarginTop === rootMarginTop)
|
|
128
|
-
return;
|
|
129
|
-
this.#rootMarginTop = rootMarginTop;
|
|
130
|
-
// Tear down old observer cleanly before replacing it
|
|
131
|
-
const wasObserving = observing.delete(this);
|
|
132
|
-
this.#scrollObserver?.disconnect();
|
|
133
|
-
this.#scrollObserver = new IntersectionObserver(this.#handleIntersect, {
|
|
134
|
-
root,
|
|
135
|
-
rootMargin: `-${this.#rootMarginTop} 0px 0px 0px`,
|
|
136
|
-
threshold: [0, 1],
|
|
137
|
-
});
|
|
138
|
-
// Re-observe immediately if we were mid-scroll
|
|
139
|
-
if (wasObserving) {
|
|
140
|
-
observing.add(this);
|
|
141
|
-
this.#scrollObserver.observe(this);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
#clearScrollState = () => {
|
|
145
|
-
if (observing.delete(this))
|
|
146
|
-
this.#scrollObserver?.unobserve(this);
|
|
147
|
-
this.#scrollSafetyTimer.cancel();
|
|
148
|
-
};
|
|
149
|
-
#handleScroll = (evt) => {
|
|
150
|
-
if (add(observing, this))
|
|
151
|
-
this.#scrollObserver?.observe(this);
|
|
152
|
-
this.#scrollSafetyTimer.next(() => this.#clearScrollState(), 2000); // reset watchdog every scroll event
|
|
153
|
-
};
|
|
154
|
-
#handleScrollend = (evt) => {
|
|
155
|
-
this.#clearScrollState();
|
|
156
|
-
};
|
|
157
|
-
// #handleResizeend: EventListener = (evt: Event) => {
|
|
158
|
-
// const root = evt.target as HTMLElement
|
|
159
|
-
// const isIntersecting = isIntersectingWithContainer(this, root, `${this.#rootMarginTop} 0px 0px 0px`)
|
|
160
|
-
// this.#applySlowness(root, isIntersecting)
|
|
161
|
-
// }
|
|
162
|
-
#handleIntersect = (entries, { root }) => {
|
|
163
|
-
if (devFlags.debug)
|
|
164
|
-
console.debug(`${_a.name} ⚡️ intersect (${entries?.at(0)?.isIntersecting})`);
|
|
165
|
-
if (!(root instanceof HTMLElement))
|
|
166
|
-
return;
|
|
167
|
-
for (const { isIntersecting } of entries)
|
|
168
|
-
this.#applySlowness(root, isIntersecting);
|
|
169
|
-
// for (const { isIntersecting } of entries) {
|
|
170
|
-
// const value = isIntersecting ? 'large' : 'inline'
|
|
171
|
-
// if (value === root?.getAttribute('navigation-bar-title-display-mode')) continue
|
|
172
|
-
// root?.setAttribute('navigation-bar-title-display-mode', value)
|
|
173
|
-
// if (this.closest('[hidden]')) continue // if (0 === this.offsetHeight + this.offsetWidth) continue
|
|
174
|
-
// if (this.hasAttribute('navigation-bar-auto-hide')) slowHideShow(isIntersecting ? 'show' : 'hide', this)
|
|
175
|
-
// }
|
|
176
|
-
};
|
|
177
|
-
#applySlowness = (root, isIntersecting) => {
|
|
178
|
-
const value = isIntersecting ? 'large' : 'inline';
|
|
179
|
-
if (this.closest('[hidden]'))
|
|
180
|
-
return; // if (0 === this.offsetHeight + this.offsetWidth) continue
|
|
181
|
-
if (value === root?.getAttribute('navigation-bar-title-display-mode'))
|
|
182
|
-
return;
|
|
183
|
-
root?.setAttribute('navigation-bar-title-display-mode', value);
|
|
184
|
-
if (this.hasAttribute('navigation-bar-auto-hide'))
|
|
185
|
-
slowHideShow(isIntersecting ? 'show' : 'hide', this);
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
_a = NavigationLargeTitle;
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
-
import { devFlags } 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
|
-
if (devFlags.debug)
|
|
12
|
-
console.debug(`${NavigationSplitView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
13
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
14
|
-
}
|
|
15
|
-
disconnectedCallback() {
|
|
16
|
-
if (devFlags.debug)
|
|
17
|
-
console.debug(`${NavigationSplitView.name} ⚡️ disconnect`);
|
|
18
|
-
super.disconnectedCallback();
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() {
|
|
21
|
-
if (devFlags.debug)
|
|
22
|
-
console.debug(`${NavigationSplitView.name} ⚡️ connect`);
|
|
23
|
-
super.connectedCallback();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
|
-
import { devFlags } 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
|
-
if (devFlags.debug)
|
|
12
|
-
console.debug(`${NavigationStack.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
13
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
14
|
-
switch (name) {
|
|
15
|
-
case 'hidden':
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
disconnectedCallback() {
|
|
20
|
-
if (devFlags.debug)
|
|
21
|
-
console.debug(`${NavigationStack.name} ⚡️ disconnect`);
|
|
22
|
-
super.disconnectedCallback();
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
if (devFlags.debug)
|
|
26
|
-
console.debug(`${NavigationStack.name} ⚡️ connect`);
|
|
27
|
-
super.connectedCallback();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
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 { 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
|
-
if (devFlags.debug)
|
|
26
|
-
console.debug(`${NavigationTitle_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
27
|
-
this.#render(this.getAttribute('value'), this.getAttribute('subtitle'), this.getAttribute('system-image'), this.getAttribute('system-image-weight'));
|
|
28
|
-
}
|
|
29
|
-
disconnectedCallback() {
|
|
30
|
-
if (devFlags.debug)
|
|
31
|
-
console.debug(`${NavigationTitle_1.name} ⚡️ disconnect`);
|
|
32
|
-
}
|
|
33
|
-
connectedCallback() {
|
|
34
|
-
if (devFlags.debug)
|
|
35
|
-
console.debug(`${NavigationTitle_1.name} ⚡️ connect`);
|
|
36
|
-
}
|
|
37
|
-
#render = (title, subtitle, systemImage, systemImageWeight) => {
|
|
38
|
-
queryMorph(':not([slot])', html `
|
|
39
|
-
<navigation-large-title>
|
|
40
|
-
<v-stack alignment="fill">
|
|
41
|
-
${systemImage ? html `<image-view system-name="${systemImage}" system-weight="${systemImageWeight}" foreground="blue"></image-view>` : null}
|
|
42
|
-
<v-stack spacing="0" alignment="fill">
|
|
43
|
-
${title
|
|
44
|
-
? html `<label-view line-limit="1" truncation-mode="tail" font="headline">
|
|
45
|
-
<span>${title}</span>
|
|
46
|
-
</label-view>`
|
|
47
|
-
: null}
|
|
48
|
-
${subtitle
|
|
49
|
-
? html `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout">
|
|
50
|
-
<span>${subtitle}</span>
|
|
51
|
-
</label-view>`
|
|
52
|
-
: null}
|
|
53
|
-
</v-stack>
|
|
54
|
-
</v-stack>
|
|
55
|
-
</navigation-large-title>
|
|
56
|
-
`, this);
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
NavigationTitle = NavigationTitle_1 = __decorate([
|
|
60
|
-
microtaskOnConnected((el) => {
|
|
61
|
-
const sibling = el.closest('scroll-view'), value = el.getAttribute('value'), subtitle = el.getAttribute('subtitle');
|
|
62
|
-
if (null === value)
|
|
63
|
-
sibling?.removeAttribute('navigation-inline-title');
|
|
64
|
-
else
|
|
65
|
-
sibling?.setAttribute('navigation-inline-title', value);
|
|
66
|
-
if (null === subtitle)
|
|
67
|
-
sibling?.removeAttribute('navigation-inline-subtitle');
|
|
68
|
-
else
|
|
69
|
-
sibling?.setAttribute('navigation-inline-subtitle', subtitle);
|
|
70
|
-
})
|
|
71
|
-
], NavigationTitle);
|
|
72
|
-
export { NavigationTitle };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
2
|
-
declare const pickerStyles: readonly ["menu", "inline", "navigation-link", "sheet", "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 {menu|inline|navigation-link|sheet|automatic} picker-style
|
|
16
|
-
*
|
|
17
|
-
* @attr help — Adds a help tooltip to the trigger of the picker, if style supports one
|
|
18
|
-
*
|
|
19
|
-
* @attr {DictEntry[]} dictionary — Renders all options using this array
|
|
20
|
-
*
|
|
21
|
-
* @attr {vertical|horizontal|auto} label-value-placement
|
|
22
|
-
*
|
|
23
|
-
* @slot — The default slot.
|
|
24
|
-
* @slot label
|
|
25
|
-
* @slot list
|
|
26
|
-
* @slot {HTMLOptionElement[]} validity-options
|
|
27
|
-
*/
|
|
28
|
-
export declare class PickerView extends FormAssociatedBase {
|
|
29
|
-
#private;
|
|
30
|
-
static get ATTR(): {
|
|
31
|
-
PLACEHOLDER: string;
|
|
32
|
-
PLACEHOLDER_ICON: string;
|
|
33
|
-
LABEL: string;
|
|
34
|
-
PICKER_STYLE: string;
|
|
35
|
-
SELECTION: string;
|
|
36
|
-
SEARCHABLE: string;
|
|
37
|
-
CURRENT_VALUE_LABEL: string;
|
|
38
|
-
CURRENT_VALUE_ICON: string;
|
|
39
|
-
TRIGGER_HELP: string;
|
|
40
|
-
DICTIONARY: string;
|
|
41
|
-
REQUIRED: string;
|
|
42
|
-
};
|
|
43
|
-
static get observedAttributes(): string[];
|
|
44
|
-
get selection(): string;
|
|
45
|
-
set selection(v: string);
|
|
46
|
-
get template(): DocumentFragment;
|
|
47
|
-
constructor();
|
|
48
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
49
|
-
disconnectedCallback(): void;
|
|
50
|
-
connectedCallback(): void;
|
|
51
|
-
get pickerStyle(): PickerStyle;
|
|
52
|
-
/**
|
|
53
|
-
* Form participation property
|
|
54
|
-
*/
|
|
55
|
-
get name(): string;
|
|
56
|
-
setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
|
|
57
|
-
setCustomValidity: (message: string) => void;
|
|
58
|
-
formStateRestoreCallback(state: string, reason: string): void;
|
|
59
|
-
formAssociatedCallback(form: HTMLFormElement): void;
|
|
60
|
-
formDisabledCallback(disabled: boolean): void;
|
|
61
|
-
formResetCallback(): void;
|
|
62
|
-
}
|
|
63
|
-
declare global {
|
|
64
|
-
interface HTMLElementTagNameMap {
|
|
65
|
-
'picker-view': PickerView;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export {};
|