@swiftwc/ui 0.0.0-dev.1 → 0.0.0-dev.100
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/README.md +15 -0
- 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 -2
- package/generated/client/index.js +279 -8
- package/generated/components/alert-dialog.d.ts +11 -0
- package/generated/components/alert-dialog.js +102 -0
- package/generated/components/body-view.d.ts +13 -0
- package/generated/components/body-view.js +17 -0
- package/generated/components/bordered-button.d.ts +17 -0
- package/generated/components/bordered-button.js +56 -0
- package/generated/components/bordered-prominent-button.d.ts +17 -0
- package/generated/components/bordered-prominent-button.js +56 -0
- package/generated/components/borderless-button.d.ts +17 -0
- package/generated/components/borderless-button.js +56 -0
- package/generated/components/color-scheme.d.ts +12 -0
- package/generated/components/color-scheme.js +54 -0
- package/generated/components/confirmation-dialog.d.ts +12 -0
- package/generated/components/confirmation-dialog.js +116 -0
- package/generated/components/content-unavailable.d.ts +30 -0
- package/generated/components/content-unavailable.js +82 -0
- package/generated/components/date-picker.d.ts +52 -0
- package/generated/components/date-picker.js +480 -0
- package/generated/components/disclosure-group.d.ts +17 -0
- package/generated/components/disclosure-group.js +66 -0
- package/generated/components/fine-tooltip.d.ts +15 -0
- package/generated/components/fine-tooltip.js +111 -0
- package/generated/components/form-view.d.ts +16 -0
- package/generated/components/form-view.js +65 -0
- package/generated/components/glass-button.d.ts +16 -0
- package/generated/components/glass-button.js +53 -0
- package/generated/components/glass-prominent-button.d.ts +16 -0
- package/generated/components/glass-prominent-button.js +53 -0
- package/generated/components/h-stack.d.ts +22 -0
- package/generated/components/h-stack.js +26 -0
- package/generated/components/image-view.d.ts +18 -0
- package/generated/components/image-view.js +68 -0
- package/generated/components/index.d.ts +47 -1
- package/generated/components/index.js +47 -6
- package/generated/components/label-view.d.ts +27 -0
- package/generated/components/label-view.js +87 -0
- package/generated/components/labeled-content.d.ts +33 -0
- package/generated/components/labeled-content.js +161 -0
- package/generated/components/list-view.d.ts +15 -0
- package/generated/components/list-view.js +22 -0
- package/generated/components/menu-view.d.ts +20 -0
- package/generated/components/menu-view.js +140 -0
- package/generated/components/navigation-large-title.d.ts +18 -0
- package/generated/components/navigation-large-title.js +188 -0
- package/generated/components/navigation-split-view.d.ts +15 -0
- package/generated/components/navigation-split-view.js +25 -0
- package/generated/components/navigation-stack.d.ts +15 -0
- package/generated/components/navigation-stack.js +29 -0
- package/generated/components/navigation-title.d.ts +18 -0
- package/generated/components/navigation-title.js +72 -0
- package/generated/components/picker-view.d.ts +68 -0
- package/generated/components/picker-view.js +1153 -0
- package/generated/components/plain-button.d.ts +7 -0
- package/generated/components/plain-button.js +22 -0
- package/generated/components/progress-view.d.ts +20 -0
- package/generated/components/progress-view.js +125 -0
- package/generated/components/screen-view.d.ts +5 -0
- package/generated/components/screen-view.js +11 -0
- package/generated/components/scroll-view-proxy.d.ts +13 -0
- package/generated/components/scroll-view-proxy.js +17 -0
- package/generated/components/scroll-view.d.ts +22 -0
- package/generated/components/scroll-view.js +237 -0
- package/generated/components/search-view.d.ts +12 -0
- package/generated/components/search-view.js +27 -0
- package/generated/components/section-view.d.ts +21 -0
- package/generated/components/section-view.js +64 -0
- package/generated/components/sheet-view.d.ts +11 -0
- package/generated/components/sheet-view.js +45 -0
- package/generated/components/sidebar-toggle.d.ts +15 -0
- package/generated/components/sidebar-toggle.js +88 -0
- package/generated/components/sidebar-view.d.ts +10 -0
- package/generated/components/sidebar-view.js +37 -0
- package/generated/components/sticky-container.d.ts +11 -0
- package/generated/components/sticky-container.js +26 -0
- package/generated/components/tab-bar.d.ts +10 -0
- package/generated/components/tab-bar.js +40 -0
- package/generated/components/tab-item.d.ts +10 -0
- package/generated/components/tab-item.js +134 -0
- package/generated/components/tab-view.d.ts +31 -0
- package/generated/components/tab-view.js +198 -0
- package/generated/components/table-view.d.ts +26 -0
- package/generated/components/table-view.js +161 -0
- package/generated/components/text-field.d.ts +42 -0
- package/generated/components/text-field.js +526 -0
- package/generated/components/toggle-view.d.ts +43 -0
- package/generated/components/toggle-view.js +371 -0
- package/generated/components/tool-bar-item-group.d.ts +13 -0
- package/generated/components/tool-bar-item-group.js +31 -0
- package/generated/components/tool-bar-item.d.ts +16 -0
- package/generated/components/tool-bar-item.js +69 -0
- package/generated/components/tool-bar.d.ts +26 -0
- package/generated/components/tool-bar.js +95 -0
- package/generated/components/v-keyboard.d.ts +18 -0
- package/generated/components/v-keyboard.js +87 -0
- package/generated/components/v-stack.d.ts +25 -0
- package/generated/components/v-stack.js +29 -0
- package/generated/css/index.css +10644 -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.js +1 -1
- 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 +26 -0
- package/generated/internal/class/form-associated-base.d.ts +16 -0
- package/generated/internal/class/form-associated-base.js +78 -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 +72 -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 +50 -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/privateNamespace.d.ts +14 -0
- package/generated/internal/privateNamespace.js +168 -0
- package/generated/internal/utils/add.d.ts +1 -0
- package/generated/internal/utils/add.js +7 -0
- package/generated/internal/utils/cash/ancestors.d.ts +1 -0
- package/generated/internal/utils/cash/ancestors.js +27 -0
- package/generated/internal/utils/cash/index.d.ts +24 -0
- package/generated/internal/utils/cash/index.js +27 -0
- package/generated/internal/utils/cash/next-all.d.ts +1 -0
- package/generated/internal/utils/cash/next-all.js +10 -0
- package/generated/internal/utils/cash/next.d.ts +1 -0
- package/generated/internal/utils/cash/next.js +9 -0
- package/generated/internal/utils/cash/prev-all.d.ts +1 -0
- package/generated/internal/utils/cash/prev-all.js +10 -0
- package/generated/internal/utils/cash/prev.d.ts +1 -0
- package/generated/internal/utils/cash/prev.js +9 -0
- package/generated/internal/utils/cash/prop.d.ts +18 -0
- package/generated/internal/utils/cash/prop.js +30 -0
- package/generated/internal/utils/cash/siblings.d.ts +1 -0
- package/generated/internal/utils/cash/siblings.js +10 -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/define-translations.d.ts +1 -0
- package/generated/internal/utils/define-translations.js +3 -0
- 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 +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 +20 -1
- package/generated/internal/utils/index.js +23 -1
- 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 -1
- package/generated/internal/utils/kebab-case.js +6 -9
- 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/onoff.d.ts +45 -0
- package/generated/internal/utils/onoff.js +31 -0
- package/generated/internal/utils/set.d.ts +1 -0
- package/generated/internal/utils/set.js +7 -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 +60 -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 +49 -8
- package/scss/_base.scss +5 -0
- package/scss/_components.scss +90 -0
- package/scss/_final.scss +1 -0
- package/scss/_functions.scss +31 -0
- package/scss/_maps.scss +293 -0
- package/scss/_mixins.scss +7 -0
- package/scss/_placeholders.scss +3 -0
- package/scss/_transitions.scss +32 -0
- package/scss/_utils.scss +9 -0
- package/scss/_vars.scss +68 -0
- package/scss/base/_layout.scss +66 -0
- package/scss/base/_reboot.scss +191 -0
- package/scss/base/_root.scss +415 -0
- package/scss/colors/_index.scss +881 -0
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_body-view.scss +17 -0
- package/scss/components/_bordered-button.scss +59 -0
- package/scss/components/_bordered-prominent-button.scss +65 -0
- package/scss/components/_borderless-button.scss +45 -0
- package/scss/components/_confirmation-dialog.scss +102 -0
- package/scss/components/_content-unavailable.scss +57 -0
- package/scss/components/_date-picker.scss +30 -0
- package/scss/components/_detail-placeholder.scss +153 -0
- package/scss/components/_disclosure-group.scss +179 -0
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +234 -0
- package/scss/components/_full-screen.scss +15 -0
- package/scss/components/_glass-button.scss +61 -0
- package/scss/components/_glass-prominent-button.scss +71 -0
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_h-divider.scss +13 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +28 -0
- package/scss/components/_image-view.scss +20 -0
- package/scss/components/_index.scss +264 -0
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +371 -0
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +75 -0
- package/scss/components/_list-view.scss +270 -0
- package/scss/components/_menu-view.scss +223 -0
- package/scss/components/_navigation-large-title.scss +44 -0
- package/scss/components/_navigation-split-view.scss +424 -0
- package/scss/components/_navigation-stack.scss +11 -0
- package/scss/components/_navigation-title.scss +10 -0
- package/scss/components/_picker-view.scss +329 -0
- package/scss/components/_plain-button.scss +19 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +81 -0
- package/scss/components/_scroll-view-toolbars.scss +132 -0
- package/scss/components/_scroll-view.scss +134 -0
- package/scss/components/_search-view.scss +23 -0
- package/scss/components/_section-view.scss +120 -0
- package/scss/components/_sheet-view.scss +103 -0
- package/scss/components/_sidebar-toggle.scss +121 -0
- package/scss/components/_sidebar-view.scss +53 -0
- package/scss/components/_sticky-container.scss +42 -0
- package/scss/components/_tab-bar.scss +268 -0
- package/scss/components/_tab-item.scss +25 -0
- package/scss/components/_tab-view.scss +312 -0
- package/scss/components/_table-column.scss +54 -0
- package/scss/components/_table-row.scss +240 -0
- package/scss/components/_table-view.scss +232 -0
- package/scss/components/_text-field.scss +57 -0
- package/scss/components/_text-view.scss +57 -0
- package/scss/components/_toggle-view.scss +161 -0
- package/scss/components/_tool-bar-item-group.scss +48 -0
- package/scss/components/_tool-bar-item.scss +97 -0
- package/scss/components/_tool-bar.scss +153 -0
- package/scss/components/_v-divider.scss +13 -0
- package/scss/components/_v-flex-stack.scss +29 -0
- package/scss/components/_v-keyboard.scss +14 -0
- package/scss/components/_v-stack.scss +24 -0
- package/scss/final/_touch-glass.scss +98 -0
- package/scss/index.scss +18 -1
- package/scss/mixins/_button.scss +44 -0
- package/scss/mixins/_color.scss +16 -0
- package/scss/mixins/_dialog.scss +89 -0
- package/scss/mixins/_index.scss +473 -0
- package/scss/placeholders/_buttons.scss +118 -0
- package/scss/placeholders/_lists.scss +622 -0
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_bwd.navbar.scss +19 -0
- package/scss/transitions/_bwd.scss +39 -0
- package/scss/transitions/_confirmation-dialog.scss +27 -0
- package/scss/transitions/_disclosure-group.scss +35 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_fwd.navbar.scss +41 -0
- package/scss/transitions/_fwd.scss +24 -0
- package/scss/transitions/_glass-button.scss +12 -0
- package/scss/transitions/_glass-prominent-button.scss +12 -0
- package/scss/transitions/_index.scss +74 -0
- package/scss/transitions/_menu-view.scss +28 -0
- package/scss/transitions/_navigation-split-view.scss +23 -0
- package/scss/transitions/_progress-view.scss +23 -0
- package/scss/transitions/_sheet-view.scss +30 -0
- package/scss/transitions/_sidebar-view.scss +36 -0
- package/scss/transitions/_tab-bar.scss +20 -0
- package/scss/utils/_frame.scss +103 -0
- package/scss/utils/_index.scss +54 -0
- package/scss/utils/_scroll-view.scss +14 -0
- package/scss/utils/_spacing.scss +25 -0
- package/scss/utils/_stacks.scss +112 -0
- package/web-components.css-data/en.json +28 -0
- package/web-components.html-data/en.json +2604 -0
- package/generated/internal/snapshot.d.ts +0 -5
- package/generated/internal/snapshot.js +0 -23
- package/generated/styles.css +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
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;
|
|
@@ -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,25 @@
|
|
|
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
|
+
}
|
|
@@ -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,29 @@
|
|
|
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
|
+
}
|
|
@@ -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,72 @@
|
|
|
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 };
|
|
@@ -0,0 +1,68 @@
|
|
|
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 {};
|