@oslokommune/punkt-elements 19.4.0 → 19.5.1

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 (171) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{accordion-CZ0O4c0_.cjs → accordion-5lSFQToJ.cjs} +6 -6
  3. package/dist/{accordion-DFcdonl-.js → accordion-BJh6X1Ek.js} +6 -6
  4. package/dist/{alert-BhvjSA5X.js → alert-C0PiYnot.js} +29 -36
  5. package/dist/alert-IaZzEgyI.cjs +39 -0
  6. package/dist/{backlink-Bw6IcRIo.cjs → backlink-BRqhwUr2.cjs} +1 -1
  7. package/dist/{backlink-DIdgvE2j.js → backlink-BslFewn-.js} +1 -1
  8. package/dist/{breadcrumbs-BfgCx3Xj.js → breadcrumbs-Cr3GugPv.js} +1 -1
  9. package/dist/{breadcrumbs-C10K1XLP.cjs → breadcrumbs-DG4i5UCh.cjs} +1 -1
  10. package/dist/{button-B5rWxfei.js → button-B78im4wB.js} +16 -16
  11. package/dist/button-BNVTj7nB.cjs +32 -0
  12. package/dist/{calendar-U8xkRdgF.js → calendar-BLaRXUBl.js} +1 -1
  13. package/dist/{calendar-D-Ow5DAp.cjs → calendar-TcxvS-1_.cjs} +1 -1
  14. package/dist/{card-D2YYPZr5.js → card-CYKhPUNI.js} +12 -12
  15. package/dist/{card-DW1uklP6.cjs → card-CaLEuumN.cjs} +10 -10
  16. package/dist/{checkbox-C0zLtnCI.cjs → checkbox-DIyi1Cya.cjs} +1 -1
  17. package/dist/{checkbox-B2O0fkh9.js → checkbox-DKeErDb5.js} +1 -1
  18. package/dist/{combobox-DpXTwNr4.js → combobox-BKnHg_-E.js} +30 -30
  19. package/dist/{combobox-BgduqUpf.cjs → combobox-C7FUvv5T.cjs} +22 -22
  20. package/dist/components/alert/alert.d.ts +0 -2
  21. package/dist/{consent-CbJG04C1.js → consent-CleJMbVH.js} +1 -1
  22. package/dist/{consent-DxpJLExu.cjs → consent-Dl-R0iC3.cjs} +1 -1
  23. package/dist/{datepicker-BLBimRTT.js → datepicker-COFEJpB4.js} +10 -10
  24. package/dist/{datepicker-53rj_Qqx.cjs → datepicker-CeUpoQuG.cjs} +27 -27
  25. package/dist/directives/slot-content.d.ts +36 -1
  26. package/dist/element-with-slot-D7sTqOr3.cjs +1 -0
  27. package/dist/{element-with-slot-FD826ooP.js → element-with-slot-DQv0cbbD.js} +80 -21
  28. package/dist/{fileupload-BxfBFhFt.js → fileupload-CUPl41uN.js} +32 -32
  29. package/dist/{fileupload-4wgr4iAi.cjs → fileupload-CaZGBvZr.cjs} +21 -21
  30. package/dist/{footer-CBkKAuvh.js → footer-DdLls3F-.js} +14 -14
  31. package/dist/{footer-DOp_9VdY.cjs → footer-vy9NqT65.cjs} +9 -9
  32. package/dist/{header-Cs4t2XMM.cjs → header-CgP3-6-b.cjs} +50 -50
  33. package/dist/{header-CF-Re0nT.js → header-Cq6INZmI.js} +56 -56
  34. package/dist/{header-menu-C9k9xG9V.js → header-menu-ANj5nL2M.js} +2 -2
  35. package/dist/{header-menu-BnqZagI6.cjs → header-menu-BfkCp8jw.cjs} +1 -1
  36. package/dist/{heading-BRHCV_5J.js → heading-CUrZvkrM.js} +1 -1
  37. package/dist/{heading-u9Arof4p.cjs → heading-zoz-QZJ9.cjs} +1 -1
  38. package/dist/{helptext-DYgeTMtA.cjs → helptext-BCkwSz1m.cjs} +2 -2
  39. package/dist/{helptext-sRC8EJqL.js → helptext-DCT_9dw1.js} +2 -2
  40. package/dist/icon-Dnv6LtPC.cjs +1 -0
  41. package/dist/{icon-DmRyYNlY.js → icon-JigbxxF7.js} +16 -12
  42. package/dist/{input-element-B1BntJeJ.js → input-element-5hsxasU3.js} +1 -1
  43. package/dist/{input-element-W6Gklt2E.cjs → input-element-Ctkz5fQk.cjs} +1 -1
  44. package/dist/{input-wrapper-CSPPa4uc.cjs → input-wrapper-Cf__-4E-.cjs} +28 -28
  45. package/dist/{input-wrapper-C1zXIKBU.js → input-wrapper-DACDx6Ie.js} +45 -45
  46. package/dist/{link-DcxVUj8s.js → link-CmZwAw5u.js} +2 -2
  47. package/dist/link-LO_5_La8.cjs +7 -0
  48. package/dist/{linkcard-MJFR7FLT.js → linkcard-CQluSyJJ.js} +8 -8
  49. package/dist/{linkcard-CWeR6t2a.cjs → linkcard-UKsxADrP.cjs} +3 -3
  50. package/dist/{listbox-DEzd-dxF.js → listbox-Ct9jIV_5.js} +8 -8
  51. package/dist/{listbox-BoBwzL4p.cjs → listbox-g-vHHLkD.cjs} +20 -20
  52. package/dist/{loader-SJ6NauNT.cjs → loader-C_PH05aw.cjs} +2 -2
  53. package/dist/{loader-CqFQoJlM.js → loader-DzctJ9jW.js} +2 -2
  54. package/dist/{messagebox-DsKi_rKn.js → messagebox-DPFBuisE.js} +2 -2
  55. package/dist/messagebox-JWKMJEFc.cjs +13 -0
  56. package/dist/{modal-DaerHpVi.cjs → modal-BymjMIJi.cjs} +2 -2
  57. package/dist/{modal-CJqe6y-V.js → modal-CELmA0-8.js} +2 -2
  58. package/dist/pkt-accordion.cjs +1 -1
  59. package/dist/pkt-accordion.js +1 -1
  60. package/dist/pkt-alert.cjs +1 -1
  61. package/dist/pkt-alert.js +1 -1
  62. package/dist/pkt-backlink.cjs +1 -1
  63. package/dist/pkt-backlink.js +1 -1
  64. package/dist/pkt-breadcrumbs.cjs +1 -1
  65. package/dist/pkt-breadcrumbs.js +1 -1
  66. package/dist/pkt-button.cjs +1 -1
  67. package/dist/pkt-button.js +1 -1
  68. package/dist/pkt-calendar.cjs +1 -1
  69. package/dist/pkt-calendar.js +1 -1
  70. package/dist/pkt-card.cjs +1 -1
  71. package/dist/pkt-card.js +1 -1
  72. package/dist/pkt-checkbox.cjs +1 -1
  73. package/dist/pkt-checkbox.js +1 -1
  74. package/dist/pkt-combobox.cjs +1 -1
  75. package/dist/pkt-combobox.js +1 -1
  76. package/dist/pkt-consent.cjs +1 -1
  77. package/dist/pkt-consent.js +1 -1
  78. package/dist/pkt-datepicker.cjs +1 -1
  79. package/dist/pkt-datepicker.js +1 -1
  80. package/dist/pkt-fileupload.cjs +1 -1
  81. package/dist/pkt-fileupload.js +1 -1
  82. package/dist/pkt-footer.cjs +1 -1
  83. package/dist/pkt-footer.js +1 -1
  84. package/dist/pkt-header-menu.cjs +1 -1
  85. package/dist/pkt-header-menu.js +1 -1
  86. package/dist/pkt-header.cjs +1 -1
  87. package/dist/pkt-header.js +1 -1
  88. package/dist/pkt-heading.cjs +1 -1
  89. package/dist/pkt-heading.js +1 -1
  90. package/dist/pkt-helptext.cjs +1 -1
  91. package/dist/pkt-helptext.js +1 -1
  92. package/dist/pkt-icon.cjs +1 -1
  93. package/dist/pkt-icon.js +1 -1
  94. package/dist/pkt-index.cjs +1 -1
  95. package/dist/pkt-index.js +34 -34
  96. package/dist/pkt-input-wrapper.cjs +1 -1
  97. package/dist/pkt-input-wrapper.js +1 -1
  98. package/dist/pkt-link.cjs +1 -1
  99. package/dist/pkt-link.js +1 -1
  100. package/dist/pkt-linkcard.cjs +1 -1
  101. package/dist/pkt-linkcard.js +1 -1
  102. package/dist/pkt-listbox.cjs +1 -1
  103. package/dist/pkt-listbox.js +1 -1
  104. package/dist/pkt-loader.cjs +1 -1
  105. package/dist/pkt-loader.js +1 -1
  106. package/dist/pkt-messagebox.cjs +1 -1
  107. package/dist/pkt-messagebox.js +1 -1
  108. package/dist/pkt-modal.cjs +1 -1
  109. package/dist/pkt-modal.js +1 -1
  110. package/dist/{pkt-options-controller-Dz-rYCG1.cjs → pkt-options-controller-CpEZcomb.cjs} +1 -1
  111. package/dist/{pkt-options-controller-sUzxHa5A.js → pkt-options-controller-D7l18Iw0.js} +1 -1
  112. package/dist/pkt-progressbar.cjs +1 -1
  113. package/dist/pkt-progressbar.js +1 -1
  114. package/dist/pkt-radiobutton.cjs +1 -1
  115. package/dist/pkt-radiobutton.js +1 -1
  116. package/dist/pkt-searchinput.cjs +1 -1
  117. package/dist/pkt-searchinput.js +1 -1
  118. package/dist/pkt-select.cjs +1 -1
  119. package/dist/pkt-select.js +1 -1
  120. package/dist/pkt-tabs.cjs +1 -1
  121. package/dist/pkt-tabs.js +1 -1
  122. package/dist/pkt-tag.cjs +1 -1
  123. package/dist/pkt-tag.js +1 -1
  124. package/dist/pkt-textarea.cjs +1 -1
  125. package/dist/pkt-textarea.js +1 -1
  126. package/dist/pkt-textinput.cjs +1 -1
  127. package/dist/pkt-textinput.js +1 -1
  128. package/dist/pkt-timepicker.cjs +1 -1
  129. package/dist/pkt-timepicker.js +1 -1
  130. package/dist/{progressbar-BrVlAcQI.cjs → progressbar-CIXNSwTy.cjs} +2 -3
  131. package/dist/{progressbar-Bd0DjiAb.js → progressbar-DH5lIBpx.js} +6 -4
  132. package/dist/{radiobutton-B0V-jSEX.js → radiobutton-DP791tUe.js} +1 -1
  133. package/dist/{radiobutton-Cv1BlwLV.cjs → radiobutton-oEYrBiT6.cjs} +1 -1
  134. package/dist/{searchinput-7-VVdkss.cjs → searchinput-CbClDE-d.cjs} +1 -1
  135. package/dist/{searchinput-CgzigmiI.js → searchinput-Co8tcq-l.js} +1 -1
  136. package/dist/{select-BbcGPmPs.js → select-B97S4g1v.js} +18 -18
  137. package/dist/{select---PCiwmy.cjs → select-QobXCtIL.cjs} +13 -13
  138. package/dist/shared-types/icon.d.ts +39 -0
  139. package/dist/shared-types/index.d.ts +2 -0
  140. package/dist/{tabs-B134M9k2.js → tabs-B8blHQrL.js} +18 -18
  141. package/dist/{tabs-Dw9E06fL.cjs → tabs-CjX-GWvM.cjs} +15 -15
  142. package/dist/tag-B5dUg7AD.cjs +27 -0
  143. package/dist/{tag-wYnHhHLK.js → tag-Bns7Xj1O.js} +11 -11
  144. package/dist/{textarea-BcgVLLTt.js → textarea-DgW0hRV5.js} +17 -17
  145. package/dist/{textarea-pA_xv8lI.cjs → textarea-ZMbtZNp3.cjs} +10 -10
  146. package/dist/{textinput-Czz2affL.cjs → textinput-DfT_1aGb.cjs} +10 -10
  147. package/dist/{textinput-Dpj1X5yr.js → textinput-s-qz2xSC.js} +15 -15
  148. package/dist/{timepicker-BwDZkSpo.cjs → timepicker-BAa_VEnf.cjs} +10 -10
  149. package/dist/{timepicker-CfQMZlaP.js → timepicker-Crj4isb9.js} +16 -16
  150. package/package.json +2 -2
  151. package/src/components/alert/alert.test.ts +15 -0
  152. package/src/components/alert/alert.ts +0 -12
  153. package/src/components/combobox/combobox.ts +3 -3
  154. package/src/components/datepicker/datepicker.ts +5 -5
  155. package/src/components/helptext/helptext-association.test.ts +79 -0
  156. package/src/components/icon/icon.ts +6 -6
  157. package/src/components/input-wrapper/input-wrapper.test.ts +49 -0
  158. package/src/components/input-wrapper/input-wrapper.ts +6 -4
  159. package/src/components/progressbar/progressbar.test.ts +19 -0
  160. package/src/components/progressbar/progressbar.ts +2 -6
  161. package/src/components/select/select.ts +3 -3
  162. package/src/components/textarea/textarea.ts +3 -3
  163. package/src/components/textinput/textinput.ts +3 -3
  164. package/src/components/timepicker/timepicker.ts +3 -3
  165. package/dist/alert-D1bQjZ7C.cjs +0 -40
  166. package/dist/button-CmNrMH-c.cjs +0 -32
  167. package/dist/element-with-slot-2PHu2w7O.cjs +0 -1
  168. package/dist/icon-CoBsgGUR.cjs +0 -1
  169. package/dist/link-EMsHusF7.cjs +0 -7
  170. package/dist/messagebox-D5GYIdjE.cjs +0 -13
  171. package/dist/tag-HTYKd-iG.cjs +0 -27
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./if-defined-2mkIDgOm.cjs"),r=require("./element-with-slot-2PHu2w7O.cjs");require("./calendar-D-Ow5DAp.cjs"),require("./icon-CoBsgGUR.cjs");const i=require("./ref-Emu5PNxk.cjs"),a=require("./converters-BJ9Fe0kW.cjs");require("./tag-HTYKd-iG.cjs");const o=require("./repeat-Dh9YKoeV.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-W6Gklt2E.cjs");require("./input-wrapper-CSPPa4uc.cjs");var l=class extends e.t{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=s.n()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},e._`
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),n=require("./element-with-slot-D7sTqOr3.cjs");require("./icon-Dnv6LtPC.cjs"),require("./calendar-TcxvS-1_.cjs");const r=require("./if-defined-2mkIDgOm.cjs"),i=require("./ref-Emu5PNxk.cjs"),a=require("./converters-BJ9Fe0kW.cjs");require("./tag-B5dUg7AD.cjs");const o=require("./repeat-Dh9YKoeV.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-Ctkz5fQk.cjs");require("./input-wrapper-Cf__-4E-.cjs");var l=class extends e.t{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=s.n()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},e._`
2
2
  <div class=${t.t(this.classes)} aria-live="polite">
3
3
  ${Array.isArray(this.dates)&&this.dates[0]?o.t(a.h((this.dates??[]).filter(Boolean)),e=>e,t=>e._` <pkt-tag
