@swiftwc/ui 0.0.0-dev.103 → 0.0.0-dev.106

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 (95) hide show
  1. package/generated/client/index.js +7 -8
  2. package/generated/components/alert-dialog.js +9 -17
  3. package/generated/components/body-view.js +3 -5
  4. package/generated/components/bordered-button.js +4 -7
  5. package/generated/components/bordered-prominent-button.js +4 -7
  6. package/generated/components/borderless-button.js +4 -7
  7. package/generated/components/color-scheme.js +4 -7
  8. package/generated/components/confirmation-dialog.js +9 -17
  9. package/generated/components/content-unavailable.js +4 -7
  10. package/generated/components/date-picker.js +13 -25
  11. package/generated/components/detail-placeholder.js +4 -8
  12. package/generated/components/disclosure-group.js +5 -9
  13. package/generated/components/fine-tooltip.js +4 -7
  14. package/generated/components/form-view.js +3 -5
  15. package/generated/components/glass-button.js +4 -7
  16. package/generated/components/glass-prominent-button.js +4 -7
  17. package/generated/components/h-divider.d.ts +11 -0
  18. package/generated/components/h-divider.js +15 -0
  19. package/generated/components/h-stack.js +3 -5
  20. package/generated/components/image-view.js +4 -7
  21. package/generated/components/index.d.ts +2 -0
  22. package/generated/components/index.js +2 -0
  23. package/generated/components/label-view.js +4 -7
  24. package/generated/components/labeled-content.js +4 -7
  25. package/generated/components/list-view.js +3 -5
  26. package/generated/components/menu-view.js +10 -19
  27. package/generated/components/navigation-large-title.js +5 -9
  28. package/generated/components/navigation-split-view.js +4 -7
  29. package/generated/components/navigation-stack.js +4 -7
  30. package/generated/components/navigation-title.js +4 -7
  31. package/generated/components/picker-view.js +32 -61
  32. package/generated/components/plain-button.js +3 -5
  33. package/generated/components/progress-view.js +6 -11
  34. package/generated/components/screen-view.js +2 -3
  35. package/generated/components/scroll-view-proxy.js +3 -5
  36. package/generated/components/scroll-view.js +9 -16
  37. package/generated/components/search-view.js +4 -7
  38. package/generated/components/section-view.js +4 -7
  39. package/generated/components/sheet-view.js +6 -11
  40. package/generated/components/sidebar-toggle.js +5 -9
  41. package/generated/components/sidebar-view.js +2 -3
  42. package/generated/components/sticky-container.js +3 -5
  43. package/generated/components/tab-bar.js +4 -7
  44. package/generated/components/tab-item.js +8 -15
  45. package/generated/components/tab-view.js +8 -14
  46. package/generated/components/table-view.js +6 -11
  47. package/generated/components/text-field.js +10 -19
  48. package/generated/components/text-view.js +4 -7
  49. package/generated/components/toggle-view.js +13 -25
  50. package/generated/components/tool-bar-item-group.js +3 -5
  51. package/generated/components/tool-bar-item.js +4 -7
  52. package/generated/components/tool-bar.js +4 -7
  53. package/generated/components/v-divider.d.ts +11 -0
  54. package/generated/components/v-divider.js +15 -0
  55. package/generated/components/v-keyboard.js +8 -12
  56. package/generated/components/v-stack.js +3 -5
  57. package/generated/css/index.css +13 -5
  58. package/generated/internal/class/css-style-observer.js +2 -3
  59. package/generated/internal/class/form-associated-base.js +5 -7
  60. package/generated/internal/class/navigation-view.js +3 -5
  61. package/generated/internal/decorators/adaptive-slot.js +4 -7
  62. package/generated/internal/decorators/microtask-on-connected.d.ts +2 -2
  63. package/generated/internal/decorators/microtask-on-connected.js +2 -2
  64. package/generated/internal/flags.json +3 -0
  65. package/generated/internal/privateNamespace.js +12 -21
  66. package/generated/internal/utils/$.d.ts +9 -0
  67. package/generated/internal/utils/$.js +11 -0
  68. package/generated/internal/utils/debug.d.ts +1 -0
  69. package/generated/internal/utils/debug.js +4 -0
  70. package/generated/internal/utils/index.d.ts +36 -2
  71. package/generated/internal/utils/index.js +36 -5
  72. package/generated/internal/utils/is-inside.js +1 -1
  73. package/generated/snapshot/index.js +3 -5
  74. package/package.json +11 -7
  75. package/scss/components/_index.scss +3 -1
  76. package/scss/components/_picker-view.scss +1 -1
  77. package/web-components.html-data/en.json +8 -0
  78. package/generated/internal/utils/cash/index.d.ts +0 -24
  79. package/generated/internal/utils/cash/index.js +0 -27
  80. package/generated/internal/utils/dev-flags.d.ts +0 -3
  81. package/generated/internal/utils/dev-flags.js +0 -5
  82. /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
  83. /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
  84. /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
  85. /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
  86. /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
  87. /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
  88. /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
  89. /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
  90. /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
  91. /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
  92. /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
  93. /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
  94. /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
  95. /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
