@swiftwc/ui 0.0.0-dev.99 → 1.0.0-canary.1
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/generated/client/index.js +8 -9
- package/generated/components/alert-dialog.js +9 -17
- package/generated/components/bordered-button.js +4 -7
- package/generated/components/bordered-prominent-button.js +4 -7
- package/generated/components/borderless-button.js +4 -7
- package/generated/components/color-scheme.js +4 -7
- package/generated/components/confirmation-dialog.js +9 -17
- package/generated/components/content-unavailable.d.ts +1 -1
- package/generated/components/content-unavailable.js +5 -8
- package/generated/components/{body-view.d.ts → content-view.d.ts} +2 -2
- package/generated/components/content-view.js +15 -0
- package/generated/components/date-picker.js +13 -25
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- package/generated/components/disclosure-group.js +5 -9
- package/generated/components/fine-tooltip.js +4 -7
- package/generated/components/form-view.js +3 -5
- package/generated/components/glass-button.js +4 -7
- package/generated/components/glass-prominent-button.js +4 -7
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-flex-stack.d.ts +16 -0
- package/generated/components/h-flex-stack.js +18 -0
- package/generated/components/h-stack.js +3 -5
- package/generated/components/image-view.js +4 -7
- package/generated/components/index.d.ts +7 -1
- package/generated/components/index.js +7 -1
- package/generated/components/label-view.d.ts +2 -2
- package/generated/components/label-view.js +6 -9
- package/generated/components/labeled-content.d.ts +7 -1
- package/generated/components/labeled-content.js +32 -32
- package/generated/components/list-view.d.ts +5 -1
- package/generated/components/list-view.js +8 -6
- package/generated/components/menu-view.d.ts +1 -1
- package/generated/components/menu-view.js +11 -20
- package/generated/components/navigation-large-title.d.ts +0 -1
- package/generated/components/navigation-large-title.js +5 -10
- package/generated/components/navigation-split-view.js +4 -7
- package/generated/components/navigation-stack.js +4 -7
- package/generated/components/navigation-title.js +4 -7
- package/generated/components/picker-view.d.ts +4 -21
- package/generated/components/picker-view.js +374 -326
- package/generated/components/plain-button.js +3 -5
- package/generated/components/progress-view.d.ts +1 -1
- package/generated/components/progress-view.js +7 -12
- package/generated/components/screen-view.js +2 -3
- package/generated/components/scroll-view-proxy.js +3 -5
- package/generated/components/scroll-view.d.ts +1 -1
- package/generated/components/scroll-view.js +10 -17
- package/generated/components/search-view.js +4 -7
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +5 -8
- package/generated/components/sheet-view.js +6 -11
- package/generated/components/sidebar-toggle.js +5 -9
- package/generated/components/sidebar-view.js +2 -3
- package/generated/components/sticky-container.js +3 -5
- package/generated/components/tab-bar.js +4 -7
- package/generated/components/tab-item.js +8 -15
- package/generated/components/tab-view.js +19 -23
- package/generated/components/table-view.d.ts +1 -1
- package/generated/components/table-view.js +7 -12
- package/generated/components/text-field.js +10 -19
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +2 -0
- package/generated/components/toggle-view.js +33 -37
- package/generated/components/tool-bar-item-group.js +3 -5
- package/generated/components/tool-bar-item.js +4 -7
- package/generated/components/tool-bar.js +4 -7
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-flex-stack.d.ts +16 -0
- package/generated/components/v-flex-stack.js +18 -0
- package/generated/components/v-keyboard.js +8 -12
- package/generated/components/v-stack.js +3 -5
- package/generated/css/index.css +762 -418
- package/generated/internal/class/css-style-observer.js +2 -3
- package/generated/internal/class/form-associated-base.js +6 -8
- package/generated/internal/class/navigation-path.js +2 -2
- package/generated/internal/class/navigation-view.js +3 -5
- package/generated/internal/decorators/adaptive-slot.js +4 -7
- package/generated/internal/decorators/microtask-on-connected.d.ts +2 -2
- package/generated/internal/decorators/microtask-on-connected.js +2 -2
- package/generated/internal/dev-flags.d.ts +4 -0
- package/generated/internal/dev-flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +2 -2
- package/generated/internal/privateNamespace.js +15 -24
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/index.d.ts +36 -2
- package/generated/internal/utils/index.js +36 -5
- package/generated/internal/utils/is-inside.js +1 -1
- package/generated/snapshot/index.js +3 -5
- package/{web-components.html-data → html-data}/en.json +155 -54
- package/package.json +24 -20
- 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 +34 -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 +41 -21
- 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 +2 -2
- 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/components/body-view.js +0 -17
- package/generated/internal/utils/cash/index.d.ts +0 -24
- package/generated/internal/utils/cash/index.js +0 -27
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
- /package/{web-components.css-data → css-data}/en.json +0 -0
- /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
- /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
- /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
- /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
- /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
- /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
- /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
- /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
- /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
- /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import { $,
|
|
3
|
+
import { $, debug, onoff } from '../internal/utils';
|
|
4
4
|
import { html } from '../tpl';
|
|
5
5
|
/**
|
|
6
6
|
* @summary A tooltip that shows an unobtrusive helpful message on pointer:fine screens. Use it by adding a `help` attribute to any element.
|
|
@@ -20,8 +20,7 @@ export class FineTooltip extends HTMLElement {
|
|
|
20
20
|
this.#render(target.getAttribute(attributeName));
|
|
21
21
|
};
|
|
22
22
|
#handleMeasure = ([{ target, borderBoxSize }]) => {
|
|
23
|
-
|
|
24
|
-
console.debug(`${_a.name} ⚡️ measure`);
|
|
23
|
+
debug(`${_a.name} ⚡️ measure`);
|
|
25
24
|
if (target.hasAttribute('closing'))
|
|
26
25
|
return;
|
|
27
26
|
if (!(target instanceof HTMLElement))
|
|
@@ -51,8 +50,7 @@ export class FineTooltip extends HTMLElement {
|
|
|
51
50
|
label.removeAttribute('title');
|
|
52
51
|
};
|
|
53
52
|
connectedCallback() {
|
|
54
|
-
|
|
55
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
53
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
56
54
|
this.removeAttribute('closing');
|
|
57
55
|
this.popover = 'manual';
|
|
58
56
|
this.inert = true;
|
|
@@ -61,8 +59,7 @@ export class FineTooltip extends HTMLElement {
|
|
|
61
59
|
this.showPopover();
|
|
62
60
|
}
|
|
63
61
|
disconnectedCallback() {
|
|
64
|
-
|
|
65
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
62
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
66
63
|
this.#resizeObserver.unobserve(this);
|
|
67
64
|
this.#mutationObserver?.disconnect();
|
|
68
65
|
this.#mutationObserver2?.disconnect();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { debug, listActive, onoff } from '../internal/utils';
|
|
3
3
|
import { FormBase } from '../namespace-browser/base';
|
|
4
4
|
/**
|
|
5
5
|
* @summary A container view that groups controls together for entering data, like a settings screen.
|
|
@@ -11,14 +11,12 @@ export class FormView extends FormBase {
|
|
|
11
11
|
super();
|
|
12
12
|
}
|
|
13
13
|
static polyfillDisconnectedCallback(el) {
|
|
14
|
-
|
|
15
|
-
console.debug(`${FormView.name} ⚡️ disconnect`);
|
|
14
|
+
debug(`${FormView.name} ⚡️ disconnect`);
|
|
16
15
|
// finally
|
|
17
16
|
CleanupRegistry.unregister(el);
|
|
18
17
|
}
|
|
19
18
|
static polyfillConnectedCallback(el) {
|
|
20
|
-
|
|
21
|
-
console.debug(`${FormView.name} ⚡️ connect`);
|
|
19
|
+
debug(`${FormView.name} ⚡️ connect`);
|
|
22
20
|
if (el.closest('[is=sidebar-view],[is=tab-bar]')) {
|
|
23
21
|
el.method = 'dialog';
|
|
24
22
|
el.noValidate = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
@@ -25,19 +25,16 @@ export class GlassButton extends ButtonBase {
|
|
|
25
25
|
super();
|
|
26
26
|
}
|
|
27
27
|
static polyfillDisconnectedCallback(el) {
|
|
28
|
-
|
|
29
|
-
console.debug(`${GlassButton.name} ⚡️ disconnect`);
|
|
28
|
+
debug(`${GlassButton.name} ⚡️ disconnect`);
|
|
30
29
|
CleanupRegistry.unregister(el);
|
|
31
30
|
}
|
|
32
31
|
static polyfillConnectedCallback(el) {
|
|
33
|
-
|
|
34
|
-
console.debug(`${GlassButton.name} ⚡️ connect`);
|
|
32
|
+
debug(`${GlassButton.name} ⚡️ connect`);
|
|
35
33
|
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
36
34
|
el.tabIndex = 0;
|
|
37
35
|
}
|
|
38
36
|
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
39
|
-
|
|
40
|
-
console.debug(`${GlassButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
37
|
+
debug(`${GlassButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
41
38
|
const node = target instanceof HTMLButtonElement;
|
|
42
39
|
if (!node)
|
|
43
40
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
@@ -25,19 +25,16 @@ export class GlassProminentButton extends ButtonBase {
|
|
|
25
25
|
super();
|
|
26
26
|
}
|
|
27
27
|
static polyfillDisconnectedCallback(el) {
|
|
28
|
-
|
|
29
|
-
console.debug(`${GlassProminentButton.name} ⚡️ disconnect`);
|
|
28
|
+
debug(`${GlassProminentButton.name} ⚡️ disconnect`);
|
|
30
29
|
CleanupRegistry.unregister(el);
|
|
31
30
|
}
|
|
32
31
|
static polyfillConnectedCallback(el) {
|
|
33
|
-
|
|
34
|
-
console.debug(`${GlassProminentButton.name} ⚡️ connect`);
|
|
32
|
+
debug(`${GlassProminentButton.name} ⚡️ connect`);
|
|
35
33
|
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
36
34
|
el.tabIndex = 0;
|
|
37
35
|
}
|
|
38
36
|
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
39
|
-
|
|
40
|
-
console.debug(`${GlassProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
37
|
+
debug(`${GlassProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
41
38
|
const node = target instanceof HTMLButtonElement;
|
|
42
39
|
if (!node)
|
|
43
40
|
return;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class HDivider extends HTMLElement {
|
|
2
|
+
constructor();
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
disconnectedCallback(): void;
|
|
5
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'h-divider': HDivider;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
|
+
export class HDivider extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
}
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
debug(`${HDivider.name} ⚡️ connect`);
|
|
8
|
+
}
|
|
9
|
+
disconnectedCallback() {
|
|
10
|
+
debug(`${HDivider.name} ⚡️ disconnect`);
|
|
11
|
+
}
|
|
12
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
13
|
+
debug(`${HDivider.name} ⚡️ attr-change [${name}]`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A view that arranges its children side by side.
|
|
3
|
+
*
|
|
4
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare class HFlexStack extends HTMLElement {
|
|
8
|
+
constructor();
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'h-flex-stack': HFlexStack;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A view that arranges its children side by side.
|
|
4
|
+
*
|
|
5
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export class HFlexStack extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
debug(`${HFlexStack.name} ⚡️ connect`);
|
|
14
|
+
}
|
|
15
|
+
disconnectedCallback() {
|
|
16
|
+
debug(`${HFlexStack.name} ⚡️ disconnect`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @summary A view that arranges its children side by side.
|
|
4
4
|
*
|
|
@@ -16,11 +16,9 @@ export class HStack extends HTMLElement {
|
|
|
16
16
|
super();
|
|
17
17
|
}
|
|
18
18
|
connectedCallback() {
|
|
19
|
-
|
|
20
|
-
console.debug(`${HStack.name} ⚡️ connect`);
|
|
19
|
+
debug(`${HStack.name} ⚡️ connect`);
|
|
21
20
|
}
|
|
22
21
|
disconnectedCallback() {
|
|
23
|
-
|
|
24
|
-
console.debug(`${HStack.name} ⚡️ disconnect`);
|
|
22
|
+
debug(`${HStack.name} ⚡️ disconnect`);
|
|
25
23
|
}
|
|
26
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $,
|
|
1
|
+
import { $, debug } from '../internal/utils';
|
|
2
2
|
import { queryMorph } from '../morphdom';
|
|
3
3
|
import { html } from '../tpl';
|
|
4
4
|
/**
|
|
@@ -20,8 +20,7 @@ export class ImageView extends HTMLElement {
|
|
|
20
20
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
21
21
|
}
|
|
22
22
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
23
|
-
|
|
24
|
-
console.debug(`${ImageView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
23
|
+
debug(`${ImageView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
25
24
|
if (oldValue === newValue)
|
|
26
25
|
return;
|
|
27
26
|
switch (name) {
|
|
@@ -58,11 +57,9 @@ export class ImageView extends HTMLElement {
|
|
|
58
57
|
// container.classList.add(...tokens)
|
|
59
58
|
}
|
|
60
59
|
disconnectedCallback() {
|
|
61
|
-
|
|
62
|
-
console.debug(`${ImageView.name} ⚡️ disconnect`);
|
|
60
|
+
debug(`${ImageView.name} ⚡️ disconnect`);
|
|
63
61
|
}
|
|
64
62
|
connectedCallback() {
|
|
65
|
-
|
|
66
|
-
console.debug(`${ImageView.name} ⚡️ connect`);
|
|
63
|
+
debug(`${ImageView.name} ⚡️ connect`);
|
|
67
64
|
}
|
|
68
65
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
export * from './alert-dialog';
|
|
2
|
-
export * from './body-view';
|
|
3
2
|
export * from './bordered-button';
|
|
4
3
|
export * from './bordered-prominent-button';
|
|
5
4
|
export * from './borderless-button';
|
|
6
5
|
export * from './color-scheme';
|
|
7
6
|
export * from './confirmation-dialog';
|
|
8
7
|
export * from './content-unavailable';
|
|
8
|
+
export * from './content-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
|
+
export * from './detail-placeholder';
|
|
10
11
|
export * from './disclosure-group';
|
|
11
12
|
export * from './fine-tooltip';
|
|
12
13
|
export * from './form-view';
|
|
13
14
|
export * from './glass-button';
|
|
14
15
|
export * from './glass-prominent-button';
|
|
16
|
+
export * from './h-divider';
|
|
17
|
+
export * from './h-flex-stack';
|
|
15
18
|
export * from './h-stack';
|
|
16
19
|
export * from './image-view';
|
|
17
20
|
export * from './label-view';
|
|
@@ -39,9 +42,12 @@ export * from './tab-item';
|
|
|
39
42
|
export * from './tab-view';
|
|
40
43
|
export * from './table-view';
|
|
41
44
|
export * from './text-field';
|
|
45
|
+
export * from './text-view';
|
|
42
46
|
export * from './toggle-view';
|
|
43
47
|
export * from './tool-bar-item-group';
|
|
44
48
|
export * from './tool-bar-item';
|
|
45
49
|
export * from './tool-bar';
|
|
50
|
+
export * from './v-divider';
|
|
51
|
+
export * from './v-flex-stack';
|
|
46
52
|
export * from './v-keyboard';
|
|
47
53
|
export * from './v-stack';
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
export * from './alert-dialog';
|
|
2
|
-
export * from './body-view';
|
|
3
2
|
export * from './bordered-button';
|
|
4
3
|
export * from './bordered-prominent-button';
|
|
5
4
|
export * from './borderless-button';
|
|
6
5
|
export * from './color-scheme';
|
|
7
6
|
export * from './confirmation-dialog';
|
|
8
7
|
export * from './content-unavailable';
|
|
8
|
+
export * from './content-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
|
+
export * from './detail-placeholder';
|
|
10
11
|
export * from './disclosure-group';
|
|
11
12
|
export * from './fine-tooltip';
|
|
12
13
|
export * from './form-view';
|
|
13
14
|
export * from './glass-button';
|
|
14
15
|
export * from './glass-prominent-button';
|
|
16
|
+
export * from './h-divider';
|
|
17
|
+
export * from './h-flex-stack';
|
|
15
18
|
export * from './h-stack';
|
|
16
19
|
export * from './image-view';
|
|
17
20
|
export * from './label-view';
|
|
@@ -39,9 +42,12 @@ export * from './tab-item';
|
|
|
39
42
|
export * from './tab-view';
|
|
40
43
|
export * from './table-view';
|
|
41
44
|
export * from './text-field';
|
|
45
|
+
export * from './text-view';
|
|
42
46
|
export * from './toggle-view';
|
|
43
47
|
export * from './tool-bar-item-group';
|
|
44
48
|
export * from './tool-bar-item';
|
|
45
49
|
export * from './tool-bar';
|
|
50
|
+
export * from './v-divider';
|
|
51
|
+
export * from './v-flex-stack';
|
|
46
52
|
export * from './v-keyboard';
|
|
47
53
|
export * from './v-stack';
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* @slot — Any children without a `slot` attribute are placed in the title block.
|
|
12
12
|
* @slot icon — Use the `slot="icon"` attribute to place childen in the icon block.
|
|
13
13
|
*
|
|
14
|
-
* @cssprop --label-gap — The gap between the icon and the title.
|
|
14
|
+
* @cssprop {length} --label-gap — The gap between the icon and the title.
|
|
15
15
|
* @cssprop {number} --label-image-size — The size of the icon.
|
|
16
|
-
* @cssprop --label-padding-inline — The padding inline of the label.
|
|
16
|
+
* @cssprop {length}--label-padding-inline — The padding inline of the label.
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
export declare class LabelView extends HTMLElement {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $,
|
|
1
|
+
import { $, debug } from '../internal/utils';
|
|
2
2
|
import { queryMorph } from '../morphdom';
|
|
3
3
|
import { html } from '../tpl';
|
|
4
4
|
/**
|
|
@@ -14,9 +14,9 @@ import { html } from '../tpl';
|
|
|
14
14
|
* @slot — Any children without a `slot` attribute are placed in the title block.
|
|
15
15
|
* @slot icon — Use the `slot="icon"` attribute to place childen in the icon block.
|
|
16
16
|
*
|
|
17
|
-
* @cssprop --label-gap — The gap between the icon and the title.
|
|
17
|
+
* @cssprop {length} --label-gap — The gap between the icon and the title.
|
|
18
18
|
* @cssprop {number} --label-image-size — The size of the icon.
|
|
19
|
-
* @cssprop --label-padding-inline — The padding inline of the label.
|
|
19
|
+
* @cssprop {length}--label-padding-inline — The padding inline of the label.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
22
|
export class LabelView extends HTMLElement {
|
|
@@ -53,8 +53,7 @@ export class LabelView extends HTMLElement {
|
|
|
53
53
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
54
54
|
}
|
|
55
55
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
56
|
-
|
|
57
|
-
console.debug(`${LabelView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
56
|
+
debug(`${LabelView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
58
57
|
if (oldValue === newValue)
|
|
59
58
|
return;
|
|
60
59
|
// this.#scheduleReflect()
|
|
@@ -77,11 +76,9 @@ export class LabelView extends HTMLElement {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
disconnectedCallback() {
|
|
80
|
-
|
|
81
|
-
console.debug(`${LabelView.name} ⚡️ disconnect`);
|
|
79
|
+
debug(`${LabelView.name} ⚡️ disconnect`);
|
|
82
80
|
}
|
|
83
81
|
connectedCallback() {
|
|
84
|
-
|
|
85
|
-
console.debug(`${LabelView.name} ⚡️ connect`);
|
|
82
|
+
debug(`${LabelView.name} ⚡️ connect`);
|
|
86
83
|
}
|
|
87
84
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @summary A container view that pairs a label with a value.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
4
|
+
* @example <labeled-content label="Label" value="Content"></labeled-content> — Creates a standard labeled element, with a view that conveys the value of the element and a label
|
|
5
|
+
*
|
|
6
|
+
* @example <labeled-content label="Height" value="6" format="unit::unit=foot"></labeled-content> — Creates a labeled element from a formatted value
|
|
7
|
+
*
|
|
8
|
+
* @example <labeled-content value="Content"><label-view slot="label" title="Custom Value"></label-view><label-view slot="label" title="Custom Subtitle Value"></label-view></labeled-content> — Creates a labeled element that displays a custom label and a custom subtitle to the label
|
|
9
|
+
*
|
|
10
|
+
* @slot — The default slot
|
|
5
11
|
* @slot label — Use the `slot="label"` attribute to place childen in the label block.
|
|
6
12
|
* @slot header
|
|
7
13
|
* @slot footer
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { $,
|
|
1
|
+
import { $, debug } from '../internal/utils';
|
|
2
2
|
import { queryMorph } from '../morphdom';
|
|
3
3
|
import { html } from '../tpl';
|
|
4
4
|
/**
|
|
5
5
|
* @summary A container view that pairs a label with a value.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @example <labeled-content label="Label" value="Content"></labeled-content> — Creates a standard labeled element, with a view that conveys the value of the element and a label
|
|
8
|
+
*
|
|
9
|
+
* @example <labeled-content label="Height" value="6" format="unit::unit=foot"></labeled-content> — Creates a labeled element from a formatted value
|
|
10
|
+
*
|
|
11
|
+
* @example <labeled-content value="Content"><label-view slot="label" title="Custom Value"></label-view><label-view slot="label" title="Custom Subtitle Value"></label-view></labeled-content> — Creates a labeled element that displays a custom label and a custom subtitle to the label
|
|
12
|
+
*
|
|
13
|
+
* @slot — The default slot
|
|
8
14
|
* @slot label — Use the `slot="label"` attribute to place childen in the label block.
|
|
9
15
|
* @slot header
|
|
10
16
|
* @slot footer
|
|
@@ -22,9 +28,16 @@ export class LabeledContent extends HTMLElement {
|
|
|
22
28
|
'header',
|
|
23
29
|
'footer',
|
|
24
30
|
/**
|
|
31
|
+
* Use this to force a specific style.
|
|
32
|
+
*
|
|
25
33
|
* @type {vertical|horizontal}
|
|
26
34
|
*/
|
|
27
35
|
'labeled-content-style',
|
|
36
|
+
/**
|
|
37
|
+
* Use this to format the text inside the value attribute. For example `format="currency::currency=USD" value="1234.5"` produces a value of `$1,234.50`.
|
|
38
|
+
*
|
|
39
|
+
* @type {"<format-type>:<locale?>:<format-options?>"}
|
|
40
|
+
*/
|
|
28
41
|
'format',
|
|
29
42
|
];
|
|
30
43
|
}
|
|
@@ -52,46 +65,23 @@ export class LabeledContent extends HTMLElement {
|
|
|
52
65
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
53
66
|
}
|
|
54
67
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
55
|
-
|
|
56
|
-
console.debug(`${LabeledContent.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
68
|
+
debug(`${LabeledContent.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
57
69
|
if (oldValue === newValue)
|
|
58
70
|
return;
|
|
59
71
|
switch (name) {
|
|
60
72
|
case 'header':
|
|
61
|
-
// if (!newValue) {
|
|
62
|
-
// this.querySelector(':scope>[slot=header]')?.remove()
|
|
63
|
-
// break
|
|
64
|
-
// }
|
|
65
|
-
// const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }))
|
|
66
73
|
queryMorph('[slot=header]', html `<header slot="header">
|
|
67
74
|
<label-view font="callout">
|
|
68
75
|
<span>${newValue}</span>
|
|
69
76
|
</label-view>
|
|
70
77
|
</header>`, this, { removeIf: !newValue });
|
|
71
|
-
// render(
|
|
72
|
-
// html`<label-view font="callout">
|
|
73
|
-
// <span>${newValue}</span>
|
|
74
|
-
// </label-view>`,
|
|
75
|
-
// header
|
|
76
|
-
// )
|
|
77
78
|
break;
|
|
78
79
|
case 'footer':
|
|
79
|
-
// if (!newValue) {
|
|
80
|
-
// this.querySelector(':scope>[slot=footer]')?.remove()
|
|
81
|
-
// break
|
|
82
|
-
// }
|
|
83
|
-
// const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }))
|
|
84
80
|
queryMorph('[slot=footer]', html `<footer slot="footer">
|
|
85
81
|
<label-view font="callout">
|
|
86
82
|
<span>${newValue}</span>
|
|
87
83
|
</label-view>
|
|
88
84
|
</footer>`, this, { removeIf: !newValue });
|
|
89
|
-
// render(
|
|
90
|
-
// html`<label-view font="callout">
|
|
91
|
-
// <span>${newValue}</span>
|
|
92
|
-
// </label-view>`,
|
|
93
|
-
// footer
|
|
94
|
-
// )
|
|
95
85
|
break;
|
|
96
86
|
case 'value': {
|
|
97
87
|
const val = this.#fmt(newValue, this.getAttribute('format'));
|
|
@@ -109,12 +99,10 @@ export class LabeledContent extends HTMLElement {
|
|
|
109
99
|
}
|
|
110
100
|
}
|
|
111
101
|
disconnectedCallback() {
|
|
112
|
-
|
|
113
|
-
console.debug(`${LabeledContent.name} ⚡️ disconnect`);
|
|
102
|
+
debug(`${LabeledContent.name} ⚡️ disconnect`);
|
|
114
103
|
}
|
|
115
104
|
connectedCallback() {
|
|
116
|
-
|
|
117
|
-
console.debug(`${LabeledContent.name} ⚡️ connect`);
|
|
105
|
+
debug(`${LabeledContent.name} ⚡️ connect`);
|
|
118
106
|
}
|
|
119
107
|
// <type>:<locale>;<option>=<value>;<option>=<value>
|
|
120
108
|
#fmt = (value, format) => {
|
|
@@ -125,7 +113,7 @@ export class LabeledContent extends HTMLElement {
|
|
|
125
113
|
locale: navigator.language,
|
|
126
114
|
options: {},
|
|
127
115
|
};
|
|
128
|
-
const [type, locale
|
|
116
|
+
const [type, locale, opts = {}] = format.split(':', 3), loc = new Intl.Locale(locale || navigator.language), options = Object.fromEntries(new URLSearchParams(opts));
|
|
129
117
|
return {
|
|
130
118
|
type,
|
|
131
119
|
locale: loc.toString(),
|
|
@@ -152,7 +140,19 @@ export class LabeledContent extends HTMLElement {
|
|
|
152
140
|
return new Intl.ListFormat(locale, options).format(value?.split('~') ?? []); // '' { style: 'long', type: 'conjunction' } "Foo, Bar, and Baz"
|
|
153
141
|
case 'region':
|
|
154
142
|
return value ? new Intl.DisplayNames(locale, { type: 'region' }).of(value) : ''; // "Greece"
|
|
155
|
-
|
|
143
|
+
case 'byte-count': {
|
|
144
|
+
const bytes = Number(value);
|
|
145
|
+
if (!Number.isFinite(bytes))
|
|
146
|
+
return value;
|
|
147
|
+
const units = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte'];
|
|
148
|
+
const index = Math.min(Math.floor(Math.log(Math.abs(bytes)) / Math.log(1024)), units.length - 1);
|
|
149
|
+
return new Intl.NumberFormat(locale, {
|
|
150
|
+
style: 'unit',
|
|
151
|
+
unit: units[Math.max(0, index)],
|
|
152
|
+
unitDisplay: 'short',
|
|
153
|
+
...options,
|
|
154
|
+
}).format(bytes / 1024 ** Math.max(0, index));
|
|
155
|
+
}
|
|
156
156
|
default:
|
|
157
157
|
return value;
|
|
158
158
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @summary A container view that arranges rows of data in a single column, optionally letting the user select one or more of them.
|
|
3
3
|
*
|
|
4
|
-
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside
|
|
4
|
+
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside
|
|
5
|
+
* @attr {sidebar} preferred-root-disclosure-style
|
|
6
|
+
*
|
|
7
|
+
* @cssprop {length} --list-row-gap — The gap between rows
|
|
8
|
+
* @cssprop {length} --list--media-inner-padding-inline-start — The inline paddint start for each row
|
|
5
9
|
*/
|
|
6
10
|
export declare class ListView extends HTMLElement {
|
|
7
11
|
constructor();
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import {
|
|
2
|
+
import { debug, listActive, onoff } from '../internal/utils';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A container view that arranges rows of data in a single column, optionally letting the user select one or more of them.
|
|
5
5
|
*
|
|
6
|
-
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside
|
|
6
|
+
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside
|
|
7
|
+
* @attr {sidebar} preferred-root-disclosure-style
|
|
8
|
+
*
|
|
9
|
+
* @cssprop {length} --list-row-gap — The gap between rows
|
|
10
|
+
* @cssprop {length} --list--media-inner-padding-inline-start — The inline paddint start for each row
|
|
7
11
|
*/
|
|
8
12
|
export class ListView extends HTMLElement {
|
|
9
13
|
constructor() {
|
|
10
14
|
super();
|
|
11
15
|
}
|
|
12
16
|
disconnectedCallback() {
|
|
13
|
-
|
|
14
|
-
console.debug(`${ListView.name} ⚡️ disconnect`);
|
|
17
|
+
debug(`${ListView.name} ⚡️ disconnect`);
|
|
15
18
|
CleanupRegistry.unregister(this);
|
|
16
19
|
}
|
|
17
20
|
connectedCallback() {
|
|
18
|
-
|
|
19
|
-
console.debug(`${ListView.name} ⚡️ connect`);
|
|
21
|
+
debug(`${ListView.name} ⚡️ connect`);
|
|
20
22
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
21
23
|
}
|
|
22
24
|
}
|