@eos-ui/vue 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/Avatar/EAvatar.js.map +1 -1
  2. package/dist/components/Avatar/EAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  3. package/dist/components/Button/EButton.js.map +1 -1
  4. package/dist/components/Button/EButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/components/Calendar/ECalendar.js.map +1 -1
  6. package/dist/components/Calendar/ECalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/CodeBlock/ECodeBlock.js.map +1 -1
  8. package/dist/components/CodeBlock/ECodeBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/DataGrid/EDataGrid.js.map +1 -1
  10. package/dist/components/DataGrid/EDataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/components/EmptyState/EEmptyState.js.map +1 -1
  12. package/dist/components/EmptyState/EEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/ExpandableRow/EExpandableRow.js.map +1 -1
  14. package/dist/components/ExpandableRow/EExpandableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  15. package/dist/components/Kbd/EKbd.js.map +1 -1
  16. package/dist/components/Kbd/EKbd.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/Menu/EMenu.js.map +1 -1
  18. package/dist/components/Menu/EMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/NavList/ENavList.js.map +1 -1
  20. package/dist/components/NavList/ENavList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/components/Notice/ENotice.js.map +1 -1
  22. package/dist/components/Notice/ENotice.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/Pagination/EPagination.js.map +1 -1
  24. package/dist/components/Pagination/EPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/PasswordField/EPasswordField.js.map +1 -1
  26. package/dist/components/PasswordField/EPasswordField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/components/Progress/EProgress.js.map +1 -1
  28. package/dist/components/Progress/EProgress.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/components/SearchBar/ESearchBar.js.map +1 -1
  30. package/dist/components/SearchBar/ESearchBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  31. package/dist/components/SearchResults/ESearchResults.js.map +1 -1
  32. package/dist/components/SearchResults/ESearchResults.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/Segmented/ESegmented.js.map +1 -1
  34. package/dist/components/Segmented/ESegmented.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/SignaturePad/ESignaturePad.js.map +1 -1
  36. package/dist/components/SignaturePad/ESignaturePad.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/components/Skeleton/ESkeleton.js.map +1 -1
  38. package/dist/components/Skeleton/ESkeleton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/components/Stamp/EStamp.js.map +1 -1
  40. package/dist/components/Stamp/EStamp.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/components/Surface/ESurface.js.map +1 -1
  42. package/dist/components/Surface/ESurface.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/Switch/ESwitch.js.map +1 -1
  44. package/dist/components/Switch/ESwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/Tabs/ETabs.js.map +1 -1
  46. package/dist/components/Tabs/ETabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  47. package/dist/style.css +50 -221
  48. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"EAvatar.js","names":["_sfc_main","EAvatar_vue_vue_type_script_setup_true_lang_default","EAvatar_default"],"sources":["../../../src/components/Avatar/EAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** The person's name. Screen readers read it; the initials are the first letters of its first and last word. */\n name: string;\n /** A photo URL. If it fails to load, the initials appear. */\n src?: string;\n /** 32px, for rows and bars. */\n small?: boolean;\n /** 64px, for a profile or practitioner on an appointment card. The default is 44px. */\n large?: boolean;\n /** `button` renders a `button` with `type=\"button\"`, a pointer cursor and a focus ring, named by `name`, such as the `trigger` of an `EMenu`. Default `span`. */\n as?: \"span\" | \"button\";\n }>(),\n { as: \"span\" },\n);\n\nconst failed = ref(false);\nwatch(\n () => props.src,\n () => (failed.value = false),\n);\n\nconst initials = computed(() => {\n const parts = String(props.name || \"?\")\n .split(/\\s+/)\n .filter(Boolean);\n const first = [...(parts[0] ?? \"?\")][0] ?? \"?\";\n const last = parts.length > 1 ? ([...parts[parts.length - 1]!][0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"e-avatar\"\n :class=\"{ 'e-avatar--s': small, 'e-avatar--l': large, 'e-avatar--button': as === 'button' }\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :role=\"as === 'button' ? undefined : 'img'\"\n :aria-label=\"as === 'button' ? undefined : name\"\n >\n <img v-if=\"src && !failed\" class=\"e-avatar-img\" :src=\"src\" alt=\"\" @error=\"failed = true\" />\n <span v-else-if=\"as === 'button'\" aria-hidden=\"true\">{{ initials }}</span>\n <template v-else>{{ initials }}</template>\n <span v-if=\"as === 'button'\" class=\"e-sr\">{{ name }}</span>\n </component>\n</template>\n\n<style>\n@layer e.primitives {\n .e-avatar {\n display: inline-grid;\n place-items: center;\n flex: none;\n box-sizing: border-box;\n width: var(--e-tap, 44px);\n height: var(--e-tap, 44px);\n overflow: hidden;\n border: var(--e-stroke-edge) solid var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: var(--e-surface-tint);\n color: var(--e-primary);\n font: 600 var(--e-text-sm) / 1 var(--e-font-mono);\n letter-spacing: 0.02em;\n }\n\n .e-avatar--button {\n position: relative;\n padding: 0;\n cursor: pointer;\n transition: border-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-avatar--button:hover {\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n }\n\n .e-avatar--button:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-avatar--button {\n transition: none;\n }\n }\n\n .e-avatar--s {\n width: 32px;\n height: 32px;\n font-size: var(--e-text-xs);\n border-radius: var(--e-radius-sm);\n }\n\n .e-avatar--l {\n width: 64px;\n height: 64px;\n font-size: var(--e-text-lg);\n }\n\n .e-avatar-img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n @media (forced-colors: active) {\n .e-avatar {\n border-color: CanvasText;\n outline-color: CanvasText;\n color: CanvasText;\n }\n\n .e-avatar--button:focus-visible {\n outline-color: Highlight;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"EAvatar.js","names":["_sfc_main","EAvatar_vue_vue_type_script_setup_true_lang_default","EAvatar_default"],"sources":["../../../src/components/Avatar/EAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** The person's name. Screen readers read it; the initials are the first letters of its first and last word. */\n name: string;\n /** A photo URL. If it fails to load, the initials appear. */\n src?: string;\n /** 32px, for rows and bars. */\n small?: boolean;\n /** 64px, for a profile or practitioner on an appointment card. The default is 44px. */\n large?: boolean;\n /** `button` renders a `button` with `type=\"button\"`, a pointer cursor and a focus ring, named by `name`, such as the `trigger` of an `EMenu`. Default `span`. */\n as?: \"span\" | \"button\";\n }>(),\n { as: \"span\" },\n);\n\nconst failed = ref(false);\nwatch(\n () => props.src,\n () => (failed.value = false),\n);\n\nconst initials = computed(() => {\n const parts = String(props.name || \"?\")\n .split(/\\s+/)\n .filter(Boolean);\n const first = [...(parts[0] ?? \"?\")][0] ?? \"?\";\n const last = parts.length > 1 ? ([...parts[parts.length - 1]!][0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"e-avatar\"\n :class=\"{ 'e-avatar--s': small, 'e-avatar--l': large, 'e-avatar--button': as === 'button' }\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :role=\"as === 'button' ? undefined : 'img'\"\n :aria-label=\"as === 'button' ? undefined : name\"\n >\n <img v-if=\"src && !failed\" class=\"e-avatar-img\" :src=\"src\" alt=\"\" @error=\"failed = true\" />\n <span v-else-if=\"as === 'button'\" aria-hidden=\"true\">{{ initials }}</span>\n <template v-else>{{ initials }}</template>\n <span v-if=\"as === 'button'\" class=\"e-sr\">{{ name }}</span>\n </component>\n</template>\n\n<style>\n@layer e.primitives {\n .e-avatar {\n display: inline-grid;\n place-items: center;\n flex: none;\n box-sizing: border-box;\n width: var(--e-tap, 44px);\n height: var(--e-tap, 44px);\n overflow: hidden;\n border: var(--e-stroke-edge) solid var(--e-border-strong);\n border-radius: var(--e-radius-md);\n background: var(--e-surface-tint);\n color: var(--e-primary);\n font: 600 var(--e-text-sm) / 1 var(--e-font-mono);\n letter-spacing: 0.02em;\n }\n\n .e-avatar--button {\n position: relative;\n padding: 0;\n cursor: pointer;\n transition: border-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-avatar--button:hover {\n border-color: var(--e-ink);\n\n }\n\n .e-avatar--button:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-avatar--button {\n transition: none;\n }\n }\n\n .e-avatar--s {\n width: 32px;\n height: 32px;\n font-size: var(--e-text-xs);\n border-radius: var(--e-radius-sm);\n }\n\n .e-avatar--l {\n width: 64px;\n height: 64px;\n font-size: var(--e-text-lg);\n }\n\n .e-avatar-img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n @media (forced-colors: active) {\n .e-avatar {\n border-color: CanvasText;\n outline-color: CanvasText;\n color: CanvasText;\n }\n\n .e-avatar--button:focus-visible {\n outline-color: Highlight;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"EAvatar.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementBlock","_toDisplayString","_Fragment","_createTextVNode","_createCommentVNode","_hoisted_1","_hoisted_2","_hoisted_3","EAvatar_vue_vue_type_script_setup_true_lang_default","props","__props","failed","ref","initials","computed","parts","openBlock","createBlock","resolveDynamicComponent","normalizeClass","withCtx","createElementBlock","_cache","toDisplayString","Fragment","createTextVNode","createCommentVNode"],"sources":["../../../src/components/Avatar/EAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** The person's name. Screen readers read it; the initials are the first letters of its first and last word. */\n name: string;\n /** A photo URL. If it fails to load, the initials appear. */\n src?: string;\n /** 32px, for rows and bars. */\n small?: boolean;\n /** 64px, for a profile or practitioner on an appointment card. The default is 44px. */\n large?: boolean;\n /** `button` renders a `button` with `type=\"button\"`, a pointer cursor and a focus ring, named by `name`, such as the `trigger` of an `EMenu`. Default `span`. */\n as?: \"span\" | \"button\";\n }>(),\n { as: \"span\" },\n);\n\nconst failed = ref(false);\nwatch(\n () => props.src,\n () => (failed.value = false),\n);\n\nconst initials = computed(() => {\n const parts = String(props.name || \"?\")\n .split(/\\s+/)\n .filter(Boolean);\n const first = [...(parts[0] ?? \"?\")][0] ?? \"?\";\n const last = parts.length > 1 ? ([...parts[parts.length - 1]!][0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"e-avatar\"\n :class=\"{ 'e-avatar--s': small, 'e-avatar--l': large, 'e-avatar--button': as === 'button' }\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :role=\"as === 'button' ? undefined : 'img'\"\n :aria-label=\"as === 'button' ? undefined : name\"\n >\n <img v-if=\"src && !failed\" class=\"e-avatar-img\" :src=\"src\" alt=\"\" @error=\"failed = true\" />\n <span v-else-if=\"as === 'button'\" aria-hidden=\"true\">{{ initials }}</span>\n <template v-else>{{ initials }}</template>\n <span v-if=\"as === 'button'\" class=\"e-sr\">{{ name }}</span>\n </component>\n</template>\n\n<style>\n@layer e.primitives {\n .e-avatar {\n display: inline-grid;\n place-items: center;\n flex: none;\n box-sizing: border-box;\n width: var(--e-tap, 44px);\n height: var(--e-tap, 44px);\n overflow: hidden;\n border: var(--e-stroke-edge) solid var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: var(--e-surface-tint);\n color: var(--e-primary);\n font: 600 var(--e-text-sm) / 1 var(--e-font-mono);\n letter-spacing: 0.02em;\n }\n\n .e-avatar--button {\n position: relative;\n padding: 0;\n cursor: pointer;\n transition: border-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-avatar--button:hover {\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n }\n\n .e-avatar--button:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-avatar--button {\n transition: none;\n }\n }\n\n .e-avatar--s {\n width: 32px;\n height: 32px;\n font-size: var(--e-text-xs);\n border-radius: var(--e-radius-sm);\n }\n\n .e-avatar--l {\n width: 64px;\n height: 64px;\n font-size: var(--e-text-lg);\n }\n\n .e-avatar-img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n @media (forced-colors: active) {\n .e-avatar {\n border-color: CanvasText;\n outline-color: CanvasText;\n color: CanvasText;\n }\n\n .e-avatar--button:focus-visible {\n outline-color: Highlight;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAIA,IAAMc,IAAQC,GAgBRC,IAASC,EAAI,EAAK;EACxB,QACQH,EAAM,WACL,EAAO,QAAQ,EACxB;EAEA,IAAMI,IAAWC,QAAe;GAC9B,IAAMC,IAAQ,OAAON,EAAM,QAAQ,GAAG,CAAA,CACnC,MAAM,KAAK,CAAA,CACX,OAAO,OAAO;GAGjB,SAFc,CAAC,GAAIM,EAAM,MAAM,GAAI,CAAC,CAAC,MAAM,QAC9BA,EAAM,SAAS,IAAK,CAAC,GAAGA,EAAMA,EAAM,SAAS,EAAG,CAAC,CAAC,MAAM,KAAM,IAAA,CACrD,YAAY;EACpC,CAAC;E,kBAICpB,EAAA,GAAAC,EAYYC,EAXLa,EAAA,EAAE,GAAA;GACP,OAAKZ,EAAA,CAAC,YAAU;IAAA,eACSY,EAAA;IAAK,eAAiBA,EAAA;IAAK,oBAAsBA,EAAA,OAAE;GAAA,CAAA,CAAA;GAC3E,MAAMA,EAAA,OAAE,WAAA,WAA2B,KAAA;GACnC,MAAMA,EAAA,OAAE,WAAgB,KAAA,IAAS;GACjC,cAAYA,EAAA,OAAE,WAAgB,KAAA,IAAYA,EAAA;;GAE3C,SAAAX,QAA2F,CAAhFW,EAAA,OAAG,CAAKC,EAAA,SAAnBhB,EAAA,GAAAK,EAA2F,OAAA;;IAAhE,OAAM;IAAgB,KAAKU,EAAA;IAAK,KAAI;IAAI,SAAK,AAAAY,EAAA,QAAA,MAAE,EAAA,QAAM;G,mBAC/DZ,EAAA,OAAE,YAAnBf,EAAA,GAAAK,EAA0E,QAA1EM,GAA0EL,EAAlBY,EAAA,KAAQ,GAAA,CAAA,MAChElB,EAAA,GAAAK,EAA0CE,GAAA,EAAA,KAAA,EAAA,GAAA,CAAtBC,EAAAF,EAAAY,EAAA,KAAQ,GAAA,CAAA,C,SAChBH,EAAA,OAAE,YAAdf,EAAA,GAAAK,EAA2D,QAA3DO,GAA2DN,EAAdS,EAAA,IAAI,GAAA,CAAA,K"}