@@ -1,17 +1,15 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, onoff } from '../internal/utils';
2
+ import { debug, onoff } from '../internal/utils';
3
3
  export class StickyContainer extends HTMLElement {
4
4
  constructor() {
5
5
  super();
6
6
  }
7
7
  disconnectedCallback() {
8
- if (devFlags.debug)
9
- console.debug(`${StickyContainer.name} ⚡️ disconnect`);
8
+ debug(`${StickyContainer.name} ⚡️ disconnect`);
10
9
  CleanupRegistry.unregister(this);
11
10
  }
12
11
  connectedCallback() {
13
- if (devFlags.debug)
14
- console.debug(`${StickyContainer.name} ⚡️ connect`);
12
+ debug(`${StickyContainer.name} ⚡️ connect`);
15
13
  // CleanupRegistry.register(this, onoff('transitionend transitionstart transitioncancel', this.#handleTransitionrun as unknown as EventListener, this).on())
16
14
  CleanupRegistry.register(this, onoff('transitionrun', this.#handleTransitionrun, this).on());
17
15
  }
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, onoff, touchGlass } from '../internal/utils';
2
+ import { debug, onoff, touchGlass } from '../internal/utils';
3
3
  import { DialogBase } from '../namespace-browser/base';
4
4
  /**
5
5
  * @summary A container view that groups tab-items together along the top or bottom of the screen.
@@ -9,14 +9,12 @@ export class TabBar extends DialogBase {
9
9
  super();
10
10
  }
11
11
  static polyfillDisconnectedCallback(el) {
12
- if (devFlags.debug)
13
- console.debug(`${TabBar.name} ⚡️ disconnect`);
12
+ debug(`${TabBar.name} ⚡️ disconnect`);
14
13
  el.removeEventListener('click', TabBar.#handleClick);
15
14
  CleanupRegistry.unregister(el);
16
15
  }
17
16
  static polyfillConnectedCallback(el) {
18
- if (devFlags.debug)
19
- console.debug(`${TabBar.name} ⚡️ connect`);
17
+ debug(`${TabBar.name} ⚡️ connect`);
20
18
  el.autofocus = true;
21
19
  CleanupRegistry.register(el, onoff('click', TabBar.#handleClick, el).on());
22
20
  CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
@@ -30,8 +28,7 @@ export class TabBar extends DialogBase {
30
28
  }), el).on());
31
29
  }
32
30
  static #handleClick = async ({ target, type }) => {
33
- if (devFlags.debug)
34
- console.debug(`${TabBar.name} ⚡️ ${type}`);
31
+ debug(`${TabBar.name} ⚡️ ${type}`);
35
32
  if (!(target instanceof HTMLElement))
36
33
  return;
37
34
  if (target instanceof HTMLDialogElement && 'tab-bar' === target.getAttribute('is'))
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, onoff } from '../internal/utils';
2
+ import { debug, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
4
  import { TabView } from './tab-view';
5
5
  /**
@@ -10,13 +10,11 @@ export class TabItem extends ButtonBase {
10
10
  super();
11
11
  }
12
12
  static polyfillDisconnectedCallback(btn) {
13
- if (devFlags.debug)
14
- console.debug(`${TabItem.name} ⚡️ disconnect`);
13
+ debug(`${TabItem.name} ⚡️ disconnect`);
15
14
  CleanupRegistry.unregister(btn);
16
15
  }
17
16
  static polyfillConnectedCallback(btn) {
18
- if (devFlags.debug)
19
- console.debug(`${TabItem.name} ⚡️ connect`);
17
+ debug(`${TabItem.name} ⚡️ connect`);
20
18
  Object.assign(btn, {
21
19
  tabIndex: 0,
22
20
  ariaSelected: 'false',
@@ -36,8 +34,7 @@ export class TabItem extends ButtonBase {
36
34
  });
37
35
  }
38
36
  static #handleTabMoreStackAllowance = async (btn, evt) => {
39
- if (devFlags.debug)
40
- console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
37
+ debug(`${TabItem.name} ⚡️ ${evt?.type}`);
41
38
  const tv = btn.closest('tab-view');
42
39
  if (!tv)
43
40
  return;
@@ -46,8 +43,7 @@ export class TabItem extends ButtonBase {
46
43
  btn.hidden = 'bottom-bar' !== tv.tabBarPlacement;
47
44
  };
48
45
  static #handleTabRevealOrSwap = async (btn, evt) => {
49
- if (devFlags.debug)
50
- console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
46
+ debug(`${TabItem.name} ⚡️ ${evt?.type}`);
51
47
  const tv = btn?.closest('tab-view');
52
48
  if (!tv)
53
49
  return;
@@ -69,8 +65,7 @@ export class TabItem extends ButtonBase {
69
65
  }, 100);
70
66
  };
71
67
  static #handleClick = async ({ type, currentTarget: btn }) => {
72
- if (devFlags.debug)
73
- console.debug(`${TabItem.name} ⚡️ ${type}`);
68
+ debug(`${TabItem.name} ⚡️ ${type}`);
74
69
  if (!(btn instanceof HTMLElement))
75
70
  return;
76
71
  // const tag = btn.getAttribute('value')
@@ -116,16 +111,14 @@ export class TabItem extends ButtonBase {
116
111
  for (const tab of tabs.reverse())
117
112
  if (tv.selectedTab.includes(tab)) {
118
113
  const eventType = 'tabroot';
119
- if (devFlags.debug)
120
- console.debug(`${TabItem.name} 💡 ${eventType}`);
114
+ debug(`${TabItem.name} 💡 ${eventType}`);
121
115
  tab?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
122
116
  return; // skip rest no selection!
123
117
  }
124
118
  }
125
119
  else if ('->' === dir) {
126
120
  const eventType = 'tabroot';
127
- if (devFlags.debug)
128
- console.debug(`${TabItem.name} 💡 ${eventType}`);
121
+ debug(`${TabItem.name} 💡 ${eventType}`);
129
122
  tabs.at(0)?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
130
123
  }
131
124
  // SECTION: finally, submit new tabs
@@ -2,7 +2,7 @@ var _a;
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
3
  import { CSSStyleObserver } from '../internal/class/css-style-observer';
4
4
  import { NavigationPath } from '../internal/class/navigation-path';
5
- import { $, cssTime, debounce, devFlags, frame, onoff, timeout } from '../internal/utils';
5
+ import { cssTime, debounce, debug, frame, onoff, siblings, timeout } from '../internal/utils';
6
6
  import { Snapshot } from '../snapshot';
7
7
  const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
8
8
  /**
@@ -29,8 +29,7 @@ export class TabView extends HTMLElement {
29
29
  this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
30
30
  }
31
31
  disconnectedCallback() {
32
- if (devFlags.debug)
33
- console.debug(`${_a.name} ⚡️ disconnect`);
32
+ debug(`${_a.name} ⚡️ disconnect`);
34
33
  this.#afterTabRevealDelay.cancel();
35
34
  this.#cssStyleObserver?.disconnect();
36
35
  CleanupRegistry.unregister(this);
@@ -42,8 +41,7 @@ export class TabView extends HTMLElement {
42
41
  return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
43
42
  }
44
43
  connectedCallback() {
45
- if (devFlags.debug)
46
- console.debug(`${_a.name} ⚡️ connect`);
44
+ debug(`${_a.name} ⚡️ connect`);
47
45
  this.#cssStyleObserver = new CSSStyleObserver({
48
46
  properties: ['--adaptable-tab-bar-placement-index'],
49
47
  });
@@ -66,7 +64,7 @@ export class TabView extends HTMLElement {
66
64
  const summary = target.closest('summary');
67
65
  if (!summary)
68
66
  return;
69
- if (0 === $.siblings('[aria-selected=true]', summary).length)
67
+ if (0 === siblings('[aria-selected=true]', summary).length)
70
68
  return;
71
69
  if (!summary.closest('scroll-view')?.matches('tab-view > [is=sidebar-view] > scroll-view'))
72
70
  return;
@@ -79,13 +77,11 @@ export class TabView extends HTMLElement {
79
77
  this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
80
78
  };
81
79
  #handleTabViewPagereveal = (evt) => {
82
- if (devFlags.debug)
83
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
80
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
84
81
  void this.#syncBodyFace();
85
82
  };
86
83
  #handleStyleChange = () => {
87
- if (devFlags.debug)
88
- console.debug(`${_a.name} ⚡️ style`);
84
+ debug(`${_a.name} ⚡️ style`);
89
85
  const style = self.getComputedStyle(this);
90
86
  const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
91
87
  newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
@@ -100,8 +96,7 @@ export class TabView extends HTMLElement {
100
96
  }
101
97
  };
102
98
  #handleAdaptableTabBarPlacementChange = (evt) => {
103
- if (devFlags.debug)
104
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
99
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
105
100
  if ('bottom-bar' !== evt.detail.oldValue)
106
101
  return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
107
102
  const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
@@ -169,8 +164,7 @@ export class TabView extends HTMLElement {
169
164
  #triggerToggleEvent = (evt) => {
170
165
  const eventType = 'tab-view:toggle';
171
166
  void this.#syncBodyFace();
172
- if (devFlags.debug)
173
- console.debug(`${_a.name} 💡 ${eventType}`);
167
+ debug(`${_a.name} 💡 ${eventType}`);
174
168
  this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
175
169
  };
176
170
  #syncBodyFace = async () => {
@@ -2,7 +2,7 @@ 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 } from '../internal/utils';
5
+ import { $, debug, listActive, onoff } from '../internal/utils';
6
6
  import { queryMorph } from '../morphdom';
7
7
  import { Snapshot } from '../snapshot';
8
8
  import { html } from '../tpl';
@@ -68,16 +68,14 @@ export class TableView extends HTMLElement {
68
68
  this.#slots?.get('column')?.addEventListener('slotchange', this.#handleColumnSlotchange);
69
69
  }
70
70
  disconnectedCallback() {
71
- if (devFlags.debug)
72
- console.debug(`${_a.name} ⚡️ disconnect`);
71
+ debug(`${_a.name} ⚡️ disconnect`);
73
72
  CleanupRegistry.unregister(this);
74
73
  this.#styleObserver?.disconnect();
75
74
  this.#observers.unobserveAll();
76
75
  this.#compactToolbarItem = undefined;
77
76
  }
78
77
  connectedCallback() {
79
- if (devFlags.debug)
80
- console.debug(`${_a.name} ⚡️ connect`);
78
+ debug(`${_a.name} ⚡️ connect`);
81
79
  CleanupRegistry.register(this, onoff(listActive(this), this).on());
82
80
  this.#styleObserver = new CSSStyleObserver({
83
81
  properties: ['--adaptable-table-style-index'],
@@ -89,8 +87,7 @@ export class TableView extends HTMLElement {
89
87
  Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
90
88
  }
91
89
  #handleColumnSlotchange = ({ type, target: slot }) => {
92
- if (devFlags.debug)
93
- console.debug(`${_a.name} ⚡️ ${type}`);
90
+ debug(`${_a.name} ⚡️ ${type}`);
94
91
  if (!(slot instanceof HTMLSlotElement))
95
92
  return;
96
93
  const assigned = slot.assignedElements();
@@ -99,8 +96,7 @@ export class TableView extends HTMLElement {
99
96
  this.#renderColumns([]);
100
97
  };
101
98
  #renderColumns = (entries) => {
102
- if (devFlags.debug)
103
- console.debug(`${_a.name} ⚡️ mutation`);
99
+ debug(`${_a.name} ⚡️ mutation`);
104
100
  if (!this.#compactToolbarItem) {
105
101
  this.#compactToolbarItem = $(html `<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
106
102
  CleanupRegistry.unregister(this, 'compact_toolbar');
@@ -123,8 +119,7 @@ export class TableView extends HTMLElement {
123
119
  };
124
120
  #observers = new MutationObserverSet(this.#renderColumns);
125
121
  #handleStyleChange = () => {
126
- if (devFlags.debug)
127
- console.debug(`${_a.name} ⚡️ style`);
122
+ debug(`${_a.name} ⚡️ style`);
128
123
  const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
129
124
  if (!target)
130
125
  return;
@@ -3,7 +3,7 @@ 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, set } from '../internal/utils';
6
+ import { $, compareBigDecimals, debug, kebabCase, onoff, set } from '../internal/utils';
7
7
  import { queryMorph } from '../morphdom';
8
8
  import { html } from '../tpl';
9
9
  const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
@@ -58,8 +58,7 @@ export class TextField extends FormAssociatedBase {
58
58
  </label>`));
59
59
  }
60
60
  #renderValidityMsgs = (entries) => {
61
- if (devFlags.debug)
62
- console.debug(`${_a.name} ⚡️ mutation`);
61
+ debug(`${_a.name} ⚡️ mutation`);
63
62
  this.setValidity(this.validity, this.validationMessage);
64
63
  };
65
64
  #shadowRoot;
@@ -96,8 +95,7 @@ export class TextField extends FormAssociatedBase {
96
95
  }, I18n.on).on());
97
96
  }
98
97
  attributeChangedCallback(name, oldValue, newValue) {
99
- if (devFlags.debug)
100
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
98
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
101
99
  switch (name) {
102
100
  case 'keyboard-type':
103
101
  switch (newValue) {
@@ -224,8 +222,7 @@ export class TextField extends FormAssociatedBase {
224
222
  }
225
223
  }
226
224
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
227
- if (devFlags.debug)
228
- console.debug(`${_a.name} ⚡️ ${type}`);
225
+ debug(`${_a.name} ⚡️ ${type}`);
229
226
  if (!(slot instanceof HTMLSlotElement))
230
227
  return;
231
228
  const assigned = slot.assignedElements();
@@ -234,8 +231,7 @@ export class TextField extends FormAssociatedBase {
234
231
  this.#renderValidityMsgs([]);
235
232
  };
236
233
  #handleFocusin = (evt) => {
237
- if (devFlags.debug)
238
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
234
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
239
235
  if (evt.target === this)
240
236
  this.#input?.focus();
241
237
  };
@@ -266,8 +262,7 @@ export class TextField extends FormAssociatedBase {
266
262
  this.dispatchEvent(new CustomEvent('commit', { detail: { text: this.text }, bubbles: true, composed: true }));
267
263
  };
268
264
  #handleInputPaste = (evt) => {
269
- if (devFlags.debug)
270
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
265
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
271
266
  const { target: input } = evt;
272
267
  if (!(input instanceof HTMLInputElement))
273
268
  return;
@@ -370,8 +365,7 @@ export class TextField extends FormAssociatedBase {
370
365
  }
371
366
  };
372
367
  #handleInputBeforeinput = (evt) => {
373
- if (devFlags.debug)
374
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
368
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
375
369
  const { target: input } = evt;
376
370
  if (!(input instanceof HTMLInputElement))
377
371
  return;
@@ -406,8 +400,7 @@ export class TextField extends FormAssociatedBase {
406
400
  }
407
401
  };
408
402
  #handleInputBlur = ({ type, target: input }) => {
409
- if (devFlags.debug)
410
- console.debug(`${_a.name} ⚡️ ${type}`);
403
+ debug(`${_a.name} ⚡️ ${type}`);
411
404
  if (!(input instanceof HTMLInputElement))
412
405
  return;
413
406
  if (0 === input.value.length)
@@ -418,8 +411,7 @@ export class TextField extends FormAssociatedBase {
418
411
  this.#sendValueToForm();
419
412
  };
420
413
  #handleInputInput = (evt) => {
421
- if (devFlags.debug)
422
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
414
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
423
415
  this.#sendValueToForm();
424
416
  };
425
417
  /**
@@ -497,8 +489,7 @@ export class TextField extends FormAssociatedBase {
497
489
  message = kebabCase(key);
498
490
  break;
499
491
  }
500
- if (devFlags.debug)
501
- console.debug(`${_a.name} ⚡️ validity-change`);
492
+ debug(`${_a.name} ⚡️ validity-change`);
502
493
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
503
494
  };
504
495
  setCustomValidity = (message) => {
@@ -1,19 +1,16 @@
1
- import { devFlags } from '../internal/utils';
1
+ import { debug } from '../internal/utils';
2
2
  export class TextView extends HTMLElement {
3
3
  constructor() {
4
4
  super();
5
5
  }
6
6
  connectedCallback() {
7
- if (devFlags.debug)
8
- console.debug(`${TextView.name} ⚡️ connect`);
7
+ debug(`${TextView.name} ⚡️ connect`);
9
8
  }
10
9
  disconnectedCallback() {
11
- if (devFlags.debug)
12
- console.debug(`${TextView.name} ⚡️ disconnect`);
10
+ debug(`${TextView.name} ⚡️ disconnect`);
13
11
  }
14
12
  attributeChangedCallback(name, oldValue, newValue) {
15
- if (devFlags.debug)
16
- console.debug(`${TextView.name} ⚡️ attr-change [${name}]`);
13
+ debug(`${TextView.name} ⚡️ attr-change [${name}]`);
17
14
  //
18
15
  }
19
16
  }
@@ -2,7 +2,7 @@ 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, touchGlass } from '../internal/utils';
5
+ import { $, debug, kebabCase, onoff, touchGlass } from '../internal/utils';
6
6
  import { queryMorph } from '../morphdom';
7
7
  import { html } from '../tpl';
8
8
  const toggleStyles = ['switch', 'button'];
@@ -49,8 +49,7 @@ export class ToggleView extends FormAssociatedBase {
49
49
  </label>`));
50
50
  }
51
51
  #renderValidityMsgs = (entries) => {
52
- if (devFlags.debug)
53
- console.debug(`${_a.name} ⚡️ mutation`);
52
+ debug(`${_a.name} ⚡️ mutation`);
54
53
  this.setValidity(this.validity, this.validationMessage);
55
54
  };
56
55
  #shadowRoot;
@@ -70,8 +69,7 @@ export class ToggleView extends FormAssociatedBase {
70
69
  return this.#trackWidth - this.#dotSize;
71
70
  }
72
71
  #handleMeasure = ([{ target, borderBoxSize }]) => {
73
- if (devFlags.debug)
74
- console.debug(`${_a.name} ⚡️ measure`);
72
+ debug(`${_a.name} ⚡️ measure`);
75
73
  if (!(target instanceof HTMLElement))
76
74
  return;
77
75
  this.#trackWidth = borderBoxSize.at(0)?.inlineSize ?? 0;
@@ -110,8 +108,7 @@ export class ToggleView extends FormAssociatedBase {
110
108
  CleanupRegistry.register(this, onoff([{ types: 'blur', listener: this.#handleWindowBlur }], self).on());
111
109
  }
112
110
  attributeChangedCallback(name, oldValue, newValue) {
113
- if (devFlags.debug)
114
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
111
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
115
112
  switch (name) {
116
113
  case 'value':
117
114
  this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
@@ -164,8 +161,7 @@ export class ToggleView extends FormAssociatedBase {
164
161
  this.ariaChecked = `${this.#isOn}`;
165
162
  }
166
163
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
167
- if (devFlags.debug)
168
- console.debug(`${_a.name} ⚡️ ${type}`);
164
+ debug(`${_a.name} ⚡️ ${type}`);
169
165
  if (!(slot instanceof HTMLSlotElement))
170
166
  return;
171
167
  const assigned = slot.assignedElements();
@@ -173,14 +169,12 @@ export class ToggleView extends FormAssociatedBase {
173
169
  this.#renderValidityMsgs([]);
174
170
  };
175
171
  #handleFocusin = ({ type, target }) => {
176
- if (devFlags.debug)
177
- console.debug(`${_a.name} ⚡️ ${type}`);
172
+ debug(`${_a.name} ⚡️ ${type}`);
178
173
  if (target === this)
179
174
  this.#track?.focus();
180
175
  };
181
176
  #handleTrackClick = ({ type }) => {
182
- if (devFlags.debug)
183
- console.debug(`${_a.name} ⚡️ ${type}`);
177
+ debug(`${_a.name} ⚡️ ${type}`);
184
178
  if (this.#didDrag)
185
179
  return (this.#didDrag = false);
186
180
  this.#applyIsOnWithFlip(!this.isOn);
@@ -199,8 +193,7 @@ export class ToggleView extends FormAssociatedBase {
199
193
  return this.isOn ? this.#trackMaxX : this.#trackMinX;
200
194
  }
201
195
  #handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
202
- if (devFlags.debug)
203
- console.debug(`${_a.name} ⚡️ ${type}`);
196
+ debug(`${_a.name} ⚡️ ${type}`);
204
197
  if (!this.#track)
205
198
  return;
206
199
  if (!this.#measurePointerIsOverDot(clientX, clientY))
@@ -212,15 +205,13 @@ export class ToggleView extends FormAssociatedBase {
212
205
  this.#track.setPointerCapture(pointerId);
213
206
  };
214
207
  #handleTrackPointermove = ({ type, clientX }) => {
215
- if (devFlags.debug)
216
- console.debug(`${_a.name} ⚡️ ${type}`);
208
+ debug(`${_a.name} ⚡️ ${type}`);
217
209
  if (!this.#isDragging)
218
210
  return;
219
211
  this.#updateFromEvent(clientX);
220
212
  };
221
213
  #handleTrackPointerup = ({ type, pointerId }) => {
222
- if (devFlags.debug)
223
- console.debug(`${_a.name} ⚡️ ${type}`);
214
+ debug(`${_a.name} ⚡️ ${type}`);
224
215
  if (!this.#isDragging)
225
216
  return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
226
217
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
@@ -228,8 +219,7 @@ export class ToggleView extends FormAssociatedBase {
228
219
  this.#settle();
229
220
  };
230
221
  #handleTrackPointercancel = ({ type }) => {
231
- if (devFlags.debug)
232
- console.debug(`${_a.name} ⚡️ ${type}`);
222
+ debug(`${_a.name} ⚡️ ${type}`);
233
223
  if (!this.#isDragging)
234
224
  return; // already settled via pointerup, or nothing to settle
235
225
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
@@ -261,8 +251,7 @@ export class ToggleView extends FormAssociatedBase {
261
251
  this.#sendValueToForm(true);
262
252
  };
263
253
  #handleTrackKeydown = (evt) => {
264
- if (devFlags.debug)
265
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
254
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
266
255
  if (' ' !== evt.key)
267
256
  return;
268
257
  evt.preventDefault();
@@ -342,8 +331,7 @@ export class ToggleView extends FormAssociatedBase {
342
331
  message = kebabCase(key);
343
332
  break;
344
333
  }
345
- if (devFlags.debug)
346
- console.debug(`${_a.name} ⚡️ validity-change`);
334
+ debug(`${_a.name} ⚡️ validity-change`);
347
335
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
348
336
  };
349
337
  setCustomValidity = (message) => {
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var ToolBarItemGroup_1;
8
8
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
9
9
  import { adaptiveSlot } from '../internal/decorators';
10
- import { devFlags } from '../internal/utils';
10
+ import { debug } from '../internal/utils';
11
11
  /**
12
12
  * @summary A container view that groups items together in the toolbar or navigation bar.
13
13
  */
@@ -16,12 +16,10 @@ let ToolBarItemGroup = ToolBarItemGroup_1 = class ToolBarItemGroup extends HTMLE
16
16
  super();
17
17
  }
18
18
  connectedCallback() {
19
- if (devFlags.debug)
20
- console.debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
19
+ debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
21
20
  }
22
21
  disconnectedCallback() {
23
- if (devFlags.debug)
24
- console.debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
22
+ debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
25
23
  CleanupRegistry.unregister(this);
26
24
  }
27
25
  };
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var ToolBarItem_1;
8
8
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
9
9
  import { adaptiveSlot } from '../internal/decorators';
