@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,279 +0,0 @@
1
- import { alertDialog, confirmationDialog as confirmationDialogBus, lifecycleObserver } from '../buses';
2
- import * as Components from '../components';
3
- import { I18n } from '../i18n';
4
- import { NavigationPath } from '../internal/class/navigation-path';
5
- import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
6
- import { $, devFlags, kebabCase, onoff } from '../internal/utils';
7
- import { Snapshot } from '../snapshot';
8
- import { html, render } from '../tpl';
9
- //#region polyfills
10
- export const polyfills = new Map();
11
- for (const [k, Ctor] of Object.entries(Components)) {
12
- const is = kebabCase(k);
13
- if ('polyfillExtends' in Ctor && 'string' === typeof Ctor.polyfillExtends) {
14
- if (customElements.get(is))
15
- continue;
16
- customElements.define(is, Ctor, { extends: Ctor.polyfillExtends });
17
- if (!(document.createElement(Ctor.polyfillExtends, { is }) instanceof Ctor))
18
- polyfills.set(is, Ctor);
19
- // const testEl = document.createElement('template')
20
- // testEl.innerHTML = `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`
21
- // const testNode = testEl.content.firstElementChild,
22
- if (!($(html `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
23
- polyfills.set(is, Ctor);
24
- continue;
25
- }
26
- if (!customElements.get(is))
27
- customElements.define(is, Ctor);
28
- }
29
- if (devFlags.debug)
30
- console.debug(polyfills);
31
- if (0 < polyfills.size) {
32
- const polyfillTagNamesCache = new Set([...polyfills.values()].map((v) => String(v.polyfillExtends ?? '').toUpperCase()).filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
33
- const handlers = new WeakMap();
34
- const observe = (el, polyfill) => {
35
- if (!Array.isArray(polyfill.observedAttributes))
36
- return;
37
- if (0 === polyfill?.observedAttributes.length)
38
- return;
39
- if (!polyfill.polyfillAttributeChangedCallback)
40
- return;
41
- const observer = new MutationObserver(polyfill.polyfillAttributeChangedCallback);
42
- observer.observe(el, {
43
- attributes: true,
44
- attributeFilter: polyfill.observedAttributes,
45
- attributeOldValue: true,
46
- });
47
- handlers.set(el, observer);
48
- for (const attributeName of polyfill.observedAttributes)
49
- if (el.hasAttribute(attributeName)) {
50
- const entry = {
51
- attributeName,
52
- oldValue: null,
53
- target: el,
54
- };
55
- polyfill.polyfillAttributeChangedCallback([entry]);
56
- }
57
- }, unobserve = (el) => {
58
- handlers.delete(el);
59
- }, polyfillTagNamesCacheSelector = [...polyfillTagNamesCache.values()].map((v) => `${v}`.toLowerCase()).join(','), flatten = (node) => [node, ...(node.querySelectorAll?.(polyfillTagNamesCacheSelector) ?? [])];
60
- if (devFlags.debug)
61
- console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
62
- for (const [is, polyfill] of polyfills)
63
- for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${CSS.escape(is)}"]`)) {
64
- polyfill.polyfillConnectedCallback(el);
65
- observe(el, polyfill);
66
- }
67
- // observer callback
68
- const observer = new MutationObserver((mutations) => {
69
- for (const { addedNodes, removedNodes } of mutations) {
70
- for (const root of addedNodes) {
71
- if (!(root instanceof HTMLElement))
72
- continue;
73
- for (const node of flatten(root)) {
74
- if (!(node instanceof HTMLElement))
75
- continue;
76
- if (!polyfillTagNamesCache.has(node.tagName))
77
- continue;
78
- const is = node?.getAttribute('is') ?? '';
79
- if (!polyfills.has(is))
80
- continue;
81
- polyfills.get(is)?.polyfillConnectedCallback(node);
82
- observe(node, polyfills.get(is));
83
- }
84
- }
85
- for (const root of removedNodes) {
86
- if (!(root instanceof HTMLElement))
87
- continue;
88
- for (const node of flatten(root)) {
89
- if (!(node instanceof HTMLElement))
90
- continue;
91
- if (!polyfillTagNamesCache.has(node.tagName))
92
- continue;
93
- const is = node?.getAttribute('is') ?? '';
94
- if (!polyfills.has(is))
95
- continue;
96
- polyfills.get(is)?.polyfillDisconnectedCallback(node);
97
- unobserve(node);
98
- }
99
- }
100
- }
101
- });
102
- observer.observe(document.body, {
103
- childList: true,
104
- subtree: true,
105
- });
106
- }
107
- // SECTION: Safari polyfill
108
- document.addEventListener('touchstart', () => { }, { passive: true });
109
- //#endregion
110
- // SECTION
111
- const handleHelp = ({ target, relatedTarget }) => {
112
- if (!(target instanceof HTMLElement))
113
- return;
114
- const trigger = target.closest('[help]');
115
- if (!trigger)
116
- return;
117
- if (['PICKER-VIEW'].includes(trigger.tagName))
118
- return;
119
- if (relatedTarget instanceof HTMLElement && trigger.contains(relatedTarget))
120
- return;
121
- const newAnchorName = `--help-${self.crypto.randomUUID()}`;
122
- const tooltip = $(html `<fine-tooltip></fine-tooltip>`, '>1');
123
- trigger.style.setProperty('anchor-name', newAnchorName);
124
- tooltip.style.setProperty('position-anchor', newAnchorName);
125
- document.body.appendChild(tooltip);
126
- // setInterval(() => {
127
- // trigger.setAttribute('help', trigger.getAttribute('help') + 'h')
128
- // }, 2000)
129
- // console.log(999, trigger)
130
- }, handleDone = ({ target, relatedTarget }) => {
131
- if (!(target instanceof HTMLElement))
132
- return;
133
- const trigger = target.closest('[help]');
134
- if (!trigger)
135
- return;
136
- if (['PICKER-VIEW'].includes(trigger.tagName))
137
- return;
138
- if (relatedTarget instanceof HTMLElement && trigger.contains(relatedTarget))
139
- return;
140
- const anchorName = trigger.style.anchorName;
141
- if (!anchorName.startsWith('--help-'))
142
- return;
143
- // for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
144
- // for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
145
- // return
146
- // }
147
- const tooltip = document.querySelector(`[style*="${CSS.escape(anchorName)}"]:not([help])`);
148
- if (!tooltip)
149
- return;
150
- // for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
151
- // for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
152
- // return
153
- // }
154
- // trigger.style.removeProperty('anchor-name')
155
- tooltip.hidePopover(); // tooltip.remove?.()
156
- };
157
- const mediaQueryList = self.matchMedia(`(pointer: fine)`);
158
- mediaQueryList.addEventListener('change', ({ matches }) => {
159
- for (const [k, v] of [
160
- ['pointerover', handleHelp],
161
- ['pointerout', handleDone],
162
- ])
163
- document.removeEventListener(k, v);
164
- if (matches)
165
- for (const [k, v] of [
166
- ['pointerover', handleHelp],
167
- ['pointerout', handleDone],
168
- ])
169
- document.addEventListener(k, v, { passive: true });
170
- });
171
- if (mediaQueryList.matches)
172
- for (const [k, v] of [
173
- ['pointerover', handleHelp],
174
- ['pointerout', handleDone],
175
- ])
176
- document.addEventListener(k, v, { passive: true });
177
- //#region fns
178
- // const a = alert('Saving…', 'Please wait')
179
- // // later, e.g. save completed early
180
- // a.dismiss() // silently resolves undefined, closes+removes dialog
181
- // // or
182
- // a.dismiss(new Error('cancelled')) // rejects instead
183
- // const result = await a // still works normally if not dismissed
184
- // const ac = new AbortController()
185
- // const a = alert('Uploading…', 'Please wait', undefined, { signal: ac.signal })
186
- // // elsewhere, e.g. upload finished before the user dismissed
187
- // ac.abort() // dialog closes silently, a rejects with AbortError
188
- // // or still works standalone
189
- // a.dismiss() // same effect, no signal needed
190
- /**
191
- * Presents an alert with a message using the given data to produce the alert’s content and a string variable as a title.
192
- */
193
- export const alert = (title, message, actions, options) => {
194
- const { promise, resolve, reject } = Promise.withResolvers();
195
- let dialog;
196
- let off;
197
- const dismiss = (reason) => {
198
- off?.();
199
- dialog?.close();
200
- // dialog?.remove()
201
- reason === undefined ? resolve(undefined) : reject(reason instanceof Error ? reason : new DOMException('Alert dismissed', 'AbortError'));
202
- };
203
- if (options?.signal)
204
- if (options.signal.aborted)
205
- dismiss(options.signal.reason); // already aborted before we even started — settle immediately, skip showing anything
206
- else
207
- options.signal.addEventListener('abort', () => dismiss(options.signal.reason), { once: true });
208
- navigator.locks
209
- .request('alert:', async () => {
210
- if (options?.signal?.aborted)
211
- return; // in case it was aborted while queued behind another lock holder
212
- const mount = document.createElement('div');
213
- render(html `<dialog is="alert-dialog">
214
- <v-stack spacing="1" alignment="fill">
215
- ${title ? html `<label-view font="headline" title="${title}"></label-view>` : null}
216
- ${message ? html `<label-view foreground="secondary" font="callout" title="${message}"></label-view>` : null}
217
- </v-stack>
218
- ${(actions ?? [{ role: 'close' }]).map((action, index) => html `
219
- <button type="button" tabindex="0" is="bordered-button" value="${index}" role="${action.role ?? null}">
220
- ${action.label || action.image ? html `<label-view title="${action.label ?? null}" system-image="${action.image ?? null}"></label-view>` : null}
221
- </button>
222
- `)}
223
- </dialog>`, mount);
224
- dialog = mount.firstElementChild;
225
- document.body.insertAdjacentElement('beforeend', dialog);
226
- dialog.showModal();
227
- off = onoff('alert:return', (evt) => {
228
- const { detail } = evt;
229
- off?.();
230
- resolve(detail.returnValue);
231
- }, alertDialog, { once: true }).on();
232
- return promise;
233
- })
234
- .catch(() => { });
235
- return Object.assign(promise, { dismiss });
236
- };
237
- export const confirmationDialog = async (trigger, title, message, actions, options) => {
238
- const newAnchorName = `--confirmation-dialog-${self.crypto.randomUUID()}`;
239
- const dialog = $(html `<dialog is="confirmation-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(html `<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
240
- trigger.style.setProperty('anchor-name', newAnchorName, 'important'); //$.prop('anchor-name', newAnchorName, trigger, 'important')
241
- dialog.style.setProperty('position-anchor', newAnchorName); //$.prop('position-anchor', newAnchorName, dialog)
242
- if (title && false !== options?.titleVisibility) {
243
- const label = $(html `<label-view font="headline"></label-view>`, '>1');
244
- label.setAttribute('title', title);
245
- vStack.insertAdjacentElement('beforeend', label);
246
- }
247
- if (message && false !== options?.titleVisibility) {
248
- const label = $(html `<label-view foreground="secondary" font="callout"></label-view>`, '>1');
249
- label.setAttribute('title', message);
250
- vStack.insertAdjacentElement('beforeend', label);
251
- }
252
- for (const [index, action] of (actions ?? []).entries()) {
253
- const btn = $(html `<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
254
- btn.setAttribute('value', `${index}`);
255
- if (action?.role)
256
- btn.setAttribute('role', action.role);
257
- if (action.label || action.image) {
258
- const label = $(html `<label-view></label-view>`, '>1');
259
- if (action.label)
260
- label.setAttribute('title', action.label);
261
- if (action.image)
262
- label.setAttribute('system-image', action.image);
263
- btn.appendChild(label);
264
- }
265
- dialog.insertAdjacentElement('beforeend', btn);
266
- }
267
- trigger.closest('body-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
268
- const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
269
- const { detail } = evt;
270
- off();
271
- resolve(detail.returnValue);
272
- }, confirmationDialogBus, { once: true }).on();
273
- return promise;
274
- };
275
- //#endregion
276
- void Snapshot.waitReady;
277
- //#region exports
278
- export { I18n, lifecycleObserver, NavigationPath, queryInsertPosition, Snapshot, startViewTransition };
279
- //#endregion
@@ -1,11 +0,0 @@
1
- import { DialogBase } from '../namespace-browser/base';
2
- /**
3
- * @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
4
- */
5
- export declare class AlertDialog extends DialogBase {
6
- #private;
7
- constructor();
8
- static polyfillDisconnectedCallback(el: AlertDialog): void;
9
- static polyfillConnectedCallback(el: AlertDialog): void;
10
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
11
- }
@@ -1,102 +0,0 @@
1
- import { alertDialog } from '../buses';
2
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { devFlags, onoff, touchGlass } from '../internal/utils';
4
- import { DialogBase } from '../namespace-browser/base';
5
- /**
6
- * @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
7
- */
8
- export class AlertDialog extends DialogBase {
9
- constructor() {
10
- super();
11
- }
12
- static polyfillDisconnectedCallback(el) {
13
- if (devFlags.debug)
14
- console.debug(`${AlertDialog.name} ⚡️ disconnect`);
15
- CleanupRegistry.unregister(el);
16
- alertDialog.dispatchEvent(new CustomEvent('alert:return', {
17
- detail: { returnValue: el.returnValue },
18
- bubbles: true,
19
- composed: true,
20
- }));
21
- }
22
- static polyfillConnectedCallback(el) {
23
- if (devFlags.debug)
24
- console.debug(`${AlertDialog.name} ⚡️ connect`);
25
- CleanupRegistry.register(el, onoff([
26
- { types: 'click', listener: this.#handleDialogClick },
27
- { types: 'close', listener: this.#handleDialogClose },
28
- { types: 'cancel', listener: this.#handleDialogCancel },
29
- ], el).on());
30
- CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
31
- if (!(target instanceof HTMLElement))
32
- return true;
33
- if (target.matches('[is=alert-dialog]'))
34
- return false;
35
- return true;
36
- }), el).on());
37
- if (devFlags.debug)
38
- console.debug(`${AlertDialog.name} ⚡️ will-open`);
39
- el.removeAttribute('closing');
40
- el.scrollTop = 0;
41
- el.returnValue = '';
42
- el.autofocus = true;
43
- el.showModal();
44
- }
45
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
46
- if (devFlags.debug)
47
- console.debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
48
- switch (attributeName) {
49
- case 'label':
50
- //
51
- break;
52
- }
53
- }
54
- static #handleDialogClick = (evt) => {
55
- if (devFlags.debug)
56
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
57
- const { target, currentTarget: dialog } = evt;
58
- if (!(dialog instanceof HTMLDialogElement))
59
- return;
60
- if (!(target instanceof HTMLElement))
61
- return;
62
- const button = target.closest('button');
63
- if (!button)
64
- return;
65
- button.scrollIntoView({
66
- behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
67
- block: 'nearest',
68
- inline: 'nearest',
69
- });
70
- dialog.returnValue = button.value;
71
- dialog.requestClose(button.value);
72
- evt.stopPropagation();
73
- evt.stopImmediatePropagation();
74
- };
75
- static #handleDialogCancel = (evt) => {
76
- if (devFlags.debug)
77
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
78
- if (!evt.cancelable)
79
- return;
80
- const { target } = evt;
81
- if (!(target instanceof HTMLDialogElement))
82
- return;
83
- evt.preventDefault();
84
- target.inert = true;
85
- if (devFlags.debug)
86
- console.debug(`${AlertDialog.name} ⚡️ will-close`);
87
- target.setAttribute('closing', '');
88
- Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
89
- if (!target.hasAttribute('closing'))
90
- return;
91
- target?.close(target?.returnValue);
92
- target.removeAttribute('closing');
93
- });
94
- };
95
- static #handleDialogClose = ({ type, target }) => {
96
- if (devFlags.debug)
97
- console.debug(`${AlertDialog.name} ⚡️ ${type}`);
98
- if (!(target instanceof HTMLDialogElement))
99
- return;
100
- target.remove();
101
- };
102
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
3
- */
4
- export declare class BodyView extends HTMLElement {
5
- constructor();
6
- disconnectedCallback(): void;
7
- connectedCallback(): void;
8
- }
9
- declare global {
10
- interface HTMLElementTagNameMap {
11
- 'body-view': BodyView;
12
- }
13
- }
@@ -1,17 +0,0 @@
1
- import { devFlags } from '../internal/utils';
2
- /**
3
- * @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
4
- */
5
- export class BodyView extends HTMLElement {
6
- constructor() {
7
- super();
8
- }
9
- disconnectedCallback() {
10
- if (devFlags.debug)
11
- console.debug(`${BodyView.name} ⚡️ disconnect`);
12
- }
13
- connectedCallback() {
14
- if (devFlags.debug)
15
- console.debug(`${BodyView.name} ⚡️ connect`);
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- import { ButtonBase } from '../namespace-browser/base';
2
- /**
3
- * @summary A control that starts an action. Styled with a standard border, adapting to the button’s surroundings.
4
- *
5
- * @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a bordered button
6
- *
7
- * @slot overlay
8
- *
9
- */
10
- export declare class BorderedButton extends ButtonBase {
11
- #private;
12
- static get observedAttributes(): string[];
13
- constructor();
14
- static polyfillDisconnectedCallback(el: BorderedButton): void;
15
- static polyfillConnectedCallback(el: BorderedButton): void;
16
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
17
- }
@@ -1,56 +0,0 @@
1
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
- import { ButtonBase } from '../namespace-browser/base';
4
- import { Snapshot } from '../snapshot';
5
- /**
6
- * @summary A control that starts an action. Styled with a standard border, adapting to the button’s surroundings.
7
- *
8
- * @example <button is="bordered-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a bordered button
9
- *
10
- * @slot overlay
11
- *
12
- */
13
- export class BorderedButton extends ButtonBase {
14
- static get observedAttributes() {
15
- return [
16
- /**
17
- * A value that describes the purpose of a button
18
- * @type {destructive|confirm}
19
- */
20
- 'role',
21
- 'title-key',
22
- ];
23
- }
24
- constructor() {
25
- super();
26
- }
27
- static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedButton.name} ⚡️ disconnect`);
30
- CleanupRegistry.unregister(el);
31
- }
32
- static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedButton.name} ⚡️ connect`);
35
- el.tabIndex = 0;
36
- CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
37
- }
38
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
- const node = target instanceof HTMLButtonElement;
42
- if (!node)
43
- return;
44
- switch (attributeName) {
45
- case 'title-key':
46
- case 'role':
47
- Snapshot.waitReady.then(() => {
48
- ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
49
- });
50
- break;
51
- }
52
- }
53
- static #handleClick = async (evt) => {
54
- //
55
- };
56
- }
@@ -1,17 +0,0 @@
1
- import { ButtonBase } from '../namespace-browser/base';
2
- /**
3
- * @summary A control that starts an action. Styled with a prominent border, adapting to the button’s surroundings.
4
- *
5
- * @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent bordered button
6
- *
7
- * @slot overlay
8
- *
9
- */
10
- export declare class BorderedProminentButton extends ButtonBase {
11
- #private;
12
- static get observedAttributes(): string[];
13
- constructor();
14
- static polyfillDisconnectedCallback(el: BorderedProminentButton): void;
15
- static polyfillConnectedCallback(el: BorderedProminentButton): void;
16
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
17
- }
@@ -1,56 +0,0 @@
1
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
- import { ButtonBase } from '../namespace-browser/base';
4
- import { Snapshot } from '../snapshot';
5
- /**
6
- * @summary A control that starts an action. Styled with a prominent border, adapting to the button’s surroundings.
7
- *
8
- * @example <button is="bordered-prominent-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Creating a prominent bordered button
9
- *
10
- * @slot overlay
11
- *
12
- */
13
- export class BorderedProminentButton extends ButtonBase {
14
- static get observedAttributes() {
15
- return [
16
- /**
17
- * A value that describes the purpose of a button
18
- * @type {destructive|confirm}
19
- */
20
- 'role',
21
- 'title-key',
22
- ];
23
- }
24
- constructor() {
25
- super();
26
- }
27
- static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
30
- CleanupRegistry.unregister(el);
31
- }
32
- static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
35
- el.tabIndex = 0;
36
- CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
37
- }
38
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
- const node = target instanceof HTMLButtonElement;
42
- if (!node)
43
- return;
44
- switch (attributeName) {
45
- case 'title-key':
46
- case 'role':
47
- Snapshot.waitReady.then(() => {
48
- ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
49
- });
50
- break;
51
- }
52
- }
53
- static #handleClick = async (evt) => {
54
- //
55
- };
56
- }
@@ -1,17 +0,0 @@
1
- import { ButtonBase } from '../namespace-browser/base';
2
- /**
3
- * @summary A control that starts an action. Styled without any borders.
4
- *
5
- * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
6
- *
7
- * @slot overlay
8
- *
9
- */
10
- export declare class BorderlessButton extends ButtonBase {
11
- #private;
12
- static get observedAttributes(): string[];
13
- constructor();
14
- static polyfillDisconnectedCallback(el: BorderlessButton): void;
15
- static polyfillConnectedCallback(el: BorderlessButton): void;
16
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
17
- }
@@ -1,56 +0,0 @@
1
- import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
- import { ButtonBase } from '../namespace-browser/base';
4
- import { Snapshot } from '../snapshot';
5
- /**
6
- * @summary A control that starts an action. Styled without any borders.
7
- *
8
- * @example <button is="borderless-button"><label-view system-image="hand-tap" title="Tap Me"></label-view></button> — Use the `is` attribute to style a `button` as a `borderless-button`
9
- *
10
- * @slot overlay
11
- *
12
- */
13
- export class BorderlessButton extends ButtonBase {
14
- static get observedAttributes() {
15
- return [
16
- /**
17
- * A value that describes the purpose of a button
18
- * @type {destructive|confirm}
19
- */
20
- 'role',
21
- 'title-key',
22
- ];
23
- }
24
- constructor() {
25
- super();
26
- }
27
- static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
30
- CleanupRegistry.unregister(el);
31
- }
32
- static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderlessButton.name} ⚡️ connect`);
35
- el.tabIndex = 0;
36
- CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
37
- }
38
- static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
- const node = target instanceof HTMLButtonElement;
42
- if (!node)
43
- return;
44
- switch (attributeName) {
45
- case 'title-key':
46
- case 'role':
47
- Snapshot.waitReady.then(() => {
48
- ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'), Snapshot.config);
49
- });
50
- break;
51
- }
52
- }
53
- static #handleClick = async (evt) => {
54
- // alert(99)
55
- };
56
- }
@@ -1,12 +0,0 @@
1
- export declare class ColorScheme extends HTMLElement {
2
- static get observedAttributes(): string[];
3
- constructor();
4
- connectedCallback(): void;
5
- disconnectedCallback(): void;
6
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
7
- }
8
- declare global {
9
- interface HTMLElementTagNameMap {
10
- 'color-scheme': ColorScheme;
11
- }
12
- }