@swiftwc/ui 0.0.0-dev.85 → 0.0.0-dev.87

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.
Files changed (84) hide show
  1. package/generated/client/index.d.ts +3 -0
  2. package/generated/client/index.js +3 -0
  3. package/generated/components/alert-dialog.d.ts +4 -0
  4. package/generated/components/alert-dialog.js +4 -0
  5. package/generated/components/bordered-button.js +1 -1
  6. package/generated/components/bordered-prominent-button.js +1 -1
  7. package/generated/components/borderless-button.js +1 -1
  8. package/generated/components/confirmation-dialog.d.ts +4 -0
  9. package/generated/components/confirmation-dialog.js +4 -0
  10. package/generated/components/date-picker.js +4 -3
  11. package/generated/components/glass-button.js +1 -1
  12. package/generated/components/glass-prominent-button.js +1 -1
  13. package/generated/components/h-stack.d.ts +6 -3
  14. package/generated/components/h-stack.js +6 -3
  15. package/generated/components/image-view.js +10 -11
  16. package/generated/components/label-view.d.ts +2 -0
  17. package/generated/components/label-view.js +15 -10
  18. package/generated/components/labeled-content.js +43 -23
  19. package/generated/components/menu-view.d.ts +2 -0
  20. package/generated/components/menu-view.js +5 -2
  21. package/generated/components/navigation-title.js +22 -16
  22. package/generated/components/picker-view.d.ts +2 -0
  23. package/generated/components/picker-view.js +15 -8
  24. package/generated/components/progress-view.d.ts +2 -0
  25. package/generated/components/progress-view.js +6 -3
  26. package/generated/components/scroll-view.d.ts +4 -0
  27. package/generated/components/scroll-view.js +30 -7
  28. package/generated/components/section-view.d.ts +4 -0
  29. package/generated/components/section-view.js +37 -17
  30. package/generated/components/table-view.d.ts +8 -0
  31. package/generated/components/table-view.js +13 -6
  32. package/generated/components/text-field.js +3 -2
  33. package/generated/components/toggle-view.js +3 -2
  34. package/generated/components/tool-bar-item.js +2 -2
  35. package/generated/components/v-stack.d.ts +6 -4
  36. package/generated/components/v-stack.js +6 -4
  37. package/generated/css/index.css +242 -11
  38. package/generated/internal/utils/ensure-placeholder.d.ts +1 -1
  39. package/generated/internal/utils/ensure-placeholder.js +8 -9
  40. package/generated/internal/utils/index.d.ts +0 -3
  41. package/generated/internal/utils/index.js +0 -3
  42. package/generated/internal/vendor/morphdom.d.ts +6 -0
  43. package/generated/internal/vendor/morphdom.js +720 -0
  44. package/generated/morphdom/html.d.ts +8 -0
  45. package/generated/morphdom/html.js +37 -0
  46. package/generated/morphdom/index.d.ts +6 -0
  47. package/generated/morphdom/index.js +6 -0
  48. package/generated/morphdom/morph.d.ts +4 -0
  49. package/generated/morphdom/morph.js +9 -0
  50. package/generated/morphdom/query-morph.d.ts +5 -0
  51. package/generated/morphdom/query-morph.js +12 -0
  52. package/package.json +5 -3
  53. package/scss/_maps.scss +256 -0
  54. package/scss/_vars.scss +2 -115
  55. package/scss/base/_root.scss +6 -5
  56. package/scss/colors/_index.scss +2 -2
  57. package/scss/components/_bordered-button.scss +2 -1
  58. package/scss/components/_bordered-prominent-button.scss +2 -1
  59. package/scss/components/_disclosure-group.scss +1 -1
  60. package/scss/components/_form-view.scss +3 -2
  61. package/scss/components/_glass-button.scss +2 -1
  62. package/scss/components/_glass-prominent-button.scss +2 -1
  63. package/scss/components/_h-stack.scss +4 -21
  64. package/scss/components/_label-view.scss +11 -10
  65. package/scss/components/_list-view.scss +3 -2
  66. package/scss/components/_picker-view.scss +5 -4
  67. package/scss/components/_scroll-view-proxy.scss +2 -2
  68. package/scss/components/_table-view.scss +3 -2
  69. package/scss/components/_toggle-view.scss +1 -1
  70. package/scss/components/_v-stack.scss +3 -4
  71. package/scss/mixins/_color.scss +2 -2
  72. package/scss/mixins/_index.scss +2 -2
  73. package/scss/placeholders/_buttons.scss +2 -1
  74. package/scss/utils/_frame.scss +1 -1
  75. package/scss/utils/_scroll-view.scss +1 -1
  76. package/scss/utils/_spacing.scss +1 -1
  77. package/scss/utils/_stacks.scss +8 -99
  78. package/web-components.html-data/en.json +460 -36
  79. package/generated/internal/utils/render-label-icon.d.ts +0 -2
  80. package/generated/internal/utils/render-label-icon.js +0 -19
  81. package/generated/internal/utils/render-label-title.d.ts +0 -2
  82. package/generated/internal/utils/render-label-title.js +0 -16
  83. package/generated/internal/utils/render-label.d.ts +0 -1
  84. package/generated/internal/utils/render-label.js +0 -19
