@oslokommune/punkt-elements 16.7.1 → 16.7.4

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 (286) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/accordion-BB1JrONI.cjs +34 -0
  3. package/dist/accordion-nNH87Y60.js +130 -0
  4. package/dist/alert-BEEnTiCb.cjs +33 -0
  5. package/dist/alert-ePJuDtmm.js +171 -0
  6. package/dist/async-directive-B9P1Qa0k.cjs +1 -0
  7. package/dist/async-directive-CaQiqjyV.js +55 -0
  8. package/dist/backlink-Ba03LlbB.cjs +13 -0
  9. package/dist/backlink-CiwXrQYD.js +38 -0
  10. package/dist/booleanish-BmcOU-43.js +11 -0
  11. package/dist/booleanish-jJLlnr6-.cjs +1 -0
  12. package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
  13. package/dist/breadcrumbs-CpuVqWhF.js +76 -0
  14. package/dist/button-BIpd1xJh.js +95 -0
  15. package/dist/button-D-TOBaJB.cjs +27 -0
  16. package/dist/calendar-BzEtOJla.js +2031 -0
  17. package/dist/calendar-E5jJLt8D.cjs +90 -0
  18. package/dist/card-BYJu1MYm.js +339 -0
  19. package/dist/card-CUFhMVim.cjs +87 -0
  20. package/dist/checkbox-BARDb9iV.cjs +31 -0
  21. package/dist/checkbox-Cspxcvt_.js +111 -0
  22. package/dist/class-map-C8HuhNzZ.js +27 -0
  23. package/dist/class-map-CJ-msbHs.cjs +1 -0
  24. package/dist/classutils-DEL164Ur.js +7 -0
  25. package/dist/classutils-z8YsPlOf.cjs +1 -0
  26. package/dist/combobox-BcdLZRDU.js +984 -0
  27. package/dist/combobox-CGbFTWq_.cjs +135 -0
  28. package/dist/consent-DeB_5sWH.js +197 -0
  29. package/dist/consent-hwu7pp3S.cjs +11 -0
  30. package/dist/datepicker-DpmlsnH_.cjs +273 -0
  31. package/dist/datepicker-OVd8pmnZ.js +1125 -0
  32. package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
  33. package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
  34. package/dist/directive-3THFsVew.js +28 -0
  35. package/dist/directive-CJ2giQBZ.cjs +1 -0
  36. package/dist/directive-helpers-D1QSxY17.cjs +1 -0
  37. package/dist/directive-helpers-Dkv2gKgs.js +25 -0
  38. package/dist/element-DjtxO-1r.cjs +2 -0
  39. package/dist/element-cZ85T_aa.js +693 -0
  40. package/dist/element-with-slot-4J2o3SeU.js +166 -0
  41. package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
  42. package/dist/header-DWgPgGfS.cjs +304 -0
  43. package/dist/header-a6ztVNp3.js +782 -0
  44. package/dist/heading-BgSWIRii.cjs +1 -0
  45. package/dist/heading-DiQLPxdf.js +73 -0
  46. package/dist/helptext-CCBKKLus.js +65 -0
  47. package/dist/helptext-D-3QfZv5.cjs +24 -0
  48. package/dist/icon-Co72KtgF.js +86 -0
  49. package/dist/icon-Dr8sfT2X.cjs +1 -0
  50. package/dist/if-defined-Cjj8qN-Z.js +5 -0
  51. package/dist/if-defined-XKOD_t_V.cjs +1 -0
  52. package/dist/index.d.ts +1 -2
  53. package/dist/input-element-B1yxcfz4.cjs +1 -0
  54. package/dist/input-element-Bw1s6NlF.js +643 -0
  55. package/dist/input-wrapper-BRuVELpK.cjs +54 -0
  56. package/dist/input-wrapper-CDyHTR1V.js +164 -0
  57. package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
  58. package/dist/input-wrapper-YfTmpSSY.js +117 -0
  59. package/dist/link-CKAFMz9j.js +89 -0
  60. package/dist/link-CyTCpI0k.cjs +7 -0
  61. package/dist/linkcard-B0KOGaGj.js +55 -0
  62. package/dist/linkcard-BE4-FewK.cjs +13 -0
  63. package/dist/listbox-DCA2JoPV.cjs +106 -0
  64. package/dist/listbox-DuBgTFvH.js +397 -0
  65. package/dist/loader-6kFZUErT.js +66 -0
  66. package/dist/loader-CX2rsC01.cjs +16 -0
  67. package/dist/messagebox-Cwlg5sOr.js +110 -0
  68. package/dist/messagebox-Din9X53b.cjs +13 -0
  69. package/dist/modal-C_wtsh9m.js +209 -0
  70. package/dist/modal-DS_wUOIv.cjs +36 -0
  71. package/dist/pkt-accordion.cjs +1 -1
  72. package/dist/pkt-accordion.js +2 -7
  73. package/dist/pkt-alert.cjs +1 -1
  74. package/dist/pkt-alert.js +2 -6
  75. package/dist/pkt-backlink.cjs +1 -1
  76. package/dist/pkt-backlink.js +2 -6
  77. package/dist/pkt-breadcrumbs.cjs +1 -43
  78. package/dist/pkt-breadcrumbs.js +2 -79
  79. package/dist/pkt-button.cjs +1 -1
  80. package/dist/pkt-button.js +2 -6
  81. package/dist/pkt-calendar.cjs +1 -1
  82. package/dist/pkt-calendar.js +2 -6
  83. package/dist/pkt-card.cjs +1 -1
  84. package/dist/pkt-card.js +2 -6
  85. package/dist/pkt-checkbox.cjs +1 -1
  86. package/dist/pkt-checkbox.js +2 -6
  87. package/dist/pkt-combobox.cjs +1 -1
  88. package/dist/pkt-combobox.js +2 -6
  89. package/dist/pkt-consent.cjs +1 -1
  90. package/dist/pkt-consent.js +2 -6
  91. package/dist/pkt-datepicker.cjs +1 -1
  92. package/dist/pkt-datepicker.js +5 -10
  93. package/dist/pkt-header.cjs +1 -304
  94. package/dist/pkt-header.js +2 -855
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +2 -6
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +2 -6
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +2 -6
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +30 -66
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +2 -6
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +2 -6
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +2 -6
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +2 -6
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +2 -6
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +2 -6
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +2 -6
  117. package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
  118. package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +2 -6
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +2 -6
  123. package/dist/pkt-select.cjs +1 -1
  124. package/dist/pkt-select.js +2 -6
  125. package/dist/pkt-tabs.cjs +1 -1
  126. package/dist/pkt-tabs.js +2 -7
  127. package/dist/pkt-tag.cjs +1 -1
  128. package/dist/pkt-tag.js +2 -6
  129. package/dist/pkt-textarea.cjs +1 -1
  130. package/dist/pkt-textarea.js +2 -6
  131. package/dist/pkt-textinput.cjs +1 -1
  132. package/dist/pkt-textinput.js +2 -6
  133. package/dist/pkt-timepicker.cjs +1 -191
  134. package/dist/pkt-timepicker.js +2 -558
  135. package/dist/progressbar-CdXtmOBb.cjs +17 -0
  136. package/dist/progressbar-Dy9AiYQz.js +113 -0
  137. package/dist/radiobutton-GOnpUbCW.cjs +31 -0
  138. package/dist/radiobutton-V_KPbup_.js +84 -0
  139. package/dist/ref-BaJ0mBT_.cjs +1 -0
  140. package/dist/ref-RS8Uv6uC.js +30 -0
  141. package/dist/repeat-Cepr3469.js +57 -0
  142. package/dist/repeat-CqcDYBxr.cjs +1 -0
  143. package/dist/select-BSAFd8Wa.js +164 -0
  144. package/dist/select-C2i8sOk5.cjs +49 -0
  145. package/dist/tabs-D8nL9rWx.cjs +37 -0
  146. package/dist/tabs-Y7utmJi9.js +318 -0
  147. package/dist/tag-DLthw5b4.cjs +27 -0
  148. package/dist/tag-VwykmuQR.js +179 -0
  149. package/dist/textarea-D7aGOyDf.cjs +46 -0
  150. package/dist/textarea-DYOBhJrN.js +115 -0
  151. package/dist/textinput-BUgntXnM.js +124 -0
  152. package/dist/textinput-DFh8_9cx.cjs +70 -0
  153. package/dist/timepicker-BIfE7KKJ.cjs +191 -0
  154. package/dist/timepicker-DaSwn1FA.js +503 -0
  155. package/dist/utils-CUqCKGvp.js +7 -0
  156. package/dist/utils-CjAbIttF.cjs +1 -0
  157. package/package.json +6 -6
  158. package/src/components/accordion/accordion.ts +6 -1
  159. package/src/components/accordion/accordionitem.ts +6 -1
  160. package/src/components/alert/alert.test.ts +1 -1
  161. package/src/components/alert/alert.ts +12 -7
  162. package/src/components/backlink/backlink.ts +6 -1
  163. package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
  164. package/src/components/button/button.ts +6 -1
  165. package/src/components/calendar/calendar.ts +6 -1
  166. package/src/components/card/card.ts +6 -1
  167. package/src/components/checkbox/checkbox.ts +6 -1
  168. package/src/components/combobox/combobox.ts +6 -1
  169. package/src/components/consent/consent.ts +6 -1
  170. package/src/components/datepicker/date-tags.ts +6 -1
  171. package/src/components/datepicker/datepicker-multiple.ts +6 -1
  172. package/src/components/datepicker/datepicker-popup.ts +6 -1
  173. package/src/components/datepicker/datepicker-range.ts +6 -1
  174. package/src/components/datepicker/datepicker-single.ts +6 -1
  175. package/src/components/datepicker/datepicker-utils.test.ts +16 -23
  176. package/src/components/datepicker/datepicker.ts +6 -1
  177. package/src/components/header/header-service.ts +6 -1
  178. package/src/components/header/header-user-menu.ts +6 -1
  179. package/src/components/header/header.ts +6 -1
  180. package/src/components/heading/heading.ts +6 -1
  181. package/src/components/helptext/helptext.ts +6 -1
  182. package/src/components/icon/icon.ts +6 -1
  183. package/src/components/input-wrapper/input-wrapper.ts +6 -1
  184. package/src/components/link/link.ts +6 -1
  185. package/src/components/linkcard/linkcard.ts +6 -1
  186. package/src/components/listbox/listbox.ts +6 -1
  187. package/src/components/loader/loader.ts +6 -1
  188. package/src/components/messagebox/messagebox.ts +6 -1
  189. package/src/components/modal/modal.ts +6 -1
  190. package/src/components/progressbar/progressbar.ts +6 -1
  191. package/src/components/radiobutton/radiobutton.ts +6 -1
  192. package/src/components/select/select.ts +6 -1
  193. package/src/components/tabs/tabitem.ts +6 -1
  194. package/src/components/tabs/tabs.ts +6 -1
  195. package/src/components/tag/tag.ts +6 -1
  196. package/src/components/textarea/textarea.ts +6 -1
  197. package/src/components/textinput/textinput.ts +6 -1
  198. package/src/components/timepicker/timepicker.ts +6 -1
  199. package/dist/accordionitem-D1Agl1bB.cjs +0 -34
  200. package/dist/accordionitem-ZlaXvjt5.js +0 -138
  201. package/dist/alert-BuAXrnKl.js +0 -115
  202. package/dist/alert-DFkFNTxh.cjs +0 -33
  203. package/dist/async-directive-CMzWMlZ5.js +0 -65
  204. package/dist/async-directive-DoMuclel.cjs +0 -5
  205. package/dist/backlink-EiAXUUZP.cjs +0 -13
  206. package/dist/backlink-V4DAt17e.js +0 -47
  207. package/dist/booleanish-BKVonob4.cjs +0 -1
  208. package/dist/booleanish-C9R0tdXH.js +0 -11
  209. package/dist/button-DEyvt1LI.js +0 -137
  210. package/dist/button-DYv5Dg4M.cjs +0 -27
  211. package/dist/calendar-HIE9nxcc.cjs +0 -90
  212. package/dist/calendar-S63oreVW.js +0 -2138
  213. package/dist/card-CyeH6l1c.cjs +0 -87
  214. package/dist/card-DDiLfuO4.js +0 -231
  215. package/dist/checkbox-BLlwTABj.cjs +0 -31
  216. package/dist/checkbox-ejBUa5qQ.js +0 -145
  217. package/dist/class-map-CEnykyO_.js +0 -34
  218. package/dist/class-map-CsENJXf1.cjs +0 -5
  219. package/dist/classutils-BwNK82ZQ.cjs +0 -1
  220. package/dist/classutils-RQs1k6D9.js +0 -7
  221. package/dist/combobox-BmxSecfE.js +0 -818
  222. package/dist/combobox-Hb2V-fPX.cjs +0 -135
  223. package/dist/consent-iXyx5v6J.js +0 -173
  224. package/dist/consent-ruWAEVXW.cjs +0 -11
  225. package/dist/datepicker-CZl7b8Na.js +0 -1158
  226. package/dist/datepicker-D2H7U6MS.cjs +0 -273
  227. package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
  228. package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
  229. package/dist/directive-C7oCP5Bh.cjs +0 -5
  230. package/dist/directive-helpers-BP2WOx60.cjs +0 -5
  231. package/dist/directive-helpers-rm-28gIj.js +0 -38
  232. package/dist/directive-oAbCiebi.js +0 -27
  233. package/dist/element-CPpT3rFQ.js +0 -638
  234. package/dist/element-gR_VtSiD.cjs +0 -27
  235. package/dist/element-with-slot-Dqk6-TRR.js +0 -240
  236. package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
  237. package/dist/heading-CKt7cVn7.js +0 -101
  238. package/dist/heading-Cvz8m1xL.cjs +0 -1
  239. package/dist/helptext-5Mzp65-F.cjs +0 -24
  240. package/dist/helptext-jIoWRcCF.js +0 -80
  241. package/dist/icon-BlKA8YuW.js +0 -103
  242. package/dist/icon-Bqj9oBbl.cjs +0 -9
  243. package/dist/if-defined-B0krMLad.js +0 -10
  244. package/dist/if-defined-BOW3ODSj.cjs +0 -5
  245. package/dist/input-element-8nLwuQS4.js +0 -837
  246. package/dist/input-element-DdVhUvva.cjs +0 -1
  247. package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
  248. package/dist/input-wrapper-B2JpK016.js +0 -179
  249. package/dist/input-wrapper-CDgenrYA.js +0 -6
  250. package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
  251. package/dist/link-R_lNhViF.cjs +0 -7
  252. package/dist/link-Z_GizclR.js +0 -53
  253. package/dist/linkcard-BlQvdB1a.js +0 -54
  254. package/dist/linkcard-C7HbSLlX.cjs +0 -13
  255. package/dist/listbox-BQKDZvZn.js +0 -438
  256. package/dist/listbox-CGgV9MAe.cjs +0 -106
  257. package/dist/loader-Ci3CHU8k.js +0 -93
  258. package/dist/loader-e2gs_1xz.cjs +0 -16
  259. package/dist/messagebox-Bf-XMlvW.js +0 -69
  260. package/dist/messagebox-D67w71VX.cjs +0 -13
  261. package/dist/modal-CyvEkbfQ.cjs +0 -36
  262. package/dist/modal-DzGe1g8Z.js +0 -154
  263. package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
  264. package/dist/pkt-options-controller-B5YalfCb.js +0 -39
  265. package/dist/progressbar-By7e0lEI.js +0 -162
  266. package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
  267. package/dist/radiobutton-6frNG9J_.js +0 -111
  268. package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
  269. package/dist/ref-Bg_Swj5w.js +0 -42
  270. package/dist/ref-CL-Xk9Xm.cjs +0 -5
  271. package/dist/repeat-BD8TKgJb.js +0 -61
  272. package/dist/repeat-Cfq8CDlf.cjs +0 -5
  273. package/dist/select-CXZt1nHS.js +0 -228
  274. package/dist/select-WFhS4Vfp.cjs +0 -49
  275. package/dist/state-C_1EOo3D.js +0 -12
  276. package/dist/state-Dg-53wQ8.cjs +0 -5
  277. package/dist/tabitem-CB8wkKmv.js +0 -332
  278. package/dist/tabitem-DZpspU4Q.cjs +0 -65
  279. package/dist/tag-BuCpqaks.js +0 -115
  280. package/dist/tag-X6xdjR0N.cjs +0 -27
  281. package/dist/textarea-Bzuymclz.js +0 -131
  282. package/dist/textarea-DoeHJ7HR.cjs +0 -50
  283. package/dist/textinput-9lHjs4ce.js +0 -150
  284. package/dist/textinput-BNsLd26i.cjs +0 -70
  285. package/dist/utils-DznhwRXm.js +0 -8
  286. package/dist/utils-byXsEz1u.cjs +0 -1