1
+ {"version":3,"file":"EAvatar.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementBlock","_toDisplayString","_Fragment","_createTextVNode","_createCommentVNode","_hoisted_1","_hoisted_2","_hoisted_3","EAvatar_vue_vue_type_script_setup_true_lang_default","props","__props","failed","ref","initials","computed","parts","openBlock","createBlock","resolveDynamicComponent","normalizeClass","withCtx","createElementBlock","_cache","toDisplayString","Fragment","createTextVNode","createCommentVNode"],"sources":["../../../src/components/Avatar/EAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** The person's name. Screen readers read it; the initials are the first letters of its first and last word. */\n name: string;\n /** A photo URL. If it fails to load, the initials appear. */\n src?: string;\n /** 32px, for rows and bars. */\n small?: boolean;\n /** 64px, for a profile or practitioner on an appointment card. The default is 44px. */\n large?: boolean;\n /** `button` renders a `button` with `type=\"button\"`, a pointer cursor and a focus ring, named by `name`, such as the `trigger` of an `EMenu`. Default `span`. */\n as?: \"span\" | \"button\";\n }>(),\n { as: \"span\" },\n);\n\nconst failed = ref(false);\nwatch(\n () => props.src,\n () => (failed.value = false),\n);\n\nconst initials = computed(() => {\n const parts = String(props.name || \"?\")\n .split(/\\s+/)\n .filter(Boolean);\n const first = [...(parts[0] ?? \"?\")][0] ?? \"?\";\n const last = parts.length > 1 ? ([...parts[parts.length - 1]!][0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n});\n</script>\n\n<template>\n <component\n :is=\"as\"\n class=\"e-avatar\"\n :class=\"{ 'e-avatar--s': small, 'e-avatar--l': large, 'e-avatar--button': as === 'button' }\"\n :type=\"as === 'button' ? 'button' : undefined\"\n :role=\"as === 'button' ? undefined : 'img'\"\n :aria-label=\"as === 'button' ? undefined : name\"\n >\n <img v-if=\"src && !failed\" class=\"e-avatar-img\" :src=\"src\" alt=\"\" @error=\"failed = true\" />\n <span v-else-if=\"as === 'button'\" aria-hidden=\"true\">{{ initials }}</span>\n <template v-else>{{ initials }}</template>\n <span v-if=\"as === 'button'\" class=\"e-sr\">{{ name }}</span>\n </component>\n</template>\n\n<style>\n@layer e.primitives {\n .e-avatar {\n display: inline-grid;\n place-items: center;\n flex: none;\n box-sizing: border-box;\n width: var(--e-tap, 44px);\n height: var(--e-tap, 44px);\n overflow: hidden;\n border: var(--e-stroke-edge) solid var(--e-border-strong);\n border-radius: var(--e-radius-md);\n background: var(--e-surface-tint);\n color: var(--e-primary);\n font: 600 var(--e-text-sm) / 1 var(--e-font-mono);\n letter-spacing: 0.02em;\n }\n\n .e-avatar--button {\n position: relative;\n padding: 0;\n cursor: pointer;\n transition: border-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-avatar--button:hover {\n border-color: var(--e-ink);\n\n }\n\n .e-avatar--button:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-avatar--button {\n transition: none;\n }\n }\n\n .e-avatar--s {\n width: 32px;\n height: 32px;\n font-size: var(--e-text-xs);\n border-radius: var(--e-radius-sm);\n }\n\n .e-avatar--l {\n width: 64px;\n height: 64px;\n font-size: var(--e-text-lg);\n }\n\n .e-avatar-img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n @media (forced-colors: active) {\n .e-avatar {\n border-color: CanvasText;\n outline-color: CanvasText;\n color: CanvasText;\n }\n\n .e-avatar--button:focus-visible {\n outline-color: Highlight;\n }\n }\n}\n</style>\n"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,K"}
@@ -1 +1 @@
1
- {"version":3,"file":"EButton.js","names":["_sfc_main","EButton_vue_vue_type_script_setup_true_lang_default","EButton_default"],"sources":["../../../src/components/Button/EButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EIcon from \"../Icon/EIcon.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `primary` is the one main action on a screen; `secondary` confirms; `outline` is for the other actions beside it; `danger` cancels or removes; `quiet` is an underlined text action. */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"quiet\";\n /** An icon before the label: a name such as `download`, or a component. */\n icon?: IconProp;\n /** Full width. */\n block?: boolean;\n /** Dashed and unfilled; not focusable, ignores clicks. With `href` the link gets `aria-disabled=\"true\"` and `tabindex=\"-1\"` and does not navigate. */\n disabled?: boolean;\n /** Set `submit` on the one that submits a form. */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Renders a link that looks like the button, for a destination rather than an action (a call to action that goes to a page). Space does not follow it. */\n href?: string;\n /** With `href`: opens in a new tab. */\n external?: boolean;\n }>(),\n { variant: \"primary\", type: \"button\" },\n);\n\ndefineSlots<{\n /** The label: a verb that says what happens, like \"Pay $162.40\". */\n default(): unknown;\n}>();\n\nfunction blockWhenDisabled(event: Event) {\n if (!props.disabled) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n</script>\n\n<template>\n <a\n v-if=\"href\"\n :href=\"href\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :target=\"external ? '_blank' : undefined\"\n :rel=\"external ? 'noreferrer' : undefined\"\n :aria-disabled=\"disabled ? 'true' : undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click.capture=\"blockWhenDisabled\"\n @auxclick.capture=\"blockWhenDisabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </a>\n <button\n v-else\n :type=\"type\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :disabled=\"disabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </button>\n</template>\n\n<style>\n@layer e.primitives {\n .e-btn {\n --e-fill: var(--e-primary);\n --e-on-fill: var(--e-on-primary);\n --e-slab: color-mix(in srgb, var(--e-fill), var(--e-shade-slab));\n --e-hover: color-mix(in srgb, var(--e-fill), var(--e-shade-hover));\n --e-press: color-mix(in srgb, var(--e-fill), var(--e-shade-press));\n\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-2);\n height: var(--e-control-height);\n padding: var(--e-depth) var(--e-space-4) 0;\n border: var(--e-stroke-edge) solid var(--e-slab);\n\n --e-bc: var(--e-slab);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-bottom-width: calc(var(--e-stroke-edge) + var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-fill);\n color: var(--e-on-fill);\n font: 500 var(--e-text-md) / 1 var(--e-font-sans);\n letter-spacing: 0.01em;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition:\n box-shadow var(--e-duration-tap) var(--e-easing-out),\n background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-btn:hover {\n background: var(--e-hover);\n }\n\n .e-btn:active {\n background: var(--e-press);\n border-bottom-width: var(--e-stroke-edge);\n box-shadow: inset 0 var(--e-depth) 0 0 color-mix(in srgb, transparent, var(--e-shade-press));\n }\n\n .e-btn--secondary {\n --e-fill: var(--e-secondary);\n --e-on-fill: var(--e-on-secondary);\n }\n\n .e-btn--danger {\n --e-fill: var(--e-danger);\n --e-on-fill: var(--e-on-danger);\n }\n\n .e-btn--outline {\n --e-fill: var(--e-surface);\n --e-on-fill: var(--e-ink);\n --e-slab: var(--e-border-strong);\n }\n\n .e-btn--outline:hover {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-hover));\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n }\n\n .e-btn--outline:active {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-press));\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n\n border-bottom-width: var(--e-stroke-edge);\n box-shadow: inset 0 var(--e-depth) 0 0 color-mix(in srgb, transparent, var(--e-shade-press));\n }\n\n .e-btn--quiet {\n border-color: transparent;\n\n --e-bc: transparent;\n\n border-bottom-width: var(--e-stroke-edge);\n background: transparent;\n color: var(--e-ink);\n box-shadow: none;\n padding-top: 0;\n padding-inline: var(--e-space-3);\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: var(--e-stroke-edge);\n text-decoration-color: var(--e-border-strong);\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):hover {\n border-color: var(--e-wash-ring);\n\n --e-bc: var(--e-wash-ring);\n\n background: var(--e-wash-hover);\n text-decoration-color: currentcolor;\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):active {\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n\n background: var(--e-wash-press);\n box-shadow: none;\n padding-top: 0;\n }\n\n .e-btn .e-icon {\n margin-inline-start: calc(-0.5 * var(--e-space-1));\n }\n\n .e-btn--block {\n width: 100%;\n }\n\n /* A toggle: any button with aria-pressed=\"true\" reads as selected. */\n .e-btn[aria-pressed=\"true\"],\n .e-btn[aria-pressed=\"true\"]:hover,\n .e-btn[aria-pressed=\"true\"]:active {\n --e-slab: var(--e-primary);\n --e-bc: var(--e-primary);\n\n border-color: var(--e-primary);\n background: var(--e-surface-hover);\n color: var(--e-primary);\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n cursor: not-allowed;\n background: transparent;\n color: var(--e-muted);\n border: var(--e-stroke-edge) dashed var(--e-border-strong);\n outline: 0;\n box-shadow: none;\n padding-top: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-btn {\n transition: none;\n }\n }\n\n @media print {\n .e-btn {\n display: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-btn {\n border: var(--e-stroke-focus) solid ButtonText;\n }\n\n .e-btn[aria-pressed=\"true\"] {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n border-color: GrayText;\n color: GrayText;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"EButton.js","names":["_sfc_main","EButton_vue_vue_type_script_setup_true_lang_default","EButton_default"],"sources":["../../../src/components/Button/EButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EIcon from \"../Icon/EIcon.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `primary` is the one main action on a screen; `secondary` confirms; `outline` is for the other actions beside it; `danger` cancels or removes; `quiet` is an underlined text action. */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"quiet\";\n /** An icon before the label: a name such as `download`, or a component. */\n icon?: IconProp;\n /** Full width. */\n block?: boolean;\n /** Dashed and unfilled; not focusable, ignores clicks. With `href` the link gets `aria-disabled=\"true\"` and `tabindex=\"-1\"` and does not navigate. */\n disabled?: boolean;\n /** Set `submit` on the one that submits a form. */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Renders a link that looks like the button, for a destination rather than an action (a call to action that goes to a page). Space does not follow it. */\n href?: string;\n /** With `href`: opens in a new tab. */\n external?: boolean;\n }>(),\n { variant: \"primary\", type: \"button\" },\n);\n\ndefineSlots<{\n /** The label: a verb that says what happens, like \"Pay $162.40\". */\n default(): unknown;\n}>();\n\nfunction blockWhenDisabled(event: Event) {\n if (!props.disabled) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n</script>\n\n<template>\n <a\n v-if=\"href\"\n :href=\"href\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :target=\"external ? '_blank' : undefined\"\n :rel=\"external ? 'noreferrer' : undefined\"\n :aria-disabled=\"disabled ? 'true' : undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click.capture=\"blockWhenDisabled\"\n @auxclick.capture=\"blockWhenDisabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </a>\n <button\n v-else\n :type=\"type\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :disabled=\"disabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </button>\n</template>\n\n<style>\n@layer e.primitives {\n .e-btn {\n --e-fill: var(--e-primary);\n --e-on-fill: var(--e-on-primary);\n --e-slab: color-mix(in srgb, var(--e-fill), var(--e-shade-slab));\n --e-hover: color-mix(in srgb, var(--e-fill), var(--e-shade-hover));\n --e-press: color-mix(in srgb, var(--e-fill), var(--e-shade-press));\n\n /* The face is a whole rounded box and the slab is an offset copy of it showing underneath, in the colour of the face's own edge. The margin gives back the room the slab takes, so the button is still one control height tall, and pressing sinks the face onto the slab. */\n --e-lift: var(--e-depth);\n\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-2);\n height: calc(var(--e-control-height) - var(--e-lift));\n margin-block-end: var(--e-lift);\n padding: 0 var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-slab);\n border-radius: var(--e-radius-md);\n background: var(--e-fill);\n box-shadow: 0 var(--e-lift) 0 0 var(--e-slab);\n color: var(--e-on-fill);\n font: 500 var(--e-text-md) / 1 var(--e-font-sans);\n letter-spacing: 0.01em;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition:\n transform var(--e-duration-tap) var(--e-easing-out),\n box-shadow var(--e-duration-tap) var(--e-easing-out),\n background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-btn:hover {\n background: var(--e-hover);\n }\n\n .e-btn:active {\n background: var(--e-press);\n box-shadow: 0 0 0 0 var(--e-slab);\n transform: translateY(var(--e-lift));\n }\n\n .e-btn--secondary {\n --e-fill: var(--e-secondary);\n --e-on-fill: var(--e-on-secondary);\n }\n\n .e-btn--danger {\n --e-fill: var(--e-danger);\n --e-on-fill: var(--e-on-danger);\n }\n\n .e-btn--outline {\n --e-fill: var(--e-surface);\n --e-on-fill: var(--e-ink);\n --e-slab: var(--e-border-strong);\n }\n\n .e-btn--outline:hover {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-hover));\n border-color: var(--e-ink);\n\n }\n\n .e-btn--outline:active {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-press));\n border-color: var(--e-ink);\n\n }\n\n .e-btn--quiet {\n border-color: transparent;\n\n --e-lift: 0px;\n\n background: transparent;\n color: var(--e-ink);\n box-shadow: none;\n padding-inline: var(--e-space-3);\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: var(--e-stroke-edge);\n text-decoration-color: var(--e-border-strong);\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):hover {\n border-color: var(--e-wash-ring);\n background: var(--e-wash-hover);\n text-decoration-color: currentcolor;\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):active {\n border-color: var(--e-ink);\n background: var(--e-wash-press);\n transform: none;\n }\n\n .e-btn .e-icon {\n margin-inline-start: calc(-0.5 * var(--e-space-1));\n }\n\n .e-btn--block {\n width: 100%;\n }\n\n /* A toggle: any button with aria-pressed=\"true\" reads as selected. */\n .e-btn[aria-pressed=\"true\"],\n .e-btn[aria-pressed=\"true\"]:hover,\n .e-btn[aria-pressed=\"true\"]:active {\n --e-slab: var(--e-primary);\n\n border-color: var(--e-primary);\n background: var(--e-surface-hover);\n color: var(--e-primary);\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n --e-lift: 0px;\n\n cursor: not-allowed;\n background: transparent;\n color: var(--e-muted);\n border: var(--e-stroke-edge) dashed var(--e-border-strong);\n outline: 0;\n box-shadow: none;\n transform: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-btn {\n transition: none;\n }\n }\n\n @media print {\n .e-btn {\n display: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-btn {\n border: var(--e-stroke-focus) solid ButtonText;\n }\n\n .e-btn[aria-pressed=\"true\"] {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n border-color: GrayText;\n color: GrayText;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"EButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","EIcon","_createCommentVNode","_renderSlot","EIcon_default","_hoisted_1","_hoisted_2","EButton_vue_vue_type_script_setup_true_lang_default","props","__props","blockWhenDisabled","event","openBlock","createElementBlock","normalizeClass","createBlock","createCommentVNode","renderSlot","_ctx"],"sources":["../../../src/components/Button/EButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EIcon from \"../Icon/EIcon.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `primary` is the one main action on a screen; `secondary` confirms; `outline` is for the other actions beside it; `danger` cancels or removes; `quiet` is an underlined text action. */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"quiet\";\n /** An icon before the label: a name such as `download`, or a component. */\n icon?: IconProp;\n /** Full width. */\n block?: boolean;\n /** Dashed and unfilled; not focusable, ignores clicks. With `href` the link gets `aria-disabled=\"true\"` and `tabindex=\"-1\"` and does not navigate. */\n disabled?: boolean;\n /** Set `submit` on the one that submits a form. */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Renders a link that looks like the button, for a destination rather than an action (a call to action that goes to a page). Space does not follow it. */\n href?: string;\n /** With `href`: opens in a new tab. */\n external?: boolean;\n }>(),\n { variant: \"primary\", type: \"button\" },\n);\n\ndefineSlots<{\n /** The label: a verb that says what happens, like \"Pay $162.40\". */\n default(): unknown;\n}>();\n\nfunction blockWhenDisabled(event: Event) {\n if (!props.disabled) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n</script>\n\n<template>\n <a\n v-if=\"href\"\n :href=\"href\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :target=\"external ? '_blank' : undefined\"\n :rel=\"external ? 'noreferrer' : undefined\"\n :aria-disabled=\"disabled ? 'true' : undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click.capture=\"blockWhenDisabled\"\n @auxclick.capture=\"blockWhenDisabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </a>\n <button\n v-else\n :type=\"type\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :disabled=\"disabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </button>\n</template>\n\n<style>\n@layer e.primitives {\n .e-btn {\n --e-fill: var(--e-primary);\n --e-on-fill: var(--e-on-primary);\n --e-slab: color-mix(in srgb, var(--e-fill), var(--e-shade-slab));\n --e-hover: color-mix(in srgb, var(--e-fill), var(--e-shade-hover));\n --e-press: color-mix(in srgb, var(--e-fill), var(--e-shade-press));\n\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-2);\n height: var(--e-control-height);\n padding: var(--e-depth) var(--e-space-4) 0;\n border: var(--e-stroke-edge) solid var(--e-slab);\n\n --e-bc: var(--e-slab);\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-bottom-width: calc(var(--e-stroke-edge) + var(--e-depth));\n border-radius: var(--e-radius-md);\n background: var(--e-fill);\n color: var(--e-on-fill);\n font: 500 var(--e-text-md) / 1 var(--e-font-sans);\n letter-spacing: 0.01em;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition:\n box-shadow var(--e-duration-tap) var(--e-easing-out),\n background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-btn:hover {\n background: var(--e-hover);\n }\n\n .e-btn:active {\n background: var(--e-press);\n border-bottom-width: var(--e-stroke-edge);\n box-shadow: inset 0 var(--e-depth) 0 0 color-mix(in srgb, transparent, var(--e-shade-press));\n }\n\n .e-btn--secondary {\n --e-fill: var(--e-secondary);\n --e-on-fill: var(--e-on-secondary);\n }\n\n .e-btn--danger {\n --e-fill: var(--e-danger);\n --e-on-fill: var(--e-on-danger);\n }\n\n .e-btn--outline {\n --e-fill: var(--e-surface);\n --e-on-fill: var(--e-ink);\n --e-slab: var(--e-border-strong);\n }\n\n .e-btn--outline:hover {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-hover));\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n }\n\n .e-btn--outline:active {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-press));\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n\n border-bottom-width: var(--e-stroke-edge);\n box-shadow: inset 0 var(--e-depth) 0 0 color-mix(in srgb, transparent, var(--e-shade-press));\n }\n\n .e-btn--quiet {\n border-color: transparent;\n\n --e-bc: transparent;\n\n border-bottom-width: var(--e-stroke-edge);\n background: transparent;\n color: var(--e-ink);\n box-shadow: none;\n padding-top: 0;\n padding-inline: var(--e-space-3);\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: var(--e-stroke-edge);\n text-decoration-color: var(--e-border-strong);\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):hover {\n border-color: var(--e-wash-ring);\n\n --e-bc: var(--e-wash-ring);\n\n background: var(--e-wash-hover);\n text-decoration-color: currentcolor;\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):active {\n border-color: var(--e-ink);\n\n --e-bc: var(--e-ink);\n\n background: var(--e-wash-press);\n box-shadow: none;\n padding-top: 0;\n }\n\n .e-btn .e-icon {\n margin-inline-start: calc(-0.5 * var(--e-space-1));\n }\n\n .e-btn--block {\n width: 100%;\n }\n\n /* A toggle: any button with aria-pressed=\"true\" reads as selected. */\n .e-btn[aria-pressed=\"true\"],\n .e-btn[aria-pressed=\"true\"]:hover,\n .e-btn[aria-pressed=\"true\"]:active {\n --e-slab: var(--e-primary);\n --e-bc: var(--e-primary);\n\n border-color: var(--e-primary);\n background: var(--e-surface-hover);\n color: var(--e-primary);\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n cursor: not-allowed;\n background: transparent;\n color: var(--e-muted);\n border: var(--e-stroke-edge) dashed var(--e-border-strong);\n outline: 0;\n box-shadow: none;\n padding-top: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-btn {\n transition: none;\n }\n }\n\n @media print {\n .e-btn {\n display: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-btn {\n border: var(--e-stroke-focus) solid ButtonText;\n }\n\n .e-btn[aria-pressed=\"true\"] {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n border-color: GrayText;\n color: GrayText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAKA,IAAMW,IAAQC;EAyBd,SAASC,EAAkB,GAAc;GACvC,AAAKF,EAAM,aACXG,EAAM,eAAe,GACrBA,EAAM,yBAAyB;EACjC;E,iBAKUF,EAAA,QADRZ,EAAA,GAAAC,EAcI,KAAA;;GAZD,MAAMW,EAAA;GACP,OAAKV,EAAA,CAAC,SAAO,CACJU,EAAA,YAAO,aAAA,UAA4BA,EAAA,WAAWA,EAAA,SAAK,cAAA,CAAA,CAAA;GAC3D,QAAQA,EAAA,WAAQ,WAAc,KAAA;GAC9B,KAAKA,EAAA,WAAQ,eAAkB,KAAA;GAC/B,iBAAeA,EAAA,WAAQ,SAAY,KAAA;GACnC,UAAUA,EAAA,WAAQ,KAAQ,KAAA;GACX,gBAAAC;GACG,mBAAAA;E,IAEND,EAAA,QAAbZ,EAAA,GAAAG,EAAkCC,GAAA;;GAAd,MAAMQ,EAAA;E,oCAC1BN,EAAQe,EAAA,QAAA,SAAA,C,cAEVrB,EAAA,GAAAC,EASS,UAAA;;GAPN,MAAMW,EAAA;GACP,OAAKV,EAAA,CAAC,SAAO,CACJU,EAAA,YAAO,aAAA,UAA4BA,EAAA,WAAWA,EAAA,SAAK,cAAA,CAAA,CAAA;GAC3D,UAAUA,EAAA;E,IAEEA,EAAA,QAAbZ,EAAA,GAAAG,EAAkCC,GAAA;;GAAd,MAAMQ,EAAA;E,oCAC1BN,EAAQe,EAAA,QAAA,SAAA,C"}
1
+ {"version":3,"file":"EButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","EIcon","_createCommentVNode","_renderSlot","EIcon_default","_hoisted_1","_hoisted_2","EButton_vue_vue_type_script_setup_true_lang_default","props","__props","blockWhenDisabled","event","openBlock","createElementBlock","normalizeClass","createBlock","createCommentVNode","renderSlot","_ctx"],"sources":["../../../src/components/Button/EButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport EIcon from \"../Icon/EIcon.vue\";\nimport type { IconProp } from \"../../icons/types.js\";\nimport \"../../styles/base.css\";\n\nconst props = withDefaults(\n defineProps<{\n /** `primary` is the one main action on a screen; `secondary` confirms; `outline` is for the other actions beside it; `danger` cancels or removes; `quiet` is an underlined text action. */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"quiet\";\n /** An icon before the label: a name such as `download`, or a component. */\n icon?: IconProp;\n /** Full width. */\n block?: boolean;\n /** Dashed and unfilled; not focusable, ignores clicks. With `href` the link gets `aria-disabled=\"true\"` and `tabindex=\"-1\"` and does not navigate. */\n disabled?: boolean;\n /** Set `submit` on the one that submits a form. */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Renders a link that looks like the button, for a destination rather than an action (a call to action that goes to a page). Space does not follow it. */\n href?: string;\n /** With `href`: opens in a new tab. */\n external?: boolean;\n }>(),\n { variant: \"primary\", type: \"button\" },\n);\n\ndefineSlots<{\n /** The label: a verb that says what happens, like \"Pay $162.40\". */\n default(): unknown;\n}>();\n\nfunction blockWhenDisabled(event: Event) {\n if (!props.disabled) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n</script>\n\n<template>\n <a\n v-if=\"href\"\n :href=\"href\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :target=\"external ? '_blank' : undefined\"\n :rel=\"external ? 'noreferrer' : undefined\"\n :aria-disabled=\"disabled ? 'true' : undefined\"\n :tabindex=\"disabled ? -1 : undefined\"\n @click.capture=\"blockWhenDisabled\"\n @auxclick.capture=\"blockWhenDisabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </a>\n <button\n v-else\n :type=\"type\"\n class=\"e-btn\"\n :class=\"[variant !== 'primary' && `e-btn--${variant}`, block && 'e-btn--block']\"\n :disabled=\"disabled\"\n >\n <EIcon v-if=\"icon\" :name=\"icon\" />\n <slot />\n </button>\n</template>\n\n<style>\n@layer e.primitives {\n .e-btn {\n --e-fill: var(--e-primary);\n --e-on-fill: var(--e-on-primary);\n --e-slab: color-mix(in srgb, var(--e-fill), var(--e-shade-slab));\n --e-hover: color-mix(in srgb, var(--e-fill), var(--e-shade-hover));\n --e-press: color-mix(in srgb, var(--e-fill), var(--e-shade-press));\n\n /* The face is a whole rounded box and the slab is an offset copy of it showing underneath, in the colour of the face's own edge. The margin gives back the room the slab takes, so the button is still one control height tall, and pressing sinks the face onto the slab. */\n --e-lift: var(--e-depth);\n\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-2);\n height: calc(var(--e-control-height) - var(--e-lift));\n margin-block-end: var(--e-lift);\n padding: 0 var(--e-space-4);\n border: var(--e-stroke-edge) solid var(--e-slab);\n border-radius: var(--e-radius-md);\n background: var(--e-fill);\n box-shadow: 0 var(--e-lift) 0 0 var(--e-slab);\n color: var(--e-on-fill);\n font: 500 var(--e-text-md) / 1 var(--e-font-sans);\n letter-spacing: 0.01em;\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition:\n transform var(--e-duration-tap) var(--e-easing-out),\n box-shadow var(--e-duration-tap) var(--e-easing-out),\n background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-btn:hover {\n background: var(--e-hover);\n }\n\n .e-btn:active {\n background: var(--e-press);\n box-shadow: 0 0 0 0 var(--e-slab);\n transform: translateY(var(--e-lift));\n }\n\n .e-btn--secondary {\n --e-fill: var(--e-secondary);\n --e-on-fill: var(--e-on-secondary);\n }\n\n .e-btn--danger {\n --e-fill: var(--e-danger);\n --e-on-fill: var(--e-on-danger);\n }\n\n .e-btn--outline {\n --e-fill: var(--e-surface);\n --e-on-fill: var(--e-ink);\n --e-slab: var(--e-border-strong);\n }\n\n .e-btn--outline:hover {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-hover));\n border-color: var(--e-ink);\n\n }\n\n .e-btn--outline:active {\n background: color-mix(in srgb, var(--e-surface), var(--e-shade-press));\n border-color: var(--e-ink);\n\n }\n\n .e-btn--quiet {\n border-color: transparent;\n\n --e-lift: 0px;\n\n background: transparent;\n color: var(--e-ink);\n box-shadow: none;\n padding-inline: var(--e-space-3);\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: var(--e-stroke-edge);\n text-decoration-color: var(--e-border-strong);\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):hover {\n border-color: var(--e-wash-ring);\n background: var(--e-wash-hover);\n text-decoration-color: currentcolor;\n }\n\n .e-btn--quiet:not([disabled], [aria-disabled=\"true\"]):active {\n border-color: var(--e-ink);\n background: var(--e-wash-press);\n transform: none;\n }\n\n .e-btn .e-icon {\n margin-inline-start: calc(-0.5 * var(--e-space-1));\n }\n\n .e-btn--block {\n width: 100%;\n }\n\n /* A toggle: any button with aria-pressed=\"true\" reads as selected. */\n .e-btn[aria-pressed=\"true\"],\n .e-btn[aria-pressed=\"true\"]:hover,\n .e-btn[aria-pressed=\"true\"]:active {\n --e-slab: var(--e-primary);\n\n border-color: var(--e-primary);\n background: var(--e-surface-hover);\n color: var(--e-primary);\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n --e-lift: 0px;\n\n cursor: not-allowed;\n background: transparent;\n color: var(--e-muted);\n border: var(--e-stroke-edge) dashed var(--e-border-strong);\n outline: 0;\n box-shadow: none;\n transform: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-btn {\n transition: none;\n }\n }\n\n @media print {\n .e-btn {\n display: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-btn {\n border: var(--e-stroke-focus) solid ButtonText;\n }\n\n .e-btn[aria-pressed=\"true\"] {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-btn[disabled],\n .e-btn[aria-disabled=\"true\"] {\n border-color: GrayText;\n color: GrayText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAKA,IAAMW,IAAQC;EAyBd,SAASC,EAAkB,GAAc;GACvC,AAAKF,EAAM,aACXG,EAAM,eAAe,GACrBA,EAAM,yBAAyB;EACjC;E,iBAKUF,EAAA,QADRZ,EAAA,GAAAC,EAcI,KAAA;;GAZD,MAAMW,EAAA;GACP,OAAKV,EAAA,CAAC,SAAO,CACJU,EAAA,YAAO,aAAA,UAA4BA,EAAA,WAAWA,EAAA,SAAK,cAAA,CAAA,CAAA;GAC3D,QAAQA,EAAA,WAAQ,WAAc,KAAA;GAC9B,KAAKA,EAAA,WAAQ,eAAkB,KAAA;GAC/B,iBAAeA,EAAA,WAAQ,SAAY,KAAA;GACnC,UAAUA,EAAA,WAAQ,KAAQ,KAAA;GACX,gBAAAC;GACG,mBAAAA;E,IAEND,EAAA,QAAbZ,EAAA,GAAAG,EAAkCC,GAAA;;GAAd,MAAMQ,EAAA;E,oCAC1BN,EAAQe,EAAA,QAAA,SAAA,C,cAEVrB,EAAA,GAAAC,EASS,UAAA;;GAPN,MAAMW,EAAA;GACP,OAAKV,EAAA,CAAC,SAAO,CACJU,EAAA,YAAO,aAAA,UAA4BA,EAAA,WAAWA,EAAA,SAAK,cAAA,CAAA,CAAA;GAC3D,UAAUA,EAAA;E,IAEEA,EAAA,QAAbZ,EAAA,GAAAG,EAAkCC,GAAA;;GAAd,MAAMQ,EAAA;E,oCAC1BN,EAAQe,EAAA,QAAA,SAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ECalendar.js","names":["_sfc_main","ECalendar_vue_vue_type_script_setup_true_lang_default","ECalendar_default"],"sources":["../../../src/components/Calendar/ECalendar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, nextTick, ref, watch } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EButton from \"../Button/EButton.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useConfig, useMessages } from \"../../config.js\";\nimport { useLocale } from \"../../composables/useLocale.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport { addDays, addMonths, compareDays, dayKey, sameDay, startOfDay } from \"./dates.js\";\nimport \"../../styles/base.css\";\n\nexport interface CalendarRange {\n start: Date | null;\n end: Date | null;\n}\n\nconst props = withDefaults(\n defineProps<{\n /** `single` chooses one day (`v-model`); `range` chooses a span (`v-model:start` and `v-model:end`): the first click sets the start, the second the end, and a click before the start restarts. */\n mode?: \"single\" | \"range\";\n /** Days that cannot be chosen or focused, such as days with nothing to book. Arrow keys skip them. */\n disabledDate?: (date: Date) => boolean;\n /** Days that get a dot: a list of dates or a function. Screen readers hear `markLabel`. */\n marked?: Date[] | ((date: Date) => boolean);\n /** What screen readers hear on a marked day. @default times available */\n markLabel?: string;\n /** The earliest day that can be chosen. Earlier days cannot be focused or chosen; navigation stops there. */\n min?: Date;\n /** The latest day that can be chosen. Later days cannot be focused or chosen; navigation stops there. */\n max?: Date;\n /** The month to open on, when nothing is chosen. Changing it moves the view. */\n month?: Date;\n /** `false` hides the Today and Clear buttons. */\n footer?: boolean;\n /** Forces the Clear button on or off. Left out, it shows when a `@clear` listener is attached. */\n clearable?: boolean;\n }>(),\n { mode: \"single\", footer: true, clearable: undefined },\n);\n\nconst emit = defineEmits<{\n /** In range mode, after every click that changes the span. */\n rangeChange: [range: CalendarRange];\n /** The Clear button. It is only shown when a `@clear` listener is attached. */\n clear: [];\n}>();\n\n/** The chosen day (`single` mode). */\nconst value = defineModel<Date | null>({ default: null });\n/** The first day of the span (`range` mode). */\nconst start = defineModel<Date | null>(\"start\", { default: null });\n/** The last day of the span (`range` mode). */\nconst end = defineModel<Date | null>(\"end\", { default: null });\n\ntype View = \"days\" | \"months\" | \"years\";\n\nconst t = useMessages();\nconst config = useConfig();\nconst loc = useLocale();\nconst uid = useUid();\nconst root = ref<HTMLElement | null>(null);\nconst range = computed(() => props.mode === \"range\");\nconst instance = getCurrentInstance();\nconst hasClear = () => props.clearable ?? !!instance?.vnode.props?.onClear;\n\nconst today = startOfDay(new Date());\nconst focus = ref(startOfDay((range.value ? start.value : value.value) || props.month || new Date()));\nconst hover = ref<Date | null>(null);\nconst view = ref<View>(\"days\");\nconst pick = ref(0);\n\nconst cy = computed(() => focus.value.getFullYear());\nconst cm = computed(() => focus.value.getMonth());\nconst yearLow = computed(() => Math.min(cy.value, props.min ? props.min.getFullYear() : today.getFullYear() - 120));\nconst yearHigh = computed(() => Math.max(cy.value, props.max ? props.max.getFullYear() : today.getFullYear() + 20));\nconst years = computed(() => Array.from({ length: yearHigh.value - yearLow.value + 1 }, (_, i) => yearLow.value + i));\n\nfunction off(d: Date): boolean {\n return (\n (!!props.min && compareDays(d, props.min) < 0) ||\n (!!props.max && compareDays(d, props.max) > 0) ||\n !!props.disabledDate?.(d)\n );\n}\nfunction isMarked(d: Date): boolean {\n const m = props.marked;\n if (!m) return false;\n return typeof m === \"function\" ? !!m(d) : m.some((x) => sameDay(x, d));\n}\nfunction monthOff(y: number, m: number): boolean {\n return (\n (!!props.min && compareDays(new Date(y, m + 1, 0, 12), props.min) < 0) ||\n (!!props.max && compareDays(new Date(y, m, 1, 12), props.max) > 0)\n );\n}\nconst yearOff = (y: number) =>\n (!!props.min && y < props.min.getFullYear()) || (!!props.max && y > props.max.getFullYear());\nfunction clamp(d: Date): Date {\n if (props.min && compareDays(d, props.min) < 0) return startOfDay(props.min);\n if (props.max && compareDays(d, props.max) > 0) return startOfDay(props.max);\n return d;\n}\nfunction settle(d: Date, step: number): Date | null {\n let n = d;\n for (let i = 0; i < 400 && off(n); i++) n = addDays(n, step);\n return off(n) ? null : n;\n}\nfunction withMonthYear(y: number, m: number): Date {\n const last = new Date(y, m + 1, 0, 12).getDate();\n return clamp(new Date(y, m, Math.min(focus.value.getDate(), last), 12));\n}\n\nif (off(focus.value)) focus.value = settle(focus.value, 1) ?? settle(focus.value, -1) ?? focus.value;\n\nlet want: string | null = null;\nasync function focusWanted() {\n await nextTick();\n if (!want) return;\n const el = root.value?.querySelector<HTMLElement>(`[id=\"${want}\"]`);\n if (!el) return;\n el.focus();\n if (want.includes(\"-y-\")) el.scrollIntoView?.({ block: \"center\" });\n want = null;\n}\nfunction focusId(id: string) {\n want = id;\n void focusWanted();\n}\nconst dayId = (d: Date) => `${uid.value}-${dayKey(d)}`;\n\nwatch(\n () => props.month?.getTime(),\n () => {\n if (props.month) focus.value = clamp(startOfDay(props.month));\n },\n);\nwatch(\n () => (range.value ? start.value : value.value)?.getTime(),\n () => {\n const chosen = range.value ? start.value : value.value;\n if (chosen && !sameDay(chosen, focus.value)) focus.value = startOfDay(chosen);\n },\n);\n\nconst weeks = computed(() => {\n const first = new Date(cy.value, cm.value, 1, 12);\n const from = addDays(first, -((first.getDay() - loc.weekStart.value + 7) % 7));\n return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(from, w * 7 + i)));\n});\nconst columns = computed(() => Array.from({ length: 7 }, (_, k) => (loc.weekStart.value + k) % 7));\nconst rangeEnd = computed(() => {\n if (!range.value) return null;\n return end.value || (start.value && hover.value && compareDays(hover.value, start.value) >= 0 ? hover.value : null);\n});\n\nfunction isSelected(d: Date): boolean {\n return range.value ? sameDay(d, start.value) || sameDay(d, end.value) : sameDay(d, value.value);\n}\nfunction inRange(d: Date): boolean {\n return !!(\n range.value &&\n start.value &&\n rangeEnd.value &&\n compareDays(d, start.value) > 0 &&\n compareDays(d, rangeEnd.value) < 0\n );\n}\nfunction dayLabel(d: Date, marked: boolean): string {\n return (\n loc.formatLong(d) +\n (sameDay(d, today) ? \", \" + t(\"todaySuffix\") : \"\") +\n (marked ? \", \" + (props.markLabel || t(\"timesAvailable\")) : \"\")\n );\n}\n\nfunction pickDay(d: Date) {\n if (off(d)) return;\n if (!range.value) {\n value.value = d;\n return;\n }\n const s = start.value;\n if (!s || end.value || compareDays(d, s) < 0) {\n start.value = d;\n end.value = null;\n emit(\"rangeChange\", { start: d, end: null });\n } else {\n end.value = d;\n emit(\"rangeChange\", { start: s, end: d });\n }\n}\nfunction clickDay(d: Date) {\n focus.value = d;\n focusId(dayId(d));\n pickDay(d);\n}\n\nfunction openView(v: \"months\" | \"years\") {\n view.value = v;\n if (v === \"months\") {\n pick.value = cm.value;\n focusId(`${uid.value}-m-${cm.value}`);\n } else {\n pick.value = cy.value;\n focusId(`${uid.value}-y-${cy.value}`);\n }\n}\nfunction backToDays() {\n view.value = \"days\";\n focusId(dayId(focus.value));\n}\nfunction back() {\n if (view.value === \"months\") openView(\"years\");\n else backToDays();\n}\nfunction chooseMonth(m: number) {\n if (monthOff(cy.value, m)) return;\n const nd = withMonthYear(cy.value, m);\n focus.value = nd;\n view.value = \"days\";\n focusId(dayId(nd));\n}\nfunction chooseYear(y: number) {\n if (yearOff(y)) return;\n const nd = withMonthYear(y, cm.value);\n focus.value = nd;\n view.value = \"months\";\n pick.value = nd.getMonth();\n focusId(`${uid.value}-m-${nd.getMonth()}`);\n}\nfunction step(n: number) {\n focus.value = clamp(addMonths(focus.value, n));\n}\n\nfunction sign(): number {\n if (config.dir) return config.dir === \"rtl\" ? -1 : 1;\n return root.value && getComputedStyle(root.value).direction === \"rtl\" ? -1 : 1;\n}\n\nfunction onDayKey(e: KeyboardEvent) {\n const f = focus.value;\n const dow = (f.getDay() - loc.weekStart.value + 7) % 7;\n const s = sign();\n let next: Date;\n let walk: number;\n switch (e.key) {\n case \"ArrowLeft\":\n walk = -s;\n next = addDays(f, walk);\n break;\n case \"ArrowRight\":\n walk = s;\n next = addDays(f, walk);\n break;\n case \"ArrowUp\":\n walk = -7;\n next = addDays(f, walk);\n break;\n case \"ArrowDown\":\n walk = 7;\n next = addDays(f, walk);\n break;\n case \"Home\":\n walk = 1;\n next = addDays(f, -dow);\n break;\n case \"End\":\n walk = -1;\n next = addDays(f, 6 - dow);\n break;\n case \"PageUp\":\n walk = -1;\n next = addMonths(f, e.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n walk = 1;\n next = addMonths(f, e.shiftKey ? 12 : 1);\n break;\n default:\n return;\n }\n e.preventDefault();\n const target = settle(next, walk);\n if (!target) return;\n focus.value = target;\n focusId(dayId(target));\n if (range.value && start.value && !end.value) hover.value = target;\n}\n\nfunction onPickKey(e: KeyboardEvent) {\n const months = view.value === \"months\";\n const lo = months ? 0 : yearLow.value;\n const hi = months ? 11 : yearHigh.value;\n const s = sign();\n let next: number | null = null;\n switch (e.key) {\n case \"ArrowLeft\":\n next = pick.value - s;\n break;\n case \"ArrowRight\":\n next = pick.value + s;\n break;\n case \"ArrowUp\":\n next = pick.value - 3;\n break;\n case \"ArrowDown\":\n next = pick.value + 3;\n break;\n case \"Home\":\n next = lo;\n break;\n case \"End\":\n next = hi;\n break;\n case \"PageUp\":\n if (!months) next = pick.value - 12;\n break;\n case \"PageDown\":\n if (!months) next = pick.value + 12;\n break;\n }\n if (next === null) return;\n e.preventDefault();\n next = Math.max(lo, Math.min(hi, next));\n pick.value = next;\n focusId(`${uid.value}-${months ? \"m\" : \"y\"}-${next}`);\n}\n\nfunction onRootKey(e: KeyboardEvent) {\n if (e.key !== \"Escape\" || view.value === \"days\") return;\n e.preventDefault();\n e.stopPropagation();\n backToDays();\n}\n\nfunction goToday() {\n const tc = clamp(today);\n focus.value = tc;\n focusId(dayId(tc));\n if (!range.value && !off(today)) pickDay(today);\n}\n\nconst shortDate = (d: Date) => `${loc.monthsShort.value[d.getMonth()]} ${d.getDate()}`;\nconst help = computed(() => {\n if (!range.value || view.value !== \"days\") return \"\";\n if (!start.value) return t(\"rangeStart\");\n if (!end.value) return t(\"rangeEnd\", { start: shortDate(start.value) });\n return t(\"rangeDone\", {\n start: shortDate(start.value),\n end: shortDate(end.value),\n days: Math.round(compareDays(end.value, start.value) / 864e5) + 1,\n });\n});\n\nconst picking = computed(() => view.value !== \"days\");\nconst prevOff = computed(() => !!props.min && compareDays(new Date(cy.value, cm.value, 0, 12), props.min) < 0);\nconst nextOff = computed(() => !!props.max && compareDays(new Date(cy.value, cm.value + 1, 1, 12), props.max) > 0);\nconst nowYear = today.getFullYear();\nconst nowMonth = today.getMonth();\n\ndefineExpose({\n view,\n focusDay: () => focusId(dayId(focus.value)),\n});\n</script>\n\n<template>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div ref=\"root\" class=\"e-cal\" :dir=\"config.dir ?? undefined\" @keydown=\"onRootKey\">\n <div class=\"e-cal-head\">\n <EIconButton\n v-if=\"picking\"\n icon=\"chevron-left\"\n :label=\"t(view === 'months' ? 'backToYears' : 'backToDays')\"\n @click=\"back\"\n />\n <EIconButton v-else icon=\"chevron-left\" :label=\"t('prevMonth')\" :disabled=\"prevOff\" @click=\"step(-1)\" />\n <div class=\"e-cal-title\" aria-live=\"polite\">\n <span v-if=\"picking\" class=\"e-cal-range\">{{\n t(view === \"months\" ? \"chooseAMonth\" : \"chooseAYear\", { year: cy })\n }}</span>\n <button\n v-else\n type=\"button\"\n class=\"e-cal-pick\"\n aria-expanded=\"false\"\n :aria-label=\"t('chooseDateNow', { month: loc.months.value[cm] ?? '', year: cy })\"\n @click=\"openView('years')\"\n >\n {{ loc.months.value[cm] }} {{ cy }}\n <EIcon name=\"chevron-down\" small />\n </button>\n </div>\n <span v-if=\"picking\" class=\"e-cal-gap\" />\n <EIconButton v-else icon=\"chevron-right\" :label=\"t('nextMonth')\" :disabled=\"nextOff\" @click=\"step(1)\" />\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -- the day buttons carry the roving tabindex -->\n <table\n v-if=\"view === 'days'\"\n class=\"e-cal-grid\"\n role=\"grid\"\n :aria-label=\"`${loc.months.value[cm]} ${cy}`\"\n @keydown=\"onDayKey\"\n >\n <thead>\n <tr>\n <th v-for=\"ix in columns\" :key=\"ix\" scope=\"col\" :abbr=\"loc.weekdays.value[ix]\">\n {{ loc.weekdaysShort.value[ix] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, w) in weeks\" :key=\"w\">\n <td\n v-for=\"d in row\"\n :key=\"dayKey(d)\"\n role=\"gridcell\"\n :aria-selected=\"isSelected(d) || inRange(d) ? 'true' : 'false'\"\n :class=\"inRange(d) && 'e-cal-in'\"\n >\n <button\n :id=\"dayId(d)\"\n type=\"button\"\n class=\"e-day\"\n :class=\"[\n d.getMonth() !== cm && 'e-day--out',\n sameDay(d, today) && 'e-day--today',\n isSelected(d) && 'e-day--sel',\n !off(d) && isMarked(d) && 'e-day--mark',\n ]\"\n :tabindex=\"sameDay(d, focus) ? 0 : -1\"\n :disabled=\"off(d)\"\n :aria-label=\"dayLabel(d, !off(d) && isMarked(d))\"\n @click=\"clickDay(d)\"\n @mouseenter=\"range && start && !end && (hover = d)\"\n @focus=\"range && start && !end && (hover = d)\"\n >\n {{ d.getDate() }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else-if=\"view === 'months'\"\n class=\"e-cal-cells\"\n role=\"group\"\n :aria-label=\"t('monthsOf', { year: cy })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"(name, m) in loc.months.value\"\n :id=\"`${uid}-m-${m}`\"\n :key=\"m\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[m === cm && 'e-day--sel', cy === nowYear && m === nowMonth && 'e-day--today']\"\n :tabindex=\"m === pick ? 0 : -1\"\n :disabled=\"monthOff(cy, m)\"\n :aria-pressed=\"m === cm ? 'true' : 'false'\"\n :aria-current=\"cy === nowYear && m === nowMonth ? 'date' : undefined\"\n @click=\"chooseMonth(m)\"\n >\n <span aria-hidden=\"true\">{{ loc.monthsShort.value[m] }}</span>\n <span class=\"e-sr\">{{ name }} {{ cy }}</span>\n </button>\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else\n class=\"e-cal-cells e-cal-years\"\n role=\"group\"\n :aria-label=\"t('yearsRange', { from: yearLow, to: yearHigh })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"y in years\"\n :id=\"`${uid}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[y === cy && 'e-day--sel', y === nowYear && 'e-day--today']\"\n :tabindex=\"y === pick ? 0 : -1\"\n :disabled=\"yearOff(y)\"\n :aria-pressed=\"y === cy ? 'true' : 'false'\"\n :aria-current=\"y === nowYear ? 'date' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n\n <p v-if=\"range\" class=\"e-cal-help\" aria-live=\"polite\">{{ help }}</p>\n\n <EActions v-if=\"footer\" class=\"e-cal-foot\" :class=\"view !== 'days' && 'e-cal-foot--idle'\" :inert=\"view !== 'days'\">\n <EButton variant=\"quiet\" @click=\"goToday\">{{ t(\"today\") }}</EButton>\n <EButton v-if=\"hasClear()\" variant=\"quiet\" @click=\"emit('clear')\">{{ t(\"clear\") }}</EButton>\n </EActions>\n </div>\n</template>\n\n<style>\n@layer e.composites {\n .e-cal {\n width: 20.5rem;\n max-width: 100%;\n font-family: var(--e-font-sans);\n }\n\n .e-cal-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--e-space-2);\n margin-bottom: var(--e-space-2);\n padding-bottom: var(--e-space-2);\n border-bottom: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-title {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-1);\n flex: 1;\n min-width: 0;\n margin: 0;\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n text-align: center;\n }\n\n .e-cal-pick {\n display: inline-flex;\n align-items: center;\n gap: var(--e-space-1);\n height: var(--e-control-height);\n padding: 0 var(--e-space-2);\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 600 var(--e-text-lg) / 1 var(--e-font-sans);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick:hover {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-cal-pick:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-cal-pick .e-icon {\n transition: transform var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick[aria-expanded=\"true\"] .e-icon {\n transform: rotate(180deg);\n }\n\n .e-cal-range {\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n font-variant-numeric: tabular-nums;\n }\n\n .e-cal-gap {\n display: block;\n width: var(--e-tap);\n height: var(--e-tap);\n }\n\n .e-cal-head .e-icon-btn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n }\n\n .e-cal-head .e-icon-btn:disabled:hover {\n background: transparent;\n box-shadow: none;\n }\n\n .e-cal-grid {\n width: 100%;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n border-collapse: collapse;\n table-layout: fixed;\n }\n\n .e-cal-grid th {\n height: var(--e-space-8);\n font: 600 var(--e-text-sm) / 1 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-grid td {\n padding: 1px 3px;\n text-align: center;\n }\n\n .e-cal-in {\n background: color-mix(in srgb, var(--e-primary) 12%, var(--e-surface));\n }\n\n .e-day {\n position: relative;\n width: 100%;\n height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-sm) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-day:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-day:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-day--out {\n color: var(--e-muted);\n font-weight: 400;\n }\n\n .e-day--today {\n box-shadow: inset 0 0 0 var(--e-stroke-edge) var(--e-primary);\n }\n\n .e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n\n --e-bc: var(--e-primary);\n\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-day:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n opacity: 1;\n }\n\n .e-day--mark::after {\n content: \"\";\n position: absolute;\n inset-inline-start: 50%;\n bottom: 5px;\n width: 5px;\n height: 5px;\n margin-inline-start: -2.5px;\n border-radius: 50%;\n background: var(--e-primary);\n }\n\n .e-day--sel.e-day--mark::after {\n background: var(--e-on-primary);\n }\n\n .e-cal-cells {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n gap: 6px;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n padding-top: var(--e-space-1);\n }\n\n .e-cal-years {\n overflow-y: auto;\n grid-auto-rows: var(--e-tap);\n padding-inline-end: 2px;\n align-content: start;\n }\n\n .e-cal-cell {\n width: 100%;\n height: 100%;\n min-height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-md) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-years .e-cal-cell {\n height: var(--e-tap);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-cal-cell:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-cal-cell:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-cal-cell:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n }\n\n .e-cal-cell.e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n\n --e-bc: var(--e-primary);\n\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-cal-help {\n min-height: calc(var(--e-text-sm) * 1.4);\n margin: var(--e-space-2) 0 0;\n font: 500 var(--e-text-sm) / 1.4 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-foot {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--e-space-2);\n margin-top: var(--e-space-2);\n padding-top: var(--e-space-2);\n border-top: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-foot--idle {\n visibility: hidden;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-day,\n .e-cal-pick,\n .e-cal-cell,\n .e-cal-pick .e-icon {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-day--sel,\n .e-cal-cell.e-day--sel {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-day--mark::after {\n background: CanvasText;\n }\n\n .e-day--sel.e-day--mark::after {\n background: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ECalendar.js","names":["_sfc_main","ECalendar_vue_vue_type_script_setup_true_lang_default","ECalendar_default"],"sources":["../../../src/components/Calendar/ECalendar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, nextTick, ref, watch } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EButton from \"../Button/EButton.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useConfig, useMessages } from \"../../config.js\";\nimport { useLocale } from \"../../composables/useLocale.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport { addDays, addMonths, compareDays, dayKey, sameDay, startOfDay } from \"./dates.js\";\nimport \"../../styles/base.css\";\n\nexport interface CalendarRange {\n start: Date | null;\n end: Date | null;\n}\n\nconst props = withDefaults(\n defineProps<{\n /** `single` chooses one day (`v-model`); `range` chooses a span (`v-model:start` and `v-model:end`): the first click sets the start, the second the end, and a click before the start restarts. */\n mode?: \"single\" | \"range\";\n /** Days that cannot be chosen or focused, such as days with nothing to book. Arrow keys skip them. */\n disabledDate?: (date: Date) => boolean;\n /** Days that get a dot: a list of dates or a function. Screen readers hear `markLabel`. */\n marked?: Date[] | ((date: Date) => boolean);\n /** What screen readers hear on a marked day. @default times available */\n markLabel?: string;\n /** The earliest day that can be chosen. Earlier days cannot be focused or chosen; navigation stops there. */\n min?: Date;\n /** The latest day that can be chosen. Later days cannot be focused or chosen; navigation stops there. */\n max?: Date;\n /** The month to open on, when nothing is chosen. Changing it moves the view. */\n month?: Date;\n /** `false` hides the Today and Clear buttons. */\n footer?: boolean;\n /** Forces the Clear button on or off. Left out, it shows when a `@clear` listener is attached. */\n clearable?: boolean;\n }>(),\n { mode: \"single\", footer: true, clearable: undefined },\n);\n\nconst emit = defineEmits<{\n /** In range mode, after every click that changes the span. */\n rangeChange: [range: CalendarRange];\n /** The Clear button. It is only shown when a `@clear` listener is attached. */\n clear: [];\n}>();\n\n/** The chosen day (`single` mode). */\nconst value = defineModel<Date | null>({ default: null });\n/** The first day of the span (`range` mode). */\nconst start = defineModel<Date | null>(\"start\", { default: null });\n/** The last day of the span (`range` mode). */\nconst end = defineModel<Date | null>(\"end\", { default: null });\n\ntype View = \"days\" | \"months\" | \"years\";\n\nconst t = useMessages();\nconst config = useConfig();\nconst loc = useLocale();\nconst uid = useUid();\nconst root = ref<HTMLElement | null>(null);\nconst range = computed(() => props.mode === \"range\");\nconst instance = getCurrentInstance();\nconst hasClear = () => props.clearable ?? !!instance?.vnode.props?.onClear;\n\nconst today = startOfDay(new Date());\nconst focus = ref(startOfDay((range.value ? start.value : value.value) || props.month || new Date()));\nconst hover = ref<Date | null>(null);\nconst view = ref<View>(\"days\");\nconst pick = ref(0);\n\nconst cy = computed(() => focus.value.getFullYear());\nconst cm = computed(() => focus.value.getMonth());\nconst yearLow = computed(() => Math.min(cy.value, props.min ? props.min.getFullYear() : today.getFullYear() - 120));\nconst yearHigh = computed(() => Math.max(cy.value, props.max ? props.max.getFullYear() : today.getFullYear() + 20));\nconst years = computed(() => Array.from({ length: yearHigh.value - yearLow.value + 1 }, (_, i) => yearLow.value + i));\n\nfunction off(d: Date): boolean {\n return (\n (!!props.min && compareDays(d, props.min) < 0) ||\n (!!props.max && compareDays(d, props.max) > 0) ||\n !!props.disabledDate?.(d)\n );\n}\nfunction isMarked(d: Date): boolean {\n const m = props.marked;\n if (!m) return false;\n return typeof m === \"function\" ? !!m(d) : m.some((x) => sameDay(x, d));\n}\nfunction monthOff(y: number, m: number): boolean {\n return (\n (!!props.min && compareDays(new Date(y, m + 1, 0, 12), props.min) < 0) ||\n (!!props.max && compareDays(new Date(y, m, 1, 12), props.max) > 0)\n );\n}\nconst yearOff = (y: number) =>\n (!!props.min && y < props.min.getFullYear()) || (!!props.max && y > props.max.getFullYear());\nfunction clamp(d: Date): Date {\n if (props.min && compareDays(d, props.min) < 0) return startOfDay(props.min);\n if (props.max && compareDays(d, props.max) > 0) return startOfDay(props.max);\n return d;\n}\nfunction settle(d: Date, step: number): Date | null {\n let n = d;\n for (let i = 0; i < 400 && off(n); i++) n = addDays(n, step);\n return off(n) ? null : n;\n}\nfunction withMonthYear(y: number, m: number): Date {\n const last = new Date(y, m + 1, 0, 12).getDate();\n return clamp(new Date(y, m, Math.min(focus.value.getDate(), last), 12));\n}\n\nif (off(focus.value)) focus.value = settle(focus.value, 1) ?? settle(focus.value, -1) ?? focus.value;\n\nlet want: string | null = null;\nasync function focusWanted() {\n await nextTick();\n if (!want) return;\n const el = root.value?.querySelector<HTMLElement>(`[id=\"${want}\"]`);\n if (!el) return;\n el.focus();\n if (want.includes(\"-y-\")) el.scrollIntoView?.({ block: \"center\" });\n want = null;\n}\nfunction focusId(id: string) {\n want = id;\n void focusWanted();\n}\nconst dayId = (d: Date) => `${uid.value}-${dayKey(d)}`;\n\nwatch(\n () => props.month?.getTime(),\n () => {\n if (props.month) focus.value = clamp(startOfDay(props.month));\n },\n);\nwatch(\n () => (range.value ? start.value : value.value)?.getTime(),\n () => {\n const chosen = range.value ? start.value : value.value;\n if (chosen && !sameDay(chosen, focus.value)) focus.value = startOfDay(chosen);\n },\n);\n\nconst weeks = computed(() => {\n const first = new Date(cy.value, cm.value, 1, 12);\n const from = addDays(first, -((first.getDay() - loc.weekStart.value + 7) % 7));\n return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(from, w * 7 + i)));\n});\nconst columns = computed(() => Array.from({ length: 7 }, (_, k) => (loc.weekStart.value + k) % 7));\nconst rangeEnd = computed(() => {\n if (!range.value) return null;\n return end.value || (start.value && hover.value && compareDays(hover.value, start.value) >= 0 ? hover.value : null);\n});\n\nfunction isSelected(d: Date): boolean {\n return range.value ? sameDay(d, start.value) || sameDay(d, end.value) : sameDay(d, value.value);\n}\nfunction inRange(d: Date): boolean {\n return !!(\n range.value &&\n start.value &&\n rangeEnd.value &&\n compareDays(d, start.value) > 0 &&\n compareDays(d, rangeEnd.value) < 0\n );\n}\nfunction dayLabel(d: Date, marked: boolean): string {\n return (\n loc.formatLong(d) +\n (sameDay(d, today) ? \", \" + t(\"todaySuffix\") : \"\") +\n (marked ? \", \" + (props.markLabel || t(\"timesAvailable\")) : \"\")\n );\n}\n\nfunction pickDay(d: Date) {\n if (off(d)) return;\n if (!range.value) {\n value.value = d;\n return;\n }\n const s = start.value;\n if (!s || end.value || compareDays(d, s) < 0) {\n start.value = d;\n end.value = null;\n emit(\"rangeChange\", { start: d, end: null });\n } else {\n end.value = d;\n emit(\"rangeChange\", { start: s, end: d });\n }\n}\nfunction clickDay(d: Date) {\n focus.value = d;\n focusId(dayId(d));\n pickDay(d);\n}\n\nfunction openView(v: \"months\" | \"years\") {\n view.value = v;\n if (v === \"months\") {\n pick.value = cm.value;\n focusId(`${uid.value}-m-${cm.value}`);\n } else {\n pick.value = cy.value;\n focusId(`${uid.value}-y-${cy.value}`);\n }\n}\nfunction backToDays() {\n view.value = \"days\";\n focusId(dayId(focus.value));\n}\nfunction back() {\n if (view.value === \"months\") openView(\"years\");\n else backToDays();\n}\nfunction chooseMonth(m: number) {\n if (monthOff(cy.value, m)) return;\n const nd = withMonthYear(cy.value, m);\n focus.value = nd;\n view.value = \"days\";\n focusId(dayId(nd));\n}\nfunction chooseYear(y: number) {\n if (yearOff(y)) return;\n const nd = withMonthYear(y, cm.value);\n focus.value = nd;\n view.value = \"months\";\n pick.value = nd.getMonth();\n focusId(`${uid.value}-m-${nd.getMonth()}`);\n}\nfunction step(n: number) {\n focus.value = clamp(addMonths(focus.value, n));\n}\n\nfunction sign(): number {\n if (config.dir) return config.dir === \"rtl\" ? -1 : 1;\n return root.value && getComputedStyle(root.value).direction === \"rtl\" ? -1 : 1;\n}\n\nfunction onDayKey(e: KeyboardEvent) {\n const f = focus.value;\n const dow = (f.getDay() - loc.weekStart.value + 7) % 7;\n const s = sign();\n let next: Date;\n let walk: number;\n switch (e.key) {\n case \"ArrowLeft\":\n walk = -s;\n next = addDays(f, walk);\n break;\n case \"ArrowRight\":\n walk = s;\n next = addDays(f, walk);\n break;\n case \"ArrowUp\":\n walk = -7;\n next = addDays(f, walk);\n break;\n case \"ArrowDown\":\n walk = 7;\n next = addDays(f, walk);\n break;\n case \"Home\":\n walk = 1;\n next = addDays(f, -dow);\n break;\n case \"End\":\n walk = -1;\n next = addDays(f, 6 - dow);\n break;\n case \"PageUp\":\n walk = -1;\n next = addMonths(f, e.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n walk = 1;\n next = addMonths(f, e.shiftKey ? 12 : 1);\n break;\n default:\n return;\n }\n e.preventDefault();\n const target = settle(next, walk);\n if (!target) return;\n focus.value = target;\n focusId(dayId(target));\n if (range.value && start.value && !end.value) hover.value = target;\n}\n\nfunction onPickKey(e: KeyboardEvent) {\n const months = view.value === \"months\";\n const lo = months ? 0 : yearLow.value;\n const hi = months ? 11 : yearHigh.value;\n const s = sign();\n let next: number | null = null;\n switch (e.key) {\n case \"ArrowLeft\":\n next = pick.value - s;\n break;\n case \"ArrowRight\":\n next = pick.value + s;\n break;\n case \"ArrowUp\":\n next = pick.value - 3;\n break;\n case \"ArrowDown\":\n next = pick.value + 3;\n break;\n case \"Home\":\n next = lo;\n break;\n case \"End\":\n next = hi;\n break;\n case \"PageUp\":\n if (!months) next = pick.value - 12;\n break;\n case \"PageDown\":\n if (!months) next = pick.value + 12;\n break;\n }\n if (next === null) return;\n e.preventDefault();\n next = Math.max(lo, Math.min(hi, next));\n pick.value = next;\n focusId(`${uid.value}-${months ? \"m\" : \"y\"}-${next}`);\n}\n\nfunction onRootKey(e: KeyboardEvent) {\n if (e.key !== \"Escape\" || view.value === \"days\") return;\n e.preventDefault();\n e.stopPropagation();\n backToDays();\n}\n\nfunction goToday() {\n const tc = clamp(today);\n focus.value = tc;\n focusId(dayId(tc));\n if (!range.value && !off(today)) pickDay(today);\n}\n\nconst shortDate = (d: Date) => `${loc.monthsShort.value[d.getMonth()]} ${d.getDate()}`;\nconst help = computed(() => {\n if (!range.value || view.value !== \"days\") return \"\";\n if (!start.value) return t(\"rangeStart\");\n if (!end.value) return t(\"rangeEnd\", { start: shortDate(start.value) });\n return t(\"rangeDone\", {\n start: shortDate(start.value),\n end: shortDate(end.value),\n days: Math.round(compareDays(end.value, start.value) / 864e5) + 1,\n });\n});\n\nconst picking = computed(() => view.value !== \"days\");\nconst prevOff = computed(() => !!props.min && compareDays(new Date(cy.value, cm.value, 0, 12), props.min) < 0);\nconst nextOff = computed(() => !!props.max && compareDays(new Date(cy.value, cm.value + 1, 1, 12), props.max) > 0);\nconst nowYear = today.getFullYear();\nconst nowMonth = today.getMonth();\n\ndefineExpose({\n view,\n focusDay: () => focusId(dayId(focus.value)),\n});\n</script>\n\n<template>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div ref=\"root\" class=\"e-cal\" :dir=\"config.dir ?? undefined\" @keydown=\"onRootKey\">\n <div class=\"e-cal-head\">\n <EIconButton\n v-if=\"picking\"\n icon=\"chevron-left\"\n :label=\"t(view === 'months' ? 'backToYears' : 'backToDays')\"\n @click=\"back\"\n />\n <EIconButton v-else icon=\"chevron-left\" :label=\"t('prevMonth')\" :disabled=\"prevOff\" @click=\"step(-1)\" />\n <div class=\"e-cal-title\" aria-live=\"polite\">\n <span v-if=\"picking\" class=\"e-cal-range\">{{\n t(view === \"months\" ? \"chooseAMonth\" : \"chooseAYear\", { year: cy })\n }}</span>\n <button\n v-else\n type=\"button\"\n class=\"e-cal-pick\"\n aria-expanded=\"false\"\n :aria-label=\"t('chooseDateNow', { month: loc.months.value[cm] ?? '', year: cy })\"\n @click=\"openView('years')\"\n >\n {{ loc.months.value[cm] }} {{ cy }}\n <EIcon name=\"chevron-down\" small />\n </button>\n </div>\n <span v-if=\"picking\" class=\"e-cal-gap\" />\n <EIconButton v-else icon=\"chevron-right\" :label=\"t('nextMonth')\" :disabled=\"nextOff\" @click=\"step(1)\" />\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -- the day buttons carry the roving tabindex -->\n <table\n v-if=\"view === 'days'\"\n class=\"e-cal-grid\"\n role=\"grid\"\n :aria-label=\"`${loc.months.value[cm]} ${cy}`\"\n @keydown=\"onDayKey\"\n >\n <thead>\n <tr>\n <th v-for=\"ix in columns\" :key=\"ix\" scope=\"col\" :abbr=\"loc.weekdays.value[ix]\">\n {{ loc.weekdaysShort.value[ix] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, w) in weeks\" :key=\"w\">\n <td\n v-for=\"d in row\"\n :key=\"dayKey(d)\"\n role=\"gridcell\"\n :aria-selected=\"isSelected(d) || inRange(d) ? 'true' : 'false'\"\n :class=\"inRange(d) && 'e-cal-in'\"\n >\n <button\n :id=\"dayId(d)\"\n type=\"button\"\n class=\"e-day\"\n :class=\"[\n d.getMonth() !== cm && 'e-day--out',\n sameDay(d, today) && 'e-day--today',\n isSelected(d) && 'e-day--sel',\n !off(d) && isMarked(d) && 'e-day--mark',\n ]\"\n :tabindex=\"sameDay(d, focus) ? 0 : -1\"\n :disabled=\"off(d)\"\n :aria-label=\"dayLabel(d, !off(d) && isMarked(d))\"\n @click=\"clickDay(d)\"\n @mouseenter=\"range && start && !end && (hover = d)\"\n @focus=\"range && start && !end && (hover = d)\"\n >\n {{ d.getDate() }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else-if=\"view === 'months'\"\n class=\"e-cal-cells\"\n role=\"group\"\n :aria-label=\"t('monthsOf', { year: cy })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"(name, m) in loc.months.value\"\n :id=\"`${uid}-m-${m}`\"\n :key=\"m\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[m === cm && 'e-day--sel', cy === nowYear && m === nowMonth && 'e-day--today']\"\n :tabindex=\"m === pick ? 0 : -1\"\n :disabled=\"monthOff(cy, m)\"\n :aria-pressed=\"m === cm ? 'true' : 'false'\"\n :aria-current=\"cy === nowYear && m === nowMonth ? 'date' : undefined\"\n @click=\"chooseMonth(m)\"\n >\n <span aria-hidden=\"true\">{{ loc.monthsShort.value[m] }}</span>\n <span class=\"e-sr\">{{ name }} {{ cy }}</span>\n </button>\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else\n class=\"e-cal-cells e-cal-years\"\n role=\"group\"\n :aria-label=\"t('yearsRange', { from: yearLow, to: yearHigh })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"y in years\"\n :id=\"`${uid}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[y === cy && 'e-day--sel', y === nowYear && 'e-day--today']\"\n :tabindex=\"y === pick ? 0 : -1\"\n :disabled=\"yearOff(y)\"\n :aria-pressed=\"y === cy ? 'true' : 'false'\"\n :aria-current=\"y === nowYear ? 'date' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n\n <p v-if=\"range\" class=\"e-cal-help\" aria-live=\"polite\">{{ help }}</p>\n\n <EActions v-if=\"footer\" class=\"e-cal-foot\" :class=\"view !== 'days' && 'e-cal-foot--idle'\" :inert=\"view !== 'days'\">\n <EButton variant=\"quiet\" @click=\"goToday\">{{ t(\"today\") }}</EButton>\n <EButton v-if=\"hasClear()\" variant=\"quiet\" @click=\"emit('clear')\">{{ t(\"clear\") }}</EButton>\n </EActions>\n </div>\n</template>\n\n<style>\n@layer e.composites {\n .e-cal {\n width: 20.5rem;\n max-width: 100%;\n font-family: var(--e-font-sans);\n }\n\n .e-cal-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--e-space-2);\n margin-bottom: var(--e-space-2);\n padding-bottom: var(--e-space-2);\n border-bottom: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-title {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-1);\n flex: 1;\n min-width: 0;\n margin: 0;\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n text-align: center;\n }\n\n .e-cal-pick {\n display: inline-flex;\n align-items: center;\n gap: var(--e-space-1);\n height: var(--e-control-height);\n padding: 0 var(--e-space-2);\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 600 var(--e-text-lg) / 1 var(--e-font-sans);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick:hover {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-cal-pick:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-cal-pick .e-icon {\n transition: transform var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick[aria-expanded=\"true\"] .e-icon {\n transform: rotate(180deg);\n }\n\n .e-cal-range {\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n font-variant-numeric: tabular-nums;\n }\n\n .e-cal-gap {\n display: block;\n width: var(--e-tap);\n height: var(--e-tap);\n }\n\n .e-cal-head .e-icon-btn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n }\n\n .e-cal-head .e-icon-btn:disabled:hover {\n background: transparent;\n box-shadow: none;\n }\n\n .e-cal-grid {\n width: 100%;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n border-collapse: collapse;\n table-layout: fixed;\n }\n\n .e-cal-grid th {\n height: var(--e-space-8);\n font: 600 var(--e-text-sm) / 1 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-grid td {\n padding: 1px 3px;\n text-align: center;\n }\n\n .e-cal-in {\n background: color-mix(in srgb, var(--e-primary) 12%, var(--e-surface));\n }\n\n .e-day {\n position: relative;\n width: 100%;\n height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-sm) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-day:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-day:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-day--out {\n color: var(--e-muted);\n font-weight: 400;\n }\n\n .e-day--today {\n box-shadow: inset 0 0 0 var(--e-stroke-edge) var(--e-primary);\n }\n\n .e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-day:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n opacity: 1;\n }\n\n .e-day--mark::after {\n content: \"\";\n position: absolute;\n inset-inline-start: 50%;\n bottom: 5px;\n width: 5px;\n height: 5px;\n margin-inline-start: -2.5px;\n border-radius: 50%;\n background: var(--e-primary);\n }\n\n .e-day--sel.e-day--mark::after {\n background: var(--e-on-primary);\n }\n\n .e-cal-cells {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n gap: 6px;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n padding-top: var(--e-space-1);\n }\n\n .e-cal-years {\n overflow-y: auto;\n grid-auto-rows: var(--e-tap);\n padding-inline-end: 2px;\n align-content: start;\n }\n\n .e-cal-cell {\n width: 100%;\n height: 100%;\n min-height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-md) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-years .e-cal-cell {\n height: var(--e-tap);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-cal-cell:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-cal-cell:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-cal-cell:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n }\n\n .e-cal-cell.e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-cal-help {\n min-height: calc(var(--e-text-sm) * 1.4);\n margin: var(--e-space-2) 0 0;\n font: 500 var(--e-text-sm) / 1.4 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-foot {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--e-space-2);\n margin-top: var(--e-space-2);\n padding-top: var(--e-space-2);\n border-top: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-foot--idle {\n visibility: hidden;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-day,\n .e-cal-pick,\n .e-cal-cell,\n .e-cal-pick .e-icon {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-day--sel,\n .e-cal-cell.e-day--sel {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-day--mark::after {\n background: CanvasText;\n }\n\n .e-day--sel.e-day--mark::after {\n background: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ECalendar.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_unref","_createElementVNode","_createBlock","EIconButton","_toDisplayString","_createTextVNode","_createVNode","EIcon","_Fragment","_renderList","_normalizeClass","_createCommentVNode","EActions","_withCtx","EButton","EActions_default","EIcon_default","EButton_default","EIconButton_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","ECalendar_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","\"start\"","\"startModifiers\"","\"end\"","\"endModifiers\"","__expose","__emit","props","__props","emit","value","useModel","start","end","t","useMessages","config","useConfig","loc","useLocale","uid","useUid","root","ref","range","computed","instance","getCurrentInstance","hasClear","today","startOfDay","focus","hover","view","pick","cy","cm","yearLow","yearHigh","years","i","off","compareDays","d","isMarked","m","sameDay","x","monthOff","y","yearOff","clamp","settle","addDays","step","withMonthYear","last","want","focusWanted","nextTick","el","focusId","id","dayId","dayKey","watch","chosen","weeks","first","from","w","columns","k","rangeEnd","isSelected","inRange","dayLabel","marked","pickDay","s","clickDay","openView","v","backToDays","back","chooseMonth","nd","chooseYear","addMonths","n","sign","onDayKey","f","dow","next","walk","target","onPickKey","months","lo","hi","onRootKey","goToday","tc","shortDate","help","picking","prevOff","nextOff","nowYear","nowMonth","openBlock","createElementBlock","unref","createElementVNode","createBlock","_cache","toDisplayString","createTextVNode","createVNode","Fragment","renderList","ix","row","normalizeClass","name","createCommentVNode","withCtx"],"sources":["../../../src/components/Calendar/ECalendar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, nextTick, ref, watch } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EButton from \"../Button/EButton.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useConfig, useMessages } from \"../../config.js\";\nimport { useLocale } from \"../../composables/useLocale.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport { addDays, addMonths, compareDays, dayKey, sameDay, startOfDay } from \"./dates.js\";\nimport \"../../styles/base.css\";\n\nexport interface CalendarRange {\n start: Date | null;\n end: Date | null;\n}\n\nconst props = withDefaults(\n defineProps<{\n /** `single` chooses one day (`v-model`); `range` chooses a span (`v-model:start` and `v-model:end`): the first click sets the start, the second the end, and a click before the start restarts. */\n mode?: \"single\" | \"range\";\n /** Days that cannot be chosen or focused, such as days with nothing to book. Arrow keys skip them. */\n disabledDate?: (date: Date) => boolean;\n /** Days that get a dot: a list of dates or a function. Screen readers hear `markLabel`. */\n marked?: Date[] | ((date: Date) => boolean);\n /** What screen readers hear on a marked day. @default times available */\n markLabel?: string;\n /** The earliest day that can be chosen. Earlier days cannot be focused or chosen; navigation stops there. */\n min?: Date;\n /** The latest day that can be chosen. Later days cannot be focused or chosen; navigation stops there. */\n max?: Date;\n /** The month to open on, when nothing is chosen. Changing it moves the view. */\n month?: Date;\n /** `false` hides the Today and Clear buttons. */\n footer?: boolean;\n /** Forces the Clear button on or off. Left out, it shows when a `@clear` listener is attached. */\n clearable?: boolean;\n }>(),\n { mode: \"single\", footer: true, clearable: undefined },\n);\n\nconst emit = defineEmits<{\n /** In range mode, after every click that changes the span. */\n rangeChange: [range: CalendarRange];\n /** The Clear button. It is only shown when a `@clear` listener is attached. */\n clear: [];\n}>();\n\n/** The chosen day (`single` mode). */\nconst value = defineModel<Date | null>({ default: null });\n/** The first day of the span (`range` mode). */\nconst start = defineModel<Date | null>(\"start\", { default: null });\n/** The last day of the span (`range` mode). */\nconst end = defineModel<Date | null>(\"end\", { default: null });\n\ntype View = \"days\" | \"months\" | \"years\";\n\nconst t = useMessages();\nconst config = useConfig();\nconst loc = useLocale();\nconst uid = useUid();\nconst root = ref<HTMLElement | null>(null);\nconst range = computed(() => props.mode === \"range\");\nconst instance = getCurrentInstance();\nconst hasClear = () => props.clearable ?? !!instance?.vnode.props?.onClear;\n\nconst today = startOfDay(new Date());\nconst focus = ref(startOfDay((range.value ? start.value : value.value) || props.month || new Date()));\nconst hover = ref<Date | null>(null);\nconst view = ref<View>(\"days\");\nconst pick = ref(0);\n\nconst cy = computed(() => focus.value.getFullYear());\nconst cm = computed(() => focus.value.getMonth());\nconst yearLow = computed(() => Math.min(cy.value, props.min ? props.min.getFullYear() : today.getFullYear() - 120));\nconst yearHigh = computed(() => Math.max(cy.value, props.max ? props.max.getFullYear() : today.getFullYear() + 20));\nconst years = computed(() => Array.from({ length: yearHigh.value - yearLow.value + 1 }, (_, i) => yearLow.value + i));\n\nfunction off(d: Date): boolean {\n return (\n (!!props.min && compareDays(d, props.min) < 0) ||\n (!!props.max && compareDays(d, props.max) > 0) ||\n !!props.disabledDate?.(d)\n );\n}\nfunction isMarked(d: Date): boolean {\n const m = props.marked;\n if (!m) return false;\n return typeof m === \"function\" ? !!m(d) : m.some((x) => sameDay(x, d));\n}\nfunction monthOff(y: number, m: number): boolean {\n return (\n (!!props.min && compareDays(new Date(y, m + 1, 0, 12), props.min) < 0) ||\n (!!props.max && compareDays(new Date(y, m, 1, 12), props.max) > 0)\n );\n}\nconst yearOff = (y: number) =>\n (!!props.min && y < props.min.getFullYear()) || (!!props.max && y > props.max.getFullYear());\nfunction clamp(d: Date): Date {\n if (props.min && compareDays(d, props.min) < 0) return startOfDay(props.min);\n if (props.max && compareDays(d, props.max) > 0) return startOfDay(props.max);\n return d;\n}\nfunction settle(d: Date, step: number): Date | null {\n let n = d;\n for (let i = 0; i < 400 && off(n); i++) n = addDays(n, step);\n return off(n) ? null : n;\n}\nfunction withMonthYear(y: number, m: number): Date {\n const last = new Date(y, m + 1, 0, 12).getDate();\n return clamp(new Date(y, m, Math.min(focus.value.getDate(), last), 12));\n}\n\nif (off(focus.value)) focus.value = settle(focus.value, 1) ?? settle(focus.value, -1) ?? focus.value;\n\nlet want: string | null = null;\nasync function focusWanted() {\n await nextTick();\n if (!want) return;\n const el = root.value?.querySelector<HTMLElement>(`[id=\"${want}\"]`);\n if (!el) return;\n el.focus();\n if (want.includes(\"-y-\")) el.scrollIntoView?.({ block: \"center\" });\n want = null;\n}\nfunction focusId(id: string) {\n want = id;\n void focusWanted();\n}\nconst dayId = (d: Date) => `${uid.value}-${dayKey(d)}`;\n\nwatch(\n () => props.month?.getTime(),\n () => {\n if (props.month) focus.value = clamp(startOfDay(props.month));\n },\n);\nwatch(\n () => (range.value ? start.value : value.value)?.getTime(),\n () => {\n const chosen = range.value ? start.value : value.value;\n if (chosen && !sameDay(chosen, focus.value)) focus.value = startOfDay(chosen);\n },\n);\n\nconst weeks = computed(() => {\n const first = new Date(cy.value, cm.value, 1, 12);\n const from = addDays(first, -((first.getDay() - loc.weekStart.value + 7) % 7));\n return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(from, w * 7 + i)));\n});\nconst columns = computed(() => Array.from({ length: 7 }, (_, k) => (loc.weekStart.value + k) % 7));\nconst rangeEnd = computed(() => {\n if (!range.value) return null;\n return end.value || (start.value && hover.value && compareDays(hover.value, start.value) >= 0 ? hover.value : null);\n});\n\nfunction isSelected(d: Date): boolean {\n return range.value ? sameDay(d, start.value) || sameDay(d, end.value) : sameDay(d, value.value);\n}\nfunction inRange(d: Date): boolean {\n return !!(\n range.value &&\n start.value &&\n rangeEnd.value &&\n compareDays(d, start.value) > 0 &&\n compareDays(d, rangeEnd.value) < 0\n );\n}\nfunction dayLabel(d: Date, marked: boolean): string {\n return (\n loc.formatLong(d) +\n (sameDay(d, today) ? \", \" + t(\"todaySuffix\") : \"\") +\n (marked ? \", \" + (props.markLabel || t(\"timesAvailable\")) : \"\")\n );\n}\n\nfunction pickDay(d: Date) {\n if (off(d)) return;\n if (!range.value) {\n value.value = d;\n return;\n }\n const s = start.value;\n if (!s || end.value || compareDays(d, s) < 0) {\n start.value = d;\n end.value = null;\n emit(\"rangeChange\", { start: d, end: null });\n } else {\n end.value = d;\n emit(\"rangeChange\", { start: s, end: d });\n }\n}\nfunction clickDay(d: Date) {\n focus.value = d;\n focusId(dayId(d));\n pickDay(d);\n}\n\nfunction openView(v: \"months\" | \"years\") {\n view.value = v;\n if (v === \"months\") {\n pick.value = cm.value;\n focusId(`${uid.value}-m-${cm.value}`);\n } else {\n pick.value = cy.value;\n focusId(`${uid.value}-y-${cy.value}`);\n }\n}\nfunction backToDays() {\n view.value = \"days\";\n focusId(dayId(focus.value));\n}\nfunction back() {\n if (view.value === \"months\") openView(\"years\");\n else backToDays();\n}\nfunction chooseMonth(m: number) {\n if (monthOff(cy.value, m)) return;\n const nd = withMonthYear(cy.value, m);\n focus.value = nd;\n view.value = \"days\";\n focusId(dayId(nd));\n}\nfunction chooseYear(y: number) {\n if (yearOff(y)) return;\n const nd = withMonthYear(y, cm.value);\n focus.value = nd;\n view.value = \"months\";\n pick.value = nd.getMonth();\n focusId(`${uid.value}-m-${nd.getMonth()}`);\n}\nfunction step(n: number) {\n focus.value = clamp(addMonths(focus.value, n));\n}\n\nfunction sign(): number {\n if (config.dir) return config.dir === \"rtl\" ? -1 : 1;\n return root.value && getComputedStyle(root.value).direction === \"rtl\" ? -1 : 1;\n}\n\nfunction onDayKey(e: KeyboardEvent) {\n const f = focus.value;\n const dow = (f.getDay() - loc.weekStart.value + 7) % 7;\n const s = sign();\n let next: Date;\n let walk: number;\n switch (e.key) {\n case \"ArrowLeft\":\n walk = -s;\n next = addDays(f, walk);\n break;\n case \"ArrowRight\":\n walk = s;\n next = addDays(f, walk);\n break;\n case \"ArrowUp\":\n walk = -7;\n next = addDays(f, walk);\n break;\n case \"ArrowDown\":\n walk = 7;\n next = addDays(f, walk);\n break;\n case \"Home\":\n walk = 1;\n next = addDays(f, -dow);\n break;\n case \"End\":\n walk = -1;\n next = addDays(f, 6 - dow);\n break;\n case \"PageUp\":\n walk = -1;\n next = addMonths(f, e.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n walk = 1;\n next = addMonths(f, e.shiftKey ? 12 : 1);\n break;\n default:\n return;\n }\n e.preventDefault();\n const target = settle(next, walk);\n if (!target) return;\n focus.value = target;\n focusId(dayId(target));\n if (range.value && start.value && !end.value) hover.value = target;\n}\n\nfunction onPickKey(e: KeyboardEvent) {\n const months = view.value === \"months\";\n const lo = months ? 0 : yearLow.value;\n const hi = months ? 11 : yearHigh.value;\n const s = sign();\n let next: number | null = null;\n switch (e.key) {\n case \"ArrowLeft\":\n next = pick.value - s;\n break;\n case \"ArrowRight\":\n next = pick.value + s;\n break;\n case \"ArrowUp\":\n next = pick.value - 3;\n break;\n case \"ArrowDown\":\n next = pick.value + 3;\n break;\n case \"Home\":\n next = lo;\n break;\n case \"End\":\n next = hi;\n break;\n case \"PageUp\":\n if (!months) next = pick.value - 12;\n break;\n case \"PageDown\":\n if (!months) next = pick.value + 12;\n break;\n }\n if (next === null) return;\n e.preventDefault();\n next = Math.max(lo, Math.min(hi, next));\n pick.value = next;\n focusId(`${uid.value}-${months ? \"m\" : \"y\"}-${next}`);\n}\n\nfunction onRootKey(e: KeyboardEvent) {\n if (e.key !== \"Escape\" || view.value === \"days\") return;\n e.preventDefault();\n e.stopPropagation();\n backToDays();\n}\n\nfunction goToday() {\n const tc = clamp(today);\n focus.value = tc;\n focusId(dayId(tc));\n if (!range.value && !off(today)) pickDay(today);\n}\n\nconst shortDate = (d: Date) => `${loc.monthsShort.value[d.getMonth()]} ${d.getDate()}`;\nconst help = computed(() => {\n if (!range.value || view.value !== \"days\") return \"\";\n if (!start.value) return t(\"rangeStart\");\n if (!end.value) return t(\"rangeEnd\", { start: shortDate(start.value) });\n return t(\"rangeDone\", {\n start: shortDate(start.value),\n end: shortDate(end.value),\n days: Math.round(compareDays(end.value, start.value) / 864e5) + 1,\n });\n});\n\nconst picking = computed(() => view.value !== \"days\");\nconst prevOff = computed(() => !!props.min && compareDays(new Date(cy.value, cm.value, 0, 12), props.min) < 0);\nconst nextOff = computed(() => !!props.max && compareDays(new Date(cy.value, cm.value + 1, 1, 12), props.max) > 0);\nconst nowYear = today.getFullYear();\nconst nowMonth = today.getMonth();\n\ndefineExpose({\n view,\n focusDay: () => focusId(dayId(focus.value)),\n});\n</script>\n\n<template>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div ref=\"root\" class=\"e-cal\" :dir=\"config.dir ?? undefined\" @keydown=\"onRootKey\">\n <div class=\"e-cal-head\">\n <EIconButton\n v-if=\"picking\"\n icon=\"chevron-left\"\n :label=\"t(view === 'months' ? 'backToYears' : 'backToDays')\"\n @click=\"back\"\n />\n <EIconButton v-else icon=\"chevron-left\" :label=\"t('prevMonth')\" :disabled=\"prevOff\" @click=\"step(-1)\" />\n <div class=\"e-cal-title\" aria-live=\"polite\">\n <span v-if=\"picking\" class=\"e-cal-range\">{{\n t(view === \"months\" ? \"chooseAMonth\" : \"chooseAYear\", { year: cy })\n }}</span>\n <button\n v-else\n type=\"button\"\n class=\"e-cal-pick\"\n aria-expanded=\"false\"\n :aria-label=\"t('chooseDateNow', { month: loc.months.value[cm] ?? '', year: cy })\"\n @click=\"openView('years')\"\n >\n {{ loc.months.value[cm] }} {{ cy }}\n <EIcon name=\"chevron-down\" small />\n </button>\n </div>\n <span v-if=\"picking\" class=\"e-cal-gap\" />\n <EIconButton v-else icon=\"chevron-right\" :label=\"t('nextMonth')\" :disabled=\"nextOff\" @click=\"step(1)\" />\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -- the day buttons carry the roving tabindex -->\n <table\n v-if=\"view === 'days'\"\n class=\"e-cal-grid\"\n role=\"grid\"\n :aria-label=\"`${loc.months.value[cm]} ${cy}`\"\n @keydown=\"onDayKey\"\n >\n <thead>\n <tr>\n <th v-for=\"ix in columns\" :key=\"ix\" scope=\"col\" :abbr=\"loc.weekdays.value[ix]\">\n {{ loc.weekdaysShort.value[ix] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, w) in weeks\" :key=\"w\">\n <td\n v-for=\"d in row\"\n :key=\"dayKey(d)\"\n role=\"gridcell\"\n :aria-selected=\"isSelected(d) || inRange(d) ? 'true' : 'false'\"\n :class=\"inRange(d) && 'e-cal-in'\"\n >\n <button\n :id=\"dayId(d)\"\n type=\"button\"\n class=\"e-day\"\n :class=\"[\n d.getMonth() !== cm && 'e-day--out',\n sameDay(d, today) && 'e-day--today',\n isSelected(d) && 'e-day--sel',\n !off(d) && isMarked(d) && 'e-day--mark',\n ]\"\n :tabindex=\"sameDay(d, focus) ? 0 : -1\"\n :disabled=\"off(d)\"\n :aria-label=\"dayLabel(d, !off(d) && isMarked(d))\"\n @click=\"clickDay(d)\"\n @mouseenter=\"range && start && !end && (hover = d)\"\n @focus=\"range && start && !end && (hover = d)\"\n >\n {{ d.getDate() }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else-if=\"view === 'months'\"\n class=\"e-cal-cells\"\n role=\"group\"\n :aria-label=\"t('monthsOf', { year: cy })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"(name, m) in loc.months.value\"\n :id=\"`${uid}-m-${m}`\"\n :key=\"m\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[m === cm && 'e-day--sel', cy === nowYear && m === nowMonth && 'e-day--today']\"\n :tabindex=\"m === pick ? 0 : -1\"\n :disabled=\"monthOff(cy, m)\"\n :aria-pressed=\"m === cm ? 'true' : 'false'\"\n :aria-current=\"cy === nowYear && m === nowMonth ? 'date' : undefined\"\n @click=\"chooseMonth(m)\"\n >\n <span aria-hidden=\"true\">{{ loc.monthsShort.value[m] }}</span>\n <span class=\"e-sr\">{{ name }} {{ cy }}</span>\n </button>\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else\n class=\"e-cal-cells e-cal-years\"\n role=\"group\"\n :aria-label=\"t('yearsRange', { from: yearLow, to: yearHigh })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"y in years\"\n :id=\"`${uid}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[y === cy && 'e-day--sel', y === nowYear && 'e-day--today']\"\n :tabindex=\"y === pick ? 0 : -1\"\n :disabled=\"yearOff(y)\"\n :aria-pressed=\"y === cy ? 'true' : 'false'\"\n :aria-current=\"y === nowYear ? 'date' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n\n <p v-if=\"range\" class=\"e-cal-help\" aria-live=\"polite\">{{ help }}</p>\n\n <EActions v-if=\"footer\" class=\"e-cal-foot\" :class=\"view !== 'days' && 'e-cal-foot--idle'\" :inert=\"view !== 'days'\">\n <EButton variant=\"quiet\" @click=\"goToday\">{{ t(\"today\") }}</EButton>\n <EButton v-if=\"hasClear()\" variant=\"quiet\" @click=\"emit('clear')\">{{ t(\"clear\") }}</EButton>\n </EActions>\n </div>\n</template>\n\n<style>\n@layer e.composites {\n .e-cal {\n width: 20.5rem;\n max-width: 100%;\n font-family: var(--e-font-sans);\n }\n\n .e-cal-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--e-space-2);\n margin-bottom: var(--e-space-2);\n padding-bottom: var(--e-space-2);\n border-bottom: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-title {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-1);\n flex: 1;\n min-width: 0;\n margin: 0;\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n text-align: center;\n }\n\n .e-cal-pick {\n display: inline-flex;\n align-items: center;\n gap: var(--e-space-1);\n height: var(--e-control-height);\n padding: 0 var(--e-space-2);\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 600 var(--e-text-lg) / 1 var(--e-font-sans);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick:hover {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-cal-pick:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-cal-pick .e-icon {\n transition: transform var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick[aria-expanded=\"true\"] .e-icon {\n transform: rotate(180deg);\n }\n\n .e-cal-range {\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n font-variant-numeric: tabular-nums;\n }\n\n .e-cal-gap {\n display: block;\n width: var(--e-tap);\n height: var(--e-tap);\n }\n\n .e-cal-head .e-icon-btn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n }\n\n .e-cal-head .e-icon-btn:disabled:hover {\n background: transparent;\n box-shadow: none;\n }\n\n .e-cal-grid {\n width: 100%;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n border-collapse: collapse;\n table-layout: fixed;\n }\n\n .e-cal-grid th {\n height: var(--e-space-8);\n font: 600 var(--e-text-sm) / 1 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-grid td {\n padding: 1px 3px;\n text-align: center;\n }\n\n .e-cal-in {\n background: color-mix(in srgb, var(--e-primary) 12%, var(--e-surface));\n }\n\n .e-day {\n position: relative;\n width: 100%;\n height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-sm) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-day:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-day:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-day--out {\n color: var(--e-muted);\n font-weight: 400;\n }\n\n .e-day--today {\n box-shadow: inset 0 0 0 var(--e-stroke-edge) var(--e-primary);\n }\n\n .e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n\n --e-bc: var(--e-primary);\n\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-day:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n opacity: 1;\n }\n\n .e-day--mark::after {\n content: \"\";\n position: absolute;\n inset-inline-start: 50%;\n bottom: 5px;\n width: 5px;\n height: 5px;\n margin-inline-start: -2.5px;\n border-radius: 50%;\n background: var(--e-primary);\n }\n\n .e-day--sel.e-day--mark::after {\n background: var(--e-on-primary);\n }\n\n .e-cal-cells {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n gap: 6px;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n padding-top: var(--e-space-1);\n }\n\n .e-cal-years {\n overflow-y: auto;\n grid-auto-rows: var(--e-tap);\n padding-inline-end: 2px;\n align-content: start;\n }\n\n .e-cal-cell {\n width: 100%;\n height: 100%;\n min-height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n\n --e-bc: transparent;\n\n outline: var(--e-stroke-edge) solid var(--e-bc);\n outline-offset: calc(-1 * var(--e-stroke-edge));\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-md) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-years .e-cal-cell {\n height: var(--e-tap);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-cal-cell:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n --e-bc: var(--e-border-strong);\n }\n\n .e-cal-cell:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-cal-cell:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n }\n\n .e-cal-cell.e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n\n --e-bc: var(--e-primary);\n\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-cal-help {\n min-height: calc(var(--e-text-sm) * 1.4);\n margin: var(--e-space-2) 0 0;\n font: 500 var(--e-text-sm) / 1.4 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-foot {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--e-space-2);\n margin-top: var(--e-space-2);\n padding-top: var(--e-space-2);\n border-top: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-foot--idle {\n visibility: hidden;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-day,\n .e-cal-pick,\n .e-cal-cell,\n .e-cal-pick .e-icon {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-day--sel,\n .e-cal-cell.e-day--sel {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-day--mark::after {\n background: CanvasText;\n }\n\n .e-day--sel.e-day--mark::after {\n background: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,IAAMgD,IAAQC,GAwBRC,IAAOH,IAQPI,IAAQnD,EAAwBiD,GAAA,YAAkB,GAElDI,IAAQrD,EAAwBiD,GAAC,OAA0B,GAE3DK,IAAMtD,EAAwBiD,GAAC,KAAwB,GAIvDM,IAAIC,EAAY,GAChBC,IAASC,EAAU,GACnBC,IAAMC,EAAU,GAChBC,IAAMC,EAAO,GACbC,IAAOC,EAAwB,IAAI,GACnCC,IAAQC,QAAelB,EAAM,SAAS,OAAO,GAC7CmB,KAAWC,GAAmB,GAC9BC,WAAiBrB,EAAM,aAAa,CAAC,CAACmB,IAAU,MAAM,OAAO,SAE7DG,IAAQC,kBAAW,IAAI,KAAK,CAAC,GAC7BC,IAAQR,EAAIO,GAAYN,EAAM,QAAQZ,EAAM,QAAQF,EAAM,UAAUH,EAAM,yBAAS,IAAI,KAAK,CAAC,CAAC,GAC9FyB,IAAQT,EAAiB,IAAI,GAC7BU,IAAOV,EAAU,MAAM,GACvBW,IAAOX,EAAI,CAAC,GAEZY,IAAKV,QAAeM,EAAM,MAAM,YAAY,CAAC,GAC7CK,IAAKX,QAAeM,EAAM,MAAM,SAAS,CAAC,GAC1CM,IAAUZ,QAAe,KAAK,IAAIU,EAAG,OAAO5B,EAAM,MAAMA,EAAM,IAAI,YAAY,IAAIsB,EAAM,YAAY,IAAI,GAAG,CAAC,GAC5GS,KAAWb,QAAe,KAAK,IAAIU,EAAG,OAAO5B,EAAM,MAAMA,EAAM,IAAI,YAAY,IAAIsB,EAAM,YAAY,IAAI,EAAE,CAAC,GAC5GU,K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C,QAAgB,CAAbR,EAAAD,EAAAJ,EAAAoD,CAAA,CAAC,CAAA,OAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"ECalendar.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_unref","_createElementVNode","_createBlock","EIconButton","_toDisplayString","_createTextVNode","_createVNode","EIcon","_Fragment","_renderList","_normalizeClass","_createCommentVNode","EActions","_withCtx","EButton","EActions_default","EIcon_default","EButton_default","EIconButton_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","ECalendar_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","\"start\"","\"startModifiers\"","\"end\"","\"endModifiers\"","__expose","__emit","props","__props","emit","value","useModel","start","end","t","useMessages","config","useConfig","loc","useLocale","uid","useUid","root","ref","range","computed","instance","getCurrentInstance","hasClear","today","startOfDay","focus","hover","view","pick","cy","cm","yearLow","yearHigh","years","i","off","compareDays","d","isMarked","m","sameDay","x","monthOff","y","yearOff","clamp","settle","addDays","step","withMonthYear","last","want","focusWanted","nextTick","el","focusId","id","dayId","dayKey","watch","chosen","weeks","first","from","w","columns","k","rangeEnd","isSelected","inRange","dayLabel","marked","pickDay","s","clickDay","openView","v","backToDays","back","chooseMonth","nd","chooseYear","addMonths","n","sign","onDayKey","f","dow","next","walk","target","onPickKey","months","lo","hi","onRootKey","goToday","tc","shortDate","help","picking","prevOff","nextOff","nowYear","nowMonth","openBlock","createElementBlock","unref","createElementVNode","createBlock","_cache","toDisplayString","createTextVNode","createVNode","Fragment","renderList","ix","row","normalizeClass","name","createCommentVNode","withCtx"],"sources":["../../../src/components/Calendar/ECalendar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, nextTick, ref, watch } from \"vue\";\nimport EActions from \"../Actions/EActions.vue\";\nimport EButton from \"../Button/EButton.vue\";\nimport EIcon from \"../Icon/EIcon.vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport { useConfig, useMessages } from \"../../config.js\";\nimport { useLocale } from \"../../composables/useLocale.js\";\nimport { useUid } from \"../../composables/useUid.js\";\nimport { addDays, addMonths, compareDays, dayKey, sameDay, startOfDay } from \"./dates.js\";\nimport \"../../styles/base.css\";\n\nexport interface CalendarRange {\n start: Date | null;\n end: Date | null;\n}\n\nconst props = withDefaults(\n defineProps<{\n /** `single` chooses one day (`v-model`); `range` chooses a span (`v-model:start` and `v-model:end`): the first click sets the start, the second the end, and a click before the start restarts. */\n mode?: \"single\" | \"range\";\n /** Days that cannot be chosen or focused, such as days with nothing to book. Arrow keys skip them. */\n disabledDate?: (date: Date) => boolean;\n /** Days that get a dot: a list of dates or a function. Screen readers hear `markLabel`. */\n marked?: Date[] | ((date: Date) => boolean);\n /** What screen readers hear on a marked day. @default times available */\n markLabel?: string;\n /** The earliest day that can be chosen. Earlier days cannot be focused or chosen; navigation stops there. */\n min?: Date;\n /** The latest day that can be chosen. Later days cannot be focused or chosen; navigation stops there. */\n max?: Date;\n /** The month to open on, when nothing is chosen. Changing it moves the view. */\n month?: Date;\n /** `false` hides the Today and Clear buttons. */\n footer?: boolean;\n /** Forces the Clear button on or off. Left out, it shows when a `@clear` listener is attached. */\n clearable?: boolean;\n }>(),\n { mode: \"single\", footer: true, clearable: undefined },\n);\n\nconst emit = defineEmits<{\n /** In range mode, after every click that changes the span. */\n rangeChange: [range: CalendarRange];\n /** The Clear button. It is only shown when a `@clear` listener is attached. */\n clear: [];\n}>();\n\n/** The chosen day (`single` mode). */\nconst value = defineModel<Date | null>({ default: null });\n/** The first day of the span (`range` mode). */\nconst start = defineModel<Date | null>(\"start\", { default: null });\n/** The last day of the span (`range` mode). */\nconst end = defineModel<Date | null>(\"end\", { default: null });\n\ntype View = \"days\" | \"months\" | \"years\";\n\nconst t = useMessages();\nconst config = useConfig();\nconst loc = useLocale();\nconst uid = useUid();\nconst root = ref<HTMLElement | null>(null);\nconst range = computed(() => props.mode === \"range\");\nconst instance = getCurrentInstance();\nconst hasClear = () => props.clearable ?? !!instance?.vnode.props?.onClear;\n\nconst today = startOfDay(new Date());\nconst focus = ref(startOfDay((range.value ? start.value : value.value) || props.month || new Date()));\nconst hover = ref<Date | null>(null);\nconst view = ref<View>(\"days\");\nconst pick = ref(0);\n\nconst cy = computed(() => focus.value.getFullYear());\nconst cm = computed(() => focus.value.getMonth());\nconst yearLow = computed(() => Math.min(cy.value, props.min ? props.min.getFullYear() : today.getFullYear() - 120));\nconst yearHigh = computed(() => Math.max(cy.value, props.max ? props.max.getFullYear() : today.getFullYear() + 20));\nconst years = computed(() => Array.from({ length: yearHigh.value - yearLow.value + 1 }, (_, i) => yearLow.value + i));\n\nfunction off(d: Date): boolean {\n return (\n (!!props.min && compareDays(d, props.min) < 0) ||\n (!!props.max && compareDays(d, props.max) > 0) ||\n !!props.disabledDate?.(d)\n );\n}\nfunction isMarked(d: Date): boolean {\n const m = props.marked;\n if (!m) return false;\n return typeof m === \"function\" ? !!m(d) : m.some((x) => sameDay(x, d));\n}\nfunction monthOff(y: number, m: number): boolean {\n return (\n (!!props.min && compareDays(new Date(y, m + 1, 0, 12), props.min) < 0) ||\n (!!props.max && compareDays(new Date(y, m, 1, 12), props.max) > 0)\n );\n}\nconst yearOff = (y: number) =>\n (!!props.min && y < props.min.getFullYear()) || (!!props.max && y > props.max.getFullYear());\nfunction clamp(d: Date): Date {\n if (props.min && compareDays(d, props.min) < 0) return startOfDay(props.min);\n if (props.max && compareDays(d, props.max) > 0) return startOfDay(props.max);\n return d;\n}\nfunction settle(d: Date, step: number): Date | null {\n let n = d;\n for (let i = 0; i < 400 && off(n); i++) n = addDays(n, step);\n return off(n) ? null : n;\n}\nfunction withMonthYear(y: number, m: number): Date {\n const last = new Date(y, m + 1, 0, 12).getDate();\n return clamp(new Date(y, m, Math.min(focus.value.getDate(), last), 12));\n}\n\nif (off(focus.value)) focus.value = settle(focus.value, 1) ?? settle(focus.value, -1) ?? focus.value;\n\nlet want: string | null = null;\nasync function focusWanted() {\n await nextTick();\n if (!want) return;\n const el = root.value?.querySelector<HTMLElement>(`[id=\"${want}\"]`);\n if (!el) return;\n el.focus();\n if (want.includes(\"-y-\")) el.scrollIntoView?.({ block: \"center\" });\n want = null;\n}\nfunction focusId(id: string) {\n want = id;\n void focusWanted();\n}\nconst dayId = (d: Date) => `${uid.value}-${dayKey(d)}`;\n\nwatch(\n () => props.month?.getTime(),\n () => {\n if (props.month) focus.value = clamp(startOfDay(props.month));\n },\n);\nwatch(\n () => (range.value ? start.value : value.value)?.getTime(),\n () => {\n const chosen = range.value ? start.value : value.value;\n if (chosen && !sameDay(chosen, focus.value)) focus.value = startOfDay(chosen);\n },\n);\n\nconst weeks = computed(() => {\n const first = new Date(cy.value, cm.value, 1, 12);\n const from = addDays(first, -((first.getDay() - loc.weekStart.value + 7) % 7));\n return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(from, w * 7 + i)));\n});\nconst columns = computed(() => Array.from({ length: 7 }, (_, k) => (loc.weekStart.value + k) % 7));\nconst rangeEnd = computed(() => {\n if (!range.value) return null;\n return end.value || (start.value && hover.value && compareDays(hover.value, start.value) >= 0 ? hover.value : null);\n});\n\nfunction isSelected(d: Date): boolean {\n return range.value ? sameDay(d, start.value) || sameDay(d, end.value) : sameDay(d, value.value);\n}\nfunction inRange(d: Date): boolean {\n return !!(\n range.value &&\n start.value &&\n rangeEnd.value &&\n compareDays(d, start.value) > 0 &&\n compareDays(d, rangeEnd.value) < 0\n );\n}\nfunction dayLabel(d: Date, marked: boolean): string {\n return (\n loc.formatLong(d) +\n (sameDay(d, today) ? \", \" + t(\"todaySuffix\") : \"\") +\n (marked ? \", \" + (props.markLabel || t(\"timesAvailable\")) : \"\")\n );\n}\n\nfunction pickDay(d: Date) {\n if (off(d)) return;\n if (!range.value) {\n value.value = d;\n return;\n }\n const s = start.value;\n if (!s || end.value || compareDays(d, s) < 0) {\n start.value = d;\n end.value = null;\n emit(\"rangeChange\", { start: d, end: null });\n } else {\n end.value = d;\n emit(\"rangeChange\", { start: s, end: d });\n }\n}\nfunction clickDay(d: Date) {\n focus.value = d;\n focusId(dayId(d));\n pickDay(d);\n}\n\nfunction openView(v: \"months\" | \"years\") {\n view.value = v;\n if (v === \"months\") {\n pick.value = cm.value;\n focusId(`${uid.value}-m-${cm.value}`);\n } else {\n pick.value = cy.value;\n focusId(`${uid.value}-y-${cy.value}`);\n }\n}\nfunction backToDays() {\n view.value = \"days\";\n focusId(dayId(focus.value));\n}\nfunction back() {\n if (view.value === \"months\") openView(\"years\");\n else backToDays();\n}\nfunction chooseMonth(m: number) {\n if (monthOff(cy.value, m)) return;\n const nd = withMonthYear(cy.value, m);\n focus.value = nd;\n view.value = \"days\";\n focusId(dayId(nd));\n}\nfunction chooseYear(y: number) {\n if (yearOff(y)) return;\n const nd = withMonthYear(y, cm.value);\n focus.value = nd;\n view.value = \"months\";\n pick.value = nd.getMonth();\n focusId(`${uid.value}-m-${nd.getMonth()}`);\n}\nfunction step(n: number) {\n focus.value = clamp(addMonths(focus.value, n));\n}\n\nfunction sign(): number {\n if (config.dir) return config.dir === \"rtl\" ? -1 : 1;\n return root.value && getComputedStyle(root.value).direction === \"rtl\" ? -1 : 1;\n}\n\nfunction onDayKey(e: KeyboardEvent) {\n const f = focus.value;\n const dow = (f.getDay() - loc.weekStart.value + 7) % 7;\n const s = sign();\n let next: Date;\n let walk: number;\n switch (e.key) {\n case \"ArrowLeft\":\n walk = -s;\n next = addDays(f, walk);\n break;\n case \"ArrowRight\":\n walk = s;\n next = addDays(f, walk);\n break;\n case \"ArrowUp\":\n walk = -7;\n next = addDays(f, walk);\n break;\n case \"ArrowDown\":\n walk = 7;\n next = addDays(f, walk);\n break;\n case \"Home\":\n walk = 1;\n next = addDays(f, -dow);\n break;\n case \"End\":\n walk = -1;\n next = addDays(f, 6 - dow);\n break;\n case \"PageUp\":\n walk = -1;\n next = addMonths(f, e.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n walk = 1;\n next = addMonths(f, e.shiftKey ? 12 : 1);\n break;\n default:\n return;\n }\n e.preventDefault();\n const target = settle(next, walk);\n if (!target) return;\n focus.value = target;\n focusId(dayId(target));\n if (range.value && start.value && !end.value) hover.value = target;\n}\n\nfunction onPickKey(e: KeyboardEvent) {\n const months = view.value === \"months\";\n const lo = months ? 0 : yearLow.value;\n const hi = months ? 11 : yearHigh.value;\n const s = sign();\n let next: number | null = null;\n switch (e.key) {\n case \"ArrowLeft\":\n next = pick.value - s;\n break;\n case \"ArrowRight\":\n next = pick.value + s;\n break;\n case \"ArrowUp\":\n next = pick.value - 3;\n break;\n case \"ArrowDown\":\n next = pick.value + 3;\n break;\n case \"Home\":\n next = lo;\n break;\n case \"End\":\n next = hi;\n break;\n case \"PageUp\":\n if (!months) next = pick.value - 12;\n break;\n case \"PageDown\":\n if (!months) next = pick.value + 12;\n break;\n }\n if (next === null) return;\n e.preventDefault();\n next = Math.max(lo, Math.min(hi, next));\n pick.value = next;\n focusId(`${uid.value}-${months ? \"m\" : \"y\"}-${next}`);\n}\n\nfunction onRootKey(e: KeyboardEvent) {\n if (e.key !== \"Escape\" || view.value === \"days\") return;\n e.preventDefault();\n e.stopPropagation();\n backToDays();\n}\n\nfunction goToday() {\n const tc = clamp(today);\n focus.value = tc;\n focusId(dayId(tc));\n if (!range.value && !off(today)) pickDay(today);\n}\n\nconst shortDate = (d: Date) => `${loc.monthsShort.value[d.getMonth()]} ${d.getDate()}`;\nconst help = computed(() => {\n if (!range.value || view.value !== \"days\") return \"\";\n if (!start.value) return t(\"rangeStart\");\n if (!end.value) return t(\"rangeEnd\", { start: shortDate(start.value) });\n return t(\"rangeDone\", {\n start: shortDate(start.value),\n end: shortDate(end.value),\n days: Math.round(compareDays(end.value, start.value) / 864e5) + 1,\n });\n});\n\nconst picking = computed(() => view.value !== \"days\");\nconst prevOff = computed(() => !!props.min && compareDays(new Date(cy.value, cm.value, 0, 12), props.min) < 0);\nconst nextOff = computed(() => !!props.max && compareDays(new Date(cy.value, cm.value + 1, 1, 12), props.max) > 0);\nconst nowYear = today.getFullYear();\nconst nowMonth = today.getMonth();\n\ndefineExpose({\n view,\n focusDay: () => focusId(dayId(focus.value)),\n});\n</script>\n\n<template>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div ref=\"root\" class=\"e-cal\" :dir=\"config.dir ?? undefined\" @keydown=\"onRootKey\">\n <div class=\"e-cal-head\">\n <EIconButton\n v-if=\"picking\"\n icon=\"chevron-left\"\n :label=\"t(view === 'months' ? 'backToYears' : 'backToDays')\"\n @click=\"back\"\n />\n <EIconButton v-else icon=\"chevron-left\" :label=\"t('prevMonth')\" :disabled=\"prevOff\" @click=\"step(-1)\" />\n <div class=\"e-cal-title\" aria-live=\"polite\">\n <span v-if=\"picking\" class=\"e-cal-range\">{{\n t(view === \"months\" ? \"chooseAMonth\" : \"chooseAYear\", { year: cy })\n }}</span>\n <button\n v-else\n type=\"button\"\n class=\"e-cal-pick\"\n aria-expanded=\"false\"\n :aria-label=\"t('chooseDateNow', { month: loc.months.value[cm] ?? '', year: cy })\"\n @click=\"openView('years')\"\n >\n {{ loc.months.value[cm] }} {{ cy }}\n <EIcon name=\"chevron-down\" small />\n </button>\n </div>\n <span v-if=\"picking\" class=\"e-cal-gap\" />\n <EIconButton v-else icon=\"chevron-right\" :label=\"t('nextMonth')\" :disabled=\"nextOff\" @click=\"step(1)\" />\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -- the day buttons carry the roving tabindex -->\n <table\n v-if=\"view === 'days'\"\n class=\"e-cal-grid\"\n role=\"grid\"\n :aria-label=\"`${loc.months.value[cm]} ${cy}`\"\n @keydown=\"onDayKey\"\n >\n <thead>\n <tr>\n <th v-for=\"ix in columns\" :key=\"ix\" scope=\"col\" :abbr=\"loc.weekdays.value[ix]\">\n {{ loc.weekdaysShort.value[ix] }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, w) in weeks\" :key=\"w\">\n <td\n v-for=\"d in row\"\n :key=\"dayKey(d)\"\n role=\"gridcell\"\n :aria-selected=\"isSelected(d) || inRange(d) ? 'true' : 'false'\"\n :class=\"inRange(d) && 'e-cal-in'\"\n >\n <button\n :id=\"dayId(d)\"\n type=\"button\"\n class=\"e-day\"\n :class=\"[\n d.getMonth() !== cm && 'e-day--out',\n sameDay(d, today) && 'e-day--today',\n isSelected(d) && 'e-day--sel',\n !off(d) && isMarked(d) && 'e-day--mark',\n ]\"\n :tabindex=\"sameDay(d, focus) ? 0 : -1\"\n :disabled=\"off(d)\"\n :aria-label=\"dayLabel(d, !off(d) && isMarked(d))\"\n @click=\"clickDay(d)\"\n @mouseenter=\"range && start && !end && (hover = d)\"\n @focus=\"range && start && !end && (hover = d)\"\n >\n {{ d.getDate() }}\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else-if=\"view === 'months'\"\n class=\"e-cal-cells\"\n role=\"group\"\n :aria-label=\"t('monthsOf', { year: cy })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"(name, m) in loc.months.value\"\n :id=\"`${uid}-m-${m}`\"\n :key=\"m\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[m === cm && 'e-day--sel', cy === nowYear && m === nowMonth && 'e-day--today']\"\n :tabindex=\"m === pick ? 0 : -1\"\n :disabled=\"monthOff(cy, m)\"\n :aria-pressed=\"m === cm ? 'true' : 'false'\"\n :aria-current=\"cy === nowYear && m === nowMonth ? 'date' : undefined\"\n @click=\"chooseMonth(m)\"\n >\n <span aria-hidden=\"true\">{{ loc.monthsShort.value[m] }}</span>\n <span class=\"e-sr\">{{ name }} {{ cy }}</span>\n </button>\n </div>\n\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n v-else\n class=\"e-cal-cells e-cal-years\"\n role=\"group\"\n :aria-label=\"t('yearsRange', { from: yearLow, to: yearHigh })\"\n @keydown=\"onPickKey\"\n >\n <button\n v-for=\"y in years\"\n :id=\"`${uid}-y-${y}`\"\n :key=\"y\"\n type=\"button\"\n class=\"e-cal-cell\"\n :class=\"[y === cy && 'e-day--sel', y === nowYear && 'e-day--today']\"\n :tabindex=\"y === pick ? 0 : -1\"\n :disabled=\"yearOff(y)\"\n :aria-pressed=\"y === cy ? 'true' : 'false'\"\n :aria-current=\"y === nowYear ? 'date' : undefined\"\n @click=\"chooseYear(y)\"\n >\n {{ y }}\n </button>\n </div>\n\n <p v-if=\"range\" class=\"e-cal-help\" aria-live=\"polite\">{{ help }}</p>\n\n <EActions v-if=\"footer\" class=\"e-cal-foot\" :class=\"view !== 'days' && 'e-cal-foot--idle'\" :inert=\"view !== 'days'\">\n <EButton variant=\"quiet\" @click=\"goToday\">{{ t(\"today\") }}</EButton>\n <EButton v-if=\"hasClear()\" variant=\"quiet\" @click=\"emit('clear')\">{{ t(\"clear\") }}</EButton>\n </EActions>\n </div>\n</template>\n\n<style>\n@layer e.composites {\n .e-cal {\n width: 20.5rem;\n max-width: 100%;\n font-family: var(--e-font-sans);\n }\n\n .e-cal-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--e-space-2);\n margin-bottom: var(--e-space-2);\n padding-bottom: var(--e-space-2);\n border-bottom: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-title {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--e-space-1);\n flex: 1;\n min-width: 0;\n margin: 0;\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n text-align: center;\n }\n\n .e-cal-pick {\n display: inline-flex;\n align-items: center;\n gap: var(--e-space-1);\n height: var(--e-control-height);\n padding: 0 var(--e-space-2);\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 600 var(--e-text-lg) / 1 var(--e-font-sans);\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick:hover {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-cal-pick:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: var(--e-focus-gap);\n }\n\n .e-cal-pick .e-icon {\n transition: transform var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-pick[aria-expanded=\"true\"] .e-icon {\n transform: rotate(180deg);\n }\n\n .e-cal-range {\n font: 600 var(--e-text-lg) / 1.2 var(--e-font-sans);\n font-variant-numeric: tabular-nums;\n }\n\n .e-cal-gap {\n display: block;\n width: var(--e-tap);\n height: var(--e-tap);\n }\n\n .e-cal-head .e-icon-btn:disabled {\n color: var(--e-muted);\n cursor: not-allowed;\n }\n\n .e-cal-head .e-icon-btn:disabled:hover {\n background: transparent;\n box-shadow: none;\n }\n\n .e-cal-grid {\n width: 100%;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n border-collapse: collapse;\n table-layout: fixed;\n }\n\n .e-cal-grid th {\n height: var(--e-space-8);\n font: 600 var(--e-text-sm) / 1 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-grid td {\n padding: 1px 3px;\n text-align: center;\n }\n\n .e-cal-in {\n background: color-mix(in srgb, var(--e-primary) 12%, var(--e-surface));\n }\n\n .e-day {\n position: relative;\n width: 100%;\n height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-sm) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-day:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-day:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-day--out {\n color: var(--e-muted);\n font-weight: 400;\n }\n\n .e-day--today {\n box-shadow: inset 0 0 0 var(--e-stroke-edge) var(--e-primary);\n }\n\n .e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-day:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n opacity: 1;\n }\n\n .e-day--mark::after {\n content: \"\";\n position: absolute;\n inset-inline-start: 50%;\n bottom: 5px;\n width: 5px;\n height: 5px;\n margin-inline-start: -2.5px;\n border-radius: 50%;\n background: var(--e-primary);\n }\n\n .e-day--sel.e-day--mark::after {\n background: var(--e-on-primary);\n }\n\n .e-cal-cells {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: 1fr;\n gap: 6px;\n height: calc(6 * var(--e-tap) + var(--e-space-8) + var(--e-space-4));\n padding-top: var(--e-space-1);\n }\n\n .e-cal-years {\n overflow-y: auto;\n grid-auto-rows: var(--e-tap);\n padding-inline-end: 2px;\n align-content: start;\n }\n\n .e-cal-cell {\n width: 100%;\n height: 100%;\n min-height: var(--e-tap);\n padding: 0;\n border: var(--e-stroke-edge) solid transparent;\n border-radius: var(--e-radius-md);\n background: transparent;\n color: var(--e-ink);\n font: 500 var(--e-text-md) / 1 var(--e-font-mono);\n font-variant-numeric: tabular-nums;\n cursor: pointer;\n transition: background-color var(--e-duration-tap) var(--e-easing-out);\n }\n\n .e-cal-years .e-cal-cell {\n height: var(--e-tap);\n }\n\n /* stylelint-disable-next-line selector-not-notation -- the selector stays in this form */\n .e-cal-cell:hover:not(:disabled):not(.e-day--sel) {\n background: var(--e-surface-hover);\n border-color: var(--e-border-strong);\n\n }\n\n .e-cal-cell:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n }\n\n .e-cal-cell:disabled {\n color: var(--e-border-strong);\n font-weight: 400;\n cursor: not-allowed;\n }\n\n .e-cal-cell.e-day--sel {\n background: var(--e-primary);\n border-color: var(--e-primary);\n font-weight: 700;\n color: var(--e-on-primary);\n }\n\n .e-cal-help {\n min-height: calc(var(--e-text-sm) * 1.4);\n margin: var(--e-space-2) 0 0;\n font: 500 var(--e-text-sm) / 1.4 var(--e-font-sans);\n color: var(--e-muted);\n text-align: center;\n }\n\n .e-cal-foot {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: var(--e-space-2);\n margin-top: var(--e-space-2);\n padding-top: var(--e-space-2);\n border-top: var(--e-stroke-hair) solid var(--e-border);\n }\n\n .e-cal-foot--idle {\n visibility: hidden;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .e-day,\n .e-cal-pick,\n .e-cal-cell,\n .e-cal-pick .e-icon {\n transition: none;\n }\n }\n\n @media (forced-colors: active) {\n .e-day--sel,\n .e-cal-cell.e-day--sel {\n forced-color-adjust: none;\n background: Highlight;\n color: HighlightText;\n }\n\n .e-day--mark::after {\n background: CanvasText;\n }\n\n .e-day--sel.e-day--mark::after {\n background: HighlightText;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,IAAMgD,IAAQC,GAwBRC,IAAOH,IAQPI,IAAQnD,EAAwBiD,GAAA,YAAkB,GAElDI,IAAQrD,EAAwBiD,GAAC,OAA0B,GAE3DK,IAAMtD,EAAwBiD,GAAC,KAAwB,GAIvDM,IAAIC,EAAY,GAChBC,IAASC,EAAU,GACnBC,IAAMC,EAAU,GAChBC,IAAMC,EAAO,GACbC,IAAOC,EAAwB,IAAI,GACnCC,IAAQC,QAAelB,EAAM,SAAS,OAAO,GAC7CmB,K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AY,KAAA;IACvC,UAAK,MAAEtB,GAAWtC,CAAC;GAEjB,GAAAnF,EAAAmF,CAAC,GAAA,IAAArD,EAAA,E;GAIC4B,EAAA,SAAThE,EAAA,GAAAC,EAAoE,KAApEoC,IAAoE/B,EAAX2I,GAAA,KAAI,GAAA,CAAA,K;GAE7CjG,EAAA,UAAhBhD,EAAA,GAAAI,EAGWU,GAAA;;IAHa,OAAKF,EAAA,CAAC,cAAqB6D,EAAA,UAAI,UAAA,kBAAA,CAAA;IAAoC,OAAOA,EAAA,UAAI;;IACpG,SAAA1D,QAAoE,CAApEP,GAAoEQ,GAAA;KAA3D,SAAQ;KAAS,SAAO8H;;KAAS,SAAA/H,QAAgB,CAAbR,EAAAD,EAAAJ,EAAAoD,CAAA,CAAC,CAAA,OAAA,CAAA,GAAA,CAAA,C;;I,IAC/Bc,GAAQ,KAAvBpE,EAAA,GAAAI,EAA4FY,GAAA;;KAAjE,SAAQ;KAAS,SAAK,AAAA4I,EAAA,QAAA,MAAE3G,EAAI,OAAA;;KAAW,SAAAlC,QAAgB,CAAbR,EAAAD,EAAAJ,EAAAoD,CAAA,CAAC,CAAA,OAAA,CAAA,GAAA,CAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ECodeBlock.js","names":["_sfc_main","ECodeBlock_vue_vue_type_script_setup_true_lang_default","ECodeBlock_default"],"sources":["../../../src/components/CodeBlock/ECodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { h, ref } from \"vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport EVisuallyHidden from \"../VisuallyHidden/EVisuallyHidden.vue\";\nimport { useMessages } from \"../../config.js\";\nimport \"../../styles/base.css\";\n\nconst props = defineProps<{\n /** The text to show, as plain text. Leave it out to use the slot and put your own highlighted markup there. */\n code?: string;\n /** The language, named for screen readers (the code's accessible name). */\n lang?: string;\n /** The copy button's name; say what is copied when a page has several. @default \"Copy code\" */\n copyLabel?: string;\n}>();\n\ndefineSlots<{\n /** Your own markup, usually a highlighted `<pre><code>`. The copy button copies the text of the first `<pre>`. */\n default?(): unknown;\n}>();\n\nconst t = useMessages();\n\nconst CopyIcon = () =>\n h(\n \"svg\",\n { viewBox: \"0 0 20 20\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.6\", \"aria-hidden\": \"true\" },\n [\n h(\"rect\", { x: \"7\", y: \"7\", width: \"9\", height: \"9\", rx: \"2\" }),\n h(\"path\", { d: \"M13 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" }),\n ],\n );\n\nconst root = ref<HTMLElement | null>(null);\nconst copied = ref(false);\n\nasync function copy() {\n const text = props.code ?? root.value?.querySelector(\"pre\")?.textContent ?? \"\";\n try {\n await navigator.clipboard.writeText(text);\n copied.value = true;\n setTimeout(() => (copied.value = false), 2000);\n } catch {}\n}\n</script>\n\n<template>\n <div ref=\"root\" class=\"e-code\">\n <div class=\"e-code-body\">\n <slot>\n <pre tabindex=\"0\" :aria-label=\"lang\"><code>{{ code }}</code></pre>\n </slot>\n </div>\n <div class=\"e-code-side\">\n <EIconButton :icon=\"copied ? 'check' : CopyIcon\" :label=\"copyLabel || t('copyCode')\" @click=\"copy\" />\n </div>\n <EVisuallyHidden role=\"status\">{{ copied ? t(\"codeCopied\") : \"\" }}</EVisuallyHidden>\n </div>\n</template>\n\n<style>\n@layer e.blocks {\n .e-code {\n /* The colours a Shiki dual-theme (css-variables) highlighter reads for syntax tokens. */\n --shiki-foreground: var(--e-ink);\n --shiki-background: transparent;\n --shiki-token-comment: var(--e-muted);\n --shiki-token-keyword: var(--e-primary);\n --shiki-token-function: var(--e-primary);\n --shiki-token-string: var(--e-secondary);\n --shiki-token-string-expression: var(--e-secondary);\n --shiki-token-constant: var(--e-warning-strong);\n --shiki-token-parameter: var(--e-ink);\n --shiki-token-punctuation: var(--e-muted);\n --shiki-token-link: var(--e-primary);\n\n display: flex;\n align-items: stretch;\n min-width: 0;\n overflow: hidden;\n border-radius: var(--e-radius-md);\n background: var(--e-surface);\n box-shadow: var(--e-edge);\n outline: var(--e-stroke-card) solid var(--e-border);\n outline-offset: 0;\n }\n\n /* Code blocks stacked back to back share one seam: the rings overlap into a single line. */\n .e-code:has(+ .e-code) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n .e-code + .e-code {\n margin-top: max(var(--e-stroke-card), 1px);\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n .e-code-body {\n display: grid;\n flex: 1;\n align-content: center;\n min-width: 0;\n overflow-x: auto;\n }\n\n .e-code pre {\n margin: 0;\n padding: var(--e-space-3) var(--e-space-4);\n background: transparent;\n font: 400 var(--e-text-sm) / 1.6 var(--e-font-mono);\n color: var(--e-ink);\n }\n\n .e-code pre:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n border-radius: var(--e-radius-md);\n }\n\n .e-code code {\n display: block;\n width: fit-content;\n min-width: 100%;\n padding: 0;\n background: transparent;\n font: inherit;\n }\n\n .e-code-side {\n flex: none;\n align-self: flex-start;\n padding: var(--e-space-1);\n }\n\n @media print {\n .e-code-side {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ECodeBlock.js","names":["_sfc_main","ECodeBlock_vue_vue_type_script_setup_true_lang_default","ECodeBlock_default"],"sources":["../../../src/components/CodeBlock/ECodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { h, ref } from \"vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport EVisuallyHidden from \"../VisuallyHidden/EVisuallyHidden.vue\";\nimport { useMessages } from \"../../config.js\";\nimport \"../../styles/base.css\";\n\nconst props = defineProps<{\n /** The text to show, as plain text. Leave it out to use the slot and put your own highlighted markup there. */\n code?: string;\n /** The language, named for screen readers (the code's accessible name). */\n lang?: string;\n /** The copy button's name; say what is copied when a page has several. @default \"Copy code\" */\n copyLabel?: string;\n}>();\n\ndefineSlots<{\n /** Your own markup, usually a highlighted `<pre><code>`. The copy button copies the text of the first `<pre>`. */\n default?(): unknown;\n}>();\n\nconst t = useMessages();\n\nconst CopyIcon = () =>\n h(\n \"svg\",\n { viewBox: \"0 0 20 20\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.6\", \"aria-hidden\": \"true\" },\n [\n h(\"rect\", { x: \"7\", y: \"7\", width: \"9\", height: \"9\", rx: \"2\" }),\n h(\"path\", { d: \"M13 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" }),\n ],\n );\n\nconst root = ref<HTMLElement | null>(null);\nconst copied = ref(false);\n\nasync function copy() {\n const text = props.code ?? root.value?.querySelector(\"pre\")?.textContent ?? \"\";\n try {\n await navigator.clipboard.writeText(text);\n copied.value = true;\n setTimeout(() => (copied.value = false), 2000);\n } catch {}\n}\n</script>\n\n<template>\n <div ref=\"root\" class=\"e-code\">\n <div class=\"e-code-body\">\n <slot>\n <pre tabindex=\"0\" :aria-label=\"lang\"><code>{{ code }}</code></pre>\n </slot>\n </div>\n <div class=\"e-code-side\">\n <EIconButton :icon=\"copied ? 'check' : CopyIcon\" :label=\"copyLabel || t('copyCode')\" @click=\"copy\" />\n </div>\n <EVisuallyHidden role=\"status\">{{ copied ? t(\"codeCopied\") : \"\" }}</EVisuallyHidden>\n </div>\n</template>\n\n<style>\n@layer e.blocks {\n .e-code {\n /* The colours a Shiki dual-theme (css-variables) highlighter reads for syntax tokens. */\n --shiki-foreground: var(--e-ink);\n --shiki-background: transparent;\n --shiki-token-comment: var(--e-muted);\n --shiki-token-keyword: var(--e-primary);\n --shiki-token-function: var(--e-primary);\n --shiki-token-string: var(--e-secondary);\n --shiki-token-string-expression: var(--e-secondary);\n --shiki-token-constant: var(--e-warning-strong);\n --shiki-token-parameter: var(--e-ink);\n --shiki-token-punctuation: var(--e-muted);\n --shiki-token-link: var(--e-primary);\n\n display: flex;\n align-items: stretch;\n min-width: 0;\n overflow: hidden;\n border-radius: var(--e-radius-md);\n background: var(--e-surface);\n box-shadow: var(--e-edge);\n }\n\n /* Code blocks stacked back to back share one seam: the rings overlap into a single line. */\n .e-code:has(+ .e-code) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n .e-code + .e-code {\n margin-top: max(var(--e-stroke-card), 1px);\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n .e-code-body {\n display: grid;\n flex: 1;\n align-content: center;\n min-width: 0;\n overflow-x: auto;\n }\n\n .e-code pre {\n margin: 0;\n padding: var(--e-space-3) var(--e-space-4);\n background: transparent;\n font: 400 var(--e-text-sm) / 1.6 var(--e-font-mono);\n color: var(--e-ink);\n }\n\n .e-code pre:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n border-radius: var(--e-radius-md);\n }\n\n .e-code code {\n display: block;\n width: fit-content;\n min-width: 100%;\n padding: 0;\n background: transparent;\n font: inherit;\n }\n\n .e-code-side {\n flex: none;\n align-self: flex-start;\n padding: var(--e-space-1);\n }\n\n @media print {\n .e-code-side {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ECodeBlock.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_toDisplayString","_createVNode","EIconButton","_unref","EVisuallyHidden","_withCtx","_createTextVNode","EIconButton_default","EVisuallyHidden_default","_hoisted_1","_hoisted_2","_hoisted_3","ECodeBlock_vue_vue_type_script_setup_true_lang_default","props","__props","t","useMessages","CopyIcon","h","root","ref","copied","copy","text","openBlock","createElementBlock","createElementVNode","renderSlot","_ctx","toDisplayString","createVNode","unref","withCtx","createTextVNode"],"sources":["../../../src/components/CodeBlock/ECodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { h, ref } from \"vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport EVisuallyHidden from \"../VisuallyHidden/EVisuallyHidden.vue\";\nimport { useMessages } from \"../../config.js\";\nimport \"../../styles/base.css\";\n\nconst props = defineProps<{\n /** The text to show, as plain text. Leave it out to use the slot and put your own highlighted markup there. */\n code?: string;\n /** The language, named for screen readers (the code's accessible name). */\n lang?: string;\n /** The copy button's name; say what is copied when a page has several. @default \"Copy code\" */\n copyLabel?: string;\n}>();\n\ndefineSlots<{\n /** Your own markup, usually a highlighted `<pre><code>`. The copy button copies the text of the first `<pre>`. */\n default?(): unknown;\n}>();\n\nconst t = useMessages();\n\nconst CopyIcon = () =>\n h(\n \"svg\",\n { viewBox: \"0 0 20 20\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.6\", \"aria-hidden\": \"true\" },\n [\n h(\"rect\", { x: \"7\", y: \"7\", width: \"9\", height: \"9\", rx: \"2\" }),\n h(\"path\", { d: \"M13 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" }),\n ],\n );\n\nconst root = ref<HTMLElement | null>(null);\nconst copied = ref(false);\n\nasync function copy() {\n const text = props.code ?? root.value?.querySelector(\"pre\")?.textContent ?? \"\";\n try {\n await navigator.clipboard.writeText(text);\n copied.value = true;\n setTimeout(() => (copied.value = false), 2000);\n } catch {}\n}\n</script>\n\n<template>\n <div ref=\"root\" class=\"e-code\">\n <div class=\"e-code-body\">\n <slot>\n <pre tabindex=\"0\" :aria-label=\"lang\"><code>{{ code }}</code></pre>\n </slot>\n </div>\n <div class=\"e-code-side\">\n <EIconButton :icon=\"copied ? 'check' : CopyIcon\" :label=\"copyLabel || t('copyCode')\" @click=\"copy\" />\n </div>\n <EVisuallyHidden role=\"status\">{{ copied ? t(\"codeCopied\") : \"\" }}</EVisuallyHidden>\n </div>\n</template>\n\n<style>\n@layer e.blocks {\n .e-code {\n /* The colours a Shiki dual-theme (css-variables) highlighter reads for syntax tokens. */\n --shiki-foreground: var(--e-ink);\n --shiki-background: transparent;\n --shiki-token-comment: var(--e-muted);\n --shiki-token-keyword: var(--e-primary);\n --shiki-token-function: var(--e-primary);\n --shiki-token-string: var(--e-secondary);\n --shiki-token-string-expression: var(--e-secondary);\n --shiki-token-constant: var(--e-warning-strong);\n --shiki-token-parameter: var(--e-ink);\n --shiki-token-punctuation: var(--e-muted);\n --shiki-token-link: var(--e-primary);\n\n display: flex;\n align-items: stretch;\n min-width: 0;\n overflow: hidden;\n border-radius: var(--e-radius-md);\n background: var(--e-surface);\n box-shadow: var(--e-edge);\n outline: var(--e-stroke-card) solid var(--e-border);\n outline-offset: 0;\n }\n\n /* Code blocks stacked back to back share one seam: the rings overlap into a single line. */\n .e-code:has(+ .e-code) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n .e-code + .e-code {\n margin-top: max(var(--e-stroke-card), 1px);\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n .e-code-body {\n display: grid;\n flex: 1;\n align-content: center;\n min-width: 0;\n overflow-x: auto;\n }\n\n .e-code pre {\n margin: 0;\n padding: var(--e-space-3) var(--e-space-4);\n background: transparent;\n font: 400 var(--e-text-sm) / 1.6 var(--e-font-mono);\n color: var(--e-ink);\n }\n\n .e-code pre:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n border-radius: var(--e-radius-md);\n }\n\n .e-code code {\n display: block;\n width: fit-content;\n min-width: 100%;\n padding: 0;\n background: transparent;\n font: inherit;\n }\n\n .e-code-side {\n flex: none;\n align-self: flex-start;\n padding: var(--e-space-1);\n }\n\n @media print {\n .e-code-side {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;EAOA,IAAMiB,IAAQC,GAcRC,IAAIC,EAAY,GAEhBC,UACJC,EACE,OACA;GAAE,SAAS;GAAa,MAAM;GAAQ,QAAQ;GAAgB,gBAAgB;GAAO,eAAe;EAAO,GAC3G,CACEA,EAAE,QAAQ;GAAE,GAAG;GAAK,GAAG;GAAK,OAAO;GAAK,QAAQ;GAAK,IAAI;EAAI,CAAC,GAC9DA,EAAE,QAAQ,EAAE,GAAG,0DAA0D,CAAC,CAC5E,CACF,GAEIC,IAAOC,EAAwB,IAAI,GACnCC,IAASD,EAAI,EAAK;EAExB,eAAeE,IAAO;GACpB,IAAMC,IAAOV,EAAM,QAAQM,EAAK,OAAO,cAAc,KAAK,CAAC,EAAE,eAAe;GAC5E,IAAI;IAGF,AAFA,MAAM,UAAU,UAAU,UAAUI,CAAI,GACxC,EAAO,QAAQ,IACf,iBAAkB,EAAO,QAAQ,IAAQ,GAAI;GAC/C,QAAQ,CAAC;EACX;E,kBAIE3B,EAAA,GAAAC,EAUM,OAAA;GAVG,SAAA;GAAJ,KAAIsB;GAAO,OAAM;;GACpBrB,EAIM,OAJNW,GAIM,CAHJV,EAEO6B,EAAA,QAAA,WAAA,CAAA,SAAA,CADL9B,EAAkE,OAAA;IAA7D,UAAS;IAAK,cAAYgB,EAAA;G,IAAMhB,EAAuB,QAAA,MAAAE,EAAdc,EAAA,IAAI,GAAA,CAAA,C;GAGtDhB,EAEM,OAFNa,GAEM,CADJV,EAAqGC,GAAA;IAAvF,MAAMmB,EAAA,QAAM,UAAaJ;IAAW,OAAOH,EAAA,aAAaX,EAAAY,CAAA,CAAC,CAAA,UAAA;IAAe,SAAOO;;GAE/FrB,EAAoFG,GAAA,EAAnE,MAAK,SAAQ,GAAA;IAAC,SAAAC,QAAmC,CAAhCC,EAAAN,EAAAqB,EAAA,QAASlB,EAAAY,CAAA,CAAC,CAAA,YAAA,IAAA,EAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"ECodeBlock.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_toDisplayString","_createVNode","EIconButton","_unref","EVisuallyHidden","_withCtx","_createTextVNode","EIconButton_default","EVisuallyHidden_default","_hoisted_1","_hoisted_2","_hoisted_3","ECodeBlock_vue_vue_type_script_setup_true_lang_default","props","__props","t","useMessages","CopyIcon","h","root","ref","copied","copy","text","openBlock","createElementBlock","createElementVNode","renderSlot","_ctx","toDisplayString","createVNode","unref","withCtx","createTextVNode"],"sources":["../../../src/components/CodeBlock/ECodeBlock.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { h, ref } from \"vue\";\nimport EIconButton from \"../IconButton/EIconButton.vue\";\nimport EVisuallyHidden from \"../VisuallyHidden/EVisuallyHidden.vue\";\nimport { useMessages } from \"../../config.js\";\nimport \"../../styles/base.css\";\n\nconst props = defineProps<{\n /** The text to show, as plain text. Leave it out to use the slot and put your own highlighted markup there. */\n code?: string;\n /** The language, named for screen readers (the code's accessible name). */\n lang?: string;\n /** The copy button's name; say what is copied when a page has several. @default \"Copy code\" */\n copyLabel?: string;\n}>();\n\ndefineSlots<{\n /** Your own markup, usually a highlighted `<pre><code>`. The copy button copies the text of the first `<pre>`. */\n default?(): unknown;\n}>();\n\nconst t = useMessages();\n\nconst CopyIcon = () =>\n h(\n \"svg\",\n { viewBox: \"0 0 20 20\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.6\", \"aria-hidden\": \"true\" },\n [\n h(\"rect\", { x: \"7\", y: \"7\", width: \"9\", height: \"9\", rx: \"2\" }),\n h(\"path\", { d: \"M13 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" }),\n ],\n );\n\nconst root = ref<HTMLElement | null>(null);\nconst copied = ref(false);\n\nasync function copy() {\n const text = props.code ?? root.value?.querySelector(\"pre\")?.textContent ?? \"\";\n try {\n await navigator.clipboard.writeText(text);\n copied.value = true;\n setTimeout(() => (copied.value = false), 2000);\n } catch {}\n}\n</script>\n\n<template>\n <div ref=\"root\" class=\"e-code\">\n <div class=\"e-code-body\">\n <slot>\n <pre tabindex=\"0\" :aria-label=\"lang\"><code>{{ code }}</code></pre>\n </slot>\n </div>\n <div class=\"e-code-side\">\n <EIconButton :icon=\"copied ? 'check' : CopyIcon\" :label=\"copyLabel || t('copyCode')\" @click=\"copy\" />\n </div>\n <EVisuallyHidden role=\"status\">{{ copied ? t(\"codeCopied\") : \"\" }}</EVisuallyHidden>\n </div>\n</template>\n\n<style>\n@layer e.blocks {\n .e-code {\n /* The colours a Shiki dual-theme (css-variables) highlighter reads for syntax tokens. */\n --shiki-foreground: var(--e-ink);\n --shiki-background: transparent;\n --shiki-token-comment: var(--e-muted);\n --shiki-token-keyword: var(--e-primary);\n --shiki-token-function: var(--e-primary);\n --shiki-token-string: var(--e-secondary);\n --shiki-token-string-expression: var(--e-secondary);\n --shiki-token-constant: var(--e-warning-strong);\n --shiki-token-parameter: var(--e-ink);\n --shiki-token-punctuation: var(--e-muted);\n --shiki-token-link: var(--e-primary);\n\n display: flex;\n align-items: stretch;\n min-width: 0;\n overflow: hidden;\n border-radius: var(--e-radius-md);\n background: var(--e-surface);\n box-shadow: var(--e-edge);\n }\n\n /* Code blocks stacked back to back share one seam: the rings overlap into a single line. */\n .e-code:has(+ .e-code) {\n border-end-start-radius: 0;\n border-end-end-radius: 0;\n }\n\n .e-code + .e-code {\n margin-top: max(var(--e-stroke-card), 1px);\n border-start-start-radius: 0;\n border-start-end-radius: 0;\n }\n\n .e-code-body {\n display: grid;\n flex: 1;\n align-content: center;\n min-width: 0;\n overflow-x: auto;\n }\n\n .e-code pre {\n margin: 0;\n padding: var(--e-space-3) var(--e-space-4);\n background: transparent;\n font: 400 var(--e-text-sm) / 1.6 var(--e-font-mono);\n color: var(--e-ink);\n }\n\n .e-code pre:focus-visible {\n outline: var(--e-stroke-focus) solid var(--e-focus-ring);\n outline-offset: calc(-1 * var(--e-stroke-focus));\n border-radius: var(--e-radius-md);\n }\n\n .e-code code {\n display: block;\n width: fit-content;\n min-width: 100%;\n padding: 0;\n background: transparent;\n font: inherit;\n }\n\n .e-code-side {\n flex: none;\n align-self: flex-start;\n padding: var(--e-space-1);\n }\n\n @media print {\n .e-code-side {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;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