@dialpad/dialtone-vue 3.193.0-next.2 → 3.193.0-next.3

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 (55) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/dialtone-vue.cjs +1 -1
  3. package/dist/dialtone-vue.js +209 -205
  4. package/dist/dialtone-vue.js.map +1 -1
  5. package/dist/lib/list-item/list-item.cjs +1 -1
  6. package/dist/lib/list-item/list-item.cjs.map +1 -1
  7. package/dist/lib/list-item/list-item.js +24 -14
  8. package/dist/lib/list-item/list-item.js.map +1 -1
  9. package/dist/lib/mode-island/index.cjs +2 -0
  10. package/dist/lib/mode-island/index.cjs.map +1 -0
  11. package/dist/lib/mode-island/index.js +7 -0
  12. package/dist/lib/mode-island/index.js.map +1 -0
  13. package/dist/lib/mode-island/mode-island-constants.cjs +2 -0
  14. package/dist/lib/mode-island/mode-island-constants.cjs.map +1 -0
  15. package/dist/lib/mode-island/mode-island-constants.js +12 -0
  16. package/dist/lib/mode-island/mode-island-constants.js.map +1 -0
  17. package/dist/lib/mode-island/mode-island.cjs +2 -0
  18. package/dist/lib/mode-island/mode-island.cjs.map +1 -0
  19. package/dist/lib/mode-island/mode-island.js +130 -0
  20. package/dist/lib/mode-island/mode-island.js.map +1 -0
  21. package/dist/lib/mode-island/utils.cjs +2 -0
  22. package/dist/lib/mode-island/utils.cjs.map +1 -0
  23. package/dist/lib/mode-island/utils.js +32 -0
  24. package/dist/lib/mode-island/utils.js.map +1 -0
  25. package/dist/lib/mode-island/validators.cjs +2 -0
  26. package/dist/lib/mode-island/validators.cjs.map +1 -0
  27. package/dist/lib/mode-island/validators.js +12 -0
  28. package/dist/lib/mode-island/validators.js.map +1 -0
  29. package/dist/lib/split-button/split-button-alpha.cjs +1 -1
  30. package/dist/lib/split-button/split-button-alpha.cjs.map +1 -1
  31. package/dist/lib/split-button/split-button-alpha.js +23 -15
  32. package/dist/lib/split-button/split-button-alpha.js.map +1 -1
  33. package/dist/lib/split-button/split-button-omega.cjs +1 -1
  34. package/dist/lib/split-button/split-button-omega.cjs.map +1 -1
  35. package/dist/lib/split-button/split-button-omega.js +13 -13
  36. package/dist/lib/split-button/split-button-omega.js.map +1 -1
  37. package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
  38. package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
  39. package/dist/lib/tooltip-directive/tooltip.js +12 -11
  40. package/dist/lib/tooltip-directive/tooltip.js.map +1 -1
  41. package/dist/types/components/list_item/list_item.vue.d.ts +3 -1
  42. package/dist/types/components/mode_island/index.d.ts +3 -0
  43. package/dist/types/components/mode_island/index.d.ts.map +1 -0
  44. package/dist/types/components/mode_island/mode_island.vue.d.ts +3 -0
  45. package/dist/types/components/mode_island/mode_island.vue.d.ts.map +1 -0
  46. package/dist/types/components/mode_island/mode_island_constants.d.ts +10 -0
  47. package/dist/types/components/mode_island/mode_island_constants.d.ts.map +1 -0
  48. package/dist/types/components/mode_island/utils.d.ts +12 -0
  49. package/dist/types/components/mode_island/utils.d.ts.map +1 -0
  50. package/dist/types/components/mode_island/validators.d.ts +6 -0
  51. package/dist/types/components/mode_island/validators.d.ts.map +1 -0
  52. package/dist/types/components/split_button/split_button-alpha.vue.d.ts +6 -1
  53. package/dist/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
  54. package/dist/types/index.d.ts +1 -0
  55. package/package.json +5 -5
@@ -1,14 +1,14 @@
1
1
  import { LIST_ITEM_NAVIGATION_TYPES as s, LIST_ITEM_TYPES as l } from "./list-item-constants.js";
2
2
  import h from "../../common/utils/index.js";
3
3
  import { DtIconCheck as g } from "@dialpad/dialtone-icons/vue3";