@@ -3,11 +3,15 @@ import { lifecycleObserver } from '../buses';
3
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
4
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
5
5
  import { $, devFlags, frame, onoff, slowHideShow } from '../internal/utils';
6
- import { html, render } from '../tpl';
6
+ import { html, queryMorph } from '../morphdom';
7
7
  const observers = new ResizeObserverSingleton();
8
+ /**
9
+ * @slot top-bar-principal
10
+ * @slot bottom-bar-principal
11
+ */
8
12
  export class ScrollView extends HTMLElement {
9
13
  static get observedAttributes() {
10
- return ['navigation-title', 'navigation-inline-title', 'navigation-inline-subtitle', 'navigation-bar-title-display-mode'];
14
+ return ['navigation-title', 'navigation-inline-title', 'navigation-inline-subtitle', 'navigation-icon', 'navigation-bar-title-display-mode'];
11
15
  }
12
16
  static #template;
13
17
  static get template() {
@@ -51,9 +55,12 @@ export class ScrollView extends HTMLElement {
51
55
  case 'navigation-inline-subtitle':
52
56
  this.#renderNavTitle(this.getAttribute('navigation-inline-title'), newValue);
53
57
  break;
54
- case 'navigation-title':
55
- //
58
+ case 'navigation-title': {
59
+ if (oldValue === newValue)
60
+ return;
61
+ this.#renderNavTitleComponent(newValue, null, this.getAttribute('navigation-icon'));
56
62
  break;
63
+ }
57
64
  case 'navigation-bar-title-display-mode':
58
65
  if (oldValue === newValue)
59
66
  break;
@@ -193,11 +200,27 @@ export class ScrollView extends HTMLElement {
193
200
  // this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal">${titleTemplate}${subtitleTemplate}</v-stack>`, '>1'))
194
201
  // renderLabel(':scope>label-view:nth-child(1)', titleTemplate, vStack, title)
195
202
  // renderLabel(':scope>label-view:nth-child(2)', subtitleTemplate, vStack, subtitle)
196
- const container = this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal"></v-stack>`, '>1'));
197
- render(html `
203
+ // const container = this.querySelector(':scope>[slot=top-bar-principal]') ?? this.appendChild($(`<v-stack spacing="0" alignment="fill" slot="top-bar-principal"></v-stack>`, '>1'))
204
+ queryMorph('[slot=top-bar-principal]', html `<v-stack spacing="0" alignment="fill" slot="top-bar-principal">
198
205
  ${title ? html `<label-view line-limit="1" truncation-mode="tail" font="headline"><span>${title}</span></label-view>` : null}
199
206
  ${subtitle ? html `<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span>${subtitle}</span></label-view>` : null}
200
- `, container);
207
+ </v-stack>`, this);
208
+ // render(
209
+ // html`
210
+ // ${title ? html`<label-view line-limit="1" truncation-mode="tail" font="headline"><span>${title}</span></label-view>` : null}
211
+ // ${subtitle ? html`<label-view line-limit="1" truncation-mode="tail" foreground="secondary" font="callout"><span>${subtitle}</span></label-view>` : null}
212
+ // `,
213
+ // container
214
+ // )
215
+ };
216
+ #renderNavTitleComponent = (title, subtitle, icon) => {
217
+ if (!title)
218
+ return this.querySelector(':scope>v-stack>navigation-title:not([slot])')?.remove?.();
219
+ // const container = ((vs = this.querySelector<HTMLElement>(':scope>v-stack') ?? (this.appendChild($(`<v-stack></v-stack>`, '>1')) as HTMLElement)) =>
220
+ // vs.querySelector<HTMLElement>(':scope>navigation-title:not([slot])') ??
221
+ // vs.appendChild($(html`<navigation-title value="${title}" subtitle="${subtitle}" system-image="${icon}" padding></navigation-title>`.toString(), '>1')))()
222
+ const container = this.querySelector(':scope>v-stack') ?? this.appendChild($(`<v-stack></v-stack>`, '>1'));
223
+ queryMorph('navigation-title:not([slot])', html `<navigation-title value="${title}" subtitle="${subtitle}" system-image="${icon}" padding></navigation-title>`, container);
201
224
  };
202
225
  }
203
226
  _a = ScrollView;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @slot header
3
+ * @slot footer
4
+ */
1
5
  export declare class SectionView extends HTMLElement {
2
6
  #private;
3
7
  static get observedAttributes(): string[];
@@ -1,5 +1,9 @@
1
1
  import { $, devFlags } from '../internal/utils';
2
- import { html, render } from '../tpl';
2
+ import { html, queryMorph } from '../morphdom';
3
+ /**
4
+ * @slot header
5
+ * @slot footer
6
+ */
3
7
  export class SectionView extends HTMLElement {
4
8
  static get observedAttributes() {
5
9
  return ['header', 'footer'];
@@ -38,24 +42,40 @@ export class SectionView extends HTMLElement {
38
42
  // Snapshot.waitReady.then(() => {
39
43
  switch (name) {
40
44
  case 'header':
41
- if (!newValue) {
42
- this.querySelector(':scope>[slot=header]')?.remove();
43
- break;
44
- }
45
- const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }));
46
- render(html `<label-view line-limit="1" truncation-mode="tail" font="callout">
47
- <span>${newValue}</span>
48
- </label-view>`, header);
45
+ // if (!newValue) {
46
+ // this.querySelector(':scope>[slot=header]')?.remove()
47
+ // break
48
+ // }
49
+ // const header = this.querySelector(':scope>[slot=header]') ?? this.appendChild(Object.assign(document.createElement('header'), { slot: 'header' }))
50
+ queryMorph('[slot=header]', html `<header slot="header">
51
+ <label-view line-limit="1" truncation-mode="tail" font="callout">
52
+ <span>${newValue}</span>
53
+ </label-view>
54
+ </header>`, this, { removeIf: !newValue });
55
+ // render(
56
+ // html`<label-view line-limit="1" truncation-mode="tail" font="callout">
57
+ // <span>${newValue}</span>
58
+ // </label-view>`,
59
+ // header
60
+ // )
49
61
  break;
50
62
  case 'footer':
51
- if (!newValue) {
52
- this.querySelector(':scope>[slot=footer]')?.remove();
53
- break;
54
- }
55
- const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }));
56
- render(html `<label-view line-limit="1" truncation-mode="tail" font="callout">
57
- <span>${newValue}</span>
58
- </label-view>`, footer);
63
+ // if (!newValue) {
64
+ // this.querySelector(':scope>[slot=footer]')?.remove()
65
+ // break
66
+ // }
67
+ // const footer = this.querySelector(':scope>[slot=footer]') ?? this.appendChild(Object.assign(document.createElement('footer'), { slot: 'footer' }))
68
+ queryMorph('[slot=footer]', html `<footer slot="footer">
69
+ <label-view line-limit="1" truncation-mode="tail" font="callout">
70
+ <span>${newValue}</span>
71
+ </label-view>
72
+ </footer>`, this, { removeIf: !newValue });
73
+ // render(
74
+ // html`<label-view line-limit="1" truncation-mode="tail" font="callout">
75
+ // <span>${newValue}</span>
76
+ // </label-view>`,
77
+ // footer
78
+ // )
59
79
  break;
