@swiftwc/ui 0.0.0-dev.11 → 0.0.0-dev.110
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/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 -10
- package/generated/client/index.js +179 -194
- package/generated/components/alert-dialog.d.ts +11 -0
- package/generated/components/alert-dialog.js +94 -0
- package/generated/components/body-view.d.ts +8 -0
- package/generated/components/body-view.js +6 -2
- package/generated/components/bordered-button.d.ts +10 -0
- package/generated/components/bordered-button.js +36 -3
- package/generated/components/bordered-prominent-button.d.ts +10 -0
- package/generated/components/bordered-prominent-button.js +36 -3
- package/generated/components/borderless-button.d.ts +9 -1
- package/generated/components/borderless-button.js +29 -11
- package/generated/components/color-scheme.d.ts +12 -0
- package/generated/components/color-scheme.js +51 -0
- package/generated/components/confirmation-dialog.d.ts +4 -1
- package/generated/components/confirmation-dialog.js +38 -32
- package/generated/components/content-unavailable.d.ts +30 -0
- package/generated/components/content-unavailable.js +79 -0
- package/generated/components/date-picker.d.ts +21 -15
- package/generated/components/date-picker.js +126 -88
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- package/generated/components/disclosure-group.d.ts +8 -0
- package/generated/components/disclosure-group.js +18 -7
- package/generated/components/fine-tooltip.d.ts +15 -0
- package/generated/components/fine-tooltip.js +108 -0
- package/generated/components/form-view.d.ts +10 -0
- package/generated/components/form-view.js +8 -3
- package/generated/components/glass-button.d.ts +10 -0
- package/generated/components/glass-button.js +36 -3
- package/generated/components/glass-prominent-button.d.ts +10 -0
- package/generated/components/glass-prominent-button.js +36 -3
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-stack.d.ts +22 -0
- package/generated/components/h-stack.js +24 -0
- package/generated/components/image-view.d.ts +18 -0
- package/generated/components/image-view.js +65 -0
- package/generated/components/index.d.ts +15 -3
- package/generated/components/index.js +15 -3
- package/generated/components/label-view.d.ts +19 -1
- package/generated/components/label-view.js +63 -62
- package/generated/components/labeled-content.d.ts +33 -0
- package/generated/components/labeled-content.js +160 -0
- package/generated/components/list-view.d.ts +14 -0
- package/generated/components/list-view.js +12 -17
- package/generated/components/menu-view.d.ts +12 -1
- package/generated/components/menu-view.js +63 -65
- package/generated/components/navigation-large-title.d.ts +11 -0
- package/generated/components/navigation-large-title.js +11 -5
- package/generated/components/navigation-split-view.d.ts +9 -1
- package/generated/components/navigation-split-view.js +10 -6
- package/generated/components/navigation-stack.d.ts +9 -1
- package/generated/components/navigation-stack.js +13 -11
- package/generated/components/navigation-title.d.ts +11 -1
- package/generated/components/navigation-title.js +58 -55
- package/generated/components/picker-view.d.ts +48 -7
- package/generated/components/picker-view.js +971 -261
- package/generated/components/plain-button.js +3 -3
- package/generated/components/progress-view.d.ts +20 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.js +2 -1
- package/generated/components/scroll-view-proxy.d.ts +13 -0
- package/generated/components/scroll-view-proxy.js +15 -0
- package/generated/components/scroll-view.d.ts +13 -1
- package/generated/components/scroll-view.js +140 -97
- package/generated/components/search-view.d.ts +12 -0
- package/generated/components/search-view.js +24 -0
- package/generated/components/section-view.d.ts +13 -1
- package/generated/components/section-view.js +38 -58
- package/generated/components/sheet-view.d.ts +4 -2
- package/generated/components/sheet-view.js +10 -39
- package/generated/components/sidebar-toggle.d.ts +9 -1
- package/generated/components/sidebar-toggle.js +46 -69
- package/generated/components/sidebar-view.d.ts +3 -0
- package/generated/components/sidebar-view.js +16 -9
- package/generated/components/sticky-container.d.ts +6 -1
- package/generated/components/sticky-container.js +9 -7
- package/generated/components/tab-bar.d.ts +3 -0
- package/generated/components/tab-bar.js +17 -13
- package/generated/components/tab-item.d.ts +3 -0
- package/generated/components/tab-item.js +20 -13
- package/generated/components/tab-view.d.ts +13 -4
- package/generated/components/tab-view.js +25 -89
- package/generated/components/table-view.d.ts +19 -0
- package/generated/components/table-view.js +88 -107
- package/generated/components/text-field.d.ts +19 -6
- package/generated/components/text-field.js +127 -99
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +43 -0
- package/generated/components/toggle-view.js +366 -0
- package/generated/components/tool-bar-item-group.d.ts +8 -0
- package/generated/components/tool-bar-item-group.js +22 -4
- package/generated/components/tool-bar-item.d.ts +12 -1
- package/generated/components/tool-bar-item.js +57 -10
- package/generated/components/tool-bar.d.ts +19 -0
- package/generated/components/tool-bar.js +48 -33
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-keyboard.d.ts +8 -1
- package/generated/components/v-keyboard.js +11 -9
- package/generated/components/v-stack.d.ts +20 -0
- package/generated/components/v-stack.js +18 -2
- package/generated/css/index.css +4617 -1266
- package/generated/events/alert-dialog.d.ts +13 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +7 -2
- package/generated/events/date-picker.d.ts +6 -1
- package/generated/events/index.d.ts +2 -0
- package/generated/events/index.js +2 -0
- package/generated/events/lifecycle-observer.d.ts +10 -2
- package/generated/events/picker-view.d.ts +22 -1
- package/generated/events/scroll-view.d.ts +10 -2
- package/generated/events/tab-view.d.ts +38 -8
- package/generated/events/text-field.d.ts +6 -1
- package/generated/events/toggle-view.d.ts +14 -0
- package/generated/events/toggle-view.js +1 -0
- package/generated/i18n/index.d.ts +19 -10
- package/generated/i18n/index.js +79 -54
- package/generated/i18n/locales/el.d.ts +16 -0
- package/generated/i18n/locales/el.js +16 -0
- package/generated/i18n/locales/en.d.ts +16 -0
- package/generated/i18n/locales/en.js +16 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/generated/internal/class/css-style-observer.js +2 -2
- package/generated/internal/class/form-associated-base.d.ts +0 -4
- package/generated/internal/class/form-associated-base.js +22 -39
- 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.js +18 -0
- package/generated/internal/class/navigation-view.d.ts +1 -1
- package/generated/internal/class/navigation-view.js +36 -43
- package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
- package/generated/internal/decorators/adaptive-slot.js +47 -0
- package/generated/internal/decorators/custom-element.d.ts +1 -1
- package/generated/internal/decorators/custom-element.js +2 -1
- package/generated/internal/decorators/index.d.ts +6 -0
- package/generated/internal/decorators/index.js +6 -0
- package/generated/internal/decorators/microtask-on-connected.d.ts +39 -0
- package/generated/internal/decorators/microtask-on-connected.js +67 -0
- package/generated/internal/flags.d.ts +4 -0
- package/generated/internal/flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +10 -0
- package/generated/internal/privateNamespace.js +159 -1
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/compare-big-decimals.js +7 -17
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/define-translations.d.ts +1 -0
- package/generated/internal/utils/define-translations.js +3 -0
- package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
- package/generated/internal/utils/ensure-placeholder.js +41 -0
- package/generated/internal/utils/index.d.ts +39 -2
- package/generated/internal/utils/index.js +39 -3
- 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.js +6 -9
- package/generated/internal/utils/list-active.js +67 -12
- package/generated/internal/utils/touch-glass.js +5 -5
- package/generated/internal/vendor/morphdom.d.ts +6 -0
- package/generated/internal/vendor/morphdom.js +720 -0
- package/generated/morphdom/index.d.ts +8 -0
- package/generated/morphdom/index.js +8 -0
- package/generated/morphdom/morph.d.ts +4 -0
- package/generated/morphdom/morph.js +10 -0
- package/generated/morphdom/query-morph.d.ts +5 -0
- package/generated/morphdom/query-morph.js +12 -0
- package/generated/morphdom/render-to-string.d.ts +12 -0
- package/generated/morphdom/render-to-string.js +48 -0
- package/generated/morphdom/unsafe-html.d.ts +2 -0
- package/generated/morphdom/unsafe-html.js +4 -0
- package/generated/namespace-browser/base.d.ts +12 -3
- package/generated/namespace-browser/base.js +41 -18
- package/generated/namespace-browser/event.d.ts +10 -0
- package/generated/namespace-browser/event.js +1 -0
- package/generated/snapshot/index.d.ts +3 -1
- package/generated/snapshot/index.js +23 -2
- package/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +7 -0
- package/generated/tpl/index.d.ts +6 -0
- package/generated/tpl/index.js +6 -0
- package/generated/tpl/is-template-result.d.ts +3 -0
- package/generated/tpl/is-template-result.js +1 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +132 -0
- package/package.json +32 -7
- package/scss/_components.scss +15 -0
- package/scss/_functions.scss +10 -0
- package/scss/_maps.scss +293 -0
- package/scss/_mixins.scss +4 -0
- package/scss/_transitions.scss +6 -1
- package/scss/_utils.scss +2 -0
- package/scss/_vars.scss +9 -115
- package/scss/base/_layout.scss +17 -7
- package/scss/base/_reboot.scss +34 -1
- package/scss/base/_root.scss +143 -124
- package/scss/colors/_index.scss +328 -88
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_bordered-button.scss +37 -0
- package/scss/components/_bordered-prominent-button.scss +46 -0
- package/scss/components/_borderless-button.scss +26 -0
- package/scss/components/_confirmation-dialog.scss +41 -49
- package/scss/components/_content-unavailable.scss +57 -0
- package/scss/components/_date-picker.scss +15 -15
- package/scss/components/_detail-placeholder.scss +1 -3
- package/scss/components/_disclosure-group.scss +85 -34
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +63 -24
- package/scss/components/_glass-button.scss +37 -0
- package/scss/components/_glass-prominent-button.scss +47 -0
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +6 -17
- package/scss/components/_image-view.scss +20 -0
- package/scss/components/_index.scss +69 -36
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +105 -120
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +67 -1
- package/scss/components/_list-view.scss +70 -29
- package/scss/components/_menu-view.scss +96 -61
- package/scss/components/_navigation-large-title.scss +23 -0
- package/scss/components/_navigation-split-view.scss +3 -3
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +270 -63
- package/scss/components/_plain-button.scss +8 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +24 -22
- package/scss/components/_scroll-view-toolbars.scss +8 -2
- package/scss/components/_scroll-view.scss +16 -0
- package/scss/components/_search-view.scss +23 -0
- package/scss/components/_section-view.scss +23 -22
- package/scss/components/_sheet-view.scss +16 -6
- package/scss/components/_sidebar-toggle.scss +1 -4
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +17 -3
- package/scss/components/_tab-view.scss +12 -2
- package/scss/components/_table-column.scss +4 -2
- package/scss/components/_table-row.scss +71 -3
- package/scss/components/_table-view.scss +27 -18
- package/scss/components/_text-field.scss +37 -17
- package/scss/components/_text-view.scss +57 -0
- package/scss/components/_toggle-view.scss +171 -0
- package/scss/components/_tool-bar-item.scss +34 -82
- package/scss/components/_tool-bar.scss +77 -57
- package/scss/components/_v-stack.scss +8 -2
- package/scss/final/_touch-glass.scss +31 -0
- package/scss/mixins/_button.scss +44 -0
- package/scss/mixins/_color.scss +16 -0
- package/scss/mixins/_dialog.scss +1 -0
- package/scss/mixins/_index.scss +73 -5
- package/scss/placeholders/_buttons.scss +46 -11
- package/scss/placeholders/_lists.scss +159 -126
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_confirmation-dialog.scss +8 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_menu-view.scss +17 -15
- package/scss/transitions/_progress-view.scss +23 -0
- package/scss/transitions/_sheet-view.scss +30 -0
- package/scss/transitions/_tab-bar.scss +6 -5
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +59 -40
- package/scss/utils/_index.scss +45 -56
- package/scss/utils/_scroll-view.scss +1 -1
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +34 -164
- package/web-components.css-data/en.json +28 -0
- package/web-components.html-data/en.json +2456 -166
- package/generated/confirmation-dialog/index.d.ts +0 -1
- package/generated/confirmation-dialog/index.js +0 -1
- package/generated/internal/utils/cash/index.d.ts +0 -22
- package/generated/internal/utils/cash/index.js +0 -23
- package/generated/lifecycle-observer/index.d.ts +0 -1
- package/generated/lifecycle-observer/index.js +0 -1
- package/scss/transitions/_dialog.scss +0 -28
- /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
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A control that starts an action. Styled with a glass border, adapting to the button’s surroundings.
|
|
4
|
+
*
|
|
5
|
+
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a glass button
|
|
6
|
+
*
|
|
7
|
+
* @slot overlay
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
export declare class GlassButton extends ButtonBase {
|
|
11
|
+
static get observedAttributes(): string[];
|
|
3
12
|
constructor();
|
|
4
13
|
static polyfillDisconnectedCallback(el: ButtonBase): void;
|
|
5
14
|
static polyfillConnectedCallback(el: ButtonBase): void;
|
|
15
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
6
16
|
}
|
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import { onoff, touchGlass } from '../internal/utils';
|
|
2
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
import { Snapshot } from '../snapshot';
|
|
5
|
+
/**
|
|
6
|
+
* @summary A control that starts an action. Styled with a glass border, adapting to the button’s surroundings.
|
|
7
|
+
*
|
|
8
|
+
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a glass button
|
|
9
|
+
*
|
|
10
|
+
* @slot overlay
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
4
13
|
export class GlassButton extends ButtonBase {
|
|
14
|
+
static get observedAttributes() {
|
|
15
|
+
return [
|
|
16
|
+
/**
|
|
17
|
+
* A value that describes the purpose of a button
|
|
18
|
+
* @type {destructive|confirm}
|
|
19
|
+
*/
|
|
20
|
+
'role',
|
|
21
|
+
'title-key',
|
|
22
|
+
];
|
|
23
|
+
}
|
|
5
24
|
constructor() {
|
|
6
25
|
super();
|
|
7
26
|
}
|
|
8
27
|
static polyfillDisconnectedCallback(el) {
|
|
9
|
-
|
|
28
|
+
debug(`${GlassButton.name} ⚡️ disconnect`);
|
|
10
29
|
CleanupRegistry.unregister(el);
|
|
11
30
|
}
|
|
12
31
|
static polyfillConnectedCallback(el) {
|
|
13
|
-
|
|
32
|
+
debug(`${GlassButton.name} ⚡️ connect`);
|
|
14
33
|
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
15
34
|
el.tabIndex = 0;
|
|
16
35
|
}
|
|
36
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
37
|
+
debug(`${GlassButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
38
|
+
const node = target instanceof HTMLButtonElement;
|
|
39
|
+
if (!node)
|
|
40
|
+
return;
|
|
41
|
+
switch (attributeName) {
|
|
42
|
+
case 'title-key':
|
|
43
|
+
case 'role':
|
|
44
|
+
Snapshot.waitReady.then(() => {
|
|
45
|
+
ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
|
|
46
|
+
});
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
17
50
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A control that starts an action. Styled with a prominent glass border, adapting to the button’s surroundings.
|
|
4
|
+
*
|
|
5
|
+
* @example <button is="glass-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent glass button
|
|
6
|
+
*
|
|
7
|
+
* @slot overlay
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
2
10
|
export declare class GlassProminentButton extends ButtonBase {
|
|
11
|
+
static get observedAttributes(): string[];
|
|
3
12
|
constructor();
|
|
4
13
|
static polyfillDisconnectedCallback(el: ButtonBase): void;
|
|
5
14
|
static polyfillConnectedCallback(el: ButtonBase): void;
|
|
15
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
|
|
6
16
|
}
|
|
@@ -1,17 +1,50 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import { onoff, touchGlass } from '../internal/utils';
|
|
2
|
+
import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
|
+
import { Snapshot } from '../snapshot';
|
|
5
|
+
/**
|
|
6
|
+
* @summary A control that starts an action. Styled with a prominent glass border, adapting to the button’s surroundings.
|
|
7
|
+
*
|
|
8
|
+
* @example <button is="glass-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent glass button
|
|
9
|
+
*
|
|
10
|
+
* @slot overlay
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
4
13
|
export class GlassProminentButton extends ButtonBase {
|
|
14
|
+
static get observedAttributes() {
|
|
15
|
+
return [
|
|
16
|
+
/**
|
|
17
|
+
* A value that describes the purpose of a button
|
|
18
|
+
* @type {destructive|confirm}
|
|
19
|
+
*/
|
|
20
|
+
'role',
|
|
21
|
+
'title-key',
|
|
22
|
+
];
|
|
23
|
+
}
|
|
5
24
|
constructor() {
|
|
6
25
|
super();
|
|
7
26
|
}
|
|
8
27
|
static polyfillDisconnectedCallback(el) {
|
|
9
|
-
|
|
28
|
+
debug(`${GlassProminentButton.name} ⚡️ disconnect`);
|
|
10
29
|
CleanupRegistry.unregister(el);
|
|
11
30
|
}
|
|
12
31
|
static polyfillConnectedCallback(el) {
|
|
13
|
-
|
|
32
|
+
debug(`${GlassProminentButton.name} ⚡️ connect`);
|
|
14
33
|
CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
|
|
15
34
|
el.tabIndex = 0;
|
|
16
35
|
}
|
|
36
|
+
static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
|
|
37
|
+
debug(`${GlassProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
|
|
38
|
+
const node = target instanceof HTMLButtonElement;
|
|
39
|
+
if (!node)
|
|
40
|
+
return;
|
|
41
|
+
switch (attributeName) {
|
|
42
|
+
case 'title-key':
|
|
43
|
+
case 'role':
|
|
44
|
+
Snapshot.waitReady.then(() => {
|
|
45
|
+
ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
|
|
46
|
+
});
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
17
50
|
}
|
|
@@ -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,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A view that arranges its children side by side.
|
|
3
|
+
*
|
|
4
|
+
* @attr {@Template} template — The main-axis grid template
|
|
5
|
+
*
|
|
6
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
7
|
+
*
|
|
8
|
+
* @attr {@blockSet} alignment — The cross-axis alignment
|
|
9
|
+
* @attr {@inlineSet} distribution — The main-axis alignment
|
|
10
|
+
* @attr {@inlinePlacementSet} placement — The main-axis alignment
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare class HStack extends HTMLElement {
|
|
14
|
+
constructor();
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
'h-stack': HStack;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
|
+
/**
|
|
3
|
+
* @summary A view that arranges its children side by side.
|
|
4
|
+
*
|
|
5
|
+
* @attr {@Template} template — The main-axis grid template
|
|
6
|
+
*
|
|
7
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
8
|
+
*
|
|
9
|
+
* @attr {@blockSet} alignment — The cross-axis alignment
|
|
10
|
+
* @attr {@inlineSet} distribution — The main-axis alignment
|
|
11
|
+
* @attr {@inlinePlacementSet} placement — The main-axis alignment
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export class HStack extends HTMLElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
debug(`${HStack.name} ⚡️ connect`);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
debug(`${HStack.name} ⚡️ disconnect`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A view that displays an image.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare class ImageView extends HTMLElement {
|
|
6
|
+
#private;
|
|
7
|
+
static get observedAttributes(): string[];
|
|
8
|
+
static get template(): DocumentFragment;
|
|
9
|
+
constructor();
|
|
10
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'image-view': ImageView;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { $, debug } from '../internal/utils';
|
|
2
|
+
import { queryMorph } from '../morphdom';
|
|
3
|
+
import { html } from '../tpl';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A view that displays an image.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export class ImageView extends HTMLElement {
|
|
9
|
+
static get observedAttributes() {
|
|
10
|
+
return ['system-name', 'system-weight'];
|
|
11
|
+
}
|
|
12
|
+
static #template;
|
|
13
|
+
static get template() {
|
|
14
|
+
return (this.#template ??= $(html `<slot></slot>`));
|
|
15
|
+
}
|
|
16
|
+
#shadowRoot;
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
20
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
21
|
+
}
|
|
22
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
23
|
+
debug(`${ImageView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
24
|
+
if (oldValue === newValue)
|
|
25
|
+
return;
|
|
26
|
+
switch (name) {
|
|
27
|
+
case 'system-weight': {
|
|
28
|
+
this.#render(this.getAttribute('system-name'), newValue);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case 'system-name': {
|
|
32
|
+
this.#render(newValue, this.getAttribute('system-weight'));
|
|
33
|
+
// // this.innerHTML = `<i style="line-height: 1.05" class="ph ph-${newValue}"></i>`
|
|
34
|
+
// //this.setAttribute('class', `ph ph-${newValue}`)
|
|
35
|
+
// let image = this.querySelector(':scope>:not([slot])')
|
|
36
|
+
// if (newValue) {
|
|
37
|
+
// const el = image ?? $(`<i style="line-height: 1"></i>`, '>1')
|
|
38
|
+
// el.setAttribute('class', `ph ph-${newValue}`)
|
|
39
|
+
// image ??= this.appendChild(el)
|
|
40
|
+
// // image ??= this.appendChild($(`<i style="line-height: 1.05"></i>`, '>1'))
|
|
41
|
+
// // image.setAttribute('class', `ph ph-${newValue}`)
|
|
42
|
+
// } else image?.remove()
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
#render(icon, weight) {
|
|
48
|
+
// if (!icon) {
|
|
49
|
+
// this.querySelector(':scope>:not([slot])')?.remove()
|
|
50
|
+
// return
|
|
51
|
+
// }
|
|
52
|
+
const tokens = [`ph${weight ? `-${weight}` : ''}`, `ph-${icon}`];
|
|
53
|
+
// const container = this.querySelector<HTMLElement>(':scope>:not([slot])') ?? this.appendChild<HTMLElement>($(`<i style="line-height: 1"></i>`, '>1'))
|
|
54
|
+
queryMorph(':not([slot])', html `<i style="line-height: 1" class="${tokens.join(' ')}"></i>`, this, { removeIf: !icon });
|
|
55
|
+
// if ('1' !== container.style.getPropertyValue('line-height')) container.style.setProperty('line-height', '1')
|
|
56
|
+
// for (const token of container.classList) if (token.startsWith('ph') && !tokens.includes(token)) container.classList.remove(token)
|
|
57
|
+
// container.classList.add(...tokens)
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
debug(`${ImageView.name} ⚡️ disconnect`);
|
|
61
|
+
}
|
|
62
|
+
connectedCallback() {
|
|
63
|
+
debug(`${ImageView.name} ⚡️ connect`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* @file Automatically generated by barrelsby.
|
|
3
|
-
*/
|
|
1
|
+
export * from './alert-dialog';
|
|
4
2
|
export * from './body-view';
|
|
5
3
|
export * from './bordered-button';
|
|
6
4
|
export * from './bordered-prominent-button';
|
|
7
5
|
export * from './borderless-button';
|
|
6
|
+
export * from './color-scheme';
|
|
8
7
|
export * from './confirmation-dialog';
|
|
8
|
+
export * from './content-unavailable';
|
|
9
9
|
export * from './date-picker';
|
|
10
|
+
export * from './detail-placeholder';
|
|
10
11
|
export * from './disclosure-group';
|
|
12
|
+
export * from './fine-tooltip';
|
|
11
13
|
export * from './form-view';
|
|
12
14
|
export * from './glass-button';
|
|
13
15
|
export * from './glass-prominent-button';
|
|
16
|
+
export * from './h-divider';
|
|
17
|
+
export * from './h-stack';
|
|
18
|
+
export * from './image-view';
|
|
14
19
|
export * from './label-view';
|
|
20
|
+
export * from './labeled-content';
|
|
15
21
|
export * from './list-view';
|
|
16
22
|
export * from './menu-view';
|
|
17
23
|
export * from './navigation-large-title';
|
|
@@ -20,8 +26,11 @@ export * from './navigation-stack';
|
|
|
20
26
|
export * from './navigation-title';
|
|
21
27
|
export * from './picker-view';
|
|
22
28
|
export * from './plain-button';
|
|
29
|
+
export * from './progress-view';
|
|
23
30
|
export * from './screen-view';
|
|
31
|
+
export * from './scroll-view-proxy';
|
|
24
32
|
export * from './scroll-view';
|
|
33
|
+
export * from './search-view';
|
|
25
34
|
export * from './section-view';
|
|
26
35
|
export * from './sheet-view';
|
|
27
36
|
export * from './sidebar-toggle';
|
|
@@ -32,8 +41,11 @@ export * from './tab-item';
|
|
|
32
41
|
export * from './tab-view';
|
|
33
42
|
export * from './table-view';
|
|
34
43
|
export * from './text-field';
|
|
44
|
+
export * from './text-view';
|
|
45
|
+
export * from './toggle-view';
|
|
35
46
|
export * from './tool-bar-item-group';
|
|
36
47
|
export * from './tool-bar-item';
|
|
37
48
|
export * from './tool-bar';
|
|
49
|
+
export * from './v-divider';
|
|
38
50
|
export * from './v-keyboard';
|
|
39
51
|
export * from './v-stack';
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* @file Automatically generated by barrelsby.
|
|
3
|
-
*/
|
|
1
|
+
export * from './alert-dialog';
|
|
4
2
|
export * from './body-view';
|
|
5
3
|
export * from './bordered-button';
|
|
6
4
|
export * from './bordered-prominent-button';
|
|
7
5
|
export * from './borderless-button';
|
|
6
|
+
export * from './color-scheme';
|
|
8
7
|
export * from './confirmation-dialog';
|
|
8
|
+
export * from './content-unavailable';
|
|
9
9
|
export * from './date-picker';
|
|
10
|
+
export * from './detail-placeholder';
|
|
10
11
|
export * from './disclosure-group';
|
|
12
|
+
export * from './fine-tooltip';
|
|
11
13
|
export * from './form-view';
|
|
12
14
|
export * from './glass-button';
|
|
13
15
|
export * from './glass-prominent-button';
|
|
16
|
+
export * from './h-divider';
|
|
17
|
+
export * from './h-stack';
|
|
18
|
+
export * from './image-view';
|
|
14
19
|
export * from './label-view';
|
|
20
|
+
export * from './labeled-content';
|
|
15
21
|
export * from './list-view';
|
|
16
22
|
export * from './menu-view';
|
|
17
23
|
export * from './navigation-large-title';
|
|
@@ -20,8 +26,11 @@ export * from './navigation-stack';
|
|
|
20
26
|
export * from './navigation-title';
|
|
21
27
|
export * from './picker-view';
|
|
22
28
|
export * from './plain-button';
|
|
29
|
+
export * from './progress-view';
|
|
23
30
|
export * from './screen-view';
|
|
31
|
+
export * from './scroll-view-proxy';
|
|
24
32
|
export * from './scroll-view';
|
|
33
|
+
export * from './search-view';
|
|
25
34
|
export * from './section-view';
|
|
26
35
|
export * from './sheet-view';
|
|
27
36
|
export * from './sidebar-toggle';
|
|
@@ -32,8 +41,11 @@ export * from './tab-item';
|
|
|
32
41
|
export * from './tab-view';
|
|
33
42
|
export * from './table-view';
|
|
34
43
|
export * from './text-field';
|
|
44
|
+
export * from './text-view';
|
|
45
|
+
export * from './toggle-view';
|
|
35
46
|
export * from './tool-bar-item-group';
|
|
36
47
|
export * from './tool-bar-item';
|
|
37
48
|
export * from './tool-bar';
|
|
49
|
+
export * from './v-divider';
|
|
38
50
|
export * from './v-keyboard';
|
|
39
51
|
export * from './v-stack';
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A view that labels items with an icon and a title.
|
|
3
|
+
*
|
|
4
|
+
* @example <label-view><span>Hello world!</span></label-view> — Creating a label using a `span` element
|
|
5
|
+
* @example <label-view title="Hello world!"></label-view> — Creating a label using the `title` attribute
|
|
6
|
+
* @example <label-view system-image="hand-waving"><span>Hello world!</span></label-view> — Creating a label with an icon and a title using the `system-image` attribute
|
|
7
|
+
* @example <label-view><i slot="icon" class="ph ph-duotone ph-hand-waving"></i><span>Hello world!</span></label-view> — Creating a label with an icon and a title using the `icon` slot
|
|
8
|
+
*
|
|
9
|
+
* @attr {@Font} font — Sets the default font for text in this view.
|
|
10
|
+
*
|
|
11
|
+
* @slot — Any children without a `slot` attribute are placed in the title block.
|
|
12
|
+
* @slot icon — Use the `slot="icon"` attribute to place childen in the icon block.
|
|
13
|
+
*
|
|
14
|
+
* @cssprop {length} --label-gap — The gap between the icon and the title.
|
|
15
|
+
* @cssprop {number} --label-image-size — The size of the icon.
|
|
16
|
+
* @cssprop {length}--label-padding-inline — The padding inline of the label.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
1
19
|
export declare class LabelView extends HTMLElement {
|
|
2
20
|
#private;
|
|
3
21
|
static get observedAttributes(): string[];
|
|
4
22
|
static get template(): DocumentFragment;
|
|
5
23
|
constructor();
|
|
24
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
25
|
disconnectedCallback(): void;
|
|
7
26
|
connectedCallback(): void;
|
|
8
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
9
27
|
}
|
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $, debug } from '../internal/utils';
|
|
2
|
+
import { queryMorph } from '../morphdom';
|
|
3
|
+
import { html } from '../tpl';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A view that labels items with an icon and a title.
|
|
6
|
+
*
|
|
7
|
+
* @example <label-view><span>Hello world!</span></label-view> — Creating a label using a `span` element
|
|
8
|
+
* @example <label-view title="Hello world!"></label-view> — Creating a label using the `title` attribute
|
|
9
|
+
* @example <label-view system-image="hand-waving"><span>Hello world!</span></label-view> — Creating a label with an icon and a title using the `system-image` attribute
|
|
10
|
+
* @example <label-view><i slot="icon" class="ph ph-duotone ph-hand-waving"></i><span>Hello world!</span></label-view> — Creating a label with an icon and a title using the `icon` slot
|
|
11
|
+
*
|
|
12
|
+
* @attr {@Font} font — Sets the default font for text in this view.
|
|
13
|
+
*
|
|
14
|
+
* @slot — Any children without a `slot` attribute are placed in the title block.
|
|
15
|
+
* @slot icon — Use the `slot="icon"` attribute to place childen in the icon block.
|
|
16
|
+
*
|
|
17
|
+
* @cssprop {length} --label-gap — The gap between the icon and the title.
|
|
18
|
+
* @cssprop {number} --label-image-size — The size of the icon.
|
|
19
|
+
* @cssprop {length}--label-padding-inline — The padding inline of the label.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
2
22
|
export class LabelView extends HTMLElement {
|
|
3
23
|
static get observedAttributes() {
|
|
4
|
-
return [
|
|
24
|
+
return [
|
|
25
|
+
'system-image',
|
|
26
|
+
'title',
|
|
27
|
+
'line-limit',
|
|
28
|
+
/**
|
|
29
|
+
* @type {"tail"}
|
|
30
|
+
*/
|
|
31
|
+
'truncation-mode',
|
|
32
|
+
];
|
|
5
33
|
}
|
|
6
34
|
static #template;
|
|
7
35
|
static get template() {
|
|
8
|
-
return (this.#template ??= $(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
36
|
+
return (this.#template ??= $(html `
|
|
37
|
+
<slot name="icon"></slot>
|
|
38
|
+
<slot></slot>
|
|
39
|
+
`));
|
|
40
|
+
// String.raw`
|
|
41
|
+
// <div part="root label-image-stack">
|
|
42
|
+
// <slot name="image"></slot>
|
|
43
|
+
// </div>
|
|
44
|
+
// <div part="root label-title-stack">
|
|
45
|
+
// <slot></slot>
|
|
46
|
+
// </div>`
|
|
15
47
|
}
|
|
16
48
|
#shadowRoot;
|
|
17
|
-
// #
|
|
18
|
-
// #slot?: HTMLSlotElement
|
|
49
|
+
// #reflectScheduled = false
|
|
19
50
|
constructor() {
|
|
20
51
|
super();
|
|
21
52
|
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
22
|
-
// Snapshot.waitReady.then(() => {
|
|
23
53
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
24
|
-
// // this.#imgSlot = this.#shadowRoot.querySelector<HTMLSlotElement>('slot[name=image]') ?? undefined
|
|
25
|
-
// // this.#slot = this.#shadowRoot.querySelector<HTMLSlotElement>('slot:not([name])') ?? undefined
|
|
26
|
-
//
|
|
27
|
-
// // this.#slot?.addEventListener('slotchange', this.#handleSlotchange)
|
|
28
|
-
// // // this.#imgSlot?.addEventListener('slotchange', this.#handleSlotchange)
|
|
29
|
-
// // // this.#handleSlotchange(new CustomEvent('slotchange'))
|
|
30
|
-
// })
|
|
31
|
-
}
|
|
32
|
-
disconnectedCallback() {
|
|
33
|
-
console.debug(`${LabelView.name} ⚡️ disconnect`);
|
|
34
|
-
// this.#slot?.removeEventListener('slotchange', this.#handleSlotchange)
|
|
35
|
-
}
|
|
36
|
-
connectedCallback() {
|
|
37
|
-
console.debug(`${LabelView.name} ⚡️ connect`);
|
|
38
54
|
}
|
|
39
55
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
debug(`${LabelView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
57
|
+
if (oldValue === newValue)
|
|
58
|
+
return;
|
|
59
|
+
// this.#scheduleReflect()
|
|
42
60
|
switch (name) {
|
|
61
|
+
// case 'system-image':
|
|
62
|
+
// case 'title':
|
|
63
|
+
// render(
|
|
64
|
+
// html`${this.getAttribute('title') ? html`<span>${this.getAttribute('title')}</span>` : null}${this.getAttribute('system-image')
|
|
65
|
+
// ? html`<image-view slot="icon" system-name="${this.getAttribute('system-image')}"></image-view>`
|
|
66
|
+
// : null}`,
|
|
67
|
+
// this
|
|
68
|
+
// )
|
|
69
|
+
// break
|
|
43
70
|
case 'system-image':
|
|
44
|
-
|
|
45
|
-
if (newValue) {
|
|
46
|
-
image ??= this.appendChild($(`<i slot="image"></i>`));
|
|
47
|
-
image.setAttribute('class', `ph ph-${newValue}`);
|
|
48
|
-
}
|
|
49
|
-
else
|
|
50
|
-
image?.remove();
|
|
51
|
-
// // const imgSlot = this.#shadowRoot.querySelector<HTMLSlotElement>('slot[name=image]')
|
|
52
|
-
// // if (!imgSlot) break
|
|
53
|
-
// const assigned = this.#imgSlot!.assignedElements({ flatten: true }) as HTMLElement[]
|
|
54
|
-
// let el = assigned[0] as HTMLElement | undefined
|
|
55
|
-
// if (!el) {
|
|
56
|
-
// el = document.createElement('i')
|
|
57
|
-
// el.slot = 'image'
|
|
58
|
-
// this.append(el)
|
|
59
|
-
// }
|
|
60
|
-
// el.setAttribute('class', `ph ph-${newValue}`)
|
|
71
|
+
queryMorph('[slot=icon]', html `<image-view slot="icon" system-name="${newValue}"></image-view>`, this, { removeIf: !newValue });
|
|
61
72
|
break;
|
|
62
73
|
case 'title':
|
|
63
|
-
|
|
64
|
-
if (newValue) {
|
|
65
|
-
title ??= this.appendChild($(`<span></span>`));
|
|
66
|
-
title.textContent = newValue;
|
|
67
|
-
}
|
|
68
|
-
else
|
|
69
|
-
title?.remove();
|
|
70
|
-
// // const titleSlot = this.#shadowRoot.querySelector<HTMLSlotElement>('slot:not([name])')
|
|
71
|
-
// // if (!titleSlot) break
|
|
72
|
-
// const title = this.#slot!.assignedElements({ flatten: true }) as HTMLElement[]
|
|
73
|
-
// let el2 = title[0] as HTMLElement | undefined
|
|
74
|
-
// if (!el2) {
|
|
75
|
-
// el2 = document.createElement('span')
|
|
76
|
-
// this.append(el2)
|
|
77
|
-
// }
|
|
78
|
-
// el2.textContent = newValue //el2.replaceChildren(escapeHTMLPolicy.createHTML(newValue))
|
|
74
|
+
queryMorph(':not([slot])', html `<span>${newValue}</span>`, this, { removeIf: !newValue });
|
|
79
75
|
break;
|
|
80
76
|
}
|
|
81
|
-
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
debug(`${LabelView.name} ⚡️ disconnect`);
|
|
80
|
+
}
|
|
81
|
+
connectedCallback() {
|
|
82
|
+
debug(`${LabelView.name} ⚡️ connect`);
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A container view that pairs a label with a value.
|
|
3
|
+
*
|
|
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.
|
|
11
|
+
* @slot label — Use the `slot="label"` attribute to place childen in the label block.
|
|
12
|
+
* @slot header
|
|
13
|
+
* @slot footer
|
|
14
|
+
*
|
|
15
|
+
* @csspart labeled-content-container
|
|
16
|
+
* @csspart labeled-content-stack
|
|
17
|
+
* @csspart labeled-content-label-stack
|
|
18
|
+
* @csspart labeled-content-value-stack
|
|
19
|
+
*/
|
|
20
|
+
export declare class LabeledContent extends HTMLElement {
|
|
21
|
+
#private;
|
|
22
|
+
static get observedAttributes(): string[];
|
|
23
|
+
static get template(): DocumentFragment;
|
|
24
|
+
constructor();
|
|
25
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
26
|
+
disconnectedCallback(): void;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'labeled-content': LabeledContent;
|
|
32
|
+
}
|
|
33
|
+
}
|