@swiftwc/ui 0.0.0-dev.98 → 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 -57
  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 +35 -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 +88 -30
  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 +8 -1
  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 -249
  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 -10592
  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,249 +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 } 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
- 'keyboard-type',
28
- /**
29
- * @type {boolean}
30
- */
31
- 'required',
32
- /**
33
- * @type {boolean}
34
- */
35
- 'disabled',
36
- ];
37
- }
38
- static #template;
39
- static get template() {
40
- return (this.#template ??= $(html `<label part="root toggle-stack">
41
- <div part="root toggle-label-stack">
42
- <slot name="label"></slot>
43
- </div>
44
- <div part="root toggle-input-stack">
45
- <!--<input type="checkbox" part="root input toggle-form-input">-->
46
- <div part="root toggle-form-input" tabindex="0"></div>
47
- </div>
48
- <slot name="validity-options" hidden></slot>
49
- </label>`));
50
- }
51
- #renderValidityMsgs = (entries) => {
52
- if (devFlags.debug)
53
- console.debug(`${_a.name} ⚡️ mutation`);
54
- this.setValidity(this.validity, this.validationMessage);
55
- };
56
- #shadowRoot;
57
- #customValidity = '';
58
- #slots = new Map();
59
- #validityObservers = new MutationObserverSet(this.#renderValidityMsgs);
60
- #input;
61
- #value = 'on';
62
- #isOn = false;
63
- #connected = false;
64
- get #internals() {
65
- return getInternals(this);
66
- }
67
- constructor() {
68
- super();
69
- this.#shadowRoot = this.attachShadow({ mode: 'closed' });
70
- this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
71
- for (const slot of this.#shadowRoot.querySelectorAll('slot'))
72
- this.#slots?.set(slot.name, slot);
73
- CleanupRegistry.register(this, () => {
74
- this.#slots = new Map();
75
- });
76
- CleanupRegistry.unregister(this, 'validities');
77
- CleanupRegistry.register(this, onoff('slotchange', this.#handleValiditiesSlotchange, this.#slots?.get('validity-options')).on(), 'validities');
78
- this.#input = this.#shadowRoot.querySelector('[part*=toggle-form-input]') ?? undefined;
79
- this.#input?.addEventListener('click', () => {
80
- this.isOn = !this.isOn;
81
- this.#sendValueToForm(this.#connected);
82
- });
83
- CleanupRegistry.register(this, onoff([{ types: 'focusin', listener: this.#handleFocusin }], this).on());
84
- CleanupRegistry.register(this, onoff([{ types: 'keydown', listener: this.#handleInputKeydown }], this.#input).on());
85
- // CleanupRegistry.register(this, onoff([{ types: 'input', listener: this.#handleInputInput }], this.#input).on())
86
- }
87
- attributeChangedCallback(name, oldValue, newValue) {
88
- if (devFlags.debug)
89
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
90
- switch (name) {
91
- case 'value':
92
- this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
93
- this.#sendValueToForm(this.#connected);
94
- break;
95
- case 'is-on':
96
- this.isOn = newValue !== null; // this.#input?.setAttribute('checked', newValue ?? '')
97
- this.#sendValueToForm(this.#connected);
98
- break;
99
- case 'required':
100
- // this.#input?.setAttribute(name, newValue ?? '')
101
- this.#sendValueToForm(this.#connected);
102
- break;
103
- case 'name':
104
- this.#sendValueToForm(this.#connected);
105
- break;
106
- case 'label':
107
- queryMorph('[slot=label]', html `<label-view slot="label">${newValue ? html `<span>${newValue}</span>` : null}</label-view>`, this);
108
- break;
109
- case 'disabled':
110
- for (const el of this.#shadowRoot.querySelectorAll('input'))
111
- el.toggleAttribute('disabled', !newValue);
112
- break;
113
- }
114
- }
115
- disconnectedCallback() {
116
- super.disconnectedCallback();
117
- this.#validityObservers.unobserveAll();
118
- }
119
- connectedCallback() {
120
- super.connectedCallback();
121
- // finally
122
- // if (this.hasAttribute('value')) this.value = this.getAttribute('value') ?? ''
123
- if (this.hasAttribute('is-on'))
124
- this.isOn = this.hasAttribute('is-on');
125
- this.#sendValueToForm(false);
126
- this.#connected = true;
127
- }
128
- get toggleStyle() {
129
- return toggleStyles.includes(this.getAttribute('toggle-style') ?? '') ? this.getAttribute('toggle-style') : 'switch';
130
- }
131
- get isOn() {
132
- return this.#isOn;
133
- }
134
- set isOn(v) {
135
- this.#isOn = Boolean(v);
136
- this.#value = this.#isOn ? (this.getAttribute('value') ?? 'on') : null;
137
- this.ariaChecked = `${this.#isOn}`;
138
- }
139
- #handleValiditiesSlotchange = ({ type, target: slot }) => {
140
- if (devFlags.debug)
141
- console.debug(`${_a.name} ⚡️ ${type}`);
142
- if (!(slot instanceof HTMLSlotElement))
143
- return;
144
- const assigned = slot.assignedElements();
145
- this.#validityObservers.syncObservations(assigned, ['value', 'label']);
146
- this.#renderValidityMsgs([]);
147
- };
148
- #handleFocusin = ({ type, target }) => {
149
- if (devFlags.debug)
150
- console.debug(`${_a.name} ⚡️ ${type}`);
151
- if (target === this)
152
- this.#input?.focus();
153
- };
154
- #sendValueToForm = (dispatchEvent = true) => {
155
- // input.value has already been updated/synced !!
156
- if (this.matches(':disabled'))
157
- return this.setValidity({});
158
- if (this.hasAttribute('required') && !this.isOn) {
159
- this.setValidity({ valueMissing: true });
160
- }
161
- else {
162
- this.setValidity({});
163
- }
164
- const entries = new FormData();
165
- if (this.value)
166
- entries.append(this.name, this.value);
167
- this.#internals.setFormValue(entries);
168
- if (dispatchEvent)
169
- this.dispatchEvent(new CustomEvent('toggle:change', { detail: { value: this.value, isOn: this.isOn }, bubbles: true, composed: true }));
170
- };
171
- #handleInputKeydown = (evt) => {
172
- if (devFlags.debug)
173
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
174
- this.isOn = !this.isOn;
175
- this.#sendValueToForm();
176
- };
177
- #handleInputInput = (evt) => {
178
- if (devFlags.debug)
179
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
180
- this.#sendValueToForm();
181
- };
182
- /**
183
- * Form participation property
184
- */
185
- get name() {
186
- return this.getAttribute('name') ?? this.getAttribute('label') ?? this.querySelector(':scope>[slot=label]')?.textContent ?? '';
187
- }
188
- get value() {
189
- return this.#value;
190
- }
191
- set value(v) {
192
- this.#value = this.isOn ? String(v) : null;
193
- }
194
- setValidity = (flags, message, anchor) => {
195
- // let msg
196
- // if (message)
197
- for (const k in flags) {
198
- const key = k; // ✅ type-safe cast
199
- if (true !== flags[key])
200
- continue;
201
- for (const el of this.#slots?.get('validity-options')?.assignedElements({ flatten: true }) ?? []) {
202
- if (!el.matches('option'))
203
- continue;
204
- const { label, value } = el;
205
- if (`${kebabCase(key)}` === value) {
206
- message = label;
207
- break;
208
- }
209
- else if (`${kebabCase(key)}:${message}` === value) {
210
- message = label;
211
- break;
212
- }
213
- }
214
- }
215
- if (!message)
216
- for (const k in flags) {
217
- const key = k; // ✅ type-safe cast
218
- if (true !== flags[key])
219
- continue;
220
- message = kebabCase(key);
221
- break;
222
- }
223
- if (devFlags.debug)
224
- console.debug(`${_a.name} ⚡️ validity-change`);
225
- return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
226
- };
227
- setCustomValidity = (message) => {
228
- this.#customValidity = message;
229
- if (this.#customValidity)
230
- this.#internals.setValidity({ ...this.#internals.validity, customError: true }, message);
231
- else
232
- this.#sendValueToForm(false);
233
- };
234
- formStateRestoreCallback(state, reason) {
235
- this.value = state;
236
- }
237
- formAssociatedCallback(form) {
238
- this.#sendValueToForm(false);
239
- }
240
- formDisabledCallback(disabled) {
241
- for (const el of this.#shadowRoot.querySelectorAll('input'))
242
- el.toggleAttribute('disabled', !disabled);
243
- }
244
- formResetCallback() {
245
- this.value = '';
246
- this.#sendValueToForm(false);
247
- }
248
- }
249
- _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
- }
@@ -1,89 +0,0 @@
1
- var _a;
2
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { $, devFlags, frame, onoff, sleep } from '../internal/utils';
4
- import { Snapshot } from '../snapshot';
5
- /**
6
- * BUG: Safari on IOS reports inaccurate innerHeight (which is what we really want) on orientationchange.
7
- * So we live with a pescy body-scrollbar that shows up on resize on desktops.
8
- *
9
- * @summary Required component, used to handle the virtual keyboard on touch devices.
10
- *
11
- * @attr {Inter} system-font — Prefers the "Inter" font family, if loaded.
12
- */
13
- export class VKeyboard extends HTMLElement {
14
- /**
15
- * Change like this:
16
- * document.querySelector('v-keyboard').shouldKeyboardBeOpen = () => document.activeElement.tagName === 'INPUT'
17
- */
18
- #shouldKeyboardBeOpenCallback = () => {
19
- return 'INPUT' === document.activeElement?.tagName && 'text' === document.activeElement?.getAttribute('type');
20
- };
21
- constructor() {
22
- super();
23
- }
24
- disconnectedCallback() {
25
- if (devFlags.debug)
26
- console.debug(`${_a.name} ⚡️ disconnect`);
27
- CleanupRegistry.unregister(this);
28
- }
29
- connectedCallback() {
30
- if (devFlags.debug)
31
- console.debug(`${_a.name} ⚡️ connect`);
32
- this.inert = true;
33
- CleanupRegistry.register(this, onoff([
34
- { types: 'scroll', listener: this.#handleWindowScroll },
35
- { types: 'orientationchange', listener: this.#handleWindowOrientationchange },
36
- ], self).on());
37
- CleanupRegistry.register(this, onoff('resize', this.#handleVisualViewportResize, self.visualViewport ?? undefined, { passive: true }).on());
38
- this.#handleVisualViewportResize();
39
- //
40
- CleanupRegistry.register(this, onoff('focusin', this.#handleBodyFocusin, document.body).on());
41
- Snapshot.waitReady.then(() => {
42
- document.documentElement.style.setProperty('--root-font-size', parseFloat(self.getComputedStyle(document.documentElement).fontSize).toFixed(5));
43
- CleanupRegistry.register(this, onoff('transitionrun', this.#handleDocumentTransitionrun, document.documentElement).on());
44
- });
45
- }
46
- #handleDocumentTransitionrun = (evt) => {
47
- if (evt.target !== document.documentElement || 'font-size' !== evt.propertyName)
48
- return;
49
- document.documentElement.style.setProperty('--root-font-size', parseFloat(self.getComputedStyle(document.documentElement).fontSize).toFixed(5));
50
- };
51
- #handleWindowScroll = () => {
52
- self.scrollTo(0, 0);
53
- };
54
- #handleVisualViewportResize = () => {
55
- const dvh = self.visualViewport?.height ?? 0, fullLvh = this.offsetHeight;
56
- const diff = Math.abs(self.outerHeight - (this.#shouldKeyboardBeOpenCallback() ? dvh : fullLvh));
57
- $.prop('--100lvh', 30 < diff ? `${dvh}px` : `${fullLvh}px`, document.documentElement); //document.documentElement.style.setProperty('--100lvh', 30 < diff ? `${dvh}px` : `${fullLvh}px`)
58
- $.prop('--keyboard-inset-top', 30 < diff ? `${dvh}px` : `${fullLvh}px`, document.documentElement); //document.documentElement.style.setProperty('--keyboard-inset-top', 30 < diff ? `${dvh}px` : `${fullLvh}px`)
59
- $.prop('--keyboard-inset-height', 30 < diff ? `${diff}px` : `0px`, document.documentElement); //document.documentElement.style.setProperty('--keyboard-inset-height', 30 < diff ? `${diff}px` : `0px`)
60
- self.scrollTo(0, 0);
61
- };
62
- #handleWindowOrientationchange = async () => {
63
- if (devFlags.debug)
64
- console.debug(`${_a.name} ⚡️ orientationchange`);
65
- if (!(await frame(this)))
66
- return; //self.requestAnimationFrame(this.#ifKeyboardScrollIntoActiveElement)
67
- this.#ifKeyboardScrollIntoActiveElement();
68
- };
69
- #handleBodyFocusin = async () => {
70
- if (devFlags.debug)
71
- console.debug(`${_a.name} ⚡️ focusin`);
72
- await sleep(100); // self.setTimeout(this.#ifKeyboardScrollIntoActiveElement, 100)
73
- if (!this.isConnected)
74
- return;
75
- this.#ifKeyboardScrollIntoActiveElement();
76
- };
77
- #ifKeyboardScrollIntoActiveElement = () => {
78
- if (!this.#shouldKeyboardBeOpenCallback() || !document.activeElement)
79
- return;
80
- const parent = document.activeElement?.closest('scroll-view');
81
- parent?.centerScrollToElement?.(document.activeElement);
82
- };
83
- set shouldKeyboardBeOpen(fn) {
84
- if ('function' !== typeof fn)
85
- throw new TypeError(`fn must be typeof function`);
86
- this.#shouldKeyboardBeOpenCallback = fn;
87
- }
88
- }
89
- _a = VKeyboard;
@@ -1,25 +0,0 @@
1
- /**
2
- * @summary A view that arranges its children one on top of the other.
3
- *
4
- * @attr {@FrameInlineLength} readable — Shortcut for `placement="leading fill" frame:alignment="center" frame:width="infinity" frame:max-width="{length}"`
5
- * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution — The distribution of cols
6
- *
7
- * @attr {@Template} template — The main-axis grid template
8
- *
9
- * @attr {@Spacing} spacing — The gap between the primary axis
10
- *
11
- * @attr {@inlineSet} alignment — The cross-axis alignment
12
- * @attr {@blockSet} distribution — The main-axis alignment
13
- * @attr {@blockPlacementSet} placement — The main-axis alignment
14
- *
15
- */
16
- export declare class VStack extends HTMLElement {
17
- constructor();
18
- connectedCallback(): void;
19
- disconnectedCallback(): void;
20
- }
21
- declare global {
22
- interface HTMLElementTagNameMap {
23
- 'v-stack': VStack;
24
- }
25
- }
@@ -1,29 +0,0 @@
1
- import { devFlags } from '../internal/utils';
2
- /**
3
- * @summary A view that arranges its children one on top of the other.
4
- *
5
- * @attr {@FrameInlineLength} readable — Shortcut for `placement="leading fill" frame:alignment="center" frame:width="infinity" frame:max-width="{length}"`
6
- * @attr {leading|"leading fill"|center|trailing|fill|space-between} distribution — The distribution of cols
7
- *
8
- * @attr {@Template} template — The main-axis grid template
9
- *
10
- * @attr {@Spacing} spacing — The gap between the primary axis
11
- *
12
- * @attr {@inlineSet} alignment — The cross-axis alignment
13
- * @attr {@blockSet} distribution — The main-axis alignment
14
- * @attr {@blockPlacementSet} placement — The main-axis alignment
15
- *
16
- */
17
- export class VStack extends HTMLElement {
18
- constructor() {
19
- super();
20
- }
21
- connectedCallback() {
22
- if (devFlags.debug)
23
- console.debug(`${VStack.name} ⚡️ connect`);
24
- }
25
- disconnectedCallback() {
26
- if (devFlags.debug)
27
- console.debug(`${VStack.name} ⚡️ disconnect`);
28
- }
29
- }