@swiftwc/ui 0.0.0-dev.99 → 1.0.0-canary.0

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 (342) hide show
  1. package/{web-components.html-data → html-data}/en.json +155 -54
  2. package/package.json +14 -11
  3. package/scss/_components.scss +1 -1
  4. package/scss/_maps.scss +3 -1
  5. package/scss/_utils.scss +3 -1
  6. package/scss/_vars.scss +1 -0
  7. package/scss/base/_layout.scss +8 -8
  8. package/scss/base/_reboot.scss +4 -29
  9. package/scss/base/_root.scss +27 -12
  10. package/scss/colors/_index.scss +66 -1
  11. package/scss/components/_alert-dialog.scss +3 -3
  12. package/scss/components/_bordered-button.scss +2 -2
  13. package/scss/components/_bordered-prominent-button.scss +3 -3
  14. package/scss/components/_borderless-button.scss +2 -2
  15. package/scss/components/_confirmation-dialog.scss +1 -1
  16. package/scss/components/_content-unavailable.scss +1 -1
  17. package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
  18. package/scss/components/_date-picker.scss +1 -1
  19. package/scss/components/_detail-placeholder.scss +5 -5
  20. package/scss/components/_disclosure-group.scss +2 -2
  21. package/scss/components/_fine-tooltip.scss +1 -1
  22. package/scss/components/_form-view.scss +3 -3
  23. package/scss/components/_full-screen.scss +1 -1
  24. package/scss/components/_glass-button.scss +2 -2
  25. package/scss/components/_glass-prominent-button.scss +3 -3
  26. package/scss/components/_group-box.scss +1 -1
  27. package/scss/components/_h-divider.scss +1 -1
  28. package/scss/components/_h-flex-stack.scss +3 -1
  29. package/scss/components/_h-stack.scss +1 -1
  30. package/scss/components/_image-view.scss +1 -1
  31. package/scss/components/_index.scss +34 -24
  32. package/scss/components/_label-view.scss +1 -1
  33. package/scss/components/_labeled-content.scss +1 -1
  34. package/scss/components/_list-view.scss +3 -3
  35. package/scss/components/_menu-view.scss +3 -3
  36. package/scss/components/_navigation-large-title.scss +15 -9
  37. package/scss/components/_navigation-split-view.scss +18 -18
  38. package/scss/components/_navigation-stack.scss +1 -1
  39. package/scss/components/_navigation-title.scss +1 -1
  40. package/scss/components/_picker-view.scss +159 -119
  41. package/scss/components/_plain-button.scss +2 -2
  42. package/scss/components/_progress-view.scss +1 -1
  43. package/scss/components/_scroll-view-proxy.scss +1 -1
  44. package/scss/components/_scroll-view-toolbars.scss +1 -1
  45. package/scss/components/_scroll-view.scss +2 -2
  46. package/scss/components/_search-view.scss +1 -1
  47. package/scss/components/_section-view.scss +1 -1
  48. package/scss/components/_sheet-view.scss +2 -2
  49. package/scss/components/_sidebar-toggle.scss +1 -1
  50. package/scss/components/_sidebar-view.scss +2 -2
  51. package/scss/components/_sticky-container.scss +1 -1
  52. package/scss/components/_tab-bar.scss +1 -1
  53. package/scss/components/_tab-item.scss +1 -1
  54. package/scss/components/_tab-view.scss +23 -15
  55. package/scss/components/_table-column.scss +1 -1
  56. package/scss/components/_table-row.scss +1 -1
  57. package/scss/components/_table-view.scss +1 -1
  58. package/scss/components/_text-field.scss +1 -1
  59. package/scss/components/_text-view.scss +1 -1
  60. package/scss/components/_toggle-view.scss +41 -21
  61. package/scss/components/_tool-bar-item-group.scss +1 -1
  62. package/scss/components/_tool-bar-item.scss +2 -2
  63. package/scss/components/_tool-bar.scss +2 -2
  64. package/scss/components/_v-divider.scss +1 -1
  65. package/scss/components/_v-flex-stack.scss +3 -1
  66. package/scss/components/_v-keyboard.scss +1 -1
  67. package/scss/components/_v-stack.scss +1 -1
  68. package/scss/final/_touch-glass.scss +2 -2
  69. package/scss/mixins/_index.scss +2 -2
  70. package/scss/placeholders/_buttons.scss +5 -5
  71. package/scss/placeholders/_lists.scss +3 -3
  72. package/scss/transitions/_alert-dialog.scss +1 -1
  73. package/scss/transitions/_bwd.navbar.scss +1 -1
  74. package/scss/transitions/_bwd.scss +3 -3
  75. package/scss/transitions/_confirmation-dialog.scss +1 -1
  76. package/scss/transitions/_disclosure-group.scss +1 -1
  77. package/scss/transitions/_fine-tooltip.scss +1 -1
  78. package/scss/transitions/_fwd.navbar.scss +1 -1
  79. package/scss/transitions/_fwd.scss +1 -1
  80. package/scss/transitions/_glass-button.scss +1 -1
  81. package/scss/transitions/_glass-prominent-button.scss +1 -1
  82. package/scss/transitions/_index.scss +1 -1
  83. package/scss/transitions/_menu-view.scss +1 -1
  84. package/scss/transitions/_navigation-split-view.scss +1 -1
  85. package/scss/transitions/_progress-view.scss +1 -1
  86. package/scss/transitions/_sheet-view.scss +1 -1
  87. package/scss/transitions/_sidebar-view.scss +1 -1
  88. package/scss/transitions/_tab-bar.scss +1 -1
  89. package/scss/utils/_background.scss +52 -0
  90. package/scss/utils/_frame.scss +2 -2
  91. package/scss/utils/_index.scss +33 -8
  92. package/scss/utils/_spacing.scss +1 -1
  93. package/scss/utils/_stacks.scss +5 -3
  94. package/generated/buses/alert-dialog.d.ts +0 -2
  95. package/generated/buses/alert-dialog.js +0 -1
  96. package/generated/buses/confirmation-dialog.d.ts +0 -2
  97. package/generated/buses/confirmation-dialog.js +0 -1
  98. package/generated/buses/index.d.ts +0 -6
  99. package/generated/buses/index.js +0 -6
  100. package/generated/buses/lifecycle-observer.d.ts +0 -2
  101. package/generated/buses/lifecycle-observer.js +0 -1
  102. package/generated/client/index.d.ts +0 -30
  103. package/generated/client/index.js +0 -279
  104. package/generated/components/alert-dialog.d.ts +0 -11
  105. package/generated/components/alert-dialog.js +0 -102
  106. package/generated/components/body-view.d.ts +0 -13
  107. package/generated/components/body-view.js +0 -17
  108. package/generated/components/bordered-button.d.ts +0 -17
  109. package/generated/components/bordered-button.js +0 -56
  110. package/generated/components/bordered-prominent-button.d.ts +0 -17
  111. package/generated/components/bordered-prominent-button.js +0 -56
  112. package/generated/components/borderless-button.d.ts +0 -17
  113. package/generated/components/borderless-button.js +0 -56
  114. package/generated/components/color-scheme.d.ts +0 -12
  115. package/generated/components/color-scheme.js +0 -54
  116. package/generated/components/confirmation-dialog.d.ts +0 -12
  117. package/generated/components/confirmation-dialog.js +0 -116
  118. package/generated/components/content-unavailable.d.ts +0 -30
  119. package/generated/components/content-unavailable.js +0 -82
  120. package/generated/components/date-picker.d.ts +0 -52
  121. package/generated/components/date-picker.js +0 -480
  122. package/generated/components/disclosure-group.d.ts +0 -17
  123. package/generated/components/disclosure-group.js +0 -66
  124. package/generated/components/fine-tooltip.d.ts +0 -15
  125. package/generated/components/fine-tooltip.js +0 -111
  126. package/generated/components/form-view.d.ts +0 -16
  127. package/generated/components/form-view.js +0 -65
  128. package/generated/components/glass-button.d.ts +0 -16
  129. package/generated/components/glass-button.js +0 -53
  130. package/generated/components/glass-prominent-button.d.ts +0 -16
  131. package/generated/components/glass-prominent-button.js +0 -53
  132. package/generated/components/h-stack.d.ts +0 -22
  133. package/generated/components/h-stack.js +0 -26
  134. package/generated/components/image-view.d.ts +0 -18
  135. package/generated/components/image-view.js +0 -68
  136. package/generated/components/index.d.ts +0 -47
  137. package/generated/components/index.js +0 -47
  138. package/generated/components/label-view.d.ts +0 -27
  139. package/generated/components/label-view.js +0 -87
  140. package/generated/components/labeled-content.d.ts +0 -27
  141. package/generated/components/labeled-content.js +0 -160
  142. package/generated/components/list-view.d.ts +0 -15
  143. package/generated/components/list-view.js +0 -22
  144. package/generated/components/menu-view.d.ts +0 -20
  145. package/generated/components/menu-view.js +0 -140
  146. package/generated/components/navigation-large-title.d.ts +0 -18
  147. package/generated/components/navigation-large-title.js +0 -188
  148. package/generated/components/navigation-split-view.d.ts +0 -15
  149. package/generated/components/navigation-split-view.js +0 -25
  150. package/generated/components/navigation-stack.d.ts +0 -15
  151. package/generated/components/navigation-stack.js +0 -29
  152. package/generated/components/navigation-title.d.ts +0 -18
  153. package/generated/components/navigation-title.js +0 -72
  154. package/generated/components/picker-view.d.ts +0 -68
  155. package/generated/components/picker-view.js +0 -1153
  156. package/generated/components/plain-button.d.ts +0 -7
  157. package/generated/components/plain-button.js +0 -22
  158. package/generated/components/progress-view.d.ts +0 -20
  159. package/generated/components/progress-view.js +0 -125
  160. package/generated/components/screen-view.d.ts +0 -5
  161. package/generated/components/screen-view.js +0 -11
  162. package/generated/components/scroll-view-proxy.d.ts +0 -13
  163. package/generated/components/scroll-view-proxy.js +0 -17
  164. package/generated/components/scroll-view.d.ts +0 -22
  165. package/generated/components/scroll-view.js +0 -237
  166. package/generated/components/search-view.d.ts +0 -12
  167. package/generated/components/search-view.js +0 -27
  168. package/generated/components/section-view.d.ts +0 -21
  169. package/generated/components/section-view.js +0 -64
  170. package/generated/components/sheet-view.d.ts +0 -11
  171. package/generated/components/sheet-view.js +0 -45
  172. package/generated/components/sidebar-toggle.d.ts +0 -15
  173. package/generated/components/sidebar-toggle.js +0 -88
  174. package/generated/components/sidebar-view.d.ts +0 -10
  175. package/generated/components/sidebar-view.js +0 -37
  176. package/generated/components/sticky-container.d.ts +0 -11
  177. package/generated/components/sticky-container.js +0 -26
  178. package/generated/components/tab-bar.d.ts +0 -10
  179. package/generated/components/tab-bar.js +0 -40
  180. package/generated/components/tab-item.d.ts +0 -10
  181. package/generated/components/tab-item.js +0 -134
  182. package/generated/components/tab-view.d.ts +0 -31
  183. package/generated/components/tab-view.js +0 -198
  184. package/generated/components/table-view.d.ts +0 -26
  185. package/generated/components/table-view.js +0 -161
  186. package/generated/components/text-field.d.ts +0 -42
  187. package/generated/components/text-field.js +0 -526
  188. package/generated/components/toggle-view.d.ts +0 -41
  189. package/generated/components/toggle-view.js +0 -370
  190. package/generated/components/tool-bar-item-group.d.ts +0 -13
  191. package/generated/components/tool-bar-item-group.js +0 -31
  192. package/generated/components/tool-bar-item.d.ts +0 -16
  193. package/generated/components/tool-bar-item.js +0 -69
  194. package/generated/components/tool-bar.d.ts +0 -26
  195. package/generated/components/tool-bar.js +0 -95
  196. package/generated/components/v-keyboard.d.ts +0 -20
  197. package/generated/components/v-keyboard.js +0 -89
  198. package/generated/components/v-stack.d.ts +0 -25
  199. package/generated/components/v-stack.js +0 -29
  200. package/generated/css/index.css +0 -10620
  201. package/generated/events/alert-dialog.d.ts +0 -13
  202. package/generated/events/alert-dialog.js +0 -1
  203. package/generated/events/confirmation-dialog.d.ts +0 -14
  204. package/generated/events/confirmation-dialog.js +0 -1
  205. package/generated/events/date-picker.d.ts +0 -13
  206. package/generated/events/date-picker.js +0 -1
  207. package/generated/events/index.d.ts +0 -9
  208. package/generated/events/index.js +0 -9
  209. package/generated/events/lifecycle-observer.d.ts +0 -18
  210. package/generated/events/lifecycle-observer.js +0 -1
  211. package/generated/events/picker-view.d.ts +0 -29
  212. package/generated/events/picker-view.js +0 -1
  213. package/generated/events/scroll-view.d.ts +0 -18
  214. package/generated/events/scroll-view.js +0 -1
  215. package/generated/events/tab-view.d.ts +0 -54
  216. package/generated/events/tab-view.js +0 -1
  217. package/generated/events/text-field.d.ts +0 -13
  218. package/generated/events/text-field.js +0 -1
  219. package/generated/events/toggle-view.d.ts +0 -14
  220. package/generated/events/toggle-view.js +0 -1
  221. package/generated/i18n/index.d.ts +0 -33
  222. package/generated/i18n/index.js +0 -164
  223. package/generated/i18n/locales/el.d.ts +0 -16
  224. package/generated/i18n/locales/el.js +0 -16
  225. package/generated/i18n/locales/en.d.ts +0 -16
  226. package/generated/i18n/locales/en.js +0 -16
  227. package/generated/i18n/locales/index.d.ts +0 -4
  228. package/generated/i18n/locales/index.js +0 -4
  229. package/generated/index.d.ts +0 -2
  230. package/generated/index.js +0 -3
  231. package/generated/internal/class/cleanup-registry.d.ts +0 -5
  232. package/generated/internal/class/cleanup-registry.js +0 -38
  233. package/generated/internal/class/css-style-observer.d.ts +0 -8
  234. package/generated/internal/class/css-style-observer.js +0 -26
  235. package/generated/internal/class/form-associated-base.d.ts +0 -16
  236. package/generated/internal/class/form-associated-base.js +0 -78
  237. package/generated/internal/class/mutation-observer-set.d.ts +0 -9
  238. package/generated/internal/class/mutation-observer-set.js +0 -42
  239. package/generated/internal/class/mutation-observer-singleton.d.ts +0 -10
  240. package/generated/internal/class/mutation-observer-singleton.js +0 -64
  241. package/generated/internal/class/navigation-path.d.ts +0 -15
  242. package/generated/internal/class/navigation-path.js +0 -84
  243. package/generated/internal/class/navigation-view.d.ts +0 -8
  244. package/generated/internal/class/navigation-view.js +0 -72
  245. package/generated/internal/class/resize-observer-singleton.d.ts +0 -7
  246. package/generated/internal/class/resize-observer-singleton.js +0 -22
  247. package/generated/internal/decorators/adaptive-slot.d.ts +0 -1
  248. package/generated/internal/decorators/adaptive-slot.js +0 -50
  249. package/generated/internal/decorators/custom-element.d.ts +0 -5
  250. package/generated/internal/decorators/custom-element.js +0 -5
  251. package/generated/internal/decorators/index.d.ts +0 -6
  252. package/generated/internal/decorators/index.js +0 -6
  253. package/generated/internal/decorators/microtask-on-connected.d.ts +0 -39
  254. package/generated/internal/decorators/microtask-on-connected.js +0 -67
  255. package/generated/internal/privateNamespace.d.ts +0 -14
  256. package/generated/internal/privateNamespace.js +0 -168
  257. package/generated/internal/utils/add.d.ts +0 -1
  258. package/generated/internal/utils/add.js +0 -7
  259. package/generated/internal/utils/cash/ancestors.d.ts +0 -1
  260. package/generated/internal/utils/cash/ancestors.js +0 -27
  261. package/generated/internal/utils/cash/index.d.ts +0 -24
  262. package/generated/internal/utils/cash/index.js +0 -27
  263. package/generated/internal/utils/cash/next-all.d.ts +0 -1
  264. package/generated/internal/utils/cash/next-all.js +0 -10
  265. package/generated/internal/utils/cash/next.d.ts +0 -1
  266. package/generated/internal/utils/cash/next.js +0 -9
  267. package/generated/internal/utils/cash/prev-all.d.ts +0 -1
  268. package/generated/internal/utils/cash/prev-all.js +0 -10
  269. package/generated/internal/utils/cash/prev.d.ts +0 -1
  270. package/generated/internal/utils/cash/prev.js +0 -9
  271. package/generated/internal/utils/cash/prop.d.ts +0 -18
  272. package/generated/internal/utils/cash/prop.js +0 -30
  273. package/generated/internal/utils/cash/siblings.d.ts +0 -1
  274. package/generated/internal/utils/cash/siblings.js +0 -10
  275. package/generated/internal/utils/clamp.d.ts +0 -1
  276. package/generated/internal/utils/clamp.js +0 -4
  277. package/generated/internal/utils/compare-big-decimals.d.ts +0 -1
  278. package/generated/internal/utils/compare-big-decimals.js +0 -80
  279. package/generated/internal/utils/css-time.d.ts +0 -1
  280. package/generated/internal/utils/css-time.js +0 -3
  281. package/generated/internal/utils/debounce.d.ts +0 -1
  282. package/generated/internal/utils/debounce.js +0 -13
  283. package/generated/internal/utils/define-translations.d.ts +0 -1
  284. package/generated/internal/utils/define-translations.js +0 -3
  285. package/generated/internal/utils/dev-flags.d.ts +0 -3
  286. package/generated/internal/utils/dev-flags.js +0 -5
  287. package/generated/internal/utils/ensure-placeholder.d.ts +0 -1
  288. package/generated/internal/utils/ensure-placeholder.js +0 -41
  289. package/generated/internal/utils/frame.d.ts +0 -1
  290. package/generated/internal/utils/frame.js +0 -6
  291. package/generated/internal/utils/index.d.ts +0 -20
  292. package/generated/internal/utils/index.js +0 -23
  293. package/generated/internal/utils/is-inside.d.ts +0 -1
  294. package/generated/internal/utils/is-inside.js +0 -4
  295. package/generated/internal/utils/kebab-case.d.ts +0 -1
  296. package/generated/internal/utils/kebab-case.js +0 -8
  297. package/generated/internal/utils/list-active.d.ts +0 -7
  298. package/generated/internal/utils/list-active.js +0 -83
  299. package/generated/internal/utils/microtask.d.ts +0 -1
  300. package/generated/internal/utils/microtask.js +0 -3
  301. package/generated/internal/utils/onoff.d.ts +0 -45
  302. package/generated/internal/utils/onoff.js +0 -31
  303. package/generated/internal/utils/set.d.ts +0 -1
  304. package/generated/internal/utils/set.js +0 -7
  305. package/generated/internal/utils/sleep.d.ts +0 -1
  306. package/generated/internal/utils/sleep.js +0 -3
  307. package/generated/internal/utils/slow-hide-show.d.ts +0 -1
  308. package/generated/internal/utils/slow-hide-show.js +0 -16
  309. package/generated/internal/utils/timeout.d.ts +0 -5
  310. package/generated/internal/utils/timeout.js +0 -16
  311. package/generated/internal/utils/touch-glass.d.ts +0 -7
  312. package/generated/internal/utils/touch-glass.js +0 -19
  313. package/generated/internal/vendor/morphdom.d.ts +0 -6
  314. package/generated/internal/vendor/morphdom.js +0 -720
  315. package/generated/morphdom/index.d.ts +0 -8
  316. package/generated/morphdom/index.js +0 -8
  317. package/generated/morphdom/morph.d.ts +0 -4
  318. package/generated/morphdom/morph.js +0 -10
  319. package/generated/morphdom/query-morph.d.ts +0 -5
  320. package/generated/morphdom/query-morph.js +0 -12
  321. package/generated/morphdom/render-to-string.d.ts +0 -12
  322. package/generated/morphdom/render-to-string.js +0 -48
  323. package/generated/morphdom/unsafe-html.d.ts +0 -2
  324. package/generated/morphdom/unsafe-html.js +0 -4
  325. package/generated/namespace-browser/base.d.ts +0 -45
  326. package/generated/namespace-browser/base.js +0 -115
  327. package/generated/namespace-browser/event.d.ts +0 -10
  328. package/generated/namespace-browser/event.js +0 -1
  329. package/generated/namespace-browser/index.d.ts +0 -7
  330. package/generated/namespace-browser/index.js +0 -1
  331. package/generated/snapshot/index.d.ts +0 -9
  332. package/generated/snapshot/index.js +0 -60
  333. package/generated/tpl/html.d.ts +0 -5
  334. package/generated/tpl/html.js +0 -7
  335. package/generated/tpl/index.d.ts +0 -6
  336. package/generated/tpl/index.js +0 -6
  337. package/generated/tpl/is-template-result.d.ts +0 -3
  338. package/generated/tpl/is-template-result.js +0 -1
  339. package/generated/tpl/render.d.ts +0 -2
  340. package/generated/tpl/render.js +0 -132
  341. /package/{web-components.css-data → css-data}/en.json +0 -0
  342. /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
