@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.7

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 (245) hide show
  1. package/README.md +1 -1
  2. package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
  3. package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
  4. package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-3PNGQEG4.js} +3 -3
  5. package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
  6. package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
  7. package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
  8. package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
  9. package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
  10. package/dist/cdn/components/chunks/chunk-BVASCT2V.js +109 -0
  11. package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-DGI7TKCU.js} +14 -9
  12. package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
  13. package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
  14. package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
  15. package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
  16. package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-LVKMAHMU.js} +10 -0
  17. package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
  18. package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-PXF554MD.js} +1 -1
  19. package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
  20. package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
  21. package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
  22. package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
  23. package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
  24. package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
  25. package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
  26. package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-Z3OFIE7S.js} +1 -1
  27. package/dist/cdn/components/eun-alert.js +13 -6
  28. package/dist/cdn/components/eun-animate.js +3 -3
  29. package/dist/cdn/components/eun-badge.js +1 -1
  30. package/dist/cdn/components/eun-button.js +1 -1
  31. package/dist/cdn/components/eun-calendar.js +2 -2
  32. package/dist/cdn/components/eun-card.js +4 -4
  33. package/dist/cdn/components/eun-carousel.js +21 -18
  34. package/dist/cdn/components/eun-check-card.js +1 -1
  35. package/dist/cdn/components/eun-checkbox-list.js +11 -8
  36. package/dist/cdn/components/eun-checkbox.js +1 -1
  37. package/dist/cdn/components/eun-chip.js +3 -3
  38. package/dist/cdn/components/eun-color-picker.js +60 -68
  39. package/dist/cdn/components/eun-counter.js +10 -10
  40. package/dist/cdn/components/eun-date-picker.js +47 -46
  41. package/dist/cdn/components/eun-description-list.js +2 -2
  42. package/dist/cdn/components/eun-divider.js +3 -3
  43. package/dist/cdn/components/eun-drawer.js +5 -5
  44. package/dist/cdn/components/eun-dropdown-button.js +1 -1
  45. package/dist/cdn/components/eun-fab.js +2 -2
  46. package/dist/cdn/components/eun-icon.js +1 -1
  47. package/dist/cdn/components/eun-image-card.js +1 -1
  48. package/dist/cdn/components/eun-image-carousel.js +10 -10
  49. package/dist/cdn/components/eun-infinite-list.js +1 -1
  50. package/dist/cdn/components/eun-input-file.js +21 -21
  51. package/dist/cdn/components/eun-input-phone.js +10 -9
  52. package/dist/cdn/components/eun-input.js +1 -1
  53. package/dist/cdn/components/eun-link.js +2 -2
  54. package/dist/cdn/components/eun-loader.js +1 -1
  55. package/dist/cdn/components/eun-modal.js +13 -13
  56. package/dist/cdn/components/eun-pagination.js +16 -16
  57. package/dist/cdn/components/eun-password-strength.js +14 -10
  58. package/dist/cdn/components/eun-radio-card.js +1 -1
  59. package/dist/cdn/components/eun-radio-list.js +11 -8
  60. package/dist/cdn/components/eun-radio.js +1 -1
  61. package/dist/cdn/components/eun-rating.js +276 -0
  62. package/dist/cdn/components/eun-scheduler-event-editor.js +10 -10
  63. package/dist/cdn/components/eun-scheduler-event.js +1 -1
  64. package/dist/cdn/components/eun-scheduler.js +28 -28
  65. package/dist/cdn/components/eun-search.js +19 -21
  66. package/dist/cdn/components/eun-select.js +27 -27
  67. package/dist/cdn/components/eun-sidebar.js +10 -8
  68. package/dist/cdn/components/eun-skeleton.js +1 -1
  69. package/dist/cdn/components/eun-slider.js +3 -3
  70. package/dist/cdn/components/eun-sliding-card.js +1 -1
  71. package/dist/cdn/components/eun-step.js +5 -4
  72. package/dist/cdn/components/eun-stepper.js +25 -25
  73. package/dist/cdn/components/eun-switch.js +1 -1
  74. package/dist/cdn/components/eun-tab-group.js +4 -4
  75. package/dist/cdn/components/eun-tab.js +1 -1
  76. package/dist/cdn/components/eun-table-action-bar.js +1 -1
  77. package/dist/cdn/components/eun-table.js +1 -1
  78. package/dist/cdn/components/eun-tag.js +3 -3
  79. package/dist/cdn/components/eun-textarea.js +39 -34
  80. package/dist/cdn/components/eun-time-picker.js +15 -14
  81. package/dist/cdn/components/eun-toast.js +19 -10
  82. package/dist/cdn/components/eun-toggle-group.js +6 -4
  83. package/dist/cdn/components/eun-toggle-item.js +1 -1
  84. package/dist/cdn/components/eun-toggle.js +2 -2
  85. package/dist/cdn/components/eun-toolbar.js +5 -5
  86. package/dist/cdn/components/eun-tooltip.js +3 -3
  87. package/dist/components/action/button/button.d.ts +2 -1
  88. package/dist/components/action/button/button.js +3 -2
  89. package/dist/components/action/button/button.styles.js +10 -5
  90. package/dist/components/action/dropdown-button/dropdown-button.js +10 -5
  91. package/dist/components/action/toggle/toggle-group.js +1 -1
  92. package/dist/components/action/toggle/toggle-group.styles.js +4 -2
  93. package/dist/components/action/toggle/toggle.js +1 -1
  94. package/dist/components/alert/alert/alert.d.ts +9 -7
  95. package/dist/components/alert/alert/alert.js +11 -14
  96. package/dist/components/alert/alert/alert.styles.js +9 -2
  97. package/dist/components/alert/drawer/drawer.d.ts +5 -5
  98. package/dist/components/alert/drawer/drawer.js +8 -12
  99. package/dist/components/alert/drawer/drawer.styles.js +1 -1
  100. package/dist/components/alert/modal/modal.d.ts +10 -10
  101. package/dist/components/alert/modal/modal.js +13 -25
  102. package/dist/components/alert/toast/toast.d.ts +7 -5
  103. package/dist/components/alert/toast/toast.js +9 -13
  104. package/dist/components/alert/toast/toast.styles.js +15 -6
  105. package/dist/components/content/badge/badge.js +2 -2
  106. package/dist/components/content/card/card.js +1 -1
  107. package/dist/components/content/card/card.styles.js +2 -2
  108. package/dist/components/content/chip/chip.d.ts +4 -4
  109. package/dist/components/content/chip/chip.js +8 -8
  110. package/dist/components/content/description-list/description-list.js +3 -3
  111. package/dist/components/content/icon/icon.d.ts +3 -0
  112. package/dist/components/content/icon/icon.js +3 -0
  113. package/dist/components/content/icon/icon.style.d.ts +2 -0
  114. package/dist/components/content/icon/icon.style.js +4 -0
  115. package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
  116. package/dist/components/content/image-carousel/image-carousel.js +24 -24
  117. package/dist/components/content/password-strength/password-strength.d.ts +21 -6
  118. package/dist/components/content/password-strength/password-strength.js +37 -16
  119. package/dist/components/content/password-strength/password-strength.styles.js +4 -0
  120. package/dist/components/content/tag/tag.js +2 -2
  121. package/dist/components/content/tooltip/tooltip.js +3 -3
  122. package/dist/components/form/checkbox/check-card.d.ts +1 -0
  123. package/dist/components/form/checkbox/check-card.js +1 -0
  124. package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
  125. package/dist/components/form/checkbox/checkbox-list.js +39 -10
  126. package/dist/components/form/checkbox/checkbox.d.ts +1 -0
  127. package/dist/components/form/checkbox/checkbox.js +3 -1
  128. package/dist/components/form/checkbox/checkbox.styles.js +3 -2
  129. package/dist/components/form/color-picker/color-picker.d.ts +41 -28
  130. package/dist/components/form/color-picker/color-picker.js +66 -50
  131. package/dist/components/form/color-picker/color-picker.styles.js +1 -1
  132. package/dist/components/form/counter/counter.d.ts +22 -18
  133. package/dist/components/form/counter/counter.js +59 -61
  134. package/dist/components/form/date-picker/date-picker.d.ts +27 -6
  135. package/dist/components/form/date-picker/date-picker.js +75 -54
  136. package/dist/components/form/input/input.d.ts +38 -39
  137. package/dist/components/form/input/input.js +85 -109
  138. package/dist/components/form/input-file/input-file.d.ts +26 -13
  139. package/dist/components/form/input-file/input-file.js +35 -35
  140. package/dist/components/form/input-file/input-file.styles.js +4 -4
  141. package/dist/components/form/input-phone/input-phone.d.ts +22 -5
  142. package/dist/components/form/input-phone/input-phone.js +41 -13
  143. package/dist/components/form/radio/radio-card.d.ts +1 -0
  144. package/dist/components/form/radio/radio-card.js +1 -0
  145. package/dist/components/form/radio/radio-list.d.ts +23 -7
  146. package/dist/components/form/radio/radio-list.js +47 -22
  147. package/dist/components/form/radio/radio.d.ts +1 -0
  148. package/dist/components/form/radio/radio.js +1 -0
  149. package/dist/components/form/rating/rating.d.ts +349 -0
  150. package/dist/components/form/rating/rating.js +665 -0
  151. package/dist/components/form/rating/rating.styles.d.ts +1 -0
  152. package/dist/components/form/rating/rating.styles.js +213 -0
  153. package/dist/components/form/search/search.d.ts +8 -8
  154. package/dist/components/form/search/search.js +23 -41
  155. package/dist/components/form/select/select.d.ts +23 -10
  156. package/dist/components/form/select/select.js +59 -41
  157. package/dist/components/form/shared-styles/listbox.styles.js +10 -0
  158. package/dist/components/form/slider/slider.d.ts +7 -8
  159. package/dist/components/form/slider/slider.js +9 -12
  160. package/dist/components/form/switch/switch.d.ts +1 -0
  161. package/dist/components/form/switch/switch.js +1 -0
  162. package/dist/components/form/textarea/textarea.d.ts +89 -23
  163. package/dist/components/form/textarea/textarea.js +192 -43
  164. package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
  165. package/dist/components/form/time-picker/time-picker-columns.js +8 -8
  166. package/dist/components/form/time-picker/time-picker.d.ts +24 -8
  167. package/dist/components/form/time-picker/time-picker.js +59 -38
  168. package/dist/components/layout/animate/animate.js +1 -1
  169. package/dist/components/layout/animate/animate.styles.js +2 -2
  170. package/dist/components/layout/divider/divider.js +1 -1
  171. package/dist/components/layout/divider/divider.styles.js +1 -1
  172. package/dist/components/loader/loader/loader.js +2 -2
  173. package/dist/components/loader/loader/loader.styles.js +14 -12
  174. package/dist/components/loader/skeleton/skeleton.js +1 -1
  175. package/dist/components/navigation/carousel/carousel.d.ts +31 -7
  176. package/dist/components/navigation/carousel/carousel.js +74 -35
  177. package/dist/components/navigation/carousel/carousel.styles.js +5 -2
  178. package/dist/components/navigation/pagination/pagination.d.ts +23 -21
  179. package/dist/components/navigation/pagination/pagination.js +30 -53
  180. package/dist/components/navigation/sidebar/sidebar.d.ts +15 -13
  181. package/dist/components/navigation/sidebar/sidebar.js +21 -33
  182. package/dist/components/navigation/sidebar/sidebar.styles.js +5 -3
  183. package/dist/components/navigation/stepper/step.js +9 -8
  184. package/dist/components/navigation/stepper/stepper.js +12 -5
  185. package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
  186. package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
  187. package/dist/components/navigation/toolbar/toolbar.d.ts +13 -13
  188. package/dist/components/navigation/toolbar/toolbar.js +20 -34
  189. package/dist/features/scheduler/calendar/calendar.js +1 -1
  190. package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
  191. package/dist/features/scheduler/scheduler/scheduler.js +15 -24
  192. package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
  193. package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
  194. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
  195. package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +6 -7
  196. package/dist/i18n/en.d.ts +68 -0
  197. package/dist/i18n/en.js +68 -0
  198. package/dist/i18n/fr.js +68 -2
  199. package/dist/index.d.ts +2 -0
  200. package/dist/index.js +1 -0
  201. package/dist/mixins/button.mixin.js +3 -2
  202. package/dist/mixins/check.mixin.js +11 -10
  203. package/dist/mixins/disabled.mixin.d.ts +5 -0
  204. package/dist/mixins/disabled.mixin.js +21 -1
  205. package/dist/mixins/editable.mixin.js +28 -5
  206. package/dist/mixins/field-appearance.mixin.js +3 -2
  207. package/dist/mixins/form.mixin.d.ts +4 -0
  208. package/dist/mixins/form.mixin.js +87 -13
  209. package/dist/mixins/localizable.mixin.d.ts +1 -1
  210. package/dist/mixins/localizable.mixin.js +1 -1
  211. package/dist/mixins/radio.mixin.js +11 -10
  212. package/dist/mixins/readonly.mixin.d.ts +2 -1
  213. package/dist/mixins/readonly.mixin.js +10 -3
  214. package/dist/ssr/alert-ssr.css +187 -0
  215. package/dist/ssr/badge-ssr.css +67 -0
  216. package/dist/ssr/breadcrumb-ssr.css +41 -0
  217. package/dist/ssr/card-ssr.css +27 -15
  218. package/dist/ssr/carousel-ssr.css +238 -0
  219. package/dist/ssr/checkbox-ssr.css +67 -0
  220. package/dist/ssr/chip-ssr.css +242 -0
  221. package/dist/ssr/collapse-ssr.css +151 -0
  222. package/dist/ssr/field-ssr.css +163 -0
  223. package/dist/ssr/icon-ssr.css +266 -0
  224. package/dist/ssr/image-carousel-ssr.css +24 -0
  225. package/dist/ssr/links-ssr.css +7 -1
  226. package/dist/ssr/pagination-ssr.css +4 -0
  227. package/dist/ssr/rating-ssr.css +254 -0
  228. package/dist/ssr/sidebar-ssr.css +9 -1
  229. package/dist/ssr/skeleton-ssr.css +63 -0
  230. package/dist/ssr/tabs-ssr.css +129 -0
  231. package/dist/ssr/toggle-group-ssr.css +182 -0
  232. package/dist/ssr/toolbar-ssr.css +31 -2
  233. package/dist/utils/implicit-submission.utils.d.ts +18 -0
  234. package/dist/utils/implicit-submission.utils.js +79 -0
  235. package/dist/utils/listbox-options.utils.d.ts +11 -0
  236. package/dist/utils/listbox-options.utils.js +41 -3
  237. package/package.json +26 -7
  238. package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
  239. package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
  240. package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
  241. package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
  242. package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
  243. package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
  244. package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
  245. package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
