@swiftwc/ui 0.0.0-dev.94 → 0.0.0-dev.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/client/index.js +7 -7
- package/generated/components/alert-dialog.d.ts +1 -1
- package/generated/components/alert-dialog.js +1 -1
- package/generated/components/body-view.d.ts +1 -1
- package/generated/components/body-view.js +1 -1
- package/generated/components/confirmation-dialog.d.ts +1 -2
- package/generated/components/confirmation-dialog.js +1 -2
- package/generated/components/content-unavailable.js +11 -11
- package/generated/components/date-picker.js +17 -17
- package/generated/components/disclosure-group.d.ts +4 -1
- package/generated/components/disclosure-group.js +5 -1
- package/generated/components/fine-tooltip.js +2 -1
- package/generated/components/form-view.d.ts +2 -0
- package/generated/components/form-view.js +2 -0
- package/generated/components/h-stack.d.ts +2 -2
- package/generated/components/h-stack.js +2 -2
- package/generated/components/image-view.d.ts +4 -0
- package/generated/components/image-view.js +7 -2
- package/generated/components/label-view.d.ts +7 -3
- package/generated/components/label-view.js +14 -10
- package/generated/components/labeled-content.d.ts +13 -0
- package/generated/components/labeled-content.js +26 -12
- package/generated/components/list-view.d.ts +2 -0
- package/generated/components/list-view.js +2 -0
- package/generated/components/menu-view.js +12 -12
- package/generated/components/navigation-large-title.d.ts +7 -0
- package/generated/components/navigation-large-title.js +7 -0
- package/generated/components/navigation-split-view.d.ts +1 -1
- package/generated/components/navigation-split-view.js +1 -1
- package/generated/components/navigation-stack.d.ts +1 -1
- package/generated/components/navigation-stack.js +1 -1
- package/generated/components/navigation-title.d.ts +5 -0
- package/generated/components/navigation-title.js +7 -1
- package/generated/components/picker-view.d.ts +1 -1
- package/generated/components/picker-view.js +51 -50
- package/generated/components/progress-view.d.ts +1 -1
- package/generated/components/progress-view.js +21 -20
- package/generated/components/scroll-view-proxy.d.ts +1 -1
- package/generated/components/scroll-view-proxy.js +1 -1
- package/generated/components/scroll-view.d.ts +2 -0
- package/generated/components/scroll-view.js +16 -14
- package/generated/components/section-view.js +11 -11
- package/generated/components/sheet-view.d.ts +3 -0
- package/generated/components/sheet-view.js +3 -0
- package/generated/components/sidebar-toggle.d.ts +3 -0
- package/generated/components/sidebar-toggle.js +3 -0
- package/generated/components/sidebar-view.d.ts +3 -0
- package/generated/components/sidebar-view.js +3 -0
- package/generated/components/tab-bar.d.ts +1 -1
- package/generated/components/tab-bar.js +1 -1
- package/generated/components/tab-item.d.ts +3 -0
- package/generated/components/tab-item.js +3 -0
- package/generated/components/tab-view.d.ts +1 -0
- package/generated/components/tab-view.js +1 -0
- package/generated/components/table-view.d.ts +1 -1
- package/generated/components/table-view.js +35 -35
- package/generated/components/text-field.d.ts +2 -0
- package/generated/components/text-field.js +16 -14
- package/generated/components/toggle-view.js +30 -13
- package/generated/components/tool-bar-item-group.d.ts +1 -1
- package/generated/components/tool-bar-item-group.js +1 -1
- package/generated/components/tool-bar-item.d.ts +1 -1
- package/generated/components/tool-bar-item.js +1 -1
- package/generated/components/tool-bar.d.ts +1 -1
- package/generated/components/tool-bar.js +28 -28
- package/generated/components/v-stack.d.ts +2 -2
- package/generated/components/v-stack.js +2 -2
- package/generated/internal/utils/cash/index.d.ts +4 -3
- package/generated/internal/utils/cash/index.js +4 -2
- package/generated/internal/utils/ensure-placeholder.js +2 -1
- package/generated/morphdom/index.d.ts +4 -2
- package/generated/morphdom/index.js +4 -2
- package/generated/morphdom/morph.d.ts +2 -2
- package/generated/morphdom/morph.js +3 -2
- package/generated/morphdom/query-morph.d.ts +2 -2
- package/generated/morphdom/query-morph.js +1 -1
- 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/tpl/html.js +4 -0
- package/generated/tpl/index.d.ts +2 -0
- package/generated/tpl/index.js +2 -0
- package/generated/tpl/is-template-result.d.ts +3 -0
- package/generated/tpl/is-template-result.js +1 -0
- package/package.json +6 -4
- package/web-components.css-data/en.json +28 -0
- package/web-components.html-data/en.json +179 -117
- package/generated/morphdom/html.d.ts +0 -8
- package/generated/morphdom/html.js +0 -37
|
@@ -19,7 +19,7 @@ for (const [k, Ctor] of Object.entries(Components)) {
|
|
|
19
19
|
// const testEl = document.createElement('template')
|
|
20
20
|
// testEl.innerHTML = `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`
|
|
21
21
|
// const testNode = testEl.content.firstElementChild,
|
|
22
|
-
if (!($(`<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
|
|
22
|
+
if (!($(html `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
|
|
23
23
|
polyfills.set(is, Ctor);
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
@@ -119,7 +119,7 @@ const handleHelp = ({ target, relatedTarget }) => {
|
|
|
119
119
|
if (relatedTarget instanceof HTMLElement && trigger.contains(relatedTarget))
|
|
120
120
|
return;
|
|
121
121
|
const newAnchorName = `--help-${self.crypto.randomUUID()}`;
|
|
122
|
-
const tooltip = $(`<fine-tooltip></fine-tooltip>`, '>1');
|
|
122
|
+
const tooltip = $(html `<fine-tooltip></fine-tooltip>`, '>1');
|
|
123
123
|
trigger.style.setProperty('anchor-name', newAnchorName);
|
|
124
124
|
tooltip.style.setProperty('position-anchor', newAnchorName);
|
|
125
125
|
document.body.appendChild(tooltip);
|
|
@@ -236,26 +236,26 @@ export const alert = (title, message, actions, options) => {
|
|
|
236
236
|
};
|
|
237
237
|
export const confirmationDialog = async (trigger, title, message, actions, options) => {
|
|
238
238
|
const newAnchorName = `--confirmation-dialog-${self.crypto.randomUUID()}`;
|
|
239
|
-
const dialog = $(`<dialog is="confirmation-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(`<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
|
|
239
|
+
const dialog = $(html `<dialog is="confirmation-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(html `<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
|
|
240
240
|
trigger.style.setProperty('anchor-name', newAnchorName, 'important'); //$.prop('anchor-name', newAnchorName, trigger, 'important')
|
|
241
241
|
dialog.style.setProperty('position-anchor', newAnchorName); //$.prop('position-anchor', newAnchorName, dialog)
|
|
242
242
|
if (title && false !== options?.titleVisibility) {
|
|
243
|
-
const label = $(`<label-view font="headline"></label-view>`, '>1');
|
|
243
|
+
const label = $(html `<label-view font="headline"></label-view>`, '>1');
|
|
244
244
|
label.setAttribute('title', title);
|
|
245
245
|
vStack.insertAdjacentElement('beforeend', label);
|
|
246
246
|
}
|
|
247
247
|
if (message && false !== options?.titleVisibility) {
|
|
248
|
-
const label = $(`<label-view foreground="secondary" font="callout"></label-view>`, '>1');
|
|
248
|
+
const label = $(html `<label-view foreground="secondary" font="callout"></label-view>`, '>1');
|
|
249
249
|
label.setAttribute('title', message);
|
|
250
250
|
vStack.insertAdjacentElement('beforeend', label);
|
|
251
251
|
}
|
|
252
252
|
for (const [index, action] of (actions ?? []).entries()) {
|
|
253
|
-
const btn = $(`<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
|
|
253
|
+
const btn = $(html `<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
|
|
254
254
|
btn.setAttribute('value', `${index}`);
|
|
255
255
|
if (action?.role)
|
|
256
256
|
btn.setAttribute('role', action.role);
|
|
257
257
|
if (action.label || action.image) {
|
|
258
|
-
const label = $(`<label-view></label-view>`, '>1');
|
|
258
|
+
const label = $(html `<label-view></label-view>`, '>1');
|
|
259
259
|
if (action.label)
|
|
260
260
|
label.setAttribute('title', action.label);
|
|
261
261
|
if (action.image)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DialogBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A
|
|
3
|
+
* @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
|
|
4
4
|
*/
|
|
5
5
|
export declare class AlertDialog extends DialogBase {
|
|
6
6
|
#private;
|
|
@@ -3,7 +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
|
-
* @summary A
|
|
6
|
+
* @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
|
|
7
7
|
*/
|
|
8
8
|
export class AlertDialog extends DialogBase {
|
|
9
9
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { devFlags } from '../internal/utils';
|
|
2
2
|
/**
|
|
3
|
-
* @summary
|
|
3
|
+
* @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
|
|
4
4
|
*/
|
|
5
5
|
export class BodyView extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DialogBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* A
|
|
4
|
-
* Use it from the client module like `await confirmation(trigger, 'Permanently erase the items in the Trash?')`.
|
|
3
|
+
* @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
|
|
5
4
|
*/
|
|
6
5
|
export declare class ConfirmationDialog extends DialogBase {
|
|
7
6
|
#private;
|
|
@@ -3,8 +3,7 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
3
3
|
import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
|
|
4
4
|
import { DialogBase } from '../namespace-browser/base';
|
|
5
5
|
/**
|
|
6
|
-
* A
|
|
7
|
-
* Use it from the client module like `await confirmation(trigger, 'Permanently erase the items in the Trash?')`.
|
|
6
|
+
* @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
|
|
8
7
|
*/
|
|
9
8
|
export class ConfirmationDialog extends DialogBase {
|
|
10
9
|
static get observedAttributes() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { I18n } from '../i18n';
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { $, devFlags, onoff } from '../internal/utils';
|
|
4
|
+
import { html } from '../tpl';
|
|
4
5
|
/**
|
|
5
6
|
* @summary A message with a title and extra information that you show when part of your app can’t be used.
|
|
6
7
|
*
|
|
@@ -23,16 +24,15 @@ export class ContentUnavailable extends HTMLElement {
|
|
|
23
24
|
}
|
|
24
25
|
static #template;
|
|
25
26
|
static get template() {
|
|
26
|
-
return (this.#template ??= $(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>`));
|
|
27
|
+
return (this.#template ??= $(html `<div part="root content-unavailable-title-stack">
|
|
28
|
+
<slot></slot>
|
|
29
|
+
</div>
|
|
30
|
+
<div part="root content-unavailable-description-stack">
|
|
31
|
+
<slot name="description"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="root content-unavailable-actions-stack">
|
|
34
|
+
<slot name="actions"></slot>
|
|
35
|
+
</div>`));
|
|
36
36
|
}
|
|
37
37
|
#shadowRoot;
|
|
38
38
|
#slots;
|
|
@@ -70,7 +70,7 @@ export class ContentUnavailable extends HTMLElement {
|
|
|
70
70
|
console.debug(`${ContentUnavailable.name} ⚡️ connect`);
|
|
71
71
|
}
|
|
72
72
|
#renderSearch = (search) => {
|
|
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'));
|
|
73
|
+
const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(html `<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(html `<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
|
|
74
74
|
if (search) {
|
|
75
75
|
const interpolate = (text, vars) => text.replaceAll(/\{(\w+)\}/g, (_, key) => vars[key] ?? '');
|
|
76
76
|
titleLabel.setAttribute('title', interpolate(I18n.t('SearchUnavailableContent').Label, { search }));
|
|
@@ -4,7 +4,8 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
4
4
|
import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
|
|
5
5
|
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
6
6
|
import { $, clamp, devFlags, kebabCase, onoff, set } from '../internal/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { queryMorph } from '../morphdom';
|
|
8
|
+
import { html } from '../tpl';
|
|
8
9
|
const datePickerStyles = ['graphical', 'field', 'automatic'];
|
|
9
10
|
/**
|
|
10
11
|
* @summary A control that selects an absolute date.
|
|
@@ -18,7 +19,7 @@ export class DatePicker extends FormAssociatedBase {
|
|
|
18
19
|
*/
|
|
19
20
|
'date-picker-style',
|
|
20
21
|
/**
|
|
21
|
-
* @type {
|
|
22
|
+
* @type {boolean}
|
|
22
23
|
*/
|
|
23
24
|
'required',
|
|
24
25
|
'prompt',
|
|
@@ -26,7 +27,7 @@ export class DatePicker extends FormAssociatedBase {
|
|
|
26
27
|
'name',
|
|
27
28
|
'selection',
|
|
28
29
|
/**
|
|
29
|
-
* @type {
|
|
30
|
+
* @type {boolean}
|
|
30
31
|
*/
|
|
31
32
|
'disabled',
|
|
32
33
|
'minimum',
|
|
@@ -53,20 +54,19 @@ export class DatePicker extends FormAssociatedBase {
|
|
|
53
54
|
if (!_a.#templates.has(this.datePickerStyle))
|
|
54
55
|
switch (this.datePickerStyle) {
|
|
55
56
|
default:
|
|
56
|
-
_a.#templates.set(this.datePickerStyle, $(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</label>`));
|
|
57
|
+
_a.#templates.set(this.datePickerStyle, $(html `<label part="root date-picker-stack">
|
|
58
|
+
<div part="root date-picker-label-stack">
|
|
59
|
+
<slot name="label"></slot>
|
|
60
|
+
</div>
|
|
61
|
+
<div part="root date-picker-input-stack">
|
|
62
|
+
<input type="text" name="month" inputmode="numeric" pattern="d*" minlength="1" maxlength="2" min="1" max="12" part="root input date-picker-form-input" />
|
|
63
|
+
<span part="root date-picker-separator"></span>
|
|
64
|
+
<input type="text" name="day" inputmode="numeric" pattern="d*" minlength="1" maxlength="2" min="1" max="31" part="root input date-picker-form-input" />
|
|
65
|
+
<span part="root date-picker-separator"></span>
|
|
66
|
+
<input type="text" name="year" inputmode="numeric" pattern="d*" minlength="4" maxlength="4" min="0" max="9999" part="root input date-picker-form-input" />
|
|
67
|
+
</div>
|
|
68
|
+
<slot name="validity-options" hidden></slot>
|
|
69
|
+
</label>`));
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
return _a.#templates.get(this.datePickerStyle);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { DetailsBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A view that shows or hides another
|
|
3
|
+
* @summary A view that shows or hides another view when the user opens or closes it.
|
|
4
4
|
*
|
|
5
5
|
* @example <details is="disclosure-group"><summary><label-view title="Items"></label-view></summary><label-view title="Item 1"></label-view><label-view title="Item 2"></label-view><details is="disclosure-group"><summary><label-view title="Sub-items"></label-view></summary><label-view title="Sub-item 1"></label-view></details></details>
|
|
6
|
+
*
|
|
7
|
+
* @fires is-expanded
|
|
8
|
+
* @fires is-collapsed
|
|
6
9
|
*/
|
|
7
10
|
export declare class DisclosureGroup extends DetailsBase {
|
|
8
11
|
#private;
|
|
@@ -3,15 +3,19 @@ import { cssTime, devFlags, onoff, timeout } from '../internal/utils';
|
|
|
3
3
|
import { DetailsBase } from '../namespace-browser/base';
|
|
4
4
|
const toggleTimers = new WeakMap();
|
|
5
5
|
/**
|
|
6
|
-
* @summary A view that shows or hides another
|
|
6
|
+
* @summary A view that shows or hides another view when the user opens or closes it.
|
|
7
7
|
*
|
|
8
8
|
* @example <details is="disclosure-group"><summary><label-view title="Items"></label-view></summary><label-view title="Item 1"></label-view><label-view title="Item 2"></label-view><details is="disclosure-group"><summary><label-view title="Sub-items"></label-view></summary><label-view title="Sub-item 1"></label-view></details></details>
|
|
9
|
+
*
|
|
10
|
+
* @fires is-expanded
|
|
11
|
+
* @fires is-collapsed
|
|
9
12
|
*/
|
|
10
13
|
export class DisclosureGroup extends DetailsBase {
|
|
11
14
|
static get observedAttributes() {
|
|
12
15
|
return [
|
|
13
16
|
/**
|
|
14
17
|
* The status of this element
|
|
18
|
+
* @type {boolean}
|
|
15
19
|
*/
|
|
16
20
|
'open',
|
|
17
21
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { $, devFlags, onoff } from '../internal/utils';
|
|
4
|
+
import { html } from '../tpl';
|
|
4
5
|
export class FineTooltip extends HTMLElement {
|
|
5
6
|
constructor() {
|
|
6
7
|
super();
|
|
@@ -40,7 +41,7 @@ export class FineTooltip extends HTMLElement {
|
|
|
40
41
|
return trigger ?? undefined;
|
|
41
42
|
}
|
|
42
43
|
#render = (str) => {
|
|
43
|
-
const label = this.querySelector(':scope>label-view') ?? this.appendChild($(`<label-view></label-view>`, '>1'));
|
|
44
|
+
const label = this.querySelector(':scope>label-view') ?? this.appendChild($(html `<label-view></label-view>`, '>1'));
|
|
44
45
|
if (str)
|
|
45
46
|
label.setAttribute('title', str);
|
|
46
47
|
else
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FormBase } from '../namespace-browser/base';
|
|
2
2
|
/**
|
|
3
|
+
* @summary A container view that groups controls together for entering data, like a settings screen.
|
|
4
|
+
*
|
|
3
5
|
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
4
6
|
*/
|
|
5
7
|
export declare class FormView extends FormBase {
|
|
@@ -2,6 +2,8 @@ import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
|
2
2
|
import { devFlags, listActive, onoff } from '../internal/utils';
|
|
3
3
|
import { FormBase } from '../namespace-browser/base';
|
|
4
4
|
/**
|
|
5
|
+
* @summary A container view that groups controls together for entering data, like a settings screen.
|
|
6
|
+
*
|
|
5
7
|
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
6
8
|
*/
|
|
7
9
|
export class FormView extends FormBase {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @summary A view that arranges its children side by side.
|
|
3
3
|
*
|
|
4
|
-
* @attr {@
|
|
4
|
+
* @attr {@Template} template — The main-axis grid template
|
|
5
5
|
*
|
|
6
|
-
* @attr {@
|
|
6
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
7
7
|
*
|
|
8
8
|
* @attr {@blockSet} alignment — The cross-axis alignment
|
|
9
9
|
* @attr {@inlineSet} distribution — The main-axis alignment
|
|
@@ -2,9 +2,9 @@ import { devFlags } from '../internal/utils';
|
|
|
2
2
|
/**
|
|
3
3
|
* @summary A view that arranges its children side by side.
|
|
4
4
|
*
|
|
5
|
-
* @attr {@
|
|
5
|
+
* @attr {@Template} template — The main-axis grid template
|
|
6
6
|
*
|
|
7
|
-
* @attr {@
|
|
7
|
+
* @attr {@Spacing} spacing — The gap between the primary axis
|
|
8
8
|
*
|
|
9
9
|
* @attr {@blockSet} alignment — The cross-axis alignment
|
|
10
10
|
* @attr {@inlineSet} distribution — The main-axis alignment
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { $, devFlags } from '../internal/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { queryMorph } from '../morphdom';
|
|
3
|
+
import { html } from '../tpl';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A view that displays an image.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
3
8
|
export class ImageView extends HTMLElement {
|
|
4
9
|
static get observedAttributes() {
|
|
5
10
|
return ['system-name', 'system-weight'];
|
|
6
11
|
}
|
|
7
12
|
static #template;
|
|
8
13
|
static get template() {
|
|
9
|
-
return (this.#template ??= $(
|
|
14
|
+
return (this.#template ??= $(html `<slot></slot>`));
|
|
10
15
|
}
|
|
11
16
|
#shadowRoot;
|
|
12
17
|
constructor() {
|
|
@@ -6,10 +6,14 @@
|
|
|
6
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
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
8
|
*
|
|
9
|
-
* @attr {@
|
|
9
|
+
* @attr {@Font} font — Sets the default font for text in this view.
|
|
10
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
|
|
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 --label-gap — The gap between the icon and the title.
|
|
15
|
+
* @cssprop --label-image-size — The size of the icon.
|
|
16
|
+
* @cssprop --label-padding-inline — The padding inline of the label.
|
|
13
17
|
*
|
|
14
18
|
*/
|
|
15
19
|
export declare class LabelView extends HTMLElement {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { $, devFlags } from '../internal/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { queryMorph } from '../morphdom';
|
|
3
|
+
import { html } from '../tpl';
|
|
3
4
|
/**
|
|
4
5
|
* @summary A view that labels items with an icon and a title.
|
|
5
6
|
*
|
|
@@ -8,10 +9,14 @@ import { html, queryMorph } from '../morphdom';
|
|
|
8
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
|
|
9
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
|
|
10
11
|
*
|
|
11
|
-
* @attr {@
|
|
12
|
+
* @attr {@Font} font — Sets the default font for text in this view.
|
|
12
13
|
*
|
|
13
|
-
* @slot — Any children without a `slot` attribute are placed in the title block
|
|
14
|
-
* @slot icon — Use the `slot="icon"` attribute to place childen in the icon block
|
|
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 --label-gap — The gap between the icon and the title.
|
|
18
|
+
* @cssprop --label-image-size — The size of the icon.
|
|
19
|
+
* @cssprop --label-padding-inline — The padding inline of the label.
|
|
15
20
|
*
|
|
16
21
|
*/
|
|
17
22
|
export class LabelView extends HTMLElement {
|
|
@@ -21,17 +26,17 @@ export class LabelView extends HTMLElement {
|
|
|
21
26
|
'title',
|
|
22
27
|
'line-limit',
|
|
23
28
|
/**
|
|
24
|
-
* @type {tail}
|
|
29
|
+
* @type {"tail"}
|
|
25
30
|
*/
|
|
26
31
|
'truncation-mode',
|
|
27
32
|
];
|
|
28
33
|
}
|
|
29
34
|
static #template;
|
|
30
35
|
static get template() {
|
|
31
|
-
return (this.#template ??= $(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
36
|
+
return (this.#template ??= $(html `
|
|
37
|
+
<slot name="icon"></slot>
|
|
38
|
+
<slot></slot>
|
|
39
|
+
`));
|
|
35
40
|
// String.raw`
|
|
36
41
|
// <div part="root label-image-stack">
|
|
37
42
|
// <slot name="image"></slot>
|
|
@@ -39,7 +44,6 @@ export class LabelView extends HTMLElement {
|
|
|
39
44
|
// <div part="root label-title-stack">
|
|
40
45
|
// <slot></slot>
|
|
41
46
|
// </div>`
|
|
42
|
-
));
|
|
43
47
|
}
|
|
44
48
|
#shadowRoot;
|
|
45
49
|
// #reflectScheduled = false
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A container view that pairs a label with a value.
|
|
3
|
+
*
|
|
4
|
+
* @slot — The default slot.
|
|
5
|
+
* @slot label — Use the `slot="label"` attribute to place childen in the label block.
|
|
6
|
+
* @slot header
|
|
7
|
+
* @slot footer
|
|
8
|
+
*
|
|
9
|
+
* @csspart labeled-content-container
|
|
10
|
+
* @csspart labeled-content-stack
|
|
11
|
+
* @csspart labeled-content-label-stack
|
|
12
|
+
* @csspart labeled-content-value-stack
|
|
13
|
+
*/
|
|
1
14
|
export declare class LabeledContent extends HTMLElement {
|
|
2
15
|
#private;
|
|
3
16
|
static get observedAttributes(): string[];
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { $, devFlags } from '../internal/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { queryMorph } from '../morphdom';
|
|
3
|
+
import { html } from '../tpl';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A container view that pairs a label with a value.
|
|
6
|
+
*
|
|
7
|
+
* @slot — The default slot.
|
|
8
|
+
* @slot label — Use the `slot="label"` attribute to place childen in the label block.
|
|
9
|
+
* @slot header
|
|
10
|
+
* @slot footer
|
|
11
|
+
*
|
|
12
|
+
* @csspart labeled-content-container
|
|
13
|
+
* @csspart labeled-content-stack
|
|
14
|
+
* @csspart labeled-content-label-stack
|
|
15
|
+
* @csspart labeled-content-value-stack
|
|
16
|
+
*/
|
|
3
17
|
export class LabeledContent extends HTMLElement {
|
|
4
18
|
static get observedAttributes() {
|
|
5
19
|
return [
|
|
@@ -16,19 +30,19 @@ export class LabeledContent extends HTMLElement {
|
|
|
16
30
|
}
|
|
17
31
|
static #template;
|
|
18
32
|
static get template() {
|
|
19
|
-
return (this.#template ??= $(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
return (this.#template ??= $(html `
|
|
34
|
+
<div part="root labeled-content-container">
|
|
35
|
+
<slot name="header"></slot>
|
|
36
|
+
<div part="root labeled-content-stack">
|
|
37
|
+
<div part="root labeled-content-label-stack">
|
|
38
|
+
<slot name="label"></slot>
|
|
39
|
+
</div>
|
|
40
|
+
<div part="root labeled-content-value-stack">
|
|
41
|
+
<slot></slot>
|
|
42
|
+
</div>
|
|
28
43
|
</div>
|
|
44
|
+
<slot name="footer"></slot>
|
|
29
45
|
</div>
|
|
30
|
-
<slot name="footer"></slot>
|
|
31
|
-
</div>
|
|
32
46
|
`));
|
|
33
47
|
}
|
|
34
48
|
#shadowRoot;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @summary A container view that arranges rows of data in a single column, optionally letting the user select one or more of them.
|
|
3
|
+
*
|
|
2
4
|
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
3
5
|
*/
|
|
4
6
|
export declare class ListView extends HTMLElement {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
2
2
|
import { devFlags, listActive, onoff } from '../internal/utils';
|
|
3
3
|
/**
|
|
4
|
+
* @summary A container view that arranges rows of data in a single column, optionally letting the user select one or more of them.
|
|
5
|
+
*
|
|
4
6
|
* @attr {hidden} navigation-link-indicator-visibility — Hides accessories like right-arrow-chevron on NavigationLink buttons inside.
|
|
5
7
|
*/
|
|
6
8
|
export class ListView extends HTMLElement {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { $, devFlags, onoff, touchGlass } from '../internal/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { queryMorph } from '../morphdom';
|
|
5
|
+
import { html } from '../tpl';
|
|
5
6
|
/**
|
|
6
7
|
* @summary A control that opens a menu of actions.
|
|
7
8
|
*
|
|
@@ -14,17 +15,16 @@ export class MenuView extends HTMLElement {
|
|
|
14
15
|
}
|
|
15
16
|
static #template;
|
|
16
17
|
static get template() {
|
|
17
|
-
return (this.#template ??= $(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</dialog>`));
|
|
18
|
+
return (this.#template ??= $(html `<button type="button" part="root button menu-summary">
|
|
19
|
+
<slot name="label"></slot>
|
|
20
|
+
</button>
|
|
21
|
+
<dialog part="root menu-dialog" autofocus inert>
|
|
22
|
+
<form part="root menu-form" method="dialog" novalidate>
|
|
23
|
+
<div part="root menu-scrollable">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</div>
|
|
26
|
+
</form>
|
|
27
|
+
</dialog>`));
|
|
28
28
|
}
|
|
29
29
|
#shadowRoot;
|
|
30
30
|
#dialog;
|
|
@@ -67,6 +67,13 @@ function isIntersectingWithContainer(el, container, rootMargin = '0px 0px 0px 0p
|
|
|
67
67
|
};
|
|
68
68
|
return !(elRect.bottom < marginRect.top || elRect.top > marginRect.bottom || elRect.right < marginRect.left || elRect.left > marginRect.right);
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @attr {grouped} background-style
|
|
73
|
+
* @attr {boolean} padding
|
|
74
|
+
* @attr {boolean} navigation-bar-auto-hide
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
70
77
|
export class NavigationLargeTitle extends HTMLElement {
|
|
71
78
|
#styleObserver;
|
|
72
79
|
#scrollObserver;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A view with two or three side-by-side
|
|
3
|
+
* @summary A container view with two or three side-by-side screens, where what the user chooses in the left screen changes what appears in the next screen.
|
|
4
4
|
*/
|
|
5
5
|
export declare class NavigationSplitView extends NavigationView {
|
|
6
6
|
constructor();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
2
|
import { devFlags } from '../internal/utils';
|
|
3
3
|
/**
|
|
4
|
-
* @summary A view with two or three side-by-side
|
|
4
|
+
* @summary A container view with two or three side-by-side screens, where what the user chooses in the left screen changes what appears in the next screen.
|
|
5
5
|
*/
|
|
6
6
|
export class NavigationSplitView extends NavigationView {
|
|
7
7
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
2
|
/**
|
|
3
|
-
* @summary A view that shows a main screen and lets
|
|
3
|
+
* @summary A container view that shows a main screen and lets the user open other screens on top of it.
|
|
4
4
|
*/
|
|
5
5
|
export declare class NavigationStack extends NavigationView {
|
|
6
6
|
constructor();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavigationView } from '../internal/class/navigation-view';
|
|
2
2
|
import { devFlags } from '../internal/utils';
|
|
3
3
|
/**
|
|
4
|
-
* @summary A view that shows a main screen and lets
|
|
4
|
+
* @summary A container view that shows a main screen and lets the user open other screens on top of it.
|
|
5
5
|
*/
|
|
6
6
|
export class NavigationStack extends NavigationView {
|
|
7
7
|
constructor() {
|