60
80
  }
61
81
  // })
@@ -2,6 +2,14 @@
2
2
  * @summary Display selectable, sortable data arranged in rows and columns.
3
3
  *
4
4
  * @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template - Sets the template areas when the table is in compact mode
5
+ *
6
+ * @slot header-leading
7
+ * @slot header-principal
8
+ * @slot header-trailing
9
+ * @slot column
10
+ * @slot footer-leading
11
+ * @slot footer-principal
12
+ * @slot footer-trailing
5
13
  */
6
14
  export declare class TableView extends HTMLElement {
7
15
  #private;
@@ -2,12 +2,21 @@ var _a;
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
3
  import { CSSStyleObserver } from '../internal/class/css-style-observer';
4
4
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
5
- import { $, devFlags, listActive, onoff, renderLabelTitle } from '../internal/utils';
5
+ import { $, devFlags, listActive, onoff } from '../internal/utils';
6
+ import { html, queryMorph } from '../morphdom';
6
7
  import { Snapshot } from '../snapshot';
7
8
  /**
8
9
  * @summary Display selectable, sortable data arranged in rows and columns.
9
10
  *
10
11
  * @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template - Sets the template areas when the table is in compact mode
12
+ *
13
+ * @slot header-leading
14
+ * @slot header-principal
15
+ * @slot header-trailing
16
+ * @slot column
17
+ * @slot footer-leading
18
+ * @slot footer-principal
19
+ * @slot footer-trailing
11
20
  */
12
21
  export class TableView extends HTMLElement {
13
22
  #styleObserver;
@@ -105,11 +114,9 @@ export class TableView extends HTMLElement {
105
114
  <label-view></label-view>
106
115
  <label-view font="callout" foreground="secondary"></label-view>
107
116
  </v-stack>
108
- </button>`, '>1'), title = btn.querySelector('label-view:first-child'), subTitle = btn.querySelector('label-view:last-child');
109
- if (title)
110
- renderLabelTitle(title, node.textContent.trim()); //title?.setAttribute('title', node.textContent.trim())
111
- if (subTitle)
112
- renderLabelTitle(subTitle, node.ariaSort ?? ''); //subTitle?.setAttribute('title', node.ariaSort ?? '')
117
+ </button>`, '>1'), title = btn.querySelector('label-view:first-child') ?? undefined, subTitle = btn.querySelector('label-view:last-child') ?? undefined;
118
+ queryMorph(':not([slot])', html `<span>${node.textContent.trim()}</span>`, title, { removeIf: !node.textContent.trim() }); //renderLabelTitle(title, node.textContent.trim()) //title?.setAttribute('title', node.textContent.trim())
119
+ queryMorph(':not([slot])', html `<span>${node.ariaSort ?? ''}</span>`, subTitle, { removeIf: !(node.ariaSort ?? '') }); //renderLabelTitle(subTitle, node.ariaSort ?? '') //subTitle?.setAttribute('title', node.ariaSort ?? '')
113
120
  this.#compactToolbarItem.appendChild(btn);
114
121
  }
115
122
  };