@@ -1,4 +1,4 @@
1
- import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunks/chunk-BRSNQMCD.js";import{b as $,c as f}from"./chunks/chunk-647ISUF4.js";import{a as n,b as g,j as y}from"./chunks/chunk-MJ4RDZLL.js";import{a as p}from"./chunks/chunk-PPCHQG7P.js";import{a,f as d,h as b,j as r,k as s,p as l,r as c,u as v}from"./chunks/chunk-YITWLCD3.js";var x=b`
1
+ import{a as k,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as L}from"./chunks/chunk-BRSNQMCD.js";import{b as D,c as f}from"./chunks/chunk-647ISUF4.js";import{a as n,b as y,j as $}from"./chunks/chunk-MJ4RDZLL.js";import{a as p}from"./chunks/chunk-PPCHQG7P.js";import{a as g}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a,f as d,h as b,j as r,k as s,p as l,r as c,u as v}from"./chunks/chunk-YITWLCD3.js";var w=b`
2
2
  :host {
3
3
  display: block;
4
4
  font-family: var(--eun-font-family, "Mulish", sans-serif);
@@ -66,7 +66,7 @@ import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunk
66
66
  #actions .spacer {
67
67
  flex: 1 1 auto;
68
68
  }
69
- `,T=x;var h=class u extends Event{static{this.eventName="eunguestinvite"}constructor(m,t){super(u.eventName,{bubbles:!0,composed:!1}),this.email=m,this.eventId=t}};var w="eun-scheduler-event-editor",C=[{name:"red",value:"#f14959"},{name:"purple",value:"#9562e3"},{name:"yellow",value:"#f0f050"},{name:"blue",value:"#3bb3b9"},{name:"green",value:"#49f15f"},{name:"pink",value:"#d05df3"}],G=["low","medium","high","critical"],P={low:"success",high:"warning",critical:"critical"},I=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=class extends v{constructor(){super(...arguments);this.hideActions=!1;this.titleLabel="Title";this.descriptionLabel="Description";this.allDayLabel="All day";this.dateLabel="Date";this.endDateLabel="End date";this.startTimeLabel="Start time";this.endTimeLabel="End time";this.locationLabel="Location";this.notesLabel="Notes";this.priorityLabel="Priority";this.colorLabel="Color";this.requiredLabel="is required";this.colorLabels={red:"Red",purple:"Purple",yellow:"Yellow",blue:"Blue",green:"Green",pink:"Pink"};this.guestsLabel="Guests";this.addGuestLabel="Add guest";this.removeGuestLabel="Remove";this.saveLabel="Save";this.cancelLabel="Cancel";this.deleteLabel="Delete";this.formTitle="";this.formDescription="";this.formAllDay=!1;this.formDate=n(new Date);this.formEndDate=n(new Date);this.formStart=null;this.formEnd=null;this.formLocation="";this.formNotes="";this.formPriority="medium";this.formColor="#3bb3b9";this.formGuests=[];this.guestInputValue="";this.guestInputError=!1;this.showErrors=!1;this.seedSnapshot="";this.handleSaveClick=()=>{this.requestSave()};this.handleCancelClick=()=>{this.seedForm()};this.handlePriorityChange=t=>{this.formPriority=t.target.value[0]};this.handleGuestInputChange=t=>{this.guestInputValue=t.target.value??"",this.guestInputError=!1};this.handleGuestInputKeydown=t=>{t.key==="Enter"&&(t.preventDefault(),this.addGuest())};this.handleAddGuestClick=()=>{this.addGuest()};this.handleRemoveGuest=t=>{this.formGuests=this.formGuests.filter(e=>e.email!==t)}}connectedCallback(){super.connectedCallback?.(),this.seedForm()}willUpdate(t){(t.has("event")||t.has("initialStart")||t.has("initialEnd"))&&this.seedForm(),super.willUpdate(t)}updated(t){super.updated(t),["formTitle","formDescription","formAllDay","formDate","formEndDate","formStart","formEnd","formLocation","formNotes","formPriority","formColor","formGuests"].some(o=>t.has(o))&&this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}seedForm(){let t=this.event;if(t)this.formTitle=t.title,this.formDescription=t.description??"",this.formAllDay=!!t.allDay,this.formDate=n(t.start),this.formEndDate=n(t.end),this.formStart=t.start,this.formEnd=t.end,this.formLocation=t.location??"",this.formNotes=t.notes??"",this.formPriority=t.priority??"medium",this.formColor=t.color,this.formGuests=t.guests?t.guests.map(e=>({...e})):[];else{let e=this.initialStart??A(new Date),o=this.initialEnd??y(e,1);this.formTitle="",this.formDescription="",this.formAllDay=!1,this.formDate=n(e),this.formEndDate=n(e),this.formStart=e,this.formEnd=o,this.formLocation="",this.formNotes="",this.formPriority="medium",this.formColor="blue",this.formGuests=[]}this.guestInputValue="",this.guestInputError=!1,this.showErrors=!1,this.seedSnapshot=this.snapshot()}snapshot(){return JSON.stringify({title:this.formTitle,description:this.formDescription,allDay:this.formAllDay,date:this.formDate.getTime(),endDate:this.formEndDate.getTime(),start:this.formStart?.getTime(),end:this.formEnd?.getTime(),location:this.formLocation,notes:this.formNotes,priority:this.formPriority,color:this.formColor,guests:this.formGuests})}get dirty(){return this.snapshot()!==this.seedSnapshot}get isEditing(){return!!this.event}composeStartEnd(){if(this.formAllDay)return{start:n(this.formDate),end:g(this.formEndDate)};if(!this.formStart||!this.formEnd)return null;let t=new Date(this.formDate);t.setHours(this.formStart.getHours(),this.formStart.getMinutes(),0,0);let e=new Date(this.formDate);return e.setHours(this.formEnd.getHours(),this.formEnd.getMinutes(),0,0),e.getTime()<=t.getTime()&&e.setDate(e.getDate()+1),{start:t,end:e}}get valid(){if(!this.formTitle.trim())return!1;let t=this.composeStartEnd();return!!t&&t.end.getTime()>t.start.getTime()}requestSave(){if(!this.valid)return this.showErrors=!0,!1;let t=this.composeStartEnd(),e={id:this.event?.id??crypto.randomUUID(),title:this.formTitle.trim(),description:this.formDescription||void 0,allDay:this.formAllDay,start:t.start,end:t.end,location:this.formLocation||void 0,notes:this.formNotes||void 0,color:this.formColor,priority:this.formPriority,guests:this.formGuests.length?this.formGuests:void 0};return this.dispatchEvent(this.event?new D(e):new L(e)),this.event=e,this.seedSnapshot=this.snapshot(),!0}requestDelete(){this.event&&this.dispatchEvent(new k(this.event.id))}addGuest(){let t=this.guestInputValue.trim();if(!t)return;if(!I.test(t)){this.guestInputError=!0;return}let e=this.formGuests.some(o=>o.email.toLowerCase()===t.toLowerCase());this.guestInputValue="",this.guestInputError=!1,!e&&(this.formGuests=[...this.formGuests,{email:t,status:"pending"}],this.dispatchEvent(new h(t,this.event?.id)))}render(){let t=this.showErrors&&!this.formTitle.trim();return l`
69
+ `,T=w;var h=class u extends Event{static{this.eventName="eunguestinvite"}constructor(m,t){super(u.eventName,{bubbles:!0,composed:!1}),this.email=m,this.eventId=t}};var C="eun-scheduler-event-editor",G=[{name:"red",value:"#f14959"},{name:"purple",value:"#9562e3"},{name:"yellow",value:"#f0f050"},{name:"blue",value:"#3bb3b9"},{name:"green",value:"#49f15f"},{name:"pink",value:"#d05df3"}],P=["low","medium","high","critical"],I={low:"success",high:"warning",critical:"critical"},A=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=class extends g(v){constructor(){super(...arguments);this.hideActions=!1;this.titleLabel="Title";this.descriptionLabel="Description";this.allDayLabel="All day";this.dateLabel="Date";this.endDateLabel="End date";this.startTimeLabel="Start time";this.endTimeLabel="End time";this.locationLabel="Location";this.notesLabel="Notes";this.priorityLabel="Priority";this.colorLabel="Color";this.requiredLabel="is required";this.colorLabels={red:"Red",purple:"Purple",yellow:"Yellow",blue:"Blue",green:"Green",pink:"Pink"};this.guestsLabel="Guests";this.addGuestLabel="Add guest";this.removeGuestLabel="Remove";this.saveLabel="Save";this.deleteLabel="Delete";this.formTitle="";this.formDescription="";this.formAllDay=!1;this.formDate=n(new Date);this.formEndDate=n(new Date);this.formStart=null;this.formEnd=null;this.formLocation="";this.formNotes="";this.formPriority="medium";this.formColor="#3bb3b9";this.formGuests=[];this.guestInputValue="";this.guestInputError=!1;this.showErrors=!1;this.seedSnapshot="";this.handleSaveClick=()=>{this.requestSave()};this.handleCancelClick=()=>{this.seedForm()};this.handlePriorityChange=t=>{this.formPriority=t.target.value[0]};this.handleGuestInputChange=t=>{this.guestInputValue=t.target.value??"",this.guestInputError=!1};this.handleGuestInputKeydown=t=>{t.key==="Enter"&&(t.preventDefault(),this.addGuest())};this.handleAddGuestClick=()=>{this.addGuest()};this.handleRemoveGuest=t=>{this.formGuests=this.formGuests.filter(e=>e.email!==t)}}connectedCallback(){super.connectedCallback?.(),this.seedForm()}willUpdate(t){(t.has("event")||t.has("initialStart")||t.has("initialEnd"))&&this.seedForm(),super.willUpdate(t)}updated(t){super.updated(t),["formTitle","formDescription","formAllDay","formDate","formEndDate","formStart","formEnd","formLocation","formNotes","formPriority","formColor","formGuests"].some(o=>t.has(o))&&this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}seedForm(){let t=this.event;if(t)this.formTitle=t.title,this.formDescription=t.description??"",this.formAllDay=!!t.allDay,this.formDate=n(t.start),this.formEndDate=n(t.end),this.formStart=t.start,this.formEnd=t.end,this.formLocation=t.location??"",this.formNotes=t.notes??"",this.formPriority=t.priority??"medium",this.formColor=t.color,this.formGuests=t.guests?t.guests.map(e=>({...e})):[];else{let e=this.initialStart??N(new Date),o=this.initialEnd??$(e,1);this.formTitle="",this.formDescription="",this.formAllDay=!1,this.formDate=n(e),this.formEndDate=n(e),this.formStart=e,this.formEnd=o,this.formLocation="",this.formNotes="",this.formPriority="medium",this.formColor="blue",this.formGuests=[]}this.guestInputValue="",this.guestInputError=!1,this.showErrors=!1,this.seedSnapshot=this.snapshot()}snapshot(){return JSON.stringify({title:this.formTitle,description:this.formDescription,allDay:this.formAllDay,date:this.formDate.getTime(),endDate:this.formEndDate.getTime(),start:this.formStart?.getTime(),end:this.formEnd?.getTime(),location:this.formLocation,notes:this.formNotes,priority:this.formPriority,color:this.formColor,guests:this.formGuests})}get dirty(){return this.snapshot()!==this.seedSnapshot}get isEditing(){return!!this.event}composeStartEnd(){if(this.formAllDay)return{start:n(this.formDate),end:y(this.formEndDate)};if(!this.formStart||!this.formEnd)return null;let t=new Date(this.formDate);t.setHours(this.formStart.getHours(),this.formStart.getMinutes(),0,0);let e=new Date(this.formDate);return e.setHours(this.formEnd.getHours(),this.formEnd.getMinutes(),0,0),e.getTime()<=t.getTime()&&e.setDate(e.getDate()+1),{start:t,end:e}}get valid(){if(!this.formTitle.trim())return!1;let t=this.composeStartEnd();return!!t&&t.end.getTime()>t.start.getTime()}requestSave(){if(!this.valid)return this.showErrors=!0,!1;let t=this.composeStartEnd(),e={id:this.event?.id??crypto.randomUUID(),title:this.formTitle.trim(),description:this.formDescription||void 0,allDay:this.formAllDay,start:t.start,end:t.end,location:this.formLocation||void 0,notes:this.formNotes||void 0,color:this.formColor,priority:this.formPriority,guests:this.formGuests.length?this.formGuests:void 0};return this.dispatchEvent(this.event?new L(e):new k(e)),this.event=e,this.seedSnapshot=this.snapshot(),!0}requestDelete(){this.event&&this.dispatchEvent(new x(this.event.id))}addGuest(){let t=this.guestInputValue.trim();if(!t)return;if(!A.test(t)){this.guestInputError=!0;return}let e=this.formGuests.some(o=>o.email.toLowerCase()===t.toLowerCase());this.guestInputValue="",this.guestInputError=!1,!e&&(this.formGuests=[...this.formGuests,{email:t,status:"pending"}],this.dispatchEvent(new h(t,this.event?.id)))}render(){let t=this.showErrors&&!this.formTitle.trim();return l`
70
70
  <div id="fields">
71
71
  <eun-input
72
72
  label=${this.titleLabel}
@@ -185,9 +185,9 @@ import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunk
185
185
  >
186
186
  <eun-chip
187
187
  appearance="outline"
188
- icon=${$[e.status]}
188
+ icon=${D[e.status]}
189
189
  .severity=${f[e.status]}
190
- .ariaLabelRemove=${this.removeGuestLabel}
190
+ .removeLabel=${this.removeGuestLabel}
191
191
  @eunclose=${()=>this.handleRemoveGuest(e.email)}
192
192
  >
193
193
  ${e.email}
@@ -215,12 +215,12 @@ import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunk
215
215
  .value=${[this.formPriority]}
216
216
  @eunchange=${this.handlePriorityChange}
217
217
  >
218
- ${G.map(e=>l`
218
+ ${P.map(e=>l`
219
219
  <eun-toggle-item
220
220
  value=${e}
221
- color=${p(P[e])}
221
+ color=${p(I[e])}
222
222
  >
223
- ${N(e)}
223
+ ${R(e)}
224
224
  </eun-toggle-item>
225
225
  `)}
226
226
  </eun-toggle-group>
@@ -233,7 +233,7 @@ import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunk
233
233
  .value=${this.formColor}
234
234
  @eunchange=${e=>{this.formColor=e.target.value}}
235
235
  >
236
- ${C.map(e=>l`
236
+ ${G.map(e=>l`
237
237
  <option value=${e.value}>
238
238
  ${this.colorLabels[e.name]}
239
239
  </option>
@@ -250,11 +250,11 @@ import{a as L,b as k}from"./chunks/chunk-IKAZYVB7.js";import{a as D}from"./chunk
250
250
  `:c}
251
251
  <span class="spacer"></span>
252
252
  <eun-button appearance="ghost" @click=${this.handleCancelClick}>
253
- ${this.cancelLabel}
253
+ ${this.cancelLabel??this.dictionary.common.cancel}
254
254
  </eun-button>
255
255
  <eun-button color="primary" @click=${this.handleSaveClick}>
256
256
  ${this.saveLabel}
257
257
  </eun-button>
258
258
  </div>
259
259
  `}
260
- `}};i.styles=T,a([r({attribute:!1})],i.prototype,"event",2),a([r({attribute:!1})],i.prototype,"initialStart",2),a([r({attribute:!1})],i.prototype,"initialEnd",2),a([r()],i.prototype,"locale",2),a([r({type:Boolean,attribute:"hide-actions"})],i.prototype,"hideActions",2),a([r({attribute:"title-label"})],i.prototype,"titleLabel",2),a([r({attribute:"description-label"})],i.prototype,"descriptionLabel",2),a([r({attribute:"all-day-label"})],i.prototype,"allDayLabel",2),a([r({attribute:"date-label"})],i.prototype,"dateLabel",2),a([r({attribute:"end-date-label"})],i.prototype,"endDateLabel",2),a([r({attribute:"start-time-label"})],i.prototype,"startTimeLabel",2),a([r({attribute:"end-time-label"})],i.prototype,"endTimeLabel",2),a([r({attribute:"location-label"})],i.prototype,"locationLabel",2),a([r({attribute:"notes-label"})],i.prototype,"notesLabel",2),a([r({attribute:"priority-label"})],i.prototype,"priorityLabel",2),a([r({attribute:"color-label"})],i.prototype,"colorLabel",2),a([r({attribute:"required-label"})],i.prototype,"requiredLabel",2),a([r({attribute:!1})],i.prototype,"colorLabels",2),a([r({attribute:"guests-label"})],i.prototype,"guestsLabel",2),a([r({attribute:"add-guest-label"})],i.prototype,"addGuestLabel",2),a([r({attribute:"remove-guest-label"})],i.prototype,"removeGuestLabel",2),a([r({attribute:"save-label"})],i.prototype,"saveLabel",2),a([r({attribute:"cancel-label"})],i.prototype,"cancelLabel",2),a([r({attribute:"delete-label"})],i.prototype,"deleteLabel",2),a([s()],i.prototype,"formTitle",2),a([s()],i.prototype,"formDescription",2),a([s()],i.prototype,"formAllDay",2),a([s()],i.prototype,"formDate",2),a([s()],i.prototype,"formEndDate",2),a([s()],i.prototype,"formStart",2),a([s()],i.prototype,"formEnd",2),a([s()],i.prototype,"formLocation",2),a([s()],i.prototype,"formNotes",2),a([s()],i.prototype,"formPriority",2),a([s()],i.prototype,"formColor",2),a([s()],i.prototype,"formGuests",2),a([s()],i.prototype,"guestInputValue",2),a([s()],i.prototype,"guestInputError",2),a([s()],i.prototype,"showErrors",2),i=a([d(w)],i);function A(u){let m=new Date(u);return m.setHours(m.getHours()+1,0,0,0),m}function N(u){return u.charAt(0).toUpperCase()+u.slice(1)}export{i as EunomiaSchedulerEventEditor,w as EunomiaSchedulerEventEditorTagName};
260
+ `}};i.styles=T,a([r({attribute:!1})],i.prototype,"event",2),a([r({attribute:!1})],i.prototype,"initialStart",2),a([r({attribute:!1})],i.prototype,"initialEnd",2),a([r()],i.prototype,"locale",2),a([r({type:Boolean,attribute:"hide-actions"})],i.prototype,"hideActions",2),a([r({attribute:"title-label"})],i.prototype,"titleLabel",2),a([r({attribute:"description-label"})],i.prototype,"descriptionLabel",2),a([r({attribute:"all-day-label"})],i.prototype,"allDayLabel",2),a([r({attribute:"date-label"})],i.prototype,"dateLabel",2),a([r({attribute:"end-date-label"})],i.prototype,"endDateLabel",2),a([r({attribute:"start-time-label"})],i.prototype,"startTimeLabel",2),a([r({attribute:"end-time-label"})],i.prototype,"endTimeLabel",2),a([r({attribute:"location-label"})],i.prototype,"locationLabel",2),a([r({attribute:"notes-label"})],i.prototype,"notesLabel",2),a([r({attribute:"priority-label"})],i.prototype,"priorityLabel",2),a([r({attribute:"color-label"})],i.prototype,"colorLabel",2),a([r({attribute:"required-label"})],i.prototype,"requiredLabel",2),a([r({attribute:!1})],i.prototype,"colorLabels",2),a([r({attribute:"guests-label"})],i.prototype,"guestsLabel",2),a([r({attribute:"add-guest-label"})],i.prototype,"addGuestLabel",2),a([r({attribute:"remove-guest-label"})],i.prototype,"removeGuestLabel",2),a([r({attribute:"save-label"})],i.prototype,"saveLabel",2),a([r({attribute:"cancel-label"})],i.prototype,"cancelLabel",2),a([r({attribute:"delete-label"})],i.prototype,"deleteLabel",2),a([s()],i.prototype,"formTitle",2),a([s()],i.prototype,"formDescription",2),a([s()],i.prototype,"formAllDay",2),a([s()],i.prototype,"formDate",2),a([s()],i.prototype,"formEndDate",2),a([s()],i.prototype,"formStart",2),a([s()],i.prototype,"formEnd",2),a([s()],i.prototype,"formLocation",2),a([s()],i.prototype,"formNotes",2),a([s()],i.prototype,"formPriority",2),a([s()],i.prototype,"formColor",2),a([s()],i.prototype,"formGuests",2),a([s()],i.prototype,"guestInputValue",2),a([s()],i.prototype,"guestInputError",2),a([s()],i.prototype,"showErrors",2),i=a([d(C)],i);function N(u){let m=new Date(u);return m.setHours(m.getHours()+1,0,0,0),m}function R(u){return u.charAt(0).toUpperCase()+u.slice(1)}export{i as EunomiaSchedulerEventEditor,C as EunomiaSchedulerEventEditorTagName};
@@ -1 +1 @@
1
- import{a,b}from"./chunks/chunk-QZ5SHR3I.js";import"./chunks/chunk-647ISUF4.js";import"./chunks/chunk-MJ4RDZLL.js";import"./chunks/chunk-YITWLCD3.js";export{b as EunomiaSchedulerEventCard,a as EunomiaSchedulerEventCardTagName};
1
+ import{a,b}from"./chunks/chunk-J3SZBXM6.js";import"./chunks/chunk-647ISUF4.js";import"./chunks/chunk-MJ4RDZLL.js";import"./chunks/chunk-YITWLCD3.js";export{b as EunomiaSchedulerEventCard,a as EunomiaSchedulerEventCardTagName};
@@ -1,4 +1,4 @@
1
- import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunks/chunk-LK5BJ4SH.js";import{b as O,c as $}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-IJJ67C66.js";import{a as w}from"./chunks/chunk-BRSNQMCD.js";import{a as P,b as M,d as y,e as T,f as S}from"./chunks/chunk-647ISUF4.js";import{j as E}from"./chunks/chunk-MJ4RDZLL.js";import{b as k}from"./chunks/chunk-BKZGTCMF.js";import{a as c}from"./chunks/chunk-PPCHQG7P.js";import{a as C}from"./chunks/chunk-LMVW522V.js";import"./chunks/chunk-KSZRQRN4.js";import{a as i,f as L,h as g,j as o,k as p,l as h,p as s,r as d,u as D}from"./chunks/chunk-YITWLCD3.js";var j=g`
1
+ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunks/chunk-LK5BJ4SH.js";import{b as O,c as $}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-IJJ67C66.js";import{a as w}from"./chunks/chunk-BRSNQMCD.js";import{a as M,b as P,d as y,e as T,f as S}from"./chunks/chunk-647ISUF4.js";import{j as E}from"./chunks/chunk-MJ4RDZLL.js";import{b as C}from"./chunks/chunk-BKZGTCMF.js";import{a as c}from"./chunks/chunk-PPCHQG7P.js";import{a as k}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as i,f as D,h as g,j as o,k as p,l as h,p as s,r as d,u as L}from"./chunks/chunk-YITWLCD3.js";var j=g`
2
2
  :host {
3
3
  display: block;
4
4
  box-sizing: border-box;
@@ -128,7 +128,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
128
128
  clip: rect(0 0 0 0);
129
129
  white-space: nowrap;
130
130
  }
131
- `,N=j;var U=g`
131
+ `,V=j;var U=g`
132
132
  #event-popover {
133
133
  box-sizing: border-box;
134
134
  width: var(--scheduler-popover-width, 300px);
@@ -251,10 +251,10 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
251
251
  gap: var(--eun-space-s, 8px);
252
252
  padding: 0 var(--eun-space-m, 16px) var(--eun-space-m, 16px);
253
253
  }
254
- `,V=U;function _(l){let{event:a,locale:e,editLabel:n,deleteLabel:r,closeLabel:u,priorityLabels:v,readonly:m,onEdit:b,onDelete:Q,onClose:I}=l;return s`
254
+ `,_=U;function N(l){let{event:n,locale:e,editLabel:a,deleteLabel:r,closeLabel:u,priorityLabels:v,readonly:m,onEdit:b,onDelete:Q,onClose:I}=l;return s`
255
255
  <div
256
256
  class="event-popover-bar"
257
- style="--_accent: var(--eun-color-${a.color}-600);"
257
+ style="--_accent: var(--eun-color-${n.color}-600);"
258
258
  ></div>
259
259
  <eun-button
260
260
  id="event-popover-close"
@@ -267,49 +267,49 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
267
267
  <eun-icon name="close" size="16"></eun-icon>
268
268
  </eun-button>
269
269
  <div class="event-popover-body">
270
- <h3 class="event-popover-title">${a.title}</h3>
270
+ <h3 class="event-popover-title">${n.title}</h3>
271
271
  <div class="event-popover-row">
272
272
  <eun-icon name="schedule" size="16"></eun-icon>
273
- <span>${B(a,e)}</span>
273
+ <span>${B(n,e)}</span>
274
274
  </div>
275
- ${a.location?s`
275
+ ${n.location?s`
276
276
  <div class="event-popover-row">
277
277
  <eun-icon name="location_on" size="16"></eun-icon>
278
- <span>${a.location}</span>
278
+ <span>${n.location}</span>
279
279
  </div>
280
280
  `:d}
281
- ${a.description?s`
281
+ ${n.description?s`
282
282
  <div class="event-popover-row">
283
283
  <eun-icon name="description" size="16"></eun-icon>
284
- <span>${a.description}</span>
284
+ <span>${n.description}</span>
285
285
  </div>
286
286
  `:d}
287
- ${a.notes?s`
287
+ ${n.notes?s`
288
288
  <div class="event-popover-row">
289
289
  <eun-icon name="notes" size="16"></eun-icon>
290
- <span>${a.notes}</span>
290
+ <span>${n.notes}</span>
291
291
  </div>
292
292
  `:d}
293
- ${a.priority?s`
293
+ ${n.priority?s`
294
294
  <div class="event-popover-row">
295
295
  <eun-icon name="priority_high" size="16"></eun-icon>
296
296
  <eun-tag
297
297
  size="s"
298
298
  hide-icon
299
299
  color="primary"
300
- .severity=${P[a.priority]}
301
- >${v[a.priority]??a.priority}</eun-tag
300
+ .severity=${M[n.priority]}
301
+ >${v[n.priority]??n.priority}</eun-tag
302
302
  >
303
303
  </div>
304
304
  `:d}
305
- ${a.guests&&a.guests.length>0?s`
305
+ ${n.guests&&n.guests.length>0?s`
306
306
  <div class="event-popover-row">
307
307
  <eun-icon name="group" size="16"></eun-icon>
308
308
  <ul class="event-popover-guests">
309
- ${a.guests.map(f=>s`
309
+ ${n.guests.map(f=>s`
310
310
  <li class="event-popover-guest" data-status=${f.status}>
311
311
  <eun-icon
312
- name=${M[f.status]}
312
+ name=${P[f.status]}
313
313
  size="14"
314
314
  aria-hidden="true"
315
315
  ></eun-icon>
@@ -331,16 +331,16 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
331
331
  >${r}</eun-button
332
332
  >
333
333
  <eun-button color="primary" size="s" rounded @click=${b}
334
- >${n}</eun-button
334
+ >${a}</eun-button
335
335
  >
336
336
  </div>
337
337
  `}
338
- `}function B(l,a){let e={weekday:"long",day:"numeric",month:"long"};if(S(l)){let v=l.start.toLocaleDateString(a,e),m=l.end.toLocaleDateString(a,e),b=v===m?v:`${v} \u2013 ${m}`;return l.allDay?`All day \xB7 ${b}`:b}let n=l.start.toLocaleDateString(a,e),r=l.start.toLocaleTimeString(a,{hour:"numeric",minute:"2-digit"}),u=l.end.toLocaleTimeString(a,{hour:"numeric",minute:"2-digit"});return`${n} \xB7 ${r} \u2013 ${u}`}var q="eun-scheduler",R=["day","week","work-week","month","year"],t=class extends C(z(D)){constructor(){super(...arguments);this.events=[];this.view="week";this.displayedDate=new Date;this.weekStartsOn=1;this.dayStartHour=0;this.dayEndHour=24;this.slotDuration=30;this.readonly=!1;this.noAnimation=!1;this.todayLabel="Today";this.newEventLabel="New event";this.ariaLabelPrevious="Previous period";this.ariaLabelNext="Next period";this.viewDayLabel="Day";this.viewWeekLabel="Week";this.viewWorkWeekLabel="Work week";this.viewMonthLabel="Month";this.viewYearLabel="Year";this.applyLabel="Apply";this.cancelLabel="Cancel";this.deleteLabel="Delete";this.editLabel="Edit";this.closeLabel="Close";this.moreEventsLabel="+{count} more";this.eventAppearance="default";this.isDrawerOpen=!1;this.isModalOpen=!1;this.editingEvent=null;this.createStart=W(new Date);this.createEnd=E(this.createStart,1);this.editorDirty=!1;this.isMobile=!1;this.selectedEvent=null;this.handleMobileMediaChange=e=>{this.isMobile=e.matches};this.handleToday=()=>{this.displayedDate=new Date};this.handlePrevious=()=>this.navigate(-1);this.handleNext=()=>this.navigate(1);this.handleViewChange=e=>{let[n]=e.target.value;n&&(this.view=n)};this.handleMobileViewSelect=e=>{this.view=e.key};this.handleCalendarPeriodChange=()=>{this.calendarEl&&(this.view=this.calendarEl.view,this.displayedDate=this.calendarEl.displayedDate)};this.handleCalendarEventClick=e=>{this.openEventPopover(e.event,e.anchor)};this.handleCalendarSlotClick=e=>{this.openCreateEditor(e.start)};this.handleEventPopoverToggle=e=>{if(e.newState==="open"){this.popoverTriggerEl&&this.eventPopoverEl&&(this.anchorFloatingElement(this.popoverTriggerEl,this.eventPopoverEl,{axis:"horizontal",forceFallback:!0}),this.observeAnchorVisibility(this.popoverTriggerEl,()=>this.closeEventPopover()));return}this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.popoverTriggerEl?.focus(),this.popoverTriggerEl=void 0};this.handlePopoverEdit=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.openEditEditor(e)};this.handlePopoverDelete=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.dispatchEvent(new x(e.id))};this.handlePopoverClose=()=>{this.closeEventPopover()};this.handleEditorCreate=e=>{this.dispatchEvent(new H(e.event)),this.closeEditor()};this.handleEditorUpdate=e=>{this.dispatchEvent(new w(e.event)),this.closeEditor()};this.handleCalendarEventMove=e=>{this.dispatchEvent(new w(e.event))};this.handleEditorDelete=e=>{this.dispatchEvent(new x(e.eventId)),this.closeEditor()};this.handleEditorInput=()=>{this.editorDirty=this.drawerEditorEl?.dirty??!1};this.handleDrawerSave=()=>{this.drawerEditorEl?.requestSave()};this.handleDrawerCancel=()=>{this.closeEditor()};this.handleDrawerDelete=()=>{this.drawerEditorEl?.requestDelete()};this.handleModalSave=()=>{this.modalEditorEl?.requestSave()};this.handleModalDelete=()=>{this.modalEditorEl?.requestDelete()};this.handleModalCancel=()=>{this.closeEditor()}}updated(e){if(super.updated(e),e.has("view")||e.has("displayedDate")||e.has("weekStartsOn")){let n=y(this.view,this.displayedDate,this.weekStartsOn);this.dispatchEvent(new A(this.view,n.start,n.end))}}updateMobileMediaQuery(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),this.mobileMediaQuery=window.matchMedia(k("tablet")),this.mobileMediaQuery.addEventListener("change",this.handleMobileMediaChange),this.isMobile=this.mobileMediaQuery.matches}connectedCallback(){super.connectedCallback?.(),this.updateMobileMediaQuery()}disconnectedCallback(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),super.disconnectedCallback?.()}navigate(e){this.displayedDate=T(this.view,this.displayedDate,e)}openCreateEditor(e){this.readonly||(this.editingEvent=null,this.createStart=e,this.createEnd=E(e,1),this.openEditorSurface())}openEditEditor(e){this.readonly||(this.editingEvent=e,this.openEditorSurface())}openEventPopover(e,n){this.selectedEvent=e,this.popoverTriggerEl=n,this.updateComplete.then(()=>{let r=this.eventPopoverEl;if(!r)return;let u=this.eventPopoverAnimation!==void 0;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0;let v=!r.matches(":popover-open");v&&r.showPopover(),(v||u)&&this.playEventPopoverOpenAnimation(r)})}eventPopoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:O(e,"--scheduler-popover-transition-duration","s",160)}playEventPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let n=this.eventPopoverAnimationDuration(e);n!==0&&(this.eventPopoverAnimation=e.animate([{opacity:0,transform:"scale(0.98)"},{opacity:1,transform:"scale(1)"}],{duration:n,easing:$(e),fill:"forwards"}))}closeEventPopover(){let e=this.eventPopoverEl;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0,e?.matches(":popover-open")&&this.playEventPopoverCloseAnimation(e)}playEventPopoverCloseAnimation(e){e.style.pointerEvents="none";let n=this.eventPopoverAnimationDuration(e);if(n===0){e.hidePopover();return}let r=e.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:n,easing:$(e),fill:"forwards"});this.eventPopoverAnimation=r,r.finished.then(()=>{this.eventPopoverAnimation===r&&(this.eventPopoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}openEditorSurface(){this.editorDirty=!1,this.isMobile?this.isModalOpen=!0:this.isDrawerOpen=!0}closeEditor(){this.isDrawerOpen=!1,this.isModalOpen=!1,this.editingEvent=null,this.editorDirty=!1}renderNavArrows(){return s`
338
+ `}function B(l,n){let e={weekday:"long",day:"numeric",month:"long"};if(S(l)){let v=l.start.toLocaleDateString(n,e),m=l.end.toLocaleDateString(n,e),b=v===m?v:`${v} \u2013 ${m}`;return l.allDay?`All day \xB7 ${b}`:b}let a=l.start.toLocaleDateString(n,e),r=l.start.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit"}),u=l.end.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit"});return`${a} \xB7 ${r} \u2013 ${u}`}var q="eun-scheduler",R=["day","week","work-week","month","year"],t=class extends k(z(L)){constructor(){super(...arguments);this.events=[];this.view="week";this.displayedDate=new Date;this.weekStartsOn=1;this.dayStartHour=0;this.dayEndHour=24;this.slotDuration=30;this.readonly=!1;this.noAnimation=!1;this.todayLabel="Today";this.newEventLabel="New event";this.viewDayLabel="Day";this.viewWeekLabel="Week";this.viewWorkWeekLabel="Work week";this.viewMonthLabel="Month";this.viewYearLabel="Year";this.applyLabel="Apply";this.deleteLabel="Delete";this.editLabel="Edit";this.moreEventsLabel="+{count} more";this.eventAppearance="default";this.isDrawerOpen=!1;this.isModalOpen=!1;this.editingEvent=null;this.createStart=W(new Date);this.createEnd=E(this.createStart,1);this.editorDirty=!1;this.isMobile=!1;this.selectedEvent=null;this.handleMobileMediaChange=e=>{this.isMobile=e.matches};this.handleToday=()=>{this.displayedDate=new Date};this.handlePrevious=()=>this.navigate(-1);this.handleNext=()=>this.navigate(1);this.handleViewChange=e=>{let[a]=e.target.value;a&&(this.view=a)};this.handleMobileViewSelect=e=>{this.view=e.key};this.handleCalendarPeriodChange=()=>{this.calendarEl&&(this.view!==this.calendarEl.view&&(this.view=this.calendarEl.view),this.displayedDate=this.calendarEl.displayedDate)};this.handleCalendarEventClick=e=>{this.openEventPopover(e.event,e.anchor)};this.handleCalendarSlotClick=e=>{this.openCreateEditor(e.start)};this.handleEventPopoverToggle=e=>{if(e.newState==="open"){this.popoverTriggerEl&&this.eventPopoverEl&&(this.anchorFloatingElement(this.popoverTriggerEl,this.eventPopoverEl,{axis:"horizontal",forceFallback:!0}),this.observeAnchorVisibility(this.popoverTriggerEl,()=>this.closeEventPopover()));return}this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.popoverTriggerEl?.focus(),this.popoverTriggerEl=void 0};this.handlePopoverEdit=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.openEditEditor(e)};this.handlePopoverDelete=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.dispatchEvent(new x(e.id))};this.handlePopoverClose=()=>{this.closeEventPopover()};this.handleEditorCreate=e=>{this.dispatchEvent(new H(e.event)),this.closeEditor()};this.handleEditorUpdate=e=>{this.dispatchEvent(new w(e.event)),this.closeEditor()};this.handleCalendarEventMove=e=>{this.dispatchEvent(new w(e.event))};this.handleEditorDelete=e=>{this.dispatchEvent(new x(e.eventId)),this.closeEditor()};this.handleEditorInput=()=>{this.editorDirty=this.drawerEditorEl?.dirty??!1};this.handleDrawerSave=()=>{this.drawerEditorEl?.requestSave()};this.handleDrawerCancel=()=>{this.closeEditor()};this.handleDrawerDelete=()=>{this.drawerEditorEl?.requestDelete()};this.handleModalSave=()=>{this.modalEditorEl?.requestSave()};this.handleModalDelete=()=>{this.modalEditorEl?.requestDelete()};this.handleModalCancel=()=>{this.closeEditor()}}updated(e){if(super.updated(e),e.has("view")||e.has("displayedDate")||e.has("weekStartsOn")){let a=y(this.view,this.displayedDate,this.weekStartsOn);this.dispatchEvent(new A(this.view,a.start,a.end))}}updateMobileMediaQuery(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),this.mobileMediaQuery=window.matchMedia(C("tablet")),this.mobileMediaQuery.addEventListener("change",this.handleMobileMediaChange),this.isMobile=this.mobileMediaQuery.matches}connectedCallback(){super.connectedCallback?.(),this.updateMobileMediaQuery()}disconnectedCallback(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),super.disconnectedCallback?.()}navigate(e){this.displayedDate=T(this.view,this.displayedDate,e)}openCreateEditor(e){this.readonly||(this.editingEvent=null,this.createStart=e,this.createEnd=E(e,1),this.openEditorSurface())}openEditEditor(e){this.readonly||(this.editingEvent=e,this.openEditorSurface())}openEventPopover(e,a){this.selectedEvent=e,this.popoverTriggerEl=a,this.updateComplete.then(()=>{let r=this.eventPopoverEl;if(!r)return;let u=this.eventPopoverAnimation!==void 0;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0;let v=!r.matches(":popover-open");v&&r.showPopover(),(v||u)&&this.playEventPopoverOpenAnimation(r)})}eventPopoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:O(e,"--scheduler-popover-transition-duration","s",160)}playEventPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let a=this.eventPopoverAnimationDuration(e);a!==0&&(this.eventPopoverAnimation=e.animate([{opacity:0,transform:"scale(0.98)"},{opacity:1,transform:"scale(1)"}],{duration:a,easing:$(e),fill:"forwards"}))}closeEventPopover(){let e=this.eventPopoverEl;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0,e?.matches(":popover-open")&&this.playEventPopoverCloseAnimation(e)}playEventPopoverCloseAnimation(e){e.style.pointerEvents="none";let a=this.eventPopoverAnimationDuration(e);if(a===0){e.hidePopover();return}let r=e.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:a,easing:$(e),fill:"forwards"});this.eventPopoverAnimation=r,r.finished.then(()=>{this.eventPopoverAnimation===r&&(this.eventPopoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}openEditorSurface(){this.editorDirty=!1,this.isMobile?this.isModalOpen=!0:this.isDrawerOpen=!0}closeEditor(){this.isDrawerOpen=!1,this.isModalOpen=!1,this.editingEvent=null,this.editorDirty=!1}renderNavArrows(){return s`
339
339
  <div id="header-nav-arrows">
340
340
  <eun-button
341
341
  appearance="ghost"
342
342
  size="s"
343
- aria-label=${this.ariaLabelPrevious}
343
+ aria-label=${this.previousLabel??this.dictionary.scheduler.previous}
344
344
  @click=${this.handlePrevious}
345
345
  >
346
346
  <eun-icon name="chevron_left" size="18"></eun-icon>
@@ -351,7 +351,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
351
351
  <eun-button
352
352
  appearance="ghost"
353
353
  size="s"
354
- aria-label=${this.ariaLabelNext}
354
+ aria-label=${this.nextLabel??this.dictionary.scheduler.next}
355
355
  @click=${this.handleNext}
356
356
  >
357
357
  <eun-icon name="chevron_right" size="18"></eun-icon>
@@ -386,7 +386,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
386
386
  appearance="flat"
387
387
  size="s"
388
388
  label=${this.viewLabel(this.view)}
389
- .options=${R.map(n=>({key:n,label:this.viewLabel(n)}))}
389
+ .options=${R.map(a=>({key:a,label:this.viewLabel(a)}))}
390
390
  @eunselect=${this.handleMobileViewSelect}
391
391
  ></eun-dropdown-button>
392
392
  </div>
@@ -395,7 +395,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
395
395
  <eun-toggle-group
396
396
  single
397
397
  aria-label=${this.dictionary.scheduler.calendarView}
398
- .options=${R.map(n=>({label:this.viewLabel(n),value:n}))}
398
+ .options=${R.map(a=>({label:this.viewLabel(a),value:a}))}
399
399
  .value=${[this.view]}
400
400
  @eunchange=${this.handleViewChange}
401
401
  ></eun-toggle-group>
@@ -452,7 +452,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
452
452
  >`:d}
453
453
  <span style="flex: 1 1 auto;"></span>
454
454
  <eun-button appearance="ghost" @click=${this.handleDrawerCancel}
455
- >${this.cancelLabel}</eun-button
455
+ >${this.cancelLabel??this.dictionary.common.cancel}</eun-button
456
456
  >
457
457
  <eun-button color="primary" @click=${this.handleDrawerSave}
458
458
  >${this.applyLabel}</eun-button
@@ -483,7 +483,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
483
483
  >`:d}
484
484
  <span style="flex: 1 1 auto;"></span>
485
485
  <eun-button color="secondary" @click=${this.handleModalCancel}
486
- >${this.cancelLabel}</eun-button
486
+ >${this.cancelLabel??this.dictionary.common.cancel}</eun-button
487
487
  >
488
488
  <eun-button color="primary" @click=${this.handleModalSave}
489
489
  >${this.applyLabel}</eun-button
@@ -492,6 +492,6 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
492
492
  </eun-modal>
493
493
 
494
494
  <div id="event-popover" popover @toggle=${this.handleEventPopoverToggle}>
495
- ${this.selectedEvent?_({event:this.selectedEvent,locale:this.locale,editLabel:this.editLabel,deleteLabel:this.deleteLabel,closeLabel:this.closeLabel,priorityLabels:{low:"Low",medium:"Medium",high:"High",critical:"Critical"},readonly:this.readonly,onEdit:this.handlePopoverEdit,onDelete:this.handlePopoverDelete,onClose:this.handlePopoverClose}):d}
495
+ ${this.selectedEvent?N({event:this.selectedEvent,locale:this.locale,editLabel:this.editLabel,deleteLabel:this.deleteLabel,closeLabel:this.closeLabel??this.dictionary.common.close,priorityLabels:{low:"Low",medium:"Medium",high:"High",critical:"Critical"},readonly:this.readonly,onEdit:this.handlePopoverEdit,onDelete:this.handlePopoverDelete,onClose:this.handlePopoverClose}):d}
496
496
  </div>
497
- `}viewLabel(e){switch(e){case"day":return this.viewDayLabel;case"week":return this.viewWeekLabel;case"work-week":return this.viewWorkWeekLabel;case"month":return this.viewMonthLabel;case"year":return this.viewYearLabel;default:return e}}};t.styles=[N,V],i([o({attribute:!1})],t.prototype,"events",2),i([o({reflect:!0})],t.prototype,"view",2),i([o({attribute:!1})],t.prototype,"displayedDate",2),i([o({type:Number,attribute:"week-starts-on"})],t.prototype,"weekStartsOn",2),i([o({type:Number,attribute:"day-start-hour"})],t.prototype,"dayStartHour",2),i([o({type:Number,attribute:"day-end-hour"})],t.prototype,"dayEndHour",2),i([o({type:Number,attribute:"slot-duration"})],t.prototype,"slotDuration",2),i([o({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([o({type:Boolean,reflect:!0,attribute:"no-animation"})],t.prototype,"noAnimation",2),i([o({attribute:"today-label"})],t.prototype,"todayLabel",2),i([o({attribute:"new-event-label"})],t.prototype,"newEventLabel",2),i([o({attribute:"aria-label-previous"})],t.prototype,"ariaLabelPrevious",2),i([o({attribute:"aria-label-next"})],t.prototype,"ariaLabelNext",2),i([o({attribute:"view-day-label"})],t.prototype,"viewDayLabel",2),i([o({attribute:"view-week-label"})],t.prototype,"viewWeekLabel",2),i([o({attribute:"view-work-week-label"})],t.prototype,"viewWorkWeekLabel",2),i([o({attribute:"view-month-label"})],t.prototype,"viewMonthLabel",2),i([o({attribute:"view-year-label"})],t.prototype,"viewYearLabel",2),i([o({attribute:"apply-label"})],t.prototype,"applyLabel",2),i([o({attribute:"cancel-label"})],t.prototype,"cancelLabel",2),i([o({attribute:"delete-label"})],t.prototype,"deleteLabel",2),i([o({attribute:"edit-label"})],t.prototype,"editLabel",2),i([o({attribute:"close-label"})],t.prototype,"closeLabel",2),i([o({attribute:"more-events-label"})],t.prototype,"moreEventsLabel",2),i([o({attribute:"event-appearance"})],t.prototype,"eventAppearance",2),i([p()],t.prototype,"isDrawerOpen",2),i([p()],t.prototype,"isModalOpen",2),i([p()],t.prototype,"editingEvent",2),i([p()],t.prototype,"createStart",2),i([p()],t.prototype,"createEnd",2),i([p()],t.prototype,"editorDirty",2),i([p()],t.prototype,"isMobile",2),i([h("#editor")],t.prototype,"drawerEditorEl",2),i([h("#editor-mobile")],t.prototype,"modalEditorEl",2),i([p()],t.prototype,"selectedEvent",2),i([h("#event-popover")],t.prototype,"eventPopoverEl",2),i([h("#calendar")],t.prototype,"calendarEl",2),t=i([L(q)],t);function W(l){let a=new Date(l);return a.setHours(a.getHours()+1,0,0,0),a}function F(l,a,e,n,r){switch(l){case"day":return e.toLocaleDateString(r,{weekday:"long",day:"numeric",month:"long",year:"numeric"});case"year":return String(a.getFullYear());case"month":return a.toLocaleDateString(r,{month:"long",year:"numeric"});default:return`${e.toLocaleDateString(r,{day:"numeric",month:"short"})} \u2013 ${n.toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric"})}`}}export{t as EunomiaScheduler,q as EunomiaSchedulerTagName};
497
+ `}viewLabel(e){switch(e){case"day":return this.viewDayLabel;case"week":return this.viewWeekLabel;case"work-week":return this.viewWorkWeekLabel;case"month":return this.viewMonthLabel;case"year":return this.viewYearLabel;default:return e}}};t.styles=[V,_],i([o({attribute:!1})],t.prototype,"events",2),i([o({reflect:!0,useDefault:!0})],t.prototype,"view",2),i([o({attribute:!1})],t.prototype,"displayedDate",2),i([o({type:Number,attribute:"week-starts-on"})],t.prototype,"weekStartsOn",2),i([o({type:Number,attribute:"day-start-hour"})],t.prototype,"dayStartHour",2),i([o({type:Number,attribute:"day-end-hour"})],t.prototype,"dayEndHour",2),i([o({type:Number,attribute:"slot-duration"})],t.prototype,"slotDuration",2),i([o({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([o({type:Boolean,reflect:!0,attribute:"no-animation"})],t.prototype,"noAnimation",2),i([o({attribute:"today-label"})],t.prototype,"todayLabel",2),i([o({attribute:"new-event-label"})],t.prototype,"newEventLabel",2),i([o({attribute:"previous-label"})],t.prototype,"previousLabel",2),i([o({attribute:"next-label"})],t.prototype,"nextLabel",2),i([o({attribute:"view-day-label"})],t.prototype,"viewDayLabel",2),i([o({attribute:"view-week-label"})],t.prototype,"viewWeekLabel",2),i([o({attribute:"view-work-week-label"})],t.prototype,"viewWorkWeekLabel",2),i([o({attribute:"view-month-label"})],t.prototype,"viewMonthLabel",2),i([o({attribute:"view-year-label"})],t.prototype,"viewYearLabel",2),i([o({attribute:"apply-label"})],t.prototype,"applyLabel",2),i([o({attribute:"cancel-label"})],t.prototype,"cancelLabel",2),i([o({attribute:"delete-label"})],t.prototype,"deleteLabel",2),i([o({attribute:"edit-label"})],t.prototype,"editLabel",2),i([o({attribute:"close-label"})],t.prototype,"closeLabel",2),i([o({attribute:"more-events-label"})],t.prototype,"moreEventsLabel",2),i([o({attribute:"event-appearance"})],t.prototype,"eventAppearance",2),i([p()],t.prototype,"isDrawerOpen",2),i([p()],t.prototype,"isModalOpen",2),i([p()],t.prototype,"editingEvent",2),i([p()],t.prototype,"createStart",2),i([p()],t.prototype,"createEnd",2),i([p()],t.prototype,"editorDirty",2),i([p()],t.prototype,"isMobile",2),i([h("#editor")],t.prototype,"drawerEditorEl",2),i([h("#editor-mobile")],t.prototype,"modalEditorEl",2),i([p()],t.prototype,"selectedEvent",2),i([h("#event-popover")],t.prototype,"eventPopoverEl",2),i([h("#calendar")],t.prototype,"calendarEl",2),t=i([D(q)],t);function W(l){let n=new Date(l);return n.setHours(n.getHours()+1,0,0,0),n}function F(l,n,e,a,r){switch(l){case"day":return e.toLocaleDateString(r,{weekday:"long",day:"numeric",month:"long",year:"numeric"});case"year":return String(n.getFullYear());case"month":return n.toLocaleDateString(r,{month:"long",year:"numeric"});default:return`${e.toLocaleDateString(r,{day:"numeric",month:"short"})} \u2013 ${a.toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric"})}`}}export{t as EunomiaScheduler,q as EunomiaSchedulerTagName};
@@ -1,4 +1,4 @@
1
- import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunks/chunk-PE4DAXHQ.js";import"./chunks/chunk-G5SBDQQ3.js";import{a as A,b as L}from"./chunks/chunk-MOMYII3P.js";import"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk-LK5BJ4SH.js";import"./chunks/chunk-UYZR4JXZ.js";import{b as I,c as g}from"./chunks/chunk-624VJYNA.js";import{a as c}from"./chunks/chunk-LYYQAALT.js";import"./chunks/chunk-4PI6RDUS.js";import"./chunks/chunk-BO3JOEWM.js";import"./chunks/chunk-VOTRXBDS.js";import{a as y}from"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-RS7TWEMQ.js";import{a as p}from"./chunks/chunk-PPCHQG7P.js";import{a as x}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-KSZRQRN4.js";import{a as r,f as v,h as m,j as n,k as h,l as d,p as o,r as l}from"./chunks/chunk-YITWLCD3.js";var O=m`
1
+ import{b as g}from"./chunks/chunk-BVASCT2V.js";import{a as A,b as L,c as k}from"./chunks/chunk-GWLD2I3P.js";import"./chunks/chunk-UVHVQRPT.js";import{a as y,b as w}from"./chunks/chunk-LVKMAHMU.js";import"./chunks/chunk-L74LXUGL.js";import{a as x}from"./chunks/chunk-LK5BJ4SH.js";import"./chunks/chunk-UYZR4JXZ.js";import{b as T,c}from"./chunks/chunk-624VJYNA.js";import{a as h}from"./chunks/chunk-LYYQAALT.js";import"./chunks/chunk-WW4BTWMH.js";import"./chunks/chunk-GVS6IUKC.js";import"./chunks/chunk-BO3JOEWM.js";import"./chunks/chunk-TLBXTBMM.js";import{a as m}from"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-3BMACIDO.js";import{a as d}from"./chunks/chunk-PPCHQG7P.js";import{a as v}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as r,f,h as b,j as n,k as u,l,p as o,r as a}from"./chunks/chunk-YITWLCD3.js";var D=b`
2
2
  #shortcut-hint {
3
3
  flex-shrink: 0;
4
4
  display: inline-flex;
@@ -138,24 +138,22 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
138
138
  gap: var(--eun-space-xs, 4px);
139
139
  padding: var(--eun-space-s, 8px) var(--eun-space-m, 16px);
140
140
  }
141
- `,$=O;var P="eun-search",i=class extends w(f){constructor(){super(...arguments);this.type="search";this.icon="search";this.clearable=!0;this.shortcut=!1;this.panel=!1;this.ariaLabelPanel="Search";this.loading=!1;this.loadingLabel="Loading\u2026";this.suggestions=!1;this.noResultsLabel="No results";this.isOpen=!1;this.highlightedIndex=-1;this.handleFieldPointerDown=()=>{this.fieldPointerDownAt=performance.now()};this.handleSuggestionsFieldActivate=()=>{!this.suggestions||this.panel||this.isOpen||this.openSuggestions()};this.handleSuggestionsInput=()=>{!this.suggestions||this.panel||(this.highlightedIndex=-1,this.isOpen||this.openSuggestions())};this.handleSuggestionsKeydown=e=>{if(!(!this.suggestions||this.panel))switch(e.key){case"ArrowDown":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.min(this.highlightedIndex+1,this.filteredOptions.length-1));break}case"ArrowUp":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.max(this.highlightedIndex-1,0));break}case"Enter":{let t=this.filteredOptions[this.highlightedIndex];t&&(e.preventDefault(),this.handleSelect(t));break}default:break}};this.handleSuggestionsPopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.listboxEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.listboxEl,{forceFallback:c}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closeSuggestions());return}if(this.fieldPointerDownAt!==void 0&&performance.now()-this.fieldPointerDownAt<i.FIELD_POINTER_DOWN_WINDOW_MS){this.fieldPointerDownAt=void 0,this.openSuggestions();return}this.isOpen=!1,this.highlightedIndex=-1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility()};this.handleShortcut=e=>{!this.shortcut||this.disabled||(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"&&(e.preventDefault(),this.panel?this.openPanel():this.focus())}}connectedCallback(){super.connectedCallback?.(),window.addEventListener("keydown",this.handleShortcut)}disconnectedCallback(){window.removeEventListener("keydown",this.handleShortcut),super.disconnectedCallback?.()}willUpdate(e){super.willUpdate(e),this.type!=="search"&&(this.type="search")}focusTarget(){return this.panel?this.triggerEl:super.focusTarget()}openPanel(){this.modalEl?.show()}closePanel(){this.modalEl?.hide()}firstUpdated(e){super.firstUpdated(e);let t=this.shadowRoot?.getElementById("field");t&&(t.addEventListener("pointerdown",this.handleFieldPointerDown),t.addEventListener("focus",this.handleSuggestionsFieldActivate),t.addEventListener("click",this.handleSuggestionsFieldActivate),t.addEventListener("input",this.handleSuggestionsInput),t.addEventListener("keydown",this.handleSuggestionsKeydown))}get options(){return k(this.children)}get effectiveQuery(){return(this.value??"").trim().toLowerCase()}get filteredOptions(){let e=this.effectiveQuery;return e?this.options.filter(t=>t.label.toLowerCase().includes(e)):this.options}openSuggestions(){if(this.disabled||this.readonly){this.fieldPointerDownAt=void 0;return}let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")||e?.showPopover(),e&&this.playListboxOpenAnimation(e)}static listboxAnimationDuration(e){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:I(e,"--field-listbox-transition-duration","m",200)}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let t=i.listboxAnimationDuration(e);t!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:g(e),fill:"forwards"}))}closeSuggestions(){let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")&&this.playListboxCloseAnimation(e)}playListboxCloseAnimation(e){e.style.pointerEvents="none";let t=i.listboxAnimationDuration(e);if(t===0){e.hidePopover();return}let s=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:g(e),fill:"forwards"});this.listboxAnimation=s,s.finished.then(()=>{this.listboxAnimation===s&&(this.listboxAnimation=void 0),e.hidePopover()}).catch(()=>{})}handleSelect(e){this.value=e.label,this.dispatchEvent(new y),this.closeSuggestions()}renderSuggestionOptionRows(e){let t=[],s=this.effectiveQuery,b;return e.forEach((a,u)=>{a.group!==b&&(b=a.group,a.group&&t.push(o`<li class="group-label" role="presentation">
142
- ${a.group}
143
- </li>`)),t.push(o`
141
+ `,I=D;var O="eun-search",i=class extends x(g){constructor(){super(...arguments);this.type="search";this.icon="search";this.clearable=!0;this.shortcut=!1;this.panel=!1;this.loading=!1;this.loadingLabel="Loading\u2026";this.suggestions=!1;this.noResultsLabel="No results";this.isOpen=!1;this.highlightedIndex=-1;this.handleFieldPointerDown=()=>{this.fieldPointerDownAt=performance.now()};this.handleSuggestionsFieldActivate=()=>{!this.suggestions||this.panel||this.isOpen||this.openSuggestions()};this.handleSuggestionsInput=()=>{!this.suggestions||this.panel||(this.highlightedIndex=-1,this.isOpen||this.openSuggestions())};this.handleSuggestionsKeydown=e=>{if(!(!this.suggestions||this.panel))switch(e.key){case"ArrowDown":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.min(this.highlightedIndex+1,this.filteredOptions.length-1));break}case"ArrowUp":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.max(this.highlightedIndex-1,0));break}case"Enter":{let t=this.filteredOptions[this.highlightedIndex];t&&(e.preventDefault(),this.handleSelect(t));break}default:break}};this.handleSuggestionsPopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.listboxEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.listboxEl,{forceFallback:h}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closeSuggestions());return}if(this.fieldPointerDownAt!==void 0&&performance.now()-this.fieldPointerDownAt<i.FIELD_POINTER_DOWN_WINDOW_MS){this.fieldPointerDownAt=void 0,this.openSuggestions();return}this.isOpen=!1,this.highlightedIndex=-1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility()};this.handleShortcut=e=>{!this.shortcut||this.disabled||(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"&&(e.preventDefault(),this.panel?this.openPanel():this.focus())}}connectedCallback(){super.connectedCallback?.(),window.addEventListener("keydown",this.handleShortcut)}disconnectedCallback(){window.removeEventListener("keydown",this.handleShortcut),super.disconnectedCallback?.()}willUpdate(e){super.willUpdate(e),this.type!=="search"&&(this.type="search")}focusTarget(){return this.panel?this.triggerEl:super.focusTarget()}openPanel(){this.modalEl?.show()}closePanel(){this.modalEl?.hide()}firstUpdated(e){super.firstUpdated(e);let t=this.shadowRoot?.getElementById("field");t&&(t.addEventListener("pointerdown",this.handleFieldPointerDown),t.addEventListener("focus",this.handleSuggestionsFieldActivate),t.addEventListener("click",this.handleSuggestionsFieldActivate),t.addEventListener("input",this.handleSuggestionsInput),t.addEventListener("keydown",this.handleSuggestionsKeydown))}get options(){return A(this.children)}get effectiveQuery(){return(this.value??"").trim().toLowerCase()}get filteredOptions(){let e=this.effectiveQuery;return e?this.options.filter(t=>t.label.toLowerCase().includes(e)):this.options}openSuggestions(){if(this.disabled||this.readonly){this.fieldPointerDownAt=void 0;return}let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")||e?.showPopover(),e&&this.playListboxOpenAnimation(e)}static listboxAnimationDuration(e){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:T(e,"--field-listbox-transition-duration","m",200)}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let t=i.listboxAnimationDuration(e);t!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:c(e),fill:"forwards"}))}closeSuggestions(){let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")&&this.playListboxCloseAnimation(e)}playListboxCloseAnimation(e){e.style.pointerEvents="none";let t=i.listboxAnimationDuration(e);if(t===0){e.hidePopover();return}let s=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:c(e),fill:"forwards"});this.listboxAnimation=s,s.finished.then(()=>{this.listboxAnimation===s&&(this.listboxAnimation=void 0),e.hidePopover()}).catch(()=>{})}handleSelect(e){this.value=e.label,this.dispatchEvent(new m),this.closeSuggestions()}renderSuggestionOptionRows(e){let t=this.effectiveQuery;return k(e,(s,p)=>o`
144
142
  <li
145
- id="listbox-option-${u}"
143
+ id="listbox-option-${p}"
146
144
  role="option"
147
- aria-selected=${a.label.toLowerCase()===s}
148
- class=${x({highlighted:u===this.highlightedIndex,selected:a.label.toLowerCase()===s})}
149
- @mousedown=${D=>{D.preventDefault(),this.handleSelect(a)}}
150
- @mouseenter=${()=>{this.highlightedIndex=u}}
145
+ aria-selected=${s.label.toLowerCase()===t}
146
+ class=${v({highlighted:p===this.highlightedIndex,selected:s.label.toLowerCase()===t})}
147
+ @mousedown=${$=>{$.preventDefault(),this.handleSelect(s)}}
148
+ @mouseenter=${()=>{this.highlightedIndex=p}}
151
149
  >
152
- ${T(a.label,s)}
150
+ ${L(s.label,t)}
153
151
  </li>
154
- `)}),t}renderSuggestionsListbox(){return o`
152
+ `)}renderSuggestionsListbox(){return o`
155
153
  <ul
156
154
  id="listbox"
157
155
  role="listbox"
158
- aria-label=${p(this.label)}
156
+ aria-label=${d(this.label)}
159
157
  popover="auto"
160
158
  @toggle=${this.handleSuggestionsPopoverToggle}
161
159
  >
@@ -170,19 +168,19 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
170
168
  variant="spinner"
171
169
  size="16"
172
170
  label=${this.loadingLabel}
173
- ></eun-loader>`:e?l:this.panel?o`<kbd id="shortcut-hint" aria-hidden="true">Esc</kbd>`:this.shortcut?o`<kbd id="shortcut-hint" aria-hidden="true"
171
+ ></eun-loader>`:e?a:this.panel?o`<kbd id="shortcut-hint" aria-hidden="true">Esc</kbd>`:this.shortcut?o`<kbd id="shortcut-hint" aria-hidden="true"
174
172
  >${this.shortcutLabel}</kbd
175
- >`:l}hasTrailingAddon(){return this.loading||this.panel||this.shortcut}renderTriggerIndicator(){return this.shortcut?o`<kbd id="shortcut-hint" aria-hidden="true"
173
+ >`:a}hasTrailingAddon(){return this.loading||this.panel||this.shortcut}renderTriggerIndicator(){return this.shortcut?o`<kbd id="shortcut-hint" aria-hidden="true"
176
174
  >${this.shortcutLabel}</kbd
177
- >`:l}updated(e){super.updated(e);let t=this.shadowRoot?.getElementById("field");t&&(this.shortcut&&!this.panel?t.hasAttribute("aria-keyshortcuts")||t.setAttribute("aria-keyshortcuts","Control+K Meta+K"):t.removeAttribute("aria-keyshortcuts"),this.panel?t.hasAttribute("autofocus")||t.setAttribute("autofocus",""):t.removeAttribute("autofocus"),this.syncSuggestionsAria(t))}syncSuggestionsAria(e){if(!this.suggestions||this.panel){e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-activedescendant");return}e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.isOpen?"true":"false"),e.setAttribute("aria-controls","listbox"),this.highlightedIndex>=0?e.setAttribute("aria-activedescendant",`listbox-option-${this.highlightedIndex}`):e.removeAttribute("aria-activedescendant")}render(){if(!this.panel)return super.render();let e=this.renderDescription();return o`
175
+ >`:a}updated(e){super.updated(e);let t=this.shadowRoot?.getElementById("field");t&&(this.shortcut&&!this.panel?t.hasAttribute("aria-keyshortcuts")||t.setAttribute("aria-keyshortcuts","Control+K Meta+K"):t.removeAttribute("aria-keyshortcuts"),this.panel?t.hasAttribute("autofocus")||t.setAttribute("autofocus",""):t.removeAttribute("autofocus"),this.syncSuggestionsAria(t))}syncSuggestionsAria(e){if(!this.suggestions||this.panel){e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-autocomplete"),e.removeAttribute("aria-activedescendant");return}e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",this.isOpen?"true":"false"),e.setAttribute("aria-controls","listbox"),this.highlightedIndex>=0?e.setAttribute("aria-activedescendant",`listbox-option-${this.highlightedIndex}`):e.removeAttribute("aria-activedescendant")}render(){if(!this.panel)return super.render();let e=this.renderDescription();return o`
178
176
  <div id="wrapper">
179
177
  ${this.renderFormLabels("search-trigger")}
180
178
  <button
181
179
  id="search-trigger"
182
180
  type="button"
183
181
  aria-haspopup="dialog"
184
- aria-label=${p(this.label)}
185
- aria-keyshortcuts=${p(this.shortcut?"Control+K Meta+K":void 0)}
182
+ aria-label=${d(this.label)}
183
+ aria-keyshortcuts=${d(this.shortcut?"Control+K Meta+K":void 0)}
186
184
  ?disabled=${this.disabled}
187
185
  @click=${this.openPanel}
188
186
  >
@@ -190,7 +188,7 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
190
188
  id="trigger-icon"
191
189
  name=${this.icon}
192
190
  size="16"
193
- ></eun-icon>`:l}
191
+ ></eun-icon>`:a}
194
192
  <span id="trigger-text" class="empty">${this.placeholder||""}</span>
195
193
  ${this.renderTriggerIndicator()}
196
194
  </button>
@@ -199,10 +197,10 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
199
197
  kind="search"
200
198
  hide-actions
201
199
  .closeable=${!1}
202
- aria-label=${this.label||this.ariaLabelPanel}
200
+ aria-label=${this.label||(this.panelLabel??this.dictionary.search.panel)}
203
201
  >
204
202
  <div id="panel-field">
205
- ${this.renderField(e!==l)}
203
+ ${this.renderField(e!==a)}
206
204
  </div>
207
205
  <div id="panel-results">
208
206
  <slot name="results"></slot>
@@ -210,4 +208,4 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
210
208
  </eun-modal>
211
209
  ${e}
212
210
  </div>
213
- `}};i.styles=[f.styles,A,...c?[]:[L],$],i.FIELD_POINTER_DOWN_WINDOW_MS=100,r([n({reflect:!0})],i.prototype,"type",2),r([n()],i.prototype,"icon",2),r([n({type:Boolean})],i.prototype,"clearable",2),r([n({type:Boolean})],i.prototype,"shortcut",2),r([n({type:Boolean})],i.prototype,"panel",2),r([n({attribute:"aria-label-panel"})],i.prototype,"ariaLabelPanel",2),r([n({type:Boolean,reflect:!0})],i.prototype,"loading",2),r([n({attribute:"loading-label"})],i.prototype,"loadingLabel",2),r([n({type:Boolean,reflect:!0})],i.prototype,"suggestions",2),r([n({attribute:"no-results-label"})],i.prototype,"noResultsLabel",2),r([h()],i.prototype,"isOpen",2),r([h()],i.prototype,"highlightedIndex",2),r([d("#panel")],i.prototype,"modalEl",2),r([d("#field-wrapper")],i.prototype,"fieldWrapperEl",2),r([d("#search-trigger")],i.prototype,"triggerEl",2),r([d("#listbox")],i.prototype,"listboxEl",2),i=r([v(P)],i);export{i as EunomiaSearch,P as EunomiaSearchTagName};
211
+ `}};i.styles=[g.styles,y,...h?[]:[w],I],i.FIELD_POINTER_DOWN_WINDOW_MS=100,r([n({reflect:!0,converter:{toAttribute:()=>null}})],i.prototype,"type",2),r([n()],i.prototype,"icon",2),r([n({type:Boolean})],i.prototype,"clearable",2),r([n({type:Boolean})],i.prototype,"shortcut",2),r([n({type:Boolean})],i.prototype,"panel",2),r([n({attribute:"panel-label"})],i.prototype,"panelLabel",2),r([n({type:Boolean,reflect:!0})],i.prototype,"loading",2),r([n({attribute:"loading-label"})],i.prototype,"loadingLabel",2),r([n({type:Boolean,reflect:!0})],i.prototype,"suggestions",2),r([n({attribute:"no-results-label"})],i.prototype,"noResultsLabel",2),r([u()],i.prototype,"isOpen",2),r([u()],i.prototype,"highlightedIndex",2),r([l("#panel")],i.prototype,"modalEl",2),r([l("#field-wrapper")],i.prototype,"fieldWrapperEl",2),r([l("#search-trigger")],i.prototype,"triggerEl",2),r([l("#listbox")],i.prototype,"listboxEl",2),i=r([f(O)],i);export{i as EunomiaSearch,O as EunomiaSearchTagName};