10
- import { devFlags, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
10
+ import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
11
11
  import { Snapshot } from '../snapshot';
12
12
  /**
13
13
  * @summary A view placed in the toolbar or navigation bar.
@@ -21,8 +21,7 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
21
21
  super();
22
22
  }
23
23
  attributeChangedCallback(name, oldValue, newValue) {
24
- if (devFlags.debug)
25
- console.debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
24
+ debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
26
25
  switch (name) {
27
26
  case 'slot':
28
27
  case 'data-previous-slot':
@@ -46,14 +45,12 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
46
45
  }
47
46
  }
48
47
  disconnectedCallback() {
49
- if (devFlags.debug)
50
- console.debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
48
+ debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
51
49
  this.#mutationObserver?.disconnect();
52
50
  CleanupRegistry.unregister(this);
53
51
  }
54
52
  connectedCallback() {
55
- if (devFlags.debug)
56
- console.debug(`${ToolBarItem_1.name} ⚡️ connect`);
53
+ debug(`${ToolBarItem_1.name} ⚡️ connect`);
57
54
  CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, ({ target }) => {
58
55
  if (!(target instanceof HTMLElement))
59
56
  return true;
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
3
- import { $, devFlags } from '../internal/utils';
3
+ import { $, debug } from '../internal/utils';
4
4
  import { html } from '../tpl';
5
5
  const observers = new ResizeObserverSingleton();
6
6
  /**
@@ -58,8 +58,7 @@ export class ToolBar extends HTMLElement {
58
58
  this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
59
59
  }
60
60
  connectedCallback() {
61
- if (devFlags.debug)
62
- console.debug(`${_a.name} ⚡️ connect`);
61
+ debug(`${_a.name} ⚡️ connect`);
63
62
  // NOTE: wait for config
64
63
  // Snapshot.waitReady.then(() => {
65
64
  for (const el of this.#shadowRoot.querySelectorAll(`[part*="toolbar-leading-stack"],[part*="toolbar-trailing-stack"]`))
@@ -67,13 +66,11 @@ export class ToolBar extends HTMLElement {
67
66
  // })
68
67
  }
69
68
  disconnectedCallback() {
70
- if (devFlags.debug)
71
- console.debug(`${_a.name} ⚡️ disconnect`);
69
+ debug(`${_a.name} ⚡️ disconnect`);
72
70
  observers.unobserve(this);
73
71
  }
74
72
  #measureStacks(entry) {
75
- if (devFlags.debug)
76
- console.debug(`${_a.name} ⚡️ measure`);
73
+ debug(`${_a.name} ⚡️ measure`);
77
74
  if (this.closest('[hidden]'))
78
75
  return;
79
76
  const leading = 'toolbar-leading-stack', trailing = 'toolbar-trailing-stack';
@@ -0,0 +1,11 @@
1
+ export declare class VDivider extends HTMLElement {
2
+ constructor();
3
+ connectedCallback(): void;
4
+ disconnectedCallback(): void;
5
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'v-divider': VDivider;
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ import { debug } from '../internal/utils';
2
+ export class VDivider extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ }
6
+ connectedCallback() {
7
+ debug(`${VDivider.name} ⚡️ connect`);
8
+ }
9
+ disconnectedCallback() {
10
+ debug(`${VDivider.name} ⚡️ disconnect`);
11
+ }
12
+ attributeChangedCallback(name, oldValue, newValue) {
13
+ debug(`${VDivider.name} ⚡️ attr-change [${name}]`);
14
+ }
15
+ }