@@ -3,7 +3,8 @@ import { I18n } from '../i18n';
3
3
  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
- import { $, compareBigDecimals, devFlags, kebabCase, onoff, renderLabel, set } from '../internal/utils';
6
+ import { $, compareBigDecimals, devFlags, kebabCase, onoff, set } from '../internal/utils';
7
+ import { html, queryMorph } from '../morphdom';
7
8
  const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
8
9
  /**
9
10
  * @slot label
@@ -137,7 +138,7 @@ export class TextField extends FormAssociatedBase {
137
138
  this.#sendValueToForm();
138
139
  break;
139
140
  case 'label':
140
- renderLabel(':scope>label-view[slot=label]', `<label-view slot="label" foreground="secondary"><span></span></label-view>`, this, newValue);
141
+ queryMorph('[slot=label]', html `<label-view slot="label" foreground="secondary">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this); //renderLabel(':scope>label-view[slot=label]', `<label-view slot="label" foreground="secondary"><span></span></label-view>`, this, newValue)
141
142
  // this.#sendValueToForm()
142
143
  break;
143
144
  case 'disabled':
@@ -2,7 +2,8 @@ var _a;
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
3
  import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
4
4
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
5
- import { $, devFlags, kebabCase, onoff, renderLabel } from '../internal/utils';
5
+ import { $, devFlags, kebabCase, onoff } from '../internal/utils';
6
+ import { html, queryMorph } from '../morphdom';
6
7
  const toggleStyles = ['switch', 'button'];
7
8
  /**
8
9
  * @slot label
@@ -84,7 +85,7 @@ export class ToggleView extends FormAssociatedBase {
84
85
  this.#sendValueToForm(this.#connected);
85
86
  break;
86
87
  case 'label':
87
- renderLabel(':scope>label-view[slot=label]', `<label-view slot="label"><span></span></label-view>`, this, newValue);
88
+ queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this); //renderLabel(':scope>label-view[slot=label]', `<label-view slot="label"><span></span></label-view>`, this, newValue)
88
89
  break;
89
90
  case 'disabled':
90
91
  for (const el of this.#shadowRoot.querySelectorAll('input'))
@@ -28,11 +28,11 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
28
28
  const role = this.getAttribute('data-previous-slot') ?? this.getAttribute('slot') ?? '', tKey = this.getAttribute('title-key');
29
29
  if (['confirmation-action', 'cancellation-action'].includes(role))
30
30
  Snapshot.waitReady.then(() => {
31
- ensurePlaceholder(this.querySelector(':scope>button'), role, tKey);
31
+ ensurePlaceholder(this.querySelector(':scope>button'), role, tKey, Snapshot.config);
32
32
  this.#mutationObserver = new MutationObserver((mutations) => {
33
33
  for (const { target } of mutations)
34
34
  if (target instanceof HTMLElement)
35
- ensurePlaceholder(this.querySelector(':scope>button'), role, tKey);
35
+ ensurePlaceholder(this.querySelector(':scope>button'), role, tKey, Snapshot.config);
36
36
  });
37
37
  this.#mutationObserver.observe(this, {
38
38
  childList: true,
@@ -1,13 +1,15 @@
1
1
  /**
2
+ * @summary A view that arranges its subviews in a vertical line.
3
+ *
2
4
  * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution - The distribution of cols
3
5
  *
4
- * @attr {"auto spacer"|"auto auto spacer"|"auto auto auto spacer"} template
6
+ * @attr {@templateSet} template - The main-axis grid template
5
7
  *
6
8
  * @attr {@spacingSet} spacing - The gap between the primary axis
7
9
  *
8
- * @attr {@alignmentSet} alignment - The cross-axis alignment
9
- * @attr {@distributionSet} distribution - The main-axis alignment
10
- * @attr {@placementSet} placement - The main-axis alignment
10
+ * @attr {@inlineSet} alignment - The cross-axis alignment
11
+ * @attr {@blockSet} distribution - The main-axis alignment
12
+ * @attr {@blockPlacementSet} placement - The main-axis alignment
11
13
  *
12
14
  */
