@swiftwc/ui 0.0.0-dev.37 → 0.0.0-dev.39

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 (60) hide show
  1. package/generated/client/index.js +5 -3
  2. package/generated/components/alert-dialog.js +17 -9
  3. package/generated/components/body-view.js +5 -3
  4. package/generated/components/bordered-button.js +7 -4
  5. package/generated/components/bordered-prominent-button.js +7 -4
  6. package/generated/components/borderless-button.js +7 -4
  7. package/generated/components/confirmation-dialog.js +17 -9
  8. package/generated/components/content-unavailable-view.js +7 -4
  9. package/generated/components/date-picker.js +34 -23
  10. package/generated/components/disclosure-group.js +9 -5
  11. package/generated/components/fine-tooltip.js +7 -4
  12. package/generated/components/form-view.js +5 -3
  13. package/generated/components/glass-button.js +7 -4
  14. package/generated/components/glass-prominent-button.js +7 -4
  15. package/generated/components/label-view.js +7 -4
  16. package/generated/components/list-view.js +5 -3
  17. package/generated/components/menu-view.js +19 -10
  18. package/generated/components/navigation-large-title.js +9 -5
  19. package/generated/components/navigation-split-view.js +7 -4
  20. package/generated/components/navigation-stack.js +7 -4
  21. package/generated/components/navigation-title.js +7 -4
  22. package/generated/components/picker-view.d.ts +1 -0
  23. package/generated/components/picker-view.js +185 -83
  24. package/generated/components/plain-button.js +5 -3
  25. package/generated/components/progress-view.js +11 -8
  26. package/generated/components/screen-view.js +3 -2
  27. package/generated/components/scroll-view-proxy.js +5 -3
  28. package/generated/components/scroll-view.js +17 -9
  29. package/generated/components/search-view.js +7 -4
  30. package/generated/components/section-view.js +7 -5
  31. package/generated/components/sheet-view.js +11 -6
  32. package/generated/components/sidebar-toggle.js +9 -5
  33. package/generated/components/sidebar-view.js +3 -2
  34. package/generated/components/sticky-container.js +5 -3
  35. package/generated/components/tab-bar.js +7 -4
  36. package/generated/components/tab-item.js +15 -8
  37. package/generated/components/tab-view.js +14 -8
  38. package/generated/components/table-view.js +13 -8
  39. package/generated/components/text-field.js +27 -17
  40. package/generated/components/tool-bar-item-group.js +5 -3
  41. package/generated/components/tool-bar-item.js +7 -4
  42. package/generated/components/tool-bar.js +7 -4
  43. package/generated/components/v-keyboard.js +9 -5
  44. package/generated/components/v-stack.js +5 -3
  45. package/generated/css/index.css +6 -2
  46. package/generated/events/picker-view.d.ts +1 -0
  47. package/generated/internal/class/css-style-observer.js +3 -2
  48. package/generated/internal/class/form-associated-base.js +7 -5
  49. package/generated/internal/class/navigation-view.js +5 -3
  50. package/generated/internal/decorators/adaptive-slot.js +7 -4
  51. package/generated/internal/privateNamespace.js +22 -13
  52. package/generated/internal/utils/dev-flags.d.ts +3 -0
  53. package/generated/internal/utils/dev-flags.js +5 -0
  54. package/generated/internal/utils/index.d.ts +1 -1
  55. package/generated/internal/utils/index.js +1 -1
  56. package/generated/snapshot/index.js +5 -3
  57. package/package.json +1 -1
  58. package/scss/base/_layout.scss +6 -7
  59. package/generated/internal/utils/debug.d.ts +0 -1
  60. package/generated/internal/utils/debug.js +0 -3
@@ -2,7 +2,7 @@ var _a;
2
2
  import { lifecycleObserver } from '../buses';
3
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
4
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
5
- import { $, debug, frame, onoff, slowHideShow } from '../internal/utils';
5
+ import { $, devFlags, frame, onoff, slowHideShow } from '../internal/utils';
6
6
  const observers = new ResizeObserverSingleton();
7
7
  export class ScrollView extends HTMLElement {
8
8
  static get observedAttributes() {
@@ -41,13 +41,15 @@ export class ScrollView extends HTMLElement {
41
41
  });
42
42
  }
