@swiftwc/ui 0.0.0-dev.7 → 0.0.0-dev.70
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 +25 -4
- package/generated/client/index.js +234 -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 +16 -0
- package/generated/components/h-stack.js +25 -0
- package/generated/components/image-view.d.ts +9 -0
- package/generated/components/image-view.js +46 -0
- package/generated/components/index.d.ts +42 -10
- package/generated/components/index.js +42 -15
- package/generated/components/label-view.d.ts +14 -0
- package/generated/components/label-view.js +56 -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 +55 -0
- package/generated/components/picker-view.js +1023 -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/toggle-view.d.ts +28 -0
- package/generated/components/toggle-view.js +222 -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 +19 -0
- package/generated/components/v-stack.js +28 -0
- package/generated/css/index.css +8966 -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 +9 -0
- package/generated/events/index.js +9 -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/events/toggle-view.d.ts +9 -0
- package/generated/events/toggle-view.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/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +3 -0
- package/generated/tpl/index.d.ts +4 -0
- package/generated/tpl/index.js +4 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +131 -0
- package/package.json +34 -9
- package/scss/_components.scss +62 -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 +843 -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 +45 -0
- package/scss/components/_image-view.scss +9 -0
- package/scss/components/_index.scss +243 -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 +223 -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 +322 -0
- package/scss/components/_plain-button.scss +18 -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 +126 -0
- package/scss/components/_scroll-view.scss +114 -66
- package/scss/components/_search-view.scss +22 -0
- package/scss/components/_section-view.scss +120 -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 +215 -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 +57 -0
- package/scss/components/_toggle-view.scss +79 -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 +123 -60
- 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 +461 -0
- package/scss/placeholders/_buttons.scss +117 -0
- package/scss/placeholders/_lists.scss +596 -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 +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 +91 -0
- package/scss/utils/_index.scss +83 -0
- package/scss/utils/_scroll-view.scss +14 -0
- package/scss/utils/_spacing.scss +25 -0
- package/scss/utils/_stacks.scss +225 -0
- package/web-components.html-data/en.json +950 -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
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @swiftwc/ui
|
|
2
|
+
|
|
3
|
+
[README](https://github.com/swiftwc/ui/blob/main/README.md)
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Visit [swiftwc.github.io/ui/](https://swiftwc.github.io/ui/) to view the documentation.
|
|
8
|
+
|
|
9
|
+
## Contributing
|
|
10
|
+
|
|
11
|
+
Please read the [contributing guide](https://github.com/swiftwc/ui/blob/main/CONTRIBUTING.md).
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
Licensed under the [MIT license](https://github.com/swiftwc/ui/blob/main/LICENSE.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default new EventTarget();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default new EventTarget();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as alertDialog } from './alert-dialog';
|
|
2
|
+
export * from './alert-dialog';
|
|
3
|
+
export { default as confirmationDialog } from './confirmation-dialog';
|
|
4
|
+
export * from './confirmation-dialog';
|
|
5
|
+
export { default as lifecycleObserver } from './lifecycle-observer';
|
|
6
|
+
export * from './lifecycle-observer';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as alertDialog } from './alert-dialog';
|
|
2
|
+
export * from './alert-dialog';
|
|
3
|
+
export { default as confirmationDialog } from './confirmation-dialog';
|
|
4
|
+
export * from './confirmation-dialog';
|
|
5
|
+
export { default as lifecycleObserver } from './lifecycle-observer';
|
|
6
|
+
export * from './lifecycle-observer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default new EventTarget();
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
+
import { lifecycleObserver } from '../buses';
|
|
2
|
+
import { I18n } from '../i18n';
|
|
3
|
+
import { NavigationPath } from '../internal/class/navigation-path';
|
|
4
|
+
import { type NavigationHost, queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
|
|
5
|
+
import { type WebComponentCtor } from '../namespace-browser';
|
|
1
6
|
import { Snapshot } from '../snapshot';
|
|
2
|
-
import { type WebComponentCtor } from '../namespace';
|
|
3
7
|
export declare const polyfills: Map<string, WebComponentCtor>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
export declare const alert: (title?: string, message?: string, actions?: {
|
|
9
|
+
label?: string;
|
|
10
|
+
image?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
}[], options?: {
|
|
13
|
+
titleVisibility?: boolean;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}) => Promise<string | undefined> & {
|
|
16
|
+
dismiss: (reason?: unknown) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const confirmationDialog: (trigger: HTMLElement, title: string, message?: string, actions?: {
|
|
19
|
+
label?: string;
|
|
20
|
+
image?: string;
|
|
21
|
+
role?: string;
|
|
22
|
+
}[], options?: {
|
|
23
|
+
controller?: AbortController;
|
|
24
|
+
titleVisibility?: boolean;
|
|
25
|
+
}) => Promise<string>;
|
|
26
|
+
export { I18n, lifecycleObserver, NavigationPath, queryInsertPosition, Snapshot, startViewTransition };
|
|
27
|
+
export { type NavigationHost };
|
|
@@ -1,70 +1,101 @@
|
|
|
1
|
+
import { alertDialog, confirmationDialog as confirmationDialogBus, lifecycleObserver } from '../buses';
|
|
1
2
|
import * as Components from '../components';
|
|
2
|
-
import {
|
|
3
|
+
import { I18n } from '../i18n';
|
|
4
|
+
import { NavigationPath } from '../internal/class/navigation-path';
|
|
5
|
+
import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
|
|
6
|
+
import { $, devFlags, kebabCase, onoff } from '../internal/utils';
|
|
3
7
|
import { Snapshot } from '../snapshot';
|
|
8
|
+
import { html, render } from '../tpl';
|
|
9
|
+
//#region polyfills
|
|
4
10
|
export const polyfills = new Map();
|
|
5
|
-
for (const [k,
|
|
11
|
+
for (const [k, Ctor] of Object.entries(Components)) {
|
|
6
12
|
const is = kebabCase(k);
|
|
7
|
-
if ('polyfillExtends' in
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
if ('polyfillExtends' in Ctor && 'string' === typeof Ctor.polyfillExtends) {
|
|
14
|
+
if (customElements.get(is))
|
|
15
|
+
continue;
|
|
16
|
+
customElements.define(is, Ctor, { extends: Ctor.polyfillExtends });
|
|
17
|
+
if (!(document.createElement(Ctor.polyfillExtends, { is }) instanceof Ctor))
|
|
18
|
+
polyfills.set(is, Ctor);
|
|
19
|
+
// const testEl = document.createElement('template')
|
|
20
|
+
// testEl.innerHTML = `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`
|
|
21
|
+
// const testNode = testEl.content.firstElementChild,
|
|
22
|
+
if (!($(`<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
|
|
23
|
+
polyfills.set(is, Ctor);
|
|
12
24
|
continue;
|
|
13
25
|
}
|
|
14
|
-
customElements.
|
|
26
|
+
if (!customElements.get(is))
|
|
27
|
+
customElements.define(is, Ctor);
|
|
15
28
|
}
|
|
16
|
-
|
|
29
|
+
if (devFlags.debug)
|
|
30
|
+
console.debug(polyfills);
|
|
17
31
|
if (0 < polyfills.size) {
|
|
18
|
-
const polyfillTagNamesCache = new Set([...polyfills.values()]
|
|
19
|
-
.map((v) => String(v.polyfillExtends ?? '').toUpperCase())
|
|
20
|
-
.filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
|
|
32
|
+
const polyfillTagNamesCache = new Set([...polyfills.values()].map((v) => String(v.polyfillExtends ?? '').toUpperCase()).filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
|
|
21
33
|
const handlers = new WeakMap();
|
|
22
|
-
// @ts-expect-error
|
|
23
34
|
const observe = (el, polyfill) => {
|
|
24
35
|
if (!Array.isArray(polyfill.observedAttributes))
|
|
25
36
|
return;
|
|
26
37
|
if (0 === polyfill?.observedAttributes.length)
|
|
27
38
|
return;
|
|
28
|
-
|
|
39
|
+
if (!polyfill.polyfillAttributeChangedCallback)
|
|
40
|
+
return;
|
|
41
|
+
const observer = new MutationObserver(polyfill.polyfillAttributeChangedCallback);
|
|
42
|
+
observer.observe(el, {
|
|
29
43
|
attributes: true,
|
|
30
44
|
attributeFilter: polyfill.observedAttributes,
|
|
31
45
|
attributeOldValue: true,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
});
|
|
47
|
+
handlers.set(el, observer);
|
|
48
|
+
for (const attributeName of polyfill.observedAttributes)
|
|
49
|
+
if (el.hasAttribute(attributeName)) {
|
|
50
|
+
const entry = {
|
|
51
|
+
attributeName,
|
|
52
|
+
oldValue: null,
|
|
53
|
+
target: el,
|
|
54
|
+
};
|
|
55
|
+
polyfill.polyfillAttributeChangedCallback([entry]);
|
|
56
|
+
}
|
|
57
|
+
}, unobserve = (el) => {
|
|
36
58
|
handlers.delete(el);
|
|
37
|
-
};
|
|
38
|
-
|
|
59
|
+
}, polyfillTagNamesCacheSelector = [...polyfillTagNamesCache.values()].map((v) => `${v}`.toLowerCase()).join(','), flatten = (node) => [node, ...(node.querySelectorAll?.(polyfillTagNamesCacheSelector) ?? [])];
|
|
60
|
+
if (devFlags.debug)
|
|
61
|
+
console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
|
|
39
62
|
for (const [is, polyfill] of polyfills)
|
|
40
|
-
for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${is}"]`)) {
|
|
63
|
+
for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${CSS.escape(is)}"]`)) {
|
|
41
64
|
polyfill.polyfillConnectedCallback(el);
|
|
42
65
|
observe(el, polyfill);
|
|
43
66
|
}
|
|
44
67
|
// observer callback
|
|
45
68
|
const observer = new MutationObserver((mutations) => {
|
|
46
69
|
for (const { addedNodes, removedNodes } of mutations) {
|
|
47
|
-
for (const
|
|
48
|
-
if (!(
|
|
49
|
-
continue;
|
|
50
|
-
if (!polyfillTagNamesCache.has(node.tagName))
|
|
70
|
+
for (const root of addedNodes) {
|
|
71
|
+
if (!(root instanceof HTMLElement))
|
|
51
72
|
continue;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
for (const node of flatten(root)) {
|
|
74
|
+
if (!(node instanceof HTMLElement))
|
|
75
|
+
continue;
|
|
76
|
+
if (!polyfillTagNamesCache.has(node.tagName))
|
|
77
|
+
continue;
|
|
78
|
+
const is = node?.getAttribute('is') ?? '';
|
|
79
|
+
if (!polyfills.has(is))
|
|
80
|
+
continue;
|
|
81
|
+
polyfills.get(is)?.polyfillConnectedCallback(node);
|
|
82
|
+
observe(node, polyfills.get(is));
|
|
83
|
+
}
|
|
57
84
|
}
|
|
58
|
-
for (const
|
|
59
|
-
if (!(
|
|
60
|
-
continue;
|
|
61
|
-
if (!polyfillTagNamesCache.has(node.tagName))
|
|
85
|
+
for (const root of removedNodes) {
|
|
86
|
+
if (!(root instanceof HTMLElement))
|
|
62
87
|
continue;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
for (const node of flatten(root)) {
|
|
89
|
+
if (!(node instanceof HTMLElement))
|
|
90
|
+
continue;
|
|
91
|
+
if (!polyfillTagNamesCache.has(node.tagName))
|
|
92
|
+
continue;
|
|
93
|
+
const is = node?.getAttribute('is') ?? '';
|
|
94
|
+
if (!polyfills.has(is))
|
|
95
|
+
continue;
|
|
96
|
+
polyfills.get(is)?.polyfillDisconnectedCallback(node);
|
|
97
|
+
unobserve(node);
|
|
98
|
+
}
|
|
68
99
|
}
|
|
69
100
|
}
|
|
70
101
|
});
|
|
@@ -73,151 +104,173 @@ if (0 < polyfills.size) {
|
|
|
73
104
|
subtree: true,
|
|
74
105
|
});
|
|
75
106
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
// SECTION: Safari polyfill
|
|
108
|
+
document.addEventListener('touchstart', () => { }, { passive: true });
|
|
109
|
+
//#endregion
|
|
110
|
+
// SECTION
|
|
111
|
+
const handleHelp = ({ target, relatedTarget }) => {
|
|
112
|
+
if (!(target instanceof HTMLElement))
|
|
113
|
+
return;
|
|
114
|
+
const trigger = target.closest('[help]');
|
|
115
|
+
if (!trigger)
|
|
116
|
+
return;
|
|
117
|
+
if (['PICKER-VIEW'].includes(trigger.tagName))
|
|
118
|
+
return;
|
|
119
|
+
if (relatedTarget instanceof HTMLElement && trigger.contains(relatedTarget))
|
|
120
|
+
return;
|
|
121
|
+
const newAnchorName = `--help-${self.crypto.randomUUID()}`;
|
|
122
|
+
const tooltip = $(`<fine-tooltip></fine-tooltip>`, '>1');
|
|
123
|
+
trigger.style.setProperty('anchor-name', newAnchorName);
|
|
124
|
+
tooltip.style.setProperty('position-anchor', newAnchorName);
|
|
125
|
+
document.body.appendChild(tooltip);
|
|
126
|
+
// setInterval(() => {
|
|
127
|
+
// trigger.setAttribute('help', trigger.getAttribute('help') + 'h')
|
|
128
|
+
// }, 2000)
|
|
129
|
+
// console.log(999, trigger)
|
|
130
|
+
}, handleDone = ({ target, relatedTarget }) => {
|
|
131
|
+
if (!(target instanceof HTMLElement))
|
|
132
|
+
return;
|
|
133
|
+
const trigger = target.closest('[help]');
|
|
134
|
+
if (!trigger)
|
|
135
|
+
return;
|
|
136
|
+
if (['PICKER-VIEW'].includes(trigger.tagName))
|
|
137
|
+
return;
|
|
138
|
+
if (relatedTarget instanceof HTMLElement && trigger.contains(relatedTarget))
|
|
139
|
+
return;
|
|
140
|
+
const anchorName = trigger.style.anchorName;
|
|
141
|
+
if (!anchorName.startsWith('--help-'))
|
|
142
|
+
return;
|
|
143
|
+
// for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
|
|
144
|
+
// for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
|
|
145
|
+
// return
|
|
146
|
+
// }
|
|
147
|
+
const tooltip = document.querySelector(`[style*="${CSS.escape(anchorName)}"]:not([help])`);
|
|
148
|
+
if (!tooltip)
|
|
149
|
+
return;
|
|
150
|
+
// for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
|
|
151
|
+
// for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
|
|
152
|
+
// return
|
|
153
|
+
// }
|
|
154
|
+
// trigger.style.removeProperty('anchor-name')
|
|
155
|
+
tooltip.hidePopover(); // tooltip.remove?.()
|
|
156
|
+
};
|
|
157
|
+
const mediaQueryList = self.matchMedia(`(pointer: fine)`);
|
|
158
|
+
mediaQueryList.addEventListener('change', ({ matches }) => {
|
|
159
|
+
for (const [k, v] of [
|
|
160
|
+
['pointerover', handleHelp],
|
|
161
|
+
['pointerout', handleDone],
|
|
93
162
|
])
|
|
94
|
-
|
|
163
|
+
document.removeEventListener(k, v);
|
|
164
|
+
if (matches)
|
|
165
|
+
for (const [k, v] of [
|
|
166
|
+
['pointerover', handleHelp],
|
|
167
|
+
['pointerout', handleDone],
|
|
168
|
+
])
|
|
169
|
+
document.addEventListener(k, v, { passive: true });
|
|
170
|
+
});
|
|
171
|
+
if (mediaQueryList.matches)
|
|
172
|
+
for (const [k, v] of [
|
|
173
|
+
['pointerover', handleHelp],
|
|
174
|
+
['pointerout', handleDone],
|
|
175
|
+
])
|
|
176
|
+
document.addEventListener(k, v, { passive: true });
|
|
177
|
+
//#region fns
|
|
178
|
+
// const a = alert('Saving…', 'Please wait')
|
|
179
|
+
// // later, e.g. save completed early
|
|
180
|
+
// a.dismiss() // silently resolves undefined, closes+removes dialog
|
|
181
|
+
// // or
|
|
182
|
+
// a.dismiss(new Error('cancelled')) // rejects instead
|
|
183
|
+
// const result = await a // still works normally if not dismissed
|
|
184
|
+
// const ac = new AbortController()
|
|
185
|
+
// const a = alert('Uploading…', 'Please wait', undefined, { signal: ac.signal })
|
|
186
|
+
// // elsewhere, e.g. upload finished before the user dismissed
|
|
187
|
+
// ac.abort() // dialog closes silently, a rejects with AbortError
|
|
188
|
+
// // or still works standalone
|
|
189
|
+
// a.dismiss() // same effect, no signal needed
|
|
190
|
+
export const alert = (title, message, actions, options) => {
|
|
191
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
192
|
+
let dialog;
|
|
193
|
+
let off;
|
|
194
|
+
const dismiss = (reason) => {
|
|
195
|
+
off?.();
|
|
196
|
+
dialog?.close();
|
|
197
|
+
// dialog?.remove()
|
|
198
|
+
reason === undefined ? resolve(undefined) : reject(reason instanceof Error ? reason : new DOMException('Alert dismissed', 'AbortError'));
|
|
199
|
+
};
|
|
200
|
+
if (options?.signal)
|
|
201
|
+
if (options.signal.aborted)
|
|
202
|
+
dismiss(options.signal.reason); // already aborted before we even started — settle immediately, skip showing anything
|
|
203
|
+
else
|
|
204
|
+
options.signal.addEventListener('abort', () => dismiss(options.signal.reason), { once: true });
|
|
205
|
+
navigator.locks
|
|
206
|
+
.request('alert:', async () => {
|
|
207
|
+
if (options?.signal?.aborted)
|
|
208
|
+
return; // in case it was aborted while queued behind another lock holder
|
|
209
|
+
const mount = document.createElement('div');
|
|
210
|
+
render(html `<dialog is="alert-dialog">
|
|
211
|
+
<v-stack spacing="1" alignment="fill">
|
|
212
|
+
${title ? html `<label-view font="headline" title="${title}"></label-view>` : null}
|
|
213
|
+
${message ? html `<label-view foreground="secondary" font="callout" title="${message}"></label-view>` : null}
|
|
214
|
+
</v-stack>
|
|
215
|
+
${(actions ?? [{ role: 'close' }]).map((action, index) => html `
|
|
216
|
+
<button type="button" tabindex="0" is="bordered-button" value="${index}" role="${action.role ?? null}">
|
|
217
|
+
${action.label || action.image ? html `<label-view title="${action.label ?? null}" system-image="${action.image ?? null}"></label-view>` : null}
|
|
218
|
+
</button>
|
|
219
|
+
`)}
|
|
220
|
+
</dialog>`, mount);
|
|
221
|
+
dialog = mount.firstElementChild;
|
|
222
|
+
document.body.insertAdjacentElement('beforeend', dialog);
|
|
223
|
+
dialog.showModal();
|
|
224
|
+
off = onoff('alert:return', (evt) => {
|
|
225
|
+
const { detail } = evt;
|
|
226
|
+
off?.();
|
|
227
|
+
resolve(detail.returnValue);
|
|
228
|
+
}, alertDialog, { once: true }).on();
|
|
229
|
+
return promise;
|
|
230
|
+
})
|
|
231
|
+
.catch(() => { });
|
|
232
|
+
return Object.assign(promise, { dismiss });
|
|
95
233
|
};
|
|
96
|
-
export const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
// const pt = event.target.closest('navigation-stack,body-view')
|
|
106
|
-
// const inte = event.target.closest(".fwd");
|
|
107
|
-
// const st = sv.scrollTop
|
|
108
|
-
// console.log(333, lm, sv, sis)
|
|
109
|
-
// let to
|
|
110
|
-
// inject or unhide
|
|
111
|
-
// if (pr.tagName === 'NAVIGATION-STACK' && 'more' === pr.getAttribute('is')) {
|
|
112
|
-
// to = document.querySelector(`#${event.target.getAttribute('tag')}`)
|
|
113
|
-
// to.hidden = false
|
|
114
|
-
// } else {
|
|
115
|
-
await updateCallback(); // updatetheDOMSomehow
|
|
116
|
-
// to = sv.nextElementSibling //pr.lastElementChild //sv.nextElementSibling
|
|
117
|
-
// }
|
|
118
|
-
Snapshot.getSnapshot(from);
|
|
119
|
-
const fromToolbars = Snapshot.toolbarItems;
|
|
120
|
-
// from = Snapshot.landmark
|
|
121
|
-
const to = Snapshot.leaf, toFrame = Snapshot.leafContainer, toToolbars = Snapshot.leafToolbarItems;
|
|
122
|
-
if ('DIALOG' === toFrame?.tagName) {
|
|
123
|
-
;
|
|
124
|
-
toFrame.showModal();
|
|
125
|
-
console.debug(`⚡️ view-transition-start (${type})`);
|
|
126
|
-
await Promise.allSettled(toFrame.getAnimations().map(({ finished }) => finished));
|
|
127
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
// purge
|
|
131
|
-
cleanup(Snapshot.root, 'backwards');
|
|
132
|
-
for (const ti of toToolbars ?? [])
|
|
133
|
-
ti.classList.add('fwnn');
|
|
134
|
-
to?.classList.add('fwdd');
|
|
135
|
-
// prepare principal/leader
|
|
136
|
-
from?.classList.add(Snapshot.config['vt-fwd-class-name']);
|
|
137
|
-
for (const ti of fromToolbars ?? [])
|
|
138
|
-
ti.classList.add('fwn'); // prepare navbs
|
|
139
|
-
// sv.inert = true
|
|
140
|
-
// if (!document.startViewTransition) {
|
|
141
|
-
// startViewTransition(event, false)
|
|
142
|
-
// return
|
|
143
|
-
// }
|
|
144
|
-
// With a transition:
|
|
145
|
-
// const transition = document.startViewTransition({
|
|
146
|
-
// async update() {},
|
|
147
|
-
// types: ['forwards'],
|
|
148
|
-
// })
|
|
149
|
-
// console.debug(transition)
|
|
150
|
-
// await transition.finished
|
|
151
|
-
// alert(3)
|
|
152
|
-
// return
|
|
153
|
-
console.debug(`⚡️ view-transition-start (${type})`);
|
|
154
|
-
await Promise.allSettled([
|
|
155
|
-
...(from?.getAnimations().map(({ finished }) => finished) ?? []),
|
|
156
|
-
...(to?.getAnimations().map(({ finished }) => finished) ?? []),
|
|
157
|
-
]);
|
|
158
|
-
// await Promise.allSettled(
|
|
159
|
-
// from.getAnimations().map(({ finished }) => finished)
|
|
160
|
-
// )
|
|
161
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
162
|
-
// console.log(9, to.querySelectorAll('.fwd'))
|
|
163
|
-
// sv2.classList.remove("fwdd");
|
|
164
|
-
if (0 <
|
|
165
|
-
(toFrame?.querySelectorAll(`.${Snapshot.config?.['vt-fwd-class-name']},.bwd`) ?? []).length)
|
|
166
|
-
return;
|
|
167
|
-
cleanup(Snapshot.root);
|
|
234
|
+
export const confirmationDialog = async (trigger, title, message, actions, options) => {
|
|
235
|
+
const newAnchorName = `--confirmation-dialog-${self.crypto.randomUUID()}`;
|
|
236
|
+
const dialog = $(`<dialog is="confirmation-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(`<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
|
|
237
|
+
trigger.style.setProperty('anchor-name', newAnchorName, 'important'); //$.prop('anchor-name', newAnchorName, trigger, 'important')
|
|
238
|
+
dialog.style.setProperty('position-anchor', newAnchorName); //$.prop('position-anchor', newAnchorName, dialog)
|
|
239
|
+
if (title && false !== options?.titleVisibility) {
|
|
240
|
+
const label = $(`<label-view font="headline"></label-view>`, '>1');
|
|
241
|
+
label.setAttribute('title', title);
|
|
242
|
+
vStack.insertAdjacentElement('beforeend', label);
|
|
168
243
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
187
|
-
if (fromFrame.matches('[open]'))
|
|
188
|
-
return;
|
|
189
|
-
await updateCallback();
|
|
190
|
-
return;
|
|
244
|
+
if (message && false !== options?.titleVisibility) {
|
|
245
|
+
const label = $(`<label-view foreground="secondary" font="callout"></label-view>`, '>1');
|
|
246
|
+
label.setAttribute('title', message);
|
|
247
|
+
vStack.insertAdjacentElement('beforeend', label);
|
|
248
|
+
}
|
|
249
|
+
for (const [index, action] of (actions ?? []).entries()) {
|
|
250
|
+
const btn = $(`<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
|
|
251
|
+
btn.setAttribute('value', `${index}`);
|
|
252
|
+
if (action?.role)
|
|
253
|
+
btn.setAttribute('role', action.role);
|
|
254
|
+
if (action.label || action.image) {
|
|
255
|
+
const label = $(`<label-view></label-view>`, '>1');
|
|
256
|
+
if (action.label)
|
|
257
|
+
label.setAttribute('title', action.label);
|
|
258
|
+
if (action.image)
|
|
259
|
+
label.setAttribute('system-image', action.image);
|
|
260
|
+
btn.appendChild(label);
|
|
191
261
|
}
|
|
192
|
-
|
|
193
|
-
cleanup(Snapshot.root, 'forwards');
|
|
194
|
-
// prepare others
|
|
195
|
-
for (const ti of toToolbars ?? [])
|
|
196
|
-
ti.classList.add('bwnn');
|
|
197
|
-
to?.classList.add('bwdd');
|
|
198
|
-
// sv2.style.visibility = "visible";
|
|
199
|
-
// prepare leader/principal (tracked)
|
|
200
|
-
for (const ti of fromToolbars ?? [])
|
|
201
|
-
ti.classList.add('bwn');
|
|
202
|
-
from?.classList.add('bwd');
|
|
203
|
-
// pr.inert = true
|
|
204
|
-
console.debug(`⚡️ view-transition-start (${type})`);
|
|
205
|
-
await Promise.allSettled([
|
|
206
|
-
...(from?.getAnimations().map(({ finished }) => finished) ?? []),
|
|
207
|
-
...(to?.getAnimations().map(({ finished }) => finished) ?? []),
|
|
208
|
-
]);
|
|
209
|
-
// await Promise.allSettled(
|
|
210
|
-
// from.getAnimations().map(({ finished }) => finished)
|
|
211
|
-
// )
|
|
212
|
-
// await Promise.allSettled(to.getAnimations().map(({ finished }) => finished))
|
|
213
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
214
|
-
// console.log(999, sv2.closest('.fwd'))
|
|
215
|
-
if (to?.closest(`.bwd,.${Snapshot.config?.['vt-fwd-class-name']}`))
|
|
216
|
-
return;
|
|
217
|
-
cleanup(Snapshot.root);
|
|
218
|
-
// remove or hide
|
|
219
|
-
await updateCallback();
|
|
262
|
+
dialog.insertAdjacentElement('beforeend', btn);
|
|
220
263
|
}
|
|
264
|
+
trigger.closest('body-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
|
|
265
|
+
const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
|
|
266
|
+
const { detail } = evt;
|
|
267
|
+
off();
|
|
268
|
+
resolve(detail.returnValue);
|
|
269
|
+
}, confirmationDialogBus, { once: true }).on();
|
|
270
|
+
return promise;
|
|
221
271
|
};
|
|
222
|
-
|
|
223
|
-
|
|
272
|
+
//#endregion
|
|
273
|
+
void Snapshot.waitReady;
|
|
274
|
+
//#region exports
|
|
275
|
+
export { I18n, lifecycleObserver, NavigationPath, queryInsertPosition, Snapshot, startViewTransition };
|
|
276
|
+
//#endregion
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DialogBase } from '../namespace-browser/base';
|
|
2
|
+
export declare class AlertDialog extends DialogBase {
|
|
3
|
+
#private;
|
|
4
|
+
constructor();
|
|
5
|
+
static polyfillDisconnectedCallback(el: AlertDialog): void;
|
|
6
|
+
static polyfillConnectedCallback(el: AlertDialog): void;
|
|
7
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
8
|
+
}
|