4
4
  id=${this.idBase+t+`-tag`}
@@ -54,13 +54,13 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
54
54
  .type=${this.inputType}
55
55
  id="${this.id}-input"
56
56
  .value=${this.value}
57
- min=${n.t(this.min)}
58
- max=${n.t(this.max)}
59
- placeholder=${n.t(this.placeholder)}
57
+ min=${r.t(this.min)}
58
+ max=${r.t(this.max)}
59
+ placeholder=${r.t(this.placeholder)}
60
60
  ?readonly=${this.isInputReadonly}
61
- aria-describedby=${n.t(this.describedBy)}
61
+ aria-describedby=${r.t(this.describedBy)}
62
62
  aria-invalid=${this.hasError}
63
- aria-errormessage=${n.t(this.errorMessageId)}
63
+ aria-errormessage=${r.t(this.errorMessageId)}
64
64
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
65
65
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
66
66
  ?disabled=${this.disabled}
@@ -73,21 +73,21 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
73
73
  />
74
74
  ${this.renderCalendarButton()}
75
75
  </div>
76
- `}};e.n([e.u({type:String})],M.prototype,`value`,void 0);try{e.d(`pkt-datepicker-single`)(M)}catch{console.warn(`Forsøker å definere <pkt-datepicker-single>, men den er allerede definert`)}var N=class extends j{constructor(...e){super(...e),this.value=[],this.label=``,this.showRangeLabels=!1,this.inputRefTo=i.t()}get inputElementTo(){return this.inputRefTo.value}render(){let r=D.getRangeLabelClasses(this.showRangeLabels);return e._`
76
+ `}};e.n([e.u({type:String})],M.prototype,`value`,void 0);try{e.d(`pkt-datepicker-single`)(M)}catch{console.warn(`Forsøker å definere <pkt-datepicker-single>, men den er allerede definert`)}var N=class extends j{constructor(...e){super(...e),this.value=[],this.label=``,this.showRangeLabels=!1,this.inputRefTo=i.t()}get inputElementTo(){return this.inputRefTo.value}render(){let n=D.getRangeLabelClasses(this.showRangeLabels);return e._`
77
77
  <div class="pkt-input__container">