13
15
  export declare class VStack extends HTMLElement {
@@ -1,14 +1,16 @@
1
1
  import { devFlags } from '../internal/utils';
2
2
  /**
3
+ * @summary A view that arranges its subviews in a vertical line.
4
+ *
3
5
  * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution - The distribution of cols
4
6
  *
5
- * @attr {"auto spacer"|"auto auto spacer"|"auto auto auto spacer"} template
7
+ * @attr {@templateSet} template - The main-axis grid template
6
8
  *
7
9
  * @attr {@spacingSet} spacing - The gap between the primary axis
8
10
  *
9
- * @attr {@alignmentSet} alignment - The cross-axis alignment
10
- * @attr {@distributionSet} distribution - The main-axis alignment
11
- * @attr {@placementSet} placement - The main-axis alignment
11
+ * @attr {@inlineSet} alignment - The cross-axis alignment
12
+ * @attr {@blockSet} distribution - The main-axis alignment
13
+ * @attr {@blockPlacementSet} placement - The main-axis alignment
12
14
  *
13
15
  */
14
16
  export class VStack extends HTMLElement {
@@ -2055,17 +2055,8 @@
2055
2055
  place-content: safe center;
2056
2056
  gap: 1rem;
2057
2057
  }
2058
- :where(h-stack[template="auto spacer"]) {
2059
- grid-template-columns: auto minmax(0, 1fr);
2060
- }
2061
- :where(h-stack[template="spacer auto"]) {
2062
- grid-template-columns: minmax(0, 1fr) auto;
2063
- }
2064
- :where(h-stack[template="auto spacer auto auto"]) {
2065
- grid-template-columns: auto minmax(0, 1fr) auto auto;
2066
- }
2067
- :where(h-stack[template="auto spacer auto"]) {
2068
- grid-template-columns: auto minmax(0, 1fr) auto;
2058
+ :where(h-stack[template=spacer]) {
2059
+ grid-template-columns: minmax(0, 1fr);
2069
2060
  }
2070
2061
  :where(h-stack[template="repeat(1,spacer)"]) {
2071
2062
  grid-template-columns: repeat(1, minmax(0, 1fr));
@@ -2097,9 +2088,117 @@
2097
2088
  :where(h-stack[template="repeat(10,spacer)"]) {
2098
2089
  grid-template-columns: repeat(10, minmax(0, 1fr));
2099
2090
  }
2091
+ :where(h-stack[template="spacer auto"]) {
2092
+ grid-template-columns: minmax(0, 1fr) auto;
2093
+ }
2094
+ :where(h-stack[template="repeat(1,spacer) auto"]) {
2095
+ grid-template-columns: repeat(1, minmax(0, 1fr)) auto;
2096
+ }
2100
2097
  :where(h-stack[template="repeat(2,spacer) auto"]) {
2101
2098
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
2102
2099
  }
2100
+ :where(h-stack[template="repeat(3,spacer) auto"]) {
2101
+ grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
2102
+ }
2103
+ :where(h-stack[template="repeat(4,spacer) auto"]) {
2104
+ grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
2105
+ }
2106
+ :where(h-stack[template="repeat(5,spacer) auto"]) {
2107
+ grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
2108
+ }
2109
+ :where(h-stack[template="repeat(6,spacer) auto"]) {
2110
+ grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
2111
+ }
2112
+ :where(h-stack[template="repeat(7,spacer) auto"]) {
2113
+ grid-template-columns: repeat(7, minmax(0, 1fr)) auto;
2114
+ }
2115
+ :where(h-stack[template="repeat(8,spacer) auto"]) {
2116
+ grid-template-columns: repeat(8, minmax(0, 1fr)) auto;
2117
+ }
2118
+ :where(h-stack[template="repeat(9,spacer) auto"]) {
2119
+ grid-template-columns: repeat(9, minmax(0, 1fr)) auto;
2120
+ }
2121
+ :where(h-stack[template="repeat(10,spacer) auto"]) {
2122
+ grid-template-columns: repeat(10, minmax(0, 1fr)) auto;
2123
+ }
2124
+ :where(h-stack[template="auto spacer"]) {
2125
+ grid-template-columns: auto minmax(0, 1fr);
2126
+ }
2127
+ :where(h-stack[template="repeat(1,auto) spacer"]) {
2128
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr);
2129
+ }
2130
+ :where(h-stack[template="repeat(2,auto) spacer"]) {
2131
+ grid-template-columns: repeat(2, auto) minmax(0, 1fr);
2132
+ }
2133
+ :where(h-stack[template="repeat(3,auto) spacer"]) {
2134
+ grid-template-columns: repeat(3, auto) minmax(0, 1fr);
2135
+ }
2136
+ :where(h-stack[template="repeat(4,auto) spacer"]) {
2137
+ grid-template-columns: repeat(4, auto) minmax(0, 1fr);
2138
+ }
2139
+ :where(h-stack[template="repeat(5,auto) spacer"]) {
2140
+ grid-template-columns: repeat(5, auto) minmax(0, 1fr);
2141
+ }
2142
+ :where(h-stack[template="repeat(6,auto) spacer"]) {
2143
+ grid-template-columns: repeat(6, auto) minmax(0, 1fr);
2144
+ }
2145
+ :where(h-stack[template="repeat(7,auto) spacer"]) {
2146
+ grid-template-columns: repeat(7, auto) minmax(0, 1fr);
2147
+ }
2148
+ :where(h-stack[template="repeat(8,auto) spacer"]) {
2149
+ grid-template-columns: repeat(8, auto) minmax(0, 1fr);
2150
+ }
2151
+ :where(h-stack[template="repeat(9,auto) spacer"]) {
2152
+ grid-template-columns: repeat(9, auto) minmax(0, 1fr);
2153
+ }
2154
+ :where(h-stack[template="repeat(10,auto) spacer"]) {
2155
+ grid-template-columns: repeat(10, auto) minmax(0, 1fr);
2156
+ }
2157
+ :where(h-stack[template="auto auto spacer"]) {
2158
+ grid-template-columns: auto auto minmax(0, 1fr);
2159
+ }
2160
+ :where(h-stack[template="auto auto auto spacer"]) {
2161
+ grid-template-columns: auto auto auto minmax(0, 1fr);
2162
+ }
2163
+ :where(h-stack[template="auto auto auto auto spacer"]) {
2164
+ grid-template-columns: auto auto auto auto minmax(0, 1fr);
2165
+ }
2166
+ :where(h-stack[template="auto spacer auto"]) {
2167
+ grid-template-columns: auto minmax(0, 1fr) auto;
2168
+ }
2169
+ :where(h-stack[template="repeat(1,auto) spacer repeat(1,auto)"]) {
2170
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr) repeat(1, auto);
2171
+ }
2172
+ :where(h-stack[template="repeat(1,auto) spacer repeat(2,auto)"]) {
2173
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr) repeat(2, auto);
2174
+ }
2175
+ :where(h-stack[template="repeat(1,auto) spacer repeat(3,auto)"]) {
2176
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr) repeat(3, auto);
2177
+ }
2178
+ :where(h-stack[template="repeat(1,auto) spacer repeat(4,auto)"]) {
2179
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr) repeat(4, auto);
2180
+ }
2181
+ :where(h-stack[template="repeat(1,auto) spacer repeat(5,auto)"]) {
2182
+ grid-template-columns: repeat(1, auto) minmax(0, 1fr) repeat(5, auto);
2183
+ }
2184
+ :where(h-stack[template="repeat(2,auto) spacer repeat(1,auto)"]) {
2185
+ grid-template-columns: repeat(2, auto) minmax(0, 1fr) repeat(1, auto);
2186
+ }
2187
+ :where(h-stack[template="repeat(3,auto) spacer repeat(1,auto)"]) {
2188
+ grid-template-columns: repeat(3, auto) minmax(0, 1fr) repeat(1, auto);
2189
+ }
2190
+ :where(h-stack[template="repeat(4,auto) spacer repeat(1,auto)"]) {
2191
+ grid-template-columns: repeat(4, auto) minmax(0, 1fr) repeat(1, auto);
2192
+ }
2193
+ :where(h-stack[template="repeat(5,auto) spacer repeat(1,auto)"]) {
2194
+ grid-template-columns: repeat(5, auto) minmax(0, 1fr) repeat(1, auto);
2195
+ }
2196
+ :where(h-stack[template="repeat(2,auto) spacer repeat(2,auto)"]) {
2197
+ grid-template-columns: repeat(2, auto) minmax(0, 1fr) repeat(2, auto);
2198
+ }
2199
+ :where(h-stack[template="auto spacer auto auto"]) {
2200
+ grid-template-columns: auto minmax(0, 1fr) auto auto;
2201
+ }
2103
2202
  }
