@swiftwc/ui 0.0.0-dev.3 → 0.0.0-dev.31
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 +31 -2
- package/generated/client/index.js +415 -8
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +94 -0
- package/generated/components/body-view.d.ts +5 -0
- package/generated/components/body-view.js +11 -0
- package/generated/components/bordered-button.d.ts +13 -0
- package/generated/components/bordered-button.js +42 -0
- package/generated/components/bordered-prominent-button.d.ts +13 -0
- package/generated/components/bordered-prominent-button.js +42 -0
- package/generated/components/borderless-button.d.ts +13 -0
- package/generated/components/borderless-button.js +42 -0
- package/generated/components/confirmation-dialog.d.ts +9 -0
- package/generated/components/confirmation-dialog.js +108 -0
- package/generated/components/content-unavailable-view.d.ts +24 -0
- package/generated/components/content-unavailable-view.js +78 -0
- package/generated/components/date-picker.d.ts +46 -0
- package/generated/components/date-picker.js +442 -0
- package/generated/components/disclosure-group.d.ts +9 -0
- package/generated/components/disclosure-group.js +54 -0
- package/generated/components/fine-tooltip.d.ts +7 -0
- package/generated/components/fine-tooltip.js +104 -0
- package/generated/components/form-view.d.ts +6 -0
- package/generated/components/form-view.js +58 -0
- package/generated/components/glass-button.d.ts +12 -0
- package/generated/components/glass-button.js +39 -0
- package/generated/components/glass-prominent-button.d.ts +12 -0
- package/generated/components/glass-prominent-button.js +39 -0
- package/generated/components/index.d.ts +41 -1
- package/generated/components/index.js +41 -6
- package/generated/components/label-view.d.ts +9 -0
- package/generated/components/label-view.js +56 -0
- package/generated/components/list-view.d.ts +5 -0
- package/generated/components/list-view.js +29 -0
- package/generated/components/menu-view.d.ts +9 -0
- package/generated/components/menu-view.js +138 -0
- package/generated/components/navigation-large-title.d.ts +6 -0
- package/generated/components/navigation-large-title.js +177 -0
- package/generated/components/navigation-split-view.d.ts +10 -0
- package/generated/components/navigation-split-view.js +21 -0
- package/generated/components/navigation-stack.d.ts +10 -0
- package/generated/components/navigation-stack.js +27 -0
- package/generated/components/navigation-title.d.ts +8 -0
- package/generated/components/navigation-title.js +49 -0
- package/generated/components/picker-view.d.ts +27 -0
- package/generated/components/picker-view.js +452 -0
- package/generated/components/plain-button.d.ts +7 -0
- package/generated/components/plain-button.js +20 -0
- package/generated/components/progress-view.d.ts +13 -0
- package/generated/components/progress-view.js +122 -0
- package/generated/components/screen-view.d.ts +5 -0
- package/generated/components/screen-view.js +9 -0
- package/generated/components/scroll-view-proxy.d.ts +8 -0
- package/generated/components/scroll-view-proxy.js +14 -0
- package/generated/components/scroll-view.d.ts +10 -0
- package/generated/components/scroll-view.js +197 -0
- package/generated/components/section-view.d.ts +9 -0
- package/generated/components/section-view.js +81 -0
- package/generated/components/sheet-view.d.ts +8 -0
- package/generated/components/sheet-view.js +85 -0
- package/generated/components/sidebar-toggle.d.ts +7 -0
- package/generated/components/sidebar-toggle.js +82 -0
- package/generated/components/sidebar-view.d.ts +7 -0
- package/generated/components/sidebar-view.js +35 -0
- package/generated/components/sticky-container.d.ts +6 -0
- package/generated/components/sticky-container.js +24 -0
- package/generated/components/tab-bar.d.ts +10 -0
- package/generated/components/tab-bar.js +42 -0
- package/generated/components/tab-item.d.ts +7 -0
- package/generated/components/tab-item.js +125 -0
- package/generated/components/tab-view.d.ts +22 -0
- package/generated/components/tab-view.js +259 -0
- package/generated/components/table-view.d.ts +7 -0
- package/generated/components/table-view.js +187 -0
- package/generated/components/text-field.d.ts +29 -0
- package/generated/components/text-field.js +478 -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 +7 -0
- package/generated/components/tool-bar-item.js +53 -0
- package/generated/components/tool-bar.d.ts +19 -0
- package/generated/components/tool-bar.js +90 -0
- package/generated/components/v-keyboard.d.ts +11 -0
- package/generated/components/v-keyboard.js +81 -0
- package/generated/components/v-stack.d.ts +10 -0
- package/generated/components/v-stack.js +16 -0
- package/generated/css/index.css +8067 -0
- package/generated/events/alert-dialog.d.ts +8 -0
- package/generated/events/alert-dialog.js +1 -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 +8 -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 +15 -0
- package/generated/i18n/locales/el.js +15 -0
- package/generated/i18n/locales/en.d.ts +15 -0
- package/generated/i18n/locales/en.js +15 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/generated/index.js +1 -1
- package/generated/internal/class/cleanup-registry.d.ts +5 -0
- package/generated/internal/class/cleanup-registry.js +38 -0
- package/generated/internal/class/css-style-observer.d.ts +8 -0
- package/generated/internal/class/css-style-observer.js +25 -0
- package/generated/internal/class/form-associated-base.d.ts +20 -0
- package/generated/internal/class/form-associated-base.js +96 -0
- package/generated/internal/class/mutation-observer-singleton.d.ts +10 -0
- package/generated/internal/class/mutation-observer-singleton.js +46 -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 +77 -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/custom-element.d.ts +5 -0
- package/generated/internal/decorators/custom-element.js +4 -0
- package/generated/internal/privateNamespace.d.ts +4 -0
- package/generated/internal/privateNamespace.js +1 -0
- package/generated/internal/utils/add.d.ts +1 -0
- package/generated/internal/utils/add.js +7 -0
- package/generated/internal/utils/button-role.d.ts +1 -0
- package/generated/internal/utils/button-role.js +59 -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/css-time.d.ts +1 -0
- package/generated/internal/utils/css-time.js +3 -0
- package/generated/internal/utils/debounce.d.ts +1 -0
- package/generated/internal/utils/debounce.js +13 -0
- package/generated/internal/utils/frame.d.ts +1 -0
- package/generated/internal/utils/frame.js +6 -0
- package/generated/internal/utils/index.d.ts +19 -1
- package/generated/internal/utils/index.js +20 -1
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/kebab-case.d.ts +1 -1
- package/generated/internal/utils/kebab-case.js +3 -3
- package/generated/internal/utils/list-active.d.ts +7 -0
- package/generated/internal/utils/list-active.js +83 -0
- package/generated/internal/utils/microtask.d.ts +1 -0
- package/generated/internal/utils/microtask.js +3 -0
- package/generated/internal/utils/onoff.d.ts +45 -0
- package/generated/internal/utils/onoff.js +31 -0
- package/generated/internal/utils/set.d.ts +1 -0
- package/generated/internal/utils/set.js +7 -0
- package/generated/internal/utils/sleep.d.ts +1 -0
- package/generated/internal/utils/sleep.js +3 -0
- package/generated/internal/utils/slow-hide-show.d.ts +1 -0
- package/generated/internal/utils/slow-hide-show.js +16 -0
- package/generated/internal/utils/timeout.d.ts +5 -0
- package/generated/internal/utils/timeout.js +16 -0
- package/generated/internal/utils/touch-glass.d.ts +7 -0
- package/generated/internal/utils/touch-glass.js +19 -0
- package/generated/namespace-browser/base.d.ts +36 -0
- package/generated/namespace-browser/base.js +92 -0
- package/generated/namespace-browser/index.d.ts +7 -0
- package/generated/namespace-browser/index.js +1 -0
- package/generated/snapshot/index.d.ts +9 -0
- package/generated/snapshot/index.js +58 -0
- package/package.json +36 -9
- package/scss/_base.scss +5 -0
- package/scss/_components.scss +82 -0
- package/scss/_final.scss +1 -0
- package/scss/_functions.scss +31 -0
- package/scss/_mixins.scss +7 -0
- package/scss/_placeholders.scss +3 -0
- package/scss/_transitions.scss +32 -0
- package/scss/_utils.scss +9 -0
- package/scss/_vars.scss +179 -3
- package/scss/base/_layout.scss +56 -0
- package/scss/base/_reboot.scss +191 -0
- package/scss/base/_root.scss +397 -0
- package/scss/colors/_index.scss +704 -0
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_body-view.scss +17 -0
- package/scss/components/_bordered-button.scss +57 -0
- package/scss/components/_bordered-prominent-button.scss +63 -0
- package/scss/components/_borderless-button.scss +44 -0
- package/scss/components/_confirmation-dialog.scss +117 -0
- package/scss/components/_content-unavailable-view.scss +45 -0
- package/scss/components/_date-picker.scss +30 -0
- package/scss/components/_detail-placeholder.scss +153 -0
- package/scss/components/_disclosure-group.scss +175 -0
- package/scss/components/_fine-tooltip.scss +82 -0
- package/scss/components/_form-view.scss +195 -0
- package/scss/components/_full-screen.scss +15 -0
- package/scss/components/_glass-button.scss +59 -0
- package/scss/components/_glass-prominent-button.scss +68 -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/_index.scss +249 -0
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +355 -0
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +9 -0
- package/scss/components/_list-view.scss +229 -0
- package/scss/components/_menu-view.scss +205 -0
- package/scss/components/_navigation-large-title.scss +27 -0
- package/scss/components/_navigation-split-view.scss +424 -0
- package/scss/components/_navigation-stack.scss +11 -0
- package/scss/components/_navigation-title.scss +10 -0
- package/scss/components/_picker-view.scss +122 -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 +130 -0
- package/scss/components/_section-view.scss +119 -0
- package/scss/components/_sheet-view.scss +102 -0
- package/scss/components/_sidebar-toggle.scss +121 -0
- package/scss/components/_sidebar-view.scss +53 -0
- package/scss/components/_sticky-container.scss +42 -0
- package/scss/components/_tab-bar.scss +260 -0
- package/scss/components/_tab-item.scss +25 -0
- package/scss/components/_tab-view.scss +312 -0
- package/scss/components/_table-column.scss +52 -0
- package/scss/components/_table-row.scss +172 -0
- package/scss/components/_table-view.scss +223 -0
- package/scss/components/_text-field.scss +37 -0
- package/scss/components/_tool-bar-item-group.scss +48 -0
- package/scss/components/_tool-bar-item.scss +97 -0
- package/scss/components/_tool-bar.scss +153 -0
- package/scss/components/_v-divider.scss +13 -0
- package/scss/components/_v-flex-stack.scss +29 -0
- package/scss/components/_v-keyboard.scss +14 -0
- package/scss/components/_v-stack.scss +25 -0
- package/scss/final/_touch-glass.scss +91 -0
- package/scss/index.scss +15 -6
- 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 +422 -0
- package/scss/placeholders/_buttons.scss +117 -0
- package/scss/placeholders/_lists.scss +561 -0
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_bwd.navbar.scss +19 -0
- package/scss/transitions/_bwd.scss +39 -0
- package/scss/transitions/_confirmation-dialog.scss +13 -0
- package/scss/transitions/_disclosure-group.scss +35 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_fwd.navbar.scss +41 -0
- package/scss/transitions/_fwd.scss +24 -0
- package/scss/transitions/_glass-button.scss +12 -0
- package/scss/transitions/_glass-prominent-button.scss +12 -0
- package/scss/transitions/_index.scss +74 -0
- package/scss/transitions/_menu-view.scss +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 +77 -0
- package/scss/utils/_scroll-view.scss +14 -0
- package/scss/utils/_spacing.scss +25 -0
- package/scss/utils/_stacks.scss +247 -0
- package/web-components.html-data/en.json +458 -0
- package/generated/internal/snapshot.d.ts +0 -5
- package/generated/internal/snapshot.js +0 -23
- package/generated/styles.css +0 -8
- package/scss/_reboot.scss +0 -11
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
+
import { buttonRole, onoff } from '../internal/utils';
|
|
3
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
import { Snapshot } from '../snapshot';
|
|
5
|
+
/**
|
|
6
|
+
* @slot overlay
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export class BorderedButton extends ButtonBase {
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return ['role', 'title-key'];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
}
|
|
16
|
+
static polyfillDisconnectedCallback(el) {
|
|
17
|
+
console.debug(`${BorderedButton.name} ⚡️ disconnect`);
|
|
18
|
+
CleanupRegistry.unregister(el);
|
|
19
|
+
}
|
|
20
|
+
static polyfillConnectedCallback(el) {
|
|
21
|
+
console.debug(`${BorderedButton.name} ⚡️ connect`);
|
|
22
|
+
el.tabIndex = 0;
|
|
23
|
+
CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
|
|
24
|
+
}
|
|
25
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
26
|
+
console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
27
|
+
const node = target instanceof HTMLButtonElement && target;
|
|
28
|
+
if (!node)
|
|
29
|
+
return;
|
|
30
|
+
switch (attributeName) {
|
|
31
|
+
case 'title-key':
|
|
32
|
+
case 'role':
|
|
33
|
+
Snapshot.waitReady.then(() => {
|
|
34
|
+
buttonRole(target, target.getAttribute('role'), target.getAttribute('title-key'));
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static #handleClick = async (evt) => {
|
|
40
|
+
//
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
2
|
+
/**
|
|
3
|
+
* @slot overlay
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class BorderedProminentButton extends ButtonBase {
|
|
7
|
+
#private;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
constructor();
|
|
10
|
+
static polyfillDisconnectedCallback(el: BorderedProminentButton): void;
|
|
11
|
+
static polyfillConnectedCallback(el: BorderedProminentButton): void;
|
|
12
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
+
import { buttonRole, onoff } from '../internal/utils';
|
|
3
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
import { Snapshot } from '../snapshot';
|
|
5
|
+
/**
|
|
6
|
+
* @slot overlay
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export class BorderedProminentButton extends ButtonBase {
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return ['role', 'title-key'];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
}
|
|
16
|
+
static polyfillDisconnectedCallback(el) {
|
|
17
|
+
console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
|
|
18
|
+
CleanupRegistry.unregister(el);
|
|
19
|
+
}
|
|
20
|
+
static polyfillConnectedCallback(el) {
|
|
21
|
+
console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
|
|
22
|
+
el.tabIndex = 0;
|
|
23
|
+
CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
|
|
24
|
+
}
|
|
25
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
26
|
+
console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
27
|
+
const node = target instanceof HTMLButtonElement && target;
|
|
28
|
+
if (!node)
|
|
29
|
+
return;
|
|
30
|
+
switch (attributeName) {
|
|
31
|
+
case 'title-key':
|
|
32
|
+
case 'role':
|
|
33
|
+
Snapshot.waitReady.then(() => {
|
|
34
|
+
buttonRole(target, target.getAttribute('role'), target.getAttribute('title-key'));
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static #handleClick = async (evt) => {
|
|
40
|
+
//
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
2
|
+
/**
|
|
3
|
+
* @slot overlay
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class BorderlessButton extends ButtonBase {
|
|
7
|
+
#private;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
constructor();
|
|
10
|
+
static polyfillDisconnectedCallback(el: BorderlessButton): void;
|
|
11
|
+
static polyfillConnectedCallback(el: BorderlessButton): void;
|
|
12
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
+
import { buttonRole, onoff } from '../internal/utils';
|
|
3
|
+
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
import { Snapshot } from '../snapshot';
|
|
5
|
+
/**
|
|
6
|
+
* @slot overlay
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export class BorderlessButton extends ButtonBase {
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return ['role', 'title-key'];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
}
|
|
16
|
+
static polyfillDisconnectedCallback(el) {
|
|
17
|
+
console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
|
|
18
|
+
CleanupRegistry.unregister(el);
|
|
19
|
+
}
|
|
20
|
+
static polyfillConnectedCallback(el) {
|
|
21
|
+
console.debug(`${BorderlessButton.name} ⚡️ connect`);
|
|
22
|
+
el.tabIndex = 0;
|
|
23
|
+
CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
|
|
24
|
+
}
|
|
25
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
26
|
+
console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
27
|
+
const node = target instanceof HTMLButtonElement && target;
|
|
28
|
+
if (!node)
|
|
29
|
+
return;
|
|
30
|
+
switch (attributeName) {
|
|
31
|
+
case 'title-key':
|
|
32
|
+
case 'role':
|
|
33
|
+
Snapshot.waitReady.then(() => {
|
|
34
|
+
buttonRole(target, target.getAttribute('role'), target.getAttribute('title-key'));
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static #handleClick = async (evt) => {
|
|
40
|
+
// alert(99)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DialogBase } from '../namespace-browser/base';
|
|
2
|
+
export declare class ConfirmationDialog extends DialogBase {
|
|
3
|
+
#private;
|
|
4
|
+
static get observedAttributes(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
static polyfillDisconnectedCallback(el: ConfirmationDialog): void;
|
|
7
|
+
static polyfillConnectedCallback(el: ConfirmationDialog): void;
|
|
8
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { confirmationDialog } from '../buses';
|
|
2
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
+
import { isInside, onoff, touchGlass } from '../internal/utils';
|
|
4
|
+
import { DialogBase } from '../namespace-browser/base';
|
|
5
|
+
export class ConfirmationDialog extends DialogBase {
|
|
6
|
+
static get observedAttributes() {
|
|
7
|
+
return ['anchor'];
|
|
8
|
+
}
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
static polyfillDisconnectedCallback(el) {
|
|
13
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
|
|
14
|
+
const positionAnchor = el.style.getPropertyValue('position-anchor');
|
|
15
|
+
document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
|
|
16
|
+
el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
|
|
17
|
+
CleanupRegistry.unregister(el);
|
|
18
|
+
confirmationDialog.dispatchEvent(new CustomEvent('confirmation:return', {
|
|
19
|
+
detail: { returnValue: el.returnValue, positionAnchor },
|
|
20
|
+
bubbles: true,
|
|
21
|
+
composed: true,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
static polyfillConnectedCallback(el) {
|
|
25
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
|
|
26
|
+
CleanupRegistry.register(el, onoff([
|
|
27
|
+
{ types: 'click', listener: this.#handleDialogClick },
|
|
28
|
+
{ types: 'close', listener: this.#handleDialogClose },
|
|
29
|
+
{ types: 'cancel', listener: this.#handleDialogCancel },
|
|
30
|
+
], el).on());
|
|
31
|
+
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, (evt) => {
|
|
32
|
+
const target = evt.target instanceof HTMLElement && evt.target;
|
|
33
|
+
if (!target)
|
|
34
|
+
return true;
|
|
35
|
+
if (target.matches('[is=confirmation-dialog]'))
|
|
36
|
+
return false;
|
|
37
|
+
// if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
|
|
38
|
+
return true;
|
|
39
|
+
}), el).on());
|
|
40
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
|
|
41
|
+
el.removeAttribute('closing');
|
|
42
|
+
el.scrollTop = 0;
|
|
43
|
+
el.returnValue = '';
|
|
44
|
+
el.autofocus = true;
|
|
45
|
+
el.showModal();
|
|
46
|
+
}
|
|
47
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
48
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
49
|
+
// const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
|
|
50
|
+
switch (attributeName) {
|
|
51
|
+
case 'label':
|
|
52
|
+
// let label = this.querySelector(':scope>[slot=label]')
|
|
53
|
+
// if (newValue) {
|
|
54
|
+
// label ??= this.appendChild($(`<label-view slot="label"></label-view>`))
|
|
55
|
+
// label.setAttribute('title', newValue)
|
|
56
|
+
// } else label?.remove()
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static #handleDialogClick = (evt) => {
|
|
61
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
|
|
62
|
+
const dialog = evt.currentTarget instanceof HTMLDialogElement && evt.currentTarget;
|
|
63
|
+
if (!dialog)
|
|
64
|
+
return;
|
|
65
|
+
const target = evt.target instanceof HTMLElement && evt.target;
|
|
66
|
+
if (!target)
|
|
67
|
+
return;
|
|
68
|
+
if (target.matches('dialog') && !isInside(evt.clientX, evt.clientY, dialog.getBoundingClientRect()))
|
|
69
|
+
return dialog.requestClose(); // click outside
|
|
70
|
+
const button = target.closest('button');
|
|
71
|
+
if (!button)
|
|
72
|
+
return;
|
|
73
|
+
button.scrollIntoView({
|
|
74
|
+
behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
|
|
75
|
+
block: 'nearest',
|
|
76
|
+
inline: 'nearest',
|
|
77
|
+
});
|
|
78
|
+
dialog.returnValue = button.value;
|
|
79
|
+
dialog.requestClose(button.value);
|
|
80
|
+
evt.stopPropagation();
|
|
81
|
+
evt.stopImmediatePropagation();
|
|
82
|
+
};
|
|
83
|
+
static #handleDialogCancel = (evt) => {
|
|
84
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
|
|
85
|
+
if (!evt.cancelable)
|
|
86
|
+
return;
|
|
87
|
+
const target = evt.target instanceof HTMLDialogElement && evt.target;
|
|
88
|
+
if (!target)
|
|
89
|
+
return;
|
|
90
|
+
evt.preventDefault();
|
|
91
|
+
target.inert = true;
|
|
92
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
|
|
93
|
+
target.setAttribute('closing', '');
|
|
94
|
+
Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
|
|
95
|
+
if (!target.hasAttribute('closing'))
|
|
96
|
+
return;
|
|
97
|
+
target?.close(target?.returnValue);
|
|
98
|
+
target.removeAttribute('closing');
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
static #handleDialogClose = (evt) => {
|
|
102
|
+
console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
|
|
103
|
+
const target = evt.target instanceof HTMLDialogElement && evt.target;
|
|
104
|
+
if (!target)
|
|
105
|
+
return;
|
|
106
|
+
target.remove();
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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-view search></content-unavailable-view>
|
|
5
|
+
*
|
|
6
|
+
* @example <content-unavailable-view search="foo"></content-unavailable-view>
|
|
7
|
+
*
|
|
8
|
+
* @example <content-unavailable-view padding><label-view title="No Mail"><i class="ph ph-tray" slot="image" 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-view>
|
|
9
|
+
*
|
|
10
|
+
* @example <content-unavailable-view padding><label-view title="No Mail"><svg slot="image" 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-view>
|
|
11
|
+
*
|
|
12
|
+
* @slot description
|
|
13
|
+
* @slot actions
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class ContentUnavailableView extends HTMLElement {
|
|
17
|
+
#private;
|
|
18
|
+
static get observedAttributes(): string[];
|
|
19
|
+
static get template(): DocumentFragment;
|
|
20
|
+
constructor();
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { I18n } from '../i18n';
|
|
2
|
+
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
+
import { $, onoff } from '../internal/utils';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
6
|
+
*
|
|
7
|
+
* @example <content-unavailable-view search></content-unavailable-view>
|
|
8
|
+
*
|
|
9
|
+
* @example <content-unavailable-view search="foo"></content-unavailable-view>
|
|
10
|
+
*
|
|
11
|
+
* @example <content-unavailable-view padding><label-view title="No Mail"><i class="ph ph-tray" slot="image" 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-view>
|
|
12
|
+
*
|
|
13
|
+
* @example <content-unavailable-view padding><label-view title="No Mail"><svg slot="image" 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-view>
|
|
14
|
+
*
|
|
15
|
+
* @slot description
|
|
16
|
+
* @slot actions
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class ContentUnavailableView extends HTMLElement {
|
|
20
|
+
static get observedAttributes() {
|
|
21
|
+
return ['search'];
|
|
22
|
+
}
|
|
23
|
+
static #template;
|
|
24
|
+
static get template() {
|
|
25
|
+
return (this.#template ??= $(String.raw `
|
|
26
|
+
<div part="root content-unavailable-title-stack">
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</div>
|
|
29
|
+
<div part="root content-unavailable-description-stack">
|
|
30
|
+
<slot name="description"></slot>
|
|
31
|
+
</div>
|
|
32
|
+
<div part="root content-unavailable-actions-stack">
|
|
33
|
+
<slot name="actions"></slot>
|
|
34
|
+
</div>`));
|
|
35
|
+
}
|
|
36
|
+
#shadowRoot;
|
|
37
|
+
#slots;
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
41
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
42
|
+
this.#slots = {
|
|
43
|
+
'': this.#shadowRoot.querySelector('slot:not([name])') ?? undefined,
|
|
44
|
+
description: this.#shadowRoot.querySelector('slot[name="description"]') ?? undefined,
|
|
45
|
+
actions: this.#shadowRoot.querySelector('slot[name="actions"]') ?? undefined,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
console.debug(`${ContentUnavailableView.name} ⚡️ disconnect`);
|
|
50
|
+
}
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
console.debug(`${ContentUnavailableView.name} ⚡️ connect`);
|
|
53
|
+
}
|
|
54
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
55
|
+
console.debug(`${ContentUnavailableView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
56
|
+
switch (name) {
|
|
57
|
+
case 'search':
|
|
58
|
+
if (oldValue === newValue)
|
|
59
|
+
break;
|
|
60
|
+
this.#renderSearch(newValue);
|
|
61
|
+
CleanupRegistry.unregister(this, 'i18n');
|
|
62
|
+
CleanupRegistry.register(this, onoff('localechange', () => {
|
|
63
|
+
this.#renderSearch(this.getAttribute('search'));
|
|
64
|
+
}, I18n.on).on(), 'i18n');
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
#renderSearch = (search) => {
|
|
69
|
+
const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<label-view><i class="ph ph-magnifying-glass" slot="image" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(`<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
|
|
70
|
+
if (search) {
|
|
71
|
+
const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
|
|
72
|
+
titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
titleLabel?.setAttribute('title', I18n.t('SearchUnavailableContent').NoLabel);
|
|
76
|
+
descText.setAttribute('title', I18n.t('SearchUnavailableContent').Description);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
export declare class DatePicker extends FormAssociatedBase {
|
|
5
|
+
#private;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
get template(): DocumentFragment;
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
12
|
+
get datePickerStyle(): DatePickerStyle;
|
|
13
|
+
get selection(): {
|
|
14
|
+
year: string;
|
|
15
|
+
month: string;
|
|
16
|
+
day: string;
|
|
17
|
+
};
|
|
18
|
+
set selection(v: {
|
|
19
|
+
year: string;
|
|
20
|
+
month: string;
|
|
21
|
+
day: string;
|
|
22
|
+
});
|
|
23
|
+
get name(): string;
|
|
24
|
+
get value(): {
|
|
25
|
+
year: string;
|
|
26
|
+
month: string;
|
|
27
|
+
day: string;
|
|
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
|
+
formAssociatedCallback: (form: HTMLFormElement) => void;
|
|
43
|
+
formDisabledCallback: (disabled: boolean) => void;
|
|
44
|
+
formResetCallback: () => void;
|
|
45
|
+
}
|
|
46
|
+
export {};
|