78
78
  ${this.showRangeLabels?e._` <div class="pkt-input-prefix">${this.pktStrings.get(`generic`).from}</div> `:e.h}
79
79
  <input
80
- aria-describedby=${n.t(this.describedBy)}
80
+ aria-describedby=${r.t(this.describedBy)}
81
81
  aria-invalid=${this.hasError}
82
- aria-errormessage=${n.t(this.errorMessageId)}
82
+ aria-errormessage=${r.t(this.errorMessageId)}
83
83
  class=${t.t(this.inputClasses)}
84
84
  .type=${this.inputType}
85
85
  id="${this.id}-input"
86
86
  aria-label="${this.label} ${this.pktStrings.get(`generic`).from}"
87
87
  .value=${this.value[0]??``}
88
- min=${n.t(this.min)}
89
- max=${n.t(this.max)}
90
- placeholder=${n.t(this.placeholder)}
88
+ min=${r.t(this.min)}
89
+ max=${r.t(this.max)}
90
+ placeholder=${r.t(this.placeholder)}
91
91
  ?readonly=${this.isInputReadonly}
92
92
  ?disabled=${this.disabled}
93
93
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
@@ -99,22 +99,22 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
99
99
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
100
100
  ${i.n(this.inputRef)}
101
101
  />
102
- <div class="${t.t(r)}" id="${this.id}-to-label">
102
+ <div class="${t.t(n)}" id="${this.id}-to-label">
103
103
  ${this.pktStrings.get(`generic`).to}
104
104
  </div>
105
105
  ${this.showRangeLabels?e.h:e._` <div class="pkt-input-separator">–</div> `}
106
106
  <input
107
- aria-describedby=${n.t(this.describedBy)}
107
+ aria-describedby=${r.t(this.describedBy)}
108
108
  aria-invalid=${this.hasError}
109
- aria-errormessage=${n.t(this.errorMessageId)}
109
+ aria-errormessage=${r.t(this.errorMessageId)}
110
110
  class=${t.t(this.inputClasses)}
111
111
  .type=${this.inputType}
112
112
  id="${this.id}-to"
113
113
  aria-label="${this.label} ${this.pktStrings.get(`generic`).to}"
114
114
  .value=${this.value[1]??``}
115
- min=${n.t(this.min)}
116
- max=${n.t(this.max)}
117
- placeholder=${n.t(this.placeholder)}
115
+ min=${r.t(this.min)}
116
+ max=${r.t(this.max)}
117
+ placeholder=${r.t(this.placeholder)}
118
118
  ?readonly=${this.isInputReadonly}
119
119
  ?disabled=${this.disabled}