2104
2203
  @layer sw-components {
2105
2204
  :where(v-stack) {
@@ -2108,9 +2207,105 @@
2108
2207
  place-content: safe center;
2109
2208
  gap: 1rem;
2110
2209
  }
2210
+ :where(v-stack[template=spacer]) {
2211
+ grid-template-rows: minmax(0, 1fr);
2212
+ }
2213
+ :where(v-stack[template="repeat(1,spacer)"]) {
2214
+ grid-template-rows: repeat(1, minmax(0, 1fr));
2215
+ }
2216
+ :where(v-stack[template="repeat(2,spacer)"]) {
2217
+ grid-template-rows: repeat(2, minmax(0, 1fr));
2218
+ }
2219
+ :where(v-stack[template="repeat(3,spacer)"]) {
2220
+ grid-template-rows: repeat(3, minmax(0, 1fr));
2221
+ }
2222
+ :where(v-stack[template="repeat(4,spacer)"]) {
2223
+ grid-template-rows: repeat(4, minmax(0, 1fr));
2224
+ }
2225
+ :where(v-stack[template="repeat(5,spacer)"]) {
2226
+ grid-template-rows: repeat(5, minmax(0, 1fr));
2227
+ }
2228
+ :where(v-stack[template="repeat(6,spacer)"]) {
2229
+ grid-template-rows: repeat(6, minmax(0, 1fr));
2230
+ }
2231
+ :where(v-stack[template="repeat(7,spacer)"]) {
2232
+ grid-template-rows: repeat(7, minmax(0, 1fr));
2233
+ }
2234
+ :where(v-stack[template="repeat(8,spacer)"]) {
2235
+ grid-template-rows: repeat(8, minmax(0, 1fr));
2236
+ }
2237
+ :where(v-stack[template="repeat(9,spacer)"]) {
2238
+ grid-template-rows: repeat(9, minmax(0, 1fr));
2239
+ }
2240
+ :where(v-stack[template="repeat(10,spacer)"]) {
2241
+ grid-template-rows: repeat(10, minmax(0, 1fr));
2242
+ }
2243
+ :where(v-stack[template="spacer auto"]) {
2244
+ grid-template-rows: minmax(0, 1fr) auto;
2245
+ }
2246
+ :where(v-stack[template="repeat(1,spacer) auto"]) {
2247
+ grid-template-rows: repeat(1, minmax(0, 1fr)) auto;
2248
+ }
2249
+ :where(v-stack[template="repeat(2,spacer) auto"]) {
2250
+ grid-template-rows: repeat(2, minmax(0, 1fr)) auto;
2251
+ }
2252
+ :where(v-stack[template="repeat(3,spacer) auto"]) {
2253
+ grid-template-rows: repeat(3, minmax(0, 1fr)) auto;
2254
+ }
2255
+ :where(v-stack[template="repeat(4,spacer) auto"]) {
2256
+ grid-template-rows: repeat(4, minmax(0, 1fr)) auto;
2257
+ }
2258
+ :where(v-stack[template="repeat(5,spacer) auto"]) {
2259
+ grid-template-rows: repeat(5, minmax(0, 1fr)) auto;
2260
+ }
2261
+ :where(v-stack[template="repeat(6,spacer) auto"]) {
2262
+ grid-template-rows: repeat(6, minmax(0, 1fr)) auto;
2263
+ }
2264
+ :where(v-stack[template="repeat(7,spacer) auto"]) {
2265
+ grid-template-rows: repeat(7, minmax(0, 1fr)) auto;
2266
+ }
2267
+ :where(v-stack[template="repeat(8,spacer) auto"]) {
2268
+ grid-template-rows: repeat(8, minmax(0, 1fr)) auto;
2269
+ }
2270
+ :where(v-stack[template="repeat(9,spacer) auto"]) {
2271
+ grid-template-rows: repeat(9, minmax(0, 1fr)) auto;
2272
+ }
2273
+ :where(v-stack[template="repeat(10,spacer) auto"]) {
2274
+ grid-template-rows: repeat(10, minmax(0, 1fr)) auto;
2275
+ }
2111
2276
  :where(v-stack[template="auto spacer"]) {
2112
2277
  grid-template-rows: auto minmax(0, 1fr);
2113
2278
  }
2279
+ :where(v-stack[template="repeat(1,auto) spacer"]) {
2280
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr);
2281
+ }
2282
+ :where(v-stack[template="repeat(2,auto) spacer"]) {
2283
+ grid-template-rows: repeat(2, auto) minmax(0, 1fr);
2284
+ }
2285
+ :where(v-stack[template="repeat(3,auto) spacer"]) {
2286
+ grid-template-rows: repeat(3, auto) minmax(0, 1fr);
2287
+ }
2288
+ :where(v-stack[template="repeat(4,auto) spacer"]) {
2289
+ grid-template-rows: repeat(4, auto) minmax(0, 1fr);
2290
+ }
2291
+ :where(v-stack[template="repeat(5,auto) spacer"]) {
2292
+ grid-template-rows: repeat(5, auto) minmax(0, 1fr);
2293
+ }
2294
+ :where(v-stack[template="repeat(6,auto) spacer"]) {
2295
+ grid-template-rows: repeat(6, auto) minmax(0, 1fr);
2296
+ }
2297
+ :where(v-stack[template="repeat(7,auto) spacer"]) {
2298
+ grid-template-rows: repeat(7, auto) minmax(0, 1fr);
2299
+ }
2300
+ :where(v-stack[template="repeat(8,auto) spacer"]) {
2301
+ grid-template-rows: repeat(8, auto) minmax(0, 1fr);
2302
+ }
2303
+ :where(v-stack[template="repeat(9,auto) spacer"]) {
2304
+ grid-template-rows: repeat(9, auto) minmax(0, 1fr);
2305
+ }
2306
+ :where(v-stack[template="repeat(10,auto) spacer"]) {
2307
+ grid-template-rows: repeat(10, auto) minmax(0, 1fr);
2308
+ }
2114
2309
  :where(v-stack[template="auto auto spacer"]) {
2115
2310
  grid-template-rows: auto auto minmax(0, 1fr);
2116
2311
  }
