@swiftwc/ui 0.0.0-dev.4 → 0.0.0-dev.41
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 +24 -0
- package/generated/client/index.js +272 -0
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +99 -0
- package/generated/components/body-view.d.ts +5 -0
- package/generated/components/body-view.js +14 -0
- package/generated/components/bordered-button.d.ts +13 -0
- package/generated/components/bordered-button.js +45 -0
- package/generated/components/bordered-prominent-button.d.ts +13 -0
- package/generated/components/bordered-prominent-button.js +45 -0
- package/generated/components/borderless-button.d.ts +13 -0
- package/generated/components/borderless-button.js +45 -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 +468 -0
- package/generated/components/disclosure-group.d.ts +9 -0
- package/generated/components/disclosure-group.js +58 -0
- package/generated/components/fine-tooltip.d.ts +7 -0
- package/generated/components/fine-tooltip.js +107 -0
- package/generated/components/form-view.d.ts +6 -0
- package/generated/components/form-view.js +60 -0
- package/generated/components/glass-button.d.ts +12 -0
- package/generated/components/glass-button.js +42 -0
- package/generated/components/glass-prominent-button.d.ts +12 -0
- package/generated/components/glass-prominent-button.js +42 -0
- package/generated/components/index.d.ts +42 -0
- package/generated/components/index.js +42 -0
- package/generated/components/label-view.d.ts +9 -0
- package/generated/components/label-view.js +59 -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 +145 -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 +10 -0
- package/generated/components/navigation-split-view.js +25 -0
- package/generated/components/navigation-stack.d.ts +10 -0
- package/generated/components/navigation-stack.js +31 -0
- package/generated/components/navigation-title.d.ts +8 -0
- package/generated/components/navigation-title.js +52 -0
- package/generated/components/picker-view.d.ts +28 -0
- package/generated/components/picker-view.js +697 -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 +125 -0
- package/generated/components/screen-view.d.ts +5 -0
- package/generated/components/screen-view.js +11 -0
- package/generated/components/scroll-view-proxy.d.ts +8 -0
- package/generated/components/scroll-view-proxy.js +17 -0
- package/generated/components/scroll-view.d.ts +10 -0
- package/generated/components/scroll-view.js +202 -0
- package/generated/components/search-view.d.ts +8 -0
- package/generated/components/search-view.js +30 -0
- package/generated/components/section-view.d.ts +9 -0
- package/generated/components/section-view.js +83 -0
- package/generated/components/sheet-view.d.ts +8 -0
- package/generated/components/sheet-view.js +62 -0
- package/generated/components/sidebar-toggle.d.ts +7 -0
- package/generated/components/sidebar-toggle.js +85 -0
- package/generated/components/sidebar-view.d.ts +7 -0
- package/generated/components/sidebar-view.js +34 -0
- package/generated/components/sticky-container.d.ts +6 -0
- package/generated/components/sticky-container.js +26 -0
- package/generated/components/tab-bar.d.ts +10 -0
- package/generated/components/tab-bar.js +43 -0
- package/generated/components/tab-item.d.ts +7 -0
- package/generated/components/tab-item.js +132 -0
- package/generated/components/tab-view.d.ts +22 -0
- package/generated/components/tab-view.js +264 -0
- package/generated/components/table-view.d.ts +7 -0
- package/generated/components/table-view.js +174 -0
- package/generated/components/text-field.d.ts +29 -0
- package/generated/components/text-field.js +503 -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 +15 -0
- package/generated/components/v-keyboard.js +89 -0
- package/generated/components/v-stack.d.ts +10 -0
- package/generated/components/v-stack.js +19 -0
- package/generated/css/index.css +8089 -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 +15 -0
- package/generated/events/picker-view.js +1 -0
- package/generated/events/scroll-view.d.ts +10 -0
- package/generated/events/scroll-view.js +1 -0
- package/generated/events/tab-view.d.ts +28 -0
- package/generated/events/tab-view.js +1 -0
- package/generated/events/text-field.d.ts +8 -0
- package/generated/events/text-field.js +1 -0
- package/generated/i18n/index.d.ts +34 -0
- package/generated/i18n/index.js +167 -0
- package/generated/i18n/locales/el.d.ts +16 -0
- package/generated/i18n/locales/el.js +16 -0
- package/generated/i18n/locales/en.d.ts +16 -0
- package/generated/i18n/locales/en.js +16 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/generated/index.d.ts +2 -0
- package/generated/index.js +3 -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 +79 -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 +4 -0
- package/generated/internal/decorators/index.js +4 -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/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/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 +19 -0
- package/generated/internal/utils/index.js +22 -0
- 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 -0
- package/generated/internal/utils/kebab-case.js +11 -0
- 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 +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 +9 -0
- package/generated/snapshot/index.js +60 -0
- package/package.json +35 -11
- package/scss/_components.scss +59 -14
- 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 +142 -23
- package/scss/base/_layout.scss +31 -16
- package/scss/base/_reboot.scss +151 -15
- package/scss/base/_root.scss +355 -25
- package/scss/colors/_index.scss +672 -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 +63 -0
- package/scss/components/_borderless-button.scss +36 -6
- package/scss/components/_confirmation-dialog.scss +84 -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 +146 -51
- package/scss/components/_fine-tooltip.scss +82 -0
- package/scss/components/_form-view.scss +195 -0
- package/scss/components/_full-screen.scss +7 -5
- 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 +234 -7
- 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 +211 -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 +131 -0
- package/scss/components/_plain-button.scss +18 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +79 -0
- package/scss/components/_scroll-view-toolbars.scss +126 -0
- package/scss/components/_scroll-view.scss +114 -66
- package/scss/components/_search-view.scss +18 -0
- package/scss/components/_section-view.scss +119 -0
- package/scss/components/_sheet-view.scss +78 -35
- package/scss/components/_sidebar-toggle.scss +87 -27
- package/scss/components/_sidebar-view.scss +30 -40
- package/scss/components/_sticky-container.scss +42 -0
- package/scss/components/_tab-bar.scss +207 -84
- package/scss/components/_tab-item.scss +25 -0
- package/scss/components/_tab-view.scss +270 -126
- 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 +30 -19
- package/scss/components/_tool-bar-item.scss +81 -71
- package/scss/components/_tool-bar.scss +126 -63
- package/scss/components/_v-divider.scss +13 -0
- package/scss/components/_v-flex-stack.scss +29 -0
- package/scss/components/_v-keyboard.scss +6 -4
- package/scss/components/_v-stack.scss +15 -9
- package/scss/final/_touch-glass.scss +91 -0
- package/scss/index.scss +6 -2
- package/scss/mixins/_button.scss +44 -0
- package/scss/mixins/_color.scss +16 -0
- package/scss/mixins/_dialog.scss +89 -0
- package/scss/mixins/_index.scss +422 -0
- package/scss/placeholders/_buttons.scss +117 -0
- package/scss/placeholders/_lists.scss +571 -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 +22 -0
- package/scss/transitions/_disclosure-group.scss +35 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_fwd.navbar.scss +4 -9
- package/scss/transitions/_fwd.scss +4 -34
- package/scss/transitions/_glass-button.scss +12 -0
- package/scss/transitions/_glass-prominent-button.scss +12 -0
- package/scss/transitions/_index.scss +35 -143
- package/scss/transitions/_menu-view.scss +26 -0
- package/scss/transitions/_navigation-split-view.scss +23 -0
- package/scss/transitions/_progress-view.scss +23 -0
- package/scss/transitions/_sheet-view.scss +30 -0
- package/scss/transitions/_sidebar-view.scss +36 -0
- package/scss/transitions/_tab-bar.scss +20 -0
- package/scss/utils/_frame.scss +91 -0
- package/scss/utils/_index.scss +91 -0
- package/scss/utils/_scroll-view.scss +14 -0
- package/scss/utils/_spacing.scss +25 -0
- package/scss/utils/_stacks.scss +209 -0
- package/web-components.html-data/en.json +500 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (ms: number): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (to: 'show' | 'hide', el?: HTMLElement): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import frame from './frame';
|
|
2
|
+
export default function (to, el) {
|
|
3
|
+
const transcleanup = ({ propertyName }) => {
|
|
4
|
+
if ('opacity' !== propertyName)
|
|
5
|
+
return;
|
|
6
|
+
el?.removeAttribute('slow');
|
|
7
|
+
};
|
|
8
|
+
for (const eventType of ['transitionend', 'transitioncancel'])
|
|
9
|
+
el?.addEventListener(eventType, transcleanup, {
|
|
10
|
+
once: true,
|
|
11
|
+
});
|
|
12
|
+
el?.setAttribute('slow', '');
|
|
13
|
+
frame(el).then(() => {
|
|
14
|
+
el?.setAttribute('slow', to);
|
|
15
|
+
}); //self.requestAnimationFrame(() => el?.setAttribute('slow', to))
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function () {
|
|
2
|
+
let id;
|
|
3
|
+
const cancel = () => {
|
|
4
|
+
if (!id)
|
|
5
|
+
return;
|
|
6
|
+
self.clearTimeout(id);
|
|
7
|
+
id = undefined;
|
|
8
|
+
}, next = (fn, ms) => {
|
|
9
|
+
cancel();
|
|
10
|
+
id = self.setTimeout(() => {
|
|
11
|
+
fn();
|
|
12
|
+
id = undefined;
|
|
13
|
+
}, ms);
|
|
14
|
+
}, pending = () => undefined !== id;
|
|
15
|
+
return { next, cancel, pending };
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const makePointerdownHandler = (target, targetCallback, checkCallback) => {
|
|
2
|
+
return function (evt) {
|
|
3
|
+
// if (event.pointerType !== 'touch') return
|
|
4
|
+
if (!checkCallback(evt))
|
|
5
|
+
return;
|
|
6
|
+
targetCallback(target).toggleAttribute('touch-glass', true);
|
|
7
|
+
};
|
|
8
|
+
}, makePointercancelHandler = (target, targetCallback) => {
|
|
9
|
+
return function (evt) {
|
|
10
|
+
targetCallback(target).toggleAttribute('touch-glass', false);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default function (t, targetCallback, checkCallback) {
|
|
14
|
+
const downListener = makePointerdownHandler(t, targetCallback, checkCallback), cancelListener = makePointercancelHandler(t, targetCallback);
|
|
15
|
+
return [
|
|
16
|
+
{ types: 'pointerdown', listener: downListener, addOptions: { passive: true } },
|
|
17
|
+
{ types: 'pointerup pointercancel pointerleave', listener: cancelListener, addOptions: { passive: true } },
|
|
18
|
+
];
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare abstract class DialogBase extends HTMLDialogElement {
|
|
2
|
+
static polyfillExtends: "dialog";
|
|
3
|
+
static polyfillConnectedCallback(el: HTMLDialogElement): void;
|
|
4
|
+
static polyfillDisconnectedCallback(el: HTMLDialogElement): void;
|
|
5
|
+
static polyfillAttributeChangedCallback(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
6
|
+
disconnectedCallback(): void;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class InputBase extends HTMLInputElement {
|
|
11
|
+
static polyfillExtends: "input";
|
|
12
|
+
static polyfillConnectedCallback(el: HTMLInputElement): void;
|
|
13
|
+
static polyfillDisconnectedCallback(el: HTMLInputElement): void;
|
|
14
|
+
static polyfillAttributeChangedCallback(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
connectedCallback(): void;
|
|
17
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class ButtonBase extends HTMLButtonElement {
|
|
20
|
+
static polyfillExtends: "button";
|
|
21
|
+
static polyfillConnectedCallback(el: HTMLButtonElement): void;
|
|
22
|
+
static polyfillDisconnectedCallback(el: HTMLButtonElement): void;
|
|
23
|
+
static polyfillAttributeChangedCallback(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
24
|
+
disconnectedCallback(): void;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
27
|
+
}
|
|
28
|
+
export declare abstract class DetailsBase extends HTMLDetailsElement {
|
|
29
|
+
static polyfillExtends: "details";
|
|
30
|
+
static polyfillConnectedCallback(el: HTMLDetailsElement): void;
|
|
31
|
+
static polyfillDisconnectedCallback(el: HTMLDetailsElement): void;
|
|
32
|
+
static polyfillAttributeChangedCallback(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
33
|
+
disconnectedCallback(): void;
|
|
34
|
+
connectedCallback(): void;
|
|
35
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
36
|
+
}
|
|
37
|
+
export declare abstract class FormBase extends HTMLFormElement {
|
|
38
|
+
static polyfillExtends: "form";
|
|
39
|
+
static polyfillConnectedCallback(el: HTMLFormElement): void;
|
|
40
|
+
static polyfillDisconnectedCallback(el: HTMLFormElement): void;
|
|
41
|
+
static polyfillAttributeChangedCallback(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
42
|
+
disconnectedCallback(): void;
|
|
43
|
+
connectedCallback(): void;
|
|
44
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export class DialogBase extends HTMLDialogElement {
|
|
2
|
+
static polyfillExtends = 'dialog';
|
|
3
|
+
static polyfillConnectedCallback(el) { }
|
|
4
|
+
static polyfillDisconnectedCallback(el) { }
|
|
5
|
+
static polyfillAttributeChangedCallback(entries) { } //MutationRecord[]) {}
|
|
6
|
+
disconnectedCallback() {
|
|
7
|
+
const ctor = this.constructor;
|
|
8
|
+
ctor.polyfillDisconnectedCallback(this);
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
const ctor = this.constructor;
|
|
12
|
+
ctor.polyfillConnectedCallback(this);
|
|
13
|
+
}
|
|
14
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
15
|
+
const ctor = this.constructor;
|
|
16
|
+
const entry = {
|
|
17
|
+
attributeName: name,
|
|
18
|
+
oldValue,
|
|
19
|
+
target: this,
|
|
20
|
+
};
|
|
21
|
+
ctor.polyfillAttributeChangedCallback([entry]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class InputBase extends HTMLInputElement {
|
|
25
|
+
static polyfillExtends = 'input';
|
|
26
|
+
static polyfillConnectedCallback(el) { }
|
|
27
|
+
static polyfillDisconnectedCallback(el) { }
|
|
28
|
+
static polyfillAttributeChangedCallback(entries) { } //MutationRecord[]) {}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
const ctor = this.constructor;
|
|
31
|
+
ctor.polyfillDisconnectedCallback(this);
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
const ctor = this.constructor;
|
|
35
|
+
ctor.polyfillConnectedCallback(this);
|
|
36
|
+
}
|
|
37
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
38
|
+
const ctor = this.constructor;
|
|
39
|
+
const entry = {
|
|
40
|
+
attributeName: name,
|
|
41
|
+
oldValue,
|
|
42
|
+
target: this,
|
|
43
|
+
};
|
|
44
|
+
ctor.polyfillAttributeChangedCallback([entry]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export class ButtonBase extends HTMLButtonElement {
|
|
48
|
+
static polyfillExtends = 'button';
|
|
49
|
+
static polyfillConnectedCallback(el) { }
|
|
50
|
+
static polyfillDisconnectedCallback(el) { }
|
|
51
|
+
static polyfillAttributeChangedCallback(entries) { } //MutationRecord[]) {}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
const ctor = this.constructor;
|
|
54
|
+
ctor.polyfillDisconnectedCallback(this);
|
|
55
|
+
}
|
|
56
|
+
connectedCallback() {
|
|
57
|
+
const ctor = this.constructor;
|
|
58
|
+
ctor.polyfillConnectedCallback(this);
|
|
59
|
+
}
|
|
60
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
61
|
+
const ctor = this.constructor;
|
|
62
|
+
const entry = {
|
|
63
|
+
attributeName: name,
|
|
64
|
+
oldValue,
|
|
65
|
+
target: this,
|
|
66
|
+
};
|
|
67
|
+
ctor.polyfillAttributeChangedCallback([entry]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class DetailsBase extends HTMLDetailsElement {
|
|
71
|
+
static polyfillExtends = 'details';
|
|
72
|
+
static polyfillConnectedCallback(el) { }
|
|
73
|
+
static polyfillDisconnectedCallback(el) { }
|
|
74
|
+
static polyfillAttributeChangedCallback(entries) { } //MutationRecord[]) {}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
const ctor = this.constructor;
|
|
77
|
+
ctor.polyfillDisconnectedCallback(this);
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
const ctor = this.constructor;
|
|
81
|
+
ctor.polyfillConnectedCallback(this);
|
|
82
|
+
}
|
|
83
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
84
|
+
const ctor = this.constructor;
|
|
85
|
+
const entry = {
|
|
86
|
+
attributeName: name,
|
|
87
|
+
oldValue,
|
|
88
|
+
target: this,
|
|
89
|
+
};
|
|
90
|
+
ctor.polyfillAttributeChangedCallback([entry]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export class FormBase extends HTMLFormElement {
|
|
94
|
+
static polyfillExtends = 'form';
|
|
95
|
+
static polyfillConnectedCallback(el) { }
|
|
96
|
+
static polyfillDisconnectedCallback(el) { }
|
|
97
|
+
static polyfillAttributeChangedCallback(entries) { } //MutationRecord[]) {}
|
|
98
|
+
disconnectedCallback() {
|
|
99
|
+
const ctor = this.constructor;
|
|
100
|
+
ctor.polyfillDisconnectedCallback(this);
|
|
101
|
+
}
|
|
102
|
+
connectedCallback() {
|
|
103
|
+
const ctor = this.constructor;
|
|
104
|
+
ctor.polyfillConnectedCallback(this);
|
|
105
|
+
}
|
|
106
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
107
|
+
const ctor = this.constructor;
|
|
108
|
+
const entry = {
|
|
109
|
+
attributeName: name,
|
|
110
|
+
oldValue,
|
|
111
|
+
target: this,
|
|
112
|
+
};
|
|
113
|
+
ctor.polyfillAttributeChangedCallback([entry]);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type WebComponentCtor = typeof HTMLElement & {
|
|
2
|
+
observedAttributes?: string[];
|
|
3
|
+
polyfillExtends?: string;
|
|
4
|
+
polyfillConnectedCallback(el: HTMLElement): void;
|
|
5
|
+
polyfillDisconnectedCallback(el: HTMLElement): void;
|
|
6
|
+
polyfillAttributeChangedCallback?(entries: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class Snapshot {
|
|
2
|
+
#private;
|
|
3
|
+
static get breakpoints(): ReadonlyMap<string, boolean> | undefined;
|
|
4
|
+
static on: EventTarget;
|
|
5
|
+
static readonly waitReady: Promise<[void, void]>;
|
|
6
|
+
static waitReadyFor<T extends HTMLElement>(element: T): Promise<T | null>;
|
|
7
|
+
static get config(): Record<string, string> | undefined;
|
|
8
|
+
static setOwnConfig(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { devFlags, onoff } from '../internal/utils';
|
|
2
|
+
export class Snapshot {
|
|
3
|
+
static #readyCalled = false;
|
|
4
|
+
static #config;
|
|
5
|
+
static #listeners;
|
|
6
|
+
static #breakpoints;
|
|
7
|
+
static get breakpoints() {
|
|
8
|
+
return this.#breakpoints;
|
|
9
|
+
}
|
|
10
|
+
static on = new EventTarget();
|
|
11
|
+
static waitReady = Promise.all([
|
|
12
|
+
'complete' === document.readyState ? Promise.resolve() : new Promise((r) => self.addEventListener('load', () => r(), { once: true })),
|
|
13
|
+
(async () => {
|
|
14
|
+
if (!this.#readyCalled)
|
|
15
|
+
await this.setOwnConfig();
|
|
16
|
+
})(), // Lazy config read promise, triggered on first access
|
|
17
|
+
]);
|
|
18
|
+
static async waitReadyFor(element) {
|
|
19
|
+
if (!element.isConnected)
|
|
20
|
+
return null;
|
|
21
|
+
await this.waitReady;
|
|
22
|
+
return element.isConnected ? element : null;
|
|
23
|
+
}
|
|
24
|
+
static get config() {
|
|
25
|
+
return this.#config;
|
|
26
|
+
}
|
|
27
|
+
static async setOwnConfig() {
|
|
28
|
+
if (!this.#readyCalled)
|
|
29
|
+
this.#readyCalled = true;
|
|
30
|
+
if ('complete' !== document.readyState)
|
|
31
|
+
await new Promise((r) => self.addEventListener('load', r, { once: true }));
|
|
32
|
+
this.#getOwnConfig();
|
|
33
|
+
}
|
|
34
|
+
static #getOwnConfig() {
|
|
35
|
+
const style = self.getComputedStyle(document.documentElement, '::before'), content = style.getPropertyValue('content'), unquoted = content.replace(/^"(.*)"$/, '$1'); // Remove quotes around the content
|
|
36
|
+
try {
|
|
37
|
+
this.#config = Object.fromEntries(new URLSearchParams(unquoted).entries()); // {"none": ""}
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
console.error('could-not-parse-config');
|
|
41
|
+
}
|
|
42
|
+
for (const off of this.#listeners ?? [])
|
|
43
|
+
off?.();
|
|
44
|
+
this.#listeners = new Set();
|
|
45
|
+
const mediaQueryList = self.matchMedia(`(pointer: fine) and (min-width: ${this.#config['ipad-sheet-view-inline-size']}) and (min-height: ${this.#config['ipad-sheet-view-height']})`);
|
|
46
|
+
this.#breakpoints = new Map([['fine_dialog_sheet', mediaQueryList.matches]]);
|
|
47
|
+
this.#listeners.add(onoff('change', (evt) => this.#handleMediaChange(evt, 'fine_dialog_sheet:change'), mediaQueryList).on());
|
|
48
|
+
if (devFlags.debug)
|
|
49
|
+
console.debug(this.#config);
|
|
50
|
+
}
|
|
51
|
+
static #handleMediaChange = ({ type, matches, media }, kind) => {
|
|
52
|
+
if (devFlags.debug)
|
|
53
|
+
console.debug(`${Snapshot.name} ⚡️ ${type}`);
|
|
54
|
+
this.#breakpoints?.set('fine_dialog_sheet', matches);
|
|
55
|
+
this.on.dispatchEvent(new MediaQueryListEvent(kind, {
|
|
56
|
+
matches,
|
|
57
|
+
media,
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftwc/ui",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
4
|
-
"description": "Elegant SwiftUI-inspired web components for
|
|
3
|
+
"version": "0.0.0-dev.41",
|
|
4
|
+
"description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"generated",
|
|
23
|
-
"scss"
|
|
23
|
+
"scss",
|
|
24
|
+
"web-components.html-data"
|
|
24
25
|
],
|
|
25
26
|
"sass": "scss/index.scss",
|
|
26
27
|
"keywords": [
|
|
@@ -42,23 +43,46 @@
|
|
|
42
43
|
"types": "./generated/client/index.d.ts",
|
|
43
44
|
"default": "./generated/client/index.js"
|
|
44
45
|
},
|
|
45
|
-
"./
|
|
46
|
+
"./events": {
|
|
47
|
+
"types": "./generated/events/index.d.ts",
|
|
48
|
+
"default": "./generated/events/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./css": "./generated/css/index.css",
|
|
46
51
|
"./scss": "./scss/index.scss",
|
|
47
|
-
"./scss/*": "./scss/*.scss"
|
|
52
|
+
"./scss/*": "./scss/*.scss",
|
|
53
|
+
"./customElements/en": "./custom-elements/en.json"
|
|
48
54
|
},
|
|
49
55
|
"bin": {
|
|
50
56
|
"swiftwc": "./generated/index.js"
|
|
51
57
|
},
|
|
52
58
|
"scripts": {
|
|
53
59
|
"prebuild": "rm -rf generated",
|
|
54
|
-
"build": "npm run build:ts && npm run build:scss",
|
|
60
|
+
"build": "npm run build:ts && npm run build:scss && npm run build:manifest && npm run build:barrels",
|
|
61
|
+
"postbuild": "npm run format:write",
|
|
55
62
|
"build:ts:watch": "npm run prebuild && tsc --watch",
|
|
56
|
-
"build:ts": "
|
|
57
|
-
"build:scss": "
|
|
63
|
+
"build:ts": "tsc",
|
|
64
|
+
"build:scss": "sass --style=expanded --no-source-map scss/index.scss generated/css/index.css",
|
|
65
|
+
"build:manifest": "tsx scripts/make-manifest.ts",
|
|
66
|
+
"build:barrels": "npm run build:barrels:components && npm run build:barrels:events && npm run build:barrels:buses && npm run build:barrels:i18n",
|
|
67
|
+
"build:barrels:components": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/components --exclude \".\\.test\\.ts\"",
|
|
68
|
+
"build:barrels:events": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/events --exclude \".\\.test\\.ts\"",
|
|
69
|
+
"build:barrels:buses": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/buses",
|
|
70
|
+
"build:barrels:i18n": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --fullPathname --directory ./js/i18n/locales",
|
|
71
|
+
"build:barrels:decorators": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/decorators",
|
|
58
72
|
"format:check": "prettier . --check",
|
|
59
|
-
"format:write": "prettier . --write"
|
|
73
|
+
"format:write": "prettier . --write",
|
|
74
|
+
"test": "vitest --dom",
|
|
75
|
+
"prepackage": "rm -rf generated",
|
|
76
|
+
"package": "npm run build:ts && npm run build:scss",
|
|
77
|
+
"version:pkg": "npm version $npm_config_bump --no-git-tag-version --preid=dev"
|
|
60
78
|
},
|
|
61
79
|
"devDependencies": {
|
|
62
|
-
"
|
|
63
|
-
|
|
80
|
+
"doctrine": "^3.0.0",
|
|
81
|
+
"happy-dom": "^20.7.0",
|
|
82
|
+
"sass": "^1.98.0",
|
|
83
|
+
"ts-morph": "^28.0.0",
|
|
84
|
+
"tsx": "^4.21.0",
|
|
85
|
+
"vitest": "^4.0.18"
|
|
86
|
+
},
|
|
87
|
+
"customElements": "custom-elements/en.json"
|
|
64
88
|
}
|
package/scss/_components.scss
CHANGED
|
@@ -4,36 +4,81 @@
|
|
|
4
4
|
|
|
5
5
|
@forward 'components/disclosure-group';
|
|
6
6
|
|
|
7
|
-
@forward 'components/
|
|
7
|
+
@forward 'components/h-divider';
|
|
8
|
+
@forward 'components/v-divider';
|
|
8
9
|
|
|
9
|
-
@forward 'components/
|
|
10
|
+
@forward 'components/full-screen';
|
|
10
11
|
|
|
11
|
-
@forward 'components/
|
|
12
|
+
@forward 'components/detail-placeholder';
|
|
13
|
+
@forward 'components/progress-view';
|
|
12
14
|
|
|
13
|
-
@forward 'components/
|
|
15
|
+
@forward 'components/fine-tooltip';
|
|
14
16
|
|
|
15
|
-
@forward 'components/
|
|
16
|
-
|
|
17
|
-
@forward 'components/full-screen';
|
|
17
|
+
@forward 'components/sticky-container';
|
|
18
18
|
|
|
19
19
|
@forward 'components/sheet-view';
|
|
20
20
|
|
|
21
|
-
@forward 'components/
|
|
22
|
-
|
|
23
|
-
@forward 'components/navigation-split-view';
|
|
24
|
-
|
|
25
|
-
@forward 'components/toolbars';
|
|
21
|
+
@forward 'components/content-unavailable-view';
|
|
26
22
|
|
|
27
|
-
@forward 'components/
|
|
23
|
+
@forward 'components/confirmation-dialog';
|
|
24
|
+
@forward 'components/alert-dialog';
|
|
28
25
|
|
|
29
26
|
@forward 'components/scroll-view';
|
|
27
|
+
@forward 'components/scroll-view-proxy';
|
|
30
28
|
|
|
29
|
+
@forward 'components/h-stack';
|
|
31
30
|
@forward 'components/v-stack';
|
|
31
|
+
@forward 'components/h-flex-stack';
|
|
32
|
+
@forward 'components/v-flex-stack';
|
|
32
33
|
|
|
33
|
-
@forward 'components/
|
|
34
|
+
@forward 'components/scroll-view-toolbars';
|
|
34
35
|
|
|
35
36
|
@forward 'components/tool-bar-item';
|
|
36
37
|
|
|
37
38
|
@forward 'components/tool-bar-item-group';
|
|
38
39
|
|
|
40
|
+
@forward 'components/plain-button';
|
|
39
41
|
@forward 'components/borderless-button';
|
|
42
|
+
@forward 'components/bordered-button';
|
|
43
|
+
@forward 'components/bordered-prominent-button';
|
|
44
|
+
@forward 'components/glass-button';
|
|
45
|
+
@forward 'components/glass-prominent-button';
|
|
46
|
+
|
|
47
|
+
@forward 'components/search-view';
|
|
48
|
+
|
|
49
|
+
@forward 'components/tool-bar';
|
|
50
|
+
|
|
51
|
+
@forward 'components/label-view';
|
|
52
|
+
|
|
53
|
+
@forward 'components/labeled-content';
|
|
54
|
+
|
|
55
|
+
// @forward 'components/button-view';
|
|
56
|
+
|
|
57
|
+
@forward 'components/body-view';
|
|
58
|
+
|
|
59
|
+
@forward 'components/navigation-large-title';
|
|
60
|
+
@forward 'components/navigation-title';
|
|
61
|
+
|
|
62
|
+
@forward 'components/sidebar-toggle';
|
|
63
|
+
|
|
64
|
+
@forward 'components/menu-view';
|
|
65
|
+
|
|
66
|
+
@forward 'components/sidebar-view';
|
|
67
|
+
|
|
68
|
+
@forward 'components/list-view';
|
|
69
|
+
@forward 'components/form-view';
|
|
70
|
+
@forward 'components/section-view';
|
|
71
|
+
@forward 'components/table-view';
|
|
72
|
+
@forward 'components/table-row';
|
|
73
|
+
@forward 'components/table-column';
|
|
74
|
+
|
|
75
|
+
@forward 'components/text-field';
|
|
76
|
+
@forward 'components/date-picker';
|
|
77
|
+
@forward 'components/picker-view';
|
|
78
|
+
|
|
79
|
+
@forward 'components/navigation-stack';
|
|
80
|
+
@forward 'components/navigation-split-view';
|
|
81
|
+
|
|
82
|
+
@forward 'components/tab-view';
|
|
83
|
+
@forward 'components/tab-bar';
|
|
84
|
+
@forward 'components/tab-item';
|
package/scss/_final.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'final/touch-glass';
|
package/scss/_functions.scss
CHANGED
|
@@ -19,3 +19,13 @@
|
|
|
19
19
|
}
|
|
20
20
|
@return string.slice($parts, 2);
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
@function str-replace($string, $search, $replace: '') {
|
|
24
|
+
$index: string.index($string, $search);
|
|
25
|
+
|
|
26
|
+
@if $index {
|
|
27
|
+
@return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + string.length($search)), $search, $replace);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@return $string;
|
|
31
|
+
}
|