120
120
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
@@ -131,15 +131,15 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
131
131
  `}};e.n([e.u({type:Array})],N.prototype,`value`,void 0),e.n([e.u({type:String})],N.prototype,`label`,void 0),e.n([e.u({type:Boolean})],N.prototype,`showRangeLabels`,void 0);try{e.d(`pkt-datepicker-range`)(N)}catch{console.warn(`Forsøker å definere <pkt-datepicker-range>, men den er allerede definert`)}var P=class extends j{constructor(...e){super(...e),this.value=[]}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent(`add-to-selected`,{detail:e,bubbles:!0,composed:!0}))}render(){return e._`
132
132
  <div class="pkt-input__container">
133
133
  <input
134
- aria-describedby=${n.t(this.describedBy)}
134
+ aria-describedby=${r.t(this.describedBy)}
135
135
  aria-invalid=${this.hasError}
136
- aria-errormessage=${n.t(this.errorMessageId)}
136
+ aria-errormessage=${r.t(this.errorMessageId)}
137
137
  class=${t.t(this.inputClasses)}
138
138
  .type=${this.inputType}
139
139
  id="${this.id}-input"
140
- min=${n.t(this.min)}
141
- max=${n.t(this.max)}
142
- placeholder=${n.t(this.placeholder)}
140
+ min=${r.t(this.min)}
141
+ max=${r.t(this.max)}
142
+ placeholder=${r.t(this.placeholder)}
143
143
  ?readonly=${this.isInputReadonly}
144
144
  ?disabled=${this.isInputDisabled}
145
145
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
@@ -167,7 +167,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
167
167
  .inputSize=${this.inputSize}
168
168
  .internals=${this.internals}
169
169
  .hasError=${this.hasError}
170
- .hasHelptext=${!!(this.helptext||this.helptextDropdown)}
170
+ .hasHelptext=${!!(this.helptext||this.helptextDropdown||this.hasSlotContent(`helptext`))}
171
171
  .strings=${this.strings}
172
172
  @toggle-calendar=${e=>this.toggleCalendar(e.detail)}
173
173
  @input-change=${()=>this.onInput()}
@@ -194,7 +194,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
194
194
  .inputSize=${this.inputSize}
195
195
  .internals=${this.internals}
196
196
  .hasError=${this.hasError}
197
- .hasHelptext=${!!(this.helptext||this.helptextDropdown)}
197
+ .hasHelptext=${!!(this.helptext||this.helptextDropdown||this.hasSlotContent(`helptext`))}
198
198
  .strings=${this.strings}
199
199
  @toggle-calendar=${e=>this.toggleCalendar(e.detail)}
200
200
  @input-change=${()=>this.onInput()}
@@ -222,7 +222,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
222
222
  .inputSize=${this.inputSize}
223
223
  .internals=${this.internals}
224
224
  .hasError=${this.hasError}
225
- .hasHelptext=${!!(this.helptext||this.helptextDropdown)}
225
+ .hasHelptext=${!!(this.helptext||this.helptextDropdown||this.hasSlotContent(`helptext`))}
226
226
  .strings=${this.strings}
227
227
  @toggle-calendar=${e=>this.toggleCalendar(e.detail)}
228
228
  @input-change=${()=>this.onInput()}
@@ -254,6 +254,7 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
254
254
  ></pkt-datepicker-popup>
255
255
  `}render(){return this.inputClasses=D.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType,this.inputSize),e._`
256
256
  <pkt-input-wrapper
257
+ ${n.n(this,[`helptext`])}
257
258
  .strings=${this.strings}
258
259
  label="${this.label}"
259
260
  forId="${this.id}-input"
@@ -278,7 +279,6 @@ const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs"),
278
279
  .ariaDescribedby=${this.ariaDescribedby}
279
280
  .size=${this.inputSize}
280
281
  >
