@swiftwc/ui 0.0.0-dev.98 → 1.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{web-components.html-data → html-data}/en.json +155 -57
- package/package.json +14 -11
- package/scss/_components.scss +1 -1
- package/scss/_maps.scss +3 -1
- package/scss/_utils.scss +3 -1
- package/scss/_vars.scss +1 -0
- package/scss/base/_layout.scss +8 -8
- package/scss/base/_reboot.scss +4 -29
- package/scss/base/_root.scss +27 -12
- package/scss/colors/_index.scss +66 -1
- package/scss/components/_alert-dialog.scss +3 -3
- package/scss/components/_bordered-button.scss +2 -2
- package/scss/components/_bordered-prominent-button.scss +3 -3
- package/scss/components/_borderless-button.scss +2 -2
- package/scss/components/_confirmation-dialog.scss +1 -1
- package/scss/components/_content-unavailable.scss +1 -1
- package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
- package/scss/components/_date-picker.scss +1 -1
- package/scss/components/_detail-placeholder.scss +5 -5
- package/scss/components/_disclosure-group.scss +2 -2
- package/scss/components/_fine-tooltip.scss +1 -1
- package/scss/components/_form-view.scss +3 -3
- package/scss/components/_full-screen.scss +1 -1
- package/scss/components/_glass-button.scss +2 -2
- package/scss/components/_glass-prominent-button.scss +3 -3
- package/scss/components/_group-box.scss +1 -1
- package/scss/components/_h-divider.scss +1 -1
- package/scss/components/_h-flex-stack.scss +3 -1
- package/scss/components/_h-stack.scss +1 -1
- package/scss/components/_image-view.scss +1 -1
- package/scss/components/_index.scss +35 -24
- package/scss/components/_label-view.scss +1 -1
- package/scss/components/_labeled-content.scss +1 -1
- package/scss/components/_list-view.scss +3 -3
- package/scss/components/_menu-view.scss +3 -3
- package/scss/components/_navigation-large-title.scss +15 -9
- package/scss/components/_navigation-split-view.scss +18 -18
- package/scss/components/_navigation-stack.scss +1 -1
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +159 -119
- package/scss/components/_plain-button.scss +2 -2
- package/scss/components/_progress-view.scss +1 -1
- package/scss/components/_scroll-view-proxy.scss +1 -1
- package/scss/components/_scroll-view-toolbars.scss +1 -1
- package/scss/components/_scroll-view.scss +2 -2
- package/scss/components/_search-view.scss +1 -1
- package/scss/components/_section-view.scss +1 -1
- package/scss/components/_sheet-view.scss +2 -2
- package/scss/components/_sidebar-toggle.scss +1 -1
- package/scss/components/_sidebar-view.scss +2 -2
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +1 -1
- package/scss/components/_tab-item.scss +1 -1
- package/scss/components/_tab-view.scss +23 -15
- package/scss/components/_table-column.scss +1 -1
- package/scss/components/_table-row.scss +1 -1
- package/scss/components/_table-view.scss +1 -1
- package/scss/components/_text-field.scss +1 -1
- package/scss/components/_text-view.scss +1 -1
- package/scss/components/_toggle-view.scss +88 -30
- package/scss/components/_tool-bar-item-group.scss +1 -1
- package/scss/components/_tool-bar-item.scss +2 -2
- package/scss/components/_tool-bar.scss +2 -2
- package/scss/components/_v-divider.scss +1 -1
- package/scss/components/_v-flex-stack.scss +3 -1
- package/scss/components/_v-keyboard.scss +1 -1
- package/scss/components/_v-stack.scss +1 -1
- package/scss/final/_touch-glass.scss +8 -1
- package/scss/mixins/_index.scss +2 -2
- package/scss/placeholders/_buttons.scss +5 -5
- package/scss/placeholders/_lists.scss +3 -3
- package/scss/transitions/_alert-dialog.scss +1 -1
- package/scss/transitions/_bwd.navbar.scss +1 -1
- package/scss/transitions/_bwd.scss +3 -3
- package/scss/transitions/_confirmation-dialog.scss +1 -1
- package/scss/transitions/_disclosure-group.scss +1 -1
- package/scss/transitions/_fine-tooltip.scss +1 -1
- package/scss/transitions/_fwd.navbar.scss +1 -1
- package/scss/transitions/_fwd.scss +1 -1
- package/scss/transitions/_glass-button.scss +1 -1
- package/scss/transitions/_glass-prominent-button.scss +1 -1
- package/scss/transitions/_index.scss +1 -1
- package/scss/transitions/_menu-view.scss +1 -1
- package/scss/transitions/_navigation-split-view.scss +1 -1
- package/scss/transitions/_progress-view.scss +1 -1
- package/scss/transitions/_sheet-view.scss +1 -1
- package/scss/transitions/_sidebar-view.scss +1 -1
- package/scss/transitions/_tab-bar.scss +1 -1
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +2 -2
- package/scss/utils/_index.scss +33 -8
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +5 -3
- package/generated/buses/alert-dialog.d.ts +0 -2
- package/generated/buses/alert-dialog.js +0 -1
- package/generated/buses/confirmation-dialog.d.ts +0 -2
- package/generated/buses/confirmation-dialog.js +0 -1
- package/generated/buses/index.d.ts +0 -6
- package/generated/buses/index.js +0 -6
- package/generated/buses/lifecycle-observer.d.ts +0 -2
- package/generated/buses/lifecycle-observer.js +0 -1
- package/generated/client/index.d.ts +0 -30
- package/generated/client/index.js +0 -279
- package/generated/components/alert-dialog.d.ts +0 -11
- package/generated/components/alert-dialog.js +0 -102
- package/generated/components/body-view.d.ts +0 -13
- package/generated/components/body-view.js +0 -17
- package/generated/components/bordered-button.d.ts +0 -17
- package/generated/components/bordered-button.js +0 -56
- package/generated/components/bordered-prominent-button.d.ts +0 -17
- package/generated/components/bordered-prominent-button.js +0 -56
- package/generated/components/borderless-button.d.ts +0 -17
- package/generated/components/borderless-button.js +0 -56
- package/generated/components/color-scheme.d.ts +0 -12
- package/generated/components/color-scheme.js +0 -54
- package/generated/components/confirmation-dialog.d.ts +0 -12
- package/generated/components/confirmation-dialog.js +0 -116
- package/generated/components/content-unavailable.d.ts +0 -30
- package/generated/components/content-unavailable.js +0 -82
- package/generated/components/date-picker.d.ts +0 -52
- package/generated/components/date-picker.js +0 -480
- package/generated/components/disclosure-group.d.ts +0 -17
- package/generated/components/disclosure-group.js +0 -66
- package/generated/components/fine-tooltip.d.ts +0 -15
- package/generated/components/fine-tooltip.js +0 -111
- package/generated/components/form-view.d.ts +0 -16
- package/generated/components/form-view.js +0 -65
- package/generated/components/glass-button.d.ts +0 -16
- package/generated/components/glass-button.js +0 -53
- package/generated/components/glass-prominent-button.d.ts +0 -16
- package/generated/components/glass-prominent-button.js +0 -53
- package/generated/components/h-stack.d.ts +0 -22
- package/generated/components/h-stack.js +0 -26
- package/generated/components/image-view.d.ts +0 -18
- package/generated/components/image-view.js +0 -68
- package/generated/components/index.d.ts +0 -47
- package/generated/components/index.js +0 -47
- package/generated/components/label-view.d.ts +0 -27
- package/generated/components/label-view.js +0 -87
- package/generated/components/labeled-content.d.ts +0 -27
- package/generated/components/labeled-content.js +0 -160
- package/generated/components/list-view.d.ts +0 -15
- package/generated/components/list-view.js +0 -22
- package/generated/components/menu-view.d.ts +0 -20
- package/generated/components/menu-view.js +0 -140
- package/generated/components/navigation-large-title.d.ts +0 -18
- package/generated/components/navigation-large-title.js +0 -188
- package/generated/components/navigation-split-view.d.ts +0 -15
- package/generated/components/navigation-split-view.js +0 -25
- package/generated/components/navigation-stack.d.ts +0 -15
- package/generated/components/navigation-stack.js +0 -29
- package/generated/components/navigation-title.d.ts +0 -18
- package/generated/components/navigation-title.js +0 -72
- package/generated/components/picker-view.d.ts +0 -68
- package/generated/components/picker-view.js +0 -1153
- package/generated/components/plain-button.d.ts +0 -7
- package/generated/components/plain-button.js +0 -22
- package/generated/components/progress-view.d.ts +0 -20
- package/generated/components/progress-view.js +0 -125
- package/generated/components/screen-view.d.ts +0 -5
- package/generated/components/screen-view.js +0 -11
- package/generated/components/scroll-view-proxy.d.ts +0 -13
- package/generated/components/scroll-view-proxy.js +0 -17
- package/generated/components/scroll-view.d.ts +0 -22
- package/generated/components/scroll-view.js +0 -237
- package/generated/components/search-view.d.ts +0 -12
- package/generated/components/search-view.js +0 -27
- package/generated/components/section-view.d.ts +0 -21
- package/generated/components/section-view.js +0 -64
- package/generated/components/sheet-view.d.ts +0 -11
- package/generated/components/sheet-view.js +0 -45
- package/generated/components/sidebar-toggle.d.ts +0 -15
- package/generated/components/sidebar-toggle.js +0 -88
- package/generated/components/sidebar-view.d.ts +0 -10
- package/generated/components/sidebar-view.js +0 -37
- package/generated/components/sticky-container.d.ts +0 -11
- package/generated/components/sticky-container.js +0 -26
- package/generated/components/tab-bar.d.ts +0 -10
- package/generated/components/tab-bar.js +0 -40
- package/generated/components/tab-item.d.ts +0 -10
- package/generated/components/tab-item.js +0 -134
- package/generated/components/tab-view.d.ts +0 -31
- package/generated/components/tab-view.js +0 -198
- package/generated/components/table-view.d.ts +0 -26
- package/generated/components/table-view.js +0 -161
- package/generated/components/text-field.d.ts +0 -42
- package/generated/components/text-field.js +0 -526
- package/generated/components/toggle-view.d.ts +0 -41
- package/generated/components/toggle-view.js +0 -249
- package/generated/components/tool-bar-item-group.d.ts +0 -13
- package/generated/components/tool-bar-item-group.js +0 -31
- package/generated/components/tool-bar-item.d.ts +0 -16
- package/generated/components/tool-bar-item.js +0 -69
- package/generated/components/tool-bar.d.ts +0 -26
- package/generated/components/tool-bar.js +0 -95
- package/generated/components/v-keyboard.d.ts +0 -20
- package/generated/components/v-keyboard.js +0 -89
- package/generated/components/v-stack.d.ts +0 -25
- package/generated/components/v-stack.js +0 -29
- package/generated/css/index.css +0 -10592
- package/generated/events/alert-dialog.d.ts +0 -13
- package/generated/events/alert-dialog.js +0 -1
- package/generated/events/confirmation-dialog.d.ts +0 -14
- package/generated/events/confirmation-dialog.js +0 -1
- package/generated/events/date-picker.d.ts +0 -13
- package/generated/events/date-picker.js +0 -1
- package/generated/events/index.d.ts +0 -9
- package/generated/events/index.js +0 -9
- package/generated/events/lifecycle-observer.d.ts +0 -18
- package/generated/events/lifecycle-observer.js +0 -1
- package/generated/events/picker-view.d.ts +0 -29
- package/generated/events/picker-view.js +0 -1
- package/generated/events/scroll-view.d.ts +0 -18
- package/generated/events/scroll-view.js +0 -1
- package/generated/events/tab-view.d.ts +0 -54
- package/generated/events/tab-view.js +0 -1
- package/generated/events/text-field.d.ts +0 -13
- package/generated/events/text-field.js +0 -1
- package/generated/events/toggle-view.d.ts +0 -14
- package/generated/events/toggle-view.js +0 -1
- package/generated/i18n/index.d.ts +0 -33
- package/generated/i18n/index.js +0 -164
- package/generated/i18n/locales/el.d.ts +0 -16
- package/generated/i18n/locales/el.js +0 -16
- package/generated/i18n/locales/en.d.ts +0 -16
- package/generated/i18n/locales/en.js +0 -16
- package/generated/i18n/locales/index.d.ts +0 -4
- package/generated/i18n/locales/index.js +0 -4
- package/generated/index.d.ts +0 -2
- package/generated/index.js +0 -3
- package/generated/internal/class/cleanup-registry.d.ts +0 -5
- package/generated/internal/class/cleanup-registry.js +0 -38
- package/generated/internal/class/css-style-observer.d.ts +0 -8
- package/generated/internal/class/css-style-observer.js +0 -26
- package/generated/internal/class/form-associated-base.d.ts +0 -16
- package/generated/internal/class/form-associated-base.js +0 -78
- package/generated/internal/class/mutation-observer-set.d.ts +0 -9
- package/generated/internal/class/mutation-observer-set.js +0 -42
- package/generated/internal/class/mutation-observer-singleton.d.ts +0 -10
- package/generated/internal/class/mutation-observer-singleton.js +0 -64
- package/generated/internal/class/navigation-path.d.ts +0 -15
- package/generated/internal/class/navigation-path.js +0 -84
- package/generated/internal/class/navigation-view.d.ts +0 -8
- package/generated/internal/class/navigation-view.js +0 -72
- package/generated/internal/class/resize-observer-singleton.d.ts +0 -7
- package/generated/internal/class/resize-observer-singleton.js +0 -22
- package/generated/internal/decorators/adaptive-slot.d.ts +0 -1
- package/generated/internal/decorators/adaptive-slot.js +0 -50
- package/generated/internal/decorators/custom-element.d.ts +0 -5
- package/generated/internal/decorators/custom-element.js +0 -5
- package/generated/internal/decorators/index.d.ts +0 -6
- package/generated/internal/decorators/index.js +0 -6
- package/generated/internal/decorators/microtask-on-connected.d.ts +0 -39
- package/generated/internal/decorators/microtask-on-connected.js +0 -67
- package/generated/internal/privateNamespace.d.ts +0 -14
- package/generated/internal/privateNamespace.js +0 -168
- package/generated/internal/utils/add.d.ts +0 -1
- package/generated/internal/utils/add.js +0 -7
- package/generated/internal/utils/cash/ancestors.d.ts +0 -1
- package/generated/internal/utils/cash/ancestors.js +0 -27
- package/generated/internal/utils/cash/index.d.ts +0 -24
- package/generated/internal/utils/cash/index.js +0 -27
- package/generated/internal/utils/cash/next-all.d.ts +0 -1
- package/generated/internal/utils/cash/next-all.js +0 -10
- package/generated/internal/utils/cash/next.d.ts +0 -1
- package/generated/internal/utils/cash/next.js +0 -9
- package/generated/internal/utils/cash/prev-all.d.ts +0 -1
- package/generated/internal/utils/cash/prev-all.js +0 -10
- package/generated/internal/utils/cash/prev.d.ts +0 -1
- package/generated/internal/utils/cash/prev.js +0 -9
- package/generated/internal/utils/cash/prop.d.ts +0 -18
- package/generated/internal/utils/cash/prop.js +0 -30
- package/generated/internal/utils/cash/siblings.d.ts +0 -1
- package/generated/internal/utils/cash/siblings.js +0 -10
- package/generated/internal/utils/clamp.d.ts +0 -1
- package/generated/internal/utils/clamp.js +0 -4
- package/generated/internal/utils/compare-big-decimals.d.ts +0 -1
- package/generated/internal/utils/compare-big-decimals.js +0 -80
- package/generated/internal/utils/css-time.d.ts +0 -1
- package/generated/internal/utils/css-time.js +0 -3
- package/generated/internal/utils/debounce.d.ts +0 -1
- package/generated/internal/utils/debounce.js +0 -13
- package/generated/internal/utils/define-translations.d.ts +0 -1
- package/generated/internal/utils/define-translations.js +0 -3
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
- package/generated/internal/utils/ensure-placeholder.d.ts +0 -1
- package/generated/internal/utils/ensure-placeholder.js +0 -41
- package/generated/internal/utils/frame.d.ts +0 -1
- package/generated/internal/utils/frame.js +0 -6
- package/generated/internal/utils/index.d.ts +0 -20
- package/generated/internal/utils/index.js +0 -23
- package/generated/internal/utils/is-inside.d.ts +0 -1
- package/generated/internal/utils/is-inside.js +0 -4
- package/generated/internal/utils/kebab-case.d.ts +0 -1
- package/generated/internal/utils/kebab-case.js +0 -8
- package/generated/internal/utils/list-active.d.ts +0 -7
- package/generated/internal/utils/list-active.js +0 -83
- package/generated/internal/utils/microtask.d.ts +0 -1
- package/generated/internal/utils/microtask.js +0 -3
- package/generated/internal/utils/onoff.d.ts +0 -45
- package/generated/internal/utils/onoff.js +0 -31
- package/generated/internal/utils/set.d.ts +0 -1
- package/generated/internal/utils/set.js +0 -7
- package/generated/internal/utils/sleep.d.ts +0 -1
- package/generated/internal/utils/sleep.js +0 -3
- package/generated/internal/utils/slow-hide-show.d.ts +0 -1
- package/generated/internal/utils/slow-hide-show.js +0 -16
- package/generated/internal/utils/timeout.d.ts +0 -5
- package/generated/internal/utils/timeout.js +0 -16
- package/generated/internal/utils/touch-glass.d.ts +0 -7
- package/generated/internal/utils/touch-glass.js +0 -19
- package/generated/internal/vendor/morphdom.d.ts +0 -6
- package/generated/internal/vendor/morphdom.js +0 -720
- package/generated/morphdom/index.d.ts +0 -8
- package/generated/morphdom/index.js +0 -8
- package/generated/morphdom/morph.d.ts +0 -4
- package/generated/morphdom/morph.js +0 -10
- package/generated/morphdom/query-morph.d.ts +0 -5
- package/generated/morphdom/query-morph.js +0 -12
- package/generated/morphdom/render-to-string.d.ts +0 -12
- package/generated/morphdom/render-to-string.js +0 -48
- package/generated/morphdom/unsafe-html.d.ts +0 -2
- package/generated/morphdom/unsafe-html.js +0 -4
- package/generated/namespace-browser/base.d.ts +0 -45
- package/generated/namespace-browser/base.js +0 -115
- package/generated/namespace-browser/event.d.ts +0 -10
- package/generated/namespace-browser/event.js +0 -1
- package/generated/namespace-browser/index.d.ts +0 -7
- package/generated/namespace-browser/index.js +0 -1
- package/generated/snapshot/index.d.ts +0 -9
- package/generated/snapshot/index.js +0 -60
- package/generated/tpl/html.d.ts +0 -5
- package/generated/tpl/html.js +0 -7
- package/generated/tpl/index.d.ts +0 -6
- package/generated/tpl/index.js +0 -6
- package/generated/tpl/is-template-result.d.ts +0 -3
- package/generated/tpl/is-template-result.js +0 -1
- package/generated/tpl/render.d.ts +0 -2
- package/generated/tpl/render.js +0 -132
- /package/{web-components.css-data → css-data}/en.json +0 -0
- /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { devFlags } from '../internal/utils';
|
|
2
|
-
export class ColorScheme extends HTMLElement {
|
|
3
|
-
static get observedAttributes() {
|
|
4
|
-
return ['dark'];
|
|
5
|
-
}
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
}
|
|
9
|
-
connectedCallback() {
|
|
10
|
-
if (devFlags.debug)
|
|
11
|
-
console.debug(`${ColorScheme.name} ⚡️ connect`);
|
|
12
|
-
this.hidden = true;
|
|
13
|
-
this.inert = true;
|
|
14
|
-
}
|
|
15
|
-
disconnectedCallback() {
|
|
16
|
-
if (devFlags.debug)
|
|
17
|
-
console.debug(`${ColorScheme.name} ⚡️ disconnect`);
|
|
18
|
-
}
|
|
19
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
20
|
-
if (devFlags.debug)
|
|
21
|
-
console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
|
|
22
|
-
// self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
|
|
23
|
-
if (newValue)
|
|
24
|
-
self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
|
|
25
|
-
// @property --canvas {
|
|
26
|
-
// syntax: "<color>";
|
|
27
|
-
// initial-value: oklch(100% 0 0deg);
|
|
28
|
-
// inherits: false;
|
|
29
|
-
// }
|
|
30
|
-
// @media (prefers-color-scheme: dark) {
|
|
31
|
-
// @property --canvas {
|
|
32
|
-
// syntax: "<color>";
|
|
33
|
-
// initial-value: oklch(0% 0 0deg);
|
|
34
|
-
// inherits: false;
|
|
35
|
-
// }
|
|
36
|
-
// }
|
|
37
|
-
// @property --canvastext {
|
|
38
|
-
// syntax: "<color>";
|
|
39
|
-
// initial-value: oklch(0% 0 0deg);
|
|
40
|
-
// inherits: false;
|
|
41
|
-
// }
|
|
42
|
-
// @media (prefers-color-scheme: dark) {
|
|
43
|
-
// @property --canvastext {
|
|
44
|
-
// syntax: "<color>";
|
|
45
|
-
// initial-value: oklch(100% 0 0deg);
|
|
46
|
-
// inherits: false;
|
|
47
|
-
// }
|
|
48
|
-
// }
|
|
49
|
-
// if (CSS.supports('interpolate-size', 'allow-keywords')) {
|
|
50
|
-
// self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
|
|
51
|
-
if (null !== newValue)
|
|
52
|
-
self.CSS.registerProperty({ name: '--background', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DialogBase } from '../namespace-browser/base';
|
|
2
|
-
/**
|
|
3
|
-
* @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
|
|
4
|
-
*/
|
|
5
|
-
export declare class ConfirmationDialog extends DialogBase {
|
|
6
|
-
#private;
|
|
7
|
-
static get observedAttributes(): string[];
|
|
8
|
-
constructor();
|
|
9
|
-
static polyfillDisconnectedCallback(el: ConfirmationDialog): void;
|
|
10
|
-
static polyfillConnectedCallback(el: ConfirmationDialog): void;
|
|
11
|
-
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
12
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { confirmationDialog } from '../buses';
|
|
2
|
-
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
|
|
4
|
-
import { DialogBase } from '../namespace-browser/base';
|
|
5
|
-
/**
|
|
6
|
-
* @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
|
|
7
|
-
*/
|
|
8
|
-
export class ConfirmationDialog extends DialogBase {
|
|
9
|
-
static get observedAttributes() {
|
|
10
|
-
return ['anchor'];
|
|
11
|
-
}
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
}
|
|
15
|
-
static polyfillDisconnectedCallback(el) {
|
|
16
|
-
if (devFlags.debug)
|
|
17
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
|
|
18
|
-
const positionAnchor = el.style.getPropertyValue('position-anchor');
|
|
19
|
-
document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
|
|
20
|
-
el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
|
|
21
|
-
CleanupRegistry.unregister(el);
|
|
22
|
-
confirmationDialog.dispatchEvent(new CustomEvent('confirmation:return', {
|
|
23
|
-
detail: { returnValue: el.returnValue, positionAnchor },
|
|
24
|
-
bubbles: true,
|
|
25
|
-
composed: true,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
static polyfillConnectedCallback(el) {
|
|
29
|
-
if (devFlags.debug)
|
|
30
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
|
|
31
|
-
CleanupRegistry.register(el, onoff([
|
|
32
|
-
{ types: 'click', listener: this.#handleDialogClick },
|
|
33
|
-
{ types: 'close', listener: this.#handleDialogClose },
|
|
34
|
-
{ types: 'cancel', listener: this.#handleDialogCancel },
|
|
35
|
-
], el).on());
|
|
36
|
-
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
|
|
37
|
-
if (!(target instanceof HTMLElement))
|
|
38
|
-
return true;
|
|
39
|
-
if (target.matches('[is=confirmation-dialog]'))
|
|
40
|
-
return false;
|
|
41
|
-
// if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
|
|
42
|
-
return true;
|
|
43
|
-
}), el).on());
|
|
44
|
-
if (devFlags.debug)
|
|
45
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
|
|
46
|
-
el.removeAttribute('closing');
|
|
47
|
-
el.scrollTop = 0;
|
|
48
|
-
el.returnValue = '';
|
|
49
|
-
el.autofocus = true;
|
|
50
|
-
el.showModal();
|
|
51
|
-
}
|
|
52
|
-
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
53
|
-
if (devFlags.debug)
|
|
54
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
55
|
-
// const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
|
|
56
|
-
switch (attributeName) {
|
|
57
|
-
case 'label':
|
|
58
|
-
// let label = this.querySelector(':scope>[slot=label]')
|
|
59
|
-
// if (newValue) {
|
|
60
|
-
// label ??= this.appendChild($(`<label-view slot="label"></label-view>`))
|
|
61
|
-
// label.setAttribute('title', newValue)
|
|
62
|
-
// } else label?.remove()
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static #handleDialogClick = (evt) => {
|
|
67
|
-
if (devFlags.debug)
|
|
68
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
|
|
69
|
-
const { target, currentTarget: dialog } = evt;
|
|
70
|
-
if (!(dialog instanceof HTMLDialogElement))
|
|
71
|
-
return;
|
|
72
|
-
if (!(target instanceof HTMLElement))
|
|
73
|
-
return;
|
|
74
|
-
if (target.matches('dialog') && !isInside(evt.clientX, evt.clientY, dialog.getBoundingClientRect()))
|
|
75
|
-
return dialog.requestClose(); // click outside
|
|
76
|
-
const button = target.closest('button');
|
|
77
|
-
if (!button)
|
|
78
|
-
return;
|
|
79
|
-
button.scrollIntoView({
|
|
80
|
-
behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
|
|
81
|
-
block: 'nearest',
|
|
82
|
-
inline: 'nearest',
|
|
83
|
-
});
|
|
84
|
-
dialog.returnValue = button.value;
|
|
85
|
-
dialog.requestClose(button.value);
|
|
86
|
-
evt.stopPropagation();
|
|
87
|
-
evt.stopImmediatePropagation();
|
|
88
|
-
};
|
|
89
|
-
static #handleDialogCancel = (evt) => {
|
|
90
|
-
if (devFlags.debug)
|
|
91
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
|
|
92
|
-
if (!evt.cancelable)
|
|
93
|
-
return;
|
|
94
|
-
const { target } = evt;
|
|
95
|
-
if (!(target instanceof HTMLDialogElement))
|
|
96
|
-
return;
|
|
97
|
-
evt.preventDefault();
|
|
98
|
-
target.inert = true;
|
|
99
|
-
if (devFlags.debug)
|
|
100
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
|
|
101
|
-
target.setAttribute('closing', '');
|
|
102
|
-
Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
|
|
103
|
-
if (!target.hasAttribute('closing'))
|
|
104
|
-
return;
|
|
105
|
-
target?.close(target?.returnValue);
|
|
106
|
-
target.removeAttribute('closing');
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
static #handleDialogClose = ({ type, target }) => {
|
|
110
|
-
if (devFlags.debug)
|
|
111
|
-
console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
|
|
112
|
-
if (!(target instanceof HTMLDialogElement))
|
|
113
|
-
return;
|
|
114
|
-
target.remove();
|
|
115
|
-
};
|
|
116
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
3
|
-
*
|
|
4
|
-
* @example <content-unavailable search></content-unavailable>
|
|
5
|
-
*
|
|
6
|
-
* @example <content-unavailable search="foo"></content-unavailable>
|
|
7
|
-
*
|
|
8
|
-
* @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
9
|
-
*
|
|
10
|
-
* @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
11
|
-
*
|
|
12
|
-
* @slot — The default slot.
|
|
13
|
-
* @slot description
|
|
14
|
-
* @slot actions
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export declare class ContentUnavailable extends HTMLElement {
|
|
18
|
-
#private;
|
|
19
|
-
static get observedAttributes(): string[];
|
|
20
|
-
static get template(): DocumentFragment;
|
|
21
|
-
constructor();
|
|
22
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
connectedCallback(): void;
|
|
25
|
-
}
|
|
26
|
-
declare global {
|
|
27
|
-
interface HTMLElementTagNameMap {
|
|
28
|
-
'content-unavailable': ContentUnavailable;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { I18n } from '../i18n';
|
|
2
|
-
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { $, devFlags, onoff } from '../internal/utils';
|
|
4
|
-
import { html } from '../tpl';
|
|
5
|
-
/**
|
|
6
|
-
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
7
|
-
*
|
|
8
|
-
* @example <content-unavailable search></content-unavailable>
|
|
9
|
-
*
|
|
10
|
-
* @example <content-unavailable search="foo"></content-unavailable>
|
|
11
|
-
*
|
|
12
|
-
* @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
13
|
-
*
|
|
14
|
-
* @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
15
|
-
*
|
|
16
|
-
* @slot — The default slot.
|
|
17
|
-
* @slot description
|
|
18
|
-
* @slot actions
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
export class ContentUnavailable extends HTMLElement {
|
|
22
|
-
static get observedAttributes() {
|
|
23
|
-
return ['search'];
|
|
24
|
-
}
|
|
25
|
-
static #template;
|
|
26
|
-
static get template() {
|
|
27
|
-
return (this.#template ??= $(html `<div part="root content-unavailable-title-stack">
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</div>
|
|
30
|
-
<div part="root content-unavailable-description-stack">
|
|
31
|
-
<slot name="description"></slot>
|
|
32
|
-
</div>
|
|
33
|
-
<div part="root content-unavailable-actions-stack">
|
|
34
|
-
<slot name="actions"></slot>
|
|
35
|
-
</div>`));
|
|
36
|
-
}
|
|
37
|
-
#shadowRoot;
|
|
38
|
-
#slots;
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
42
|
-
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
43
|
-
this.#slots = {
|
|
44
|
-
'': this.#shadowRoot.querySelector('slot:not([name])') ?? undefined,
|
|
45
|
-
description: this.#shadowRoot.querySelector('slot[name="description"]') ?? undefined,
|
|
46
|
-
actions: this.#shadowRoot.querySelector('slot[name="actions"]') ?? undefined,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
50
|
-
if (devFlags.debug)
|
|
51
|
-
console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
52
|
-
switch (name) {
|
|
53
|
-
case 'search':
|
|
54
|
-
if (oldValue === newValue)
|
|
55
|
-
break;
|
|
56
|
-
this.#renderSearch(newValue);
|
|
57
|
-
CleanupRegistry.unregister(this, 'i18n');
|
|
58
|
-
CleanupRegistry.register(this, onoff('localechange', () => {
|
|
59
|
-
this.#renderSearch(this.getAttribute('search'));
|
|
60
|
-
}, I18n.on).on(), 'i18n');
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
disconnectedCallback() {
|
|
65
|
-
if (devFlags.debug)
|
|
66
|
-
console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
|
|
67
|
-
}
|
|
68
|
-
connectedCallback() {
|
|
69
|
-
if (devFlags.debug)
|
|
70
|
-
console.debug(`${ContentUnavailable.name} ⚡️ connect`);
|
|
71
|
-
}
|
|
72
|
-
#renderSearch = (search) => {
|
|
73
|
-
const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(html `<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(html `<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
|
|
74
|
-
if (search) {
|
|
75
|
-
const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
|
|
76
|
-
titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
|
|
77
|
-
}
|
|
78
|
-
else
|
|
79
|
-
titleLabel?.setAttribute('title', I18n.t('SearchUnavailableContent').NoLabel);
|
|
80
|
-
descText.setAttribute('title', I18n.t('SearchUnavailableContent').Description);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
2
|
-
declare const datePickerStyles: readonly ["graphical", "field", "automatic"];
|
|
3
|
-
export type DatePickerStyle = (typeof datePickerStyles)[number];
|
|
4
|
-
/**
|
|
5
|
-
* @summary A control that selects an absolute date.
|
|
6
|
-
*/
|
|
7
|
-
export declare class DatePicker extends FormAssociatedBase {
|
|
8
|
-
#private;
|
|
9
|
-
static get observedAttributes(): string[];
|
|
10
|
-
get template(): DocumentFragment;
|
|
11
|
-
constructor();
|
|
12
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
13
|
-
disconnectedCallback(): void;
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
get datePickerStyle(): DatePickerStyle;
|
|
16
|
-
/**
|
|
17
|
-
* Form participation property
|
|
18
|
-
*/
|
|
19
|
-
get name(): string;
|
|
20
|
-
get value(): {
|
|
21
|
-
year: string;
|
|
22
|
-
month: string;
|
|
23
|
-
day: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Returns the value as a Date object.
|
|
27
|
-
* @type {Date|null}
|
|
28
|
-
*/
|
|
29
|
-
get valueAsDate(): Date | null;
|
|
30
|
-
get minimum(): {
|
|
31
|
-
year: string;
|
|
32
|
-
month: string;
|
|
33
|
-
day: string;
|
|
34
|
-
} | null;
|
|
35
|
-
get maximum(): {
|
|
36
|
-
year: string;
|
|
37
|
-
month: string;
|
|
38
|
-
day: string;
|
|
39
|
-
} | null;
|
|
40
|
-
setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
|
|
41
|
-
setCustomValidity: (message: string) => void;
|
|
42
|
-
formStateRestoreCallback(state: string, reason: string): void;
|
|
43
|
-
formAssociatedCallback(form: HTMLFormElement): void;
|
|
44
|
-
formDisabledCallback(disabled: boolean): void;
|
|
45
|
-
formResetCallback(): void;
|
|
46
|
-
}
|
|
47
|
-
declare global {
|
|
48
|
-
interface HTMLElementTagNameMap {
|
|
49
|
-
'date-picker': DatePicker;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
export {};
|