@swiftwc/ui 0.0.0-dev.102 → 0.0.0-dev.105

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 (90) hide show
  1. package/generated/client/index.js +5 -5
  2. package/generated/components/alert-dialog.js +10 -17
  3. package/generated/components/body-view.js +3 -5
  4. package/generated/components/bordered-button.js +5 -7
  5. package/generated/components/bordered-prominent-button.js +5 -7
  6. package/generated/components/borderless-button.js +5 -7
  7. package/generated/components/color-scheme.js +4 -7
  8. package/generated/components/confirmation-dialog.js +10 -17
  9. package/generated/components/content-unavailable.js +5 -7
  10. package/generated/components/date-picker.js +14 -25
  11. package/generated/components/detail-placeholder.js +4 -8
  12. package/generated/components/disclosure-group.js +6 -9
  13. package/generated/components/fine-tooltip.js +5 -7
  14. package/generated/components/form-view.js +4 -5
  15. package/generated/components/glass-button.js +5 -7
  16. package/generated/components/glass-prominent-button.js +5 -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 +5 -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 +5 -7
  24. package/generated/components/labeled-content.js +5 -7
  25. package/generated/components/list-view.js +4 -5
  26. package/generated/components/menu-view.js +11 -19
  27. package/generated/components/navigation-large-title.js +6 -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 +62 -62
  32. package/generated/components/plain-button.js +4 -5
  33. package/generated/components/progress-view.js +7 -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 +10 -16
  37. package/generated/components/search-view.js +5 -7
  38. package/generated/components/section-view.js +5 -7
  39. package/generated/components/sheet-view.js +7 -11
  40. package/generated/components/sidebar-toggle.js +6 -9
  41. package/generated/components/sidebar-view.js +3 -3
  42. package/generated/components/sticky-container.js +4 -5
  43. package/generated/components/tab-bar.js +5 -7
  44. package/generated/components/tab-item.js +9 -15
  45. package/generated/components/tab-view.js +9 -14
  46. package/generated/components/table-view.js +7 -11
  47. package/generated/components/text-field.js +11 -19
  48. package/generated/components/text-view.js +4 -7
  49. package/generated/components/toggle-view.js +14 -25
  50. package/generated/components/tool-bar-item-group.js +3 -5
  51. package/generated/components/tool-bar-item.js +5 -7
  52. package/generated/components/tool-bar.js +5 -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 +9 -12
  56. package/generated/components/v-stack.js +3 -5
  57. package/generated/css/index.css +15 -7
  58. package/generated/internal/class/css-style-observer.js +3 -3
  59. package/generated/internal/class/form-associated-base.js +5 -7
  60. package/generated/internal/class/navigation-view.js +4 -5
  61. package/generated/internal/decorators/adaptive-slot.js +5 -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/index.d.ts +35 -1
  69. package/generated/internal/utils/index.js +35 -4
  70. package/generated/snapshot/index.js +4 -5
  71. package/package.json +10 -7
  72. package/scss/components/_index.scss +3 -1
  73. package/scss/components/_picker-view.scss +2 -2
  74. package/web-components.html-data/en.json +8 -0
  75. package/generated/internal/utils/cash/index.d.ts +0 -24
  76. package/generated/internal/utils/cash/index.js +0 -27
  77. /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
  78. /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
  79. /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
  80. /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
  81. /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
  82. /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
  83. /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
  84. /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
  85. /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
  86. /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
  87. /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
  88. /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
  89. /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
  90. /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
