cosey 0.1.1 → 0.1.4
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/components/audio-card/audio-card.vue.js +1 -1
- package/components/audio-card/style/index.d.ts +1 -1
- package/components/audio-viewer/style/index.d.ts +1 -1
- package/components/close/close.vue.js +1 -1
- package/components/close/style/index.d.ts +1 -1
- package/components/col/style/index.d.ts +1 -1
- package/components/col/style/index.js +1 -1
- package/components/components.d.ts +98 -44
- package/components/config-provider/config-provider.js +1 -3
- package/components/config-provider/config-provider.vue.d.ts +2 -7
- package/components/config-provider/config-provider.vue.js +8 -4
- package/components/config-provider/index.d.ts +1 -1
- package/components/config-provider/override-element-plus.d.ts +3 -2
- package/components/config-provider/override-element-plus.js +2 -2
- package/components/container/container.d.ts +0 -1
- package/components/container/container.vue.js +0 -4
- package/components/container/style/index.d.ts +1 -1
- package/components/context-menu/content.vue.js +1 -1
- package/components/context-menu/context-menu.vue.js +2 -2
- package/components/context-menu/style/index.d.ts +1 -1
- package/components/copy/copy.d.ts +0 -2
- package/components/copy/copy.vue.d.ts +1 -7
- package/components/copy/copy.vue.js +1 -2
- package/components/copy/index.d.ts +3 -19
- package/components/copy/style/index.d.ts +1 -1
- package/components/cssinjs/parser.js +8 -25
- package/components/dnd-sort/dnd-sort-item.vue.js +3 -4
- package/components/dnd-sort/dnd-sort.vue.js +1 -2
- package/components/dnd-sort/index.d.ts +1 -1
- package/components/dnd-sort/style/index.d.ts +1 -1
- package/components/dnd-sort/style/index.js +1 -0
- package/components/editor/components/button-group.vue.d.ts +2 -7
- package/components/editor/components/button.vue.d.ts +2 -7
- package/components/editor/components/color-picker/color-picker.style.d.ts +1 -1
- package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
- package/components/editor/components/color-picker/color-picker.vue.js +14 -11
- package/components/editor/components/list/list.style.d.ts +1 -1
- package/components/editor/components/picker/picker.style.d.ts +1 -1
- package/components/editor/components/picker/picker.vue.d.ts +2 -15
- package/components/editor/components/resize/resize.js +4 -4
- package/components/editor/components/resize/resize.style.d.ts +1 -1
- package/components/editor/components/resize/resize.style.js +9 -32
- package/components/editor/components/resize/resize.vue.js +21 -14
- package/components/editor/components/select-button.vue.d.ts +2 -9
- package/components/editor/components/select-button.vue.js +1 -1
- package/components/editor/components/split-button.vue.d.ts +2 -19
- package/components/editor/components/split-button.vue.js +1 -1
- package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +1 -1
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
- package/components/editor/components/toolbar/formats/align.vue.js +4 -4
- package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
- package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
- package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
- package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
- package/components/editor/components/toolbar/formats/code.vue.js +1 -1
- package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
- package/components/editor/components/toolbar/formats/image.vue.js +1 -1
- package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
- package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
- package/components/editor/components/toolbar/formats/link.vue.js +15 -13
- package/components/editor/components/toolbar/formats/list.vue.js +3 -3
- package/components/editor/components/toolbar/formats/script.vue.js +2 -2
- package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
- package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
- package/components/editor/components/toolbar/formats/table.style.d.ts +1 -1
- package/components/editor/components/toolbar/formats/table.vue.js +1 -1
- package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
- package/components/editor/components/toolbar/formats/video.vue.js +1 -1
- package/components/editor/components/toolbar/toolbar.d.ts +1 -2
- package/components/editor/components/toolbar/toolbar.js +17 -21
- package/components/editor/components/toolbar/toolbarContext.js +1 -3
- package/components/editor/editor.d.ts +0 -2
- package/components/editor/editor.vue.js +1 -11
- package/components/editor/formats/image.d.ts +13 -0
- package/components/editor/formats/image.js +46 -0
- package/components/editor/formats/indent.d.ts +2 -0
- package/components/editor/formats/indent.js +12 -7
- package/components/editor/formats/link.js +1 -5
- package/components/editor/formats/list.d.ts +0 -4
- package/components/editor/formats/list.js +10 -5
- package/components/editor/formats/video.js +6 -9
- package/components/editor/modules/custom-list.js +1 -6
- package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +1 -1
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +4 -4
- package/components/editor/modules/image-uploader/image-uploader.js +1 -3
- package/components/editor/quill.js +7 -4
- package/components/editor/quillContext.js +1 -3
- package/components/editor/style/hljs.d.ts +1 -1
- package/components/editor/style/index.d.ts +1 -1
- package/components/editor/style/index.js +1 -5
- package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
- package/components/field/components/checkbox-group/panel.vue.js +2 -2
- package/components/field/components/tree-select/tree-select.d.ts +1 -2
- package/components/field/components/tree-select/tree-select.js +69 -0
- package/components/file-card/file-card.vue.js +1 -1
- package/components/file-card/style/index.d.ts +1 -1
- package/components/form/form-item.vue.js +1 -1
- package/components/form/style/index.d.ts +1 -1
- package/components/form/useFormItemWidth.js +1 -1
- package/components/form/useFormTemplate.js +2 -10
- package/components/form-dialog/form-dialog.vue.d.ts +0 -1
- package/components/form-dialog/form-dialog.vue.js +1 -1
- package/components/form-dialog/index.d.ts +0 -3
- package/components/form-group/form-group.vue.js +1 -1
- package/components/form-list/form-list.js +1 -6
- package/components/form-list/form-list.vue.js +2 -2
- package/components/form-list/style/index.d.ts +1 -1
- package/components/form-query/form-query.vue.js +5 -5
- package/components/form-query/style/index.d.ts +1 -1
- package/components/highlight/highlight.d.ts +1 -1
- package/components/highlight/highlight.vue.js +11 -4
- package/components/highlight/style/index.d.ts +1 -1
- package/components/highlight/style/index.js +15 -5
- package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
- package/components/horizontal-tree/style/index.d.ts +1 -1
- package/components/icon/style/index.d.ts +1 -1
- package/components/iconify-icon/iconify-icon.d.ts +3 -0
- package/components/iconify-icon/iconify-icon.js +9 -0
- package/components/iconify-icon/iconify-icon.vue.js +2 -5
- package/components/iconify-icon/index.js +1 -0
- package/components/image-card/style/index.d.ts +1 -1
- package/components/index.js +4 -2
- package/components/long-text/style/index.d.ts +1 -1
- package/components/mask/style/index.d.ts +1 -1
- package/components/media-card-group/media-card-group.vue.js +4 -3
- package/components/media-card-group/style/index.d.ts +1 -1
- package/components/panel/style/index.d.ts +1 -1
- package/components/row/style/index.d.ts +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -2
- package/components/scroll-view/style/index.d.ts +1 -1
- package/components/snug-menu/snug-menu.vue.js +1 -2
- package/components/snug-menu/style/index.d.ts +1 -1
- package/components/style/animation.d.ts +5 -0
- package/components/style/animation.js +33 -0
- package/components/style/index.d.ts +1 -1
- package/components/style/index.js +2 -2
- package/components/style/mixins.d.ts +2 -0
- package/components/style/mixins.js +10 -1
- package/components/table/index.d.ts +0 -8
- package/components/table/style/index.d.ts +1 -1
- package/components/table/style/index.js +2 -2
- package/components/table/table-column/renderer.js +22 -18
- package/components/table/table-column/style/index.d.ts +1 -1
- package/components/table/table-column/table-column.vue.d.ts +3 -3
- package/components/table/table-column-editor/item.vue.js +5 -8
- package/components/table/table-column-editor/style/index.d.ts +1 -1
- package/components/table/table-column-editor/style/index.js +1 -0
- package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
- package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
- package/components/table/table-export/style/index.d.ts +1 -1
- package/components/table/table-export/table-export.vue.js +2 -2
- package/components/table/table-query/table-query.d.ts +0 -4
- package/components/table/table-query/table-query.js +0 -4
- package/components/table/table-query/table-query.vue.d.ts +0 -9
- package/components/table/table-query/table-query.vue.js +14 -12
- package/components/table/table.js +1 -3
- package/components/table/table.vue.js +22 -24
- package/components/table/useTable.js +1 -4
- package/components/table/utils.js +1 -3
- package/components/table-action/item.vue.js +5 -5
- package/components/table-action/style/index.d.ts +1 -1
- package/components/table-action/table-action.vue.js +4 -3
- package/components/theme/StyleContext.js +1 -3
- package/components/theme/createCacheToken.js +1 -4
- package/components/theme/getGlobalStyleHook.d.ts +2 -3
- package/components/theme/getGlobalStyleHook.js +5 -13
- package/components/theme/getOverrideStyleHook.d.ts +8 -0
- package/components/theme/getOverrideStyleHook.js +39 -0
- package/components/theme/getSimpleStyleHook.d.ts +2 -2
- package/components/theme/getSimpleStyleHook.js +4 -11
- package/components/theme/getStyleHook.d.ts +2 -2
- package/components/theme/getStyleHook.js +4 -11
- package/components/theme/index.d.ts +2 -1
- package/components/theme/index.js +1 -0
- package/components/theme/interface/index.d.ts +1 -1
- package/components/theme/theme-context.d.ts +11 -2
- package/components/theme/theme-context.js +36 -6
- package/components/theme/themes/shared/genColorMapToken.js +1 -4
- package/components/theme/useStyleRegister.d.ts +1 -7
- package/components/theme/useStyleRegister.js +3 -6
- package/components/theme/util/alias.js +4 -16
- package/components/theme/util/getAlphaColor.js +1 -6
- package/components/theme/util/normalizeStyle.js +1 -1
- package/components/theme/util/statistic.js +4 -1
- package/components/theme/util/useToken.d.ts +4 -4
- package/components/theme/util/useToken.js +7 -10
- package/components/toggle/toggle.vue.js +1 -1
- package/components/transition/style/index.d.ts +1 -1
- package/components/transition/transition.vue.js +1 -2
- package/components/transition-group/index.d.ts +3 -3
- package/components/transition-group/style/index.d.ts +1 -1
- package/components/transition-group/transition-group.vue.d.ts +1 -1
- package/components/upload/index.d.ts +0 -3
- package/components/upload/style/index.d.ts +1 -1
- package/components/upload/upload-item.vue.js +8 -8
- package/components/upload/upload.d.ts +0 -2
- package/components/upload/upload.js +0 -1
- package/components/upload/upload.vue.d.ts +0 -1
- package/components/upload/upload.vue.js +1 -5
- package/components/video-card/style/index.d.ts +1 -1
- package/components/video-card/video-card.vue.js +1 -1
- package/components/video-viewer/style/index.d.ts +1 -1
- package/config/http.d.ts +1 -1
- package/config/http.js +1 -1
- package/config/index.d.ts +23 -22
- package/config/index.js +2 -7
- package/config/layout.d.ts +36 -0
- package/config/layout.js +37 -1
- package/config/nprogress.style.d.ts +2 -0
- package/config/nprogress.style.js +51 -0
- package/config/root-config-provider.vue.d.ts +2 -20
- package/config/root-config-provider.vue.js +2 -0
- package/hooks/useColorScheme.js +5 -9
- package/hooks/useEcharts.js +2 -4
- package/hooks/useFetch.d.ts +1 -1
- package/hooks/useFetch.js +1 -7
- package/hooks/useFullPage.js +7 -9
- package/hooks/useLocale.js +1 -3
- package/hooks/useLockscreenObserver.js +1 -1
- package/hooks/usePersist.js +1 -3
- package/hooks/useTreeCheck.js +13 -26
- package/hooks/useUpsert.d.ts +15 -16
- package/hooks/useUpsert.js +3 -3
- package/index.d.ts +1 -0
- package/index.js +5 -4
- package/layout/index.js +2 -2
- package/layout/layout-aside/layout-aside.vue.js +2 -1
- package/layout/layout-aside/style/index.d.ts +1 -1
- package/layout/layout-auth/style/index.d.ts +1 -1
- package/layout/layout-base/layout-base.vue.js +9 -9
- package/layout/layout-base/style/index.d.ts +1 -1
- package/layout/layout-brand/style/index.d.ts +1 -1
- package/layout/layout-change-password/layout-change-password.vue.js +8 -8
- package/layout/layout-change-password/style/index.d.ts +1 -1
- package/layout/layout-change-password/style/index.js +1 -1
- package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
- package/layout/layout-color-scheme/style/index.d.ts +2 -5
- package/layout/layout-color-scheme/style/index.js +26 -44
- package/layout/layout-content/layout-content.vue.d.ts +2 -13
- package/layout/layout-content/style/index.d.ts +1 -1
- package/layout/layout-exception/style/index.d.ts +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
- package/layout/layout-header/layout-header.vue.d.ts +2 -14
- package/layout/layout-header/style/index.d.ts +1 -1
- package/layout/layout-iframe/style/index.d.ts +1 -1
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
- package/layout/layout-login/layout-login.vue.js +5 -5
- package/layout/layout-login/style/index.d.ts +1 -1
- package/layout/layout-login/style/index.js +1 -1
- package/layout/layout-main/style/index.d.ts +1 -1
- package/layout/layout-mask/style/index.d.ts +1 -1
- package/layout/layout-mask/style/index.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -0
- package/layout/layout-menu/style/index.d.ts +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +2 -2
- package/layout/layout-search/layout-search.vue.js +37 -34
- package/layout/layout-search/style/index.d.ts +1 -1
- package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
- package/layout/layout-sidebar/style/index.d.ts +1 -1
- package/layout/layout-sidebar/style/index.js +1 -1
- package/layout/layout-snug-aside/style/index.d.ts +1 -1
- package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
- package/layout/layout-switch-effect/style/index.d.ts +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +8 -3
- package/layout/layout-tabbar/reload.vue.js +1 -1
- package/layout/layout-tabbar/style/index.d.ts +1 -1
- package/layout/layout-tabbar/style/index.js +6 -2
- package/layout/layout-toggle/layout-toggle.vue.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
- package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
- package/layout/layout-topbar/style/index.d.ts +1 -1
- package/layout/layout-user-menu/index.d.ts +1 -0
- package/layout/layout-user-menu/index.js +1 -0
- package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
- package/layout/{layout-user → layout-user-menu}/style/index.d.ts +1 -1
- package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
- package/layout/layout.d.ts +1 -1
- package/layout/layout.js +1 -1
- package/layout/merged/index.d.ts +1 -1
- package/layout/merged/index.js +1 -1
- package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
- package/layout/utils.js +1 -4
- package/package.json +16 -6
- package/request/useRequest.js +1 -1
- package/router/guard/auth.js +2 -5
- package/router/guard/index.js +2 -2
- package/router/guard/pageTitle.d.ts +2 -0
- package/router/guard/pageTitle.js +11 -0
- package/router/guard/progress.js +11 -1
- package/router/index.d.ts +22 -0
- package/router/index.js +1 -1
- package/router/routes/static/auth.js +5 -6
- package/router/routes/static/exception.js +3 -3
- package/router/utils.js +11 -3
- package/store/layout.d.ts +4 -10
- package/store/layout.js +19 -31
- package/store/user.d.ts +4 -4
- package/store/user.js +2 -1
- package/utils/array.js +3 -0
- package/utils/dynamicCSS.d.ts +3 -2
- package/utils/dynamicCSS.js +12 -1
- package/utils/excel/index.js +1 -3
- package/utils/excel/utils.js +1 -5
- package/utils/file.js +1 -3
- package/utils/index.js +1 -1
- package/utils/object.js +1 -3
- package/utils/tree.js +2 -11
- package/utils/vue.js +1 -1
- package/components/global.d.js +0 -1
- package/components/style/motion/index.d.ts +0 -1
- package/components/style/motion/index.js +0 -1
- package/components/style/motion/loading.d.ts +0 -3
- package/components/style/motion/loading.js +0 -23
- package/layout/layout-user/index.d.ts +0 -1
- package/layout/layout-user/index.js +0 -1
- package/router/guard/popup.d.ts +0 -2
- package/router/guard/popup.js +0 -6
- package/types/vue-router.d.js +0 -1
- package/types/vue.d.js +0 -1
- /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
- /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
|
@@ -5,10 +5,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
5
5
|
type: import("vue").PropType<import("../..").FormItemProps<import("../..").FieldType>[]>;
|
|
6
6
|
default: () => never[];
|
|
7
7
|
};
|
|
8
|
-
modelValue: {
|
|
9
|
-
type: ObjectConstructor;
|
|
10
|
-
default: () => {};
|
|
11
|
-
};
|
|
12
8
|
grid: {
|
|
13
9
|
type: BooleanConstructor;
|
|
14
10
|
default: boolean;
|
|
@@ -160,10 +156,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
160
156
|
type: import("vue").PropType<import("../..").FormItemProps<import("../..").FieldType>[]>;
|
|
161
157
|
default: () => never[];
|
|
162
158
|
};
|
|
163
|
-
modelValue: {
|
|
164
|
-
type: ObjectConstructor;
|
|
165
|
-
default: () => {};
|
|
166
|
-
};
|
|
167
159
|
grid: {
|
|
168
160
|
type: BooleanConstructor;
|
|
169
161
|
default: boolean;
|
|
@@ -303,7 +295,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
303
295
|
grid: boolean;
|
|
304
296
|
inline: boolean;
|
|
305
297
|
disabled: boolean;
|
|
306
|
-
modelValue: Record<string, any>;
|
|
307
298
|
readonly: boolean;
|
|
308
299
|
labelWidth: string | number;
|
|
309
300
|
labelPosition: "left" | "right" | "top";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, onBeforeMount, createBlock, openBlock, unref, mergeProps, withKeys, withModifiers, withCtx, createElementBlock, Fragment, renderList } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, reactive, onBeforeMount, createBlock, openBlock, unref, mergeProps, withKeys, withModifiers, withCtx, createElementBlock, Fragment, renderList } from 'vue';
|
|
2
2
|
import { tableQueryProps, omittedTableQueryProps, tableQueryExposeKeys } from './table-query.js';
|
|
3
3
|
import { reactiveOmit } from '@vueuse/core';
|
|
4
4
|
import { cloneDeep } from 'lodash-es';
|
|
@@ -19,9 +19,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
19
19
|
const props = __props;
|
|
20
20
|
const formQueryProps = reactiveOmit(props, omittedTableQueryProps);
|
|
21
21
|
const formQueryRef = useTemplateRef("formQuery");
|
|
22
|
+
const formModel = reactive({});
|
|
22
23
|
onBeforeMount(() => {
|
|
23
24
|
props.schemes.forEach(item => {
|
|
24
|
-
|
|
25
|
+
formModel[item.prop] = item.modelValue;
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
const onEnter = () => {
|
|
@@ -29,13 +30,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
29
30
|
};
|
|
30
31
|
const customExpose = {
|
|
31
32
|
getFieldsValue() {
|
|
32
|
-
return cloneDeep(
|
|
33
|
+
return cloneDeep(formModel);
|
|
33
34
|
},
|
|
34
35
|
setFieldsValue(value) {
|
|
35
|
-
Object.assign(
|
|
36
|
+
Object.assign(formModel, value);
|
|
36
37
|
},
|
|
37
38
|
getFormModel() {
|
|
38
|
-
return
|
|
39
|
+
return formModel;
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
__expose(createMergedExpose(tableQueryExposeKeys, () => formQueryRef.value, customExpose));
|
|
@@ -43,18 +44,19 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
43
44
|
return openBlock(), createBlock(unref(_FormQuery), mergeProps({
|
|
44
45
|
ref: "formQuery"
|
|
45
46
|
}, unref(formQueryProps), {
|
|
46
|
-
model:
|
|
47
|
-
onKeyup: withKeys(withModifiers(onEnter, ["prevent"]), ["enter"
|
|
47
|
+
model: formModel,
|
|
48
|
+
onKeyup: withKeys(withModifiers(onEnter, ["prevent"]), ["enter"])
|
|
48
49
|
}), {
|
|
49
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.schemes, item => {
|
|
50
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.schemes, (item, i) => {
|
|
50
51
|
return openBlock(), createBlock(unref(_FormItem), mergeProps({
|
|
52
|
+
key: i,
|
|
51
53
|
ref_for: true
|
|
52
54
|
}, item, {
|
|
53
|
-
modelValue:
|
|
54
|
-
"onUpdate:modelValue": $event =>
|
|
55
|
+
modelValue: formModel[item.prop],
|
|
56
|
+
"onUpdate:modelValue": $event => formModel[item.prop] = $event
|
|
55
57
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]);
|
|
56
|
-
}),
|
|
57
|
-
/*
|
|
58
|
+
}), 128
|
|
59
|
+
/* KEYED_FRAGMENT */))]),
|
|
58
60
|
_: 1
|
|
59
61
|
/* STABLE */
|
|
60
62
|
}, 16, ["model", "onKeyup"]);
|
|
@@ -50,9 +50,7 @@ const tableProps = {
|
|
|
50
50
|
...omit(elTableProps, "style"),
|
|
51
51
|
...tableExtraProps
|
|
52
52
|
};
|
|
53
|
-
const omittedTableProps = Object.keys(
|
|
54
|
-
tableExtraProps
|
|
55
|
-
);
|
|
53
|
+
const omittedTableProps = Object.keys(tableExtraProps);
|
|
56
54
|
const elSlotsName = ["default", "append", "empty"];
|
|
57
55
|
const defaultPaginationProps = {
|
|
58
56
|
layout: "prev, pager, next, sizes, jumper, total"
|
|
@@ -103,7 +103,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
103
103
|
[tableKeys.value.page]: page.value,
|
|
104
104
|
[tableKeys.value.pageSize]: pageSize.value,
|
|
105
105
|
...orderParams,
|
|
106
|
-
...filterEmptyFormValue(
|
|
106
|
+
...filterEmptyFormValue(tableQueryRef.value?.getFieldsValue() || {})
|
|
107
107
|
};
|
|
108
108
|
params = props.beforeFetch?.(params) || params;
|
|
109
109
|
return props.api?.(params);
|
|
@@ -183,7 +183,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
183
183
|
zIndex.value = isFullPage.value ? nextZIndex() : void 0;
|
|
184
184
|
};
|
|
185
185
|
const settingRef = useTemplateRef("setting-ref");
|
|
186
|
-
const formModel = ref({});
|
|
187
186
|
const onSubmit = async () => {
|
|
188
187
|
if (!isFetching.value) {
|
|
189
188
|
page.value = 1;
|
|
@@ -226,11 +225,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
226
225
|
}, [createVNode(stdin_default$2, mergeProps({
|
|
227
226
|
ref: "tableQuery"
|
|
228
227
|
}, _ctx.formProps, {
|
|
229
|
-
modelValue: formModel.value,
|
|
230
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => formModel.value = $event),
|
|
231
228
|
reset: onReset,
|
|
232
229
|
submit: onSubmit
|
|
233
|
-
}), null, 16
|
|
230
|
+
}), null, 16
|
|
231
|
+
/* FULL_PROPS */)], 2
|
|
234
232
|
/* CLASS */)) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
235
233
|
class: normalizeClass(`${unref(prefixCls)}-body`)
|
|
236
234
|
}, [_ctx.$slots["toolbar-left"] || _ctx.$slots["toolbar-right"] || _ctx.toolbarConfig ? (openBlock(), createElementBlock("div", {
|
|
@@ -251,11 +249,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
251
249
|
"hide-after": 0
|
|
252
250
|
}, {
|
|
253
251
|
default: withCtx(() => [createVNode(unref(ElButton), {
|
|
254
|
-
|
|
252
|
+
circle: ""
|
|
255
253
|
}, {
|
|
256
254
|
default: withCtx(() => [createVNode(stdin_default$3, {
|
|
257
|
-
name: "
|
|
258
|
-
size: "
|
|
255
|
+
name: "co:rotate-360",
|
|
256
|
+
size: "md",
|
|
259
257
|
class: normalizeClass([`${unref(prefixCls)}-refresh-icon`, {
|
|
260
258
|
"is-spinning": reloading.value
|
|
261
259
|
}]),
|
|
@@ -273,12 +271,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
273
271
|
"hide-after": 0
|
|
274
272
|
}, {
|
|
275
273
|
default: withCtx(() => [createVNode(unref(ElButton), {
|
|
276
|
-
|
|
277
|
-
onClick: _cache[
|
|
274
|
+
circle: "",
|
|
275
|
+
onClick: _cache[0] || (_cache[0] = $event => exportVisible.value = true)
|
|
278
276
|
}, {
|
|
279
277
|
default: withCtx(() => [createVNode(stdin_default$3, {
|
|
280
|
-
name: "
|
|
281
|
-
size: "
|
|
278
|
+
name: "co:download",
|
|
279
|
+
size: "md"
|
|
282
280
|
})]),
|
|
283
281
|
_: 1
|
|
284
282
|
/* STABLE */
|
|
@@ -287,7 +285,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
287
285
|
/* STABLE */
|
|
288
286
|
}), createVNode(stdin_default$4, {
|
|
289
287
|
modelValue: exportVisible.value,
|
|
290
|
-
"onUpdate:modelValue": _cache[
|
|
288
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => exportVisible.value = $event),
|
|
291
289
|
title: "\u5BFC\u51FA\u6570\u636E",
|
|
292
290
|
columns: renderedColumns.value,
|
|
293
291
|
data: tableData.value
|
|
@@ -298,12 +296,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
298
296
|
"hide-after": 0
|
|
299
297
|
}, {
|
|
300
298
|
default: withCtx(() => [createVNode(unref(ElButton), {
|
|
301
|
-
|
|
299
|
+
circle: "",
|
|
302
300
|
onClick: onFullScreen
|
|
303
301
|
}, {
|
|
304
302
|
default: withCtx(() => [createVNode(stdin_default$3, {
|
|
305
|
-
name: unref(isFullPage) ? "
|
|
306
|
-
size: "
|
|
303
|
+
name: unref(isFullPage) ? "co:fullscreen-exit" : "co:fullscreen",
|
|
304
|
+
size: "md"
|
|
307
305
|
}, null, 8, ["name"])]),
|
|
308
306
|
_: 1
|
|
309
307
|
/* STABLE */
|
|
@@ -317,12 +315,12 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
317
315
|
"hide-after": 0
|
|
318
316
|
}, {
|
|
319
317
|
default: withCtx(() => [createVNode(unref(ElButton), {
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
ref: "setting-ref",
|
|
319
|
+
circle: ""
|
|
322
320
|
}, {
|
|
323
321
|
default: withCtx(() => [createVNode(stdin_default$3, {
|
|
324
|
-
name: "
|
|
325
|
-
size: "
|
|
322
|
+
name: "co:settings-adjust",
|
|
323
|
+
size: "md"
|
|
326
324
|
})]),
|
|
327
325
|
_: 1
|
|
328
326
|
/* STABLE */
|
|
@@ -332,8 +330,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
332
330
|
/* STABLE */
|
|
333
331
|
}), createVNode(stdin_default$5, {
|
|
334
332
|
modelValue: renderedColumns.value,
|
|
335
|
-
"onUpdate:modelValue": _cache[
|
|
336
|
-
"virtual-ref":
|
|
333
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => renderedColumns.value = $event),
|
|
334
|
+
"virtual-ref": settingRef.value,
|
|
337
335
|
onReset: onColumnReset
|
|
338
336
|
}, null, 8, ["modelValue", "virtual-ref"])])) : createCommentVNode("v-if", true)], 2
|
|
339
337
|
/* CLASS */)) : createCommentVNode("v-if", true)], 2
|
|
@@ -372,9 +370,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
372
370
|
key: 1
|
|
373
371
|
}, paginationProps.value, {
|
|
374
372
|
"current-page": page.value,
|
|
375
|
-
"onUpdate:currentPage": _cache[
|
|
373
|
+
"onUpdate:currentPage": _cache[3] || (_cache[3] = $event => page.value = $event),
|
|
376
374
|
"page-size": pageSize.value,
|
|
377
|
-
"onUpdate:pageSize": _cache[
|
|
375
|
+
"onUpdate:pageSize": _cache[4] || (_cache[4] = $event => pageSize.value = $event),
|
|
378
376
|
class: `${unref(prefixCls)}-pagination`,
|
|
379
377
|
style: {
|
|
380
378
|
"--el-pagination-bg-color": "transparent",
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { isEmpty } from '../../utils/is.js';
|
|
2
2
|
|
|
3
3
|
function filterEmptyFormValue(model) {
|
|
4
|
-
return Object.fromEntries(
|
|
5
|
-
Object.entries(model).filter(([, value]) => !isEmpty(value))
|
|
6
|
-
);
|
|
4
|
+
return Object.fromEntries(Object.entries(model).filter(([, value]) => !isEmpty(value)));
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
export { filterEmptyFormValue };
|
|
@@ -64,9 +64,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
64
64
|
size: "small",
|
|
65
65
|
onClick: event => onCancel(event, cancel)
|
|
66
66
|
}, {
|
|
67
|
-
default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode("
|
|
68
|
-
_: 2
|
|
69
|
-
|
|
67
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode("\u5426")])),
|
|
68
|
+
_: 2,
|
|
69
|
+
__: [0]
|
|
70
70
|
}, 1032, ["onClick"]), createVNode(unref(ElButton), {
|
|
71
71
|
type: "danger",
|
|
72
72
|
size: "small",
|
|
@@ -74,8 +74,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
74
74
|
onClick: event => onConfirm(event, confirm)
|
|
75
75
|
}, {
|
|
76
76
|
default: withCtx(() => _cache[1] || (_cache[1] = [createTextVNode(" \u662F ")])),
|
|
77
|
-
_: 2
|
|
78
|
-
|
|
77
|
+
_: 2,
|
|
78
|
+
__: [1]
|
|
79
79
|
}, 1032, ["loading", "onClick"])]),
|
|
80
80
|
_: 1
|
|
81
81
|
/* STABLE */
|
|
@@ -3,7 +3,7 @@ export interface ComponentToken {
|
|
|
3
3
|
}
|
|
4
4
|
export interface TableActionToken extends FullToken<'TableAction'> {
|
|
5
5
|
}
|
|
6
|
-
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string,
|
|
6
|
+
declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
|
|
7
7
|
hashId: import("vue").Ref<string, string>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -26,13 +26,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
26
26
|
return (_ctx, _cache) => {
|
|
27
27
|
return openBlock(), createElementBlock("div", {
|
|
28
28
|
class: normalizeClass([unref(hashId), unref(prefixCls)])
|
|
29
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actions, action => {
|
|
29
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actions, (action, _i) => {
|
|
30
30
|
return openBlock(), createBlock(stdin_default$2, mergeProps({
|
|
31
|
+
key: _i,
|
|
31
32
|
ref_for: true
|
|
32
33
|
}, action), null, 16
|
|
33
34
|
/* FULL_PROPS */);
|
|
34
|
-
}),
|
|
35
|
-
/*
|
|
35
|
+
}), 128
|
|
36
|
+
/* KEYED_FRAGMENT */))], 2
|
|
36
37
|
/* CLASS */);
|
|
37
38
|
};
|
|
38
39
|
}
|
|
@@ -7,10 +7,7 @@ class CacheToken {
|
|
|
7
7
|
cache = [];
|
|
8
8
|
getToken(token, algorithm, components) {
|
|
9
9
|
const result = this.cache.find(([_token, algorithm$, components$]) => {
|
|
10
|
-
if (isShallowEqual(
|
|
11
|
-
[_token, algorithm$, components$],
|
|
12
|
-
[token, algorithm, components]
|
|
13
|
-
)) {
|
|
10
|
+
if (isShallowEqual([_token, algorithm$, components$], [token, algorithm, components])) {
|
|
14
11
|
return true;
|
|
15
12
|
}
|
|
16
13
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
2
1
|
import type { CSSInterpolation } from '../cssinjs';
|
|
3
2
|
import type { AliasToken } from './interface';
|
|
4
|
-
import {
|
|
5
|
-
export declare function getGlobalStyleHook(component: string, styleFn: (token: AliasToken) => CSSInterpolation): (
|
|
3
|
+
import { ThemeManager } from './theme-context';
|
|
4
|
+
export declare function getGlobalStyleHook(component: string, styleFn: (token: AliasToken) => CSSInterpolation): (themeManager?: ThemeManager) => void;
|
|
@@ -6,23 +6,15 @@ import { useConfig } from '../config-provider/config-provider.js';
|
|
|
6
6
|
import { useMounted } from '../../hooks/useMounted.js';
|
|
7
7
|
import { isClient } from '../../utils/env.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const oldGlobalClass = /* @__PURE__ */ new Set();
|
|
10
10
|
function getGlobalStyleHook(component, styleFn) {
|
|
11
|
-
return (
|
|
12
|
-
const { token, hashId } = useToken(
|
|
11
|
+
return (themeManager) => {
|
|
12
|
+
const { token, hashId } = useToken(themeManager);
|
|
13
13
|
const configContext = useConfig();
|
|
14
14
|
useStyleRegister(
|
|
15
|
-
computed(() =>
|
|
16
|
-
path: [component],
|
|
17
|
-
token: token.value,
|
|
18
|
-
hashId: hashId.value,
|
|
19
|
-
global: true
|
|
20
|
-
})),
|
|
15
|
+
computed(() => ["__global", component]),
|
|
21
16
|
() => {
|
|
22
|
-
const cssVar = tokenValueToCssVar(
|
|
23
|
-
token.value,
|
|
24
|
-
configContext.prefixCls.value
|
|
25
|
-
);
|
|
17
|
+
const cssVar = tokenValueToCssVar(token.value, configContext.prefixCls.value);
|
|
26
18
|
return styleFn(cssVar);
|
|
27
19
|
}
|
|
28
20
|
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CSSInterpolation } from '../cssinjs';
|
|
2
|
+
import type { AliasToken, TokenWithCommonCls } from './interface';
|
|
3
|
+
import { ThemeManager } from './theme-context';
|
|
4
|
+
export type AliasTokenWithCommonCls = TokenWithCommonCls<AliasToken>;
|
|
5
|
+
export declare function getOverrideStyleHook(component: string, styleFn: (token: AliasTokenWithCommonCls) => CSSInterpolation): (_themeManager?: ThemeManager) => {
|
|
6
|
+
readonly token: import("vue").ComputedRef<import("./interface").GlobalToken>;
|
|
7
|
+
readonly hashId: import("vue").Ref<string, string>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { watch } from 'vue';
|
|
2
|
+
import { parseStyle } from '../cssinjs/parser.js';
|
|
3
|
+
import { useToken } from './util/useToken.js';
|
|
4
|
+
import { tokenValueToCssVar } from './util/tokenValueToCssVar.js';
|
|
5
|
+
import { useConfig } from '../config-provider/config-provider.js';
|
|
6
|
+
import hash from '@emotion/hash';
|
|
7
|
+
import { normalizeStyle } from './util/normalizeStyle.js';
|
|
8
|
+
|
|
9
|
+
function getOverrideStyleHook(component, styleFn) {
|
|
10
|
+
const pathHash = hash(["__override", component].join("|"));
|
|
11
|
+
return (_themeManager) => {
|
|
12
|
+
const { token, hashId, themeManager } = useToken(_themeManager);
|
|
13
|
+
const configContext = useConfig();
|
|
14
|
+
watch(
|
|
15
|
+
hashId,
|
|
16
|
+
() => {
|
|
17
|
+
const cssVar = tokenValueToCssVar(token.value, configContext.prefixCls.value);
|
|
18
|
+
const styleInterpolation = styleFn({
|
|
19
|
+
...cssVar,
|
|
20
|
+
hashId: hashId.value,
|
|
21
|
+
componentCls: "",
|
|
22
|
+
prefixCls: ""
|
|
23
|
+
});
|
|
24
|
+
const [parsedStr] = parseStyle(styleInterpolation);
|
|
25
|
+
const styleStr = normalizeStyle(parsedStr);
|
|
26
|
+
themeManager.setOverrideStyle(styleStr, pathHash, hash([hashId.value, pathHash].join("|")));
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
immediate: true
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
return {
|
|
33
|
+
token,
|
|
34
|
+
hashId
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { getOverrideStyleHook };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import type { CSSInterpolation } from '../cssinjs';
|
|
3
3
|
import type { AliasToken, TokenWithCommonCls } from './interface';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeManager } from './theme-context';
|
|
5
5
|
export type AliasTokenWithCommonCls = TokenWithCommonCls<AliasToken>;
|
|
6
|
-
export declare function getSimpleStyleHook(component: string, styleFn: (token: AliasTokenWithCommonCls) => CSSInterpolation): (_prefixCls?: ComputedRef<string> | string,
|
|
6
|
+
export declare function getSimpleStyleHook(component: string, styleFn: (token: AliasTokenWithCommonCls) => CSSInterpolation): (_prefixCls?: ComputedRef<string> | string, themeManager?: ThemeManager) => {
|
|
7
7
|
hashId: import("vue").Ref<string, string>;
|
|
8
8
|
};
|
|
@@ -5,22 +5,15 @@ import { tokenValueToCssVar } from './util/tokenValueToCssVar.js';
|
|
|
5
5
|
import { useConfig } from '../config-provider/config-provider.js';
|
|
6
6
|
|
|
7
7
|
function getSimpleStyleHook(component, styleFn) {
|
|
8
|
-
return (_prefixCls = "",
|
|
8
|
+
return (_prefixCls = "", themeManager) => {
|
|
9
9
|
const prefixCls = computed(() => unref(_prefixCls));
|
|
10
|
-
const { token, hashId } = useToken(
|
|
10
|
+
const { token, hashId } = useToken(themeManager);
|
|
11
11
|
const configContext = useConfig();
|
|
12
12
|
useStyleRegister(
|
|
13
|
-
computed(() =>
|
|
14
|
-
path: [component, prefixCls.value],
|
|
15
|
-
token: token.value,
|
|
16
|
-
hashId: hashId.value
|
|
17
|
-
})),
|
|
13
|
+
computed(() => ["__simple", component, prefixCls.value]),
|
|
18
14
|
() => {
|
|
19
15
|
const componentCls = `.${prefixCls.value}`;
|
|
20
|
-
const cssVar = tokenValueToCssVar(
|
|
21
|
-
token.value,
|
|
22
|
-
configContext.prefixCls.value
|
|
23
|
-
);
|
|
16
|
+
const cssVar = tokenValueToCssVar(token.value, configContext.prefixCls.value);
|
|
24
17
|
return styleFn({
|
|
25
18
|
...cssVar,
|
|
26
19
|
componentCls,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import type { CSSInterpolation } from '../cssinjs';
|
|
3
3
|
import type { ComponentTokenMap, GlobalToken, TokenWithCommonCls } from './interface';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeManager } from './theme-context';
|
|
5
5
|
export type OverrideTokenWithoutDerivative = ComponentTokenMap;
|
|
6
6
|
export type OverrideComponent = keyof OverrideTokenWithoutDerivative;
|
|
7
7
|
export type GlobalTokenWithComponent<ComponentName extends OverrideComponent> = GlobalToken & ComponentTokenMap[ComponentName];
|
|
@@ -11,6 +11,6 @@ export interface StyleInfo<ComponentName extends OverrideComponent> {
|
|
|
11
11
|
overrideComponentToken: ComponentTokenMap[ComponentName];
|
|
12
12
|
}
|
|
13
13
|
export type FullToken<ComponentName extends OverrideComponent> = TokenWithCommonCls<GlobalTokenWithComponent<ComponentName>>;
|
|
14
|
-
export declare function getStyleHook<ComponentName extends OverrideComponent>(component: ComponentName, styleFn: (token: FullToken<ComponentName>, info: StyleInfo<ComponentName>) => CSSInterpolation, getDefaultToken?: OverrideTokenWithoutDerivative[ComponentName] | ((token: GlobalToken) => OverrideTokenWithoutDerivative[ComponentName])): (_prefixCls?: ComputedRef<string> | string,
|
|
14
|
+
export declare function getStyleHook<ComponentName extends OverrideComponent>(component: ComponentName, styleFn: (token: FullToken<ComponentName>, info: StyleInfo<ComponentName>) => CSSInterpolation, getDefaultToken?: OverrideTokenWithoutDerivative[ComponentName] | ((token: GlobalToken) => OverrideTokenWithoutDerivative[ComponentName])): (_prefixCls?: ComputedRef<string> | string, themeManager?: ThemeManager) => {
|
|
15
15
|
hashId: import("vue").Ref<string, string>;
|
|
16
16
|
};
|
|
@@ -5,16 +5,12 @@ import { tokenValueToCssVar } from './util/tokenValueToCssVar.js';
|
|
|
5
5
|
import { useConfig } from '../config-provider/config-provider.js';
|
|
6
6
|
|
|
7
7
|
function getStyleHook(component, styleFn, getDefaultToken) {
|
|
8
|
-
return (_prefixCls = "",
|
|
8
|
+
return (_prefixCls = "", themeManager) => {
|
|
9
9
|
const prefixCls = computed(() => unref(_prefixCls));
|
|
10
|
-
const { token, hashId } = useToken(
|
|
10
|
+
const { token, hashId } = useToken(themeManager);
|
|
11
11
|
const configContext = useConfig();
|
|
12
12
|
useStyleRegister(
|
|
13
|
-
computed(() =>
|
|
14
|
-
path: [component, prefixCls.value],
|
|
15
|
-
token: token.value,
|
|
16
|
-
hashId: hashId.value
|
|
17
|
-
})),
|
|
13
|
+
computed(() => ["__default", component, prefixCls.value]),
|
|
18
14
|
() => {
|
|
19
15
|
const componentCls = `.${prefixCls.value}`;
|
|
20
16
|
const defaultComponentToken = typeof getDefaultToken === "function" ? getDefaultToken(token.value) : getDefaultToken;
|
|
@@ -26,10 +22,7 @@ function getStyleHook(component, styleFn, getDefaultToken) {
|
|
|
26
22
|
...token.value,
|
|
27
23
|
...mergedComponentToken
|
|
28
24
|
};
|
|
29
|
-
const cssVar = tokenValueToCssVar(
|
|
30
|
-
mergedToken,
|
|
31
|
-
configContext.prefixCls.value
|
|
32
|
-
);
|
|
25
|
+
const cssVar = tokenValueToCssVar(mergedToken, configContext.prefixCls.value);
|
|
33
26
|
return styleFn(
|
|
34
27
|
{
|
|
35
28
|
...cssVar,
|
|
@@ -11,6 +11,7 @@ import { getSimpleStyleHook } from './getSimpleStyleHook';
|
|
|
11
11
|
import { useThemeProvide, type ThemeConfig } from './theme-context';
|
|
12
12
|
import { extractCacheStyle, extractStyle } from './extractStyle';
|
|
13
13
|
import { StyleCache, StyleProvider } from './StyleContext';
|
|
14
|
+
import { getOverrideStyleHook } from './getOverrideStyleHook';
|
|
14
15
|
type GenerateStyle<ComponentToken extends object = AliasToken, ReturnType = CSSInterpolation> = (token: ComponentToken) => ReturnType;
|
|
15
|
-
export { seedToken, useToken, defaultAlgorithm, darkAlgorithm, compactAlgorithm, getStyleHook, getSimpleStyleHook, getGlobalStyleHook, useThemeProvide, defaultGenerateColorPalettes, darkGenerateColorPalettes, extractStyle, extractCacheStyle, StyleCache, StyleProvider, };
|
|
16
|
+
export { seedToken, useToken, defaultAlgorithm, darkAlgorithm, compactAlgorithm, getStyleHook, getSimpleStyleHook, getGlobalStyleHook, getOverrideStyleHook, useThemeProvide, defaultGenerateColorPalettes, darkGenerateColorPalettes, extractStyle, extractCacheStyle, StyleCache, StyleProvider, };
|
|
16
17
|
export type { SeedToken, MapToken, AliasToken, GlobalToken, GenerateStyle, FullToken, ThemeConfig, ComponentTokenMap, TokenWithCommonCls, };
|
|
@@ -9,5 +9,6 @@ export { getSimpleStyleHook } from './getSimpleStyleHook.js';
|
|
|
9
9
|
export { useThemeProvide } from './theme-context.js';
|
|
10
10
|
export { extractCacheStyle, extractStyle } from './extractStyle.js';
|
|
11
11
|
export { StyleCache, StyleProvider } from './StyleContext.js';
|
|
12
|
+
export { getOverrideStyleHook } from './getOverrideStyleHook.js';
|
|
12
13
|
export { generateColorPalettes as darkGenerateColorPalettes } from './themes/dark/colors.js';
|
|
13
14
|
export { generateColorPalettes as defaultGenerateColorPalettes } from './themes/default/colors.js';
|
|
@@ -4,7 +4,7 @@ export type { AliasToken } from './alias';
|
|
|
4
4
|
export type { ComponentTokenMap } from './components';
|
|
5
5
|
export type { ColorMapToken, ColorNeutralMapToken, CommonMapToken, FontMapToken, HeightMapToken, MapToken, SizeMapToken, StyleMapToken, } from './maps';
|
|
6
6
|
export { PresetColors } from './presetColors';
|
|
7
|
-
export type { ColorPalettes, PresetColorKey, PresetColorType
|
|
7
|
+
export type { ColorPalettes, PresetColorKey, PresetColorType } from './presetColors';
|
|
8
8
|
export type { SeedToken } from './seeds';
|
|
9
9
|
export type OverrideToken = {
|
|
10
10
|
[key in keyof ComponentTokenMap]: Partial<ComponentTokenMap[key]> & Partial<AliasToken>;
|
|
@@ -8,6 +8,15 @@ export interface ThemeConfig {
|
|
|
8
8
|
algorithm?: MappingAlgorithm | MappingAlgorithm[];
|
|
9
9
|
inherit?: boolean;
|
|
10
10
|
}
|
|
11
|
+
export declare class ThemeManager {
|
|
12
|
+
theme?: ComputedRef<ThemeConfig | undefined>;
|
|
13
|
+
overrideStyles: Record<string, HTMLStyleElement | null | undefined>;
|
|
14
|
+
style: HTMLStyleElement | null | undefined;
|
|
15
|
+
constructor(theme?: ComputedRef<ThemeConfig | undefined>);
|
|
16
|
+
setStyle(styleStr: string, hashId: string): void;
|
|
17
|
+
setOverrideStyle(styleStr: string, pathHash: string, hashId: string): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
11
20
|
export type ThemeContext = ComputedRef<ThemeConfig | undefined>;
|
|
12
|
-
export declare const useThemeProvide: (
|
|
13
|
-
export declare const useTheme: () =>
|
|
21
|
+
export declare const useThemeProvide: (themeManager: ThemeManager) => void;
|
|
22
|
+
export declare const useTheme: (themeManager?: ThemeManager) => ThemeManager;
|
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, provide } from 'vue';
|
|
2
|
+
import { updateCSSByStyle } from '../../utils/dynamicCSS.js';
|
|
2
3
|
|
|
4
|
+
class ThemeManager {
|
|
5
|
+
theme;
|
|
6
|
+
overrideStyles = {};
|
|
7
|
+
style = null;
|
|
8
|
+
constructor(theme) {
|
|
9
|
+
this.theme = theme;
|
|
10
|
+
}
|
|
11
|
+
setStyle(styleStr, hashId) {
|
|
12
|
+
this.style = updateCSSByStyle(this.style, styleStr, hashId);
|
|
13
|
+
}
|
|
14
|
+
setOverrideStyle(styleStr, pathHash, hashId) {
|
|
15
|
+
this.overrideStyles[pathHash] = updateCSSByStyle(
|
|
16
|
+
this.overrideStyles[pathHash],
|
|
17
|
+
styleStr,
|
|
18
|
+
hashId
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
destroy() {
|
|
22
|
+
this.style?.remove();
|
|
23
|
+
Object.values(this.overrideStyles).forEach((style) => {
|
|
24
|
+
style?.remove();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
3
28
|
const themeContextKey = Symbol("themeContext");
|
|
4
|
-
const useThemeProvide = (
|
|
5
|
-
provide(themeContextKey,
|
|
29
|
+
const useThemeProvide = (themeManager) => {
|
|
30
|
+
provide(themeContextKey, themeManager);
|
|
6
31
|
};
|
|
7
|
-
|
|
8
|
-
|
|
32
|
+
let defaultTheme = void 0;
|
|
33
|
+
const useTheme = (themeManager) => {
|
|
34
|
+
let mergedThemeManager = themeManager || inject(themeContextKey, defaultTheme);
|
|
35
|
+
if (!mergedThemeManager) {
|
|
36
|
+
mergedThemeManager = defaultTheme = new ThemeManager();
|
|
37
|
+
}
|
|
38
|
+
return mergedThemeManager;
|
|
9
39
|
};
|
|
10
40
|
|
|
11
|
-
export { useTheme, useThemeProvide };
|
|
41
|
+
export { ThemeManager, useTheme, useThemeProvide };
|
|
@@ -15,10 +15,7 @@ function genColorMapToken(seed, { generateColorPalettes, generateNeutralColorPal
|
|
|
15
15
|
const warningColors = generateColorPalettes(colorWarningBase);
|
|
16
16
|
const errorColors = generateColorPalettes(colorErrorBase);
|
|
17
17
|
const infoColors = generateColorPalettes(colorInfoBase);
|
|
18
|
-
const neutralColors = generateNeutralColorPalettes(
|
|
19
|
-
colorBgBase,
|
|
20
|
-
colorTextBase
|
|
21
|
-
);
|
|
18
|
+
const neutralColors = generateNeutralColorPalettes(colorBgBase, colorTextBase);
|
|
22
19
|
const colorLink = seed.colorLink || seed.colorInfo;
|
|
23
20
|
const linkColors = generateColorPalettes(colorLink);
|
|
24
21
|
const colorErrorBgFilledHover = new TinyColor(errorColors[1]).mix(new TinyColor(errorColors[3]), 50).toHexString();
|