@voicenter-team/voicenter-ui-plus 4.0.0-beta.5 → 4.0.0-beta.6
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/README.md +116 -57
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcAgentRun/UiComponents/VcAgentRunRow.css +1 -1
- package/library/assets/components/VcAgentRun/VcAgentRunCard.css +1 -1
- package/library/assets/components/VcAgentRun/VcAgentRunGroup.css +1 -1
- package/library/assets/components/VcApprovalCard/VcApprovalCard.css +1 -1
- package/library/assets/components/VcAskUserCard/VcAskUserCard.css +1 -1
- package/library/assets/components/VcAutocomplete/VcAutocomplete.css +1 -1
- package/library/assets/components/VcButton/VcButton.css +1 -1
- package/library/assets/components/VcButton/VcButtonIcon.css +1 -1
- package/library/assets/components/VcButton/VcToggleButton.css +1 -1
- package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -1
- package/library/assets/components/VcCheckbox/VcCheckbox.css +1 -1
- package/library/assets/components/VcCodeBlock/VcCodeBlock.css +1 -1
- package/library/assets/components/VcCollapse/VcCollapseItem.css +1 -1
- package/library/assets/components/VcColorPicker/VcColorPicker.css +1 -1
- package/library/assets/components/VcDatePicker/VcDatePicker.css +1 -1
- package/library/assets/components/VcDatePickerPanel/VcDatePickerPanel.css +1 -1
- package/library/assets/components/VcDropdown/VcDropdownItem.css +1 -1
- package/library/assets/components/VcEmojiPicker/VcEmojiPicker.css +1 -1
- package/library/assets/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.css +1 -1
- package/library/assets/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePickerQuickOptionsSelection.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileItem.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderArea.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
- package/library/assets/components/VcForm/UiComponents/VcInputLabel.css +1 -1
- package/library/assets/components/VcHyperLink/VcHyperLink.css +1 -1
- package/library/assets/components/VcImageUploader/VcImageUploader.css +1 -1
- package/library/assets/components/VcInput/VcInput.css +1 -1
- package/library/assets/components/VcInputNumber/VcInputNumber.css +1 -1
- package/library/assets/components/VcJsonSchema/Components/JsonCodeMirror.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerCards.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerKey.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerState.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerValue.css +1 -1
- package/library/assets/components/VcJsonViewer/VcJsonViewer.css +1 -1
- package/library/assets/components/VcLightbox/VcLightbox.css +1 -1
- package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
- package/library/assets/components/VcMdEditor/VcMdEditorContent.css +1 -1
- package/library/assets/components/VcMessage/VcMessage.css +1 -1
- package/library/assets/components/VcMessage/reactions/VcMessageReactionBar.css +1 -1
- package/library/assets/components/VcOtpInput/VcOtpInput.css +1 -1
- package/library/assets/components/VcPdfViewer/VcPdfDocumentViewerFooter.css +1 -1
- package/library/assets/components/VcRadio/VcRadio.css +1 -1
- package/library/assets/components/VcRadioButtons/VcRadioButtonsGroup.css +1 -1
- package/library/assets/components/VcRadioTabs/UiComponents/VcRadioTabsNav.css +1 -1
- package/library/assets/components/VcRadioTabs/VcRadioTabs.css +1 -1
- package/library/assets/components/VcSegmented/VcSegmented.css +1 -1
- package/library/assets/components/VcSelect/VcSelect.css +1 -1
- package/library/assets/components/VcSelect/VcSelectOption.css +1 -1
- package/library/assets/components/VcSipFlow/VcSipFlow.css +1 -1
- package/library/assets/components/VcSoundplayer/VcPlayerPlaybackRate.css +1 -1
- package/library/assets/components/VcSoundplayer/VcSoundPlayerMarker.css +1 -1
- package/library/assets/components/VcSplitButton/VcSplitButton.css +1 -1
- package/library/assets/components/VcSwitch/VcSwitch.css +1 -1
- package/library/assets/components/VcTable/VcTable.css +1 -1
- package/library/assets/components/VcTabs/VcTabNav.css +1 -1
- package/library/assets/components/VcTag/VcTag.css +1 -1
- package/library/assets/components/VcTagInput/VcTagInput.css +1 -1
- package/library/assets/components/VcToolCall/VcToolCall.css +1 -1
- package/library/assets/components/VcTour/VcTour.css +1 -1
- package/library/assets/components/VcTransfer/VcTransfer.css +1 -1
- package/library/assets/components/VcTree/VcTreeSelect.css +1 -1
- package/library/assets/components/VcVerticalTabs/VcVerticalTabs.css +1 -1
- package/library/assets/components/VcVerticalTabs/VerticalTabNav.css +1 -1
- package/library/assets/entity/components/Tabs/VcEntityEditableTabs.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/tree.css +1 -1
- package/library/components/VcDatePicker/VcDatePicker.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcExcelFileProcessLoader.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcFileImportErrorsCard.vue.mjs +2 -2
- package/library/components/VcExcelUploader/VcFileImportParseResultBlock.vue.mjs +4 -4
- package/library/components/VcExcelUploader/VcFileImportResultBindDataTable.vue.mjs +0 -1
- package/library/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.mjs +2 -2
- package/library/components/VcHtmlEditor/VcHtmlEditor.vue.mjs +1 -1
- package/library/components/VcIconPicker/VcIconPicker.vue.mjs +2 -2
- package/library/components/VcImageUploader/VcImageUploader.vue.mjs +4 -4
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerSections.vue.mjs +9 -4
- package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue2.mjs +1 -1
- package/library/components/VcMdEditor/VcMdEditor.vue.mjs +1 -1
- package/library/components/VcPdfViewer/VcPdfDocumentCard.vue.mjs +3 -3
- package/library/components/VcPdfViewer/VcPdfDocumentViewerFooter.vue.mjs +2 -2
- package/library/components/VcPdfViewer/VcPdfDocumentViewerToolbar.vue.mjs +4 -4
- package/library/components/VcSegmented/VcSegmented.vue.mjs +88 -41
- package/library/components/VcSelect/VcInfiniteScrollSelect.vue.mjs +1 -1
- package/library/components/VcSipFlow/VcSipFlow.vue.mjs +1 -3
- package/library/components/VcSoundplayer/VcPlayerPlayStopButton.vue.mjs +4 -4
- package/library/components/VcSoundplayer/VcPlayerPlaybackRate.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcPlayerPlaybackRatePopup.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcPlayerSkipButtons.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcSoundPlayerMarker.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcSoundVolume.vue.mjs +2 -2
- package/library/components/VcSoundplayer/player.options.mjs +2 -2
- package/library/components/VcTable/VcTable.vue.mjs +5 -8
- package/library/components/VcTabs/VcTabNav.vue.mjs +45 -32
- package/library/components/VcTabs/VcTabPane.vue.mjs +12 -3
- package/library/components/VcTour/VcTour.vue.mjs +104 -16
- package/library/components/VcTree/VcTree.vue.mjs +1 -1
- package/library/components/VcTree/VcTreeSelect.vue.mjs +1 -1
- package/library/components/VcWizard/VcSummaryProgress.vue.mjs +1 -1
- package/library/components/VcWizard/VcSummaryStep.vue.mjs +3 -3
- package/library/components/VcWizard/VcWizard.vue.mjs +2 -16
- package/library/entity/components/Form/VcEntityVerticalEditForm.vue.mjs +6 -10
- package/library/entity/components/Table/VcEntityListTable.vue.mjs +1 -2
- package/library/entity/components/Tabs/VcEntityEditableTabs.vue.mjs +51 -7
- package/library/font/index.mjs +1 -1
- package/library/index.mjs +200 -206
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/plugin-components.gen.mjs +198 -204
- package/library/plugin.mjs +198 -204
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +67 -71
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/theme/index.mjs +1 -1
- package/library/theme/index.mjs.br +0 -0
- package/library/theme/index.mjs.gz +0 -0
- package/library/theme/themeMerge.mjs +2 -0
- package/library/theme/themes.json.mjs +33 -144
- package/library/types/components/VcApprovalCard/VcApprovalCard.vue.d.ts +1 -1
- package/library/types/components/VcButton/VcToggleButton.vue.d.ts +1 -1
- package/library/types/components/VcCheckbox/VcCheckboxButtonGroup.vue.d.ts +3 -3
- package/library/types/components/VcCheckboxGroup/VcCheckboxGroup.vue.d.ts +3 -3
- package/library/types/components/VcMdEditor/VcMdEditor.vue.d.ts +1 -1
- package/library/types/components/VcMessage/VcMessage.vue.d.ts +1 -1
- package/library/types/components/VcSegmented/VcSegmented.vue.d.ts +25 -16
- package/library/types/components/VcSelect/VcSelect.vue.d.ts +3 -3
- package/library/types/components/VcTable/VcTable.vue.d.ts +22 -22
- package/library/types/components/VcTabs/VcTabPane.vue.d.ts +8 -0
- package/library/types/components/VcTabs/VcTabs.vue.d.ts +2 -0
- package/library/types/components/VcTag/VcTag.vue.d.ts +1 -1
- package/library/types/components/VcToolCall/VcToolCall.vue.d.ts +1 -1
- package/library/types/components/exports.d.ts +1 -5
- package/library/types/components.gen.d.ts +0 -2
- package/library/types/entity/components/Tabs/VcEntityEditableTabs.vue.d.ts +14 -8
- package/library/types/theme/themes.json.d.ts +31 -136
- package/library/types/types/ExcelParser.types.d.ts +0 -7
- package/library/types/types/Tabs.d.ts +16 -0
- package/library/types/types/VcDatetimeRangePicker.types.d.ts +0 -19
- package/library/types/types/VcTable.types.d.ts +5 -0
- package/library/types/types/VcTabs.types.d.ts +1 -0
- package/library/types/types/VcWizard.types.d.ts +0 -4
- package/library/utils/jsonSchema/jsonSchemaHelpers.mjs +1 -1
- package/library/utils/lucideIcon.mjs +1 -1
- package/package.json +2 -2
- package/src/theme/index.ts +101 -101
- package/src/theme/tailwindScheme.js +10 -2
- package/src/theme/theme.types.ts +31 -31
- package/src/theme/themeMerge.ts +2 -0
- package/src/theme/themes.json +31 -136
- package/tailwind.config.d.ts +5 -5
- package/tailwind.config.js +2 -0
- package/library/assets/components/VcDatetimeRangePicker/VcDatetimeRangePicker.css +0 -1
- package/library/assets/components/VcViewSwitcher/VcViewSwitcher.css +0 -1
- package/library/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue.mjs +0 -24
- package/library/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue3.mjs +0 -5
- package/library/components/VcViewSwitcher/VcViewSwitcher.vue.mjs +0 -86
- package/library/components/VcViewSwitcher/VcViewSwitcher.vue3.mjs +0 -5
- package/library/types/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue.d.ts +0 -2
- package/library/types/components/VcViewSwitcher/VcViewSwitcher.vue.d.ts +0 -74
package/src/theme/index.ts
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { themesType, themeType, UIThemeConfig } from './theme.types' // Must be relative as doing publish
|
|
2
|
-
import __themes from './themes.json' // Must be relative as doing publish
|
|
3
|
-
import { overrideElementTheme as _overrideElementTheme, globalVariables } from './themeMerge'
|
|
4
|
-
|
|
5
|
-
const _default: themeType = __themes.
|
|
6
|
-
|
|
7
|
-
const themes: themesType = __themes
|
|
8
|
-
|
|
9
|
-
// Re-exported for back-compat with consumers that imported it directly.
|
|
10
|
-
// The implementation lives in `themeMerge.ts` so the build-time codegen
|
|
11
|
-
// can reuse it without dragging in browser-globals from the rest of this
|
|
12
|
-
// module.
|
|
13
|
-
export const overrideElementTheme = _overrideElementTheme
|
|
14
|
-
|
|
15
|
-
export function appendGlobalCssVariables (cssData: { [key: string]: string }, appendTo: HTMLElement) {
|
|
16
|
-
Object.entries(cssData).forEach(([ variableName, variableValue ]) => {
|
|
17
|
-
appendTo.style.setProperty(`--${variableName}`, variableValue)
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function getThemeConfigData (themeConfig?: UIThemeConfig) {
|
|
22
|
-
let currentTheme = _default
|
|
23
|
-
|
|
24
|
-
if (themeConfig) {
|
|
25
|
-
|
|
26
|
-
if (themeConfig.type === 'local') {
|
|
27
|
-
if (themes[themeConfig.themeName]) {
|
|
28
|
-
currentTheme = themes[themeConfig.themeName]
|
|
29
|
-
} else {
|
|
30
|
-
console.warn(`[VoicenterUI-plus] No such theme: ${themeConfig.themeName}`)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (themeConfig.type === 'remote') {
|
|
35
|
-
let body = JSON.stringify(
|
|
36
|
-
{
|
|
37
|
-
SectionList: [
|
|
38
|
-
themeConfig.brandingSectionName
|
|
39
|
-
],
|
|
40
|
-
Domain: window.location.hostname
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
if (themeConfig.payloadData) {
|
|
45
|
-
body = JSON.stringify(themeConfig.payloadData)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const apiStyling = await fetch(themeConfig.apiUrl, {
|
|
49
|
-
method: 'POST',
|
|
50
|
-
cache: 'no-cache',
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-Type': 'application/json'
|
|
53
|
-
},
|
|
54
|
-
referrerPolicy: 'no-referrer',
|
|
55
|
-
body
|
|
56
|
-
})
|
|
57
|
-
.then(res => res.json())
|
|
58
|
-
.then(res => res.Data)
|
|
59
|
-
.then(res => {
|
|
60
|
-
return Object.fromEntries(Object.entries(res).map(([ key, value ]) => {
|
|
61
|
-
return [
|
|
62
|
-
key.replace(`${themeConfig.brandingSectionName}.`, ''),
|
|
63
|
-
String(value)
|
|
64
|
-
]
|
|
65
|
-
}))
|
|
66
|
-
})
|
|
67
|
-
.catch(e => console.error(e))
|
|
68
|
-
|
|
69
|
-
if (apiStyling) {
|
|
70
|
-
currentTheme = apiStyling
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (themeConfig.type === 'customJson') {
|
|
75
|
-
currentTheme = themeConfig.config ?? {}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return currentTheme
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default async function (themeConfig?: UIThemeConfig, appendTo: HTMLElement = document.documentElement) {
|
|
83
|
-
|
|
84
|
-
if (themeConfig?.type === 'none') {
|
|
85
|
-
return themeConfig?.onSetupCallback ? themeConfig?.onSetupCallback({}) : {}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const currentTheme = await getThemeConfigData(themeConfig)
|
|
89
|
-
|
|
90
|
-
appendGlobalCssVariables(
|
|
91
|
-
{
|
|
92
|
-
...overrideElementTheme(currentTheme),
|
|
93
|
-
...globalVariables
|
|
94
|
-
},
|
|
95
|
-
appendTo
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
if (themeConfig?.onSetupCallback) {
|
|
99
|
-
themeConfig.onSetupCallback(currentTheme)
|
|
100
|
-
}
|
|
101
|
-
}
|
|
1
|
+
import { themesType, themeType, UIThemeConfig } from './theme.types' // Must be relative as doing publish
|
|
2
|
+
import __themes from './themes.json' // Must be relative as doing publish
|
|
3
|
+
import { overrideElementTheme as _overrideElementTheme, globalVariables } from './themeMerge'
|
|
4
|
+
|
|
5
|
+
const _default: themeType = __themes.voicenter
|
|
6
|
+
|
|
7
|
+
const themes: themesType = __themes
|
|
8
|
+
|
|
9
|
+
// Re-exported for back-compat with consumers that imported it directly.
|
|
10
|
+
// The implementation lives in `themeMerge.ts` so the build-time codegen
|
|
11
|
+
// can reuse it without dragging in browser-globals from the rest of this
|
|
12
|
+
// module.
|
|
13
|
+
export const overrideElementTheme = _overrideElementTheme
|
|
14
|
+
|
|
15
|
+
export function appendGlobalCssVariables (cssData: { [key: string]: string }, appendTo: HTMLElement) {
|
|
16
|
+
Object.entries(cssData).forEach(([ variableName, variableValue ]) => {
|
|
17
|
+
appendTo.style.setProperty(`--${variableName}`, variableValue)
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function getThemeConfigData (themeConfig?: UIThemeConfig) {
|
|
22
|
+
let currentTheme = _default
|
|
23
|
+
|
|
24
|
+
if (themeConfig) {
|
|
25
|
+
|
|
26
|
+
if (themeConfig.type === 'local') {
|
|
27
|
+
if (themes[themeConfig.themeName]) {
|
|
28
|
+
currentTheme = themes[themeConfig.themeName]
|
|
29
|
+
} else {
|
|
30
|
+
console.warn(`[VoicenterUI-plus] No such theme: ${themeConfig.themeName}`)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (themeConfig.type === 'remote') {
|
|
35
|
+
let body = JSON.stringify(
|
|
36
|
+
{
|
|
37
|
+
SectionList: [
|
|
38
|
+
themeConfig.brandingSectionName
|
|
39
|
+
],
|
|
40
|
+
Domain: window.location.hostname
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
if (themeConfig.payloadData) {
|
|
45
|
+
body = JSON.stringify(themeConfig.payloadData)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const apiStyling = await fetch(themeConfig.apiUrl, {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
cache: 'no-cache',
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': 'application/json'
|
|
53
|
+
},
|
|
54
|
+
referrerPolicy: 'no-referrer',
|
|
55
|
+
body
|
|
56
|
+
})
|
|
57
|
+
.then(res => res.json())
|
|
58
|
+
.then(res => res.Data)
|
|
59
|
+
.then(res => {
|
|
60
|
+
return Object.fromEntries(Object.entries(res).map(([ key, value ]) => {
|
|
61
|
+
return [
|
|
62
|
+
key.replace(`${themeConfig.brandingSectionName}.`, ''),
|
|
63
|
+
String(value)
|
|
64
|
+
]
|
|
65
|
+
}))
|
|
66
|
+
})
|
|
67
|
+
.catch(e => console.error(e))
|
|
68
|
+
|
|
69
|
+
if (apiStyling) {
|
|
70
|
+
currentTheme = apiStyling
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (themeConfig.type === 'customJson') {
|
|
75
|
+
currentTheme = themeConfig.config ?? {}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return currentTheme
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default async function (themeConfig?: UIThemeConfig, appendTo: HTMLElement = document.documentElement) {
|
|
83
|
+
|
|
84
|
+
if (themeConfig?.type === 'none') {
|
|
85
|
+
return themeConfig?.onSetupCallback ? themeConfig?.onSetupCallback({}) : {}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const currentTheme = await getThemeConfigData(themeConfig)
|
|
89
|
+
|
|
90
|
+
appendGlobalCssVariables(
|
|
91
|
+
{
|
|
92
|
+
...overrideElementTheme(currentTheme),
|
|
93
|
+
...globalVariables
|
|
94
|
+
},
|
|
95
|
+
appendTo
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
if (themeConfig?.onSetupCallback) {
|
|
99
|
+
themeConfig.onSetupCallback(currentTheme)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -44,12 +44,20 @@ module.exports = {
|
|
|
44
44
|
|
|
45
45
|
content: {
|
|
46
46
|
primary: v('content-primary'),
|
|
47
|
-
secondary:
|
|
47
|
+
secondary: {
|
|
48
|
+
DEFAULT: v('content-secondary'),
|
|
49
|
+
hover: v('content-secondary--hover')
|
|
50
|
+
},
|
|
48
51
|
tertiary: v('content-tertiary'),
|
|
49
52
|
disabled: v('content-disabled'),
|
|
53
|
+
// Brand-coloured text: links, active tabs, outline and borderless primary buttons.
|
|
54
|
+
brand: {
|
|
55
|
+
DEFAULT: v('content-brand'),
|
|
56
|
+
hover: v('content-brand--hover'),
|
|
57
|
+
pressed: v('content-brand--pressed')
|
|
58
|
+
},
|
|
50
59
|
success: v('content-success'),
|
|
51
60
|
warning: v('content-warning'),
|
|
52
|
-
'warning-icon': v('content-warning-icon'),
|
|
53
61
|
danger: v('content-danger'),
|
|
54
62
|
info: v('content-info')
|
|
55
63
|
},
|
package/src/theme/theme.types.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export type themeType = {
|
|
2
|
-
[key: string]: string
|
|
3
|
-
}
|
|
4
|
-
export type themesType = {
|
|
5
|
-
[key: string]: themeType
|
|
6
|
-
}
|
|
7
|
-
export type UIThemeBaseConfig = {
|
|
8
|
-
type: string
|
|
9
|
-
onSetupCallback?: (loadedTheme: themeType) => void
|
|
10
|
-
}
|
|
11
|
-
export type UIThemeLocalConfig = UIThemeBaseConfig & {
|
|
12
|
-
type: 'local'
|
|
13
|
-
themeName: string
|
|
14
|
-
}
|
|
15
|
-
export type UIThemeRemoteConfig = UIThemeBaseConfig & {
|
|
16
|
-
type: 'remote'
|
|
17
|
-
brandingSectionName?: string
|
|
18
|
-
payloadData?: Record<string, unknown>
|
|
19
|
-
apiUrl: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type UIThemeCustomObjectJsonConfig = UIThemeBaseConfig & {
|
|
23
|
-
type: 'customJson',
|
|
24
|
-
config: themeType
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type UiThemeNoneConfig = UIThemeBaseConfig & {
|
|
28
|
-
type: 'none'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export declare type UIThemeConfig = UIThemeLocalConfig | UIThemeRemoteConfig | UIThemeCustomObjectJsonConfig | UiThemeNoneConfig
|
|
1
|
+
export type themeType = {
|
|
2
|
+
[key: string]: string
|
|
3
|
+
}
|
|
4
|
+
export type themesType = {
|
|
5
|
+
[key: string]: themeType
|
|
6
|
+
}
|
|
7
|
+
export type UIThemeBaseConfig = {
|
|
8
|
+
type: string
|
|
9
|
+
onSetupCallback?: (loadedTheme: themeType) => void
|
|
10
|
+
}
|
|
11
|
+
export type UIThemeLocalConfig = UIThemeBaseConfig & {
|
|
12
|
+
type: 'local'
|
|
13
|
+
themeName: string
|
|
14
|
+
}
|
|
15
|
+
export type UIThemeRemoteConfig = UIThemeBaseConfig & {
|
|
16
|
+
type: 'remote'
|
|
17
|
+
brandingSectionName?: string
|
|
18
|
+
payloadData?: Record<string, unknown>
|
|
19
|
+
apiUrl: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type UIThemeCustomObjectJsonConfig = UIThemeBaseConfig & {
|
|
23
|
+
type: 'customJson',
|
|
24
|
+
config: themeType
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type UiThemeNoneConfig = UIThemeBaseConfig & {
|
|
28
|
+
type: 'none'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare type UIThemeConfig = UIThemeLocalConfig | UIThemeRemoteConfig | UIThemeCustomObjectJsonConfig | UiThemeNoneConfig
|
package/src/theme/themeMerge.ts
CHANGED
|
@@ -18,6 +18,8 @@ export function overrideElementTheme (theme: Record<string, string>): Record<str
|
|
|
18
18
|
...theme,
|
|
19
19
|
// A status text colour the theme does not set is the theme's fill of that status.
|
|
20
20
|
...Object.fromEntries(statusColors.map(color => [ `vc-content-${color}`, theme[`vc-content-${color}`] ?? theme[`vc-action-${color}`] ])),
|
|
21
|
+
// Brand-coloured text (links, active tabs, outline and borderless primary buttons), if the theme does not set it, is its primary fill.
|
|
22
|
+
'vc-content-brand': theme['vc-content-brand'] ?? theme['vc-action-primary'],
|
|
21
23
|
'el-color-primary': theme['el-color-primary'] ?? theme['vc-action-primary'],
|
|
22
24
|
'el-color-success': theme['el-color-success'] ?? theme['vc-action-success'],
|
|
23
25
|
'el-color-warning': theme['el-color-warning'] ?? theme['vc-action-warning'],
|
package/src/theme/themes.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"vc-content-primary": "#161922",
|
|
4
4
|
"vc-content-secondary": "#525D70",
|
|
5
5
|
"vc-content-tertiary": "#567391",
|
|
6
|
+
"vc-content-brand": "#C20027",
|
|
6
7
|
"vc-content-disabled": "#A6B0C0",
|
|
7
8
|
"vc-bg-page": "#F8F9FB",
|
|
8
9
|
"vc-bg-surface": "#FFFFFF",
|
|
@@ -15,14 +16,13 @@
|
|
|
15
16
|
"vc-onfill": "#FFFFFF",
|
|
16
17
|
"vc-onfill-primary": "#FFFFFF",
|
|
17
18
|
"vc-action-info": "#2759DA",
|
|
18
|
-
"vc-action-success": "#
|
|
19
|
-
"vc-content-success": "#
|
|
19
|
+
"vc-action-success": "#007D47",
|
|
20
|
+
"vc-content-success": "#007D47",
|
|
20
21
|
"vc-content-warning": "#BF5001",
|
|
21
|
-
"vc-content-warning-icon": "#D67714",
|
|
22
22
|
"vc-action-warning": "#FEC635",
|
|
23
23
|
"vc-onfill-warning": "#161922",
|
|
24
24
|
"vc-action-danger": "#750830",
|
|
25
|
-
"vc-action-secondary": "#
|
|
25
|
+
"vc-action-secondary": "#4A607A",
|
|
26
26
|
"vc-border": "#E2E6EE",
|
|
27
27
|
"vc-border-strong": "#CDD4E0",
|
|
28
28
|
"vc-input": "#CDD4E0",
|
|
@@ -34,144 +34,39 @@
|
|
|
34
34
|
"vc-content-danger": "#750830",
|
|
35
35
|
"vc-content-info": "#2759DA"
|
|
36
36
|
},
|
|
37
|
-
"
|
|
38
|
-
"vc-content-primary": "#
|
|
39
|
-
"vc-content-secondary": "#
|
|
40
|
-
"vc-content-tertiary": "#
|
|
41
|
-
"vc-content-
|
|
42
|
-
"vc-
|
|
43
|
-
"vc-bg-
|
|
44
|
-
"vc-bg-
|
|
45
|
-
"vc-bg-inset
|
|
46
|
-
"vc-bg-
|
|
47
|
-
"vc-bg-
|
|
48
|
-
"vc-bg-
|
|
49
|
-
"vc-
|
|
50
|
-
"vc-
|
|
51
|
-
"vc-onfill-primary": "#FFFFFF",
|
|
52
|
-
"vc-action-info": "#2759DA",
|
|
53
|
-
"vc-action-success": "#14854A",
|
|
54
|
-
"vc-content-success": "#10713E",
|
|
55
|
-
"vc-content-warning": "#BF5001",
|
|
56
|
-
"vc-content-warning-icon": "#D67714",
|
|
57
|
-
"vc-action-warning": "#FEC635",
|
|
58
|
-
"vc-onfill-warning": "#161922",
|
|
59
|
-
"vc-action-danger": "#750830",
|
|
60
|
-
"vc-action-secondary": "#567391",
|
|
61
|
-
"vc-border": "#E2E6EE",
|
|
62
|
-
"vc-border-strong": "#CDD4E0",
|
|
63
|
-
"vc-input": "#CDD4E0",
|
|
64
|
-
"vc-ring": "#4087FF",
|
|
65
|
-
"vc-mix-anchor": "#000000",
|
|
66
|
-
"vc-mix-anchor-primary": "#000000",
|
|
67
|
-
"vc-mix-anchor-warning": "#000000",
|
|
68
|
-
"vc-shadow-color": "#161922",
|
|
69
|
-
"vc-content-danger": "#750830",
|
|
70
|
-
"vc-content-info": "#2759DA"
|
|
71
|
-
},
|
|
72
|
-
"red": {
|
|
73
|
-
"vc-content-primary": "#263148",
|
|
74
|
-
"vc-content-secondary": "#567391",
|
|
75
|
-
"vc-content-tertiary": "#9EA6B2",
|
|
76
|
-
"vc-content-disabled": "#888F9D",
|
|
77
|
-
"vc-bg-page": "#F7FAFC",
|
|
78
|
-
"vc-bg-surface": "#FFFFFF",
|
|
79
|
-
"vc-bg-inset": "#F7FAFC",
|
|
80
|
-
"vc-bg-inset-strong": "#E0E2E5",
|
|
81
|
-
"vc-bg-field": "#FFFFFF",
|
|
82
|
-
"vc-bg-muted": "#EDEDED",
|
|
83
|
-
"vc-bg-overlay": "color-mix(in srgb, #000000 40%, transparent)",
|
|
84
|
-
"vc-action-primary": "#FC0303",
|
|
85
|
-
"vc-onfill": "#FFFFFF",
|
|
86
|
-
"vc-onfill-primary": "#FFFFFF",
|
|
87
|
-
"vc-action-info": "#2759DA",
|
|
88
|
-
"vc-action-success": "#0EB886",
|
|
89
|
-
"vc-content-success": "#0EB886",
|
|
90
|
-
"vc-content-warning": "#ECA944",
|
|
91
|
-
"vc-content-warning-icon": "#ECA944",
|
|
92
|
-
"vc-action-warning": "#ECA944",
|
|
93
|
-
"vc-onfill-warning": "#FFFFFF",
|
|
94
|
-
"vc-action-danger": "#EC444D",
|
|
95
|
-
"vc-action-secondary": "#8292A5",
|
|
96
|
-
"vc-border": "#E0E2E5",
|
|
97
|
-
"vc-border-strong": "#FFCCCE",
|
|
98
|
-
"vc-input": "#BEC2C9",
|
|
99
|
-
"vc-ring": "#4087FF",
|
|
100
|
-
"vc-mix-anchor": "#000000",
|
|
101
|
-
"vc-mix-anchor-primary": "#000000",
|
|
102
|
-
"vc-mix-anchor-warning": "#000000",
|
|
103
|
-
"vc-shadow-color": "#161922",
|
|
104
|
-
"vc-content-danger": "#EC444D",
|
|
105
|
-
"vc-content-info": "#2759DA"
|
|
106
|
-
},
|
|
107
|
-
"redGreen": {
|
|
108
|
-
"vc-content-primary": "#263148",
|
|
109
|
-
"vc-content-secondary": "#567391",
|
|
110
|
-
"vc-content-tertiary": "#9EA6B2",
|
|
111
|
-
"vc-content-disabled": "#888F9D",
|
|
112
|
-
"vc-bg-page": "#F7FAFC",
|
|
113
|
-
"vc-bg-surface": "#FFFFFF",
|
|
114
|
-
"vc-bg-inset": "#F7FAFC",
|
|
115
|
-
"vc-bg-inset-strong": "#E0E2E5",
|
|
116
|
-
"vc-bg-field": "#FFFFFF",
|
|
117
|
-
"vc-bg-muted": "#EDEDED",
|
|
118
|
-
"vc-bg-overlay": "color-mix(in srgb, #000000 40%, transparent)",
|
|
119
|
-
"vc-action-primary": "#D34C4C",
|
|
37
|
+
"voicenterDark": {
|
|
38
|
+
"vc-content-primary": "#E2ECF7",
|
|
39
|
+
"vc-content-secondary": "#93A0B5",
|
|
40
|
+
"vc-content-tertiary": "#6D8AAA",
|
|
41
|
+
"vc-content-brand": "#FF6B6A",
|
|
42
|
+
"vc-content-disabled": "#48515F",
|
|
43
|
+
"vc-bg-page": "#0E1015",
|
|
44
|
+
"vc-bg-surface": "#161922",
|
|
45
|
+
"vc-bg-inset": "#0E1015",
|
|
46
|
+
"vc-bg-inset-strong": "#232427",
|
|
47
|
+
"vc-bg-field": "#161922",
|
|
48
|
+
"vc-bg-muted": "#232427",
|
|
49
|
+
"vc-bg-overlay": "#000000B3",
|
|
50
|
+
"vc-action-primary": "#E50A3B",
|
|
120
51
|
"vc-onfill": "#FFFFFF",
|
|
121
52
|
"vc-onfill-primary": "#FFFFFF",
|
|
122
|
-
"vc-action-info": "#
|
|
123
|
-
"vc-action-success": "#
|
|
124
|
-
"vc-content-success": "#
|
|
125
|
-
"vc-content-warning": "#
|
|
126
|
-
"vc-
|
|
127
|
-
"vc-action-warning": "#ECA944",
|
|
53
|
+
"vc-action-info": "#2268DE",
|
|
54
|
+
"vc-action-success": "#007A45",
|
|
55
|
+
"vc-content-success": "#00B96B",
|
|
56
|
+
"vc-content-warning": "#D66527",
|
|
57
|
+
"vc-action-warning": "#A25600",
|
|
128
58
|
"vc-onfill-warning": "#FFFFFF",
|
|
129
|
-
"vc-action-danger": "#
|
|
130
|
-
"vc-action-secondary": "#
|
|
131
|
-
"vc-border": "#
|
|
132
|
-
"vc-border-strong": "#
|
|
133
|
-
"vc-input": "#
|
|
134
|
-
"vc-ring": "#
|
|
59
|
+
"vc-action-danger": "#934A5A",
|
|
60
|
+
"vc-action-secondary": "#5A7189",
|
|
61
|
+
"vc-border": "#282C32",
|
|
62
|
+
"vc-border-strong": "#333841",
|
|
63
|
+
"vc-input": "#333841",
|
|
64
|
+
"vc-ring": "#2268DE",
|
|
135
65
|
"vc-mix-anchor": "#000000",
|
|
136
66
|
"vc-mix-anchor-primary": "#000000",
|
|
137
67
|
"vc-mix-anchor-warning": "#000000",
|
|
138
|
-
"vc-shadow-color": "#161922",
|
|
139
|
-
"vc-content-danger": "#EC444D",
|
|
140
|
-
"vc-content-info": "#2759DA"
|
|
141
|
-
},
|
|
142
|
-
"black": {
|
|
143
|
-
"vc-content-primary": "#FFFFFF",
|
|
144
|
-
"vc-content-secondary": "#FFFFFF",
|
|
145
|
-
"vc-content-tertiary": "#CCCCCC",
|
|
146
|
-
"vc-content-disabled": "#CCCCCC",
|
|
147
|
-
"vc-bg-page": "#202124",
|
|
148
|
-
"vc-bg-surface": "#000000",
|
|
149
|
-
"vc-bg-inset": "#202124",
|
|
150
|
-
"vc-bg-inset-strong": "#131212",
|
|
151
|
-
"vc-bg-field": "#151515",
|
|
152
|
-
"vc-bg-muted": "#3B3D41",
|
|
153
|
-
"vc-bg-overlay": "color-mix(in srgb, #636C78 40%, transparent)",
|
|
154
|
-
"vc-action-primary": "#D34C4C",
|
|
155
|
-
"vc-onfill": "#FFFFFF",
|
|
156
|
-
"vc-onfill-primary": "#FFFFFF",
|
|
157
|
-
"vc-action-info": "#2759DA",
|
|
158
|
-
"vc-action-success": "#13A363",
|
|
159
|
-
"vc-content-success": "#13A363",
|
|
160
|
-
"vc-content-warning": "#FFB341",
|
|
161
|
-
"vc-content-warning-icon": "#FFB341",
|
|
162
|
-
"vc-action-warning": "#FFB341",
|
|
163
|
-
"vc-onfill-warning": "#FFFFFF",
|
|
164
|
-
"vc-action-danger": "#DC3643",
|
|
165
|
-
"vc-action-secondary": "#8292A5",
|
|
166
|
-
"vc-border": "#474747",
|
|
167
|
-
"vc-border-strong": "#E0E2E5",
|
|
168
|
-
"vc-input": "#E0E2E5",
|
|
169
|
-
"vc-ring": "#4087FF",
|
|
170
|
-
"vc-mix-anchor": "#FFFFFF",
|
|
171
|
-
"vc-mix-anchor-primary": "#FFFFFF",
|
|
172
|
-
"vc-mix-anchor-warning": "#FFFFFF",
|
|
173
68
|
"vc-shadow-color": "#000000",
|
|
174
|
-
"vc-content-danger": "#
|
|
175
|
-
"vc-content-info": "#
|
|
69
|
+
"vc-content-danger": "#FF9BAD",
|
|
70
|
+
"vc-content-info": "#6293FF"
|
|
176
71
|
}
|
|
177
72
|
}
|
package/tailwind.config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Config } from 'tailwindcss'
|
|
2
|
-
|
|
3
|
-
declare const config: Config
|
|
4
|
-
|
|
5
|
-
export default config
|
|
1
|
+
import { Config } from 'tailwindcss'
|
|
2
|
+
|
|
3
|
+
declare const config: Config
|
|
4
|
+
|
|
5
|
+
export default config
|
package/tailwind.config.js
CHANGED
|
@@ -84,6 +84,8 @@ module.exports = {
|
|
|
84
84
|
full: '9999px',
|
|
85
85
|
// The radius roles (_foundations.scss --vc-radius-*)
|
|
86
86
|
control: 'var(--vc-radius-control)',
|
|
87
|
+
// A control at the small size (--vc-size-control-sm)
|
|
88
|
+
'control-sm': 'var(--vc-radius-control-sm)',
|
|
87
89
|
popup: 'var(--vc-radius-popup)',
|
|
88
90
|
card: 'var(--vc-radius-card)',
|
|
89
91
|
tag: 'var(--vc-radius-tag)',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.vc-datetime-picker--deprecated{padding:1rem;border:1px dashed var(--vc-action-warning);border-radius:var(--vc-radius-inner);background-color:var(--vc-action-warning--subtle-hover)}.vc-datetime-picker__deprecated-message{color:var(--vc-content-warning);font-size:14px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.vc-view-switcher{display:flex;width:-moz-max-content;width:max-content;align-items:center}.vc-view-switcher>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)));border-color:var(--vc-border)}.vc-view-switcher{border-radius:var(--vc-radius-control);border-width:1px;border-color:var(--vc-border);color:var(--vc-content-disabled);outline:2px solid transparent;outline-offset:2px;background-color:var(--vc-bg-muted)}.vc-view-switcher__wrap{position:relative;display:flex;overflow-x:auto;overflow-y:hidden}.vc-view-switcher__wrap::-webkit-scrollbar{width:2px;height:2px}.vc-view-switcher-item{position:relative;display:inline-flex;cursor:pointer;align-items:center;border-radius:var(--vc-radius-inner);padding:.5rem .75rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.vc-view-switcher-item--icon{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.vc-view-switcher-item--text{white-space:nowrap;font-size:.875rem;font-weight:var(--vc-font-weight-medium);color:var(--vc-action-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.vc-view-switcher-item--active{background-color:var(--vc-bg-surface);--tw-shadow: 0px 0px 4px var(--vc-bg-overlay);--tw-shadow-colored: 0px 0px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.vc-view-switcher-item--active .vc-view-switcher-item--text{color:var(--vc-content-primary)}.vc-view-switcher-item--active .vc-view-switcher-item--icon{color:var(--vc-action-primary)}.vc-view-switcher-item--vertical-line{margin-left:.125rem;margin-right:.125rem;display:inline-block;height:2rem;border-right-width:1px;border-color:var(--vc-border)}.vc-view-switcher-item:not(.vc-view-switcher-item--active):not(.vc-view-switcher-item--disabled):hover{background-color:var(--vc-action-primary--subtle-hover)}.vc-view-switcher-item:not(.vc-view-switcher-item--active):not(.vc-view-switcher-item--disabled):hover .vc-view-switcher-item--text,.vc-view-switcher-item:not(.vc-view-switcher-item--active):not(.vc-view-switcher-item--disabled):hover .vc-view-switcher-item--icon{color:var(--vc-content-primary)}.vc-view-switcher-item:not(.vc-view-switcher-item--active):focus-visible{background-color:var(--vc-action-primary--subtle-hover)}.vc-view-switcher-item:not(.vc-view-switcher-item--active):focus-visible .vc-view-switcher-item--text,.vc-view-switcher-item:not(.vc-view-switcher-item--active):focus-visible .vc-view-switcher-item--icon{color:var(--vc-content-primary)}.vc-view-switcher-item{outline:2px solid transparent;outline-offset:2px}.vc-view-switcher-item--disabled{cursor:not-allowed;opacity:.5}.vc-view-switcher--disabled{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:.5}.vc-view-switcher--disabled .vc-view-switcher-item:hover,.vc-view-switcher--disabled .vc-view-switcher-item--active,.vc-view-switcher--disabled .vc-view-switcher-item:not(.vc-view-switcher-item--active):not(.vc-view-switcher-item--disabled):hover{cursor:not-allowed;background-color:var(--vc-action-secondary--subtle-hover);opacity:.5}.vc-view-switcher-container{display:inline-flex;align-items:center;padding:.125rem}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import '../../assets/components/VcDatetimeRangePicker/VcDatetimeRangePicker.css';
|
|
2
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode } from "vue";
|
|
3
|
-
const _hoisted_1 = {
|
|
4
|
-
ref: "pickerWrap",
|
|
5
|
-
class: "vc-datetime-picker vc-datetime-picker--deprecated"
|
|
6
|
-
};
|
|
7
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
...{
|
|
9
|
-
name: "VcDatetimeRangePicker",
|
|
10
|
-
inheritAttrs: false
|
|
11
|
-
},
|
|
12
|
-
__name: "VcDatetimeRangePicker",
|
|
13
|
-
setup(__props) {
|
|
14
|
-
console.warn("[VcDatetimeRangePicker] This component is deprecated. Please use VcExtendedDatetimeRangePicker instead.");
|
|
15
|
-
return (_ctx, _cache) => {
|
|
16
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [..._cache[0] || (_cache[0] = [
|
|
17
|
-
createElementVNode("span", { class: "vc-datetime-picker__deprecated-message" }, " This component is deprecated. Please use VcExtendedDatetimeRangePicker instead. ", -1)
|
|
18
|
-
])], 512);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
export {
|
|
23
|
-
_sfc_main as default
|
|
24
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import '../../assets/components/VcViewSwitcher/VcViewSwitcher.css';
|
|
2
|
-
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, Fragment, renderList, withKeys, unref, renderSlot, createVNode, toDisplayString } from "vue";
|
|
3
|
-
import { useVModel } from "@vueuse/core";
|
|
4
|
-
import useOptionMethods from "../../composables/option/useOptionMethods.mjs";
|
|
5
|
-
import _sfc_main$1 from "../VcIcon/VcIcon.vue.mjs";
|
|
6
|
-
import '../../assets/components/VcIcon/VcIcon.css';/* empty css */
|
|
7
|
-
const _hoisted_1 = { class: "vc-view-switcher__wrap" };
|
|
8
|
-
const _hoisted_2 = ["data-test"];
|
|
9
|
-
const _hoisted_3 = ["tabindex", "onKeyup", "onClick"];
|
|
10
|
-
const _hoisted_4 = { class: "flex items-center gap-1.5" };
|
|
11
|
-
const _hoisted_5 = { class: "vc-view-switcher-item--text" };
|
|
12
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
-
__name: "VcViewSwitcher",
|
|
14
|
-
props: {
|
|
15
|
-
disabled: { type: Boolean, default: false },
|
|
16
|
-
dataTestName: { default: "default" },
|
|
17
|
-
modelValue: { default: void 0 },
|
|
18
|
-
config: { default: void 0 },
|
|
19
|
-
options: { default: () => [] }
|
|
20
|
-
},
|
|
21
|
-
emits: ["change", "update:modelValue"],
|
|
22
|
-
setup(__props, { emit: __emit }) {
|
|
23
|
-
const props = __props;
|
|
24
|
-
const { optionListMap } = useOptionMethods();
|
|
25
|
-
const emit = __emit;
|
|
26
|
-
const activeElement = useVModel(
|
|
27
|
-
props,
|
|
28
|
-
"modelValue",
|
|
29
|
-
emit
|
|
30
|
-
);
|
|
31
|
-
const optionsMapped = computed(() => {
|
|
32
|
-
return optionListMap(props.options, props.config);
|
|
33
|
-
});
|
|
34
|
-
function onClick(option) {
|
|
35
|
-
if (option.disabled || props.disabled) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const value = option.value;
|
|
39
|
-
activeElement.value = value;
|
|
40
|
-
emit("change", option.originalItem);
|
|
41
|
-
emit("update:modelValue", value);
|
|
42
|
-
}
|
|
43
|
-
return (_ctx, _cache) => {
|
|
44
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
45
|
-
createElementVNode("div", {
|
|
46
|
-
class: normalizeClass(["vc-view-switcher", { "vc-view-switcher--disabled": __props.disabled }]),
|
|
47
|
-
"data-test": __props.dataTestName
|
|
48
|
-
}, [
|
|
49
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(optionsMapped.value, (option) => {
|
|
50
|
-
return openBlock(), createElementBlock("div", {
|
|
51
|
-
key: option.key,
|
|
52
|
-
class: "vc-view-switcher-container",
|
|
53
|
-
tabindex: "-1"
|
|
54
|
-
}, [
|
|
55
|
-
createElementVNode("div", {
|
|
56
|
-
class: normalizeClass(["vc-view-switcher-item", [
|
|
57
|
-
{ "vc-view-switcher-item--active": option.value === unref(activeElement) },
|
|
58
|
-
{ "vc-view-switcher-item--disabled": option.disabled }
|
|
59
|
-
]]),
|
|
60
|
-
tabindex: option.disabled ? -1 : 0,
|
|
61
|
-
onKeyup: withKeys(($event) => onClick(option), ["enter"]),
|
|
62
|
-
onClick: ($event) => onClick(option)
|
|
63
|
-
}, [
|
|
64
|
-
renderSlot(_ctx.$slots, "tab-item", {
|
|
65
|
-
option,
|
|
66
|
-
isActive: option.value === unref(activeElement)
|
|
67
|
-
}, () => [
|
|
68
|
-
createElementVNode("div", _hoisted_4, [
|
|
69
|
-
createVNode(_sfc_main$1, {
|
|
70
|
-
icon: option.icon,
|
|
71
|
-
class: "vc-view-switcher-item--icon"
|
|
72
|
-
}, null, 8, ["icon"]),
|
|
73
|
-
createElementVNode("span", _hoisted_5, toDisplayString(option.label), 1)
|
|
74
|
-
])
|
|
75
|
-
])
|
|
76
|
-
], 42, _hoisted_3)
|
|
77
|
-
]);
|
|
78
|
-
}), 128))
|
|
79
|
-
], 10, _hoisted_2)
|
|
80
|
-
]);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
export {
|
|
85
|
-
_sfc_main as default
|
|
86
|
-
};
|