@swiftwc/ui 0.0.0-dev.6 → 0.0.0-dev.61
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 +22 -4
- package/generated/client/index.js +219 -181
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +99 -0
- package/generated/components/body-view.js +5 -2
- package/generated/components/bordered-button.d.ts +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 +12 -4
- package/generated/components/borderless-button.js +47 -16
- package/generated/components/color-scheme.d.ts +7 -0
- package/generated/components/color-scheme.js +54 -0
- package/generated/components/confirmation-dialog.d.ts +9 -0
- package/generated/components/confirmation-dialog.js +113 -0
- package/generated/components/content-unavailable-view.d.ts +24 -0
- package/generated/components/content-unavailable-view.js +81 -0
- package/generated/components/date-picker.d.ts +36 -0
- package/generated/components/date-picker.js +461 -0
- package/generated/components/disclosure-group.d.ts +9 -7
- package/generated/components/disclosure-group.js +51 -65
- package/generated/components/fine-tooltip.d.ts +7 -0
- package/generated/components/fine-tooltip.js +107 -0
- package/generated/components/form-view.d.ts +9 -0
- package/generated/components/form-view.js +63 -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 +10 -0
- package/generated/components/h-stack.js +19 -0
- package/generated/components/image-view.d.ts +9 -0
- package/generated/components/image-view.js +46 -0
- package/generated/components/index.d.ts +41 -10
- package/generated/components/index.js +41 -15
- package/generated/components/label-view.d.ts +9 -0
- package/generated/components/label-view.js +51 -0
- package/generated/components/labeled-content.d.ts +9 -0
- package/generated/components/labeled-content.js +115 -0
- package/generated/components/list-view.d.ts +8 -0
- package/generated/components/list-view.js +32 -0
- package/generated/components/menu-view.d.ts +12 -0
- package/generated/components/menu-view.js +142 -0
- package/generated/components/navigation-large-title.d.ts +6 -0
- package/generated/components/navigation-large-title.js +181 -0
- package/generated/components/navigation-split-view.d.ts +7 -2
- package/generated/components/navigation-split-view.js +19 -3
- package/generated/components/navigation-stack.d.ts +6 -2
- package/generated/components/navigation-stack.js +23 -59
- package/generated/components/navigation-title.d.ts +8 -0
- package/generated/components/navigation-title.js +50 -0
- package/generated/components/picker-view.d.ts +44 -0
- package/generated/components/picker-view.js +1009 -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 +13 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.d.ts +1 -1
- package/generated/components/screen-view.js +4 -2
- package/generated/components/scroll-view-proxy.d.ts +8 -0
- package/generated/components/scroll-view-proxy.js +17 -0
- package/generated/components/scroll-view.d.ts +4 -2
- package/generated/components/scroll-view.js +179 -64
- package/generated/components/search-view.d.ts +7 -0
- package/generated/components/search-view.js +30 -0
- package/generated/components/section-view.d.ts +9 -0
- package/generated/components/section-view.js +85 -0
- package/generated/components/sheet-view.d.ts +3 -4
- package/generated/components/sheet-view.js +53 -17
- package/generated/components/sidebar-toggle.d.ts +1 -1
- package/generated/components/sidebar-toggle.js +76 -72
- package/generated/components/sidebar-view.d.ts +2 -4
- package/generated/components/sidebar-view.js +25 -17
- package/generated/components/sticky-container.d.ts +6 -0
- package/generated/components/sticky-container.js +26 -0
- package/generated/components/tab-bar.d.ts +5 -4
- package/generated/components/tab-bar.js +34 -17
- package/generated/components/tab-item.d.ts +4 -3
- package/generated/components/tab-item.js +125 -29
- package/generated/components/tab-view.d.ts +17 -2
- package/generated/components/tab-view.js +252 -17
- package/generated/components/table-view.d.ts +12 -0
- package/generated/components/table-view.js +153 -0
- package/generated/components/text-field.d.ts +29 -0
- package/generated/components/text-field.js +496 -0
- package/generated/components/tool-bar-item-group.d.ts +5 -0
- package/generated/components/tool-bar-item-group.js +28 -0
- package/generated/components/tool-bar-item.d.ts +8 -0
- package/generated/components/tool-bar-item.js +66 -0
- package/generated/components/tool-bar.d.ts +19 -0
- package/generated/components/tool-bar.js +93 -0
- package/generated/components/v-keyboard.d.ts +4 -0
- package/generated/components/v-keyboard.js +72 -70
- package/generated/components/v-stack.d.ts +13 -0
- package/generated/components/v-stack.js +22 -0
- package/generated/css/index.css +8847 -0
- package/generated/events/alert-dialog.d.ts +8 -0
- package/generated/events/confirmation-dialog.d.ts +9 -0
- package/generated/events/confirmation-dialog.js +1 -0
- package/generated/events/date-picker.d.ts +8 -0
- package/generated/events/date-picker.js +1 -0
- package/generated/events/index.d.ts +8 -0
- package/generated/events/index.js +8 -0
- package/generated/events/lifecycle-observer.d.ts +10 -0
- package/generated/events/lifecycle-observer.js +1 -0
- package/generated/events/picker-view.d.ts +15 -0
- package/generated/events/picker-view.js +1 -0
- package/generated/events/scroll-view.d.ts +10 -0
- package/generated/events/scroll-view.js +1 -0
- package/generated/events/tab-view.d.ts +28 -0
- package/generated/events/tab-view.js +1 -0
- package/generated/events/text-field.d.ts +8 -0
- package/generated/events/text-field.js +1 -0
- package/generated/i18n/index.d.ts +34 -0
- package/generated/i18n/index.js +167 -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/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 +23 -0
- package/generated/internal/utils/cash/index.js +25 -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 +90 -0
- package/generated/internal/utils/debounce.d.ts +1 -0
- package/generated/internal/utils/debounce.js +13 -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 +55 -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 +21 -1
- package/generated/internal/utils/index.js +24 -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/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/render-label-icon.d.ts +2 -0
- package/generated/internal/utils/render-label-icon.js +19 -0
- package/generated/internal/utils/render-label-title.d.ts +2 -0
- package/generated/internal/utils/render-label-title.js +16 -0
- package/generated/internal/utils/render-label.d.ts +1 -0
- package/generated/internal/utils/render-label.js +19 -0
- package/generated/internal/utils/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/namespace-browser/base.d.ts +45 -0
- package/generated/namespace-browser/base.js +115 -0
- package/generated/namespace-browser/index.d.ts +7 -0
- package/generated/namespace-browser/index.js +1 -0
- package/generated/snapshot/index.d.ts +4 -11
- package/generated/snapshot/index.js +55 -145
- package/package.json +33 -9
- package/scss/_components.scss +60 -13
- package/scss/_final.scss +1 -0
- package/scss/_functions.scss +10 -0
- package/scss/_mixins.scss +4 -169
- package/scss/_placeholders.scss +3 -0
- package/scss/_transitions.scss +22 -1
- package/scss/_utils.scss +9 -0
- package/scss/_vars.scss +144 -23
- package/scss/base/_layout.scss +40 -16
- package/scss/base/_reboot.scss +151 -15
- package/scss/base/_root.scss +358 -25
- package/scss/colors/_index.scss +788 -70
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_body-view.scss +12 -3
- package/scss/components/_bordered-button.scss +57 -0
- package/scss/components/_bordered-prominent-button.scss +64 -0
- package/scss/components/_borderless-button.scss +36 -6
- package/scss/components/_confirmation-dialog.scss +102 -0
- package/scss/components/_content-unavailable-view.scss +54 -0
- package/scss/components/_date-picker.scss +30 -0
- package/scss/components/_detail-placeholder.scss +153 -0
- package/scss/components/_disclosure-group.scss +147 -48
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +233 -0
- package/scss/components/_full-screen.scss +7 -5
- package/scss/components/_glass-button.scss +59 -0
- package/scss/components/_glass-prominent-button.scss +70 -0
- package/scss/components/_h-divider.scss +13 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +29 -0
- package/scss/components/_image-view.scss +9 -0
- package/scss/components/_index.scss +239 -7
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +372 -0
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +67 -0
- package/scss/components/_list-view.scss +269 -0
- package/scss/components/_menu-view.scss +219 -0
- package/scss/components/_navigation-large-title.scss +27 -0
- package/scss/components/_navigation-split-view.scss +329 -269
- package/scss/components/_navigation-stack.scss +6 -6
- package/scss/components/_navigation-title.scss +10 -0
- package/scss/components/_picker-view.scss +307 -0
- package/scss/components/_plain-button.scss +18 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +79 -0
- package/scss/components/_scroll-view-toolbars.scss +126 -0
- package/scss/components/_scroll-view.scss +114 -66
- package/scss/components/_search-view.scss +22 -0
- package/scss/components/_section-view.scss +119 -0
- package/scss/components/_sheet-view.scss +78 -35
- package/scss/components/_sidebar-toggle.scss +87 -27
- package/scss/components/_sidebar-view.scss +30 -40
- package/scss/components/_sticky-container.scss +42 -0
- package/scss/components/_tab-bar.scss +211 -84
- package/scss/components/_tab-item.scss +25 -0
- package/scss/components/_tab-view.scss +270 -126
- package/scss/components/_table-column.scss +54 -0
- package/scss/components/_table-row.scss +240 -0
- package/scss/components/_table-view.scss +231 -0
- package/scss/components/_text-field.scss +53 -0
- package/scss/components/_tool-bar-item-group.scss +30 -19
- package/scss/components/_tool-bar-item.scss +81 -71
- package/scss/components/_tool-bar.scss +126 -63
- package/scss/components/_v-divider.scss +13 -0
- package/scss/components/_v-flex-stack.scss +29 -0
- package/scss/components/_v-keyboard.scss +6 -4
- package/scss/components/_v-stack.scss +15 -9
- package/scss/final/_touch-glass.scss +91 -0
- package/scss/index.scss +6 -2
- 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 +453 -0
- package/scss/placeholders/_buttons.scss +117 -0
- package/scss/placeholders/_lists.scss +594 -0
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_bwd.navbar.scss +3 -13
- package/scss/transitions/_bwd.scss +4 -20
- 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 +4 -9
- package/scss/transitions/_fwd.scss +4 -34
- package/scss/transitions/_glass-button.scss +12 -0
- package/scss/transitions/_glass-prominent-button.scss +12 -0
- package/scss/transitions/_index.scss +35 -143
- package/scss/transitions/_menu-view.scss +26 -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 +91 -0
- package/scss/utils/_index.scss +78 -0
- package/scss/utils/_scroll-view.scss +14 -0
- package/scss/utils/_spacing.scss +25 -0
- package/scss/utils/_stacks.scss +222 -0
- package/web-components.html-data/en.json +721 -0
- package/generated/components/bottom-bar.d.ts +0 -10
- package/generated/components/bottom-bar.js +0 -73
- package/generated/components/navigation-bar.d.ts +0 -10
- package/generated/components/navigation-bar.js +0 -80
- package/generated/internal/class.d.ts +0 -18
- package/generated/internal/class.js +0 -18
- package/generated/namespace/index.d.ts +0 -6
- package/generated/styles.css +0 -1305
- package/scss/_dev.scss +0 -68
- package/scss/components/_tab-bar-stack.scss +0 -101
- package/scss/components/_toolbars.scss +0 -100
- package/scss/transitions/_dialog.scss +0 -32
- /package/generated/{namespace/index.js → events/alert-dialog.js} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
+
import { devFlags, onoff } from '../internal/utils';
|
|
3
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
export class PlainButton extends ButtonBase {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
static polyfillDisconnectedCallback(el) {
|
|
9
|
+
if (devFlags.debug)
|
|
10
|
+
console.debug(`${PlainButton.name} ⚡️ disconnect`);
|
|
11
|
+
CleanupRegistry.unregister(el);
|
|
12
|
+
}
|
|
13
|
+
static polyfillConnectedCallback(el) {
|
|
14
|
+
if (devFlags.debug)
|
|
15
|
+
console.debug(`${PlainButton.name} ⚡️ connect`);
|
|
16
|
+
el.tabIndex = 0;
|
|
17
|
+
CleanupRegistry.register(el, onoff('click', PlainButton.#handleClick, el).on());
|
|
18
|
+
}
|
|
19
|
+
static #handleClick = async (evt) => {
|
|
20
|
+
// alert(99)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A view that shows the progress toward completion of a task.
|
|
3
|
+
*/
|
|
4
|
+
export declare class ProgressView extends HTMLElement {
|
|
5
|
+
#private;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
get progressViewStyle(): "circular" | "linear";
|
|
8
|
+
get template(): DocumentFragment;
|
|
9
|
+
constructor();
|
|
10
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
+
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
|
+
import { $, devFlags, renderLabel } from '../internal/utils';
|
|
5
|
+
import { Snapshot } from '../snapshot';
|
|
6
|
+
const progressViewStyles = ['circular', 'linear'];
|
|
7
|
+
/**
|
|
8
|
+
* @summary A view that shows the progress toward completion of a task.
|
|
9
|
+
*/
|
|
10
|
+
export class ProgressView extends HTMLElement {
|
|
11
|
+
static get observedAttributes() {
|
|
12
|
+
return ['label', 'current-value-label', 'value'];
|
|
13
|
+
}
|
|
14
|
+
static #templates = new Map();
|
|
15
|
+
#cssStyleObserver;
|
|
16
|
+
#progressViewStyle;
|
|
17
|
+
#lastRenderedStyle;
|
|
18
|
+
#shadowRoot;
|
|
19
|
+
#slots = new Map();
|
|
20
|
+
get progressViewStyle() {
|
|
21
|
+
return this.#progressViewStyle ?? 'circular';
|
|
22
|
+
}
|
|
23
|
+
get template() {
|
|
24
|
+
if (!_a.#templates.has(this.progressViewStyle))
|
|
25
|
+
switch (this.progressViewStyle) {
|
|
26
|
+
case 'linear':
|
|
27
|
+
_a.#templates.set(this.progressViewStyle, $(String.raw `
|
|
28
|
+
<slot></slot>
|
|
29
|
+
<div part="root progress-control progress-line-control"></div>
|
|
30
|
+
<slot name="current-value"></slot>
|
|
31
|
+
`));
|
|
32
|
+
break;
|
|
33
|
+
case 'circular':
|
|
34
|
+
default:
|
|
35
|
+
_a.#templates.set(this.progressViewStyle, $(String.raw `
|
|
36
|
+
<div part="root progress-control progress-circular-control">
|
|
37
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-1"></div>
|
|
38
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-2"></div>
|
|
39
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-3"></div>
|
|
40
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-4"></div>
|
|
41
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-5"></div>
|
|
42
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-6"></div>
|
|
43
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-7"></div>
|
|
44
|
+
<div part="root progress-control progress-circular-blade progress-circular-blade-8"></div>
|
|
45
|
+
</div>
|
|
46
|
+
<slot></slot>
|
|
47
|
+
<slot name="current-value"></slot>
|
|
48
|
+
`));
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
return _a.#templates.get(this.progressViewStyle);
|
|
52
|
+
}
|
|
53
|
+
constructor() {
|
|
54
|
+
super();
|
|
55
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
56
|
+
}
|
|
57
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
58
|
+
if (devFlags.debug)
|
|
59
|
+
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
60
|
+
switch (name) {
|
|
61
|
+
case 'label': {
|
|
62
|
+
const label = this.querySelector(':scope>label-view:not([slot])') ?? this.appendChild($(`<label-view foreground="secondary"></label-view>`, '>1'));
|
|
63
|
+
if (newValue) {
|
|
64
|
+
label.setAttribute('title', newValue);
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
label.removeAttribute('title');
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case 'current-value-label': {
|
|
71
|
+
renderLabel(this, ':scope>[slot=current-value]', `<label-view slot="current-value" font="callout" foreground="secondary"><span></span></label-view>`, newValue);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
disconnectedCallback() {
|
|
77
|
+
if (devFlags.debug)
|
|
78
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
79
|
+
CleanupRegistry.unregister(this);
|
|
80
|
+
}
|
|
81
|
+
connectedCallback() {
|
|
82
|
+
if (devFlags.debug)
|
|
83
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
84
|
+
this.inert = true;
|
|
85
|
+
this.#cssStyleObserver = new CSSStyleObserver({
|
|
86
|
+
properties: ['--progress-view-style-index'],
|
|
87
|
+
});
|
|
88
|
+
this.#cssStyleObserver.observe(this, this.#handleStyleChange);
|
|
89
|
+
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
|
|
90
|
+
}
|
|
91
|
+
#handleStyleChange = () => {
|
|
92
|
+
if (devFlags.debug)
|
|
93
|
+
console.debug(`${_a.name} ⚡️ style`);
|
|
94
|
+
const raw = self.getComputedStyle(this).getPropertyValue('--progress-view-style-index').trim();
|
|
95
|
+
const newValue = progressViewStyles[Number(raw)] ?? progressViewStyles[0];
|
|
96
|
+
if (newValue === this.#progressViewStyle)
|
|
97
|
+
return;
|
|
98
|
+
this.#progressViewStyle = newValue;
|
|
99
|
+
this.#render();
|
|
100
|
+
};
|
|
101
|
+
#render() {
|
|
102
|
+
if (devFlags.debug)
|
|
103
|
+
console.debug(`${_a.name} ⚡️ render (${this.#progressViewStyle})`);
|
|
104
|
+
if (this.#lastRenderedStyle === this.#progressViewStyle)
|
|
105
|
+
return; // skip if already applied
|
|
106
|
+
this.#lastRenderedStyle = this.#progressViewStyle;
|
|
107
|
+
this.#shadowRoot.replaceChildren(document.importNode(this.template, true)); // clear shadow DOM
|
|
108
|
+
CleanupRegistry.unregister(this, 'slots');
|
|
109
|
+
for (const slot of this.#shadowRoot.querySelectorAll('slot'))
|
|
110
|
+
this.#slots?.set(slot.name, slot);
|
|
111
|
+
CleanupRegistry.register(this, () => {
|
|
112
|
+
this.#slots = new Map();
|
|
113
|
+
}, 'slots');
|
|
114
|
+
switch (this.#progressViewStyle
|
|
115
|
+
//
|
|
116
|
+
) {
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
_a = ProgressView;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { devFlags } from '../internal/utils';
|
|
2
|
+
import { DialogBase } from '../namespace-browser/base';
|
|
2
3
|
export class ScreenView extends DialogBase {
|
|
3
4
|
constructor() {
|
|
4
5
|
super();
|
|
5
6
|
}
|
|
6
7
|
disconnectedCallback() {
|
|
7
|
-
|
|
8
|
+
if (devFlags.debug)
|
|
9
|
+
console.debug(`${ScreenView.name} ⚡️ disconnect`);
|
|
8
10
|
}
|
|
9
11
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { devFlags } from '../internal/utils';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A wrapper to {hv}-stacks
|
|
4
|
+
*/
|
|
5
|
+
export class ScrollViewProxy extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
disconnectedCallback() {
|
|
10
|
+
if (devFlags.debug)
|
|
11
|
+
console.debug(`${ScrollViewProxy.name} ⚡️ disconnect`);
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
if (devFlags.debug)
|
|
15
|
+
console.debug(`${ScrollViewProxy.name} ⚡️ connect`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare class ScrollView extends HTMLElement {
|
|
2
2
|
#private;
|
|
3
|
-
static get
|
|
3
|
+
static get observedAttributes(): string[];
|
|
4
|
+
static get template(): DocumentFragment;
|
|
4
5
|
constructor();
|
|
6
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
5
7
|
disconnectedCallback(): void;
|
|
6
8
|
connectedCallback(): void;
|
|
7
|
-
|
|
9
|
+
centerScrollToElement(child: Element): void;
|
|
8
10
|
}
|
|
@@ -1,80 +1,195 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _a, _ScrollView_template, _ScrollView_shadowRoot;
|
|
1
|
+
var _a;
|
|
2
|
+
import { lifecycleObserver } from '../buses';
|
|
3
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
4
|
+
import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
|
|
5
|
+
import { $, devFlags, frame, onoff, renderLabel, slowHideShow } from '../internal/utils';
|
|
6
|
+
const observers = new ResizeObserverSingleton();
|
|
13
7
|
export class ScrollView extends HTMLElement {
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return ['navigation-title', 'navigation-inline-title', 'navigation-inline-subtitle', 'navigation-bar-title-display-mode'];
|
|
10
|
+
}
|
|
11
|
+
static #template;
|
|
14
12
|
static get template() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
return (this.#template ??= $(String.raw `
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<div part="root scroll-view-navbar">
|
|
16
|
+
<div part="root scroll-view-navbar-stack">
|
|
17
|
+
<slot name="top-bar-principal"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div part="root scroll-view-toolbar">
|
|
21
|
+
<div part="root scroll-view-toolbar-stack">
|
|
22
|
+
<slot name="bottom-bar-principal"></slot>
|
|
23
|
+
</div>
|
|
24
|
+
</div>`));
|
|
22
25
|
}
|
|
26
|
+
#shadowRoot;
|
|
27
|
+
#slots = new Map();
|
|
28
|
+
// #navbarPrincipalSlot?: HTMLSlotElement
|
|
29
|
+
#isMidScroll;
|
|
30
|
+
#lastScrollTop = 0;
|
|
31
|
+
// #stopRecordingScrollTop?: boolean = false
|
|
32
|
+
#beforeTabSwapLastScrolltop;
|
|
23
33
|
constructor() {
|
|
24
34
|
super();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
36
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
37
|
+
for (const slot of this.#shadowRoot.querySelectorAll('slot'))
|
|
38
|
+
this.#slots?.set(slot.name, slot);
|
|
39
|
+
CleanupRegistry.register(this, () => {
|
|
40
|
+
this.#slots = new Map();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
44
|
+
if (devFlags.debug)
|
|
45
|
+
console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
46
|
+
switch (name) {
|
|
47
|
+
case 'navigation-inline-title':
|
|
48
|
+
this.#renderNavTitle(newValue, this.getAttribute('navigation-inline-subtitle'));
|
|
49
|
+
break;
|
|
50
|
+
case 'navigation-inline-subtitle':
|
|
51
|
+
this.#renderNavTitle(this.getAttribute('navigation-inline-title'), newValue);
|
|
52
|
+
break;
|
|
53
|
+
case 'navigation-title':
|
|
54
|
+
//
|
|
55
|
+
break;
|
|
56
|
+
case 'navigation-bar-title-display-mode':
|
|
57
|
+
if (oldValue === newValue)
|
|
58
|
+
break;
|
|
59
|
+
this.#syncSibling(`${oldValue}${newValue}`);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
35
62
|
}
|
|
36
63
|
disconnectedCallback() {
|
|
37
|
-
|
|
64
|
+
if (devFlags.debug)
|
|
65
|
+
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
66
|
+
CleanupRegistry.unregister(this);
|
|
67
|
+
observers.unobserve(this);
|
|
68
|
+
frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('pagehide', { detail: { page: this }, bubbles: true, composed: true })));
|
|
38
69
|
}
|
|
39
70
|
connectedCallback() {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
if (devFlags.debug)
|
|
72
|
+
console.debug(`${_a.name} ⚡️ connect`);
|
|
73
|
+
CleanupRegistry.register(this, onoff([
|
|
74
|
+
// { types: 'tabreveal', listener: this.#handleTabReveal as EventListener },
|
|
75
|
+
{ types: 'beforetabswap', listener: this.#handleTabBeforeswap },
|
|
76
|
+
], this.closest('tab-view') ?? undefined).on());
|
|
77
|
+
CleanupRegistry.register(this, onoff([
|
|
78
|
+
{ types: 'scroll', listener: this.#handleScroll, addOptions: { passive: true } },
|
|
79
|
+
{ types: 'scrollend', listener: this.#handleScrollend, addOptions: { passive: true } },
|
|
80
|
+
], this).on());
|
|
81
|
+
frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('pageshow', { detail: { page: this }, bubbles: true, composed: true })));
|
|
82
|
+
observers.observe(this, this.#handleMeasure.bind(this));
|
|
83
|
+
// frame(this).then((r) => {
|
|
84
|
+
// if (!r) return
|
|
85
|
+
// let first = true
|
|
86
|
+
// observeResizeEnd(this, () => {
|
|
87
|
+
// if (first) {
|
|
88
|
+
// first = false
|
|
89
|
+
// return
|
|
90
|
+
// }
|
|
91
|
+
// this.dispatchEvent(new CustomEvent('resizeend', { bubbles: true, composed: true }))
|
|
92
|
+
// })
|
|
93
|
+
// })
|
|
56
94
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
95
|
+
#syncSibling = (comp) => {
|
|
96
|
+
if (!this.isConnected)
|
|
97
|
+
return;
|
|
98
|
+
if (this.closest('[hidden]'))
|
|
99
|
+
return; // iREPAINT ALERT! if (0 === this.offsetHeight + this.offsetWidth) break
|
|
100
|
+
if (!this.#isMidScroll)
|
|
101
|
+
return;
|
|
102
|
+
const title = this.#slots?.get('top-bar-principal')?.assignedElements({ flatten: true })?.at(0);
|
|
103
|
+
slowHideShow('largeinline' === `${comp}` ? 'show' : 'hide', title);
|
|
104
|
+
};
|
|
105
|
+
#handleScroll = ({ target, type }) => {
|
|
106
|
+
if (devFlags.debug)
|
|
107
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
108
|
+
if (!this.#isMidScroll)
|
|
109
|
+
this.#isMidScroll = true;
|
|
110
|
+
// if (this.#stopRecordingScrollTop) return
|
|
111
|
+
if (!(target instanceof HTMLElement))
|
|
112
|
+
return;
|
|
113
|
+
this.#lastScrollTop = target.scrollTop;
|
|
114
|
+
};
|
|
115
|
+
#handleScrollend = (evt) => {
|
|
116
|
+
if (devFlags.debug)
|
|
117
|
+
console.debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
118
|
+
if (this.#isMidScroll)
|
|
119
|
+
this.#isMidScroll = false;
|
|
120
|
+
};
|
|
121
|
+
#handleMeasure = (entry) => {
|
|
122
|
+
if (devFlags.debug)
|
|
123
|
+
console.debug(`${_a.name} ⚡️ measure`);
|
|
124
|
+
if (0 === entry.contentRect.width + entry.contentRect.height)
|
|
125
|
+
return;
|
|
126
|
+
if (undefined === this.#beforeTabSwapLastScrolltop)
|
|
127
|
+
return;
|
|
128
|
+
if (this.#beforeTabSwapLastScrolltop === this.#lastScrollTop)
|
|
129
|
+
return;
|
|
130
|
+
// this.#stopRecordingScrollTop = true
|
|
131
|
+
entry.target.scrollTop = this.#beforeTabSwapLastScrolltop;
|
|
132
|
+
// entry.target.scrollTo({
|
|
133
|
+
// top: this.#beforeTabSwapLastScrolltop,
|
|
134
|
+
// behavior: 'smooth',
|
|
135
|
+
// }) //
|
|
136
|
+
// this.#stopRecordingScrollTop = false
|
|
137
|
+
this.#beforeTabSwapLastScrolltop = undefined;
|
|
138
|
+
};
|
|
139
|
+
// #handleTabReveal = ({ type, target }: CustomEvent<TabDetail>) => {
|
|
140
|
+
// if (devFlags.debug) console.debug(`${ScrollView.name} ⚡️ ${type}`)
|
|
141
|
+
// if (!(target instanceof HTMLElement)) return
|
|
142
|
+
// if (!target.contains(this)) return
|
|
143
|
+
// if (this.closest('[hidden]')) return
|
|
144
|
+
// // console.log(888, this.#beforeTabSwapLastScrolltop, this.#lastScrollTop)
|
|
145
|
+
// // this.style.setProperty('clip-path', 'inset(50%)')
|
|
146
|
+
// // this.style.setProperty('opacity', '0.001')
|
|
147
|
+
// // this.style.opacity = '0.001'
|
|
148
|
+
// // console.log(99, this.style.opacity)
|
|
149
|
+
// // self.requestAnimationFrame(() => {
|
|
150
|
+
// // if (undefined === this.#beforeTabSwapLastScrolltop) return
|
|
151
|
+
// // if (this.#beforeTabSwapLastScrolltop === this.#lastScrollTop) return
|
|
152
|
+
// // this.#stopRecordingScrollTop = true
|
|
153
|
+
// // // console.log(999, this.#beforeTabSwapLastScrolltop)
|
|
154
|
+
// // // console.log(999, this, this.#beforeTabSwapLastScrolltop, this.#lastScrollTop)
|
|
155
|
+
// // this.scrollTop = this.#beforeTabSwapLastScrolltop
|
|
156
|
+
// // // this.scrollTo({
|
|
157
|
+
// // // top: this.#beforeTabSwapLastScrolltop,
|
|
158
|
+
// // // behavior: 'instant',
|
|
159
|
+
// // // }) //
|
|
160
|
+
// // this.#stopRecordingScrollTop = false
|
|
161
|
+
// // this.#beforeTabSwapLastScrolltop = undefined
|
|
162
|
+
// // // self.requestAnimationFrame(() => {
|
|
163
|
+
// // // // this.style.removeProperty('opacity')
|
|
164
|
+
// // // })
|
|
165
|
+
// // })
|
|
166
|
+
// }
|
|
167
|
+
#handleTabBeforeswap = ({ type, target }) => {
|
|
168
|
+
if (devFlags.debug)
|
|
169
|
+
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
170
|
+
if (!(target instanceof HTMLElement))
|
|
171
|
+
return;
|
|
172
|
+
if (!target.contains(this))
|
|
173
|
+
return;
|
|
174
|
+
if (this.closest('[hidden]'))
|
|
175
|
+
return;
|
|
176
|
+
this.#beforeTabSwapLastScrolltop = this.scrollTop; //#lastScrollTop
|
|
177
|
+
};
|
|
178
|
+
centerScrollToElement(child) {
|
|
64
179
|
// scrollTop needed to center child
|
|
65
|
-
const parentRect = this.getBoundingClientRect();
|
|
66
|
-
const childRect = child.getBoundingClientRect();
|
|
180
|
+
const parentRect = this.getBoundingClientRect(), childRect = child.getBoundingClientRect();
|
|
67
181
|
// current scroll + offset of child relative to parent
|
|
68
|
-
const
|
|
69
|
-
childRect.top -
|
|
70
|
-
parentRect.top -
|
|
71
|
-
parentRect.height / 2 +
|
|
72
|
-
childRect.height / 2;
|
|
182
|
+
const top = this.scrollTop + childRect.top - parentRect.top - parentRect.height / 2 + childRect.height / 2;
|
|
73
183
|
this.scrollTo({
|
|
74
|
-
top
|
|
75
|
-
behavior: 'smooth', // optional: smooth scroll
|
|
184
|
+
top,
|
|
185
|
+
behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant', // optional: smooth scroll
|
|
76
186
|
});
|
|
77
187
|
}
|
|
188
|
+
#renderNavTitle = (title, subtitle) => {
|
|
189
|
+
const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`, subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`;
|
|
190
|
+
const vStack = this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal">${titleTemplate}${subtitleTemplate}</v-stack>`, '>1'));
|
|
191
|
+
renderLabel(vStack, ':scope>label-view:nth-child(1)', titleTemplate, title);
|
|
192
|
+
renderLabel(vStack, ':scope>label-view:nth-child(2)', subtitleTemplate, subtitle);
|
|
193
|
+
};
|
|
78
194
|
}
|
|
79
|
-
_a = ScrollView
|
|
80
|
-
_ScrollView_template = { value: void 0 };
|
|
195
|
+
_a = ScrollView;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputBase } from '../namespace-browser/base';
|
|
2
|
+
export declare class SearchView extends InputBase {
|
|
3
|
+
constructor();
|
|
4
|
+
static polyfillDisconnectedCallback(el: InputBase): void;
|
|
5
|
+
static polyfillConnectedCallback(el: InputBase): void;
|
|
6
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
+
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
3
|
+
import { InputBase } from '../namespace-browser/base';
|
|
4
|
+
export class SearchView extends InputBase {
|
|
5
|
+
// static get observedAttributes() {
|
|
6
|
+
// return ['role', 'title-key']
|
|
7
|
+
// }
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
static polyfillDisconnectedCallback(el) {
|
|
12
|
+
if (devFlags.debug)
|
|
13
|
+
console.debug(`${SearchView.name} ⚡️ disconnect`);
|
|
14
|
+
CleanupRegistry.unregister(el);
|
|
15
|
+
}
|
|
16
|
+
static polyfillConnectedCallback(el) {
|
|
17
|
+
if (devFlags.debug)
|
|
18
|
+
console.debug(`${SearchView.name} ⚡️ connect`);
|
|
19
|
+
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
20
|
+
el.type = 'search';
|
|
21
|
+
}
|
|
22
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
23
|
+
if (devFlags.debug)
|
|
24
|
+
console.debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
25
|
+
const node = target instanceof HTMLInputElement;
|
|
26
|
+
if (!node)
|
|
27
|
+
return;
|
|
28
|
+
//
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class SectionView extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
static get observedAttributes(): string[];
|
|
4
|
+
static get template(): DocumentFragment;
|
|
5
|
+
constructor();
|
|
6
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { $, devFlags, renderLabel } from '../internal/utils';
|
|
2
|
+
export class SectionView extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return ['header', 'footer'];
|
|
5
|
+
}
|
|
6
|
+
static #template;
|
|
7
|
+
static get template() {
|
|
8
|
+
return (this.#template ??= $(String.raw `
|
|
9
|
+
<div part="root section-main-stack">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div part="root section-header-stack">
|
|
13
|
+
<slot name="header"></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div part="root section-footer-stack">
|
|
16
|
+
<slot name="footer"></slot>
|
|
17
|
+
</div>`));
|
|
18
|
+
// <div class="sticky-sentinel" style="grid-area:sentinel;inline-size:100%;block-size:0.1px;pointer-events:none;"></div>
|
|
19
|
+
}
|
|
20
|
+
#shadowRoot;
|
|
21
|
+
// #observer?: IntersectionObserver
|
|
22
|
+
// #sibling?: HTMLElement
|
|
23
|
+
// #sentinel?: HTMLElement
|
|
24
|
+
// #sentinelIsIntersecting: boolean = false
|
|
25
|
+
// #isIntersecting: boolean = false
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
29
|
+
// Snapshot.waitReady.then(() => {
|
|
30
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
31
|
+
// this.#sentinel = this.#shadowRoot.querySelector('.sticky-sentinel') ?? undefined
|
|
32
|
+
// })
|
|
33
|
+
}
|
|
34
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
35
|
+
if (devFlags.debug)
|
|
36
|
+
console.debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
37
|
+
// Snapshot.waitReady.then(() => {
|
|
38
|
+
switch (name) {
|
|
39
|
+
case 'header':
|
|
40
|
+
let header = this.querySelector(':scope>[slot=header]');
|
|
41
|
+
if (newValue) {
|
|
42
|
+
const el = header ?? $(`<header slot="header"></header>`, '>1');
|
|
43
|
+
renderLabel(el, ':scope>label-view', `<label-view line-limit="1" truncation-mode="tail" font="callout"><span></span></label-view>`, newValue);
|
|
44
|
+
header ??= this.appendChild(el);
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
header?.remove();
|
|
48
|
+
break;
|
|
49
|
+
case 'footer':
|
|
50
|
+
let footer = this.querySelector(':scope>[slot=footer]');
|
|
51
|
+
if (newValue) {
|
|
52
|
+
const el = footer ?? $(`<footer slot="footer"></footer>`, '>1');
|
|
53
|
+
renderLabel(el, ':scope>label-view', `<label-view line-limit="1" truncation-mode="tail" font="callout"><span></span></label-view>`, newValue);
|
|
54
|
+
footer ??= this.appendChild(el);
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
footer?.remove();
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
// })
|
|
61
|
+
}
|
|
62
|
+
disconnectedCallback() {
|
|
63
|
+
if (devFlags.debug)
|
|
64
|
+
console.debug(`${SectionView.name} ⚡️ disconnect`);
|
|
65
|
+
// if (this.#sentinel) this.#observer?.unobserve(this.#sentinel)
|
|
66
|
+
// this.#observer?.unobserve(this)
|
|
67
|
+
}
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
if (devFlags.debug)
|
|
70
|
+
console.debug(`${SectionView.name} ⚡️ connect`);
|
|
71
|
+
// this.#sibling = this.closest('scroll-view') ?? undefined
|
|
72
|
+
// Snapshot.waitReady.then(() => {
|
|
73
|
+
// if (!(await frame(this))) return // NOTE: Required or BREAKS transitions // self.requestAnimationFrame(() => {
|
|
74
|
+
// const blockSizeProp = getComputedStyle(this).getPropertyValue('--navigation-bar-block-size') || '0', //`${document.documentElement.computedStyleMap().get(`--navigation-bar-block-size`) ?? '0'}`, //
|
|
75
|
+
// blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(getComputedStyle(document.documentElement).fontSize) : 1)
|
|
76
|
+
// this.#observer = new IntersectionObserver(this.#handleIntersect, {
|
|
77
|
+
// root: this.#sibling,
|
|
78
|
+
// rootMargin: `-${blockSize}px 0px 0px 0px`,
|
|
79
|
+
// threshold: [0, 1],
|
|
80
|
+
// })
|
|
81
|
+
// if (this.#sentinel) this.#observer.observe(this.#sentinel)
|
|
82
|
+
// this.#observer.observe(this)
|
|
83
|
+
// })
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { DialogBase } from '../
|
|
1
|
+
import { DialogBase } from '../namespace-browser/base';
|
|
2
2
|
export declare class SheetView extends DialogBase {
|
|
3
|
+
#private;
|
|
3
4
|
constructor();
|
|
4
|
-
disconnectedCallback(): void;
|
|
5
|
-
connectedCallback(): void;
|
|
6
5
|
static polyfillDisconnectedCallback(el: SheetView): void;
|
|
7
6
|
static polyfillConnectedCallback(el: SheetView): void;
|
|
8
|
-
static
|
|
7
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
9
8
|
}
|