@swiftwc/ui 0.0.0-dev.8 → 0.0.0-dev.81
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 +21 -10
- package/generated/client/index.js +177 -194
- package/generated/components/alert-dialog.d.ts +8 -0
- package/generated/components/alert-dialog.js +99 -0
- package/generated/components/body-view.js +5 -2
- package/generated/components/bordered-button.d.ts +10 -0
- package/generated/components/bordered-button.js +39 -3
- package/generated/components/bordered-prominent-button.d.ts +10 -0
- package/generated/components/bordered-prominent-button.js +39 -3
- package/generated/components/borderless-button.d.ts +9 -1
- package/generated/components/borderless-button.js +32 -11
- package/generated/components/color-scheme.d.ts +7 -0
- package/generated/components/color-scheme.js +54 -0
- package/generated/components/confirmation-dialog.d.ts +1 -1
- package/generated/components/confirmation-dialog.js +43 -32
- 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 +2 -12
- package/generated/components/date-picker.js +96 -65
- package/generated/components/disclosure-group.d.ts +5 -0
- package/generated/components/disclosure-group.js +18 -7
- package/generated/components/fine-tooltip.d.ts +7 -0
- package/generated/components/fine-tooltip.js +107 -0
- package/generated/components/form-view.d.ts +3 -0
- package/generated/components/form-view.js +8 -3
- package/generated/components/glass-button.d.ts +10 -0
- package/generated/components/glass-button.js +39 -3
- package/generated/components/glass-prominent-button.d.ts +10 -0
- package/generated/components/glass-prominent-button.js +39 -3
- package/generated/components/h-stack.d.ts +14 -0
- package/generated/components/h-stack.js +23 -0
- package/generated/components/image-view.d.ts +9 -0
- package/generated/components/image-view.js +64 -0
- package/generated/components/index.d.ts +11 -3
- package/generated/components/index.js +11 -3
- package/generated/components/label-view.d.ts +6 -1
- package/generated/components/label-view.js +40 -60
- package/generated/components/labeled-content.d.ts +9 -0
- package/generated/components/labeled-content.js +116 -0
- package/generated/components/list-view.d.ts +3 -0
- package/generated/components/list-view.js +20 -17
- package/generated/components/menu-view.d.ts +4 -1
- package/generated/components/menu-view.js +60 -51
- package/generated/components/navigation-large-title.js +9 -5
- package/generated/components/navigation-split-view.d.ts +4 -1
- package/generated/components/navigation-split-view.js +13 -6
- package/generated/components/navigation-stack.d.ts +4 -1
- package/generated/components/navigation-stack.js +16 -9
- package/generated/components/navigation-title.d.ts +1 -1
- package/generated/components/navigation-title.js +58 -55
- package/generated/components/picker-view.d.ts +32 -4
- package/generated/components/picker-view.js +924 -234
- package/generated/components/plain-button.js +5 -3
- package/generated/components/progress-view.d.ts +13 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.js +3 -1
- 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 +1 -1
- package/generated/components/scroll-view.js +101 -85
- package/generated/components/search-view.d.ts +7 -0
- package/generated/components/search-view.js +30 -0
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +35 -30
- package/generated/components/sheet-view.d.ts +1 -2
- package/generated/components/sheet-view.js +32 -39
- package/generated/components/sidebar-toggle.js +44 -66
- package/generated/components/sidebar-view.js +13 -8
- package/generated/components/sticky-container.js +8 -4
- package/generated/components/tab-bar.d.ts +3 -0
- package/generated/components/tab-bar.js +20 -10
- package/generated/components/tab-item.js +24 -13
- package/generated/components/tab-view.js +25 -17
- package/generated/components/table-view.d.ts +5 -0
- package/generated/components/table-view.js +55 -77
- package/generated/components/text-field.d.ts +2 -2
- package/generated/components/text-field.js +95 -88
- package/generated/components/toggle-view.d.ts +28 -0
- package/generated/components/toggle-view.js +224 -0
- package/generated/components/tool-bar-item-group.js +21 -4
- package/generated/components/tool-bar-item.d.ts +4 -1
- package/generated/components/tool-bar-item.js +57 -10
- package/generated/components/tool-bar.d.ts +12 -0
- package/generated/components/tool-bar.js +27 -11
- package/generated/components/v-keyboard.d.ts +3 -1
- package/generated/components/v-keyboard.js +12 -6
- package/generated/components/v-stack.d.ts +12 -0
- package/generated/components/v-stack.js +17 -2
- package/generated/css/index.css +2533 -941
- package/generated/events/alert-dialog.d.ts +8 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +2 -2
- package/generated/events/index.d.ts +2 -0
- package/generated/events/index.js +2 -0
- package/generated/events/picker-view.d.ts +7 -0
- package/generated/events/scroll-view.js +4 -0
- package/generated/events/tab-view.d.ts +6 -2
- package/generated/events/text-field.js +3 -0
- package/generated/events/toggle-view.d.ts +9 -0
- package/generated/events/toggle-view.js +4 -0
- package/generated/i18n/index.d.ts +20 -10
- package/generated/i18n/index.js +82 -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 +3 -2
- package/generated/internal/class/form-associated-base.d.ts +0 -4
- package/generated/internal/class/form-associated-base.js +23 -38
- 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 +38 -43
- 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 +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/privateNamespace.d.ts +10 -0
- package/generated/internal/privateNamespace.js +168 -1
- package/generated/internal/utils/cash/index.d.ts +4 -3
- package/generated/internal/utils/cash/index.js +6 -4
- 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/index.d.ts +7 -2
- package/generated/internal/utils/index.js +9 -2
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/list-active.js +67 -12
- package/generated/internal/utils/render-label-icon.d.ts +2 -0
- package/generated/internal/utils/render-label-icon.js +19 -0
- package/generated/internal/utils/render-label-title.d.ts +2 -0
- package/generated/internal/utils/render-label-title.js +16 -0
- package/generated/internal/utils/render-label.d.ts +1 -0
- package/generated/internal/utils/render-label.js +19 -0
- package/generated/internal/utils/touch-glass.js +5 -5
- 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 +25 -2
- package/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +3 -0
- package/generated/tpl/index.d.ts +4 -0
- package/generated/tpl/index.js +4 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +132 -0
- package/package.json +18 -4
- package/scss/_components.scss +14 -0
- package/scss/_functions.scss +10 -0
- package/scss/_mixins.scss +4 -0
- package/scss/_transitions.scss +6 -1
- package/scss/_vars.scss +9 -2
- package/scss/base/_layout.scss +17 -7
- package/scss/base/_reboot.scss +34 -1
- package/scss/base/_root.scss +117 -114
- package/scss/colors/_index.scss +304 -85
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_bordered-button.scss +35 -0
- package/scss/components/_bordered-prominent-button.scss +45 -0
- package/scss/components/_borderless-button.scss +25 -0
- package/scss/components/_confirmation-dialog.scss +41 -49
- package/scss/components/_content-unavailable-view.scss +56 -0
- package/scss/components/_date-picker.scss +15 -15
- package/scss/components/_detail-placeholder.scss +1 -3
- package/scss/components/_disclosure-group.scss +84 -33
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +58 -20
- package/scss/components/_glass-button.scss +35 -0
- package/scss/components/_glass-prominent-button.scss +46 -0
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +21 -15
- package/scss/components/_image-view.scss +20 -0
- package/scss/components/_index.scss +40 -20
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +94 -110
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +59 -1
- package/scss/components/_list-view.scss +65 -25
- package/scss/components/_menu-view.scss +95 -60
- package/scss/components/_navigation-large-title.scss +17 -0
- package/scss/components/_navigation-split-view.scss +3 -3
- package/scss/components/_picker-view.scss +259 -59
- package/scss/components/_plain-button.scss +7 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +22 -20
- package/scss/components/_scroll-view.scss +4 -0
- package/scss/components/_search-view.scss +22 -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 +4 -2
- package/scss/components/_table-column.scss +2 -0
- package/scss/components/_table-row.scss +69 -1
- package/scss/components/_table-view.scss +22 -14
- package/scss/components/_text-field.scss +37 -17
- package/scss/components/_toggle-view.scss +112 -0
- package/scss/components/_tool-bar-item.scss +34 -82
- package/scss/components/_tool-bar.scss +77 -57
- package/scss/components/_v-stack.scss +9 -2
- package/scss/final/_touch-glass.scss +24 -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 +64 -2
- package/scss/placeholders/_buttons.scss +44 -10
- package/scss/placeholders/_lists.scss +133 -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/_frame.scss +42 -0
- package/scss/utils/_index.scss +67 -52
- package/scss/utils/_stacks.scss +56 -73
- package/web-components.html-data/en.json +623 -24
- package/generated/confirmation-dialog/index.d.ts +0 -1
- package/generated/confirmation-dialog/index.js +0 -1
- package/generated/lifecycle-observer/index.d.ts +0 -1
- package/generated/lifecycle-observer/index.js +0 -1
- package/scss/transitions/_dialog.scss +0 -28
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @attr {@spacingSet} spacing - The gap between the primary axis
|
|
4
|
+
*
|
|
5
|
+
* @attr {@alignmentSet} alignment - The cross-axis alignment
|
|
6
|
+
* @attr {@distributionSet} distribution - The main-axis alignment
|
|
7
|
+
* @attr {@placementSet} placement - The main-axis alignment
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class HStack extends HTMLElement {
|
|
11
|
+
constructor();
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { devFlags } from '../internal/utils';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @attr {@spacingSet} spacing - The gap between the primary axis
|
|
5
|
+
*
|
|
6
|
+
* @attr {@alignmentSet} alignment - The cross-axis alignment
|
|
7
|
+
* @attr {@distributionSet} distribution - The main-axis alignment
|
|
8
|
+
* @attr {@placementSet} placement - The main-axis alignment
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export class HStack extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
if (devFlags.debug)
|
|
17
|
+
console.debug(`${HStack.name} ⚡️ connect`);
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
if (devFlags.debug)
|
|
21
|
+
console.debug(`${HStack.name} ⚡️ disconnect`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class ImageView extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
static get observedAttributes(): string[];
|
|
4
|
+
static get template(): DocumentFragment;
|
|
5
|
+
constructor();
|
|
6
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { $, devFlags } from '../internal/utils';
|
|
2
|
+
export class ImageView extends HTMLElement {
|
|
3
|
+
static get observedAttributes() {
|
|
4
|
+
return ['system-name', 'system-weight'];
|
|
5
|
+
}
|
|
6
|
+
static #template;
|
|
7
|
+
static get template() {
|
|
8
|
+
return (this.#template ??= $(String.raw `<slot></slot>`));
|
|
9
|
+
}
|
|
10
|
+
#shadowRoot;
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
14
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
15
|
+
}
|
|
16
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
17
|
+
if (devFlags.debug)
|
|
18
|
+
console.debug(`${ImageView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
19
|
+
if (oldValue === newValue)
|
|
20
|
+
return;
|
|
21
|
+
switch (name) {
|
|
22
|
+
case 'system-weight': {
|
|
23
|
+
this.#render(this.getAttribute('system-name'), newValue);
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case 'system-name': {
|
|
27
|
+
this.#render(newValue, this.getAttribute('system-weight'));
|
|
28
|
+
// // this.innerHTML = `<i style="line-height: 1.05" class="ph ph-${newValue}"></i>`
|
|
29
|
+
// //this.setAttribute('class', `ph ph-${newValue}`)
|
|
30
|
+
// let image = this.querySelector(':scope>:not([slot])')
|
|
31
|
+
// if (newValue) {
|
|
32
|
+
// const el = image ?? $(`<i style="line-height: 1"></i>`, '>1')
|
|
33
|
+
// el.setAttribute('class', `ph ph-${newValue}`)
|
|
34
|
+
// image ??= this.appendChild(el)
|
|
35
|
+
// // image ??= this.appendChild($(`<i style="line-height: 1.05"></i>`, '>1'))
|
|
36
|
+
// // image.setAttribute('class', `ph ph-${newValue}`)
|
|
37
|
+
// } else image?.remove()
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
#render(icon, weight) {
|
|
43
|
+
if (!icon) {
|
|
44
|
+
this.querySelector(':scope>:not([slot])')?.remove();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const tokens = [`ph${weight ? `-${weight}` : ''}`, `ph-${icon}`];
|
|
48
|
+
const container = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<i style="line-height: 1"></i>`, '>1'));
|
|
49
|
+
if ('1' !== container.style.getPropertyValue('line-height'))
|
|
50
|
+
container.style.setProperty('line-height', '1');
|
|
51
|
+
for (const token of container.classList)
|
|
52
|
+
if (token.startsWith('ph') && !tokens.includes(token))
|
|
53
|
+
container.classList.remove(token);
|
|
54
|
+
container.classList.add(...tokens);
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
if (devFlags.debug)
|
|
58
|
+
console.debug(`${ImageView.name} ⚡️ disconnect`);
|
|
59
|
+
}
|
|
60
|
+
connectedCallback() {
|
|
61
|
+
if (devFlags.debug)
|
|
62
|
+
console.debug(`${ImageView.name} ⚡️ connect`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,17 +1,21 @@
|
|
|
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-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './disclosure-group';
|
|
11
|
+
export * from './fine-tooltip';
|
|
11
12
|
export * from './form-view';
|
|
12
13
|
export * from './glass-button';
|
|
13
14
|
export * from './glass-prominent-button';
|
|
15
|
+
export * from './h-stack';
|
|
16
|
+
export * from './image-view';
|
|
14
17
|
export * from './label-view';
|
|
18
|
+
export * from './labeled-content';
|
|
15
19
|
export * from './list-view';
|
|
16
20
|
export * from './menu-view';
|
|
17
21
|
export * from './navigation-large-title';
|
|
@@ -20,8 +24,11 @@ export * from './navigation-stack';
|
|
|
20
24
|
export * from './navigation-title';
|
|
21
25
|
export * from './picker-view';
|
|
22
26
|
export * from './plain-button';
|
|
27
|
+
export * from './progress-view';
|
|
23
28
|
export * from './screen-view';
|
|
29
|
+
export * from './scroll-view-proxy';
|
|
24
30
|
export * from './scroll-view';
|
|
31
|
+
export * from './search-view';
|
|
25
32
|
export * from './section-view';
|
|
26
33
|
export * from './sheet-view';
|
|
27
34
|
export * from './sidebar-toggle';
|
|
@@ -32,6 +39,7 @@ export * from './tab-item';
|
|
|
32
39
|
export * from './tab-view';
|
|
33
40
|
export * from './table-view';
|
|
34
41
|
export * from './text-field';
|
|
42
|
+
export * from './toggle-view';
|
|
35
43
|
export * from './tool-bar-item-group';
|
|
36
44
|
export * from './tool-bar-item';
|
|
37
45
|
export * from './tool-bar';
|
|
@@ -1,17 +1,21 @@
|
|
|
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-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './disclosure-group';
|
|
11
|
+
export * from './fine-tooltip';
|
|
11
12
|
export * from './form-view';
|
|
12
13
|
export * from './glass-button';
|
|
13
14
|
export * from './glass-prominent-button';
|
|
15
|
+
export * from './h-stack';
|
|
16
|
+
export * from './image-view';
|
|
14
17
|
export * from './label-view';
|
|
18
|
+
export * from './labeled-content';
|
|
15
19
|
export * from './list-view';
|
|
16
20
|
export * from './menu-view';
|
|
17
21
|
export * from './navigation-large-title';
|
|
@@ -20,8 +24,11 @@ export * from './navigation-stack';
|
|
|
20
24
|
export * from './navigation-title';
|
|
21
25
|
export * from './picker-view';
|
|
22
26
|
export * from './plain-button';
|
|
27
|
+
export * from './progress-view';
|
|
23
28
|
export * from './screen-view';
|
|
29
|
+
export * from './scroll-view-proxy';
|
|
24
30
|
export * from './scroll-view';
|
|
31
|
+
export * from './search-view';
|
|
25
32
|
export * from './section-view';
|
|
26
33
|
export * from './sheet-view';
|
|
27
34
|
export * from './sidebar-toggle';
|
|
@@ -32,6 +39,7 @@ export * from './tab-item';
|
|
|
32
39
|
export * from './tab-view';
|
|
33
40
|
export * from './table-view';
|
|
34
41
|
export * from './text-field';
|
|
42
|
+
export * from './toggle-view';
|
|
35
43
|
export * from './tool-bar-item-group';
|
|
36
44
|
export * from './tool-bar-item';
|
|
37
45
|
export * from './tool-bar';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @attr {@fontSet} font - Sets the default font for text in this view.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
1
6
|
export declare class LabelView extends HTMLElement {
|
|
2
7
|
#private;
|
|
3
8
|
static get observedAttributes(): string[];
|
|
4
9
|
static get template(): DocumentFragment;
|
|
5
10
|
constructor();
|
|
11
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
12
|
disconnectedCallback(): void;
|
|
7
13
|
connectedCallback(): void;
|
|
8
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
9
14
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $, devFlags } from '../internal/utils';
|
|
2
|
+
import { html, render } from '../tpl';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @attr {@fontSet} font - Sets the default font for text in this view.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
2
8
|
export class LabelView extends HTMLElement {
|
|
3
9
|
static get observedAttributes() {
|
|
4
10
|
return ['system-image', 'title', 'line-limit', 'truncation-mode'];
|
|
@@ -6,78 +12,52 @@ export class LabelView extends HTMLElement {
|
|
|
6
12
|
static #template;
|
|
7
13
|
static get template() {
|
|
8
14
|
return (this.#template ??= $(String.raw `
|
|
9
|
-
|
|
10
|
-
<slot name="image"></slot>
|
|
11
|
-
</div>
|
|
12
|
-
<div part="root label-title-stack">
|
|
15
|
+
<slot name="icon"></slot>
|
|
13
16
|
<slot></slot>
|
|
14
|
-
|
|
17
|
+
`
|
|
18
|
+
// String.raw`
|
|
19
|
+
// <div part="root label-image-stack">
|
|
20
|
+
// <slot name="image"></slot>
|
|
21
|
+
// </div>
|
|
22
|
+
// <div part="root label-title-stack">
|
|
23
|
+
// <slot></slot>
|
|
24
|
+
// </div>`
|
|
25
|
+
));
|
|
15
26
|
}
|
|
16
27
|
#shadowRoot;
|
|
17
|
-
// #
|
|
18
|
-
// #slot?: HTMLSlotElement
|
|
28
|
+
// #reflectScheduled = false
|
|
19
29
|
constructor() {
|
|
20
30
|
super();
|
|
21
31
|
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
22
|
-
// Snapshot.waitReady.then(() => {
|
|
23
32
|
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
33
|
}
|
|
39
34
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
if (devFlags.debug)
|
|
36
|
+
console.debug(`${LabelView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
37
|
+
if (oldValue === newValue)
|
|
38
|
+
return;
|
|
39
|
+
// this.#scheduleReflect()
|
|
42
40
|
switch (name) {
|
|
43
41
|
case 'system-image':
|
|
44
|
-
let image = this.querySelector(':scope>[slot=image]');
|
|
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}`)
|
|
61
|
-
break;
|
|
62
42
|
case 'title':
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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))
|
|
43
|
+
render(html `${this.getAttribute('title') ? html `<span>${this.getAttribute('title')}</span>` : null}${this.getAttribute('system-image')
|
|
44
|
+
? html `<image-view slot="icon" system-name="${this.getAttribute('system-image')}"></image-view>`
|
|
45
|
+
: null}`, this);
|
|
79
46
|
break;
|
|
47
|
+
// case 'system-image':
|
|
48
|
+
// renderLabelIcon(this, newValue)
|
|
49
|
+
// break
|
|
50
|
+
// case 'title':
|
|
51
|
+
// renderLabelTitle(this, newValue)
|
|
52
|
+
// break
|
|
80
53
|
}
|
|
81
|
-
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
if (devFlags.debug)
|
|
57
|
+
console.debug(`${LabelView.name} ⚡️ disconnect`);
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
if (devFlags.debug)
|
|
61
|
+
console.debug(`${LabelView.name} ⚡️ connect`);
|
|
82
62
|
}
|
|
83
63
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class LabeledContent extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
static get observedAttributes(): string[];
|
|
4
|
+
static get template(): DocumentFragment;
|
|
5
|
+
constructor();
|
|
6
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { $, devFlags, renderLabel } from '../internal/utils';
|
|
2
|
+
import { html, render } from '../tpl';
|
|
3
|
+
export class LabeledContent extends HTMLElement {
|
|
4
|
+
static get observedAttributes() {
|
|
5
|
+
return ['value', 'label', 'header', 'footer', 'labeled-content-style', 'format'];
|
|
6
|
+
}
|
|
7
|
+
static #template;
|
|
8
|
+
static get template() {
|
|
9
|
+
return (this.#template ??= $(String.raw `
|
|
10
|
+
<div part="root labeled-content-container">
|
|
11
|
+
<slot name="header"></slot>
|
|
12
|
+
<div part="root labeled-content-stack">
|
|
13
|
+
<div part="root labeled-content-label-stack">
|
|
14
|
+
<slot name="label"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div part="root labeled-content-value-stack">
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<slot name="footer"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
`));
|
|
23
|
+
}
|
|
24
|
+
#shadowRoot;
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
28
|
+
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
29
|
+
}
|
|
30
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
31
|
+
if (devFlags.debug)
|
|
32
|
+
console.debug(`${LabeledContent.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
33
|
+
if (oldValue === newValue)
|
|
34
|
+
return;
|
|
35
|
+
switch (name) {
|
|
36
|
+
case 'header':
|
|
37
|
+
if (!newValue) {
|
|
38
|
+
this.querySelector(':scope>[slot=header]')?.remove();
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }));
|
|
42
|
+
render(html `<label-view font="callout">
|
|
43
|
+
<span>${newValue}</span>
|
|
44
|
+
</label-view>`, header);
|
|
45
|
+
break;
|
|
46
|
+
case 'footer':
|
|
47
|
+
if (!newValue) {
|
|
48
|
+
this.querySelector(':scope>[slot=footer]')?.remove();
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }));
|
|
52
|
+
render(html `<label-view font="callout">
|
|
53
|
+
<span>${newValue}</span>
|
|
54
|
+
</label-view>`, footer);
|
|
55
|
+
break;
|
|
56
|
+
case 'value':
|
|
57
|
+
renderLabel(':scope>label-view:not([slot])', `<label-view><span></span></label-view>`, this, this.#fmt(newValue, this.getAttribute('format')));
|
|
58
|
+
break;
|
|
59
|
+
case 'format':
|
|
60
|
+
renderLabel(':scope>label-view:not([slot])', `<label-view><span></span></label-view>`, this, this.#fmt(this.getAttribute('value'), newValue));
|
|
61
|
+
break;
|
|
62
|
+
case 'label':
|
|
63
|
+
renderLabel(':scope>label-view[slot=label]', `<label-view slot="label"><span></span></label-view>`, this, newValue);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
disconnectedCallback() {
|
|
68
|
+
if (devFlags.debug)
|
|
69
|
+
console.debug(`${LabeledContent.name} ⚡️ disconnect`);
|
|
70
|
+
}
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
if (devFlags.debug)
|
|
73
|
+
console.debug(`${LabeledContent.name} ⚡️ connect`);
|
|
74
|
+
}
|
|
75
|
+
// <type>:<locale>;<option>=<value>;<option>=<value>
|
|
76
|
+
#fmt = (value, format) => {
|
|
77
|
+
const parseFormat = (format) => {
|
|
78
|
+
if (!format)
|
|
79
|
+
return {
|
|
80
|
+
type: 'text',
|
|
81
|
+
locale: navigator.language,
|
|
82
|
+
options: {},
|
|
83
|
+
};
|
|
84
|
+
const [type, locale = navigator.language, opts = {}] = format.split(':', 3), loc = new Intl.Locale(locale), options = Object.fromEntries(new URLSearchParams(opts));
|
|
85
|
+
return {
|
|
86
|
+
type,
|
|
87
|
+
locale: loc.toString(),
|
|
88
|
+
options,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
const { type, locale, options } = parseFormat(format);
|
|
92
|
+
switch (type) {
|
|
93
|
+
case 'currency':
|
|
94
|
+
return new Intl.NumberFormat(locale, { style: 'currency', ...options }).format(Number(value)); // currency:en-US;currency=USD "$1,234.50"
|
|
95
|
+
case 'percent':
|
|
96
|
+
return new Intl.NumberFormat(locale, { style: 'percent' }).format(Number(value)); // percent:en-US "42%"
|
|
97
|
+
case 'unit':
|
|
98
|
+
return new Intl.NumberFormat(locale, { style: 'unit', ...options }).format(Number(value)); // percent:en-US:unit=kilometer-per-hour "50 km/h"
|
|
99
|
+
case 'number':
|
|
100
|
+
return new Intl.NumberFormat(locale, options).format(Number(value)); // number:en-US:notation=compact "1.2M"
|
|
101
|
+
case 'date':
|
|
102
|
+
return new Intl.DateTimeFormat(locale, options).format(new Date(value ?? '2000')); // { dateStyle: 'full', timeStyle: 'short' } "Saturday, July 4, 2026 at 2:30 PM"
|
|
103
|
+
case 'relative-time': {
|
|
104
|
+
const [number = 0, unit = 'day'] = value?.split('~') ?? [];
|
|
105
|
+
return new Intl.RelativeTimeFormat(locale, options).format(Number(number), unit); // -1~day { numeric: 'auto' } "yesterday"
|
|
106
|
+
}
|
|
107
|
+
case 'list':
|
|
108
|
+
return new Intl.ListFormat(locale, options).format(value?.split('~') ?? []); // '' { style: 'long', type: 'conjunction' } "Foo, Bar, and Baz"
|
|
109
|
+
case 'region':
|
|
110
|
+
return value ? new Intl.DisplayNames(locale, { type: 'region' }).of(value) : ''; // "Greece"
|
|
111
|
+
// "Foo, Bar, and Baz"
|
|
112
|
+
default:
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
|
-
import { listActive, onoff } from '../internal/utils';
|
|
2
|
+
import { devFlags, listActive, onoff } from '../internal/utils';
|
|
3
|
+
/**
|
|
4
|
+
* @attr {hidden} navigation-link-indicator-visibility - Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
5
|
+
*/
|
|
3
6
|
export class ListView extends HTMLElement {
|
|
4
|
-
// static
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
7
|
+
// static #template: DocumentFragment
|
|
8
|
+
// static get template() {
|
|
9
|
+
// return (this.#template ??= $(
|
|
10
|
+
// String.raw`
|
|
11
|
+
// <slot name="searchable"></slot>
|
|
12
|
+
// <slot></slot>
|
|
13
|
+
// `
|
|
14
|
+
// ))
|
|
15
|
+
// }
|
|
16
|
+
// #shadowRoot
|
|
9
17
|
constructor() {
|
|
10
18
|
super();
|
|
11
|
-
// this.#
|
|
12
|
-
// this.
|
|
19
|
+
// this.#shadowRoot = this.attachShadow({ mode: 'closed' })
|
|
20
|
+
// this.#shadowRoot.appendChild(document.importNode((this.constructor as typeof ListView).template, true))
|
|
13
21
|
}
|
|
14
22
|
disconnectedCallback() {
|
|
15
|
-
|
|
23
|
+
if (devFlags.debug)
|
|
24
|
+
console.debug(`${ListView.name} ⚡️ disconnect`);
|
|
16
25
|
CleanupRegistry.unregister(this);
|
|
17
26
|
}
|
|
18
27
|
connectedCallback() {
|
|
19
|
-
|
|
28
|
+
if (devFlags.debug)
|
|
29
|
+
console.debug(`${ListView.name} ⚡️ connect`);
|
|
20
30
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
21
|
-
// this.setAttribute('role', 'listbox')
|
|
22
|
-
// this.setAttribute('aria-multiselectable', 'true')
|
|
23
|
-
// this.#options = Array.from(this.querySelectorAll('[option]'))
|
|
24
|
-
// this.addEventListener('pointerleave', this.#onCancel)
|
|
25
|
-
// this.addEventListener('click', this.#onClick)
|
|
26
|
-
// this.addEventListener('keydown', this.#onKeyDown)
|
|
27
|
-
// this.#updateOptionAttributes()
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A control for presenting a menu of actions.
|
|
3
|
+
*/
|
|
1
4
|
export declare class MenuView extends HTMLElement {
|
|
2
5
|
#private;
|
|
3
6
|
static get observedAttributes(): string[];
|
|
4
7
|
static get template(): DocumentFragment;
|
|
5
8
|
constructor();
|
|
9
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
6
10
|
disconnectedCallback(): void;
|
|
7
11
|
connectedCallback(): void;
|
|
8
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
9
12
|
}
|