@coreui/vue-pro 4.9.0-beta.0 → 4.9.0-beta.2
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 +1 -1
- package/dist/composables/useColorModes.d.ts +2 -1
- package/dist/directives/v-c-tooltip.d.ts +1 -0
- package/dist/index.es.js +19 -8
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/sidebar/CSidebar.ts +7 -2
- package/src/composables/useColorModes.ts +13 -7
- package/src/directives/v-c-tooltip.ts +1 -0
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
Several quick start options are available:
|
|
48
48
|
|
|
49
|
-
- [Download the latest release](https://github.com/coreui/coreui-vue-pro/archive/v4.9.0-beta.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-vue-pro/archive/v4.9.0-beta.2.zip)
|
|
50
50
|
- Clone the repo: `git clone https://github.com/coreui/coreui-vue-pro.git`
|
|
51
51
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/vue-pro`
|
|
52
52
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/vue-pro`
|
package/dist/index.es.js
CHANGED
|
@@ -12877,7 +12877,12 @@ const CPopoverPlugin = {
|
|
|
12877
12877
|
},
|
|
12878
12878
|
};
|
|
12879
12879
|
|
|
12880
|
-
const isOnMobile = (element) =>
|
|
12880
|
+
const isOnMobile = (element) => {
|
|
12881
|
+
if (!element) {
|
|
12882
|
+
return;
|
|
12883
|
+
}
|
|
12884
|
+
return Boolean(getComputedStyle(element).getPropertyValue('--cui-is-mobile'));
|
|
12885
|
+
};
|
|
12881
12886
|
const CSidebar = defineComponent({
|
|
12882
12887
|
name: 'CSidebar',
|
|
12883
12888
|
props: {
|
|
@@ -16348,6 +16353,7 @@ const toggleTooltipElement = (tooltip, el, popperOptions) => {
|
|
|
16348
16353
|
addTooltipElement(tooltip, el, popperOptions);
|
|
16349
16354
|
};
|
|
16350
16355
|
var vCTooltip = {
|
|
16356
|
+
name: 'c-tooltip',
|
|
16351
16357
|
mounted(el, binding) {
|
|
16352
16358
|
const value = binding.value;
|
|
16353
16359
|
const content = typeof value === 'string' ? value : value.content ?? '';
|
|
@@ -16403,9 +16409,12 @@ var Directives = /*#__PURE__*/Object.freeze({
|
|
|
16403
16409
|
vctooltip: vCTooltip
|
|
16404
16410
|
});
|
|
16405
16411
|
|
|
16406
|
-
const getStoredTheme = (localStorageItemName) => localStorage.getItem(localStorageItemName);
|
|
16412
|
+
const getStoredTheme = (localStorageItemName) => typeof window !== 'undefined' && localStorage.getItem(localStorageItemName);
|
|
16407
16413
|
const setStoredTheme = (localStorageItemName, colorMode) => localStorage.setItem(localStorageItemName, colorMode);
|
|
16408
16414
|
const getPreferredColorScheme = (localStorageItemName) => {
|
|
16415
|
+
if (typeof window === 'undefined') {
|
|
16416
|
+
return;
|
|
16417
|
+
}
|
|
16409
16418
|
const storedTheme = getStoredTheme(localStorageItemName);
|
|
16410
16419
|
if (storedTheme) {
|
|
16411
16420
|
return storedTheme;
|
|
@@ -16423,23 +16432,25 @@ const setTheme = (colorMode) => {
|
|
|
16423
16432
|
const useColorModes = (localStorageItemName = 'coreui-vue-color-scheme') => {
|
|
16424
16433
|
const colorMode = ref(getPreferredColorScheme(localStorageItemName));
|
|
16425
16434
|
watch(colorMode, () => {
|
|
16426
|
-
|
|
16427
|
-
|
|
16435
|
+
if (colorMode.value) {
|
|
16436
|
+
setStoredTheme(localStorageItemName, colorMode.value);
|
|
16437
|
+
setTheme(colorMode.value);
|
|
16438
|
+
}
|
|
16428
16439
|
});
|
|
16429
16440
|
onBeforeMount(() => {
|
|
16430
|
-
if (typeof getStoredTheme(localStorageItemName) === 'string') {
|
|
16441
|
+
if (typeof getStoredTheme(localStorageItemName) === 'string' && colorMode.value) {
|
|
16431
16442
|
setTheme(colorMode.value);
|
|
16432
16443
|
}
|
|
16433
16444
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
16434
16445
|
const storedTheme = getStoredTheme(localStorageItemName);
|
|
16435
|
-
if (storedTheme !== 'light' && storedTheme !== 'dark') {
|
|
16446
|
+
if (storedTheme !== 'light' && storedTheme !== 'dark' && colorMode.value) {
|
|
16436
16447
|
setTheme(colorMode.value);
|
|
16437
16448
|
}
|
|
16438
16449
|
});
|
|
16439
|
-
watch(colorMode, () => setTheme(colorMode.value));
|
|
16440
16450
|
});
|
|
16441
16451
|
return {
|
|
16442
16452
|
getColorMode: () => colorMode.value,
|
|
16453
|
+
isColorModeSet: () => Boolean(getStoredTheme(localStorageItemName)),
|
|
16443
16454
|
setColorMode: (mode) => {
|
|
16444
16455
|
colorMode.value = mode;
|
|
16445
16456
|
},
|
|
@@ -16452,7 +16463,7 @@ const CoreuiVue = {
|
|
|
16452
16463
|
app.component(key, Components[key]);
|
|
16453
16464
|
}
|
|
16454
16465
|
for (const key in Directives) {
|
|
16455
|
-
app.directive(key, Directives[key]);
|
|
16466
|
+
app.directive(Directives[key]['name'], Directives[key]);
|
|
16456
16467
|
}
|
|
16457
16468
|
},
|
|
16458
16469
|
};
|