43
43
  disconnectedCallback() {
44
- debug(`${_a.name} ⚡️ disconnect`);
44
+ if (devFlags.debug)
45
+ console.debug(`${_a.name} ⚡️ disconnect`);
45
46
  CleanupRegistry.unregister(this);
46
47
  observers.unobserve(this);
47
48
  frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('pagehide', { detail: { page: this }, bubbles: true, composed: true })));
48
49
  }
49
50
  connectedCallback() {
50
- debug(`${_a.name} ⚡️ connect`);
51
+ if (devFlags.debug)
52
+ console.debug(`${_a.name} ⚡️ connect`);
51
53
  CleanupRegistry.register(this, onoff([
52
54
  // { types: 'tabreveal', listener: this.#handleTabReveal as EventListener },
53
55
  { types: 'beforetabswap', listener: this.#handleTabBeforeswap },
@@ -71,7 +73,8 @@ export class ScrollView extends HTMLElement {
71
73
  // })
72
74
  }
73
75
  attributeChangedCallback(name, oldValue, newValue) {
74
- debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
76
+ if (devFlags.debug)
77
+ console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
75
78
  switch (name) {
76
79
  case 'navigation-inline-title':
77
80
  this.#renderNavTitle(newValue, this.getAttribute('navigation-inline-subtitle'));
@@ -95,7 +98,8 @@ export class ScrollView extends HTMLElement {
95
98
  }
96
99
  }
97
100
  #handleScroll = ({ target, type }) => {
98
- debug(`${_a.name} ⚡️ ${type}`);
101
+ if (devFlags.debug)
102
+ console.debug(`${_a.name} ⚡️ ${type}`);
99
103
  if (!this.#isMidScroll)
100
104
  this.#isMidScroll = true;
101
105
  // if (this.#stopRecordingScrollTop) return
@@ -104,12 +108,14 @@ export class ScrollView extends HTMLElement {
104
108
  this.#lastScrollTop = target.scrollTop;
105
109
  };
106
110
  #handleScrollend = (evt) => {
107
- debug(`${_a.name} ⚡️ ${evt?.type}`);
111
+ if (devFlags.debug)
112
+ console.debug(`${_a.name} ⚡️ ${evt?.type}`);
108
113
  if (this.#isMidScroll)
109
114
  this.#isMidScroll = false;
110
115
  };
111
116
  #handleMeasure = (entry) => {
112
- debug(`${_a.name} ⚡️ measure`);
117
+ if (devFlags.debug)
118
+ console.debug(`${_a.name} ⚡️ measure`);
113
119
  if (0 === entry.contentRect.width + entry.contentRect.height)
114
120
  return;
115
121
  if (undefined === this.#beforeTabSwapLastScrolltop)
@@ -126,7 +132,8 @@ export class ScrollView extends HTMLElement {
126
132
  this.#beforeTabSwapLastScrolltop = undefined;
127
133
  };
128
134
  #handleTabReveal = ({ type, target }) => {
129
- debug(`${_a.name} ⚡️ ${type}`);
135
+ if (devFlags.debug)
136
+ console.debug(`${_a.name} ⚡️ ${type}`);
130
137
  if (!(target instanceof HTMLElement && target))
131
138
  return;
132
139
  if (!target.contains(this))
@@ -157,7 +164,8 @@ export class ScrollView extends HTMLElement {
157
164
  // })
158
165
  };
159
166
  #handleTabBeforeswap = ({ type, target }) => {
160
- debug(`${_a.name} ⚡️ ${type}`);
167
+ if (devFlags.debug)
168
+ console.debug(`${_a.name} ⚡️ ${type}`);
161
169
  if (!(target instanceof HTMLElement && target))
162
170
  return;
163
171
  if (!target.contains(this))
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff, touchGlass } from '../internal/utils';
2
+ import { devFlags, onoff, touchGlass } from '../internal/utils';
3
3
  import { InputBase } from '../namespace-browser/base';
4
4
  export class SearchView extends InputBase {
5
5
  static get observedAttributes() {
@@ -9,16 +9,19 @@ export class SearchView extends InputBase {
9
9
  super();
10
10
  }
11
11
  static polyfillDisconnectedCallback(el) {
12
- debug(`${SearchView.name} ⚡️ disconnect`);
12
+ if (devFlags.debug)
13
+ console.debug(`${SearchView.name} ⚡️ disconnect`);
13
14
  CleanupRegistry.unregister(el);
14
15
  }
15
16
  static polyfillConnectedCallback(el) {
16
- debug(`${SearchView.name} ⚡️ connect`);
17
+ if (devFlags.debug)
18
+ console.debug(`${SearchView.name} ⚡️ connect`);
17
19
  CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
18
20
  el.type = 'search';
19
21
  }
20
22
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
21
- debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
23
+ if (devFlags.debug)
24
+ console.debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
22
25
  const node = target instanceof HTMLInputElement && target;
23
26
  if (!node)
24
27
  return;
@@ -1,4 +1,4 @@
1
- import { $, debug } from '../internal/utils';
1
+ import { $, devFlags } from '../internal/utils';
2
2
  export class SectionView extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ['header', 'footer'];
@@ -32,16 +32,17 @@ export class SectionView extends HTMLElement {
32
32
  // })
33
33
  }
34
34
  disconnectedCallback() {
35
- debug(`${SectionView.name} ⚡️ disconnect`);
35
+ if (devFlags.debug)
36
+ console.debug(`${SectionView.name} ⚡️ disconnect`);
36
37
  // if (this.#sentinel) this.#observer?.unobserve(this.#sentinel)
37
38
  // this.#observer?.unobserve(this)
38
39
  }
39
40
  connectedCallback() {
40
- debug(`${SectionView.name} ⚡️ connect`);
41
+ if (devFlags.debug)
42
+ console.debug(`${SectionView.name} ⚡️ connect`);
41
43
  // this.#sibling = this.closest('scroll-view') ?? undefined
42
44
  // Snapshot.waitReady.then(() => {
43
45
  // if (!(await frame(this))) return // NOTE: Required or BREAKS transitions // self.requestAnimationFrame(() => {
44
- // if (!this.isConnected) return
45
46
  // const blockSizeProp = getComputedStyle(this).getPropertyValue('--navigation-bar-block-size') || '0', //`${document.documentElement.computedStyleMap().get(`--navigation-bar-block-size`) ?? '0'}`, //
46
47
  // blockSize = parseFloat(blockSizeProp) * (blockSizeProp.endsWith('rem') ? parseFloat(getComputedStyle(document.documentElement).fontSize) : 1)
47
48
  // this.#observer = new IntersectionObserver(this.#handleIntersect, {
@@ -54,7 +55,8 @@ export class SectionView extends HTMLElement {
54
55
  // })
55
56
  }
56
57
  attributeChangedCallback(name, oldValue, newValue) {
57
- debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
58
+ if (devFlags.debug)
59
+ console.debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
58
60
  // Snapshot.waitReady.then(() => {
59
61
  switch (name) {
60
62
  case 'header':
@@ -1,16 +1,18 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff } from '../internal/utils';
2
+ import { devFlags, onoff } from '../internal/utils';
3
3
  import { DialogBase } from '../namespace-browser/base';
4
4
  export class SheetView extends DialogBase {
5
5
  constructor() {
6
6
  super();
7
7
  }
8
8
  static polyfillDisconnectedCallback(el) {
9
- debug(`${SheetView.name} ⚡️ disconnect`);
9
+ if (devFlags.debug)
10
+ console.debug(`${SheetView.name} ⚡️ disconnect`);
10
11
  CleanupRegistry.unregister(el);
11
12
  }
12
13
  static polyfillConnectedCallback(el) {
13
- debug(`${SheetView.name} ⚡️ connect`);
14
+ if (devFlags.debug)
15
+ console.debug(`${SheetView.name} ⚡️ connect`);
14
16
  CleanupRegistry.register(el, onoff([
15
17
  { types: 'cancel', listener: this.#handleCancel },
16
18
  { types: 'keydown', listener: SheetView.#handleKeydown },
@@ -18,7 +20,8 @@ export class SheetView extends DialogBase {
18
20
  el.autofocus = true;
19
21
  }
20
22
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
21
- debug(`${SheetView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
23
+ if (devFlags.debug)
24
+ console.debug(`${SheetView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
22
25
  // // NOTE: wait for config
23
26
  // Snapshot.waitReady.then(() => {
24
27
  // switch (attributeName) {
@@ -41,7 +44,8 @@ export class SheetView extends DialogBase {
41
44
  // })
42
45
  }
43
46
  static #handleKeydown = (evt) => {
44
- debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.key})`);
47
+ if (devFlags.debug)
48
+ console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.key})`);
45
49
  if ('Escape' !== evt.key)
46
50
  return;
47
51
  evt.preventDefault();
@@ -49,7 +53,8 @@ export class SheetView extends DialogBase {
49
53
  evt.stopPropagation();
50
54
  };
51
55
  static #handleCancel = (evt) => {
52
- debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.cancelable})`);
56
+ if (devFlags.debug)
57
+ console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.cancelable})`);
53
58
  if (!evt.cancelable)
54
59
  return;
55
60
  evt.preventDefault();
@@ -1,14 +1,15 @@
1
1
  var _a;
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
3
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
4
- import { debounce, debug, onoff } from '../internal/utils';
4
+ import { debounce, devFlags, onoff } from '../internal/utils';
5
5
  const observers = new ResizeObserverSingleton();
6
6
  export class SidebarToggle extends HTMLElement {
7
7
  constructor() {
8
8
  super();
9
9
  }
10
10
  connectedCallback() {
11
- debug(`${_a.name} ⚡️ connect`);
11
+ if (devFlags.debug)
12
+ console.debug(`${_a.name} ⚡️ connect`);
12
13
  CleanupRegistry.register(this, onoff('click', this.#handleClick, this).on());
13
14
  const entry = {
14
15
  target: this,
@@ -18,7 +19,8 @@ export class SidebarToggle extends HTMLElement {
18
19
  _a.#handleMeasure([entry]);
19
20
  }
20
21
  disconnectedCallback() {
21
- debug(`${_a.name} ⚡️ disconnect`);
22
+ if (devFlags.debug)
23
+ console.debug(`${_a.name} ⚡️ disconnect`);
22
24
  observers.unobserve(this);
23
25
  CleanupRegistry.unregister(this);
24
26
  }
@@ -28,7 +30,8 @@ export class SidebarToggle extends HTMLElement {
28
30
  }
29
31
  // This triggers on show/hide of any of sidebar-toggle elements
30
32
  static #handleMeasure(entry) {
31
- debug(`${_a.name} ⚡️ measure`);
33
+ if (devFlags.debug)
34
+ console.debug(`${_a.name} ⚡️ measure`);
32
35
  const { target } = entry ?? {};
33
36
  if (!(target instanceof HTMLElement && target))
34
37
  return;
@@ -66,7 +69,8 @@ export class SidebarToggle extends HTMLElement {
66
69
  });
67
70
  }
68
71
  #handleClick({ target, type }) {
69
- debug(`${_a.name} ⚡️ ${type}`);
72
+ if (devFlags.debug)
73
+ console.debug(`${_a.name} ⚡️ ${type}`);
70
74
  if (!(target instanceof HTMLElement && target))
71
75
  return;
72
76
  if (!target?.closest('button'))
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff, touchGlass } from '../internal/utils';
2
+ import { devFlags, onoff, touchGlass } from '../internal/utils';
3
3
  import { DialogBase } from '../namespace-browser/base';
4
4
  export class SidebarView extends DialogBase {
5
5
  constructor() {
@@ -24,7 +24,8 @@ export class SidebarView extends DialogBase {
24
24
  }
25
25
  /** Autoclose on click outside. */
26
26
  static #handleClick = async ({ target, type }) => {
27
- debug(`${SidebarView.name} ⚡️ ${type}`);
27
+ if (devFlags.debug)
28
+ console.debug(`${SidebarView.name} ⚡️ ${type}`);
28
29
  if (!(target instanceof HTMLElement && target))
29
30
  return;
30
31
  if (target instanceof HTMLDialogElement && 'sidebar-view' === target.getAttribute('is'))
@@ -1,16 +1,18 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff } from '../internal/utils';
2
+ import { devFlags, onoff } from '../internal/utils';
3
3
  export class StickyContainer extends HTMLElement {
4
4
  constructor() {
5
5
  super();
6
6
  }
7
7
  connectedCallback() {
8
- debug(`${StickyContainer.name} ⚡️ connect`);
8
+ if (devFlags.debug)
9
+ console.debug(`${StickyContainer.name} ⚡️ connect`);
9
10
  // CleanupRegistry.register(this, onoff('transitionend transitionstart transitioncancel', this.#handleTransitionrun as unknown as EventListener, this).on())
10
11
  CleanupRegistry.register(this, onoff('transitionrun', this.#handleTransitionrun, this).on());
11
12
  }
12
13
  disconnectedCallback() {
13
- debug(`${StickyContainer.name} ⚡️ disconnect`);
14
+ if (devFlags.debug)
15
+ console.debug(`${StickyContainer.name} ⚡️ disconnect`);
14
16
  CleanupRegistry.unregister(this);
15
17
  }
16
18
  #handleTransitionrun = ({ target, propertyName, pseudoElement }) => {
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff, touchGlass } from '../internal/utils';
2
+ import { devFlags, onoff, touchGlass } from '../internal/utils';
3
3
  import { DialogBase } from '../namespace-browser/base';
4
4
  /**
5
5
  * @summary A screen that lets users switch between different views using buttons, tabs, or other controls.
@@ -9,12 +9,14 @@ export class TabBar extends DialogBase {
9
9
  super();
10
10
  }
11
11
  static polyfillDisconnectedCallback(el) {
12
- debug(`${TabBar.name} ⚡️ disconnect`);
12
+ if (devFlags.debug)
13
+ console.debug(`${TabBar.name} ⚡️ disconnect`);
13
14
  el.removeEventListener('click', TabBar.#handleClick);
14
15
  CleanupRegistry.unregister(el);
15
16
  }
16
17
  static polyfillConnectedCallback(el) {
17
- debug(`${TabBar.name} ⚡️ connect`);
18
+ if (devFlags.debug)
19
+ console.debug(`${TabBar.name} ⚡️ connect`);
18
20
  el.autofocus = true;
19
21
  // Snapshot.waitReadyFor(el).then((r) => {
20
22
  // if (!r) return
@@ -31,7 +33,8 @@ export class TabBar extends DialogBase {
31
33
  // })
32
34
  }
33
35
  static #handleClick = async ({ target, type }) => {
34
- debug(`${TabBar.name} ⚡️ ${type}`);
36
+ if (devFlags.debug)
37
+ console.debug(`${TabBar.name} ⚡️ ${type}`);
35
38
  if (!(target instanceof HTMLElement && target))
36
39
  return;
37
40
  if (target instanceof HTMLDialogElement && 'tab-bar' === target.getAttribute('is'))
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { debug, onoff } from '../internal/utils';
2
+ import { devFlags, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
4
  import { TabView } from './tab-view';
5
5
  export class TabItem extends ButtonBase {
@@ -7,11 +7,13 @@ export class TabItem extends ButtonBase {
7
7
  super();
8
8
  }
9
9
  static polyfillDisconnectedCallback(btn) {
10
- debug(`${TabItem.name} ⚡️ disconnect`);
10
+ if (devFlags.debug)
11
+ console.debug(`${TabItem.name} ⚡️ disconnect`);
11
12
  CleanupRegistry.unregister(btn);
12
13
  }
13
14
  static polyfillConnectedCallback(btn) {
14
- debug(`${TabItem.name} ⚡️ connect`);
15
+ if (devFlags.debug)
16
+ console.debug(`${TabItem.name} ⚡️ connect`);
15
17
  Object.assign(btn, {
16
18
  tabIndex: 0,
17
19
  ariaSelected: 'false',
@@ -31,7 +33,8 @@ export class TabItem extends ButtonBase {
31
33
  });
32
34
  }
33
35
  static #handleTabMoreStackAllowance = async (btn, evt) => {
34
- debug(`${TabItem.name} ⚡️ ${evt?.type}`);
36
+ if (devFlags.debug)
37
+ console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
35
38
  const tv = btn.closest('tab-view');
36
39
  if (!tv)
37
40
  return;
@@ -40,7 +43,8 @@ export class TabItem extends ButtonBase {
40
43
  btn.hidden = 'bottom-bar' !== tv.tabBarPlacement;
41
44
  };
42
45
  static #handleTabRevealOrSwap = async (btn, evt) => {
43
- debug(`${TabItem.name} ⚡️ ${evt?.type}`);
46
+ if (devFlags.debug)
47
+ console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
44
48
  const tv = btn?.closest('tab-view');
45
49
  if (!tv)
46
50
  return;
@@ -62,7 +66,8 @@ export class TabItem extends ButtonBase {
62
66
  }, 100);
63
67
  };
64
68
  static #handleClick = async (evt) => {
65
- debug(`${TabItem.name} ⚡️ ${evt?.type}`);
69
+ if (devFlags.debug)
70
+ console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
66
71
  const btn = evt.currentTarget instanceof HTMLElement && evt.currentTarget;
67
72
  if (!btn)
68
73
  return;
@@ -109,14 +114,16 @@ export class TabItem extends ButtonBase {
109
114
  for (const tab of tabs.reverse())
110
115
  if (tv.selectedTab.includes(tab)) {
111
116
  const eventType = 'tabroot';
112
- debug(`${TabItem.name} 💡 ${eventType}`);
117
+ if (devFlags.debug)
118
+ console.debug(`${TabItem.name} 💡 ${eventType}`);
113
119
  tab?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
114
120
  return; // skip rest no selection!
115
121
  }
116
122
  }
117
123
  else if ('->' === dir) {
118
124
  const eventType = 'tabroot';
119
- debug(`${TabItem.name} 💡 ${eventType}`);
125
+ if (devFlags.debug)
126
+ console.debug(`${TabItem.name} 💡 ${eventType}`);
120
127
  tabs.at(0)?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
121
128
  }
122
129
  // 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, debug, frame, onoff, timeout } from '../internal/utils';
5
+ import { $, cssTime, debounce, devFlags, frame, onoff, timeout } from '../internal/utils';
6
6
  import { Snapshot } from '../snapshot';
7
7
  const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
8
8
  /**
@@ -25,7 +25,8 @@ export class TabView extends HTMLElement {
25
25
  this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
26
26
  }
27
27
  disconnectedCallback() {
28
- debug(`${_a.name} ⚡️ disconnect`);
28
+ if (devFlags.debug)
29
+ console.debug(`${_a.name} ⚡️ disconnect`);
29
30
  this.#afterTabRevealDelay.cancel();
30
31
  this.#cssStyleObserver?.disconnect();
31
32
  CleanupRegistry.unregister(this);
@@ -37,7 +38,8 @@ export class TabView extends HTMLElement {
37
38
  return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
38
39
  }
39
40
  connectedCallback() {
40
- debug(`${_a.name} ⚡️ connect`);
41
+ if (devFlags.debug)
42
+ console.debug(`${_a.name} ⚡️ connect`);
41
43
  this.#cssStyleObserver = new CSSStyleObserver({
42
44
  properties: ['--adaptable-tab-bar-placement-index'],
43
45
  });
@@ -91,11 +93,13 @@ export class TabView extends HTMLElement {
91
93
  this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
92
94
  };
93
95
  #handleTabViewPagereveal = (evt) => {
94
- debug(`${_a.name} ⚡️ ${evt?.type}`);
96
+ if (devFlags.debug)
97
+ console.debug(`${_a.name} ⚡️ ${evt?.type}`);
95
98
  void this.#syncBodyFace();
96
99
  };
97
100
  #handleStyleChange = () => {
98
- debug(`${_a.name} ⚡️ style`);
101
+ if (devFlags.debug)
102
+ console.debug(`${_a.name} ⚡️ style`);
99
103
  const style = self.getComputedStyle(this);
100
104
  const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
101
105
  newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
@@ -110,7 +114,7 @@ export class TabView extends HTMLElement {
110
114
  }
111
115
  };
112
116
  // #handleMediaChange: (evt: MediaQueryListEvent) => void = (evt) => {
113
- // debug(`${TabView.name} ⚡️ ${evt?.type}`)
117
+ // if (devFlags.debug) console.debug(`${TabView.name} ⚡️ ${evt?.type}`)
114
118
  // if (!evt.matches) return
115
119
  // this.#handleStyleChange()
116
120
  // // if (evt.matches) {
@@ -161,7 +165,8 @@ export class TabView extends HTMLElement {
161
165
  // // }
162
166
  // }
163
167
  #handleAdaptableTabBarPlacementChange = (evt) => {
164
- debug(`${_a.name} ⚡️ ${evt?.type}`);
168
+ if (devFlags.debug)
169
+ console.debug(`${_a.name} ⚡️ ${evt?.type}`);
165
170
  if ('bottom-bar' !== evt.detail.oldValue)
166
171
  return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
167
172
  const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
@@ -230,7 +235,8 @@ export class TabView extends HTMLElement {
230
235
  #triggerToggleEvent = (evt) => {
231
236
  const eventType = 'tab-view:toggle';
232
237
  void this.#syncBodyFace();
233
- debug(`${_a.name} 💡 ${eventType}`);
238
+ if (devFlags.debug)
239
+ console.debug(`${_a.name} 💡 ${eventType}`);
234
240
  this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
235
241
  };
236
242
  #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 { $, debug, listActive, onoff } from '../internal/utils';
5
+ import { $, devFlags, listActive, onoff } from '../internal/utils';
6
6
  import { Snapshot } from '../snapshot';
7
7
  export class TableView extends HTMLElement {
8
8
  #styleObserver;
@@ -82,14 +82,16 @@ export class TableView extends HTMLElement {
82
82
  // )
83
83
  }
84
84
  disconnectedCallback() {
85
- debug(`${_a.name} ⚡️ disconnect`);
85
+ if (devFlags.debug)
86
+ console.debug(`${_a.name} ⚡️ disconnect`);
86
87
  CleanupRegistry.unregister(this);
87
88
  this.#styleObserver?.disconnect();
88
89
  this.#observers.unobserveAll();
89
90
  this.#compactToolbarItem = undefined;
90
91
  }
91
92
  connectedCallback() {
92
- debug(`${_a.name} ⚡️ connect`);
93
+ if (devFlags.debug)
94
+ console.debug(`${_a.name} ⚡️ connect`);
93
95
  CleanupRegistry.register(this, onoff(listActive(this), this).on());
94
96
  // console.log(999, this.#shadowRoot.querySelector('[part*=table-column-stack]'))
95
97
  this.#styleObserver = new CSSStyleObserver({
@@ -102,16 +104,18 @@ export class TableView extends HTMLElement {
102
104
  Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
103
105
  }
104
106
  #handleColumnSlotchange = ({ type, target: slot }) => {
105
- debug(`${_a.name} ⚡️ ${type}`);
107
+ if (devFlags.debug)
108
+ console.debug(`${_a.name} ⚡️ ${type}`);
106
109
  if (!(slot instanceof HTMLSlotElement && slot))
107
110
  return;
108
111
  const assigned = slot.assignedElements();
109
112
  this.#observers.syncObservations(assigned);
110
- if (0 < assigned.length)
111
- this.#renderColumns([]);
113
+ // if (0 < assigned.length)
114
+ this.#renderColumns([]);
112
115
  };
113
116
  #renderColumns = (entries) => {
114
- debug(`${_a.name} ⚡️ mutation`);
117
+ if (devFlags.debug)
118
+ console.debug(`${_a.name} ⚡️ mutation`);
115
119
  if (!this.#compactToolbarItem) {
116
120
  this.#compactToolbarItem = $(`<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
117
121
  CleanupRegistry.unregister(this, 'compact_toolbar');
@@ -134,7 +138,8 @@ export class TableView extends HTMLElement {
134
138
  };
135
139
  #observers = new MutationObserverSet(this.#renderColumns);
136
140
  #handleStyleChange = () => {
137
- debug(`${_a.name} ⚡️ style`);
141
+ if (devFlags.debug)
142
+ console.debug(`${_a.name} ⚡️ style`);
138
143
  const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
139
144
  if (!target)
140
145
  return;