@@ -1,370 +0,0 @@
1
- var _a;
2
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
4
- import { MutationObserverSet } from '../internal/class/mutation-observer-set';
5
- import { $, devFlags, kebabCase, onoff, touchGlass } from '../internal/utils';
6
- import { queryMorph } from '../morphdom';
7
- import { html } from '../tpl';
8
- const toggleStyles = ['switch', 'button'];
9
- /**
10
- * @summary A control that switches between on and off states.
11
- *
12
- * @fires toggle:change — User toggled the control
13
- *
14
- * @slot label
15
- * @slot {HTMLOptionElement[]} validity-options
16
- */
17
- export class ToggleView extends FormAssociatedBase {
18
- static get observedAttributes() {
19
- return [
20
- 'label',
21
- 'name',
22
- 'value',
23
- /**
24
- * @type {boolean}
25
- */
26
- 'is-on',
27
- /**
28
- * @type {boolean}
29
- */
30
- 'required',
31
- /**
32
- * @type {boolean}
33
- */
34
- 'disabled',
35
- ];
36
- }
37
- static #template;
38
- static get template() {
39
- return (this.#template ??= $(html `<label part="root toggle-stack">
40
- <div part="root toggle-label-stack">
41
- <slot name="label"></slot>
42
- </div>
43
- <div part="root toggle-input-stack">
44
- <div part="root toggle-track" tabindex="0"></div>
45
- </div>
46
- <slot name="validity-options" hidden></slot>
47
- </label>`));
48
- }
49
- #renderValidityMsgs = (entries) => {
50
- if (devFlags.debug)
51
- console.debug(`${_a.name} ⚡️ mutation`);
52
- this.setValidity(this.validity, this.validationMessage);
53
- };
54
- #shadowRoot;
55
- #customValidity = '';
56
- #slots = new Map();
57
- #validityObservers = new MutationObserverSet(this.#renderValidityMsgs);
58
- #track;
59
- #value = 'on';
60
- #isOn = false;
61
- #didDrag = false;
62
- #trackWidth = 0;
63
- #dotSize = 0;
64
- get #trackMinX() {
65
- return 0;
66
- }
67
- get #trackMaxX() {
68
- return this.#trackWidth - this.#dotSize;
69
- }
70
- #handleMeasure = ([{ target, borderBoxSize }]) => {
71
- if (devFlags.debug)
72
- console.debug(`${_a.name} ⚡️ measure`);
73
- if (!(target instanceof HTMLElement))
74
- return;
75
- this.#trackWidth = borderBoxSize.at(0)?.inlineSize ?? 0;
76
- this.#dotSize = borderBoxSize.at(0)?.blockSize ?? 0;
77
- };
78
- #resizeObserver = new ResizeObserver(this.#handleMeasure);
79
- get #isDragging() {
80
- return '0ms' === this.#track?.style.getPropertyValue('--toggle--dot-transition-duration');
81
- }
82
- get #internals() {
83
- return getInternals(this);
84
- }
85
- constructor() {
86
- super();
87
- this.#shadowRoot = this.attachShadow({ mode: 'closed' });
88
- this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
89
- for (const slot of this.#shadowRoot.querySelectorAll('slot'))
90
- this.#slots?.set(slot.name, slot);
91
- CleanupRegistry.register(this, () => {
92
- this.#slots = new Map();
93
- });
94
- CleanupRegistry.unregister(this, 'validities');
95
- CleanupRegistry.register(this, onoff('slotchange', this.#handleValiditiesSlotchange, this.#slots?.get('validity-options')).on(), 'validities');
96
- this.#track = this.#shadowRoot.querySelector('[part*=toggle-track]') ?? undefined;
97
- CleanupRegistry.register(this, onoff([{ types: 'focusin', listener: this.#handleFocusin }], this).on());
98
- CleanupRegistry.register(this, onoff([
99
- { types: 'keydown', listener: this.#handleTrackKeydown },
100
- { types: 'click', listener: this.#handleTrackClick },
101
- { types: 'pointerdown', listener: this.#handleTrackPointerdown },
102
- { types: 'pointerup', listener: this.#handleTrackPointerup },
103
- { types: 'pointercancel', listener: this.#handleTrackPointercancel },
104
- { types: 'pointermove', listener: this.#handleTrackPointermove },
105
- { types: 'lostpointercapture', listener: this.#handleTrackPointercancel },
106
- ], this.#track).on());
107
- CleanupRegistry.register(this, onoff([{ types: 'blur', listener: this.#handleWindowBlur }], self).on());
108
- }
109
- attributeChangedCallback(name, oldValue, newValue) {
110
- if (devFlags.debug)
111
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
112
- switch (name) {
113
- case 'value':
114
- this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
115
- this.#sendValueToForm(false);
116
- break;
117
- case 'is-on':
118
- this.isOn = newValue !== null; // this.#input?.setAttribute('checked', newValue ?? '')
119
- this.#sendValueToForm(false);
120
- break;
121
- case 'required':
122
- // this.#input?.setAttribute(name, newValue ?? '')
123
- this.#sendValueToForm(false);
124
- break;
125
- case 'name':
126
- this.#sendValueToForm(false);
127
- break;
128
- case 'label':
129
- queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
130
- break;
131
- case 'disabled':
132
- for (const el of this.#shadowRoot.querySelectorAll('input'))
133
- el.toggleAttribute('disabled', !newValue);
134
- break;
135
- }
136
- }
137
- disconnectedCallback() {
138
- super.disconnectedCallback();
139
- if (this.#track)
140
- this.#resizeObserver.unobserve(this.#track);
141
- this.#validityObservers.unobserveAll();
142
- }
143
- connectedCallback() {
144
- super.connectedCallback();
145
- if (this.hasAttribute('is-on'))
146
- this.isOn = this.hasAttribute('is-on');
147
- this.#sendValueToForm(false);
148
- if (this.#track)
149
- this.#resizeObserver.observe(this.#track);
150
- CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t, ({ clientX, clientY }) => this.#measurePointerIsOverDot(clientX, clientY) ?? false), this).on());
151
- }
152
- get toggleStyle() {
153
- return toggleStyles.includes(this.getAttribute('toggle-style') ?? '') ? this.getAttribute('toggle-style') : 'switch';
154
- }
155
- get isOn() {
156
- return this.#isOn;
157
- }
158
- set isOn(v) {
159
- this.#isOn = Boolean(v);
160
- this.#value = this.#isOn ? (this.getAttribute('value') ?? 'on') : null;
161
- this.ariaChecked = `${this.#isOn}`;
162
- }
163
- #handleValiditiesSlotchange = ({ type, target: slot }) => {
164
- if (devFlags.debug)
165
- console.debug(`${_a.name} ⚡️ ${type}`);
166
- if (!(slot instanceof HTMLSlotElement))
167
- return;
168
- const assigned = slot.assignedElements();
169
- this.#validityObservers.syncObservations(assigned, ['value', 'label']);
170
- this.#renderValidityMsgs([]);
171
- };
172
- #handleFocusin = ({ type, target }) => {
173
- if (devFlags.debug)
174
- console.debug(`${_a.name} ⚡️ ${type}`);
175
- if (target === this)
176
- this.#track?.focus();
177
- };
178
- #handleTrackClick = ({ type }) => {
179
- if (devFlags.debug)
180
- console.debug(`${_a.name} ⚡️ ${type}`);
181
- if (this.#didDrag)
182
- return (this.#didDrag = false);
183
- this.#applyIsOnWithFlip(!this.isOn);
184
- this.#sendValueToForm(true);
185
- };
186
- #measurePointerIsOverDot = (clientX, clientY) => {
187
- if (!this.#track)
188
- return;
189
- const { left, top, height } = this.#track.getBoundingClientRect();
190
- const dotLeft = left + parseFloat(self.getComputedStyle(this.#track, '::before').left);
191
- const dotCenterX = dotLeft + this.#dotSize / 2;
192
- const dotCenterY = top + height / 2;
193
- return Math.hypot(clientX - dotCenterX, clientY - dotCenterY) <= this.#dotSize / 2;
194
- };
195
- #dragOffsetX = 0;
196
- get #baseX() {
197
- return this.isOn ? this.#trackMaxX : this.#trackMinX;
198
- }
199
- #handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
200
- if (devFlags.debug)
201
- console.debug(`${_a.name} ⚡️ ${type}`);
202
- if (!this.#track)
203
- return;
204
- if (!this.#measurePointerIsOverDot(clientX, clientY))
205
- return; // ignore taps elsewhere on the track
206
- this.#didDrag = true; // dot was engaged — settle() will own the outcome, click must be swallowed
207
- const currentDelta = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0;
208
- const currentAbsoluteX = this.#baseX + currentDelta;
209
- this.#dragOffsetX = clientX - this.#track.getBoundingClientRect().left - currentAbsoluteX;
210
- this.#track.style.setProperty('--toggle--dot-transition-duration', '0ms');
211
- this.#track.setPointerCapture(pointerId);
212
- // this.#updateFromEvent(clientX)
213
- };
214
- #handleTrackPointermove = ({ type, clientX }) => {
215
- if (devFlags.debug)
216
- console.debug(`${_a.name} ⚡️ ${type}`);
217
- if (!this.#isDragging)
218
- return;
219
- this.#updateFromEvent(clientX);
220
- };
221
- #handleTrackPointerup = ({ type, pointerId }) => {
222
- if (devFlags.debug)
223
- console.debug(`${_a.name} ⚡️ ${type}`);
224
- if (!this.#isDragging)
225
- return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
226
- this.#track?.style.removeProperty('--toggle--dot-transition-duration');
227
- this.#track?.releasePointerCapture(pointerId);
228
- this.#settle();
229
- };
230
- #handleTrackPointercancel = ({ type }) => {
231
- if (devFlags.debug)
232
- console.debug(`${_a.name} ⚡️ ${type}`);
233
- if (!this.#isDragging)
234
- return; // already settled via pointerup, or nothing to settle
235
- this.#track?.style.removeProperty('--toggle--dot-transition-duration');
236
- this.#settle();
237
- };
238
- #handleWindowBlur = () => {
239
- if (!this.#isDragging)
240
- return;
241
- this.#track?.style.removeProperty('--toggle--dot-transition-duration');
242
- this.#settle();
243
- };
244
- #updateFromEvent = (clientX) => {
245
- if (!this.#track)
246
- return;
247
- const { left } = this.#track.getBoundingClientRect();
248
- const absoluteX = Math.min(Math.max(clientX - left - this.#dragOffsetX, this.#trackMinX), this.#trackMaxX);
249
- this.#track.style.setProperty('--toggle--dot-x', `${Math.round(absoluteX - this.#baseX)}px`);
250
- };
251
- #settle = () => {
252
- if (!this.#track)
253
- return;
254
- const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0;
255
- const absoluteX = this.#baseX + deltaX;
256
- const nextIsOn = absoluteX > this.#trackMaxX / 2;
257
- if (nextIsOn === this.isOn)
258
- return this.#track.style.removeProperty('--toggle--dot-x'); // pure transform animation back to rest, inset untouched
259
- this.#applyIsOnWithFlip(nextIsOn);
260
- this.#sendValueToForm(true);
261
- };
262
- #handleTrackKeydown = (evt) => {
263
- if (devFlags.debug)
264
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
265
- if (' ' !== evt.key)
266
- return;
267
- evt.preventDefault();
268
- this.#applyIsOnWithFlip(!this.isOn);
269
- this.#sendValueToForm(true);
270
- };
271
- #applyIsOnWithFlip = (nextIsOn) => {
272
- if (!this.#track || nextIsOn === this.isOn)
273
- return;
274
- // capture current visual position under the OLD base, before flipping state
275
- const deltaX = parseFloat(self.getComputedStyle(this.#track).getPropertyValue('--toggle--dot-x')) || 0, oldAbsoluteX = this.#baseX + deltaX;
276
- this.isOn = nextIsOn; // changes --toggle--dot-inset-inline-start/-end via aria-checked
277
- const compensationX = oldAbsoluteX - this.#baseX; // baseX now reflects the NEW state
278
- // make inset + transform jump together, instantly, so nothing is visibly out of sync
279
- this.#track.style.setProperty('--toggle--dot-transition-duration', '0ms');
280
- this.#track.style.setProperty('--toggle--dot-x', `${Math.round(compensationX)}px`);
281
- void this.#track.offsetWidth; // force reflow so the instant jump is committed before re-enabling transitions
282
- this.#track.style.removeProperty('--toggle--dot-transition-duration');
283
- self.requestAnimationFrame(() => {
284
- this.#track?.style.removeProperty('--toggle--dot-x'); // only transform animates from here — single source of motion
285
- });
286
- };
287
- #sendValueToForm = (dispatchEvent = true) => {
288
- // input.value has already been updated/synced !!
289
- if (this.matches(':disabled'))
290
- return this.setValidity({});
291
- if (this.hasAttribute('required') && !this.isOn) {
292
- this.setValidity({ valueMissing: true });
293
- }
294
- else
295
- this.setValidity({});
296
- const entries = new FormData();
297
- if (this.value)
298
- entries.append(this.name, this.value);
299
- this.#internals.setFormValue(entries);
300
- if (dispatchEvent)
301
- this.dispatchEvent(new CustomEvent('toggle:change', { detail: { value: this.value, isOn: this.isOn }, bubbles: true, composed: true }));
302
- };
303
- /**
304
- * Form participation property
305
- */
306
- get name() {
307
- return this.getAttribute('name') ?? this.getAttribute('label') ?? this.querySelector(':scope>[slot=label]')?.textContent ?? '';
308
- }
309
- get value() {
310
- return this.#value;
311
- }
312
- set value(v) {
313
- this.#value = this.isOn ? String(v) : null;
314
- }
315
- setValidity = (flags, message, anchor) => {
316
- // let msg
317
- // if (message)
318
- for (const k in flags) {
319
- const key = k; // ✅ type-safe cast
320
- if (true !== flags[key])
321
- continue;
322
- for (const el of this.#slots?.get('validity-options')?.assignedElements({ flatten: true }) ?? []) {
323
- if (!el.matches('option'))
324
- continue;
325
- const { label, value } = el;
326
- if (`${kebabCase(key)}` === value) {
327
- message = label;
328
- break;
329
- }
330
- else if (`${kebabCase(key)}:${message}` === value) {
331
- message = label;
332
- break;
333
- }
334
- }
335
- }
336
- if (!message)
337
- for (const k in flags) {
338
- const key = k; // ✅ type-safe cast
339
- if (true !== flags[key])
340
- continue;
341
- message = kebabCase(key);
342
- break;
343
- }
344
- if (devFlags.debug)
345
- console.debug(`${_a.name} ⚡️ validity-change`);
346
- return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
347
- };
348
- setCustomValidity = (message) => {
349
- this.#customValidity = message;
350
- if (this.#customValidity)
351
- this.#internals.setValidity({ ...this.#internals.validity, customError: true }, message);
352
- else
353
- this.#sendValueToForm(false);
354
- };
355
- formStateRestoreCallback(state, reason) {
356
- this.value = state;
357
- }
358
- formAssociatedCallback(form) {
359
- this.#sendValueToForm(false);
360
- }
361
- formDisabledCallback(disabled) {
362
- for (const el of this.#shadowRoot.querySelectorAll('input'))
363
- el.toggleAttribute('disabled', !disabled);
364
- }
365
- formResetCallback() {
366
- this.value = '';
367
- this.#sendValueToForm(false);
368
- }
369
- }
370
- _a = ToggleView;
@@ -1,13 +0,0 @@
1
- /**
2
- * @summary A container view that groups items together in the toolbar or navigation bar.
3
- */
4
- export declare class ToolBarItemGroup extends HTMLElement {
5
- constructor();
6
- connectedCallback(): void;
7
- disconnectedCallback(): void;
8
- }
9
- declare global {
10
- interface HTMLElementTagNameMap {
11
- 'tool-bar-item-group': ToolBarItemGroup;
12
- }
13
- }
@@ -1,31 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var ToolBarItemGroup_1;
8
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
9
- import { adaptiveSlot } from '../internal/decorators';
10
- import { devFlags } from '../internal/utils';
11
- /**
12
- * @summary A container view that groups items together in the toolbar or navigation bar.
13
- */
14
- let ToolBarItemGroup = ToolBarItemGroup_1 = class ToolBarItemGroup extends HTMLElement {
15
- constructor() {
16
- super();
17
- }
18
- connectedCallback() {
19
- if (devFlags.debug)
20
- console.debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
21
- }
22
- disconnectedCallback() {
23
- if (devFlags.debug)
24
- console.debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
25
- CleanupRegistry.unregister(this);
26
- }
27
- };
28
- ToolBarItemGroup = ToolBarItemGroup_1 = __decorate([
29
- adaptiveSlot()
30
- ], ToolBarItemGroup);
31
- export { ToolBarItemGroup };
@@ -1,16 +0,0 @@
1
- /**
2
- * @summary A view placed in the toolbar or navigation bar.
3
- */
4
- export declare class ToolBarItem extends HTMLElement {
5
- #private;
6
- static get observedAttributes(): string[];
7
- constructor();
8
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
9
- disconnectedCallback(): void;
10
- connectedCallback(): void;
11
- }
12
- declare global {
13
- interface HTMLElementTagNameMap {
14
- 'tool-bar-item': ToolBarItem;
15
- }
16
- }
@@ -1,69 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var ToolBarItem_1;
8
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
9
- import { adaptiveSlot } from '../internal/decorators';
10
- import { devFlags, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
11
- import { Snapshot } from '../snapshot';
12
- /**
13
- * @summary A view placed in the toolbar or navigation bar.
14
- */
15
- let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
16
- static get observedAttributes() {
17
- return ['slot', 'data-previous-slot', 'title-key'];
18
- }
19
- #mutationObserver;
20
- constructor() {
21
- super();
22
- }
23
- attributeChangedCallback(name, oldValue, newValue) {
24
- if (devFlags.debug)
25
- console.debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
26
- switch (name) {
27
- case 'slot':
28
- case 'data-previous-slot':
29
- case 'title-key': {
30
- this.#mutationObserver?.disconnect();
31
- const role = this.getAttribute('data-previous-slot') ?? this.getAttribute('slot') ?? '', tKey = this.getAttribute('title-key');
32
- if (['confirmation-action', 'cancellation-action'].includes(role))
33
- Snapshot.waitReady.then(() => {
34
- ensurePlaceholder(this.querySelector(':scope>button:not(:has(> :not([slot])))'), role, tKey, Snapshot.config);
35
- this.#mutationObserver = new MutationObserver((mutations) => {
36
- for (const { target } of mutations)
37
- if (target instanceof HTMLElement)
38
- ensurePlaceholder(this.querySelector(':scope>button:not(:has(> :not([slot])))'), role, tKey, Snapshot.config);
39
- });
40
- this.#mutationObserver.observe(this, {
41
- childList: true,
42
- });
43
- });
44
- break;
45
- }
46
- }
47
- }
48
- disconnectedCallback() {
49
- if (devFlags.debug)
50
- console.debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
51
- this.#mutationObserver?.disconnect();
52
- CleanupRegistry.unregister(this);
53
- }
54
- connectedCallback() {
55
- if (devFlags.debug)
56
- console.debug(`${ToolBarItem_1.name} ⚡️ connect`);
57
- CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, ({ target }) => {
58
- if (!(target instanceof HTMLElement))
59
- return true;
60
- if (target.closest('menu-view[open]'))
61
- return false;
62
- return true;
63
- }), this).on());
64
- }
65
- };
66
- ToolBarItem = ToolBarItem_1 = __decorate([
67
- adaptiveSlot((el) => !el.closest('tool-bar-item-group'))
68
- ], ToolBarItem);
69
- export { ToolBarItem };
@@ -1,26 +0,0 @@
1
- /**
2
- * @summary A list of items placed into the toolbar or navigation bar around your content.
3
- *
4
- * @slot cancellation-action — The item represents a cancellation action for a modal interface. Places the item in the leading edge of the top bar and on the trailing edge of the bottom bar when fine modal
5
- * @slot primary-action — The item represents a primary action. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
6
- * @slot confirmation-action — The item represents a confirmation action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
7
- * @slot destructive-action — The item represents a destructive action for a modal interface. Places the item in the leading edge of the top bar and on the leading edge of the bottom bar when fine modal
8
- * @slot top-bar-leading — Places the item in the leading edge of the top bar
9
- * @slot top-bar-principal — Places the item in the middle of the top bar
10
- * @slot top-bar-trailing — Places the item in the trailing edge of the top bar
11
- * @slot bottom-bar-leading — Places the item in the leading edge of the bottom bar
12
- * @slot bottom-bar-principal — Places the item in the middle of the bottom bar
13
- * @slot bottom-bar-trailing — Places the item in the trailing edge of the bottom bar
14
- */
15
- export declare class ToolBar extends HTMLElement {
16
- #private;
17
- static get template(): DocumentFragment;
18
- constructor();
19
- connectedCallback(): void;
20
- disconnectedCallback(): void;
21
- }
22
- declare global {
23
- interface HTMLElementTagNameMap {
24
- 'tool-bar': ToolBar;
25
- }
26
- }
@@ -1,95 +0,0 @@
1
- var _a;
2
- import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
3
- import { $, devFlags } from '../internal/utils';
4
- import { html } from '../tpl';
5
- const observers = new ResizeObserverSingleton();
6
- /**
7
- * @summary A list of items placed into the toolbar or navigation bar around your content.
8
- *
9
- * @slot cancellation-action — The item represents a cancellation action for a modal interface. Places the item in the leading edge of the top bar and on the trailing edge of the bottom bar when fine modal
10
- * @slot primary-action — The item represents a primary action. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
11
- * @slot confirmation-action — The item represents a confirmation action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal
12
- * @slot destructive-action — The item represents a destructive action for a modal interface. Places the item in the leading edge of the top bar and on the leading edge of the bottom bar when fine modal
13
- * @slot top-bar-leading — Places the item in the leading edge of the top bar
14
- * @slot top-bar-principal — Places the item in the middle of the top bar
15
- * @slot top-bar-trailing — Places the item in the trailing edge of the top bar
16
- * @slot bottom-bar-leading — Places the item in the leading edge of the bottom bar
17
- * @slot bottom-bar-principal — Places the item in the middle of the bottom bar
18
- * @slot bottom-bar-trailing — Places the item in the trailing edge of the bottom bar
19
- */
20
- export class ToolBar extends HTMLElement {
21
- static #template;
22
- static get template() {
23
- // <!--exportparts="toolbar-leading-stack,toolbar-principal-stack,toolbar-trailing-stack"-->
24
- return (this.#template ??= $(html `<div part="root top-bar">
25
- <div part="root toolbar-leading-stack">
26
- <slot name="cancellation-action"></slot>
27
- <slot name="destructive-action"></slot>
28
- <slot name="top-bar-leading"></slot>
29
- </div>
30
- <div part="root toolbar-principal-stack">
31
- <slot name="top-bar-principal"></slot>
32
- </div>
33
- <div part="root toolbar-trailing-stack">
34
- <slot name="top-bar-trailing"></slot>
35
- <slot name="primary-action"></slot>
36
- <slot name="confirmation-action"></slot>
37
- </div>
38
- </div>
39
- <div part="root bottom-bar">
40
- <div part="root toolbar-leading-stack">
41
- <slot name="bottom-bar-leading"></slot>
42
- </div>
43
- <div part="root toolbar-principal-stack">
44
- <slot name="bottom-bar-principal"></slot>
45
- </div>
46
- <div part="root toolbar-trailing-stack">
47
- <slot name="bottom-bar-trailing"></slot>
48
- </div>
49
- </div>`));
50
- }
51
- #shadowRoot;
52
- get #scrollView() {
53
- return this.parentElement?.querySelector(':scope>scroll-view') ?? undefined; //this.previousElementSibling ?? undefined
54
- }
55
- constructor() {
56
- super();
57
- this.#shadowRoot = this.attachShadow({ mode: 'closed' });
58
- this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
59
- }
60
- connectedCallback() {
61
- if (devFlags.debug)
62
- console.debug(`${_a.name} ⚡️ connect`);
63
- // NOTE: wait for config
64
- // Snapshot.waitReady.then(() => {
65
- for (const el of this.#shadowRoot.querySelectorAll(`[part*="toolbar-leading-stack"],[part*="toolbar-trailing-stack"]`))
66
- observers.observe(el, this.#measureStacks.bind(this));
67
- // })
68
- }
69
- disconnectedCallback() {
70
- if (devFlags.debug)
71
- console.debug(`${_a.name} ⚡️ disconnect`);
72
- observers.unobserve(this);
73
- }
74
- #measureStacks(entry) {
75
- if (devFlags.debug)
76
- console.debug(`${_a.name} ⚡️ measure`);
77
- if (this.closest('[hidden]'))
78
- return;
79
- const leading = 'toolbar-leading-stack', trailing = 'toolbar-trailing-stack';
80
- const parentMap = {
81
- 'top-bar': 'navbar',
82
- 'bottom-bar': 'toolbar', //'bottombar',
83
- };
84
- const { contentRect: { width }, target, } = entry;
85
- const parentPart = target.parentElement?.part.contains('top-bar') ? 'top-bar' : target.parentElement?.part.contains('bottom-bar') ? 'bottom-bar' : null;
86
- if (!parentPart)
87
- return;
88
- const side = target.part.contains(leading) ? 'inline-start' : target.part.contains(trailing) ? 'inline-end' : null;
89
- if (!side)
90
- return;
91
- const prop = `--${parentMap[parentPart]}-padding-${side}`;
92
- this.#scrollView?.style?.setProperty(prop, `${Math.round(width)}px`); // $.prop(prop, `${Math.round(width)}px`, this.#scrollView) //
93
- }
94
- }
95
- _a = ToolBar;
@@ -1,20 +0,0 @@
1
- /**
2
- * BUG: Safari on IOS reports inaccurate innerHeight (which is what we really want) on orientationchange.
3
- * So we live with a pescy body-scrollbar that shows up on resize on desktops.
4
- *
5
- * @summary Required component, used to handle the virtual keyboard on touch devices.
6
- *
7
- * @attr {Inter} system-font — Prefers the "Inter" font family, if loaded.
8
- */
9
- export declare class VKeyboard extends HTMLElement {
10
- #private;
11
- constructor();
12
- disconnectedCallback(): void;
13
- connectedCallback(): void;
14
- set shouldKeyboardBeOpen(fn: () => boolean);
15
- }
16
- declare global {
17
- interface HTMLElementTagNameMap {
18
- 'v-keyboard': VKeyboard;
19
- }
20
- }