@@ -2120,6 +2315,42 @@
2120
2315
  :where(v-stack[template="auto auto auto auto spacer"]) {
2121
2316
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
2122
2317
  }
2318
+ :where(v-stack[template="auto spacer auto"]) {
2319
+ grid-template-rows: auto minmax(0, 1fr) auto;
2320
+ }
2321
+ :where(v-stack[template="repeat(1,auto) spacer repeat(1,auto)"]) {
2322
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr) repeat(1, auto);
2323
+ }
2324
+ :where(v-stack[template="repeat(1,auto) spacer repeat(2,auto)"]) {
2325
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr) repeat(2, auto);
2326
+ }
2327
+ :where(v-stack[template="repeat(1,auto) spacer repeat(3,auto)"]) {
2328
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr) repeat(3, auto);
2329
+ }
2330
+ :where(v-stack[template="repeat(1,auto) spacer repeat(4,auto)"]) {
2331
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr) repeat(4, auto);
2332
+ }
2333
+ :where(v-stack[template="repeat(1,auto) spacer repeat(5,auto)"]) {
2334
+ grid-template-rows: repeat(1, auto) minmax(0, 1fr) repeat(5, auto);
2335
+ }
2336
+ :where(v-stack[template="repeat(2,auto) spacer repeat(1,auto)"]) {
2337
+ grid-template-rows: repeat(2, auto) minmax(0, 1fr) repeat(1, auto);
2338
+ }
2339
+ :where(v-stack[template="repeat(3,auto) spacer repeat(1,auto)"]) {
2340
+ grid-template-rows: repeat(3, auto) minmax(0, 1fr) repeat(1, auto);
2341
+ }
2342
+ :where(v-stack[template="repeat(4,auto) spacer repeat(1,auto)"]) {
2343
+ grid-template-rows: repeat(4, auto) minmax(0, 1fr) repeat(1, auto);
2344
+ }
2345
+ :where(v-stack[template="repeat(5,auto) spacer repeat(1,auto)"]) {
2346
+ grid-template-rows: repeat(5, auto) minmax(0, 1fr) repeat(1, auto);
2347
+ }
2348
+ :where(v-stack[template="repeat(2,auto) spacer repeat(2,auto)"]) {
2349
+ grid-template-rows: repeat(2, auto) minmax(0, 1fr) repeat(2, auto);
2350
+ }
2351
+ :where(v-stack[template="auto spacer auto auto"]) {
2352
+ grid-template-rows: auto minmax(0, 1fr) auto auto;
2353
+ }
2123
2354
  }