281
- <div class="pkt-contents" slot="helptext">${r.r(this,`helptext`)}</div>
282
282
  ${this.multiple?e._`<pkt-date-tags
283
283
  .dates=${this._value}
284
284
  dateformat=${this.dateformat}
@@ -1,11 +1,15 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { AsyncDirective, PartInfo } from 'lit/async-directive.js';
3
- import { ChildPart } from 'lit/directive.js';
3
+ import { ChildPart, ElementPart } from 'lit/directive.js';
4
4
  /**
5
5
  * Returns the SlotManager for a host, creating one if it doesn't exist.
6
6
  * Call this in connectedCallback() to eagerly collect children before Lit renders.
7
7
  */
8
8
  export declare function getSlotManager(host: LitElement): SlotManager;
9
+ declare const DEFAULT_SLOT: unique symbol;
10
+ type SlotKey = string | typeof DEFAULT_SLOT;
11
+ type SlotMapping = Array<[from: SlotKey, to: SlotKey]>;
12
+ type ForwardedSlots = string[] | Record<string, string | null>;
9
13
  /**
10
14
  * Per-host singleton that manages node collection and observation.
11
15
  * Scans host children, categorizes them by slot attribute, and notifies
@@ -28,6 +32,8 @@ export declare class SlotManager {
28
32
  private placeholderToNode;
29
33
  private nodeToPlaceholder;
30
34
  private static PLACEHOLDER_PREFIX;
35
+ private sources;
36
+ private subscribers;
31
37
  constructor(host: LitElement);
32
38
  /**
33
39
  * Collect original children BEFORE Lit's first render.
@@ -43,6 +49,8 @@ export declare class SlotManager {
43
49
  * Unregister a directive instance. Stops observing if no directives remain.
44
50
  */
45
51
  removeDirective(d: SlotContentDirective): void;
52
+ addSource(token: object, manager: SlotManager, mapping: SlotMapping): void;
53
+ removeSource(token: object): void;
46
54
  /**
47
55
  * Returns nodes matching the given slot name.
48
56
  */
@@ -59,6 +67,10 @@ export declare class SlotManager {
59
67
  * the placeholder removal and clean up the real node.
60
68
  */
61
69
  ensurePlaceholder(node: Node): void;
70
+ private nodesFor;
71
+ private detachFrom;
72
+ private handleChange;
73
+ private stopObservingIfUnused;
62
74
  /**
63
75
  * Start MutationObserver for dynamic child changes.
64
76
  * Deferred via setTimeout to avoid catching Lit's first render mutations.
@@ -125,4 +137,27 @@ declare class SlotContentDirective extends AsyncDirective {
125
137
  * html`<div class="help">${slotContent(this, 'helptext')}</div>`
126
138
  */
127
139
  export declare const slotContent: (_host: LitElement, _slotName?: string | undefined) => import('lit-html/directive.js').DirectiveResult<typeof SlotContentDirective>;
140
+ declare class ForwardSlotsDirective extends AsyncDirective {
141
+ private target;
142
+ private source;
143
+ private mapping;
144
+ constructor(partInfo: PartInfo);
145
+ render(_host: LitElement, _slots: ForwardedSlots): unknown;
146
+ update(part: ElementPart, [host, slots]: [LitElement, ForwardedSlots]): unknown;
147
+ disconnected(): void;
148
+ reconnected(): void;
149
+ }
150
+ /**
151
+ * Element directive that gives a child element the host's slot content without an
152
+ * intermediate element. The child renders the nodes with its own `slotContent()`.
153
+ *
154
+ * @param host - The component instance (typically `this`)
155
+ * @param slots - Slot names forwarded under the same name, or a map from the host's slot
156
+ * name to the child's slot name (`null` for the child's default slot)
157
+ *
158
+ * @example
159
+ * html`<pkt-input-wrapper ${forwardSlots(this, ['helptext'])}></pkt-input-wrapper>`
160
+ * html`<pkt-helptext ${forwardSlots(this, { helptext: null })}></pkt-helptext>`
161
+ */
162
+ export declare const forwardSlots: (_host: LitElement, _slots: ForwardedSlots) => import('lit-html/directive.js').DirectiveResult<typeof ForwardSlotsDirective>;
128
163
  export {};
@@ -0,0 +1 @@
1
+ const e=require("./element-BOmr9YLv.cjs"),t=require("./async-directive-BGoo_npW.cjs");function n(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function r(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function i(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var a=new WeakMap;function o(e){let t=a.get(e);return t||(t=new p(e),a.set(e,t)),t}var s=Symbol(`default`);function c(e){return e===void 0?s:e}function l(e){return Array.isArray(e)?e.map(e=>[e,e]):Object.entries(e).map(([e,t])=>[e,t===null?s:t])}function u(e,t){return e.length===t.length&&e.every(([e,n],r)=>t[r][0]===e&&t[r][1]===n)}function d(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return i(e)?(f(t,s,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let i=e;if(n(i)||r(i))return!1;if(i instanceof HTMLTemplateElement){let e=Array.from(i.content.childNodes),n=c(i.getAttribute(`slot`)??void 0);for(let r of e)f(t,n,r);return!0}let a=i.getAttribute(`slot`);return f(t,a===null?s:c(a),e),!0}return!1}function f(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var p=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.sources=new Map,this.subscribers=new Set,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)d(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.stopObservingIfUnused()}addSource(e,t,n){let r=this.sources.get(e);r&&r.manager===t&&u(r.mapping,n)||(r&&r.manager!==t&&this.detachFrom(r.manager,e),this.sources.set(e,{manager:t,mapping:n}),t.subscribers.add(this),t.startObserving(),this.handleChange())}removeSource(e){let t=this.sources.get(e);t&&(this.sources.delete(e),this.detachFrom(t.manager,e),this.handleChange())}getNodes(e){return this.nodesFor(c(e))}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(t){if(this.nodeToPlaceholder.has(t))return;if(t.parentNode!==this.host){for(let{manager:e}of this.sources.values())e.ensurePlaceholder(t);return}let n=document.createComment(e.PLACEHOLDER_PREFIX);this.host.insertBefore(n,t),this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n)}nodesFor(e){let t=this.nodesBySlot.get(e)??[];if(this.sources.size===0)return t;let n=[];for(let{manager:t,mapping:r}of this.sources.values())for(let[i,a]of r)a===e&&n.push(...t.nodesFor(i));return n.length?[...t,...n]:t}detachFrom(e,t){[...this.sources.entries()].some(([n,r])=>n!==t&&r.manager===e)||(e.subscribers.delete(this),e.stopObservingIfUnused())}handleChange(){this.generation++,this.notifyDirectives();for(let e of this.subscribers)e.handleChange();this.host.requestUpdate()}stopObservingIfUnused(){this.directives.size===0&&this.subscribers.size===0&&this.stopObserving()}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{!this.observing||typeof MutationObserver>`u`||(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0,subtree:!0}))},0))}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}handleMutations(e){if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(let n of e){for(let e of n.removedNodes){let n=this.placeholderToNode.get(e);if(n){n.parentNode?.removeChild(n),this.trackedNodes.delete(n),this.removeFromSlots(n),this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(n),t=!0;continue}if(this.trackedNodes.has(e)&&!this.host.contains(e)){this.trackedNodes.delete(e),this.removeFromSlots(e);let n=this.nodeToPlaceholder.get(e);n&&(n.parentNode?.removeChild(n),this.placeholderToNode.delete(n),this.nodeToPlaceholder.delete(e)),t=!0}}if(n.target===this.host)for(let e of n.addedNodes)this.placeholderToNode.has(e)||!this.trackedNodes.has(e)&&this.isUserContent(e)&&d(e,this.nodesBySlot)&&(this.trackedNodes.add(e),t=!0)}t&&this.handleChange(),this.observer?.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return i(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(n(t)||r(t))}return!1}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}},m=class extends t.t{constructor(t){if(super(t),this.manager=null,this.lastGeneration=-1,t.type!==e.m.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.g}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=o(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();let t=this.getNodesOrNoChange();t!==e.g&&this.setValue(t)}ensurePlaceholders(){if(!this.manager)return;let e=this.manager.getNodes(this.slotName);for(let t of e)this.manager.ensurePlaceholder(t)}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return e.g;let t=this.manager.generation;return t===this.lastGeneration?e.g:(this.lastGeneration=t,this.manager.getNodes(this.slotName))}},h=e.f(m),g=class extends t.t{constructor(t){if(super(t),this.target=null,this.source=null,this.mapping=[],t.type!==e.m.ELEMENT)throw Error(`forwardSlots() can only be used as an element directive`)}render(t,n){return e.g}update(t,[n,r]){let i=o(t.element);return this.target&&this.target!==i&&this.target.removeSource(this),this.target=i,this.source=o(n),this.source.collectNodes(),this.mapping=l(r),this.target.addSource(this,this.source,this.mapping),e.g}disconnected(){this.target?.removeSource(this)}reconnected(){this.target&&this.source&&this.target.addSource(this,this.source,this.mapping)}},_=e.f(g),v=class extends e.t{connectedCallback(){o(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return o(this).hasContent(e)}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
@@ -15,67 +15,109 @@ function s(e) {
15
15
  var c = /* @__PURE__ */ new WeakMap();
16
16
  function l(e) {
17
17
  let t = c.get(e);
18
- return t || (t = new m(e), c.set(e, t)), t;
18
+ return t || (t = new g(e), c.set(e, t)), t;
19
19
  }
20
20
  var u = Symbol("default");
21
21
  function d(e) {
22
22
  return e === void 0 ? u : e;
23
23
  }
24
- function f(e, t) {
24
+ function f(e) {
25
+ return Array.isArray(e) ? e.map((e) => [e, e]) : Object.entries(e).map(([e, t]) => [e, t === null ? u : t]);
26
+ }
27
+ function p(e, t) {
28
+ return e.length === t.length && e.every(([e, n], r) => t[r][0] === e && t[r][1] === n);
29
+ }
30
+ function m(e, t) {
25
31
  if (e.nodeType === Node.COMMENT_NODE) return !1;
26
- if (e.nodeType === Node.TEXT_NODE) return s(e) ? (p(t, u, e), !0) : !1;
32
+ if (e.nodeType === Node.TEXT_NODE) return s(e) ? (h(t, u, e), !0) : !1;
27
33
  if (e.nodeType === Node.ELEMENT_NODE) {
28
34
  let n = e;
29
35
  if (a(n) || o(n)) return !1;
30
36
  if (n instanceof HTMLTemplateElement) {
31
37
  let e = Array.from(n.content.childNodes), r = d(n.getAttribute("slot") ?? void 0);
32
- for (let n of e) p(t, r, n);
38
+ for (let n of e) h(t, r, n);
33
39
  return !0;
34
40
  }
35
41
  let r = n.getAttribute("slot");
36
- return p(t, r === null ? u : d(r), e), !0;
42
+ return h(t, r === null ? u : d(r), e), !0;
37
43
  }
38
44
  return !1;
39
45
  }
40
- function p(e, t, n) {
46
+ function h(e, t, n) {
41
47
  let r = e.get(t);
42
48
  r || (r = [], e.set(t, r)), r.push(n);
43
49
  }
44
- var m = class e {
50
+ var g = class e {
45
51
  static {
46
52
  this.PLACEHOLDER_PREFIX = "pkt-slot";
47
53
  }
48
54
  constructor(e) {
49
- this.observer = null, this.nodesBySlot = /* @__PURE__ */ new Map(), this.directives = /* @__PURE__ */ new Set(), this.observing = !1, this.trackedNodes = /* @__PURE__ */ new Set(), this.generation = 0, this.initialCollectionDone = !1, this.processingMutations = !1, this.placeholderToNode = /* @__PURE__ */ new Map(), this.nodeToPlaceholder = /* @__PURE__ */ new Map(), this.host = e;
55
+ this.observer = null, this.nodesBySlot = /* @__PURE__ */ new Map(), this.directives = /* @__PURE__ */ new Set(), this.observing = !1, this.trackedNodes = /* @__PURE__ */ new Set(), this.generation = 0, this.initialCollectionDone = !1, this.processingMutations = !1, this.placeholderToNode = /* @__PURE__ */ new Map(), this.nodeToPlaceholder = /* @__PURE__ */ new Map(), this.sources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Set(), this.host = e;
50
56
  }
51
57
  collectNodes() {
52
58
  if (this.initialCollectionDone) return;
53
59
  this.initialCollectionDone = !0, this.generation++;
54
60
  let e = Array.from(this.host.childNodes);
55
- for (let t of e) f(t, this.nodesBySlot) && this.trackedNodes.add(t);
61
+ for (let t of e) m(t, this.nodesBySlot) && this.trackedNodes.add(t);
56
62
  }
57
63
  addDirective(e) {
58
64
  this.directives.add(e), this.startObserving();
59
65
  }
60
66
  removeDirective(e) {
61
- this.directives.delete(e), this.directives.size === 0 && this.stopObserving();
67
+ this.directives.delete(e), this.stopObservingIfUnused();
68
+ }
69
+ addSource(e, t, n) {
70
+ let r = this.sources.get(e);
71
+ r && r.manager === t && p(r.mapping, n) || (r && r.manager !== t && this.detachFrom(r.manager, e), this.sources.set(e, {
72
+ manager: t,
73
+ mapping: n
74
+ }), t.subscribers.add(this), t.startObserving(), this.handleChange());
75
+ }
76
+ removeSource(e) {
77
+ let t = this.sources.get(e);
78
+ t && (this.sources.delete(e), this.detachFrom(t.manager, e), this.handleChange());
62
79
  }
63
80
  getNodes(e) {
64
- return this.nodesBySlot.get(d(e)) ?? [];
81
+ return this.nodesFor(d(e));
65
82
  }
66
83
  hasContent(e) {
67
84
  return this.getNodes(e).length > 0;
68
85
  }
69
86
  ensurePlaceholder(t) {
70
- if (this.nodeToPlaceholder.has(t) || t.parentNode !== this.host) return;
87
+ if (this.nodeToPlaceholder.has(t)) return;
88
+ if (t.parentNode !== this.host) {
89
+ for (let { manager: e } of this.sources.values()) e.ensurePlaceholder(t);
90
+ return;
91
+ }
71
92
  let n = document.createComment(e.PLACEHOLDER_PREFIX);
72
93
  this.host.insertBefore(n, t), this.placeholderToNode.set(n, t), this.nodeToPlaceholder.set(t, n);
73
94
  }
95
+ nodesFor(e) {
96
+ let t = this.nodesBySlot.get(e) ?? [];
97
+ if (this.sources.size === 0) return t;
98
+ let n = [];
99
+ for (let { manager: t, mapping: r } of this.sources.values()) for (let [i, a] of r) a === e && n.push(...t.nodesFor(i));
100
+ return n.length ? [...t, ...n] : t;
101
+ }
102
+ detachFrom(e, t) {
103
+ [...this.sources.entries()].some(([n, r]) => n !== t && r.manager === e) || (e.subscribers.delete(this), e.stopObservingIfUnused());
104
+ }
105
+ handleChange() {
106
+ this.generation++, this.notifyDirectives();
107
+ for (let e of this.subscribers) e.handleChange();
108
+ this.host.requestUpdate();
109
+ }
110
+ stopObservingIfUnused() {
111
+ this.directives.size === 0 && this.subscribers.size === 0 && this.stopObserving();
112
+ }
74
113
  startObserving() {
75
114
  this.observing || (this.observing = !0, setTimeout(() => {
76
- this.observing && (this.observer = new MutationObserver((e) => {
115
+ !this.observing || typeof MutationObserver > "u" || (this.observer = new MutationObserver((e) => {
77
116
  this.handleMutations(e);
78
- }), this.observer.observe(this.host, { childList: !0 }));
117
+ }), this.observer.observe(this.host, {
118
+ childList: !0,
119
+ subtree: !0
120
+ }));
79
121
  }, 0));
80
122
  }
81
123
  stopObserving() {
@@ -85,22 +127,22 @@ var m = class e {
85
127
  if (this.processingMutations) return;
86
128
  this.processingMutations = !0;
87
129
  let t = !1;
88
- for (let n of e) if (n.target === this.host) {
130
+ for (let n of e) {
89
131
  for (let e of n.removedNodes) {
90
132
  let n = this.placeholderToNode.get(e);
91
133
  if (n) {
92
134
  n.parentNode?.removeChild(n), this.trackedNodes.delete(n), this.removeFromSlots(n), this.placeholderToNode.delete(e), this.nodeToPlaceholder.delete(n), t = !0;
93
135
  continue;
94
136
  }
95
- if (this.trackedNodes.has(e)) {
137
+ if (this.trackedNodes.has(e) && !this.host.contains(e)) {
96
138
  this.trackedNodes.delete(e), this.removeFromSlots(e);
97
139
  let n = this.nodeToPlaceholder.get(e);
98
140
  n && (n.parentNode?.removeChild(n), this.placeholderToNode.delete(n), this.nodeToPlaceholder.delete(e)), t = !0;
99
141
  }
100
142
  }
101
- for (let e of n.addedNodes) this.placeholderToNode.has(e) || !this.trackedNodes.has(e) && this.isUserContent(e) && f(e, this.nodesBySlot) && (this.trackedNodes.add(e), t = !0);
143
+ if (n.target === this.host) for (let e of n.addedNodes) this.placeholderToNode.has(e) || !this.trackedNodes.has(e) && this.isUserContent(e) && m(e, this.nodesBySlot) && (this.trackedNodes.add(e), t = !0);
102
144
  }
103
- t && (this.generation++, this.notifyDirectives()), this.observer?.takeRecords(), this.processingMutations = !1;
145
+ t && this.handleChange(), this.observer?.takeRecords(), this.processingMutations = !1;
104
146
  }
105
147
  isUserContent(e) {
106
148
  if (e.nodeType === Node.COMMENT_NODE) return !1;
@@ -123,7 +165,7 @@ var m = class e {
123
165
  notifyDirectives() {
124
166
  for (let e of this.directives) e.handleNodesChanged();
125
167
  }
126
- }, h = e(class extends i {
168
+ }, _ = e(class extends i {
127
169
  constructor(e) {
128
170
  if (super(e), this.manager = null, this.lastGeneration = -1, e.type !== n.CHILD) throw Error("slotContent() can only be used in child expressions");
129
171
  }
@@ -153,7 +195,24 @@ var m = class e {
153
195
  let e = this.manager.generation;
154
196
  return e === this.lastGeneration ? t : (this.lastGeneration = e, this.manager.getNodes(this.slotName));
155
197
  }
156
- }), g = class extends r {
198
+ }), v = e(class extends i {
199
+ constructor(e) {
200
+ if (super(e), this.target = null, this.source = null, this.mapping = [], e.type !== n.ELEMENT) throw Error("forwardSlots() can only be used as an element directive");
201
+ }
202
+ render(e, n) {
203
+ return t;
204
+ }
205
+ update(e, [n, r]) {
206
+ let i = l(e.element);
207
+ return this.target && this.target !== i && this.target.removeSource(this), this.target = i, this.source = l(n), this.source.collectNodes(), this.mapping = f(r), this.target.addSource(this, this.source, this.mapping), t;
208
+ }
209
+ disconnected() {
210
+ this.target?.removeSource(this);
211
+ }
212
+ reconnected() {
213
+ this.target && this.source && this.target.addSource(this, this.source, this.mapping);
214
+ }
215
+ }), y = class extends r {
157
216
  connectedCallback() {
158
217
  l(this).collectNodes(), super.connectedCallback();
159
218
  }
@@ -162,4 +221,4 @@ var m = class e {
162
221
  }
163
222
  };
164
223
  //#endregion
165
- export { o as i, l as n, h as r, g as t };
224
+ export { o as a, _ as i, v as n, l as r, y as t };
@@ -1,15 +1,15 @@
1
1
  import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-mwwC2Rra.js";
2
2
  import { t as s } from "./class-map-C4hdfSfY.js";
3
- import { t as c } from "./if-defined-Bebu3LXY.js";
4
- import { n as l, t as u } from "./format-BTeSVkED.js";
5
- import "./alert-BhvjSA5X.js";
6
- import "./icon-DmRyYNlY.js";
3
+ import { n as c, t as l } from "./format-BTeSVkED.js";
4
+ import "./alert-C0PiYnot.js";
5
+ import "./icon-JigbxxF7.js";
6
+ import { t as u } from "./if-defined-Bebu3LXY.js";
7
7
  import { t as d } from "./converters-CkjLSYpa.js";
8
8
  import { n as f } from "./utils-BwF4QSrq.js";
9
- import "./input-wrapper-C1zXIKBU.js";
9
+ import "./input-wrapper-DACDx6Ie.js";
10
10
  import { r as p } from "./focus-trap-DG3pEuyJ.js";
11
- import "./modal-CJqe6y-V.js";
12
- import "./progressbar-Bd0DjiAb.js";
11
+ import "./modal-CELmA0-8.js";
12
+ import "./progressbar-DH5lIBpx.js";
13
13
  //#region ../../shared-utils/fileupload/size.ts
14
14
  function m(e) {
15
15
  if (e == null || e === "") return;
@@ -246,7 +246,7 @@ var j = class extends a {
246
246
  file: e,
247
247
  attributes: { targetFilename: e.name }
248
248
  })), r = this.pktStrings.get("fileupload");
249
- this.setAddedAnnouncement(n.length === 1 ? u(r.srFileAdded, { filename: n[0].attributes.targetFilename }) : u(r.srFilesAdded, { count: n.length }));
249
+ this.setAddedAnnouncement(n.length === 1 ? l(r.srFileAdded, { filename: n[0].attributes.targetFilename }) : l(r.srFilesAdded, { count: n.length }));
250
250
  let i = this.getCurrentFiles(), a = this.multiple ? [...i, ...n] : [n[0]];
251
251
  this.commitFiles(a, "add", n.map((e) => e.fileId)), this.uploadStrategy === "custom" && n.forEach((e) => {
252
252
  this.dispatchEvent(new CustomEvent("file-upload-requested", {
@@ -379,20 +379,20 @@ var j = class extends a {
379
379
  let { totalCount: e, uploadedCount: t } = k(this.getCurrentFiles(), this.transfers);
380
380
  if (e === 0 || t === 0) return "";
381
381
  let n = this.pktStrings.get("fileupload");
382
- return u(n.srFilesUploadedOfTotal, {
382
+ return l(n.srFilesUploadedOfTotal, {
383
383
  uploaded: t,
384
384
  total: e,
385
- label: l(e, n.fileLabelOne, n.fileLabelOther)
385
+ label: c(e, n.fileLabelOne, n.fileLabelOther)
386
386
  });
387
387
  }
388
388
  getSrErrorsMessage() {
389
389
  let { totalCount: e, failedCount: t } = k(this.getCurrentFiles(), this.transfers);
390
390
  if (e === 0 || t === 0) return "";
391
391
  let n = this.pktStrings.get("fileupload");
392
- return u(n.srFilesFailedOfTotal, {
392
+ return l(n.srFilesFailedOfTotal, {
393
393
  failed: t,
394
394
  total: e,
395
- label: l(e, n.fileLabelOne, n.fileLabelOther)
395
+ label: c(e, n.fileLabelOne, n.fileLabelOther)
396
396
  });
397
397
  }
398
398
  get ownerForm() {
@@ -491,7 +491,7 @@ var M = "comments", N = (e, t) => {
491
491
  let n = new Date(e);
492
492
  if (Number.isNaN(n.getTime())) return e;
493
493
  let r = String(n.getDate()).padStart(2, "0"), i = String(n.getMonth() + 1).padStart(2, "0"), a = n.getFullYear(), o = String(n.getHours()).padStart(2, "0"), s = String(n.getMinutes()).padStart(2, "0");
494
- return u(t.commentTimestamp, {
494
+ return l(t.commentTimestamp, {
495
495
  date: `${r}.${i}.${a}`,
496
496
  time: `${o}:${s}`
497
497
  });
@@ -730,7 +730,7 @@ var M = "comments", N = (e, t) => {
730
730
  >${o}</span
731
731
  >` : null}