@@ -2,10 +2,12 @@ import { alertDialog, confirmationDialog as confirmationDialogBus, lifecycleObse
2
2
  import * as Components from '../components';
3
3
  import { I18n } from '../i18n';
4
4
  import { NavigationPath } from '../internal/class/navigation-path';
5
+ import flags from '../internal/flags.json' with { type: 'json' };
5
6
  import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
6
- import { $, devFlags, kebabCase, onoff } from '../internal/utils';
7
+ import { $, kebabCase, onoff } from '../internal/utils';
7
8
  import { Snapshot } from '../snapshot';
8
9
  import { html, render } from '../tpl';
10
+ flags.DEBUG && console.debug(flags);
9
11
  //#region polyfills
10
12
  export const polyfills = new Map();
11
13
  for (const [k, Ctor] of Object.entries(Components)) {
@@ -26,8 +28,7 @@ for (const [k, Ctor] of Object.entries(Components)) {
26
28
  if (!customElements.get(is))
27
29
  customElements.define(is, Ctor);
28
30
  }
29
- if (devFlags.debug)
30
- console.debug(polyfills);
31
+ flags.DEBUG && console.debug(polyfills);
31
32
  if (0 < polyfills.size) {
32
33
  const polyfillTagNamesCache = new Set([...polyfills.values()].map((v) => String(v.polyfillExtends ?? '').toUpperCase()).filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
33
34
  const handlers = new WeakMap();
@@ -57,8 +58,7 @@ if (0 < polyfills.size) {
57
58
  }, unobserve = (el) => {
58
59
  handlers.delete(el);
59
60
  }, polyfillTagNamesCacheSelector = [...polyfillTagNamesCache.values()].map((v) => `${v}`.toLowerCase()).join(','), flatten = (node) => [node, ...(node.querySelectorAll?.(polyfillTagNamesCacheSelector) ?? [])];
60
- if (devFlags.debug)
61
- console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
61
+ flags.DEBUG && console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
62
62
  for (const [is, polyfill] of polyfills)
63
63
  for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${CSS.escape(is)}"]`)) {
64
64
  polyfill.polyfillConnectedCallback(el);
@@ -1,6 +1,7 @@
1
1
  import { alertDialog } from '../buses';
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { devFlags, onoff, touchGlass } from '../internal/utils';
3
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
4
+ import { onoff, touchGlass } from '../internal/utils';
4
5
  import { DialogBase } from '../namespace-browser/base';
5
6
  /**
6
7
  * @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
@@ -10,8 +11,7 @@ export class AlertDialog extends DialogBase {
10
11
  super();
11
12
  }
12
13
  static polyfillDisconnectedCallback(el) {
13
- if (devFlags.debug)
14
- console.debug(`${AlertDialog.name} ⚡️ disconnect`);
14
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ disconnect`);
15
15
  CleanupRegistry.unregister(el);
16
16
  alertDialog.dispatchEvent(new CustomEvent('alert:return', {
17
17
  detail: { returnValue: el.returnValue },
@@ -20,8 +20,7 @@ export class AlertDialog extends DialogBase {
20
20
  }));
21
21
  }
22
22
  static polyfillConnectedCallback(el) {
23
- if (devFlags.debug)
24
- console.debug(`${AlertDialog.name} ⚡️ connect`);
23
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ connect`);
25
24
  CleanupRegistry.register(el, onoff([
26
25
  { types: 'click', listener: this.#handleDialogClick },
27
26
  { types: 'close', listener: this.#handleDialogClose },
@@ -34,8 +33,7 @@ export class AlertDialog extends DialogBase {
34
33
  return false;
35
34
  return true;
36
35
  }), el).on());
37
- if (devFlags.debug)
38
- console.debug(`${AlertDialog.name} ⚡️ will-open`);
36
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ will-open`);
39
37
  el.removeAttribute('closing');
40
38
  el.scrollTop = 0;
41
39
  el.returnValue = '';
@@ -43,8 +41,7 @@ export class AlertDialog extends DialogBase {
43
41
  el.showModal();
44
42
  }
45
43
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
46
- if (devFlags.debug)
47
- console.debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
44
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
48
45
  switch (attributeName) {
49
46
  case 'label':
50
47
  //
@@ -52,8 +49,7 @@ export class AlertDialog extends DialogBase {
52
49
  }
53
50
  }
54
51
  static #handleDialogClick = (evt) => {
55
- if (devFlags.debug)
56
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
52
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
57
53
  const { target, currentTarget: dialog } = evt;
58
54
  if (!(dialog instanceof HTMLDialogElement))
59
55
  return;
@@ -73,8 +69,7 @@ export class AlertDialog extends DialogBase {
73
69
  evt.stopImmediatePropagation();
74
70
  };
75
71
  static #handleDialogCancel = (evt) => {
76
- if (devFlags.debug)
77
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
72
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
78
73
  if (!evt.cancelable)
79
74
  return;
80
75
  const { target } = evt;
@@ -82,8 +77,7 @@ export class AlertDialog extends DialogBase {
82
77
  return;
83
78
  evt.preventDefault();
84
79
  target.inert = true;
85
- if (devFlags.debug)
86
- console.debug(`${AlertDialog.name} ⚡️ will-close`);
80
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ will-close`);
87
81
  target.setAttribute('closing', '');
88
82
  Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
89
83
  if (!target.hasAttribute('closing'))
@@ -93,8 +87,7 @@ export class AlertDialog extends DialogBase {
93
87
  });
94
88
  };
95
89
  static #handleDialogClose = ({ type, target }) => {
96
- if (devFlags.debug)
97
- console.debug(`${AlertDialog.name} ⚡️ ${type}`);
90
+ DEBUG && console.debug(`${AlertDialog.name} ⚡️ ${type}`);
98
91
  if (!(target instanceof HTMLDialogElement))
99
92
  return;
100
93
  target.remove();
@@ -1,4 +1,4 @@
1
- import { devFlags } from '../internal/utils';
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
2
  /**
3
3
  * @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
4
4
  */
@@ -7,11 +7,9 @@ export class BodyView extends HTMLElement {
7
7
  super();
8
8
  }
9
9
  disconnectedCallback() {
10
- if (devFlags.debug)
11
- console.debug(`${BodyView.name} ⚡️ disconnect`);
10
+ DEBUG && console.debug(`${BodyView.name} ⚡️ disconnect`);
12
11
  }
13
12
  connectedCallback() {
14
- if (devFlags.debug)
15
- console.debug(`${BodyView.name} ⚡️ connect`);
13
+ DEBUG && console.debug(`${BodyView.name} ⚡️ connect`);
16
14
  }
17
15
  }
@@ -1,5 +1,6 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
2
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
3
+ import { ensurePlaceholder, onoff } from '../internal/utils';
3
4
  import { ButtonBase } from '../namespace-browser/base';
4
5
  import { Snapshot } from '../snapshot';
5
6
  /**
@@ -25,19 +26,16 @@ export class BorderedButton extends ButtonBase {
25
26
  super();
26
27
  }
27
28
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedButton.name} ⚡️ disconnect`);
29
+ DEBUG && console.debug(`${BorderedButton.name} ⚡️ disconnect`);
30
30
  CleanupRegistry.unregister(el);
31
31
  }
32
32
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedButton.name} ⚡️ connect`);
33
+ DEBUG && console.debug(`${BorderedButton.name} ⚡️ connect`);
35
34
  el.tabIndex = 0;
36
35
  CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
37
36
  }
38
37
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
38
+ DEBUG && console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
39
  const node = target instanceof HTMLButtonElement;
42
40
  if (!node)
43
41
  return;
@@ -1,5 +1,6 @@
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ensurePlaceholder, onoff } from '../internal/utils';
3
4
  import { ButtonBase } from '../namespace-browser/base';
4
5
  import { Snapshot } from '../snapshot';
5
6
  /**
@@ -25,19 +26,16 @@ export class BorderedProminentButton extends ButtonBase {
25
26
  super();
26
27
  }
27
28
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
29
+ DEBUG && console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
30
30
  CleanupRegistry.unregister(el);
31
31
  }
32
32
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
33
+ DEBUG && console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
35
34
  el.tabIndex = 0;
36
35
  CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
37
36
  }
38
37
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
38
+ DEBUG && console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
39
  const node = target instanceof HTMLButtonElement;
42
40
  if (!node)
43
41
  return;
@@ -1,5 +1,6 @@
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ensurePlaceholder, onoff } from '../internal/utils';
3
4
  import { ButtonBase } from '../namespace-browser/base';
4
5
  import { Snapshot } from '../snapshot';
5
6
  /**
@@ -25,19 +26,16 @@ export class BorderlessButton extends ButtonBase {
25
26
  super();
26
27
  }
27
28
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
29
+ DEBUG && console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
30
30
  CleanupRegistry.unregister(el);
31
31
  }
32
32
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderlessButton.name} ⚡️ connect`);
33
+ DEBUG && console.debug(`${BorderlessButton.name} ⚡️ connect`);
35
34
  el.tabIndex = 0;
36
35
  CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
37
36
  }
38
37
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
38
+ DEBUG && console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
39
  const node = target instanceof HTMLButtonElement;
42
40
  if (!node)
43
41
  return;
@@ -1,4 +1,4 @@
1
- import { devFlags } from '../internal/utils';
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
2
  export class ColorScheme extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ['dark'];
@@ -7,18 +7,15 @@ export class ColorScheme extends HTMLElement {
7
7
  super();
8
8
  }
9
9
  connectedCallback() {
10
- if (devFlags.debug)
11
- console.debug(`${ColorScheme.name} ⚡️ connect`);
10
+ DEBUG && console.debug(`${ColorScheme.name} ⚡️ connect`);
12
11
  this.hidden = true;
13
12
  this.inert = true;
14
13
  }
15
14
  disconnectedCallback() {
16
- if (devFlags.debug)
17
- console.debug(`${ColorScheme.name} ⚡️ disconnect`);
15
+ DEBUG && console.debug(`${ColorScheme.name} ⚡️ disconnect`);
18
16
  }
19
17
  attributeChangedCallback(name, oldValue, newValue) {
20
- if (devFlags.debug)
21
- console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
18
+ DEBUG && console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
22
19
  // self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
23
20
  if (newValue)
24
21
  self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
@@ -1,6 +1,7 @@
1
1
  import { confirmationDialog } from '../buses';
2
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
4
+ import { isInside, onoff, touchGlass } from '../internal/utils';
4
5
  import { DialogBase } from '../namespace-browser/base';
5
6
  /**
6
7
  * @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?')`.
@@ -13,8 +14,7 @@ export class ConfirmationDialog extends DialogBase {
13
14
  super();
14
15
  }
15
16
  static polyfillDisconnectedCallback(el) {
16
- if (devFlags.debug)
17
- console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
17
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
18
18
  const positionAnchor = el.style.getPropertyValue('position-anchor');
19
19
  document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
20
20
  el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
@@ -26,8 +26,7 @@ export class ConfirmationDialog extends DialogBase {
26
26
  }));
27
27
  }
28
28
  static polyfillConnectedCallback(el) {
29
- if (devFlags.debug)
30
- console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
29
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
31
30
  CleanupRegistry.register(el, onoff([
32
31
  { types: 'click', listener: this.#handleDialogClick },
33
32
  { types: 'close', listener: this.#handleDialogClose },
@@ -41,8 +40,7 @@ export class ConfirmationDialog extends DialogBase {
41
40
  // if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
42
41
  return true;
43
42
  }), el).on());
44
- if (devFlags.debug)
45
- console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
43
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
46
44
  el.removeAttribute('closing');
47
45
  el.scrollTop = 0;
48
46
  el.returnValue = '';
@@ -50,8 +48,7 @@ export class ConfirmationDialog extends DialogBase {
50
48
  el.showModal();
51
49
  }
52
50
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
53
- if (devFlags.debug)
54
- console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
51
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
55
52
  // const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
56
53
  switch (attributeName) {
57
54
  case 'label':
@@ -64,8 +61,7 @@ export class ConfirmationDialog extends DialogBase {
64
61
  }
65
62
  }
66
63
  static #handleDialogClick = (evt) => {
67
- if (devFlags.debug)
68
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
64
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
69
65
  const { target, currentTarget: dialog } = evt;
70
66
  if (!(dialog instanceof HTMLDialogElement))
71
67
  return;
@@ -87,8 +83,7 @@ export class ConfirmationDialog extends DialogBase {
87
83
  evt.stopImmediatePropagation();
88
84
  };
89
85
  static #handleDialogCancel = (evt) => {
90
- if (devFlags.debug)
91
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
86
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
92
87
  if (!evt.cancelable)
93
88
  return;
94
89
  const { target } = evt;
@@ -96,8 +91,7 @@ export class ConfirmationDialog extends DialogBase {
96
91
  return;
97
92
  evt.preventDefault();
98
93
  target.inert = true;
99
- if (devFlags.debug)
100
- console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
94
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
101
95
  target.setAttribute('closing', '');
102
96
  Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
103
97
  if (!target.hasAttribute('closing'))
@@ -107,8 +101,7 @@ export class ConfirmationDialog extends DialogBase {
107
101
  });
108
102
  };
109
103
  static #handleDialogClose = ({ type, target }) => {
110
- if (devFlags.debug)
111
- console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
104
+ DEBUG && console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
112
105
  if (!(target instanceof HTMLDialogElement))
113
106
  return;
114
107
  target.remove();
@@ -1,6 +1,7 @@
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
2
  import { I18n } from '../i18n';
2
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { $, devFlags, onoff } from '../internal/utils';
4
+ import { $, onoff } from '../internal/utils';
4
5
  import { html } from '../tpl';
5
6
  /**
6
7
  * @summary A message with a title and extra information that you show when part of your app can’t be used.
@@ -47,8 +48,7 @@ export class ContentUnavailable extends HTMLElement {
47
48
  };
48
49
  }
49
50
  attributeChangedCallback(name, oldValue, newValue) {
50
- if (devFlags.debug)
51
- console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
51
+ DEBUG && console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
52
52
  switch (name) {
53
53
  case 'search':
54
54
  if (oldValue === newValue)
@@ -62,12 +62,10 @@ export class ContentUnavailable extends HTMLElement {
62
62
  }
63
63
  }
64
64
  disconnectedCallback() {
65
- if (devFlags.debug)
66
- console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
65
+ DEBUG && console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
67
66
  }
68
67
  connectedCallback() {
69
- if (devFlags.debug)
70
- console.debug(`${ContentUnavailable.name} ⚡️ connect`);
68
+ DEBUG && console.debug(`${ContentUnavailable.name} ⚡️ connect`);
71
69
  }
72
70
  #renderSearch = (search) => {
73
71
  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'));
@@ -1,9 +1,10 @@
1
1
  var _a;
2
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
3
  import { I18n } from '../i18n';
3
4
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
5
  import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
5
6
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
6
- import { $, clamp, devFlags, kebabCase, onoff, set } from '../internal/utils';
7
+ import { $, clamp, kebabCase, onoff, set } from '../internal/utils';
7
8
  import { queryMorph } from '../morphdom';
8
9
  import { html } from '../tpl';
9
10
  const datePickerStyles = ['graphical', 'field', 'automatic'];
@@ -37,8 +38,7 @@ export class DatePicker extends FormAssociatedBase {
37
38
  static #templates = new Map();
38
39
  // #lastRenderedStyle?: DatePickerStyle //string | null
39
40
  #renderValidityMsgs = (entries) => {
40
- if (devFlags.debug)
41
- console.debug(`${_a.name} ⚡️ mutation`);
41
+ DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
42
42
  this.setValidity(this.validity, this.validationMessage);
43
43
  };
44
44
  #shadowRoot;
@@ -76,8 +76,7 @@ export class DatePicker extends FormAssociatedBase {
76
76
  this.#shadowRoot = this.attachShadow({ mode: 'closed' });
77
77
  }
78
78
  attributeChangedCallback(name, oldValue, newValue) {
79
- if (devFlags.debug)
80
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
79
+ DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
81
80
  switch (name) {
82
81
  case 'selection':
83
82
  // nothing happens// const [y = '', m = '', d = ''] = (newValue ?? '').split(/\D+/)
@@ -130,8 +129,7 @@ export class DatePicker extends FormAssociatedBase {
130
129
  return datePickerStyles.includes(this.getAttribute('date-picker-style') ?? '') ? this.getAttribute('date-picker-style') : 'automatic';
131
130
  }
132
131
  #render() {
133
- if (devFlags.debug)
134
- console.debug(`${_a.name} ⚡️ #render (${this.datePickerStyle})`);
132
+ DEBUG && console.debug(`${_a.name} ⚡️ #render (${this.datePickerStyle})`);
135
133
  // if (this.#lastRenderedStyle === this.datePickerStyle) return // skip if already applied
136
134
  // this.#lastRenderedStyle = this.datePickerStyle
137
135
  // clear shadow DOM
@@ -175,8 +173,7 @@ export class DatePicker extends FormAssociatedBase {
175
173
  }
176
174
  }
177
175
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
178
- if (devFlags.debug)
179
- console.debug(`${_a.name} ⚡️ ${type}`);
176
+ DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
180
177
  if (!(slot instanceof HTMLSlotElement))
181
178
  return;
182
179
  const assigned = slot.assignedElements();
@@ -204,8 +201,7 @@ export class DatePicker extends FormAssociatedBase {
204
201
  }
205
202
  }
206
203
  #handleClick = (evt) => {
207
- if (devFlags.debug)
208
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
204
+ DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
209
205
  const { target } = evt;
210
206
  if (!(target instanceof HTMLElement))
211
207
  return;
@@ -248,8 +244,7 @@ export class DatePicker extends FormAssociatedBase {
248
244
  this.dispatchEvent(new CustomEvent('selection', { detail: { selection }, bubbles: true, composed: true }));
249
245
  };
250
246
  #handleInputPaste = (evt) => {
251
- if (devFlags.debug)
252
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
247
+ DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
253
248
  const { target: input } = evt;
254
249
  if (!(input instanceof HTMLInputElement))
255
250
  return;
@@ -271,8 +266,7 @@ export class DatePicker extends FormAssociatedBase {
271
266
  this.#sendValueToForm();
272
267
  };
273
268
  #handleInputBeforeinput = (evt) => {
274
- if (devFlags.debug)
275
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
269
+ DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
276
270
  const { target: input } = evt;
277
271
  if (!(input instanceof HTMLInputElement))
278
272
  return;
@@ -295,8 +289,7 @@ export class DatePicker extends FormAssociatedBase {
295
289
  }
296
290
  };
297
291
  #handleInputKeydown = ({ type, target, key }) => {
298
- if (devFlags.debug)
299
- console.debug(`${_a.name} ⚡️ ${type}`);
292
+ DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
300
293
  if (!(target instanceof HTMLInputElement))
301
294
  return;
302
295
  const input = target;
@@ -315,14 +308,12 @@ export class DatePicker extends FormAssociatedBase {
315
308
  this.#inputs[index]?.focus();
316
309
  };
317
310
  #handleInputFocus = (evt) => {
318
- if (devFlags.debug)
319
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
311
+ DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
320
312
  for (const input of this.#inputs)
321
313
  input.classList.toggle('focus', input === evt.target);
322
314
  };
323
315
  #handleInputBlur = ({ target, type }) => {
324
- if (devFlags.debug)
325
- console.debug(`${_a.name} ⚡️ ${type}`);
316
+ DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
326
317
  if (!(target instanceof HTMLInputElement))
327
318
  return;
328
319
  const input = target;
@@ -335,8 +326,7 @@ export class DatePicker extends FormAssociatedBase {
335
326
  this.#sendValueToForm();
336
327
  };
337
328
  #handleInputInput = (evt) => {
338
- if (devFlags.debug)
339
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
329
+ DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
340
330
  this.#sendValueToForm();
341
331
  };
342
332
  /**
@@ -447,8 +437,7 @@ export class DatePicker extends FormAssociatedBase {
447
437
  message = kebabCase(key);
448
438
  break;
449
439
  }
450
- if (devFlags.debug)
451
- console.debug(`${_a.name} ⚡️ validity-change`);
440
+ DEBUG && console.debug(`${_a.name} ⚡️ validity-change`);
452
441
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#inputs.at(0));
453
442
  };
454
443
  setCustomValidity = (message) => {
@@ -1,19 +1,15 @@
1
- import { devFlags } from '../internal/utils';
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
2
  export class DetailPlaceholder extends HTMLElement {
3
3
  constructor() {
4
4
  super();
5
5
  }
6
6
  connectedCallback() {
7
- if (devFlags.debug)
8
- console.debug(`${DetailPlaceholder.name} ⚡️ connect`);
7
+ DEBUG && console.debug(`${DetailPlaceholder.name} ⚡️ connect`);
9
8
  }
10
9
  disconnectedCallback() {
11
- if (devFlags.debug)
12
- console.debug(`${DetailPlaceholder.name} ⚡️ disconnect`);
10
+ DEBUG && console.debug(`${DetailPlaceholder.name} ⚡️ disconnect`);
13
11
  }
14
12
  attributeChangedCallback(name, oldValue, newValue) {
15
- if (devFlags.debug)
16
- console.debug(`${DetailPlaceholder.name} ⚡️ attr-change [${name}]`);
17
- //
13
+ DEBUG && console.debug(`${DetailPlaceholder.name} ⚡️ attr-change [${name}]`);
18
14
  }
19
15
  }
@@ -1,5 +1,6 @@
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { cssTime, devFlags, onoff, timeout } from '../internal/utils';
3
+ import { cssTime, onoff, timeout } from '../internal/utils';
3
4
  import { DetailsBase } from '../namespace-browser/base';
4
5
  const toggleTimers = new WeakMap();
5
6
  /**
@@ -24,18 +25,15 @@ export class DisclosureGroup extends DetailsBase {
24
25
  super();
25
26
  }
26
27
  attributeChangedCallback(name, oldValue, newValue) {
27
- if (devFlags.debug)
28
- console.debug(`${DisclosureGroup.name} ⚡️ attr-change [${name}]`);
28
+ DEBUG && console.debug(`${DisclosureGroup.name} ⚡️ attr-change [${name}]`);
29
29
  // if (CSS.supports('interpolate-size', 'allow-keywords')) return
30
30
  }
31
31
  static polyfillDisconnectedCallback(el) {
32
- if (devFlags.debug)
33
- console.debug(`${DisclosureGroup.name} ⚡️ disconnect`);
32
+ DEBUG && console.debug(`${DisclosureGroup.name} ⚡️ disconnect`);
34
33
  CleanupRegistry.unregister(el);
35
34
  }
36
35
  static polyfillConnectedCallback(el) {
37
- if (devFlags.debug)
38
- console.debug(`${DisclosureGroup.name} ⚡️ connect`);
36
+ DEBUG && console.debug(`${DisclosureGroup.name} ⚡️ connect`);
39
37
  const newValue = el.open ? 'open' : 'closed';
40
38
  if (newValue !== el.dataset.state)
41
39
  el.dataset.state = newValue;
@@ -46,8 +44,7 @@ export class DisclosureGroup extends DetailsBase {
46
44
  });
47
45
  }
48
46
  static #handleToggle = async ({ type, currentTarget: details }) => {
49
- if (devFlags.debug)
50
- console.debug(`${DisclosureGroup.name} ⚡️ ${type}`);
47
+ DEBUG && console.debug(`${DisclosureGroup.name} ⚡️ ${type}`);
51
48
  if (!(details instanceof HTMLDetailsElement))
52
49
  return;
53
50
  const newValue = details.open ? 'opening' : 'closing';
@@ -1,6 +1,7 @@
1
1
  var _a;
2
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { $, devFlags, onoff } from '../internal/utils';
4
+ import { $, onoff } from '../internal/utils';
4
5
  import { html } from '../tpl';
5
6
  /**
6
7
  * @summary A tooltip that shows an unobtrusive helpful message on pointer:fine screens. Use it by adding a `help` attribute to any element.
@@ -20,8 +21,7 @@ export class FineTooltip extends HTMLElement {
20
21
  this.#render(target.getAttribute(attributeName));
21
22
  };
22
23
  #handleMeasure = ([{ target, borderBoxSize }]) => {
23
- if (devFlags.debug)
24
- console.debug(`${_a.name} ⚡️ measure`);
24
+ DEBUG && console.debug(`${_a.name} ⚡️ measure`);
25
25
  if (target.hasAttribute('closing'))
26
26
  return;
27
27
  if (!(target instanceof HTMLElement))
@@ -51,8 +51,7 @@ export class FineTooltip extends HTMLElement {
51
51
  label.removeAttribute('title');
52
52
  };
53
53
  connectedCallback() {
54
- if (devFlags.debug)
55
- console.debug(`${_a.name} ⚡️ connect`);
54
+ DEBUG && console.debug(`${_a.name} ⚡️ connect`);
56
55
  this.removeAttribute('closing');
57
56
  this.popover = 'manual';
58
57
  this.inert = true;
@@ -61,8 +60,7 @@ export class FineTooltip extends HTMLElement {
61
60
  this.showPopover();
62
61
  }
63
62
  disconnectedCallback() {
64
- if (devFlags.debug)
65
- console.debug(`${_a.name} ⚡️ disconnect`);
63
+ DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
66
64
  this.#resizeObserver.unobserve(this);
67
65
  this.#mutationObserver?.disconnect();
68
66
  this.#mutationObserver2?.disconnect();
@@ -1,5 +1,6 @@
1
+ import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, listActive, onoff } from '../internal/utils';
3
+ import { listActive, onoff } from '../internal/utils';
3
4
  import { FormBase } from '../namespace-browser/base';
4
5
  /**
5
6
  * @summary A container view that groups controls together for entering data, like a settings screen.
@@ -11,14 +12,12 @@ export class FormView extends FormBase {
11
12
  super();
12
13
  }
13
14
  static polyfillDisconnectedCallback(el) {
14
- if (devFlags.debug)
15
- console.debug(`${FormView.name} ⚡️ disconnect`);
15
+ DEBUG && console.debug(`${FormView.name} ⚡️ disconnect`);
16
16
  // finally
17
17
  CleanupRegistry.unregister(el);
18
18
  }
19
19
  static polyfillConnectedCallback(el) {
20
- if (devFlags.debug)
21
- console.debug(`${FormView.name} ⚡️ connect`);
20
+ DEBUG && console.debug(`${FormView.name} ⚡️ connect`);
22
21
  if (el.closest('[is=sidebar-view],[is=tab-bar]')) {
23
22
  el.method = 'dialog';
24
23
  el.noValidate = true;