2124
2355
  @layer sw-components {
2125
2356
  :where(h-flex-stack) {
@@ -1 +1 @@
1
- export default function (target: HTMLElement | null, role: string | null, titleKey?: string | null): void;
1
+ export default function (target: HTMLElement | null, role: string | null, titleKey?: string | null, config?: Record<string, string>): void;
@@ -1,7 +1,6 @@
1
1
  import { I18n } from '../../i18n';
2
- import { Snapshot } from '../../snapshot';
3
2
  import { default as $ } from './cash';
4
- function renderPlaceholder(el, role, titleKey) {
3
+ function renderPlaceholder(el, role, titleKey, config) {
5
4
  // if (!el.isConnected) return
6
5
  // self.requestAnimationFrame(() => {
7
6
  // if (!el.isConnected) return
@@ -9,7 +8,7 @@ function renderPlaceholder(el, role, titleKey) {
9
8
  switch (role) {
10
9
  case 'cancel':
11
10
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Cancel);
12
- label.setAttribute('system-image', Snapshot.config['cancel-button-icon']);
11
+ label.setAttribute('system-image', config['cancel-button-icon']);
13
12
  break;
14
13
  case 'close':
15
14
  if (label.closest('[is=alert-dialog]')) {
@@ -17,24 +16,24 @@ function renderPlaceholder(el, role, titleKey) {
17
16
  }
18
17
  else {
19
18
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Close);
20
- label.setAttribute('system-image', Snapshot.config['close-button-icon']);
19
+ label.setAttribute('system-image', config['close-button-icon']);
21
20
  }
22
21
  break;
23
22
  case 'confirm':
24
23
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Confirm);
25
- label.setAttribute('system-image', Snapshot.config['confirm-button-icon']);
24
+ label.setAttribute('system-image', config['confirm-button-icon']);
26
25
  break;
27
26
  case 'confirmation-action':
28
27
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Confirm);
29
- label.setAttribute('system-image', Snapshot.config['confirm-button-icon']);
28
+ label.setAttribute('system-image', config['confirm-button-icon']);
30
29
  break;
31
30
  case 'cancellation-action':
32
31
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Cancel);
33
- label.setAttribute('system-image', Snapshot.config['cancel-button-icon']);
32
+ label.setAttribute('system-image', config['cancel-button-icon']);
34
33
  break;
35
34
  case 'destructive':
36
35
  label.setAttribute('title', titleKey && titleKey in I18n.t('ButtonRole') ? I18n.t('ButtonRole')[titleKey] : I18n.t('ButtonRole').Destructive);
37
- label.setAttribute('system-image', Snapshot.config['delete-button-icon']);
36
+ label.setAttribute('system-image', config['delete-button-icon']);
38
37
  break;
39
38
  default:
40
39
  label?.remove();
@@ -45,7 +44,7 @@ function renderPlaceholder(el, role, titleKey) {
45
44
  // } else label?.remove()
46
45
  // })
47
46
  }
48
- export default function (target, role, titleKey) {
47
+ export default function (target, role, titleKey, config) {
49
48
  if (!target)
50
49
  return;
51
50
  const overiderTitle = typeof titleKey === 'string' && titleKey in I18n.t('ButtonRole') ? titleKey : undefined;
@@ -13,9 +13,6 @@ export { default as kebabCase } from './kebab-case';
13
13
  export { default as listActive } from './list-active';
14
14
  export { default as microtask } from './microtask';
15
15
  export { default as onoff } from './onoff';
16
- export { default as renderLabel } from './render-label';
17
- export { default as renderLabelIcon } from './render-label-icon';
18
- export { default as renderLabelTitle } from './render-label-title';
19
16
  export { default as set } from './set';
20
17
  export { default as sleep } from './sleep';
21
18
  export { default as slowHideShow } from './slow-hide-show';