732
732
  `;
733
- }, K = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: l, setFileAttribute: u }) => {
733
+ }, K = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
734
734
  let d = i.find((e) => e.id === a);
735
735
  if (d?.renderInlineUI || d?.renderExtendedUI) return null;
736
736
  let f = i.map((i) => {
@@ -742,15 +742,15 @@ var M = "comments", N = (e, t) => {
742
742
  isActive: i.id === a,
743
743
  onActivateOperation: o,
744
744
  onCloseOperation: s,
745
- getFileAttribute: l,
746
- setFileAttribute: u
745
+ getFileAttribute: c,
746
+ setFileAttribute: l
747
747
  }), f = typeof i.title == "function" ? i.title(t) : i.title;
748
748
  if (!f) return null;
749
749
  let p = typeof i.ariaLabel == "function" ? i.ariaLabel(t) : i.ariaLabel;
750
750
  return e`<button
751
751
  type="button"
752
752
  class="pkt-fileupload__queue-display__item__operation"
753
- aria-label=${c(p)}
753
+ aria-label=${u(p)}
754
754
  ?disabled=${n}
755
755
  @click=${() => {
756
756
  (i.renderInlineUI || i.renderExtendedUI) && d.activate(), i.onClick?.(d);
@@ -818,8 +818,8 @@ var M = "comments", N = (e, t) => {
818
818
  ></pkt-icon>
819
819
  ${B(i, n, r)}
820
820
  `;
821
- }, Z = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview: i, truncateTail: a, strings: o, onOpenPreview: l, onThumbnailImageError: d }) => {
822
- let f = A(t), p = !!n, m = !!r && !!i, h = m && !!l;
821
+ }, Z = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview: i, truncateTail: a, strings: o, onOpenPreview: c, onThumbnailImageError: d }) => {
822
+ let f = A(t), p = !!n, m = !!r && !!i, h = m && !!c;
823
823
  return e`
824
824
  <div
825
825
  class=${s({
@@ -830,10 +830,10 @@ var M = "comments", N = (e, t) => {
830
830
  <button
831
831
  type="button"
832
832
  class="pkt-fileupload__queue-display__item__thumbnail__image-wrapper pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--label-only"
833
- aria-label=${u(o.previewImage, { filename: f })}
833
+ aria-label=${l(o.previewImage, { filename: f })}
834
834
  ?disabled=${!h}
835
835
  @click=${() => {
836
- !h || !l || l(t.fileId);
836
+ !h || !c || c(t.fileId);
837
837
  }}
838
838
  >
839
839
  <span class="pkt-btn__text">
@@ -843,7 +843,7 @@ var M = "comments", N = (e, t) => {
843
843
  aria-hidden="true"
844
844
  ></pkt-icon>` : null}
845
845
  ${p ? e`<img
846
- src=${c(n)}
846
+ src=${u(n)}
847
847
  alt=${f}
848
848
  @error=${() => d?.(t.fileId)}
849
849
  />` : e`<pkt-icon
@@ -1160,23 +1160,23 @@ var M = "comments", N = (e, t) => {
1160
1160
  <input
1161
1161
  id=${`${this.id}-input`}
1162
1162
  type="file"
1163
- name=${c(this.uploadStrategy === "form" ? this.name : void 0)}
1164
- form=${c(this.form)}
1163
+ name=${u(this.uploadStrategy === "form" ? this.name : void 0)}
1164
+ form=${u(this.form)}
1165
1165
  ?multiple=${this.multiple}
1166
1166
  ?disabled=${this.disabled}
1167
1167
  ?required=${this.required && this.uploadStrategy === "form"}
1168
1168
  accept=${this.getResolvedAcceptValue()}
1169
- aria-label=${c(this.label ? void 0 : this.multiple ? this.pktStrings.get("fileupload").openFileDialogLabelMultiple : this.pktStrings.get("fileupload").openFileDialogLabelSingle)}
1170
- aria-required=${c(this.required ? "true" : void 0)}
1171
- aria-invalid=${c(this.hasEffectiveError ? "true" : void 0)}
1172
- aria-describedby=${c(a)}
1169
+ aria-label=${u(this.label ? void 0 : this.multiple ? this.pktStrings.get("fileupload").openFileDialogLabelMultiple : this.pktStrings.get("fileupload").openFileDialogLabelSingle)}
1170
+ aria-required=${u(this.required ? "true" : void 0)}
1171
+ aria-invalid=${u(this.hasEffectiveError ? "true" : void 0)}
1172
+ aria-describedby=${u(a)}
1173
1173
  @change=${this.onNativeFileChange}
1174
1174
  />
1175
1175
  ${this.uploadStrategy === "custom" ? t.map((t) => e`<input
1176
1176
  type="hidden"
1177
1177
  name=${this.name}
1178
1178
  value=${t.fileId}
1179
- form=${c(this.form)}
1179
+ form=${u(this.form)}
1180
1180
  />`) : null}
1181
1181
  <div class="pkt-fileupload__drop-zone__placeholder">
1182
1182
  <pkt-icon
@@ -1313,7 +1313,7 @@ var M = "comments", N = (e, t) => {
1313
1313
  ${i ? e`<button
1314
1314
  type="button"
1315
1315
  class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
1316
- aria-label=${u(n.previewPrevious, {
1316
+ aria-label=${l(n.previewPrevious, {
1317
1317
  index: this.previewCurrentIndex,
1318
1318
  total: t.length
1319
1319
  })}
@@ -1330,7 +1330,7 @@ var M = "comments", N = (e, t) => {
1330
1330
  <div class="pkt-fileupload__image-preview__content">
1331
1331
  ${o ? e`<img
1332
1332
  src=${a}
1333
- alt=${u(n.previewImageAlt, {
1333
+ alt=${l(n.previewImageAlt, {
1334
1334
  filename: s,
1335
1335
  index: this.previewCurrentIndex + 1,
1336
1336
  total: t.length
@@ -1350,7 +1350,7 @@ var M = "comments", N = (e, t) => {
1350
1350
  ${i ? e`<button
1351
1351
  type="button"
1352
1352
  class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
1353
- aria-label=${u(n.previewNext, {
1353
+ aria-label=${l(n.previewNext, {
1354
1354
  index: this.previewCurrentIndex + 2,
1355
1355
  total: t.length
1356
1356
  })}