@swiftwc/ui 0.0.0-dev.92 → 0.0.0-dev.93
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/components/alert-dialog.d.ts +1 -2
- package/generated/components/alert-dialog.js +1 -2
- package/generated/components/body-view.d.ts +3 -0
- package/generated/components/body-view.js +3 -0
- package/generated/components/bordered-button.d.ts +2 -2
- package/generated/components/bordered-button.js +2 -2
- package/generated/components/bordered-prominent-button.d.ts +2 -2
- package/generated/components/bordered-prominent-button.js +2 -2
- package/generated/components/borderless-button.d.ts +2 -2
- package/generated/components/borderless-button.js +2 -2
- package/generated/components/content-unavailable.d.ts +25 -0
- package/generated/components/{content-unavailable-view.js → content-unavailable.js} +8 -8
- package/generated/components/date-picker.d.ts +1 -1
- package/generated/components/date-picker.js +2 -2
- package/generated/components/glass-button.d.ts +2 -2
- package/generated/components/glass-button.js +2 -2
- package/generated/components/glass-prominent-button.d.ts +2 -2
- package/generated/components/glass-prominent-button.js +2 -2
- package/generated/components/h-stack.d.ts +1 -1
- package/generated/components/h-stack.js +1 -1
- package/generated/components/index.d.ts +1 -1
- package/generated/components/index.js +1 -1
- package/generated/components/label-view.d.ts +5 -2
- package/generated/components/label-view.js +7 -4
- package/generated/components/labeled-content.js +3 -3
- package/generated/components/list-view.js +0 -12
- package/generated/components/menu-view.d.ts +1 -1
- package/generated/components/menu-view.js +2 -8
- package/generated/components/navigation-stack.js +0 -2
- package/generated/components/navigation-title.js +0 -9
- package/generated/components/picker-view.d.ts +1 -0
- package/generated/components/picker-view.js +7 -6
- package/generated/components/progress-view.js +1 -1
- package/generated/components/scroll-view.js +0 -1
- package/generated/components/search-view.js +0 -3
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +3 -48
- package/generated/components/sheet-view.js +0 -20
- package/generated/components/sidebar-view.js +1 -1
- package/generated/components/tab-bar.js +0 -3
- package/generated/components/tab-view.js +0 -70
- package/generated/components/table-view.js +2 -2
- package/generated/components/text-field.d.ts +1 -1
- package/generated/components/text-field.js +2 -2
- package/generated/components/toggle-view.d.ts +2 -0
- package/generated/components/toggle-view.js +3 -1
- package/generated/components/v-stack.d.ts +1 -1
- package/generated/components/v-stack.js +1 -1
- package/generated/css/index.css +24 -17
- package/generated/events/scroll-view.js +0 -4
- package/generated/events/text-field.js +0 -3
- package/generated/events/toggle-view.js +0 -3
- package/generated/internal/utils/ensure-placeholder.js +0 -55
- package/package.json +1 -1
- package/scss/_components.scss +1 -1
- package/scss/components/{_content-unavailable-view.scss → _content-unavailable.scss} +1 -1
- package/scss/components/_index.scss +5 -4
- package/scss/components/_labeled-content.scss +8 -0
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_toggle-view.scss +1 -1
- package/web-components.html-data/en.json +27 -21
- package/generated/components/content-unavailable-view.d.ts +0 -25
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DialogBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* A representation of an alert presentation.
|
|
4
|
-
* Use it from the client module like `void alert('Save failed.')`.
|
|
3
|
+
* @summary A representation of an alert presentation. Use it from the client module like `void alert('Save failed.')`.
|
|
5
4
|
*/
|
|
6
5
|
export declare class AlertDialog extends DialogBase {
|
|
7
6
|
#private;
|
|
@@ -3,8 +3,7 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
3
3
|
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
4
4
|
import { DialogBase } from '../namespace-browser/base';
|
|
5
5
|
/**
|
|
6
|
-
* A representation of an alert presentation.
|
|
7
|
-
* Use it from the client module like `void alert('Save failed.')`.
|
|
6
|
+
* @summary A representation of an alert presentation. Use it from the client module like `void alert('Save failed.')`.
|
|
8
7
|
*/
|
|
9
8
|
export class AlertDialog extends DialogBase {
|
|
10
9
|
constructor() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A control that
|
|
3
|
+
* @summary A control that starts an action. Styled with a standard border, adapting to the button’s surroundings.
|
|
4
4
|
*
|
|
5
|
-
* @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a
|
|
5
|
+
* @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a bordered button
|
|
6
6
|
*
|
|
7
7
|
* @slot overlay
|
|
8
8
|
*
|
|
@@ -3,9 +3,9 @@ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
|
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control that
|
|
6
|
+
* @summary A control that starts an action. Styled with a standard border, adapting to the button’s surroundings.
|
|
7
7
|
*
|
|
8
|
-
* @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a
|
|
8
|
+
* @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a bordered button
|
|
9
9
|
*
|
|
10
10
|
* @slot overlay
|
|
11
11
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A control that
|
|
3
|
+
* @summary A control that starts an action. Styled with a prominent border, adapting to the button’s surroundings.
|
|
4
4
|
*
|
|
5
|
-
* @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
5
|
+
* @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent bordered button
|
|
6
6
|
*
|
|
7
7
|
* @slot overlay
|
|
8
8
|
*
|
|
@@ -3,9 +3,9 @@ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
|
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control that
|
|
6
|
+
* @summary A control that starts an action. Styled with a prominent border, adapting to the button’s surroundings.
|
|
7
7
|
*
|
|
8
|
-
* @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
8
|
+
* @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent bordered button
|
|
9
9
|
*
|
|
10
10
|
* @slot overlay
|
|
11
11
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A control that
|
|
3
|
+
* @summary A control that starts an action. Styled without any borders.
|
|
4
4
|
*
|
|
5
|
-
* @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
5
|
+
* @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
|
|
6
6
|
*
|
|
7
7
|
* @slot overlay
|
|
8
8
|
*
|
|
@@ -3,9 +3,9 @@ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
|
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control that
|
|
6
|
+
* @summary A control that starts an action. Styled without any borders.
|
|
7
7
|
*
|
|
8
|
-
* @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
8
|
+
* @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
|
|
9
9
|
*
|
|
10
10
|
* @slot overlay
|
|
11
11
|
*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
3
|
+
*
|
|
4
|
+
* @example <content-unavailable search></content-unavailable>
|
|
5
|
+
*
|
|
6
|
+
* @example <content-unavailable search="foo"></content-unavailable>
|
|
7
|
+
*
|
|
8
|
+
* @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
9
|
+
*
|
|
10
|
+
* @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
11
|
+
*
|
|
12
|
+
* @slot — The default slot.
|
|
13
|
+
* @slot description
|
|
14
|
+
* @slot actions
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare class ContentUnavailable extends HTMLElement {
|
|
18
|
+
#private;
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
|
+
static get template(): DocumentFragment;
|
|
21
|
+
constructor();
|
|
22
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
connectedCallback(): void;
|
|
25
|
+
}
|
|
@@ -4,20 +4,20 @@ import { $, devFlags, onoff } from '../internal/utils';
|
|
|
4
4
|
/**
|
|
5
5
|
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
6
6
|
*
|
|
7
|
-
* @example <content-unavailable
|
|
7
|
+
* @example <content-unavailable search></content-unavailable>
|
|
8
8
|
*
|
|
9
|
-
* @example <content-unavailable
|
|
9
|
+
* @example <content-unavailable search="foo"></content-unavailable>
|
|
10
10
|
*
|
|
11
|
-
* @example <content-unavailable
|
|
11
|
+
* @example <content-unavailable padding><label-view title="No Mail"><i class="ph ph-tray" slot="icon" foreground="secondary"></i></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
12
12
|
*
|
|
13
|
-
* @example <content-unavailable
|
|
13
|
+
* @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
|
|
14
14
|
*
|
|
15
15
|
* @slot — The default slot.
|
|
16
16
|
* @slot description
|
|
17
17
|
* @slot actions
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
export class
|
|
20
|
+
export class ContentUnavailable extends HTMLElement {
|
|
21
21
|
static get observedAttributes() {
|
|
22
22
|
return ['search'];
|
|
23
23
|
}
|
|
@@ -48,7 +48,7 @@ export class ContentUnavailableView extends HTMLElement {
|
|
|
48
48
|
}
|
|
49
49
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
50
50
|
if (devFlags.debug)
|
|
51
|
-
console.debug(`${
|
|
51
|
+
console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
52
52
|
switch (name) {
|
|
53
53
|
case 'search':
|
|
54
54
|
if (oldValue === newValue)
|
|
@@ -63,11 +63,11 @@ export class ContentUnavailableView extends HTMLElement {
|
|
|
63
63
|
}
|
|
64
64
|
disconnectedCallback() {
|
|
65
65
|
if (devFlags.debug)
|
|
66
|
-
console.debug(`${
|
|
66
|
+
console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
|
|
67
67
|
}
|
|
68
68
|
connectedCallback() {
|
|
69
69
|
if (devFlags.debug)
|
|
70
|
-
console.debug(`${
|
|
70
|
+
console.debug(`${ContentUnavailable.name} ⚡️ connect`);
|
|
71
71
|
}
|
|
72
72
|
#renderSearch = (search) => {
|
|
73
73
|
const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(`<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
|
|
@@ -2,7 +2,7 @@ import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
|
2
2
|
declare const datePickerStyles: readonly ["graphical", "field", "automatic"];
|
|
3
3
|
export type DatePickerStyle = (typeof datePickerStyles)[number];
|
|
4
4
|
/**
|
|
5
|
-
* @summary A control
|
|
5
|
+
* @summary A control that selects an absolute date.
|
|
6
6
|
*/
|
|
7
7
|
export declare class DatePicker extends FormAssociatedBase {
|
|
8
8
|
#private;
|
|
@@ -7,7 +7,7 @@ import { $, clamp, devFlags, kebabCase, onoff, set } from '../internal/utils';
|
|
|
7
7
|
import { html, queryMorph } from '../morphdom';
|
|
8
8
|
const datePickerStyles = ['graphical', 'field', 'automatic'];
|
|
9
9
|
/**
|
|
10
|
-
* @summary A control
|
|
10
|
+
* @summary A control that selects an absolute date.
|
|
11
11
|
*/
|
|
12
12
|
export class DatePicker extends FormAssociatedBase {
|
|
13
13
|
static get observedAttributes() {
|
|
@@ -93,7 +93,7 @@ export class DatePicker extends FormAssociatedBase {
|
|
|
93
93
|
input.setAttribute('placeholder', map[input.name] ?? '');
|
|
94
94
|
break;
|
|
95
95
|
case 'label':
|
|
96
|
-
queryMorph('[slot=label]', html `<label-view slot="label" foreground="secondary">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
96
|
+
queryMorph('[slot=label]', html `<label-view slot="label" foreground="secondary">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
97
97
|
// this.#sendValueToForm()
|
|
98
98
|
break;
|
|
99
99
|
case 'disabled':
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A control that
|
|
3
|
+
* @summary A control that starts an action. Styled with a glass border, adapting to the button’s surroundings.
|
|
4
4
|
*
|
|
5
|
-
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
5
|
+
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a glass button
|
|
6
6
|
*
|
|
7
7
|
* @slot overlay
|
|
8
8
|
*
|
|
@@ -3,9 +3,9 @@ import { devFlags, ensurePlaceholder, onoff, touchGlass } from '../internal/util
|
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control that
|
|
6
|
+
* @summary A control that starts an action. Styled with a glass border, adapting to the button’s surroundings.
|
|
7
7
|
*
|
|
8
|
-
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
8
|
+
* @example <button is="glass-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a glass button
|
|
9
9
|
*
|
|
10
10
|
* @slot overlay
|
|
11
11
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ButtonBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A control that
|
|
3
|
+
* @summary A control that starts an action. Styled with a prominent glass border, adapting to the button’s surroundings.
|
|
4
4
|
*
|
|
5
|
-
* @example <button is="glass-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
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
6
|
*
|
|
7
7
|
* @slot overlay
|
|
8
8
|
*
|
|
@@ -3,9 +3,9 @@ import { devFlags, ensurePlaceholder, onoff, touchGlass } from '../internal/util
|
|
|
3
3
|
import { ButtonBase } from '../namespace-browser/base';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control that
|
|
6
|
+
* @summary A control that starts an action. Styled with a prominent glass border, adapting to the button’s surroundings.
|
|
7
7
|
*
|
|
8
|
-
* @example <button is="glass-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button>
|
|
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
9
|
*
|
|
10
10
|
* @slot overlay
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ export * from './bordered-prominent-button';
|
|
|
5
5
|
export * from './borderless-button';
|
|
6
6
|
export * from './color-scheme';
|
|
7
7
|
export * from './confirmation-dialog';
|
|
8
|
-
export * from './content-unavailable
|
|
8
|
+
export * from './content-unavailable';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './disclosure-group';
|
|
11
11
|
export * from './fine-tooltip';
|
|
@@ -5,7 +5,7 @@ export * from './bordered-prominent-button';
|
|
|
5
5
|
export * from './borderless-button';
|
|
6
6
|
export * from './color-scheme';
|
|
7
7
|
export * from './confirmation-dialog';
|
|
8
|
-
export * from './content-unavailable
|
|
8
|
+
export * from './content-unavailable';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './disclosure-group';
|
|
11
11
|
export * from './fine-tooltip';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @summary A view that labels items with an icon and a title.
|
|
3
|
+
*
|
|
4
|
+
* @example <label-view system-image="hand-tap"><span>Hello</span></label-view> — Creating a label with an icon image and a title
|
|
2
5
|
*
|
|
3
6
|
* @attr {@fontSet} font — Sets the default font for text in this view.
|
|
4
7
|
*
|
|
5
|
-
* @slot —
|
|
6
|
-
* @slot icon
|
|
8
|
+
* @slot — Place children without a `slot` attribute inside the main block of the label.
|
|
9
|
+
* @slot icon — Place children with a `slot="icon"` attribute in the icon block of the label.
|
|
7
10
|
*
|
|
8
11
|
*/
|
|
9
12
|
export declare class LabelView extends HTMLElement {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { $, devFlags } from '../internal/utils';
|
|
2
2
|
import { html, queryMorph } from '../morphdom';
|
|
3
3
|
/**
|
|
4
|
+
* @summary A view that labels items with an icon and a title.
|
|
5
|
+
*
|
|
6
|
+
* @example <label-view system-image="hand-tap"><span>Hello</span></label-view> — Creating a label with an icon image and a title
|
|
4
7
|
*
|
|
5
8
|
* @attr {@fontSet} font — Sets the default font for text in this view.
|
|
6
9
|
*
|
|
7
|
-
* @slot —
|
|
8
|
-
* @slot icon
|
|
10
|
+
* @slot — Place children without a `slot` attribute inside the main block of the label.
|
|
11
|
+
* @slot icon — Place children with a `slot="icon"` attribute in the icon block of the label.
|
|
9
12
|
*
|
|
10
13
|
*/
|
|
11
14
|
export class LabelView extends HTMLElement {
|
|
@@ -51,10 +54,10 @@ export class LabelView extends HTMLElement {
|
|
|
51
54
|
// )
|
|
52
55
|
// break
|
|
53
56
|
case 'system-image':
|
|
54
|
-
queryMorph('[slot=icon]', html `<image-view slot="icon" system-name="${newValue}"></image-view>`, this, { removeIf: !newValue });
|
|
57
|
+
queryMorph('[slot=icon]', html `<image-view slot="icon" system-name="${newValue}"></image-view>`, this, { removeIf: !newValue });
|
|
55
58
|
break;
|
|
56
59
|
case 'title':
|
|
57
|
-
queryMorph(':not([slot])', html `<span>${newValue}</span>`, this, { removeIf: !newValue });
|
|
60
|
+
queryMorph(':not([slot])', html `<span>${newValue}</span>`, this, { removeIf: !newValue });
|
|
58
61
|
break;
|
|
59
62
|
}
|
|
60
63
|
}
|
|
@@ -71,16 +71,16 @@ export class LabeledContent extends HTMLElement {
|
|
|
71
71
|
break;
|
|
72
72
|
case 'value': {
|
|
73
73
|
const val = this.#fmt(newValue, this.getAttribute('format'));
|
|
74
|
-
queryMorph('label-view:not([slot])', html `<label-view>${val ? html `<span>${val}</span>` : null}</label-view>`, this);
|
|
74
|
+
queryMorph('label-view:not([slot])', html `<label-view>${val ? html `<span>${val}</span>` : null}</label-view>`, this);
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
case 'format': {
|
|
78
78
|
const val = this.#fmt(this.getAttribute('value'), newValue);
|
|
79
|
-
queryMorph('label-view:not([slot])', html `<label-view>${val ? html `<span>${val}</span>` : null}</label-view>`, this);
|
|
79
|
+
queryMorph('label-view:not([slot])', html `<label-view>${val ? html `<span>${val}</span>` : null}</label-view>`, this);
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
82
|
case 'label':
|
|
83
|
-
queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
83
|
+
queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -4,20 +4,8 @@ import { devFlags, listActive, onoff } from '../internal/utils';
|
|
|
4
4
|
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
5
5
|
*/
|
|
6
6
|
export class ListView extends HTMLElement {
|
|
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
|
|
17
7
|
constructor() {
|
|
18
8
|
super();
|
|
19
|
-
// this.#shadowRoot = this.attachShadow({ mode: 'closed' })
|
|
20
|
-
// this.#shadowRoot.appendChild(document.importNode((this.constructor as typeof ListView).template, true))
|
|
21
9
|
}
|
|
22
10
|
disconnectedCallback() {
|
|
23
11
|
if (devFlags.debug)
|
|
@@ -3,7 +3,7 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
3
3
|
import { $, devFlags, onoff, touchGlass } from '../internal/utils';
|
|
4
4
|
import { html, queryMorph } from '../morphdom';
|
|
5
5
|
/**
|
|
6
|
-
* @summary A control
|
|
6
|
+
* @summary A control that opens a menu of actions.
|
|
7
7
|
*
|
|
8
8
|
* @slot — The default slot.
|
|
9
9
|
* @slot label
|
|
@@ -62,19 +62,13 @@ export class MenuView extends HTMLElement {
|
|
|
62
62
|
}
|
|
63
63
|
break;
|
|
64
64
|
case 'label':
|
|
65
|
-
queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
65
|
+
queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
disconnectedCallback() {
|
|
70
70
|
if (devFlags.debug)
|
|
71
71
|
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
72
|
-
// const dialog = this.#shadowRoot.querySelector('dialog'),
|
|
73
|
-
// trigger = this.#shadowRoot.querySelector('button')
|
|
74
|
-
// trigger?.removeEventListener('click', this.#handleTriggerClick)
|
|
75
|
-
// dialog?.removeEventListener('click', this.#handleDialogClick)
|
|
76
|
-
// dialog?.removeEventListener('close', this.#handleDialogClose)
|
|
77
|
-
// dialog?.removeEventListener('cancel', this.#handleDialogCancel)
|
|
78
72
|
const summaryPart = this.#shadowRoot.querySelector('[part*=menu-summary]'), dialogPart = this.#shadowRoot.querySelector('[part*=menu-dialog]');
|
|
79
73
|
summaryPart?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, summaryPart)
|
|
80
74
|
dialogPart?.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, dialogPart)
|
|
@@ -11,12 +11,10 @@ export class NavigationStack extends NavigationView {
|
|
|
11
11
|
if (devFlags.debug)
|
|
12
12
|
console.debug(`${NavigationStack.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
|
|
13
13
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
14
|
-
// Snapshot.waitReady.then(() => {
|
|
15
14
|
switch (name) {
|
|
16
15
|
case 'hidden':
|
|
17
16
|
break;
|
|
18
17
|
}
|
|
19
|
-
// })
|
|
20
18
|
}
|
|
21
19
|
disconnectedCallback() {
|
|
22
20
|
if (devFlags.debug)
|
|
@@ -29,8 +29,6 @@ let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElem
|
|
|
29
29
|
console.debug(`${NavigationTitle_1.name} ⚡️ connect`);
|
|
30
30
|
}
|
|
31
31
|
#render = (title, subtitle, systemImage, systemImageWeight) => {
|
|
32
|
-
// const container = this.querySelector(':scope>:not([slot])') ?? this.appendChild(document.createElement('navigation-large-title'))
|
|
33
|
-
// render(template, container)
|
|
34
32
|
queryMorph(':not([slot])', html `
|
|
35
33
|
<navigation-large-title>
|
|
36
34
|
<v-stack alignment="fill">
|
|
@@ -50,13 +48,6 @@ let NavigationTitle = NavigationTitle_1 = class NavigationTitle extends HTMLElem
|
|
|
50
48
|
</v-stack>
|
|
51
49
|
</navigation-large-title>
|
|
52
50
|
`, this);
|
|
53
|
-
// const titleTemplate = `<label-view line-limit="1" truncation-mode="tail" font="headline"><span></span></label-view>`,
|
|
54
|
-
// subtitleTemplate = `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span></span></label-view>`,
|
|
55
|
-
// vStactTemplate = `<v-stack spacing="0" alignment="fill">${titleTemplate}${subtitleTemplate}</v-stack>`
|
|
56
|
-
// const el = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(`<navigation-large-title>${vStactTemplate}</navigation-large-title>`, '>1')),
|
|
57
|
-
// vStack = el.querySelector(':scope>v-stack') ?? el.appendChild($(vStactTemplate, '>1'))
|
|
58
|
-
// renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title)
|
|
59
|
-
// renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle)
|
|
60
51
|
};
|
|
61
52
|
};
|
|
62
53
|
NavigationTitle = NavigationTitle_1 = __decorate([
|
|
@@ -116,6 +116,7 @@ const indexGroups = (nodes, parentPath = '') => {
|
|
|
116
116
|
};
|
|
117
117
|
const collectLeafValues = (node) => (node.children.length ? node.children.flatMap(collectLeafValues) : [node.value]);
|
|
118
118
|
/**
|
|
119
|
+
* @summary A control that selects one value from a set of options.
|
|
119
120
|
*
|
|
120
121
|
* @attr {menu|inline|navigation-link|sheet|automatic} picker-style
|
|
121
122
|
*
|
|
@@ -437,7 +438,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
437
438
|
const value = this.getAttribute(this.constructor.ATTR.LABEL);
|
|
438
439
|
if (value) {
|
|
439
440
|
const hStack = $(`<h-stack distribution="leading" template="auto spacer"><label-view data-role="check" style="visibility: hidden"><image-view slot="icon" system-name="check"></image-view></label-view><label-view><span></span></label-view></h-stack>`, '>1');
|
|
440
|
-
queryMorph('label-view:nth-child(2)', htmx `<label-view>${value ? htmx `<span>${value}</span>` : null}</label-view>`, hStack);
|
|
441
|
+
queryMorph('label-view:nth-child(2)', htmx `<label-view>${value ? htmx `<span>${value}</span>` : null}</label-view>`, hStack);
|
|
441
442
|
// if (label) renderLabelTitle(label, value) //label.setAttribute('title', value)
|
|
442
443
|
section.insertAdjacentElement('beforeend', hStack);
|
|
443
444
|
}
|
|
@@ -984,7 +985,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
984
985
|
#reflectLabel(value) {
|
|
985
986
|
if (devFlags.debug)
|
|
986
987
|
console.debug(`${_a.name} #reflectLabel`);
|
|
987
|
-
queryMorph('[slot=label]', htmx `<label-view slot="label">${value ? htmx `<span>${value}</span>` : null}</label-view>`, this);
|
|
988
|
+
queryMorph('[slot=label]', htmx `<label-view slot="label">${value ? htmx `<span>${value}</span>` : null}</label-view>`, this);
|
|
988
989
|
this.#renderSlotted([]);
|
|
989
990
|
}
|
|
990
991
|
#reflectSelectionOnButtons() {
|
|
@@ -1032,8 +1033,8 @@ export class PickerView extends FormAssociatedBase {
|
|
|
1032
1033
|
// if (!cvl) currentValueLabel.setAttribute('foreground', 'secondary')
|
|
1033
1034
|
// else currentValueLabel.removeAttribute('foreground')
|
|
1034
1035
|
const title = this.#currentValueLabel || this.#selection || this.getAttribute(this.constructor.ATTR.PLACEHOLDER), systemImage = this.#currentValueIcon || this.getAttribute(this.constructor.ATTR.PLACEHOLDER_ICON);
|
|
1035
|
-
queryMorph(':not([slot])', htmx `<span>${title}</span>`, currentValueLabel, { removeIf: !title });
|
|
1036
|
-
queryMorph('[slot=icon]', htmx `<image-view slot="icon" system-name="${systemImage}"></image-view>`, currentValueLabel, { removeIf: !systemImage });
|
|
1036
|
+
queryMorph(':not([slot])', htmx `<span>${title}</span>`, currentValueLabel, { removeIf: !title });
|
|
1037
|
+
queryMorph('[slot=icon]', htmx `<image-view slot="icon" system-name="${systemImage}"></image-view>`, currentValueLabel, { removeIf: !systemImage });
|
|
1037
1038
|
// morph(
|
|
1038
1039
|
// htmx`<label-view>${systemImage ? htmx`<image-view slot="icon" system-name="${systemImage}"></image-view>` : null}${title ? htmx`<span>${title}</span>` : null}</label-view>`,
|
|
1039
1040
|
// currentValueLabel
|
|
@@ -1047,8 +1048,8 @@ export class PickerView extends FormAssociatedBase {
|
|
|
1047
1048
|
// if (!cvl) currentValueLabel.setAttribute('foreground', 'secondary')
|
|
1048
1049
|
// else currentValueLabel.removeAttribute('foreground')
|
|
1049
1050
|
const title = this.#currentValueLabel || this.#selection || this.getAttribute(this.constructor.ATTR.PLACEHOLDER), systemImage = this.#currentValueIcon || this.getAttribute(this.constructor.ATTR.PLACEHOLDER_ICON);
|
|
1050
|
-
queryMorph(':not([slot])', htmx `<span>${title}</span>`, currentValueLabel, { removeIf: !title });
|
|
1051
|
-
queryMorph('[slot=icon]', htmx `<image-view slot="icon" system-name="${systemImage}"></image-view>`, currentValueLabel, { removeIf: !systemImage });
|
|
1051
|
+
queryMorph(':not([slot])', htmx `<span>${title}</span>`, currentValueLabel, { removeIf: !title });
|
|
1052
|
+
queryMorph('[slot=icon]', htmx `<image-view slot="icon" system-name="${systemImage}"></image-view>`, currentValueLabel, { removeIf: !systemImage });
|
|
1052
1053
|
// morph(
|
|
1053
1054
|
// htmx`<label-view slot="label">${systemImage ? htmx`<image-view slot="icon" system-name="${systemImage}"></image-view>` : null}${title ? htmx`<span>${title}</span>` : null}</label-view>`,
|
|
1054
1055
|
// currentValueLabel
|
|
@@ -72,7 +72,7 @@ export class ProgressView extends HTMLElement {
|
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case 'current-value-label': {
|
|
75
|
-
queryMorph('[slot=current-value]', html `<label-view slot="current-value" font="callout" foreground="secondary">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
75
|
+
queryMorph('[slot=current-value]', html `<label-view slot="current-value" font="callout" foreground="secondary">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -2,9 +2,6 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
2
2
|
import { devFlags, onoff, touchGlass } from '../internal/utils';
|
|
3
3
|
import { InputBase } from '../namespace-browser/base';
|
|
4
4
|
export class SearchView extends InputBase {
|
|
5
|
-
// static get observedAttributes() {
|
|
6
|
-
// return ['role', 'title-key']
|
|
7
|
-
// }
|
|
8
5
|
constructor() {
|
|
9
6
|
super();
|
|
10
7
|
}
|