@@ -1,395 +0,0 @@
1
- var d = window.CustomEvent;
2
- (!d || typeof d == "object") && (d = function(t, o) {
3
- o = o || {};
4
- var i = document.createEvent("CustomEvent");
5
- return i.initCustomEvent(t, !!o.bubbles, !!o.cancelable, o.detail || null), i;
6
- }, d.prototype = window.Event.prototype);
7
- function g(e, t) {
8
- var o = "on" + t.type.toLowerCase();
9
- return typeof e[o] == "function" && e[o](t), e.dispatchEvent(t);
10
- }
11
- function E(e) {
12
- for (; e && e !== document.body; ) {
13
- var t = window.getComputedStyle(e), o = function(i, a) {
14
- return !(t[i] === void 0 || t[i] === a);
15
- };
16
- if (t.opacity < 1 || o("zIndex", "auto") || o("transform", "none") || o("mixBlendMode", "normal") || o("filter", "none") || o("perspective", "none") || t.isolation === "isolate" || t.position === "fixed" || t.webkitOverflowScrolling === "touch")
17
- return !0;
18
- e = e.parentElement;
19
- }
20
- return !1;
21
- }
22
- function c(e) {
23
- for (; e; ) {
24
- if (e.localName === "dialog")
25
- return (
26
- /** @type {HTMLDialogElement} */
27
- e
28
- );
29
- e.parentElement ? e = e.parentElement : e.parentNode ? e = e.parentNode.host : e = null;
30
- }
31
- return null;
32
- }
33
- function b(e) {
34
- for (; e && e.shadowRoot && e.shadowRoot.activeElement; )
35
- e = e.shadowRoot.activeElement;
36
- e && e.blur && e !== document.body && e.blur();
37
- }
38
- function M(e, t) {
39
- for (var o = 0; o < e.length; ++o)
40
- if (e[o] === t)
41
- return !0;
42
- return !1;
43
- }
44
- function h(e) {
45
- return !e || !e.hasAttribute("method") ? !1 : e.getAttribute("method").toLowerCase() === "dialog";
46
- }
47
- function v(e) {
48
- var t = ["button", "input", "keygen", "select", "textarea"], o = t.map(function(s) {
49
- return s + ":not([disabled])";
50
- });
51
- o.push('[tabindex]:not([disabled]):not([tabindex=""])');
52
- var i = e.querySelector(o.join(", "));
53
- if (!i && "attachShadow" in Element.prototype)
54
- for (var a = e.querySelectorAll("*"), r = 0; r < a.length && !(a[r].tagName && a[r].shadowRoot && (i = v(a[r].shadowRoot), i)); r++)
55
- ;
56
- return i;
57
- }
58
- function m(e) {
59
- return e.isConnected || document.body.contains(e);
60
- }
61
- function y(e) {
62
- if (e.submitter)
63
- return e.submitter;
64
- var t = e.target;
65
- if (!(t instanceof HTMLFormElement))
66
- return null;
67
- var o = n.formSubmitter;
68
- if (!o) {
69
- var i = e.target, a = "getRootNode" in i && i.getRootNode() || document;
70
- o = a.activeElement;
71
- }
72
- return !o || o.form !== t ? null : o;
73
- }
74
- function D(e) {
75
- if (!e.defaultPrevented) {
76
- var t = (
77
- /** @type {!HTMLFormElement} */
78
- e.target
79
- ), o = n.imagemapUseValue, i = y(e);
80
- o === null && i && (o = i.value);
81
- var a = c(t);
82
- if (a) {
83
- var r = i && i.getAttribute("formmethod") || t.getAttribute("method");
84
- r === "dialog" && (e.preventDefault(), o != null ? a.close(o) : a.close());
85
- }
86
- }
87
- }
88
- function _(e) {
89
- if (this.dialog_ = e, this.replacedStyleTop_ = !1, this.openAsModal_ = !1, e.hasAttribute("role") || e.setAttribute("role", "dialog"), e.show = this.show.bind(this), e.showModal = this.showModal.bind(this), e.close = this.close.bind(this), e.addEventListener("submit", D, !1), "returnValue" in e || (e.returnValue = ""), "MutationObserver" in window) {
90
- var t = new MutationObserver(this.maybeHideModal.bind(this));
91
- t.observe(e, { attributes: !0, attributeFilter: ["open"] });
92
- } else {
93
- var o = !1, i = (function() {
94
- o ? this.downgradeModal() : this.maybeHideModal(), o = !1;
95
- }).bind(this), a, r = function(s) {
96
- if (s.target === e) {
97
- var u = "DOMNodeRemoved";
98
- o |= s.type.substr(0, u.length) === u, window.clearTimeout(a), a = window.setTimeout(i, 0);
99
- }
100
- };
101
- ["DOMAttrModified", "DOMNodeRemoved", "DOMNodeRemovedFromDocument"].forEach(function(s) {
102
- e.addEventListener(s, r);
103
- });
104
- }
105
- Object.defineProperty(e, "open", {
106
- set: this.setOpen.bind(this),
107
- get: e.hasAttribute.bind(e, "open")
108
- }), this.backdrop_ = document.createElement("div"), this.backdrop_.className = "backdrop", this.backdrop_.addEventListener("mouseup", this.backdropMouseEvent_.bind(this)), this.backdrop_.addEventListener("mousedown", this.backdropMouseEvent_.bind(this)), this.backdrop_.addEventListener("click", this.backdropMouseEvent_.bind(this));
109
- }
110
- _.prototype = /** @type {HTMLDialogElement.prototype} */
111
- {
112
- get dialog() {
113
- return this.dialog_;
114
- },
115
- /**
116
- * Maybe remove this dialog from the modal top layer. This is called when
117
- * a modal dialog may no longer be tenable, e.g., when the dialog is no
118
- * longer open or is no longer part of the DOM.
119
- */
120
- maybeHideModal: function() {
121
- this.dialog_.hasAttribute("open") && m(this.dialog_) || this.downgradeModal();
122
- },
123
- /**
124
- * Remove this dialog from the modal top layer, leaving it as a non-modal.
125
- */
126
- downgradeModal: function() {
127
- this.openAsModal_ && (this.openAsModal_ = !1, this.dialog_.style.zIndex = "", this.replacedStyleTop_ && (this.dialog_.style.top = "", this.replacedStyleTop_ = !1), this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_), n.dm.removeDialog(this));
128
- },
129
- /**
130
- * @param {boolean} value whether to open or close this dialog
131
- */
132
- setOpen: function(e) {
133
- e ? this.dialog_.hasAttribute("open") || this.dialog_.setAttribute("open", "") : (this.dialog_.removeAttribute("open"), this.maybeHideModal());
134
- },
135
- /**
136
- * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
137
- * they were on the dialog itself.
138
- *
139
- * @param {!Event} e to redirect
140
- */
141
- backdropMouseEvent_: function(e) {
142
- if (this.dialog_.hasAttribute("tabindex"))
143
- this.dialog_.focus();
144
- else {
145
- var t = document.createElement("div");
146
- this.dialog_.insertBefore(t, this.dialog_.firstChild), t.tabIndex = -1, t.focus(), this.dialog_.removeChild(t);
147
- }
148
- var o = document.createEvent("MouseEvents");
149
- o.initMouseEvent(
150
- e.type,
151
- e.bubbles,
152
- e.cancelable,
153
- window,
154
- e.detail,
155
- e.screenX,
156
- e.screenY,
157
- e.clientX,
158
- e.clientY,
159
- e.ctrlKey,
160
- e.altKey,
161
- e.shiftKey,
162
- e.metaKey,
163
- e.button,
164
- e.relatedTarget
165
- ), this.dialog_.dispatchEvent(o), e.stopPropagation();
166
- },
167
- /**
168
- * Focuses on the first focusable element within the dialog. This will always blur the current
169
- * focus, even if nothing within the dialog is found.
170
- */
171
- focus_: function() {
172
- var e = this.dialog_.querySelector("[autofocus]:not([disabled])");
173
- !e && this.dialog_.tabIndex >= 0 && (e = this.dialog_), e || (e = v(this.dialog_)), b(document.activeElement), e && e.focus();
174
- },
175
- /**
176
- * Sets the zIndex for the backdrop and dialog.
177
- *
178
- * @param {number} dialogZ
179
- * @param {number} backdropZ
180
- */
181
- updateZIndex: function(e, t) {
182
- if (e < t)
183
- throw new Error("dialogZ should never be < backdropZ");
184
- this.dialog_.style.zIndex = e, this.backdrop_.style.zIndex = t;
185
- },
186
- /**
187
- * Shows the dialog. If the dialog is already open, this does nothing.
188
- */
189
- show: function() {
190
- this.dialog_.open || (this.setOpen(!0), this.focus_());
191
- },
192
- /**
193
- * Show this dialog modally.
194
- */
195
- showModal: function() {
196
- if (this.dialog_.hasAttribute("open"))
197
- throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");
198
- if (!m(this.dialog_))
199
- throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");
200
- if (!n.dm.pushDialog(this))
201
- throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");
202
- E(this.dialog_.parentElement) && console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"), this.setOpen(!0), this.openAsModal_ = !0, n.needsCentering(this.dialog_) ? (n.reposition(this.dialog_), this.replacedStyleTop_ = !0) : this.replacedStyleTop_ = !1, this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling), this.focus_();
203
- },
204
- /**
205
- * Closes this HTMLDialogElement. This is optional vs clearing the open
206
- * attribute, however this fires a 'close' event.
207
- *
208
- * @param {string=} opt_returnValue to use as the returnValue
209
- */
210
- close: function(e) {
211
- if (!this.dialog_.hasAttribute("open"))
212
- throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");
213
- this.setOpen(!1), e !== void 0 && (this.dialog_.returnValue = e);
214
- var t = new d("close", {
215
- bubbles: !1,
216
- cancelable: !1
217
- });
218
- g(this.dialog_, t);
219
- }
220
- };
221
- var n = {};
222
- n.reposition = function(e) {
223
- var t = document.body.scrollTop || document.documentElement.scrollTop, o = t + (window.innerHeight - e.offsetHeight) / 2;
224
- e.style.top = Math.max(t, o) + "px";
225
- };
226
- n.isInlinePositionSetByStylesheet = function(e) {
227
- for (var t = 0; t < document.styleSheets.length; ++t) {
228
- var o = document.styleSheets[t], i = null;
229
- try {
230
- i = o.cssRules;
231
- } catch {
232
- }
233
- if (i)
234
- for (var a = 0; a < i.length; ++a) {
235
- var r = i[a], s = null;
236
- try {
237
- s = document.querySelectorAll(r.selectorText);
238
- } catch {
239
- }
240
- if (!(!s || !M(s, e))) {
241
- var u = r.style.getPropertyValue("top"), f = r.style.getPropertyValue("bottom");
242
- if (u && u !== "auto" || f && f !== "auto")
243
- return !0;
244
- }
245
- }
246
- }
247
- return !1;
248
- };
249
- n.needsCentering = function(e) {
250
- var t = window.getComputedStyle(e);
251
- return t.position !== "absolute" || e.style.top !== "auto" && e.style.top !== "" || e.style.bottom !== "auto" && e.style.bottom !== "" ? !1 : !n.isInlinePositionSetByStylesheet(e);
252
- };
253
- n.forceRegisterDialog = function(e) {
254
- if ((window.HTMLDialogElement || e.showModal) && console.warn("This browser already supports <dialog>, the polyfill may not work correctly", e), e.localName !== "dialog")
255
- throw new Error("Failed to register dialog: The element is not a dialog.");
256
- new _(
257
- /** @type {!HTMLDialogElement} */
258
- e
259
- );
260
- };
261
- n.registerDialog = function(e) {
262
- e.showModal || n.forceRegisterDialog(e);
263
- };
264
- n.DialogManager = function() {
265
- this.pendingDialogStack = [];
266
- var e = this.checkDOM_.bind(this);
267
- this.overlay = document.createElement("div"), this.overlay.className = "_dialog_overlay", this.overlay.addEventListener("click", (function(t) {
268
- this.forwardTab_ = void 0, t.stopPropagation(), e([]);
269
- }).bind(this)), this.handleKey_ = this.handleKey_.bind(this), this.handleFocus_ = this.handleFocus_.bind(this), this.zIndexLow_ = 1e5, this.zIndexHigh_ = 100150, this.forwardTab_ = void 0, "MutationObserver" in window && (this.mo_ = new MutationObserver(function(t) {
270
- var o = [];
271
- t.forEach(function(i) {
272
- for (var a = 0, r; r = i.removedNodes[a]; ++a) {
273
- if (r instanceof Element)
274
- r.localName === "dialog" && o.push(r);
275
- else continue;
276
- o = o.concat(r.querySelectorAll("dialog"));
277
- }
278
- }), o.length && e(o);
279
- }));
280
- };
281
- n.DialogManager.prototype.blockDocument = function() {
282
- document.documentElement.addEventListener("focus", this.handleFocus_, !0), document.addEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.observe(document, { childList: !0, subtree: !0 });
283
- };
284
- n.DialogManager.prototype.unblockDocument = function() {
285
- document.documentElement.removeEventListener("focus", this.handleFocus_, !0), document.removeEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.disconnect();
286
- };
287
- n.DialogManager.prototype.updateStacking = function() {
288
- for (var e = this.zIndexHigh_, t = 0, o; o = this.pendingDialogStack[t]; ++t)
289
- o.updateZIndex(--e, --e), t === 0 && (this.overlay.style.zIndex = --e);
290
- var i = this.pendingDialogStack[0];
291
- if (i) {
292
- var a = i.dialog.parentNode || document.body;
293
- a.appendChild(this.overlay);
294
- } else this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay);
295
- };
296
- n.DialogManager.prototype.containedByTopDialog_ = function(e) {
297
- for (; e = c(e); ) {
298
- for (var t = 0, o; o = this.pendingDialogStack[t]; ++t)
299
- if (o.dialog === e)
300
- return t === 0;
301
- e = e.parentElement;
302
- }
303
- return !1;
304
- };
305
- n.DialogManager.prototype.handleFocus_ = function(e) {
306
- var t = e.composedPath ? e.composedPath()[0] : e.target;
307
- if (!this.containedByTopDialog_(t) && document.activeElement !== document.documentElement && (e.preventDefault(), e.stopPropagation(), b(
308
- /** @type {Element} */
309
- t
310
- ), this.forwardTab_ !== void 0)) {
311
- var o = this.pendingDialogStack[0], i = o.dialog, a = i.compareDocumentPosition(t);
312
- return a & Node.DOCUMENT_POSITION_PRECEDING && (this.forwardTab_ ? o.focus_() : t !== document.documentElement && document.documentElement.focus()), !1;
313
- }
314
- };
315
- n.DialogManager.prototype.handleKey_ = function(e) {
316
- if (this.forwardTab_ = void 0, e.keyCode === 27) {
317
- e.preventDefault(), e.stopPropagation();
318
- var t = new d("cancel", {
319
- bubbles: !1,
320
- cancelable: !0
321
- }), o = this.pendingDialogStack[0];
322
- o && g(o.dialog, t) && o.dialog.close();
323
- } else e.keyCode === 9 && (this.forwardTab_ = !e.shiftKey);
324
- };
325
- n.DialogManager.prototype.checkDOM_ = function(e) {
326
- var t = this.pendingDialogStack.slice();
327
- t.forEach(function(o) {
328
- e.indexOf(o.dialog) !== -1 ? o.downgradeModal() : o.maybeHideModal();
329
- });
330
- };
331
- n.DialogManager.prototype.pushDialog = function(e) {
332
- var t = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;
333
- return this.pendingDialogStack.length >= t ? !1 : (this.pendingDialogStack.unshift(e) === 1 && this.blockDocument(), this.updateStacking(), !0);
334
- };
335
- n.DialogManager.prototype.removeDialog = function(e) {
336
- var t = this.pendingDialogStack.indexOf(e);
337
- t !== -1 && (this.pendingDialogStack.splice(t, 1), this.pendingDialogStack.length === 0 && this.unblockDocument(), this.updateStacking());
338
- };
339
- n.dm = new n.DialogManager();
340
- n.formSubmitter = null;
341
- n.imagemapUseValue = null;
342
- if (window.HTMLDialogElement === void 0) {
343
- var p = document.createElement("form");
344
- if (p.setAttribute("method", "dialog"), p.method !== "dialog") {
345
- var l = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "method");
346
- if (l) {
347
- var k = l.get;
348
- l.get = function() {
349
- return h(this) ? "dialog" : k.call(this);
350
- };
351
- var S = l.set;
352
- l.set = function(e) {
353
- return typeof e == "string" && e.toLowerCase() === "dialog" ? this.setAttribute("method", e) : S.call(this, e);
354
- }, Object.defineProperty(HTMLFormElement.prototype, "method", l);
355
- }
356
- }
357
- document.addEventListener("click", function(e) {
358
- if (n.formSubmitter = null, n.imagemapUseValue = null, !e.defaultPrevented) {
359
- var t = (
360
- /** @type {Element} */
361
- e.target
362
- );
363
- if ("composedPath" in e) {
364
- var o = e.composedPath();
365
- t = o.shift() || t;
366
- }
367
- if (!(!t || !h(t.form))) {
368
- var i = t.type === "submit" && ["button", "input"].indexOf(t.localName) > -1;
369
- if (!i) {
370
- if (!(t.localName === "input" && t.type === "image"))
371
- return;
372
- n.imagemapUseValue = e.offsetX + "," + e.offsetY;
373
- }
374
- var a = c(t);
375
- a && (n.formSubmitter = t);
376
- }
377
- }
378
- }, !1), document.addEventListener("submit", function(e) {
379
- var t = e.target, o = c(t);
380
- if (!o) {
381
- var i = y(e), a = i && i.getAttribute("formmethod") || t.getAttribute("method");
382
- a === "dialog" && e.preventDefault();
383
- }
384
- });
385
- var T = HTMLFormElement.prototype.submit, x = function() {
386
- if (!h(this))
387
- return T.call(this);
388
- var e = c(this);
389
- e && e.close();
390
- };
391
- HTMLFormElement.prototype.submit = x;
392
- }
393
- export {
394
- n as default
395
- };
@@ -1,5 +0,0 @@
1
- "use strict";/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},_=i=>(...t)=>({_$litDirective$:i,values:t});class ${constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}exports.e=_;exports.i=$;exports.t=r;
@@ -1,5 +0,0 @@
1
- "use strict";const l=require("./element-gR_VtSiD.cjs");/**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const{I:v}=l.j,c=t=>t,m=t=>t.strings===void 0,d=()=>document.createComment(""),u=(t,i,n)=>{var s;const $=t._$AA.parentNode,e=i===void 0?t._$AB:i._$AA;if(n===void 0){const r=$.insertBefore(d(),e),_=$.insertBefore(d(),e);n=new v(r,_,t,t.options)}else{const r=n._$AB.nextSibling,_=n._$AM,o=_!==t;if(o){let A;(s=n._$AQ)==null||s.call(n,t),n._$AM=t,n._$AP!==void 0&&(A=t._$AU)!==_._$AU&&n._$AP(A)}if(r!==e||o){let A=n._$AA;for(;A!==r;){const f=c(A).nextSibling;c($).insertBefore(A,e),A=f}}}return n},B=(t,i,n=t)=>(t._$AI(i,n),t),p={},M=(t,i=p)=>t._$AH=i,g=t=>t._$AH,a=t=>{t._$AR(),t._$AA.remove()};exports.M=g;exports.h=a;exports.p=M;exports.r=m;exports.u=B;exports.v=u;
@@ -1,38 +0,0 @@
1
- import { j as m } from "./element-CPpT3rFQ.js";
2
- /**
3
- * @license
4
- * Copyright 2020 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- const { I: l } = m, c = (t) => t, B = (t) => t.strings === void 0, f = () => document.createComment(""), g = (t, i, A) => {
8
- var o;
9
- const e = t._$AA.parentNode, r = i === void 0 ? t._$AB : i._$AA;
10
- if (A === void 0) {
11
- const _ = e.insertBefore(f(), r), $ = e.insertBefore(f(), r);
12
- A = new l(_, $, t, t.options);
13
- } else {
14
- const _ = A._$AB.nextSibling, $ = A._$AM, s = $ !== t;
15
- if (s) {
16
- let n;
17
- (o = A._$AQ) == null || o.call(A, t), A._$AM = t, A._$AP !== void 0 && (n = t._$AU) !== $._$AU && A._$AP(n);
18
- }
19
- if (_ !== r || s) {
20
- let n = A._$AA;
21
- for (; n !== _; ) {
22
- const d = c(n).nextSibling;
23
- c(e).insertBefore(n, r), n = d;
24
- }
25
- }
26
- }
27
- return A;
28
- }, u = (t, i, A = t) => (t._$AI(i, A), t), v = {}, x = (t, i = v) => t._$AH = i, M = (t) => t._$AH, a = (t) => {
29
- t._$AR(), t._$AA.remove();
30
- };
31
- export {
32
- M,
33
- a as h,
34
- x as p,
35
- B as r,
36
- u,
37
- g as v
38
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const s = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4 }, _ = (r) => (...t) => ({ _$litDirective$: r, values: t });
7
- class $ {
8
- constructor(t) {
9
- }
10
- get _$AU() {
11
- return this._$AM._$AU;
12
- }
13
- _$AT(t, e, i) {
14
- this._$Ct = t, this._$AM = e, this._$Ci = i;
15
- }
16
- _$AS(t, e) {
17
- return this.update(t, e);
18
- }
19
- update(t, e) {
20
- return this.render(...e);
21
- }
22
- }
23
- export {
24
- _ as e,
25
- $ as i,
26
- s as t
27
- };