4
- import { resolveComponent as r, createBlock as n, openBlock as d, resolveDynamicComponent as f, mergeProps as _, toHandlers as p, withCtx as a, renderSlot as m, normalizeClass as y, createSlots as v, renderList as T, createVNode as b } from "vue";
5
- import { _ as I } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
- import k from "../item-layout/item-layout.js";
4
+ import { resolveComponent as r, createBlock as n, openBlock as d, resolveDynamicComponent as f, mergeProps as _, toHandlers as p, withCtx as o, renderSlot as c, normalizeClass as y, createSlots as v, renderList as k, createVNode as T } from "vue";
5
+ import { _ as b } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
+ import I from "../item-layout/item-layout.js";
7
7
  const L = ["listitem", "menuitem", "option"], S = {
8
8
  compatConfig: { MODE: 3 },
9
9
  name: "DtListItem",
10
10
  components: {
11
- DtItemLayout: k,
11
+ DtItemLayout: I,
12
12
  DtIconCheck: g
13
13
  },
14
14
  /**
@@ -82,6 +82,13 @@ const L = ["listitem", "menuitem", "option"], S = {
82
82
  }
83
83
  },
84
84
  emits: [
85
+ /**
86
+ * Native click event
87
+ *
88
+ * @event click
89
+ * @type {PointerEvent | KeyboardEvent}
90
+ */
91
+ "click",
85
92
  /**
86
93
  * Key down event
87
94
  *
@@ -116,6 +123,9 @@ const L = ["listitem", "menuitem", "option"], S = {
116
123
  },
117
124
  listItemListeners() {
118
125
  return {
126
+ click: (e) => {
127
+ this.onClick(e);
128
+ },
119
129
  keydown: (e) => {
120
130
  ["enter", "space"].includes(e.code.toLowerCase()) && this.onClick(e), this.$emit("keydown", e);
121
131
  },
@@ -157,7 +167,7 @@ const L = ["listitem", "menuitem", "option"], S = {
157
167
  }
158
168
  };
159
169
  function H(e, C, i, D, E, t) {
160
- const c = r("dt-icon-check"), u = r("dt-item-layout");
170
+ const m = r("dt-icon-check"), u = r("dt-item-layout");
161
171
  return d(), n(f(i.elementType), _({
162
172
  id: i.id,
163
173
  class: [
@@ -172,7 +182,7 @@ function H(e, C, i, D, E, t) {
172
182
  role: i.role,
173
183
  "aria-selected": i.role === "listitem" ? void 0 : t.isHighlighted
174
184
  }, p(t.listItemListeners)), {
175
- default: a(() => [
185
+ default: o(() => [
176
186
  t.isDefaultType ? (d(), n(u, {
177
187
  key: 0,
178
188
  unstyled: "",
@@ -186,25 +196,25 @@ function H(e, C, i, D, E, t) {
186
196
  "selected-class": "d-list-item__selected",
187
197
  "data-qa": "dt-list-item-wrapper"
188
198
  }, v({ _: 2 }, [
189
- T(e.$slots, (w, o) => ({
190
- name: o,
191
- fn: a(() => [
192
- m(e.$slots, o)
199
+ k(e.$slots, (w, a) => ({
200
+ name: a,
201
+ fn: o(() => [
202
+ c(e.$slots, a)
193
203
  ])
194
204
  })),
195
205
  i.selected ? {
196
206
  name: "selected",
197
- fn: a(() => [
198
- b(c, { size: "400" })
207
+ fn: o(() => [
208
+ T(m, { size: "400" })
199
209
  ]),
200
210
  key: "0"
201
211
  } : void 0
202
- ]), 1032, ["class"])) : m(e.$slots, "default", { key: 1 })
212
+ ]), 1032, ["class"])) : c(e.$slots, "default", { key: 1 })
203
213
  ]),
204
214
  _: 3
205
215
  }, 16, ["id", "class", "tabindex", "role", "aria-selected"]);
206
216
  }
207
- const B = /* @__PURE__ */ I(S, [["render", H]]);
217
+ const B = /* @__PURE__ */ b(S, [["render", H]]);
208
218
  export {
209
219
  B as default
210
220
  };
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.js","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"role === 'listitem' ? undefined : isHighlighted\"\n v-on=\"listItemListeners\"\n >\n <dt-item-layout\n v-if=\"isDefaultType\"\n unstyled\n :class=\"['d-list-item__wrapper', wrapperClass]\"\n left-class=\"d-list-item__left\"\n content-class=\"d-list-item__content\"\n title-class=\"d-list-item__title\"\n subtitle-class=\"d-list-item__subtitle\"\n bottom-class=\"d-list-item__bottom\"\n right-class=\"d-list-item__right\"\n selected-class=\"d-list-item__selected\"\n data-qa=\"dt-list-item-wrapper\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check size=\"400\" />\n </template>\n </dt-item-layout>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './list_item_constants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue3';\nimport { DtItemLayout } from '@/components/item_layout';\n\nconst ROLES = ['listitem', 'menuitem', 'option'];\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * String to use for the item's role.\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => (ROLES).includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Applies selected styles to the list item\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional Classes to apply to the wrapper element,\n * note: it only applies on \"default\" type\n * Can accept all of: String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n wrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n isDefaultType () {\n return this.type === LIST_ITEM_TYPES.DEFAULT;\n },\n\n listItemListeners () {\n return {\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n // disabled as we do not want to override native click\n // eslint-disable-next-line vue/require-explicit-emits\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"names":["ROLES","_sfc_main","DtItemLayout","DtIconCheck","utils","role","LIST_ITEM_TYPES","t","LIST_ITEM_NAVIGATION_TYPES","event","_openBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","_component_dt_item_layout","_normalizeClass","_createSlots","_renderList","_ctx","_","slotName","_renderSlot","_createVNode","_component_dt_icon_check"],"mappings":";;;;;;AAyDA,MAAMA,IAAQ,CAAC,YAAY,YAAY,QAAQ,GAM1CC,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,cAAAC;AAAA,IACA,aAAAC;AAAA;;;;EAMF,QAAQ;AAAA,IACN,aAAa,EAAE,SAAS,KAAG;AAAA;EAG7B,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AAAE,eAAOC,EAAM,gBAAe;AAAA,MAAI;AAAA;;;;IAM/C,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAUL,EAAO,SAASK,CAAI;AAAA;;;;IAM5C,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAASC,EAAgB;AAAA,MACzB,WAAW,CAACC,MAAM,OAAO,OAAOD,CAAe,EAAE,SAASC,CAAC;AAAA;;;;;;;;IAU7D,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,SAASC,EAA2B;AAAA,MACpC,WAAW,CAACD,MAAM,OAAO,OAAOC,CAA0B,EAAE,SAASD,CAAC;AAAA;;;;IAMxE,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;;;;IASX,cAAc;AAAA,MACZ,MAAM,CAAC,QAAQ,QAAQ,KAAK;AAAA,MAC5B,SAAS;AAAA;;EAIb,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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;AAAA,IACJ,OAAK;AAAA;;kCAAmEE,EAAA;AAAA,oCAAiDA,EAAA;AAAA,gCAA+CA,EAAA;AAAA;;IAOxK,UAAUA,EAAA,cAAW,IAAA;AAAA,IACrB,MAAMF,EAAA;AAAA,IACN,iBAAeA,EAAA,SAAI,aAAkB,SAAYE,EAAA;AAAA,EAClD,GAAAC,EAAwBD,EAAlB,iBAAiB,CAAA,GAAA;AAAA,IAd3B,SAAAE,EAgBI,MA0BiB;AAAA,MAzBTF,EAAA,sBADRJ,EA0BiBO,GAAA;AAAA,QA1CrB,KAAA;AAAA,QAkBM,UAAA;AAAA,QACC,OAnBPC,2BAmBuCN,EAAA,YAAY,CAAA;AAAA,QAC7C,cAAW;AAAA,QACX,iBAAc;AAAA,QACd,eAAY;AAAA,QACZ,kBAAe;AAAA,QACf,gBAAa;AAAA,QACb,eAAY;AAAA,QACZ,kBAAe;AAAA,QACf,WAAQ;AAAA,MA3Bd,GAAAO,EAAA,EAAA,GAAA,KAAA;AAAA,QAAAC,EA8BgCC,EAAA,QA9BhC,CA8BgBC,GAAGC;UA9BnB,MA+BSA;AAAA,UA/BT,IAAAP,EAkCQ,MAAyB;AAAA,YAAzBQ,EAAyBH,UAAZE,CAAQ;AAAA;;QAGfX,EAAA;UArCd,MAsCS;AAAA,UAtCT,IAAAI,EAwCQ,MAA4B;AAAA,YAA5BS,EAA4BC,GAAA,EAAb,MAAK,MAAK,CAAA;AAAA;UAxCjC,KAAA;AAAA,YAAA;AAAA,8BA4CIF,EAAeH,uBA5CnB,KAAA,EAAA,CAAA;AAAA;IAAA,GAAA;AAAA;;;"}
1
+ {"version":3,"file":"list-item.js","sources":["../../../components/list_item/list_item.vue"],"sourcesContent":["<template>\n <component\n :is=\"elementType\"\n :id=\"id\"\n :class=\"[\n 'd-list-item',\n {\n 'd-list-item--focusable': isFocusable,\n 'd-list-item--highlighted': isHighlighted,\n 'd-list-item--static': !isHoverable,\n }]\"\n :tabindex=\"isFocusable ? 0 : -1\"\n :role=\"role\"\n :aria-selected=\"role === 'listitem' ? undefined : isHighlighted\"\n v-on=\"listItemListeners\"\n >\n <dt-item-layout\n v-if=\"isDefaultType\"\n unstyled\n :class=\"['d-list-item__wrapper', wrapperClass]\"\n left-class=\"d-list-item__left\"\n content-class=\"d-list-item__content\"\n title-class=\"d-list-item__title\"\n subtitle-class=\"d-list-item__subtitle\"\n bottom-class=\"d-list-item__bottom\"\n right-class=\"d-list-item__right\"\n selected-class=\"d-list-item__selected\"\n data-qa=\"dt-list-item-wrapper\"\n >\n <template\n v-for=\"(_, slotName) in $slots\"\n #[slotName]\n >\n <!-- @slot named slots for custom list items -->\n <slot :name=\"slotName\" />\n </template>\n <template\n v-if=\"selected\"\n #selected\n >\n <dt-icon-check size=\"400\" />\n </template>\n </dt-item-layout>\n <!-- @slot slot for the main content -->\n <slot v-else />\n </component>\n</template>\n\n<script>\nimport {\n LIST_ITEM_TYPES,\n LIST_ITEM_NAVIGATION_TYPES,\n} from './list_item_constants';\nimport utils from '@/common/utils';\nimport { DtIconCheck } from '@dialpad/dialtone-icons/vue3';\nimport { DtItemLayout } from '@/components/item_layout';\n\nconst ROLES = ['listitem', 'menuitem', 'option'];\n\n/**\n * A list item is an element that can be used to represent individual items in a list.\n * @see https://dialtone.dialpad.com/components/list_item.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtListItem',\n\n components: {\n DtItemLayout,\n DtIconCheck,\n },\n\n /**\n * Value provided from keyboard_list_navigation.js using id prop.\n */\n inject: {\n highlightId: { default: null },\n },\n\n props: {\n /**\n * Id for the item.\n */\n id: {\n type: String,\n default () { return utils.getUniqueString(); },\n },\n\n /**\n * String to use for the item's role.\n */\n role: {\n type: String,\n default: 'listitem',\n validator: (role) => (ROLES).includes(role),\n },\n\n /**\n * HTML element type (tag name) of the content wrapper element.\n */\n elementType: {\n type: String,\n default: 'li',\n },\n\n /**\n * The type of child list item to use.\n * @values default, custom\n */\n type: {\n type: String,\n default: LIST_ITEM_TYPES.DEFAULT,\n validator: (t) => Object.values(LIST_ITEM_TYPES).includes(t),\n },\n\n /**\n * The type of navigation that this component should support.\n * - \"arrow-keys\" for items that are navigated with UP/DOWN keys.\n * - \"tab\" for items that are navigated using the TAB key.\n * - \"none\" for static items that are not interactive.\n * @values arrow-keys, tab, none\n */\n navigationType: {\n type: String,\n default: LIST_ITEM_NAVIGATION_TYPES.NONE,\n validator: (t) => Object.values(LIST_ITEM_NAVIGATION_TYPES).includes(t),\n },\n\n /**\n * Applies selected styles to the list item\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional Classes to apply to the wrapper element,\n * note: it only applies on \"default\" type\n * Can accept all of: String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n wrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Native click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Key down event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native mouse move event\n *\n * @event mousemove\n * @type {MouseEvent}\n */\n 'mousemove',\n\n /**\n * Native mouse leave event\n *\n * @event mouseleave\n * @type {MouseEvent}\n */\n 'mouseleave',\n ],\n\n data () {\n return {\n injected: false,\n mouseHighlighted: false,\n };\n },\n\n computed: {\n isDefaultType () {\n return this.type === LIST_ITEM_TYPES.DEFAULT;\n },\n\n listItemListeners () {\n return {\n click: event => {\n this.onClick(event);\n },\n\n keydown: event => {\n if (['enter', 'space'].includes(event.code.toLowerCase())) {\n this.onClick(event);\n }\n this.$emit('keydown', event);\n },\n\n mousemove: event => {\n this.onMouseHover(event);\n this.$emit('mousemove', event);\n },\n\n mouseleave: event => {\n this.onMouseLeave(event);\n this.$emit('mouseleave', event);\n },\n };\n },\n\n /**\n * For keyboard navigation, whether this item is currently highlighted.\n * An injected highlightId will override the default mouseover highlight.\n */\n isHighlighted () {\n if (this.isHoverable) {\n return this.highlightId && this.highlightId() ? this.id === this.highlightId() : this.mouseHighlighted;\n }\n return false;\n },\n\n isFocusable () {\n // Navigation type has to be set to \"tab\".\n return this.navigationType === LIST_ITEM_NAVIGATION_TYPES.TAB;\n },\n\n /**\n * Whether to apply hover styles.\n */\n isHoverable () {\n return this.navigationType !== LIST_ITEM_NAVIGATION_TYPES.NONE;\n },\n },\n\n methods: {\n onClick (e) {\n // disabled as we do not want to override native click\n this.$emit('click', e);\n },\n\n onMouseHover () {\n this.mouseHighlighted = true;\n },\n\n onMouseLeave () {\n this.mouseHighlighted = false;\n },\n },\n};\n</script>\n"],"names":["ROLES","_sfc_main","DtItemLayout","DtIconCheck","utils","role","LIST_ITEM_TYPES","t","LIST_ITEM_NAVIGATION_TYPES","event","_openBlock","_createBlock","_resolveDynamicComponent","$props","_mergeProps","$options","_toHandlers","_withCtx","_component_dt_item_layout","_normalizeClass","_createSlots","_renderList","_ctx","_","slotName","_renderSlot","_createVNode","_component_dt_icon_check"],"mappings":";;;;;;AAyDA,MAAMA,IAAQ,CAAC,YAAY,YAAY,QAAQ,GAM1CC,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,cAAAC;AAAA,IACA,aAAAC;AAAA;;;;EAMF,QAAQ;AAAA,IACN,aAAa,EAAE,SAAS,KAAG;AAAA;EAG7B,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAW;AAAE,eAAOC,EAAM,gBAAe;AAAA,MAAI;AAAA;;;;IAM/C,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAUL,EAAO,SAASK,CAAI;AAAA;;;;IAM5C,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAASC,EAAgB;AAAA,MACzB,WAAW,CAACC,MAAM,OAAO,OAAOD,CAAe,EAAE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MAAyB;AAAA,YAAzBQ,EAAyBH,UAAZE,CAAQ;AAAA;;QAGfX,EAAA;UArCd,MAsCS;AAAA,UAtCT,IAAAI,EAwCQ,MAA4B;AAAA,YAA5BS,EAA4BC,GAAA,EAAb,MAAK,MAAK,CAAA;AAAA;UAxCjC,KAAA;AAAA,YAAA;AAAA,8BA4CIF,EAAeH,uBA5CnB,KAAA,EAAA,CAAA;AAAA;IAAA,GAAA;AAAA;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mode-island.cjs"),d=require("./mode-island-constants.cjs");exports.DtModeIsland=e.default;exports.DT_MODE_ISLAND_TYPES=d.DT_MODE_ISLAND_TYPES;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { default as r } from "./mode-island.js";
2
+ import { DT_MODE_ISLAND_TYPES as D } from "./mode-island-constants.js";
3
+ export {
4
+ D as DT_MODE_ISLAND_TYPES,
5
+ r as DtModeIsland
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={INVERTED:"inverted",LIGHT:"light",DARK:"dark"},t={DT_MODE_ISLAND_TYPES:e};exports.DT_MODE_ISLAND_TYPES=e;exports.default=t;
2
+ //# sourceMappingURL=mode-island-constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-island-constants.cjs","sources":["../../../components/mode_island/mode_island_constants.js"],"sourcesContent":["export const DT_MODE_ISLAND_TYPES = {\n INVERTED: 'inverted',\n LIGHT: 'light',\n DARK: 'dark',\n};\n\nexport default {\n DT_MODE_ISLAND_TYPES,\n};"],"names":["DT_MODE_ISLAND_TYPES","mode_island_constants"],"mappings":"4GAAY,MAACA,EAAuB,CAClC,SAAU,WACV,MAAO,QACP,KAAM,MACR,EAEAC,EAAe,CACb,qBAAAD,CACF"}
@@ -0,0 +1,12 @@
1
+ const t = {
2
+ INVERTED: "inverted",
3
+ LIGHT: "light",
4
+ DARK: "dark"
5
+ }, n = {
6
+ DT_MODE_ISLAND_TYPES: t
7
+ };
8
+ export {
9
+ t as DT_MODE_ISLAND_TYPES,
10
+ n as default
11
+ };
12
+ //# sourceMappingURL=mode-island-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-island-constants.js","sources":["../../../components/mode_island/mode_island_constants.js"],"sourcesContent":["export const DT_MODE_ISLAND_TYPES = {\n INVERTED: 'inverted',\n LIGHT: 'light',\n DARK: 'dark',\n};\n\nexport default {\n DT_MODE_ISLAND_TYPES,\n};"],"names":["DT_MODE_ISLAND_TYPES","mode_island_constants"],"mappings":"AAAY,MAACA,IAAuB;AAAA,EAClC,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AACR,GAEAC,IAAe;AAAA,EACb,sBAAAD;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./mode-island-constants.cjs"),l=require("./validators.cjs"),r=require("./utils.cjs"),o=require("vue"),u=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),c={name:"DtModeIsland",compatConfig:{MODE:3},provide(){return{dtModeIslandMode:()=>this.computedMode}},inject:{parentModeIslandMode:{from:"dtModeIslandMode",default:null}},inheritAttrs:!1,props:{as:{type:String,default:"div"},mode:{type:String,default:d.DT_MODE_ISLAND_TYPES.INVERTED,validator:l.modeValidator}},data(){return{currentContrast:r.getRootContrast(),contrastObserver:null,modeObserver:null,elementRef:null,calculatedMode:null}},computed:{isInverted(){return this.mode===d.DT_MODE_ISLAND_TYPES.INVERTED},invertedAttribute(){return this.isInverted?"":null},computedMode(){return this.mode===d.DT_MODE_ISLAND_TYPES.LIGHT||this.mode===d.DT_MODE_ISLAND_TYPES.DARK?this.mode:this.mode===d.DT_MODE_ISLAND_TYPES.INVERTED&&this.calculatedMode?this.calculatedMode:this.calculateInvertedMode()}},beforeCreate(){if(this.$attrs&&this.$attrs["data-dt-brand"])throw new Error("[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.")},mounted(){this.elementRef=this.$el,this.setupContrastObserver(),this.isInverted&&(this.calculatedMode=this.calculateInvertedMode(),this.setupModeObserver()),this.currentContrast=r.getRootContrast()},beforeUnmount(){this.contrastObserver&&(this.contrastObserver.disconnect(),this.contrastObserver=null),this.modeObserver&&(this.modeObserver.disconnect(),this.modeObserver=null)},methods:{calculateInvertedMode(){if(this.parentModeIslandMode){const e=typeof this.parentModeIslandMode=="function"?this.parentModeIslandMode():this.parentModeIslandMode;return r.getOppositeMode(e)}if(this.elementRef){const e=r.findParentMode(this.elementRef);return r.getOppositeMode(e)}return r.getOppositeMode(r.getRootMode())},setupContrastObserver(){this.contrastObserver=new MutationObserver(e=>{for(const t of e)t.type==="attributes"&&t.attributeName==="data-dt-contrast"&&(this.currentContrast=r.getRootContrast())}),this.contrastObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-dt-contrast"]})},setupModeObserver(){var s;const e={attributes:!0,attributeFilter:["data-dt-mode"],subtree:!1};this.modeObserver=new MutationObserver(a=>{for(const n of a)n.type==="attributes"&&n.attributeName==="data-dt-mode"&&(this.calculatedMode=this.calculateInvertedMode())}),this.modeObserver.observe(document.documentElement,e);let t=(s=this.elementRef)==null?void 0:s.parentElement;for(;t;)t.hasAttribute("data-dt-mode")&&this.modeObserver.observe(t,e),t=t.parentElement}}};function m(e,t,s,a,n,i){return o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.as),o.mergeProps({class:"d-mode-island"},e.$attrs,{"data-dt-mode":i.computedMode,"data-mode-island-inverted":i.invertedAttribute,"data-dt-contrast":n.currentContrast}),{default:o.withCtx(()=>[o.renderSlot(e.$slots,"default")]),_:3},16,["data-dt-mode","data-mode-island-inverted","data-dt-contrast"])}const h=u._(c,[["render",m]]);exports.default=h;
2
+ //# sourceMappingURL=mode-island.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-island.cjs","sources":["../../../components/mode_island/mode_island.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n class=\"d-mode-island\"\n v-bind=\"$attrs\"\n :data-dt-mode=\"computedMode\"\n :data-mode-island-inverted=\"invertedAttribute\"\n :data-dt-contrast=\"currentContrast\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport { DT_MODE_ISLAND_TYPES } from './mode_island_constants';\nimport { modeValidator } from './validators';\nimport {\n getOppositeMode,\n getRootMode,\n getRootContrast,\n findParentMode,\n} from './utils';\n\nexport default {\n name: 'DtModeIsland',\n compatConfig: { MODE: 3 },\n\n provide () {\n return {\n dtModeIslandMode: () => this.computedMode,\n };\n },\n\n inject: {\n parentModeIslandMode: {\n from: 'dtModeIslandMode',\n default: null,\n },\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Set this prop to render the mode island as a specific HTML element.\n * @type {String}\n * @values div, section, nav, article, aside, header, footer, main\n */\n as: {\n type: String,\n default: 'div',\n },\n\n /**\n * The mode to apply to the island.\n * - 'inverted': Opposite of parent or root mode\n * - 'light': Always light mode\n * - 'dark': Always dark mode\n * @type {String}\n * @values inverted, light, dark\n */\n mode: {\n type: String,\n default: DT_MODE_ISLAND_TYPES.INVERTED,\n validator: modeValidator,\n },\n },\n\n data () {\n return {\n currentContrast: getRootContrast(),\n contrastObserver: null,\n modeObserver: null,\n elementRef: null,\n calculatedMode: null, // Store calculated mode as reactive data\n };\n },\n\n computed: {\n isInverted () {\n return this.mode === DT_MODE_ISLAND_TYPES.INVERTED;\n },\n\n invertedAttribute () {\n return this.isInverted ? '' : null;\n },\n\n computedMode () {\n // If mode is explicitly light or dark, use it directly\n if (this.mode === DT_MODE_ISLAND_TYPES.LIGHT || this.mode === DT_MODE_ISLAND_TYPES.DARK) {\n return this.mode;\n }\n\n // If mode is inverted, use the calculated mode if available\n if (this.mode === DT_MODE_ISLAND_TYPES.INVERTED && this.calculatedMode) {\n return this.calculatedMode;\n }\n\n // Otherwise calculate it now\n return this.calculateInvertedMode();\n },\n },\n\n beforeCreate () {\n // Throw error if data-dt-brand is manually set\n if (this.$attrs && this.$attrs['data-dt-brand']) {\n throw new Error('[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.');\n }\n },\n\n mounted () {\n // Store element reference\n this.elementRef = this.$el;\n\n // Setup MutationObserver to watch for contrast changes on root\n this.setupContrastObserver();\n\n // Setup MutationObserver to watch for mode changes (only if inverted)\n if (this.isInverted) {\n // Initialize the calculated mode\n this.calculatedMode = this.calculateInvertedMode();\n this.setupModeObserver();\n }\n\n // Initial contrast value\n this.currentContrast = getRootContrast();\n },\n\n beforeUnmount () {\n // Cleanup observers\n if (this.contrastObserver) {\n this.contrastObserver.disconnect();\n this.contrastObserver = null;\n }\n if (this.modeObserver) {\n this.modeObserver.disconnect();\n this.modeObserver = null;\n }\n },\n\n methods: {\n calculateInvertedMode () {\n // First check if there's a parent mode island\n if (this.parentModeIslandMode) {\n const parentMode = typeof this.parentModeIslandMode === 'function'\n ? this.parentModeIslandMode()\n : this.parentModeIslandMode;\n return getOppositeMode(parentMode);\n }\n\n // Otherwise, find the nearest parent with data-dt-mode\n if (this.elementRef) {\n const parentMode = findParentMode(this.elementRef);\n return getOppositeMode(parentMode);\n }\n\n // Default fallback\n return getOppositeMode(getRootMode());\n },\n\n setupContrastObserver () {\n this.contrastObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-dt-contrast') {\n this.currentContrast = getRootContrast();\n }\n }\n });\n\n this.contrastObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-dt-contrast'],\n });\n },\n\n setupModeObserver () {\n const config = {\n attributes: true,\n attributeFilter: ['data-dt-mode'],\n subtree: false,\n };\n\n this.modeObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-dt-mode') {\n // Recalculate and update the reactive data property\n this.calculatedMode = this.calculateInvertedMode();\n }\n }\n });\n\n // Observe root element\n this.modeObserver.observe(document.documentElement, config);\n\n // Also observe all parent elements with data-dt-mode\n let parent = this.elementRef?.parentElement;\n while (parent) {\n if (parent.hasAttribute('data-dt-mode')) {\n this.modeObserver.observe(parent, config);\n }\n parent = parent.parentElement;\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DT_MODE_ISLAND_TYPES","modeValidator","getRootContrast","parentMode","getOppositeMode","findParentMode","getRootMode","mutationsList","mutation","config","parent","_a","_createBlock","_resolveDynamicComponent","$props","_mergeProps","_ctx","$options","$data","_withCtx","_renderSlot"],"mappings":"6RAwBKA,EAAU,CACb,KAAM,eACN,aAAc,CAAE,KAAM,GAEtB,SAAW,CACT,MAAO,CACL,iBAAkB,IAAM,KAAK,aAEjC,EAEA,OAAQ,CACN,qBAAsB,CACpB,KAAM,mBACN,QAAS,OAIb,aAAc,GAEd,MAAO,CAML,GAAI,CACF,KAAM,OACN,QAAS,OAWX,KAAM,CACJ,KAAM,OACN,QAASC,EAAAA,qBAAqB,SAC9B,UAAWC,EAAAA,gBAIf,MAAQ,CACN,MAAO,CACL,gBAAiBC,EAAAA,gBAAe,EAChC,iBAAkB,KAClB,aAAc,KACd,WAAY,KACZ,eAAgB,KAEpB,EAEA,SAAU,CACR,YAAc,CACZ,OAAO,KAAK,OAASF,EAAAA,qBAAqB,QAC5C,EAEA,mBAAqB,CACnB,OAAO,KAAK,WAAa,GAAK,IAChC,EAEA,cAAgB,CAEd,OAAI,KAAK,OAASA,uBAAqB,OAAS,KAAK,OAASA,EAAAA,qBAAqB,KAC1E,KAAK,KAIV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AgBA,EAAS,gBAAkB,iBAE/D,KAAK,eAAiB,KAAK,sBAAqB,EAGtD,CAAC,EAGD,KAAK,aAAa,QAAQ,SAAS,gBAAiBC,CAAM,EAG1D,IAAIC,GAASC,EAAA,KAAK,aAAL,YAAAA,EAAiB,cAC9B,KAAOD,GACDA,EAAO,aAAa,cAAc,GACpC,KAAK,aAAa,QAAQA,EAAQD,CAAM,EAE1CC,EAASA,EAAO,aAEpB,EAEJ,+CA5MEE,EAAAA,YADFC,EAAAA,wBAESC,EAAA,EAAE,EADTC,EAAAA,WAUY,CARV,MAAM,iBACEC,EAAA,OAAM,CACb,eAAcC,EAAA,aACd,4BAA2BA,EAAA,kBAC3B,mBAAkBC,EAAA,mBAPvB,QAAAC,EAAAA,QAUI,IAAQ,CAARC,aAAQJ,EAAA,OAAA,SAAA,IAVZ,EAAA"}
@@ -0,0 +1,130 @@
1
+ import { DT_MODE_ISLAND_TYPES as r } from "./mode-island-constants.js";
2
+ import { modeValidator as l } from "./validators.js";
3
+ import { getRootContrast as s, getOppositeMode as a, findParentMode as u, getRootMode as c } from "./utils.js";
4
+ import { createBlock as m, openBlock as h, resolveDynamicComponent as f, mergeProps as b, withCtx as p, renderSlot as M } from "vue";
5
+ import { _ as v } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const O = {
7
+ name: "DtModeIsland",
8
+ compatConfig: { MODE: 3 },
9
+ provide() {
10
+ return {
11
+ dtModeIslandMode: () => this.computedMode
12
+ };
13
+ },
14
+ inject: {
15
+ parentModeIslandMode: {
16
+ from: "dtModeIslandMode",
17
+ default: null
18
+ }
19
+ },
20
+ inheritAttrs: !1,
21
+ props: {
22
+ /**
23
+ * Set this prop to render the mode island as a specific HTML element.
24
+ * @type {String}
25
+ * @values div, section, nav, article, aside, header, footer, main
26
+ */
27
+ as: {
28
+ type: String,
29
+ default: "div"
30
+ },
31
+ /**
32
+ * The mode to apply to the island.
33
+ * - 'inverted': Opposite of parent or root mode
34
+ * - 'light': Always light mode
35
+ * - 'dark': Always dark mode
36
+ * @type {String}
37
+ * @values inverted, light, dark
38
+ */
39
+ mode: {
40
+ type: String,
41
+ default: r.INVERTED,
42
+ validator: l
43
+ }
44
+ },
45
+ data() {
46
+ return {
47
+ currentContrast: s(),
48
+ contrastObserver: null,
49
+ modeObserver: null,
50
+ elementRef: null,
51
+ calculatedMode: null
52
+ // Store calculated mode as reactive data
53
+ };
54
+ },
55
+ computed: {
56
+ isInverted() {
57
+ return this.mode === r.INVERTED;
58
+ },
59
+ invertedAttribute() {
60
+ return this.isInverted ? "" : null;
61
+ },
62
+ computedMode() {
63
+ return this.mode === r.LIGHT || this.mode === r.DARK ? this.mode : this.mode === r.INVERTED && this.calculatedMode ? this.calculatedMode : this.calculateInvertedMode();
64
+ }
65
+ },
66
+ beforeCreate() {
67
+ if (this.$attrs && this.$attrs["data-dt-brand"])
68
+ throw new Error("[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.");
69
+ },
70
+ mounted() {
71
+ this.elementRef = this.$el, this.setupContrastObserver(), this.isInverted && (this.calculatedMode = this.calculateInvertedMode(), this.setupModeObserver()), this.currentContrast = s();
72
+ },
73
+ beforeUnmount() {
74
+ this.contrastObserver && (this.contrastObserver.disconnect(), this.contrastObserver = null), this.modeObserver && (this.modeObserver.disconnect(), this.modeObserver = null);
75
+ },
76
+ methods: {
77
+ calculateInvertedMode() {
78
+ if (this.parentModeIslandMode) {
79
+ const t = typeof this.parentModeIslandMode == "function" ? this.parentModeIslandMode() : this.parentModeIslandMode;
80
+ return a(t);
81
+ }
82
+ if (this.elementRef) {
83
+ const t = u(this.elementRef);
84
+ return a(t);
85
+ }
86
+ return a(c());
87
+ },
88
+ setupContrastObserver() {
89
+ this.contrastObserver = new MutationObserver((t) => {
90
+ for (const e of t)
91
+ e.type === "attributes" && e.attributeName === "data-dt-contrast" && (this.currentContrast = s());
92
+ }), this.contrastObserver.observe(document.documentElement, {
93
+ attributes: !0,
94
+ attributeFilter: ["data-dt-contrast"]
95
+ });
96
+ },
97
+ setupModeObserver() {
98
+ var o;
99
+ const t = {
100
+ attributes: !0,
101
+ attributeFilter: ["data-dt-mode"],
102
+ subtree: !1
103
+ };
104
+ this.modeObserver = new MutationObserver((n) => {
105
+ for (const d of n)
106
+ d.type === "attributes" && d.attributeName === "data-dt-mode" && (this.calculatedMode = this.calculateInvertedMode());
107
+ }), this.modeObserver.observe(document.documentElement, t);
108
+ let e = (o = this.elementRef) == null ? void 0 : o.parentElement;
109
+ for (; e; )
110
+ e.hasAttribute("data-dt-mode") && this.modeObserver.observe(e, t), e = e.parentElement;
111
+ }
112
+ }
113
+ };
114
+ function I(t, e, o, n, d, i) {
115
+ return h(), m(f(o.as), b({ class: "d-mode-island" }, t.$attrs, {
116
+ "data-dt-mode": i.computedMode,
117
+ "data-mode-island-inverted": i.invertedAttribute,
118
+ "data-dt-contrast": d.currentContrast
119
+ }), {
120
+ default: p(() => [
121
+ M(t.$slots, "default")
122
+ ]),
123
+ _: 3
124
+ }, 16, ["data-dt-mode", "data-mode-island-inverted", "data-dt-contrast"]);
125
+ }
126
+ const g = /* @__PURE__ */ v(O, [["render", I]]);
127
+ export {
128
+ g as default
129
+ };
130
+ //# sourceMappingURL=mode-island.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-island.js","sources":["../../../components/mode_island/mode_island.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n class=\"d-mode-island\"\n v-bind=\"$attrs\"\n :data-dt-mode=\"computedMode\"\n :data-mode-island-inverted=\"invertedAttribute\"\n :data-dt-contrast=\"currentContrast\"\n >\n <!-- @slot Slot for main content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport { DT_MODE_ISLAND_TYPES } from './mode_island_constants';\nimport { modeValidator } from './validators';\nimport {\n getOppositeMode,\n getRootMode,\n getRootContrast,\n findParentMode,\n} from './utils';\n\nexport default {\n name: 'DtModeIsland',\n compatConfig: { MODE: 3 },\n\n provide () {\n return {\n dtModeIslandMode: () => this.computedMode,\n };\n },\n\n inject: {\n parentModeIslandMode: {\n from: 'dtModeIslandMode',\n default: null,\n },\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Set this prop to render the mode island as a specific HTML element.\n * @type {String}\n * @values div, section, nav, article, aside, header, footer, main\n */\n as: {\n type: String,\n default: 'div',\n },\n\n /**\n * The mode to apply to the island.\n * - 'inverted': Opposite of parent or root mode\n * - 'light': Always light mode\n * - 'dark': Always dark mode\n * @type {String}\n * @values inverted, light, dark\n */\n mode: {\n type: String,\n default: DT_MODE_ISLAND_TYPES.INVERTED,\n validator: modeValidator,\n },\n },\n\n data () {\n return {\n currentContrast: getRootContrast(),\n contrastObserver: null,\n modeObserver: null,\n elementRef: null,\n calculatedMode: null, // Store calculated mode as reactive data\n };\n },\n\n computed: {\n isInverted () {\n return this.mode === DT_MODE_ISLAND_TYPES.INVERTED;\n },\n\n invertedAttribute () {\n return this.isInverted ? '' : null;\n },\n\n computedMode () {\n // If mode is explicitly light or dark, use it directly\n if (this.mode === DT_MODE_ISLAND_TYPES.LIGHT || this.mode === DT_MODE_ISLAND_TYPES.DARK) {\n return this.mode;\n }\n\n // If mode is inverted, use the calculated mode if available\n if (this.mode === DT_MODE_ISLAND_TYPES.INVERTED && this.calculatedMode) {\n return this.calculatedMode;\n }\n\n // Otherwise calculate it now\n return this.calculateInvertedMode();\n },\n },\n\n beforeCreate () {\n // Throw error if data-dt-brand is manually set\n if (this.$attrs && this.$attrs['data-dt-brand']) {\n throw new Error('[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.');\n }\n },\n\n mounted () {\n // Store element reference\n this.elementRef = this.$el;\n\n // Setup MutationObserver to watch for contrast changes on root\n this.setupContrastObserver();\n\n // Setup MutationObserver to watch for mode changes (only if inverted)\n if (this.isInverted) {\n // Initialize the calculated mode\n this.calculatedMode = this.calculateInvertedMode();\n this.setupModeObserver();\n }\n\n // Initial contrast value\n this.currentContrast = getRootContrast();\n },\n\n beforeUnmount () {\n // Cleanup observers\n if (this.contrastObserver) {\n this.contrastObserver.disconnect();\n this.contrastObserver = null;\n }\n if (this.modeObserver) {\n this.modeObserver.disconnect();\n this.modeObserver = null;\n }\n },\n\n methods: {\n calculateInvertedMode () {\n // First check if there's a parent mode island\n if (this.parentModeIslandMode) {\n const parentMode = typeof this.parentModeIslandMode === 'function'\n ? this.parentModeIslandMode()\n : this.parentModeIslandMode;\n return getOppositeMode(parentMode);\n }\n\n // Otherwise, find the nearest parent with data-dt-mode\n if (this.elementRef) {\n const parentMode = findParentMode(this.elementRef);\n return getOppositeMode(parentMode);\n }\n\n // Default fallback\n return getOppositeMode(getRootMode());\n },\n\n setupContrastObserver () {\n this.contrastObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-dt-contrast') {\n this.currentContrast = getRootContrast();\n }\n }\n });\n\n this.contrastObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-dt-contrast'],\n });\n },\n\n setupModeObserver () {\n const config = {\n attributes: true,\n attributeFilter: ['data-dt-mode'],\n subtree: false,\n };\n\n this.modeObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-dt-mode') {\n // Recalculate and update the reactive data property\n this.calculatedMode = this.calculateInvertedMode();\n }\n }\n });\n\n // Observe root element\n this.modeObserver.observe(document.documentElement, config);\n\n // Also observe all parent elements with data-dt-mode\n let parent = this.elementRef?.parentElement;\n while (parent) {\n if (parent.hasAttribute('data-dt-mode')) {\n this.modeObserver.observe(parent, config);\n }\n parent = parent.parentElement;\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DT_MODE_ISLAND_TYPES","modeValidator","getRootContrast","parentMode","getOppositeMode","findParentMode","getRootMode","mutationsList","mutation","config","parent","_a","_createBlock","_resolveDynamicComponent","$props","_mergeProps","_ctx","$options","$data","_withCtx","_renderSlot"],"mappings":";;;;;AAwBA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;;cA5MEE,EADFC,EAESC,EAAA,EAAE,GADTC,EAUY,EARV,OAAM,mBACEC,EAAA,QAAM;AAAA,IACb,gBAAcC,EAAA;AAAA,IACd,6BAA2BA,EAAA;AAAA,IAC3B,oBAAkBC,EAAA;AAAA;IAPvB,SAAAC,EAUI,MAAQ;AAAA,MAARC,EAAQJ,EAAA,QAAA,SAAA;AAAA;IAVZ,GAAA;AAAA;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(t){return t==="light"?"dark":"light"}function o(){return document.documentElement.getAttribute("data-dt-mode")||"light"}function r(){return document.documentElement.getAttribute("data-dt-contrast")||"default"}function d(t){let e=t==null?void 0:t.parentElement;for(;e&&e!==document.documentElement;){if(e.hasAttribute("data-dt-mode"))return e.getAttribute("data-dt-mode");e=e.parentElement}return o()}const u={getOppositeMode:n,getRootMode:o,getRootContrast:r,findParentMode:d};exports.default=u;exports.findParentMode=d;exports.getOppositeMode=n;exports.getRootContrast=r;exports.getRootMode=o;
2
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs","sources":["../../../components/mode_island/utils.js"],"sourcesContent":["/**\n * Get the opposite mode (light <-> dark)\n * @param {string} currentMode - The current mode\n * @returns {string} The opposite mode\n */\nexport function getOppositeMode (currentMode) {\n return currentMode === 'light' ? 'dark' : 'light';\n}\n\n/**\n * Get the mode from the root HTML element\n * @returns {string} The root mode or 'light' as default\n */\nexport function getRootMode () {\n const rootMode = document.documentElement.getAttribute('data-dt-mode');\n return rootMode || 'light';\n}\n\n/**\n * Get the contrast from the root HTML element\n * @returns {string} The root contrast or 'default' as default\n */\nexport function getRootContrast () {\n const rootContrast = document.documentElement.getAttribute('data-dt-contrast');\n return rootContrast || 'default';\n}\n\n/**\n * Find the mode from the nearest parent element with data-dt-mode attribute\n * @param {HTMLElement} el - The starting element\n * @returns {string} The parent mode or root mode\n */\nexport function findParentMode (el) {\n let parent = el?.parentElement;\n while (parent && parent !== document.documentElement) {\n if (parent.hasAttribute('data-dt-mode')) {\n return parent.getAttribute('data-dt-mode');\n }\n parent = parent.parentElement;\n }\n return getRootMode();\n}\n\nexport default {\n getOppositeMode,\n getRootMode,\n getRootContrast,\n findParentMode,\n};"],"names":["getOppositeMode","currentMode","getRootMode","getRootContrast","findParentMode","el","parent","utils"],"mappings":"4GAKO,SAASA,EAAiBC,EAAa,CAC5C,OAAOA,IAAgB,QAAU,OAAS,OAC5C,CAMO,SAASC,GAAe,CAE7B,OADiB,SAAS,gBAAgB,aAAa,cAAc,GAClD,OACrB,CAMO,SAASC,GAAmB,CAEjC,OADqB,SAAS,gBAAgB,aAAa,kBAAkB,GACtD,SACzB,CAOO,SAASC,EAAgBC,EAAI,CAClC,IAAIC,EAASD,GAAA,YAAAA,EAAI,cACjB,KAAOC,GAAUA,IAAW,SAAS,iBAAiB,CACpD,GAAIA,EAAO,aAAa,cAAc,EACpC,OAAOA,EAAO,aAAa,cAAc,EAE3CA,EAASA,EAAO,aAClB,CACA,OAAOJ,EAAW,CACpB,CAEA,MAAAK,EAAe,CACb,gBAAAP,EACA,YAAAE,EACA,gBAAAC,EACA,eAAAC,CACF"}
@@ -0,0 +1,32 @@
1
+ function n(t) {
2
+ return t === "light" ? "dark" : "light";
3
+ }
4
+ function o() {
5
+ return document.documentElement.getAttribute("data-dt-mode") || "light";
6
+ }
7
+ function r() {
8
+ return document.documentElement.getAttribute("data-dt-contrast") || "default";
9
+ }
10
+ function d(t) {
11
+ let e = t == null ? void 0 : t.parentElement;
12
+ for (; e && e !== document.documentElement; ) {
13
+ if (e.hasAttribute("data-dt-mode"))
14
+ return e.getAttribute("data-dt-mode");
15
+ e = e.parentElement;
16
+ }
17
+ return o();
18
+ }
19
+ const u = {
20
+ getOppositeMode: n,
21
+ getRootMode: o,
22
+ getRootContrast: r,
23
+ findParentMode: d
24
+ };
25
+ export {
26
+ u as default,
27
+ d as findParentMode,
28
+ n as getOppositeMode,
29
+ r as getRootContrast,
30
+ o as getRootMode
31
+ };
32
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../components/mode_island/utils.js"],"sourcesContent":["/**\n * Get the opposite mode (light <-> dark)\n * @param {string} currentMode - The current mode\n * @returns {string} The opposite mode\n */\nexport function getOppositeMode (currentMode) {\n return currentMode === 'light' ? 'dark' : 'light';\n}\n\n/**\n * Get the mode from the root HTML element\n * @returns {string} The root mode or 'light' as default\n */\nexport function getRootMode () {\n const rootMode = document.documentElement.getAttribute('data-dt-mode');\n return rootMode || 'light';\n}\n\n/**\n * Get the contrast from the root HTML element\n * @returns {string} The root contrast or 'default' as default\n */\nexport function getRootContrast () {\n const rootContrast = document.documentElement.getAttribute('data-dt-contrast');\n return rootContrast || 'default';\n}\n\n/**\n * Find the mode from the nearest parent element with data-dt-mode attribute\n * @param {HTMLElement} el - The starting element\n * @returns {string} The parent mode or root mode\n */\nexport function findParentMode (el) {\n let parent = el?.parentElement;\n while (parent && parent !== document.documentElement) {\n if (parent.hasAttribute('data-dt-mode')) {\n return parent.getAttribute('data-dt-mode');\n }\n parent = parent.parentElement;\n }\n return getRootMode();\n}\n\nexport default {\n getOppositeMode,\n getRootMode,\n getRootContrast,\n findParentMode,\n};"],"names":["getOppositeMode","currentMode","getRootMode","getRootContrast","findParentMode","el","parent","utils"],"mappings":"AAKO,SAASA,EAAiBC,GAAa;AAC5C,SAAOA,MAAgB,UAAU,SAAS;AAC5C;AAMO,SAASC,IAAe;AAE7B,SADiB,SAAS,gBAAgB,aAAa,cAAc,KAClD;AACrB;AAMO,SAASC,IAAmB;AAEjC,SADqB,SAAS,gBAAgB,aAAa,kBAAkB,KACtD;AACzB;AAOO,SAASC,EAAgBC,GAAI;AAClC,MAAIC,IAASD,KAAA,gBAAAA,EAAI;AACjB,SAAOC,KAAUA,MAAW,SAAS,mBAAiB;AACpD,QAAIA,EAAO,aAAa,cAAc;AACpC,aAAOA,EAAO,aAAa,cAAc;AAE3C,IAAAA,IAASA,EAAO;AAAA,EAClB;AACA,SAAOJ,EAAW;AACpB;AAEA,MAAAK,IAAe;AAAA,EACb,iBAAAP;AAAA,EACA,aAAAE;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./mode-island-constants.cjs");function e(t){return Object.values(o.DT_MODE_ISLAND_TYPES).includes(t)}const a={modeValidator:e};exports.default=a;exports.modeValidator=e;
2
+ //# sourceMappingURL=validators.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.cjs","sources":["../../../components/mode_island/validators.js"],"sourcesContent":["import { DT_MODE_ISLAND_TYPES } from './mode_island_constants';\n\nexport function modeValidator (mode) {\n return Object.values(DT_MODE_ISLAND_TYPES).includes(mode);\n}\n\nexport default {\n modeValidator,\n};"],"names":["modeValidator","mode","DT_MODE_ISLAND_TYPES","validators"],"mappings":"2JAEO,SAASA,EAAeC,EAAM,CACnC,OAAO,OAAO,OAAOC,EAAAA,oBAAoB,EAAE,SAASD,CAAI,CAC1D,CAEA,MAAAE,EAAe,CACb,cAAAH,CACF"}
@@ -0,0 +1,12 @@
1
+ import { DT_MODE_ISLAND_TYPES as o } from "./mode-island-constants.js";
2
+ function a(t) {
3
+ return Object.values(o).includes(t);
4
+ }
5
+ const r = {
6
+ modeValidator: a
7
+ };
8
+ export {
9
+ r as default,
10
+ a as modeValidator
11
+ };
12
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sources":["../../../components/mode_island/validators.js"],"sourcesContent":["import { DT_MODE_ISLAND_TYPES } from './mode_island_constants';\n\nexport function modeValidator (mode) {\n return Object.values(DT_MODE_ISLAND_TYPES).includes(mode);\n}\n\nexport default {\n modeValidator,\n};"],"names":["modeValidator","mode","DT_MODE_ISLAND_TYPES","validators"],"mappings":";AAEO,SAASA,EAAeC,GAAM;AACnC,SAAO,OAAO,OAAOC,CAAoB,EAAE,SAASD,CAAI;AAC1D;AAEA,MAAAE,IAAe;AAAA,EACb,eAAAH;AACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),s=require("../button/button.cjs"),d=require("../button/button-constants.cjs"),u={compatConfig:{MODE:3},name:"SplitButtonAlpha",components:{DtButton:s.default},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},iconPosition:{type:String,default:"left"},labelClass:{type:[String,Array,Object],default:""},loading:{type:Boolean,default:!1},tooltipText:{type:String,default:""},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},importance:{type:String,default:"primary"},kind:{type:String,default:"default"},size:{type:String,default:"md"}},data(){return{BUTTON_ICON_SIZES:d.BUTTON_ICON_SIZES}}};function c(a,_,t,f,i,b){const l=e.resolveComponent("dt-button"),n=e.resolveDirective("dt-tooltip");return e.withDirectives((e.openBlock(),e.createBlock(l,{"data-qa":"dt-split-button-alpha",active:t.active,"aria-label":t.ariaLabel,"assertive-on-focus":t.assertiveOnFocus,class:e.normalizeClass(`d-split-btn__alpha d-split-btn__alpha--${t.size}`),disabled:t.disabled,"icon-position":t.iconPosition,importance:t.importance,kind:t.kind,"label-class":t.labelClass,loading:t.loading,size:t.size},{icon:e.withCtx(()=>[e.renderSlot(a.$slots,"icon",{size:i.BUTTON_ICON_SIZES[t.size]})]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["active","aria-label","assertive-on-focus","class","disabled","icon-position","importance","kind","label-class","loading","size"])),[[n,t.tooltipText]])}const r=o._(u,[["render",c]]);exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),d=require("../button/button.cjs"),r=require("../button/button-constants.cjs"),u={compatConfig:{MODE:3},name:"SplitButtonAlpha",components:{DtButton:d.default},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},iconPosition:{type:String,default:"left"},labelClass:{type:[String,Array,Object],default:""},loading:{type:Boolean,default:!1},tooltipText:{type:String,default:""},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},importance:{type:String,default:"primary"},kind:{type:String,default:"default"},size:{type:String,default:"md"}},data(){return{BUTTON_ICON_SIZES:r.BUTTON_ICON_SIZES}},computed:{tooltipConfig(){return{message:this.tooltipText,inverted:this.kind==="inverted"}}}};function c(i,_,t,b,a,l){const n=e.resolveComponent("dt-button"),o=e.resolveDirective("dt-tooltip");return e.withDirectives((e.openBlock(),e.createBlock(n,{"data-qa":"dt-split-button-alpha",active:t.active,"aria-label":t.ariaLabel,"assertive-on-focus":t.assertiveOnFocus,class:e.normalizeClass(`d-split-btn__alpha d-split-btn__alpha--${t.size}`),disabled:t.disabled,"icon-position":t.iconPosition,importance:t.importance,kind:t.kind,"label-class":t.labelClass,loading:t.loading,size:t.size},{icon:e.withCtx(()=>[e.renderSlot(i.$slots,"icon",{size:a.BUTTON_ICON_SIZES[t.size]})]),default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["active","aria-label","assertive-on-focus","class","disabled","icon-position","importance","kind","label-class","loading","size"])),[[o,l.tooltipConfig]])}const f=s._(u,[["render",c]]);exports.default=f;
2
2
  //# sourceMappingURL=split-button-alpha.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"split-button-alpha.cjs","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipText\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES","_createBlock","_component_dt_button","$props","_normalizeClass","_renderSlot","_ctx","$data","_withCtx"],"mappings":"2QA6BKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,mBAEN,WAAY,CACV,SAAAC,EAAAA,SAGF,MAAO,CAIL,OAAQ,CACN,KAAM,QACN,QAAS,IAMX,UAAW,CACT,KAAM,OACN,QAAS,MAMX,aAAc,CACZ,KAAM,OACN,QAAS,QAMX,WAAY,CACV,KAAM,CAAC,OAAQ,MAAO,MAAM,EAC5B,QAAS,IAMX,QAAS,CACP,KAAM,QACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,IAOX,iBAAkB,CAChB,KAAM,QACN,QAAS,IAMX,SAAU,CACR,KAAM,QACN,QAAS,IAMX,WAAY,CACV,KAAM,OACN,QAAS,WAMX,KAAM,CACJ,KAAM,OACN,QAAS,WAMX,KAAM,CACJ,KAAM,OACN,QAAS,OAIb,MAAQ,CACN,MAAO,CACL,kBAAAC,EAAAA,kBAEJ,CACF,4IApIEC,EAAAA,YAsBYC,EAAA,CApBV,UAAQ,wBACP,OAAQC,EAAA,OACR,aAAYA,EAAA,UACZ,qBAAoBA,EAAA,iBACpB,MAPLC,EAAAA,yDAOsDD,EAAA,IAAI,EAAA,EACrD,SAAUA,EAAA,SACV,gBAAeA,EAAA,aACf,WAAYA,EAAA,WACZ,KAAMA,EAAA,KACN,cAAaA,EAAA,WACb,QAASA,EAAA,QACT,KAAMA,EAAA,OAEI,eACT,IAGE,CAHFE,aAGEC,EAAA,OAAA,OAAA,CADC,KAAMC,EAAA,kBAAkBJ,EAAA,IAAI,MAnBrC,QAAAK,EAAAA,QAsBI,IAAuB,CAAvBH,aAAuBC,EAAA,OAAA,SAAA,IAtB3B,EAAA,8IAEkBH,EAAA,WAAW"}
1
+ {"version":3,"file":"split-button-alpha.cjs","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipConfig\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n\n computed: {\n tooltipConfig () {\n return {\n message: this.tooltipText,\n inverted: this.kind === 'inverted',\n };\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES","_createBlock","_component_dt_button","$props","_normalizeClass","_renderSlot","_ctx","$data","_withCtx","$options"],"mappings":"2QA6BKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,mBAEN,WAAY,CACV,SAAAC,EAAAA,SAGF,MAAO,CAIL,OAAQ,CACN,KAAM,QACN,QAAS,IAMX,UAAW,CACT,KAAM,OACN,QAAS,MAMX,aAAc,CACZ,KAAM,OACN,QAAS,QAMX,WAAY,CACV,KAAM,CAAC,OAAQ,MAAO,MAAM,EAC5B,QAAS,IAMX,QAAS,CACP,KAAM,QACN,QAAS,IAMX,YAAa,CACX,KAAM,OACN,QAAS,IAOX,iBAAkB,CAChB,KAAM,QACN,QAAS,IAMX,SAAU,CACR,KAAM,QACN,QAAS,IAMX,WAAY,CACV,KAAM,OACN,QAAS,WAMX,KAAM,CACJ,KAAM,OACN,QAAS,WAMX,KAAM,CACJ,KAAM,OACN,QAAS,OAIb,MAAQ,CACN,MAAO,CACL,kBAAAC,EAAAA,kBAEJ,EAEA,SAAU,CACR,eAAiB,CACf,MAAO,CACL,QAAS,KAAK,YACd,SAAU,KAAK,OAAS,WAE5B,EAEJ,4IA7IEC,EAAAA,YAsBYC,EAAA,CApBV,UAAQ,wBACP,OAAQC,EAAA,OACR,aAAYA,EAAA,UACZ,qBAAoBA,EAAA,iBACpB,MAPLC,EAAAA,yDAOsDD,EAAA,IAAI,EAAA,EACrD,SAAUA,EAAA,SACV,gBAAeA,EAAA,aACf,WAAYA,EAAA,WACZ,KAAMA,EAAA,KACN,cAAaA,EAAA,WACb,QAASA,EAAA,QACT,KAAMA,EAAA,OAEI,eACT,IAGE,CAHFE,aAGEC,EAAA,OAAA,OAAA,CADC,KAAMC,EAAA,kBAAkBJ,EAAA,IAAI,MAnBrC,QAAAK,EAAAA,QAsBI,IAAuB,CAAvBH,aAAuBC,EAAA,OAAA,SAAA,IAtB3B,EAAA,8IAEkBG,EAAA,aAAa"}
@@ -1,8 +1,8 @@
1
- import { resolveComponent as s, resolveDirective as d, withDirectives as c, createBlock as r, openBlock as f, normalizeClass as u, withCtx as a, renderSlot as i } from "vue";
2
- import { _ as p } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
1
+ import { resolveComponent as d, resolveDirective as r, withDirectives as c, createBlock as f, openBlock as u, normalizeClass as p, withCtx as i, renderSlot as a } from "vue";
2
+ import { _ as m } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  import _ from "../button/button.js";
4
- import { BUTTON_ICON_SIZES as m } from "../button/button-constants.js";
5
- const b = {
4
+ import { BUTTON_ICON_SIZES as b } from "../button/button-constants.js";
5
+ const g = {
6
6
  compatConfig: { MODE: 3 },
7
7
  name: "SplitButtonAlpha",
8
8
  components: {
@@ -90,18 +90,26 @@ const b = {
90
90
  },
91
91
  data() {
92
92
  return {
93
- BUTTON_ICON_SIZES: m
93
+ BUTTON_ICON_SIZES: b
94
94
  };
95
+ },
96
+ computed: {
97
+ tooltipConfig() {
98
+ return {
99
+ message: this.tooltipText,
100
+ inverted: this.kind === "inverted"
101
+ };
102
+ }
95
103
  }
96
104
  };
97
- function S(e, v, t, y, l, g) {
98
- const o = s("dt-button"), n = d("dt-tooltip");
99
- return c((f(), r(o, {
105
+ function v(e, S, t, y, l, o) {
106
+ const n = d("dt-button"), s = r("dt-tooltip");
107
+ return c((u(), f(n, {
100
108
  "data-qa": "dt-split-button-alpha",
101
109
  active: t.active,
102
110
  "aria-label": t.ariaLabel,
103
111
  "assertive-on-focus": t.assertiveOnFocus,
104
- class: u(`d-split-btn__alpha d-split-btn__alpha--${t.size}`),
112
+ class: p(`d-split-btn__alpha d-split-btn__alpha--${t.size}`),
105
113
  disabled: t.disabled,
106
114
  "icon-position": t.iconPosition,
107
115
  importance: t.importance,
@@ -110,20 +118,20 @@ function S(e, v, t, y, l, g) {
110
118
  loading: t.loading,
111
119
  size: t.size
112
120
  }, {
113
- icon: a(() => [
114
- i(e.$slots, "icon", {
121
+ icon: i(() => [
122
+ a(e.$slots, "icon", {
115
123
  size: l.BUTTON_ICON_SIZES[t.size]
116
124
  })
117
125
  ]),
118
- default: a(() => [
119
- i(e.$slots, "default")
126
+ default: i(() => [
127
+ a(e.$slots, "default")
120
128
  ]),
121
129
  _: 3
122
130
  }, 8, ["active", "aria-label", "assertive-on-focus", "class", "disabled", "icon-position", "importance", "kind", "label-class", "loading", "size"])), [
123
- [n, t.tooltipText]
131
+ [s, o.tooltipConfig]
124
132
  ]);
125
133
  }
126
- const O = /* @__PURE__ */ p(b, [["render", S]]);
134
+ const O = /* @__PURE__ */ m(g, [["render", v]]);
127
135
  export {
128
136
  O as default
129
137
  };
@@ -1 +1 @@
1
- {"version":3,"file":"split-button-alpha.js","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipText\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES","_createBlock","_component_dt_button","$props","_normalizeClass","_renderSlot","_ctx","$data","_withCtx"],"mappings":";;;;AA6BA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,OAAO,MAAM;AAAA,MAC5B,SAAS;AAAA;;;;IAMX,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;;IAOX,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA;;EAIb,OAAQ;AACN,WAAO;AAAA,MACL,mBAAAC;AAAA;EAEJ;AACF;;;iBApIEC,EAsBYC,GAAA;AAAA,IApBV,WAAQ;AAAA,IACP,QAAQC,EAAA;AAAA,IACR,cAAYA,EAAA;AAAA,IACZ,sBAAoBA,EAAA;AAAA,IACpB,OAPLC,4CAOsDD,EAAA,IAAI,EAAA;AAAA,IACrD,UAAUA,EAAA;AAAA,IACV,iBAAeA,EAAA;AAAA,IACf,YAAYA,EAAA;AAAA,IACZ,MAAMA,EAAA;AAAA,IACN,eAAaA,EAAA;AAAA,IACb,SAASA,EAAA;AAAA,IACT,MAAMA,EAAA;AAAA;IAEI,QACT,MAGE;AAAA,MAHFE,EAGEC,EAAA,QAAA,QAAA;AAAA,QADC,MAAMC,EAAA,kBAAkBJ,EAAA,IAAI;AAAA;;IAnBrC,SAAAK,EAsBI,MAAuB;AAAA,MAAvBH,EAAuBC,EAAA,QAAA,SAAA;AAAA;IAtB3B,GAAA;AAAA;QAEkBH,EAAA,WAAW;AAAA;;;"}
1
+ {"version":3,"file":"split-button-alpha.js","sources":["../../../components/split_button/split_button-alpha.vue"],"sourcesContent":["<template>\n <dt-button\n v-dt-tooltip=\"tooltipConfig\"\n data-qa=\"dt-split-button-alpha\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :assertive-on-focus=\"assertiveOnFocus\"\n :class=\"`d-split-btn__alpha d-split-btn__alpha--${size}`\"\n :disabled=\"disabled\"\n :icon-position=\"iconPosition\"\n :importance=\"importance\"\n :kind=\"kind\"\n :label-class=\"labelClass\"\n :loading=\"loading\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"BUTTON_ICON_SIZES[size]\"\n />\n </template>\n <slot name=\"default\" />\n </dt-button>\n</template>\n\n<script>\nimport { BUTTON_ICON_SIZES, DtButton } from '@/components/button';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'SplitButtonAlpha',\n\n components: {\n DtButton,\n },\n\n props: {\n /**\n * Determines whether the button should have active styling\n */\n active: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the button\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * The position of the icon slot within the button.\n */\n iconPosition: {\n type: String,\n default: 'left',\n },\n\n /**\n * Used to customize the label container\n */\n labelClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Whether the button should display a loading animation or not.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n\n /**\n * Determines whether a screenreader reads live updates of\n * the button content to the user while the button is in focus.\n */\n assertiveOnFocus: {\n type: Boolean,\n default: false,\n },\n\n /**\n * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The fill and outline of the button associated with its visual importance.\n */\n importance: {\n type: String,\n default: 'primary',\n },\n\n /**\n * The color of the button.\n */\n kind: {\n type: String,\n default: 'default',\n },\n\n /**\n * The size of the button.\n */\n size: {\n type: String,\n default: 'md',\n },\n },\n\n data () {\n return {\n BUTTON_ICON_SIZES,\n };\n },\n\n computed: {\n tooltipConfig () {\n return {\n message: this.tooltipText,\n inverted: this.kind === 'inverted',\n };\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","BUTTON_ICON_SIZES","_createBlock","_component_dt_button","$props","_normalizeClass","_renderSlot","_ctx","$data","_withCtx","$options"],"mappings":";;;;AA6BA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,UAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,cA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AAAA;IAtB3B,GAAA;AAAA;QAEkBG,EAAA,aAAa;AAAA;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./split-button-constants.cjs"),d=require("@dialpad/dialtone-icons/vue3"),c=require("../../common/utils/index.cjs"),t=require("vue"),s=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),u=require("../button/button.cjs"),_={compatConfig:{MODE:3},name:"SplitButtonOmega",components:{DtButton:u.default,DtIconChevronDown:d.DtIconChevronDown},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},disabled:{type:Boolean,default:!1},id:{type:String,default:c.getUniqueString()},importance:{type:String,default:"primary"},kind:{type:String,default:"default"},size:{type:String,default:"md"},tooltipText:{type:String,default:""}},data(){return{SPLIT_BUTTON_ICON_SIZES:r.SPLIT_BUTTON_ICON_SIZES}}};function S(i,b,e,p,n,f){const o=t.resolveComponent("dt-icon-chevron-down"),a=t.resolveComponent("dt-button"),l=t.resolveDirective("dt-tooltip");return t.withDirectives((t.openBlock(),t.createBlock(a,{id:e.id,"data-qa":"dt-split-button-omega",active:e.active,"aria-label":e.ariaLabel,class:t.normalizeClass(`d-split-btn__omega d-split-btn__omega--${e.size}`),disabled:e.disabled,importance:e.importance,kind:e.kind,size:e.size},{icon:t.withCtx(()=>[t.renderSlot(i.$slots,"icon",{size:n.SPLIT_BUTTON_ICON_SIZES[e.size]},()=>[t.createVNode(o,{size:n.SPLIT_BUTTON_ICON_SIZES[e.size]},null,8,["size"])])]),_:3},8,["id","active","aria-label","class","disabled","importance","kind","size"])),[[l,e.tooltipText]])}const m=s._(_,[["render",S]]);exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./split-button-constants.cjs"),r=require("@dialpad/dialtone-icons/vue3"),c=require("../../common/utils/index.cjs"),t=require("vue"),s=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),u=require("../button/button.cjs"),_={compatConfig:{MODE:3},name:"SplitButtonOmega",components:{DtButton:u.default,DtIconChevronDown:r.DtIconChevronDown},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},disabled:{type:Boolean,default:!1},id:{type:String,default:c.getUniqueString()},importance:{type:String,default:"primary"},kind:{type:String,default:"default"},size:{type:String,default:"md"},tooltipText:{type:String,default:""}},data(){return{SPLIT_BUTTON_ICON_SIZES:d.SPLIT_BUTTON_ICON_SIZES}}};function m(i,v,e,b,n,f){const o=t.resolveComponent("dt-icon-chevron-down"),a=t.resolveComponent("dt-button"),l=t.resolveDirective("dt-tooltip");return t.withDirectives((t.openBlock(),t.createBlock(a,{id:e.id,"data-qa":"dt-split-button-omega",active:e.active,"aria-label":e.ariaLabel,class:t.normalizeClass(`d-split-btn__omega d-split-btn__omega--${e.size}`),disabled:e.disabled,importance:e.importance,kind:e.kind,size:e.size},{icon:t.withCtx(()=>[t.renderSlot(i.$slots,"icon",{size:n.SPLIT_BUTTON_ICON_SIZES[e.size]},()=>[t.createVNode(o,{size:n.SPLIT_BUTTON_ICON_SIZES[e.size]},null,8,["size"])])]),_:3},8,["id","active","aria-label","class","disabled","importance","kind","size"])),[[l,{message:e.tooltipText,inverted:e.kind==="inverted"}]])}const S=s._(_,[["render",m]]);exports.default=S;
2
2
  //# sourceMappingURL=split-button-omega.cjs.map