@dialpad/dialtone-vue 2.201.0-next.2 → 2.201.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.
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +203 -199
- package/dist/dialtone-vue.js.map +1 -1
- package/dist/lib/mode-island/index.cjs +2 -0
- package/dist/lib/mode-island/index.cjs.map +1 -0
- package/dist/lib/mode-island/index.js +7 -0
- package/dist/lib/mode-island/index.js.map +1 -0
- package/dist/lib/mode-island/mode-island-constants.cjs +2 -0
- package/dist/lib/mode-island/mode-island-constants.cjs.map +1 -0
- package/dist/lib/mode-island/mode-island-constants.js +12 -0
- package/dist/lib/mode-island/mode-island-constants.js.map +1 -0
- package/dist/lib/mode-island/mode-island.cjs +2 -0
- package/dist/lib/mode-island/mode-island.cjs.map +1 -0
- package/dist/lib/mode-island/mode-island.js +124 -0
- package/dist/lib/mode-island/mode-island.js.map +1 -0
- package/dist/lib/mode-island/utils.cjs +2 -0
- package/dist/lib/mode-island/utils.cjs.map +1 -0
- package/dist/lib/mode-island/utils.js +32 -0
- package/dist/lib/mode-island/utils.js.map +1 -0
- package/dist/lib/mode-island/validators.cjs +2 -0
- package/dist/lib/mode-island/validators.cjs.map +1 -0
- package/dist/lib/mode-island/validators.js +12 -0
- package/dist/lib/mode-island/validators.js.map +1 -0
- package/dist/lib/split-button/split-button-alpha.cjs +1 -1
- package/dist/lib/split-button/split-button-alpha.cjs.map +1 -1
- package/dist/lib/split-button/split-button-alpha.js +16 -8
- package/dist/lib/split-button/split-button-alpha.js.map +1 -1
- package/dist/lib/split-button/split-button-omega.cjs +1 -1
- package/dist/lib/split-button/split-button-omega.cjs.map +1 -1
- package/dist/lib/split-button/split-button-omega.js +10 -10
- package/dist/lib/split-button/split-button-omega.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +17 -16
- package/dist/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/types/components/mode_island/index.d.ts +3 -0
- package/dist/types/components/mode_island/index.d.ts.map +1 -0
- package/dist/types/components/mode_island/mode_island.vue.d.ts +3 -0
- package/dist/types/components/mode_island/mode_island.vue.d.ts.map +1 -0
- package/dist/types/components/mode_island/mode_island_constants.d.ts +10 -0
- package/dist/types/components/mode_island/mode_island_constants.d.ts.map +1 -0
- package/dist/types/components/mode_island/utils.d.ts +12 -0
- package/dist/types/components/mode_island/utils.d.ts.map +1 -0
- package/dist/types/components/mode_island/validators.d.ts +6 -0
- package/dist/types/components/mode_island/validators.d.ts.map +1 -0
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts +6 -1
- package/dist/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +5 -5
|
@@ -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 @@
|
|
|
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 s=require("./mode-island-constants.cjs"),a=require("./validators.cjs"),r=require("./utils.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),l={name:"DtModeIsland",provide(){return{dtModeIslandMode:()=>this.computedMode}},inject:{parentModeIslandMode:{from:"dtModeIslandMode",default:null}},inheritAttrs:!1,props:{as:{type:String,default:"div"},mode:{type:String,default:s.DT_MODE_ISLAND_TYPES.INVERTED,validator:a.modeValidator}},data(){return{currentContrast:r.getRootContrast(),contrastObserver:null,modeObserver:null,elementRef:null,calculatedMode:null}},computed:{isInverted(){return this.mode===s.DT_MODE_ISLAND_TYPES.INVERTED},invertedAttribute(){return this.isInverted?"":null},computedMode(){return this.mode===s.DT_MODE_ISLAND_TYPES.LIGHT||this.mode===s.DT_MODE_ISLAND_TYPES.DARK?this.mode:this.mode===s.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()},beforeDestroy(){this.contrastObserver&&(this.contrastObserver.disconnect(),this.contrastObserver=null),this.modeObserver&&(this.modeObserver.disconnect(),this.modeObserver=null)},methods:{calculateInvertedMode(){if(this.parentModeIslandMode){const t=typeof this.parentModeIslandMode=="function"?this.parentModeIslandMode():this.parentModeIslandMode;return r.getOppositeMode(t)}if(this.elementRef){const t=r.findParentMode(this.elementRef);return r.getOppositeMode(t)}return r.getOppositeMode(r.getRootMode())},setupContrastObserver(){this.contrastObserver=new MutationObserver(t=>{for(const e of t)e.type==="attributes"&&e.attributeName==="data-dt-contrast"&&(this.currentContrast=r.getRootContrast())}),this.contrastObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-dt-contrast"]})},setupModeObserver(){var o;const t={attributes:!0,attributeFilter:["data-dt-mode"],subtree:!1};this.modeObserver=new MutationObserver(n=>{for(const d of n)d.type==="attributes"&&d.attributeName==="data-dt-mode"&&(this.calculatedMode=this.calculateInvertedMode())}),this.modeObserver.observe(document.documentElement,t);let e=(o=this.elementRef)==null?void 0:o.parentElement;for(;e;)e.hasAttribute("data-dt-mode")&&this.modeObserver.observe(e,t),e=e.parentElement}}};var u=function(){var e=this,o=e._self._c;return o(e.as,e._b({tag:"component",staticClass:"d-mode-island",attrs:{"data-dt-mode":e.computedMode,"data-mode-island-inverted":e.invertedAttribute,"data-dt-contrast":e.currentContrast}},"component",e.$attrs,!1),[e._t("default")],2)},c=[],m=i.n(l,u,c);const h=m.exports;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\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 beforeDestroy () {\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"],"mappings":"0QAwBAA,EAAA,CACA,KAAA,eAEA,SAAA,CACA,MAAA,CACA,iBAAA,IAAA,KAAA,YACA,CACA,EAEA,OAAA,CACA,qBAAA,CACA,KAAA,mBACA,QAAA,IACA,CACA,EAEA,aAAA,GAEA,MAAA,CAMA,GAAA,CACA,KAAA,OACA,QAAA,KACA,EAUA,KAAA,CACA,KAAA,OACA,QAAAC,EAAAA,qBAAA,SACA,UAAAC,EAAAA,aACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,gBAAAC,EAAAA,gBAAA,EACA,iBAAA,KACA,aAAA,KACA,WAAA,KACA,eAAA,IACA,CACA,EAEA,SAAA,CACA,YAAA,CACA,OAAA,KAAA,OAAAF,EAAAA,qBAAA,QACA,EAEA,mBAAA,CACA,OAAA,KAAA,WAAA,GAAA,IACA,EAEA,cAAA,CAEA,OAAA,KAAA,OAAAA,uBAAA,OAAA,KAAA,OAAAA,EAAAA,qBAAA,KACA,KAAA,KAIA,KAAA,OAAAA,EAAAA,qBAAA,UAAA,KAAA,eACA,KAAA,eAIA,KAAA,sBAAA,CACA,CACA,EAEA,cAAA,CAEA,GAAA,KAAA,QAAA,KAAA,OAAA,eAAA,EACA,MAAA,IAAA,MAAA,wHAAA,CAEA,EAEA,SAAA,CAEA,KAAA,WAAA,KAAA,IAGA,KAAA,sBAAA,EAGA,KAAA,aAEA,KAAA,eAAA,KAAA,sBAAA,EACA,KAAA,kBAAA,GAIA,KAAA,gBAAAE,kBAAA,CACA,EAEA,eAAA,CAEA,KAAA,mBACA,KAAA,iBAAA,WAAA,EACA,KAAA,iBAAA,MAEA,KAAA,eACA,KAAA,aAAA,WAAA,EACA,KAAA,aAAA,KAEA,EAEA,QAAA,CACA,uBAAA,CAEA,GAAA,KAAA,qBAAA,CACA,MAAAC,EAAA,OAAA,KAAA,sBAAA,WACA,KAAA,qBAAA,EACA,KAAA,qBACA,OAAAC,EAAAA,gBAAAD,CAAA,CACA,CAGA,GAAA,KAAA,WAAA,CACA,MAAAA,EAAAE,EAAAA,eAAA,KAAA,UAAA,EACA,OAAAD,EAAAA,gBAAAD,CAAA,CACA,CAGA,OAAAC,EAAAA,gBAAAE,EAAAA,aAAA,CACA,EAEA,uBAAA,CACA,KAAA,iBAAA,IAAA,iBAAAC,GAAA,CACA,UAAAC,KAAAD,EACAC,EAAA,OAAA,cAAAA,EAAA,gBAAA,qBACA,KAAA,gBAAAN,kBAAA,EAGA,CAAA,EAEA,KAAA,iBAAA,QAAA,SAAA,gBAAA,CACA,WAAA,GACA,gBAAA,CAAA,kBAAA,CACA,CAAA,CACA,EAEA,mBAAA,OACA,MAAAO,EAAA,CACA,WAAA,GACA,gBAAA,CAAA,cAAA,EACA,QAAA,EACA,EAEA,KAAA,aAAA,IAAA,iBAAAF,GAAA,CACA,UAAAC,KAAAD,EACAC,EAAA,OAAA,cAAAA,EAAA,gBAAA,iBAEA,KAAA,eAAA,KAAA,sBAAA,EAGA,CAAA,EAGA,KAAA,aAAA,QAAA,SAAA,gBAAAC,CAAA,EAGA,IAAAC,GAAAC,EAAA,KAAA,aAAA,YAAAA,EAAA,cACA,KAAAD,GACAA,EAAA,aAAA,cAAA,GACA,KAAA,aAAA,QAAAA,EAAAD,CAAA,EAEAC,EAAAA,EAAA,aAEA,CACA,CACA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { DT_MODE_ISLAND_TYPES as r } from "./mode-island-constants.js";
|
|
2
|
+
import { modeValidator as i } from "./validators.js";
|
|
3
|
+
import { getRootContrast as s, getOppositeMode as d, findParentMode as l, getRootMode as u } from "./utils.js";
|
|
4
|
+
import { n as c } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
5
|
+
const m = {
|
|
6
|
+
name: "DtModeIsland",
|
|
7
|
+
provide() {
|
|
8
|
+
return {
|
|
9
|
+
dtModeIslandMode: () => this.computedMode
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
inject: {
|
|
13
|
+
parentModeIslandMode: {
|
|
14
|
+
from: "dtModeIslandMode",
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
props: {
|
|
20
|
+
/**
|
|
21
|
+
* Set this prop to render the mode island as a specific HTML element.
|
|
22
|
+
* @type {String}
|
|
23
|
+
* @values div, section, nav, article, aside, header, footer, main
|
|
24
|
+
*/
|
|
25
|
+
as: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "div"
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* The mode to apply to the island.
|
|
31
|
+
* - 'inverted': Opposite of parent or root mode
|
|
32
|
+
* - 'light': Always light mode
|
|
33
|
+
* - 'dark': Always dark mode
|
|
34
|
+
* @type {String}
|
|
35
|
+
* @values inverted, light, dark
|
|
36
|
+
*/
|
|
37
|
+
mode: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: r.INVERTED,
|
|
40
|
+
validator: i
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
currentContrast: s(),
|
|
46
|
+
contrastObserver: null,
|
|
47
|
+
modeObserver: null,
|
|
48
|
+
elementRef: null,
|
|
49
|
+
calculatedMode: null
|
|
50
|
+
// Store calculated mode as reactive data
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
isInverted() {
|
|
55
|
+
return this.mode === r.INVERTED;
|
|
56
|
+
},
|
|
57
|
+
invertedAttribute() {
|
|
58
|
+
return this.isInverted ? "" : null;
|
|
59
|
+
},
|
|
60
|
+
computedMode() {
|
|
61
|
+
return this.mode === r.LIGHT || this.mode === r.DARK ? this.mode : this.mode === r.INVERTED && this.calculatedMode ? this.calculatedMode : this.calculateInvertedMode();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
beforeCreate() {
|
|
65
|
+
if (this.$attrs && this.$attrs["data-dt-brand"])
|
|
66
|
+
throw new Error("[DtModeIsland] The data-dt-brand attribute is not allowed on mode islands. Brand should only be set at the root level.");
|
|
67
|
+
},
|
|
68
|
+
mounted() {
|
|
69
|
+
this.elementRef = this.$el, this.setupContrastObserver(), this.isInverted && (this.calculatedMode = this.calculateInvertedMode(), this.setupModeObserver()), this.currentContrast = s();
|
|
70
|
+
},
|
|
71
|
+
beforeDestroy() {
|
|
72
|
+
this.contrastObserver && (this.contrastObserver.disconnect(), this.contrastObserver = null), this.modeObserver && (this.modeObserver.disconnect(), this.modeObserver = null);
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
calculateInvertedMode() {
|
|
76
|
+
if (this.parentModeIslandMode) {
|
|
77
|
+
const e = typeof this.parentModeIslandMode == "function" ? this.parentModeIslandMode() : this.parentModeIslandMode;
|
|
78
|
+
return d(e);
|
|
79
|
+
}
|
|
80
|
+
if (this.elementRef) {
|
|
81
|
+
const e = l(this.elementRef);
|
|
82
|
+
return d(e);
|
|
83
|
+
}
|
|
84
|
+
return d(u());
|
|
85
|
+
},
|
|
86
|
+
setupContrastObserver() {
|
|
87
|
+
this.contrastObserver = new MutationObserver((e) => {
|
|
88
|
+
for (const t of e)
|
|
89
|
+
t.type === "attributes" && t.attributeName === "data-dt-contrast" && (this.currentContrast = s());
|
|
90
|
+
}), this.contrastObserver.observe(document.documentElement, {
|
|
91
|
+
attributes: !0,
|
|
92
|
+
attributeFilter: ["data-dt-contrast"]
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
setupModeObserver() {
|
|
96
|
+
var o;
|
|
97
|
+
const e = {
|
|
98
|
+
attributes: !0,
|
|
99
|
+
attributeFilter: ["data-dt-mode"],
|
|
100
|
+
subtree: !1
|
|
101
|
+
};
|
|
102
|
+
this.modeObserver = new MutationObserver((a) => {
|
|
103
|
+
for (const n of a)
|
|
104
|
+
n.type === "attributes" && n.attributeName === "data-dt-mode" && (this.calculatedMode = this.calculateInvertedMode());
|
|
105
|
+
}), this.modeObserver.observe(document.documentElement, e);
|
|
106
|
+
let t = (o = this.elementRef) == null ? void 0 : o.parentElement;
|
|
107
|
+
for (; t; )
|
|
108
|
+
t.hasAttribute("data-dt-mode") && this.modeObserver.observe(t, e), t = t.parentElement;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var h = function() {
|
|
113
|
+
var t = this, o = t._self._c;
|
|
114
|
+
return o(t.as, t._b({ tag: "component", staticClass: "d-mode-island", attrs: { "data-dt-mode": t.computedMode, "data-mode-island-inverted": t.invertedAttribute, "data-dt-contrast": t.currentContrast } }, "component", t.$attrs, !1), [t._t("default")], 2);
|
|
115
|
+
}, f = [], b = /* @__PURE__ */ c(
|
|
116
|
+
m,
|
|
117
|
+
h,
|
|
118
|
+
f
|
|
119
|
+
);
|
|
120
|
+
const O = b.exports;
|
|
121
|
+
export {
|
|
122
|
+
O as default
|
|
123
|
+
};
|
|
124
|
+
//# 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\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 beforeDestroy () {\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"],"mappings":";;;;AAwBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,UAAA;AACA,WAAA;AAAA,MACA,kBAAA,MAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA;AAAA,IACA,sBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,MACA,WAAAC;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,iBAAAC,EAAA;AAAA,MACA,kBAAA;AAAA,MACA,cAAA;AAAA,MACA,YAAA;AAAA,MACA,gBAAA;AAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,SAAAF,EAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,aAAA,KAAA,aAAA,KAAA;AAAA,IACA;AAAA,IAEA,eAAA;AAEA,aAAA,KAAA,SAAAA,EAAA,SAAA,KAAA,SAAAA,EAAA,OACA,KAAA,OAIA,KAAA,SAAAA,EAAA,YAAA,KAAA,iBACA,KAAA,iBAIA,KAAA,sBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,eAAA;AAEA,QAAA,KAAA,UAAA,KAAA,OAAA,eAAA;AACA,YAAA,IAAA,MAAA,wHAAA;AAAA,EAEA;AAAA,EAEA,UAAA;AAEA,SAAA,aAAA,KAAA,KAGA,KAAA,sBAAA,GAGA,KAAA,eAEA,KAAA,iBAAA,KAAA,sBAAA,GACA,KAAA,kBAAA,IAIA,KAAA,kBAAAE,EAAA;AAAA,EACA;AAAA,EAEA,gBAAA;AAEA,IAAA,KAAA,qBACA,KAAA,iBAAA,WAAA,GACA,KAAA,mBAAA,OAEA,KAAA,iBACA,KAAA,aAAA,WAAA,GACA,KAAA,eAAA;AAAA,EAEA;AAAA,EAEA,SAAA;AAAA,IACA,wBAAA;AAEA,UAAA,KAAA,sBAAA;AACA,cAAAC,IAAA,OAAA,KAAA,wBAAA,aACA,KAAA,qBAAA,IACA,KAAA;AACA,eAAAC,EAAAD,CAAA;AAAA,MACA;AAGA,UAAA,KAAA,YAAA;AACA,cAAAA,IAAAE,EAAA,KAAA,UAAA;AACA,eAAAD,EAAAD,CAAA;AAAA,MACA;AAGA,aAAAC,EAAAE,GAAA;AAAA,IACA;AAAA,IAEA,wBAAA;AACA,WAAA,mBAAA,IAAA,iBAAA,CAAAC,MAAA;AACA,mBAAAC,KAAAD;AACA,UAAAC,EAAA,SAAA,gBAAAA,EAAA,kBAAA,uBACA,KAAA,kBAAAN,EAAA;AAAA,MAGA,CAAA,GAEA,KAAA,iBAAA,QAAA,SAAA,iBAAA;AAAA,QACA,YAAA;AAAA,QACA,iBAAA,CAAA,kBAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,oBAAA;;AACA,YAAAO,IAAA;AAAA,QACA,YAAA;AAAA,QACA,iBAAA,CAAA,cAAA;AAAA,QACA,SAAA;AAAA,MACA;AAEA,WAAA,eAAA,IAAA,iBAAA,CAAAF,MAAA;AACA,mBAAAC,KAAAD;AACA,UAAAC,EAAA,SAAA,gBAAAA,EAAA,kBAAA,mBAEA,KAAA,iBAAA,KAAA,sBAAA;AAAA,MAGA,CAAA,GAGA,KAAA,aAAA,QAAA,SAAA,iBAAAC,CAAA;AAGA,UAAAC,KAAAC,IAAA,KAAA,eAAA,gBAAAA,EAAA;AACA,aAAAD;AACA,QAAAA,EAAA,aAAA,cAAA,KACA,KAAA,aAAA,QAAAA,GAAAD,CAAA,GAEAC,IAAAA,EAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;"}
|
|
@@ -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 a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),i=require("../button/button.cjs"),n=require("../button/button-constants.cjs"),o={name:"SplitButtonAlpha",components:{DtButton:i.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:n.BUTTON_ICON_SIZES}},computed:{tooltipConfig(){return{message:this.tooltipText,inverted:this.kind==="inverted"}}}};var l=function(){var t=this,e=t._self._c;return e("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:t.tooltipConfig,expression:"tooltipConfig"}],class:`d-split-btn__alpha d-split-btn__alpha--${t.size}`,attrs:{"data-qa":"dt-split-button-alpha",active:t.active,"aria-label":t.ariaLabel,"assertive-on-focus":t.assertiveOnFocus,disabled:t.disabled,"icon-position":t.iconPosition,importance:t.importance,kind:t.kind,"label-class":t.labelClass,loading:t.loading,size:t.size},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon",null,{size:t.BUTTON_ICON_SIZES[t.size]})]},proxy:!0}],null,!0)},[t._t("default")],2)},s=[],r=a.n(o,l,s);const u=r.exports;exports.default=u;
|
|
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=\"
|
|
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 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"],"mappings":"wPA6BAA,EAAA,CACA,KAAA,mBAEA,WAAA,CACA,SAAAC,EAAAA,OACA,EAEA,MAAA,CAIA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,MACA,EAKA,WAAA,CACA,KAAA,CAAA,OAAA,MAAA,MAAA,EACA,QAAA,EACA,EAKA,QAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,iBAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,WAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,IACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,kBAAAC,EAAAA,iBACA,CACA,EAEA,SAAA,CACA,eAAA,CACA,MAAA,CACA,QAAA,KAAA,YACA,SAAA,KAAA,OAAA,UACA,CACA,CACA,CACA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
2
2
|
import i from "../button/button.js";
|
|
3
|
-
import { BUTTON_ICON_SIZES as
|
|
4
|
-
const
|
|
3
|
+
import { BUTTON_ICON_SIZES as o } from "../button/button-constants.js";
|
|
4
|
+
const n = {
|
|
5
5
|
name: "SplitButtonAlpha",
|
|
6
6
|
components: {
|
|
7
7
|
DtButton: i
|
|
@@ -88,22 +88,30 @@ const o = {
|
|
|
88
88
|
},
|
|
89
89
|
data() {
|
|
90
90
|
return {
|
|
91
|
-
BUTTON_ICON_SIZES:
|
|
91
|
+
BUTTON_ICON_SIZES: o
|
|
92
92
|
};
|
|
93
|
+
},
|
|
94
|
+
computed: {
|
|
95
|
+
tooltipConfig() {
|
|
96
|
+
return {
|
|
97
|
+
message: this.tooltipText,
|
|
98
|
+
inverted: this.kind === "inverted"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
93
101
|
}
|
|
94
102
|
};
|
|
95
|
-
var
|
|
103
|
+
var l = function() {
|
|
96
104
|
var t = this, e = t._self._c;
|
|
97
|
-
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: t.
|
|
105
|
+
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: t.tooltipConfig, expression: "tooltipConfig" }], class: `d-split-btn__alpha d-split-btn__alpha--${t.size}`, attrs: { "data-qa": "dt-split-button-alpha", active: t.active, "aria-label": t.ariaLabel, "assertive-on-focus": t.assertiveOnFocus, disabled: t.disabled, "icon-position": t.iconPosition, importance: t.importance, kind: t.kind, "label-class": t.labelClass, loading: t.loading, size: t.size }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
98
106
|
return [t._t("icon", null, { size: t.BUTTON_ICON_SIZES[t.size] })];
|
|
99
107
|
}, proxy: !0 }], null, !0) }, [t._t("default")], 2);
|
|
100
108
|
}, s = [], r = /* @__PURE__ */ a(
|
|
101
|
-
o,
|
|
102
109
|
n,
|
|
110
|
+
l,
|
|
103
111
|
s
|
|
104
112
|
);
|
|
105
|
-
const
|
|
113
|
+
const c = r.exports;
|
|
106
114
|
export {
|
|
107
|
-
|
|
115
|
+
c as default
|
|
108
116
|
};
|
|
109
117
|
//# sourceMappingURL=split-button-alpha.js.map
|
|
@@ -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=\"
|
|
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 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"],"mappings":";;;AA6BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA,CAAA,QAAA,OAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,mBAAAC;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,gBAAA;AACA,aAAA;AAAA,QACA,SAAA,KAAA;AAAA,QACA,UAAA,KAAA,SAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./split-button-constants.cjs"),i=require("@dialpad/dialtone-icons/vue2"),o=require("../../common/utils/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./split-button-constants.cjs"),i=require("@dialpad/dialtone-icons/vue2"),o=require("../../common/utils/index.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),a=require("../button/button.cjs"),s={name:"SplitButtonOmega",components:{DtButton:a.default,DtIconChevronDown:i.DtIconChevronDown},props:{active:{type:Boolean,default:!1},ariaLabel:{type:String,default:null},disabled:{type:Boolean,default:!1},id:{type:String,default:o.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:n.SPLIT_BUTTON_ICON_SIZES}}};var l=function(){var t=this,e=t._self._c;return e("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:{message:t.tooltipText,inverted:t.kind==="inverted"},expression:"{ message: tooltipText, inverted: kind === 'inverted' }"}],class:`d-split-btn__omega d-split-btn__omega--${t.size}`,attrs:{id:t.id,"data-qa":"dt-split-button-omega",active:t.active,"aria-label":t.ariaLabel,disabled:t.disabled,importance:t.importance,kind:t.kind,size:t.size},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon",function(){return[e("dt-icon-chevron-down",{attrs:{size:t.SPLIT_BUTTON_ICON_SIZES[t.size]}})]},{size:t.SPLIT_BUTTON_ICON_SIZES[t.size]})]},proxy:!0}],null,!0)})},d=[],u=r.n(s,l,d);const _=u.exports;exports.default=_;
|
|
2
2
|
//# sourceMappingURL=split-button-omega.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button-omega.cjs","sources":["../../../components/split_button/split_button-omega.vue"],"sourcesContent":["<template>\n <dt-button\n :id=\"id\"\n v-dt-tooltip=\"tooltipText\"\n data-qa=\"dt-split-button-omega\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :class=\"`d-split-btn__omega d-split-btn__omega--${size}`\"\n :disabled=\"disabled\"\n :importance=\"importance\"\n :kind=\"kind\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"SPLIT_BUTTON_ICON_SIZES[size]\"\n >\n <dt-icon-chevron-down :size=\"SPLIT_BUTTON_ICON_SIZES[size]\" />\n </slot>\n </template>\n </dt-button>\n</template>\n\n<script>\nimport { SPLIT_BUTTON_ICON_SIZES } from './split_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronDown } from '@dialpad/dialtone-icons/vue2';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'SplitButtonOmega',\n components: {\n DtButton,\n DtIconChevronDown,\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 * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n id: {\n type: String,\n default: getUniqueString(),\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 * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n SPLIT_BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronDown","getUniqueString","SPLIT_BUTTON_ICON_SIZES"],"mappings":"0UA8BAA,EAAA,CACA,KAAA,mBACA,WAAA,CACA,SAAAC,EAAAA,QACA,kBAAAC,EAAAA,iBACA,EAEA,MAAA,CAIA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,GAAA,CACA,KAAA,OACA,QAAAC,EAAAA,gBAAA,CACA,EAKA,WAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,wBAAAC,EAAAA,uBACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"split-button-omega.cjs","sources":["../../../components/split_button/split_button-omega.vue"],"sourcesContent":["<template>\n <dt-button\n :id=\"id\"\n v-dt-tooltip=\"{ message: tooltipText, inverted: kind === 'inverted' }\"\n data-qa=\"dt-split-button-omega\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :class=\"`d-split-btn__omega d-split-btn__omega--${size}`\"\n :disabled=\"disabled\"\n :importance=\"importance\"\n :kind=\"kind\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"SPLIT_BUTTON_ICON_SIZES[size]\"\n >\n <dt-icon-chevron-down :size=\"SPLIT_BUTTON_ICON_SIZES[size]\" />\n </slot>\n </template>\n </dt-button>\n</template>\n\n<script>\nimport { SPLIT_BUTTON_ICON_SIZES } from './split_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronDown } from '@dialpad/dialtone-icons/vue2';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'SplitButtonOmega',\n components: {\n DtButton,\n DtIconChevronDown,\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 * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n id: {\n type: String,\n default: getUniqueString(),\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 * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n SPLIT_BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronDown","getUniqueString","SPLIT_BUTTON_ICON_SIZES"],"mappings":"0UA8BAA,EAAA,CACA,KAAA,mBACA,WAAA,CACA,SAAAC,EAAAA,QACA,kBAAAC,EAAAA,iBACA,EAEA,MAAA,CAIA,OAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,GAAA,CACA,KAAA,OACA,QAAAC,EAAAA,gBAAA,CACA,EAKA,WAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,SACA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,wBAAAC,EAAAA,uBACA,CACA,CACA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SPLIT_BUTTON_ICON_SIZES as i } from "./split-button-constants.js";
|
|
2
2
|
import { DtIconChevronDown as n } from "@dialpad/dialtone-icons/vue2";
|
|
3
|
-
import { getUniqueString as
|
|
4
|
-
import { n as
|
|
3
|
+
import { getUniqueString as a } from "../../common/utils/index.js";
|
|
4
|
+
import { n as o } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
5
5
|
import r from "../button/button.js";
|
|
6
|
-
const
|
|
6
|
+
const d = {
|
|
7
7
|
name: "SplitButtonOmega",
|
|
8
8
|
components: {
|
|
9
9
|
DtButton: r,
|
|
@@ -37,7 +37,7 @@ const l = {
|
|
|
37
37
|
*/
|
|
38
38
|
id: {
|
|
39
39
|
type: String,
|
|
40
|
-
default:
|
|
40
|
+
default: a()
|
|
41
41
|
},
|
|
42
42
|
/**
|
|
43
43
|
* The fill and outline of the button associated with its visual importance.
|
|
@@ -76,18 +76,18 @@ const l = {
|
|
|
76
76
|
};
|
|
77
77
|
var s = function() {
|
|
78
78
|
var t = this, e = t._self._c;
|
|
79
|
-
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: t.tooltipText, expression: "tooltipText" }], class: `d-split-btn__omega d-split-btn__omega--${t.size}`, attrs: { id: t.id, "data-qa": "dt-split-button-omega", active: t.active, "aria-label": t.ariaLabel, disabled: t.disabled, importance: t.importance, kind: t.kind, size: t.size }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
79
|
+
return e("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: { message: t.tooltipText, inverted: t.kind === "inverted" }, expression: "{ message: tooltipText, inverted: kind === 'inverted' }" }], class: `d-split-btn__omega d-split-btn__omega--${t.size}`, attrs: { id: t.id, "data-qa": "dt-split-button-omega", active: t.active, "aria-label": t.ariaLabel, disabled: t.disabled, importance: t.importance, kind: t.kind, size: t.size }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
80
80
|
return [t._t("icon", function() {
|
|
81
81
|
return [e("dt-icon-chevron-down", { attrs: { size: t.SPLIT_BUTTON_ICON_SIZES[t.size] } })];
|
|
82
82
|
}, { size: t.SPLIT_BUTTON_ICON_SIZES[t.size] })];
|
|
83
83
|
}, proxy: !0 }], null, !0) });
|
|
84
|
-
},
|
|
85
|
-
|
|
84
|
+
}, l = [], p = /* @__PURE__ */ o(
|
|
85
|
+
d,
|
|
86
86
|
s,
|
|
87
|
-
|
|
87
|
+
l
|
|
88
88
|
);
|
|
89
|
-
const
|
|
89
|
+
const v = p.exports;
|
|
90
90
|
export {
|
|
91
|
-
|
|
91
|
+
v as default
|
|
92
92
|
};
|
|
93
93
|
//# sourceMappingURL=split-button-omega.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button-omega.js","sources":["../../../components/split_button/split_button-omega.vue"],"sourcesContent":["<template>\n <dt-button\n :id=\"id\"\n v-dt-tooltip=\"tooltipText\"\n data-qa=\"dt-split-button-omega\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :class=\"`d-split-btn__omega d-split-btn__omega--${size}`\"\n :disabled=\"disabled\"\n :importance=\"importance\"\n :kind=\"kind\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"SPLIT_BUTTON_ICON_SIZES[size]\"\n >\n <dt-icon-chevron-down :size=\"SPLIT_BUTTON_ICON_SIZES[size]\" />\n </slot>\n </template>\n </dt-button>\n</template>\n\n<script>\nimport { SPLIT_BUTTON_ICON_SIZES } from './split_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronDown } from '@dialpad/dialtone-icons/vue2';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'SplitButtonOmega',\n components: {\n DtButton,\n DtIconChevronDown,\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 * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n id: {\n type: String,\n default: getUniqueString(),\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 * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n SPLIT_BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronDown","getUniqueString","SPLIT_BUTTON_ICON_SIZES"],"mappings":";;;;;AA8BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,yBAAAC;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"split-button-omega.js","sources":["../../../components/split_button/split_button-omega.vue"],"sourcesContent":["<template>\n <dt-button\n :id=\"id\"\n v-dt-tooltip=\"{ message: tooltipText, inverted: kind === 'inverted' }\"\n data-qa=\"dt-split-button-omega\"\n :active=\"active\"\n :aria-label=\"ariaLabel\"\n :class=\"`d-split-btn__omega d-split-btn__omega--${size}`\"\n :disabled=\"disabled\"\n :importance=\"importance\"\n :kind=\"kind\"\n :size=\"size\"\n >\n <template #icon>\n <slot\n name=\"icon\"\n :size=\"SPLIT_BUTTON_ICON_SIZES[size]\"\n >\n <dt-icon-chevron-down :size=\"SPLIT_BUTTON_ICON_SIZES[size]\" />\n </slot>\n </template>\n </dt-button>\n</template>\n\n<script>\nimport { SPLIT_BUTTON_ICON_SIZES } from './split_button_constants';\nimport { DtButton } from '@/components/button';\nimport { DtIconChevronDown } from '@dialpad/dialtone-icons/vue2';\nimport { getUniqueString } from '@/common/utils';\n\nexport default {\n name: 'SplitButtonOmega',\n components: {\n DtButton,\n DtIconChevronDown,\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 * HTML button disabled attribute\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element ID, useful in case you need to reference the button\n * as an external anchor for popover\n */\n id: {\n type: String,\n default: getUniqueString(),\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 * Text shown in tooltip when you hover the button\n */\n tooltipText: {\n type: String,\n default: '',\n },\n },\n\n data () {\n return {\n SPLIT_BUTTON_ICON_SIZES,\n };\n },\n};\n</script>\n"],"names":["_sfc_main","DtButton","DtIconChevronDown","getUniqueString","SPLIT_BUTTON_ICON_SIZES"],"mappings":";;;;;AA8BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,yBAAAC;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../common/utils/index.cjs"),p=require("../tooltip/tooltip.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../common/utils/index.cjs"),v=require("deep-equal"),p=require("../tooltip/tooltip.cjs"),f=require("../tooltip/tooltip-constants.cjs"),n={name:"dt-tooltip-directive",install(r){const s=document.createElement("div");document.body.appendChild(s);const d="top",a=new r({name:"DtTooltipDirectiveApp",components:{DtTooltip:p.default},data(){return{tooltips:[]}},methods:{addOrUpdateTooltip(e,t){const o=this.tooltips.findIndex(i=>i.id===e);o!==-1?this.tooltips.splice(o,1,{id:e,...t}):this.tooltips.push({id:e,...t})},removeTooltip(e){this.tooltips=this.tooltips.filter(t=>t.id!==e)}},render(e){return e("div",{domProps:{id:"dt-tooltip-directive-app"}},[this.tooltips.map(({id:t,...o})=>e(p.default,{key:t,props:{...o,sticky:o.sticky!==void 0?o.sticky:!0,delay:o.delay!==void 0?o.delay:process.env.NODE_ENV!=="test",externalAnchor:`[data-dt-tooltip-id="${t}"]`}}))])}});a.$mount(s),r.directive("dt-tooltip",{bind(e,t){u(e,t)},update(e,t){v(t.value,t.oldValue)||u(e,t)},unbind(e){a.removeTooltip(e.getAttribute("data-dt-tooltip-id"))}});function u(e,t){if(t.value===null||t.value===void 0){const l=e.getAttribute("data-dt-tooltip-id");l&&a.removeTooltip(l);return}const o=e.getAttribute("data-dt-tooltip-id")||c.getUniqueString();let i;if(typeof t.value=="string")i={message:t.value,placement:t.arg||d};else if(typeof t.value=="object"&&t.value!==null)i={placement:t.arg||t.value.placement||d,...t.value};else{console.error("DtTooltipDirective: binding value must be string, object, null or undefined");return}Object.keys(t.modifiers).forEach(l=>{switch(l){case"inverted":i.inverted=!0;break;case"no-delay":i.delay=!1;break;case"no-transition":i.transition=!1;break;default:f.TOOLTIP_DIRECTIONS.includes(l)&&(i.placement=l);break}}),e.setAttribute("data-dt-tooltip-id",o),a.addOrUpdateTooltip(o,i)}}};exports.DtTooltipDirective=n;exports.default=n;
|
|
2
2
|
//# sourceMappingURL=tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.cjs","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n },\n });\n }),\n ],\n );\n },\n });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n if (binding.value
|
|
1
|
+
{"version":3,"file":"tooltip.cjs","sources":["../../../directives/tooltip_directive/tooltip.js"],"sourcesContent":["import { DtTooltip, TOOLTIP_DIRECTIONS } from '@/components/tooltip';\nimport { getUniqueString } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport const DtTooltipDirective = {\n name: 'dt-tooltip-directive',\n install (Vue) {\n const mountPoint = document.createElement('div');\n document.body.appendChild(mountPoint);\n\n const DEFAULT_PLACEMENT = 'top';\n const DtTooltipDirectiveApp = new Vue({\n name: 'DtTooltipDirectiveApp',\n components: { DtTooltip },\n data () {\n return {\n tooltips: [],\n };\n },\n\n methods: {\n addOrUpdateTooltip (id, tooltipConfig) {\n const index = this.tooltips.findIndex(tooltip => tooltip.id === id);\n if (index !== -1) {\n // Update existing tooltip\n this.tooltips.splice(index, 1, { id, ...tooltipConfig });\n } else {\n // Add new tooltip\n this.tooltips.push({ id, ...tooltipConfig });\n }\n },\n\n removeTooltip (id) {\n this.tooltips = this.tooltips.filter(tooltip => tooltip.id !== id);\n },\n },\n\n render (h) {\n return h('div',\n {\n domProps: { id: 'dt-tooltip-directive-app' },\n },\n [\n this.tooltips.map(({ id, ...tooltipProps }) => {\n return h(DtTooltip, {\n key: id,\n props: {\n ...tooltipProps,\n sticky: tooltipProps.sticky !== undefined ? tooltipProps.sticky : true,\n /**\n * Set the delay to false when running tests only.\n */\n delay: tooltipProps.delay !== undefined ? tooltipProps.delay : (process.env.NODE_ENV !== 'test'),\n externalAnchor: `[data-dt-tooltip-id=\"${id}\"]`,\n },\n });\n }),\n ],\n );\n },\n });\n\n DtTooltipDirectiveApp.$mount(mountPoint);\n\n Vue.directive('dt-tooltip', {\n bind (anchor, binding) {\n // Initial tooltip setup\n setupTooltip(anchor, binding);\n },\n update (anchor, binding) {\n // Update tooltip on binding value change\n // Use deep equality check to prevent infinite loops when objects are passed\n if (!deepEqual(binding.value, binding.oldValue)) {\n setupTooltip(anchor, binding);\n }\n },\n unbind (anchor) {\n DtTooltipDirectiveApp.removeTooltip(anchor.getAttribute('data-dt-tooltip-id'));\n },\n });\n\n function setupTooltip (anchor, binding) {\n if (binding.value === null || binding.value === undefined) {\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id');\n if (tooltipId) {\n DtTooltipDirectiveApp.removeTooltip(tooltipId);\n }\n return;\n }\n\n const tooltipId = anchor.getAttribute('data-dt-tooltip-id') || getUniqueString();\n\n let tooltipConfig;\n if (typeof binding.value === 'string') {\n tooltipConfig = {\n message: binding.value,\n placement: binding.arg || DEFAULT_PLACEMENT,\n };\n } else if (typeof binding.value === 'object' && binding.value !== null) {\n tooltipConfig = {\n placement: binding.arg || binding.value.placement || DEFAULT_PLACEMENT,\n ...binding.value,\n };\n } else {\n console.error('DtTooltipDirective: binding value must be string, object, null or undefined');\n return;\n }\n\n Object.keys(binding.modifiers).forEach(modifier => {\n switch (modifier) {\n case 'inverted':\n tooltipConfig.inverted = true;\n break;\n case 'no-delay':\n tooltipConfig.delay = false;\n break;\n case 'no-transition':\n tooltipConfig.transition = false;\n break;\n default:\n if (TOOLTIP_DIRECTIONS.includes(modifier)) {\n tooltipConfig.placement = modifier;\n }\n break;\n }\n });\n\n anchor.setAttribute('data-dt-tooltip-id', tooltipId);\n DtTooltipDirectiveApp.addOrUpdateTooltip(tooltipId, tooltipConfig);\n }\n },\n};\n\nexport default DtTooltipDirective;\n"],"names":["DtTooltipDirective","Vue","mountPoint","DEFAULT_PLACEMENT","DtTooltipDirectiveApp","DtTooltip","id","tooltipConfig","index","tooltip","h","tooltipProps","anchor","binding","setupTooltip","deepEqual","tooltipId","getUniqueString","modifier","TOOLTIP_DIRECTIONS"],"mappings":"sQAIaA,EAAqB,CAChC,KAAM,uBACN,QAASC,EAAK,CACZ,MAAMC,EAAa,SAAS,cAAc,KAAK,EAC/C,SAAS,KAAK,YAAYA,CAAU,EAEpC,MAAMC,EAAoB,MACpBC,EAAwB,IAAIH,EAAI,CACpC,KAAM,wBACN,WAAY,CAAA,UAAEI,EAAAA,OAAS,EACvB,MAAQ,CACN,MAAO,CACL,SAAU,CAAA,CACpB,CACM,EAEA,QAAS,CACP,mBAAoBC,EAAIC,EAAe,CACrC,MAAMC,EAAQ,KAAK,SAAS,UAAUC,GAAWA,EAAQ,KAAOH,CAAE,EAC9DE,IAAU,GAEZ,KAAK,SAAS,OAAOA,EAAO,EAAG,CAAE,GAAAF,EAAI,GAAGC,EAAe,EAGvD,KAAK,SAAS,KAAK,CAAE,GAAAD,EAAI,GAAGC,CAAa,CAAE,CAE/C,EAEA,cAAeD,EAAI,CACjB,KAAK,SAAW,KAAK,SAAS,OAAOG,GAAWA,EAAQ,KAAOH,CAAE,CACnE,CACR,EAEM,OAAQI,EAAG,CACT,OAAOA,EAAE,MACP,CACE,SAAU,CAAE,GAAI,0BAA0B,CACtD,EACU,CACE,KAAK,SAAS,IAAI,CAAC,CAAE,GAAAJ,EAAI,GAAGK,KACnBD,EAAEL,EAAAA,QAAW,CAClB,IAAKC,EACL,MAAO,CACL,GAAGK,EACH,OAAQA,EAAa,SAAW,OAAYA,EAAa,OAAS,GAIlE,MAAOA,EAAa,QAAU,OAAYA,EAAa,MAAS,QAAQ,IAAI,WAAa,OACzF,eAAgB,wBAAwBL,CAAE,IAC5D,CACA,CAAe,CACF,CACb,CACA,CACM,CACN,CAAK,EAEDF,EAAsB,OAAOF,CAAU,EAEvCD,EAAI,UAAU,aAAc,CAC1B,KAAMW,EAAQC,EAAS,CAErBC,EAAaF,EAAQC,CAAO,CAC9B,EACA,OAAQD,EAAQC,EAAS,CAGlBE,EAAUF,EAAQ,MAAOA,EAAQ,QAAQ,GAC5CC,EAAaF,EAAQC,CAAO,CAEhC,EACA,OAAQD,EAAQ,CACdR,EAAsB,cAAcQ,EAAO,aAAa,oBAAoB,CAAC,CAC/E,CACN,CAAK,EAED,SAASE,EAAcF,EAAQC,EAAS,CACtC,GAAIA,EAAQ,QAAU,MAAQA,EAAQ,QAAU,OAAW,CACzD,MAAMG,EAAYJ,EAAO,aAAa,oBAAoB,EACtDI,GACFZ,EAAsB,cAAcY,CAAS,EAE/C,MACF,CAEA,MAAMA,EAAYJ,EAAO,aAAa,oBAAoB,GAAKK,EAAAA,gBAAe,EAE9E,IAAIV,EACJ,GAAI,OAAOM,EAAQ,OAAU,SAC3BN,EAAgB,CACd,QAASM,EAAQ,MACjB,UAAWA,EAAQ,KAAOV,CACpC,UACiB,OAAOU,EAAQ,OAAU,UAAYA,EAAQ,QAAU,KAChEN,EAAgB,CACd,UAAWM,EAAQ,KAAOA,EAAQ,MAAM,WAAaV,EACrD,GAAGU,EAAQ,KACrB,MACa,CACL,QAAQ,MAAM,6EAA6E,EAC3F,MACF,CAEA,OAAO,KAAKA,EAAQ,SAAS,EAAE,QAAQK,GAAY,CACjD,OAAQA,EAAQ,CACd,IAAK,WACHX,EAAc,SAAW,GACzB,MACF,IAAK,WACHA,EAAc,MAAQ,GACtB,MACF,IAAK,gBACHA,EAAc,WAAa,GAC3B,MACF,QACMY,EAAAA,mBAAmB,SAASD,CAAQ,IACtCX,EAAc,UAAYW,GAE5B,KACZ,CACM,CAAC,EAEDN,EAAO,aAAa,qBAAsBI,CAAS,EACnDZ,EAAsB,mBAAmBY,EAAWT,CAAa,CACnE,CACF,CACF"}
|