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.
Files changed (321) hide show
  1. package/components/audio-card/audio-card.vue.js +1 -1
  2. package/components/audio-card/style/index.d.ts +1 -1
  3. package/components/audio-viewer/style/index.d.ts +1 -1
  4. package/components/close/close.vue.js +1 -1
  5. package/components/close/style/index.d.ts +1 -1
  6. package/components/col/style/index.d.ts +1 -1
  7. package/components/col/style/index.js +1 -1
  8. package/components/components.d.ts +98 -44
  9. package/components/config-provider/config-provider.js +1 -3
  10. package/components/config-provider/config-provider.vue.d.ts +2 -7
  11. package/components/config-provider/config-provider.vue.js +8 -4
  12. package/components/config-provider/index.d.ts +1 -1
  13. package/components/config-provider/override-element-plus.d.ts +3 -2
  14. package/components/config-provider/override-element-plus.js +2 -2
  15. package/components/container/container.d.ts +0 -1
  16. package/components/container/container.vue.js +0 -4
  17. package/components/container/style/index.d.ts +1 -1
  18. package/components/context-menu/content.vue.js +1 -1
  19. package/components/context-menu/context-menu.vue.js +2 -2
  20. package/components/context-menu/style/index.d.ts +1 -1
  21. package/components/copy/copy.d.ts +0 -2
  22. package/components/copy/copy.vue.d.ts +1 -7
  23. package/components/copy/copy.vue.js +1 -2
  24. package/components/copy/index.d.ts +3 -19
  25. package/components/copy/style/index.d.ts +1 -1
  26. package/components/cssinjs/parser.js +8 -25
  27. package/components/dnd-sort/dnd-sort-item.vue.js +3 -4
  28. package/components/dnd-sort/dnd-sort.vue.js +1 -2
  29. package/components/dnd-sort/index.d.ts +1 -1
  30. package/components/dnd-sort/style/index.d.ts +1 -1
  31. package/components/dnd-sort/style/index.js +1 -0
  32. package/components/editor/components/button-group.vue.d.ts +2 -7
  33. package/components/editor/components/button.vue.d.ts +2 -7
  34. package/components/editor/components/color-picker/color-picker.style.d.ts +1 -1
  35. package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
  36. package/components/editor/components/color-picker/color-picker.vue.js +14 -11
  37. package/components/editor/components/list/list.style.d.ts +1 -1
  38. package/components/editor/components/picker/picker.style.d.ts +1 -1
  39. package/components/editor/components/picker/picker.vue.d.ts +2 -15
  40. package/components/editor/components/resize/resize.js +4 -4
  41. package/components/editor/components/resize/resize.style.d.ts +1 -1
  42. package/components/editor/components/resize/resize.style.js +9 -32
  43. package/components/editor/components/resize/resize.vue.js +21 -14
  44. package/components/editor/components/select-button.vue.d.ts +2 -9
  45. package/components/editor/components/select-button.vue.js +1 -1
  46. package/components/editor/components/split-button.vue.d.ts +2 -19
  47. package/components/editor/components/split-button.vue.js +1 -1
  48. package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +1 -1
  49. package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
  50. package/components/editor/components/toolbar/formats/align.vue.js +4 -4
  51. package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
  52. package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
  53. package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
  54. package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
  55. package/components/editor/components/toolbar/formats/code.vue.js +1 -1
  56. package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
  57. package/components/editor/components/toolbar/formats/image.vue.js +1 -1
  58. package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
  59. package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
  60. package/components/editor/components/toolbar/formats/link.vue.js +15 -13
  61. package/components/editor/components/toolbar/formats/list.vue.js +3 -3
  62. package/components/editor/components/toolbar/formats/script.vue.js +2 -2
  63. package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
  64. package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
  65. package/components/editor/components/toolbar/formats/table.style.d.ts +1 -1
  66. package/components/editor/components/toolbar/formats/table.vue.js +1 -1
  67. package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
  68. package/components/editor/components/toolbar/formats/video.vue.js +1 -1
  69. package/components/editor/components/toolbar/toolbar.d.ts +1 -2
  70. package/components/editor/components/toolbar/toolbar.js +17 -21
  71. package/components/editor/components/toolbar/toolbarContext.js +1 -3
  72. package/components/editor/editor.d.ts +0 -2
  73. package/components/editor/editor.vue.js +1 -11
  74. package/components/editor/formats/image.d.ts +13 -0
  75. package/components/editor/formats/image.js +46 -0
  76. package/components/editor/formats/indent.d.ts +2 -0
  77. package/components/editor/formats/indent.js +12 -7
  78. package/components/editor/formats/link.js +1 -5
  79. package/components/editor/formats/list.d.ts +0 -4
  80. package/components/editor/formats/list.js +10 -5
  81. package/components/editor/formats/video.js +6 -9
  82. package/components/editor/modules/custom-list.js +1 -6
  83. package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +1 -1
  84. package/components/editor/modules/image-uploader/formats/image-loading.style.js +4 -4
  85. package/components/editor/modules/image-uploader/image-uploader.js +1 -3
  86. package/components/editor/quill.js +7 -4
  87. package/components/editor/quillContext.js +1 -3
  88. package/components/editor/style/hljs.d.ts +1 -1
  89. package/components/editor/style/index.d.ts +1 -1
  90. package/components/editor/style/index.js +1 -5
  91. package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
  92. package/components/field/components/checkbox-group/panel.vue.js +2 -2
  93. package/components/field/components/tree-select/tree-select.d.ts +1 -2
  94. package/components/field/components/tree-select/tree-select.js +69 -0
  95. package/components/file-card/file-card.vue.js +1 -1
  96. package/components/file-card/style/index.d.ts +1 -1
  97. package/components/form/form-item.vue.js +1 -1
  98. package/components/form/style/index.d.ts +1 -1
  99. package/components/form/useFormItemWidth.js +1 -1
  100. package/components/form/useFormTemplate.js +2 -10
  101. package/components/form-dialog/form-dialog.vue.d.ts +0 -1
  102. package/components/form-dialog/form-dialog.vue.js +1 -1
  103. package/components/form-dialog/index.d.ts +0 -3
  104. package/components/form-group/form-group.vue.js +1 -1
  105. package/components/form-list/form-list.js +1 -6
  106. package/components/form-list/form-list.vue.js +2 -2
  107. package/components/form-list/style/index.d.ts +1 -1
  108. package/components/form-query/form-query.vue.js +5 -5
  109. package/components/form-query/style/index.d.ts +1 -1
  110. package/components/highlight/highlight.d.ts +1 -1
  111. package/components/highlight/highlight.vue.js +11 -4
  112. package/components/highlight/style/index.d.ts +1 -1
  113. package/components/highlight/style/index.js +15 -5
  114. package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
  115. package/components/horizontal-tree/style/index.d.ts +1 -1
  116. package/components/icon/style/index.d.ts +1 -1
  117. package/components/iconify-icon/iconify-icon.d.ts +3 -0
  118. package/components/iconify-icon/iconify-icon.js +9 -0
  119. package/components/iconify-icon/iconify-icon.vue.js +2 -5
  120. package/components/iconify-icon/index.js +1 -0
  121. package/components/image-card/style/index.d.ts +1 -1
  122. package/components/index.js +4 -2
  123. package/components/long-text/style/index.d.ts +1 -1
  124. package/components/mask/style/index.d.ts +1 -1
  125. package/components/media-card-group/media-card-group.vue.js +4 -3
  126. package/components/media-card-group/style/index.d.ts +1 -1
  127. package/components/panel/style/index.d.ts +1 -1
  128. package/components/row/style/index.d.ts +1 -1
  129. package/components/scroll-view/scroll-view.vue.js +1 -2
  130. package/components/scroll-view/style/index.d.ts +1 -1
  131. package/components/snug-menu/snug-menu.vue.js +1 -2
  132. package/components/snug-menu/style/index.d.ts +1 -1
  133. package/components/style/animation.d.ts +5 -0
  134. package/components/style/animation.js +33 -0
  135. package/components/style/index.d.ts +1 -1
  136. package/components/style/index.js +2 -2
  137. package/components/style/mixins.d.ts +2 -0
  138. package/components/style/mixins.js +10 -1
  139. package/components/table/index.d.ts +0 -8
  140. package/components/table/style/index.d.ts +1 -1
  141. package/components/table/style/index.js +2 -2
  142. package/components/table/table-column/renderer.js +22 -18
  143. package/components/table/table-column/style/index.d.ts +1 -1
  144. package/components/table/table-column/table-column.vue.d.ts +3 -3
  145. package/components/table/table-column-editor/item.vue.js +5 -8
  146. package/components/table/table-column-editor/style/index.d.ts +1 -1
  147. package/components/table/table-column-editor/style/index.js +1 -0
  148. package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
  149. package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
  150. package/components/table/table-export/style/index.d.ts +1 -1
  151. package/components/table/table-export/table-export.vue.js +2 -2
  152. package/components/table/table-query/table-query.d.ts +0 -4
  153. package/components/table/table-query/table-query.js +0 -4
  154. package/components/table/table-query/table-query.vue.d.ts +0 -9
  155. package/components/table/table-query/table-query.vue.js +14 -12
  156. package/components/table/table.js +1 -3
  157. package/components/table/table.vue.js +22 -24
  158. package/components/table/useTable.js +1 -4
  159. package/components/table/utils.js +1 -3
  160. package/components/table-action/item.vue.js +5 -5
  161. package/components/table-action/style/index.d.ts +1 -1
  162. package/components/table-action/table-action.vue.js +4 -3
  163. package/components/theme/StyleContext.js +1 -3
  164. package/components/theme/createCacheToken.js +1 -4
  165. package/components/theme/getGlobalStyleHook.d.ts +2 -3
  166. package/components/theme/getGlobalStyleHook.js +5 -13
  167. package/components/theme/getOverrideStyleHook.d.ts +8 -0
  168. package/components/theme/getOverrideStyleHook.js +39 -0
  169. package/components/theme/getSimpleStyleHook.d.ts +2 -2
  170. package/components/theme/getSimpleStyleHook.js +4 -11
  171. package/components/theme/getStyleHook.d.ts +2 -2
  172. package/components/theme/getStyleHook.js +4 -11
  173. package/components/theme/index.d.ts +2 -1
  174. package/components/theme/index.js +1 -0
  175. package/components/theme/interface/index.d.ts +1 -1
  176. package/components/theme/theme-context.d.ts +11 -2
  177. package/components/theme/theme-context.js +36 -6
  178. package/components/theme/themes/shared/genColorMapToken.js +1 -4
  179. package/components/theme/useStyleRegister.d.ts +1 -7
  180. package/components/theme/useStyleRegister.js +3 -6
  181. package/components/theme/util/alias.js +4 -16
  182. package/components/theme/util/getAlphaColor.js +1 -6
  183. package/components/theme/util/normalizeStyle.js +1 -1
  184. package/components/theme/util/statistic.js +4 -1
  185. package/components/theme/util/useToken.d.ts +4 -4
  186. package/components/theme/util/useToken.js +7 -10
  187. package/components/toggle/toggle.vue.js +1 -1
  188. package/components/transition/style/index.d.ts +1 -1
  189. package/components/transition/transition.vue.js +1 -2
  190. package/components/transition-group/index.d.ts +3 -3
  191. package/components/transition-group/style/index.d.ts +1 -1
  192. package/components/transition-group/transition-group.vue.d.ts +1 -1
  193. package/components/upload/index.d.ts +0 -3
  194. package/components/upload/style/index.d.ts +1 -1
  195. package/components/upload/upload-item.vue.js +8 -8
  196. package/components/upload/upload.d.ts +0 -2
  197. package/components/upload/upload.js +0 -1
  198. package/components/upload/upload.vue.d.ts +0 -1
  199. package/components/upload/upload.vue.js +1 -5
  200. package/components/video-card/style/index.d.ts +1 -1
  201. package/components/video-card/video-card.vue.js +1 -1
  202. package/components/video-viewer/style/index.d.ts +1 -1
  203. package/config/http.d.ts +1 -1
  204. package/config/http.js +1 -1
  205. package/config/index.d.ts +23 -22
  206. package/config/index.js +2 -7
  207. package/config/layout.d.ts +36 -0
  208. package/config/layout.js +37 -1
  209. package/config/nprogress.style.d.ts +2 -0
  210. package/config/nprogress.style.js +51 -0
  211. package/config/root-config-provider.vue.d.ts +2 -20
  212. package/config/root-config-provider.vue.js +2 -0
  213. package/hooks/useColorScheme.js +5 -9
  214. package/hooks/useEcharts.js +2 -4
  215. package/hooks/useFetch.d.ts +1 -1
  216. package/hooks/useFetch.js +1 -7
  217. package/hooks/useFullPage.js +7 -9
  218. package/hooks/useLocale.js +1 -3
  219. package/hooks/useLockscreenObserver.js +1 -1
  220. package/hooks/usePersist.js +1 -3
  221. package/hooks/useTreeCheck.js +13 -26
  222. package/hooks/useUpsert.d.ts +15 -16
  223. package/hooks/useUpsert.js +3 -3
  224. package/index.d.ts +1 -0
  225. package/index.js +5 -4
  226. package/layout/index.js +2 -2
  227. package/layout/layout-aside/layout-aside.vue.js +2 -1
  228. package/layout/layout-aside/style/index.d.ts +1 -1
  229. package/layout/layout-auth/style/index.d.ts +1 -1
  230. package/layout/layout-base/layout-base.vue.js +9 -9
  231. package/layout/layout-base/style/index.d.ts +1 -1
  232. package/layout/layout-brand/style/index.d.ts +1 -1
  233. package/layout/layout-change-password/layout-change-password.vue.js +8 -8
  234. package/layout/layout-change-password/style/index.d.ts +1 -1
  235. package/layout/layout-change-password/style/index.js +1 -1
  236. package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
  237. package/layout/layout-color-scheme/style/index.d.ts +2 -5
  238. package/layout/layout-color-scheme/style/index.js +26 -44
  239. package/layout/layout-content/layout-content.vue.d.ts +2 -13
  240. package/layout/layout-content/style/index.d.ts +1 -1
  241. package/layout/layout-exception/style/index.d.ts +1 -1
  242. package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
  243. package/layout/layout-header/layout-header.vue.d.ts +2 -14
  244. package/layout/layout-header/style/index.d.ts +1 -1
  245. package/layout/layout-iframe/style/index.d.ts +1 -1
  246. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
  247. package/layout/layout-login/layout-login.vue.js +5 -5
  248. package/layout/layout-login/style/index.d.ts +1 -1
  249. package/layout/layout-login/style/index.js +1 -1
  250. package/layout/layout-main/style/index.d.ts +1 -1
  251. package/layout/layout-mask/style/index.d.ts +1 -1
  252. package/layout/layout-mask/style/index.js +1 -1
  253. package/layout/layout-menu/layout-menu.vue.js +5 -0
  254. package/layout/layout-menu/style/index.d.ts +1 -1
  255. package/layout/layout-not-found/layout-not-found.vue.js +2 -2
  256. package/layout/layout-search/layout-search.vue.js +37 -34
  257. package/layout/layout-search/style/index.d.ts +1 -1
  258. package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
  259. package/layout/layout-sidebar/style/index.d.ts +1 -1
  260. package/layout/layout-sidebar/style/index.js +1 -1
  261. package/layout/layout-snug-aside/style/index.d.ts +1 -1
  262. package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
  263. package/layout/layout-switch-effect/style/index.d.ts +1 -1
  264. package/layout/layout-tabbar/layout-tabbar.vue.js +8 -3
  265. package/layout/layout-tabbar/reload.vue.js +1 -1
  266. package/layout/layout-tabbar/style/index.d.ts +1 -1
  267. package/layout/layout-tabbar/style/index.js +6 -2
  268. package/layout/layout-toggle/layout-toggle.vue.js +1 -1
  269. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
  270. package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
  271. package/layout/layout-topbar/style/index.d.ts +1 -1
  272. package/layout/layout-user-menu/index.d.ts +1 -0
  273. package/layout/layout-user-menu/index.js +1 -0
  274. package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
  275. package/layout/{layout-user → layout-user-menu}/style/index.d.ts +1 -1
  276. package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
  277. package/layout/layout.d.ts +1 -1
  278. package/layout/layout.js +1 -1
  279. package/layout/merged/index.d.ts +1 -1
  280. package/layout/merged/index.js +1 -1
  281. package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
  282. package/layout/utils.js +1 -4
  283. package/package.json +16 -6
  284. package/request/useRequest.js +1 -1
  285. package/router/guard/auth.js +2 -5
  286. package/router/guard/index.js +2 -2
  287. package/router/guard/pageTitle.d.ts +2 -0
  288. package/router/guard/pageTitle.js +11 -0
  289. package/router/guard/progress.js +11 -1
  290. package/router/index.d.ts +22 -0
  291. package/router/index.js +1 -1
  292. package/router/routes/static/auth.js +5 -6
  293. package/router/routes/static/exception.js +3 -3
  294. package/router/utils.js +11 -3
  295. package/store/layout.d.ts +4 -10
  296. package/store/layout.js +19 -31
  297. package/store/user.d.ts +4 -4
  298. package/store/user.js +2 -1
  299. package/utils/array.js +3 -0
  300. package/utils/dynamicCSS.d.ts +3 -2
  301. package/utils/dynamicCSS.js +12 -1
  302. package/utils/excel/index.js +1 -3
  303. package/utils/excel/utils.js +1 -5
  304. package/utils/file.js +1 -3
  305. package/utils/index.js +1 -1
  306. package/utils/object.js +1 -3
  307. package/utils/tree.js +2 -11
  308. package/utils/vue.js +1 -1
  309. package/components/global.d.js +0 -1
  310. package/components/style/motion/index.d.ts +0 -1
  311. package/components/style/motion/index.js +0 -1
  312. package/components/style/motion/loading.d.ts +0 -3
  313. package/components/style/motion/loading.js +0 -23
  314. package/layout/layout-user/index.d.ts +0 -1
  315. package/layout/layout-user/index.js +0 -1
  316. package/router/guard/popup.d.ts +0 -2
  317. package/router/guard/popup.js +0 -6
  318. package/types/vue-router.d.js +0 -1
  319. package/types/vue.d.js +0 -1
  320. /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
  321. /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
@@ -7,10 +7,6 @@ export declare const tableQueryProps: {
7
7
  type: PropType<FormItemProps<FieldType>[]>;
8
8
  default: () => never[];
9
9
  };
10
- modelValue: {
11
- type: ObjectConstructor;
12
- default: () => {};
13
- };
14
10
  grid: {
15
11
  type: BooleanConstructor;
16
12
  default: boolean;
@@ -5,10 +5,6 @@ const tableQueryExtraProps = {
5
5
  schemes: {
6
6
  type: Array,
7
7
  default: () => []
8
- },
9
- modelValue: {
10
- type: Object,
11
- default: () => ({})
12
8
  }
13
9
  };
14
10
  const tableQueryProps = {
@@ -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
- props.modelValue[item.prop] = item.modelValue;
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(props.modelValue);
33
+ return cloneDeep(formModel);
33
34
  },
34
35
  setFieldsValue(value) {
35
- Object.assign(props.modelValue, value);
36
+ Object.assign(formModel, value);
36
37
  },
37
38
  getFormModel() {
38
- return props.modelValue;
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: _ctx.modelValue,
47
- onKeyup: withKeys(withModifiers(onEnter, ["prevent"]), ["enter", "native"])
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: _ctx.modelValue[item.prop],
54
- "onUpdate:modelValue": $event => _ctx.modelValue[item.prop] = $event
55
+ modelValue: formModel[item.prop],
56
+ "onUpdate:modelValue": $event => formModel[item.prop] = $event
55
57
  }), null, 16, ["modelValue", "onUpdate:modelValue"]);
56
- }), 256
57
- /* UNKEYED_FRAGMENT */))]),
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(formModel.value)
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, ["modelValue"])], 2
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
- link: ""
252
+ circle: ""
255
253
  }, {
256
254
  default: withCtx(() => [createVNode(stdin_default$3, {
257
- name: "mdi:refresh",
258
- size: "xl",
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
- link: "",
277
- onClick: _cache[1] || (_cache[1] = $event => exportVisible.value = true)
274
+ circle: "",
275
+ onClick: _cache[0] || (_cache[0] = $event => exportVisible.value = true)
278
276
  }, {
279
277
  default: withCtx(() => [createVNode(stdin_default$3, {
280
- name: "mdi:download-outline",
281
- size: "xl"
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[2] || (_cache[2] = $event => exportVisible.value = $event),
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
- link: "",
299
+ circle: "",
302
300
  onClick: onFullScreen
303
301
  }, {
304
302
  default: withCtx(() => [createVNode(stdin_default$3, {
305
- name: unref(isFullPage) ? "mdi:fullscreen-exit" : "mdi:fullscreen",
306
- size: "xl"
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
- link: "",
321
- ref: "setting-ref"
318
+ ref: "setting-ref",
319
+ circle: ""
322
320
  }, {
323
321
  default: withCtx(() => [createVNode(stdin_default$3, {
324
- name: "mdi:cog-outline",
325
- size: "xl"
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[3] || (_cache[3] = $event => renderedColumns.value = $event),
336
- "virtual-ref": unref(settingRef),
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[4] || (_cache[4] = $event => page.value = $event),
373
+ "onUpdate:currentPage": _cache[3] || (_cache[3] = $event => page.value = $event),
376
374
  "page-size": pageSize.value,
377
- "onUpdate:pageSize": _cache[5] || (_cache[5] = $event => pageSize.value = $event),
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",
@@ -15,10 +15,7 @@ function useTable(props) {
15
15
  props
16
16
  );
17
17
  });
18
- const expose = createMergedExpose(
19
- tableExposeKeys,
20
- () => tableRef
21
- );
18
+ const expose = createMergedExpose(tableExposeKeys, () => tableRef);
22
19
  return [mergedProps, expose];
23
20
  }
24
21
 
@@ -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(" \u5426 ")])),
68
- _: 2
69
- /* DYNAMIC */
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
- /* DYNAMIC */
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, theme?: import("vue").ComputedRef<import("../..").ThemeConfig | undefined>) => {
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
- }), 256
35
- /* UNKEYED_FRAGMENT */))], 2
35
+ }), 128
36
+ /* KEYED_FRAGMENT */))], 2
36
37
  /* CLASS */);
37
38
  };
38
39
  }
@@ -12,9 +12,7 @@ class StyleCache {
12
12
  return this.cache.has(key);
13
13
  }
14
14
  }
15
- const styleContextKey = Symbol(
16
- "styleContext"
17
- );
15
+ const styleContextKey = Symbol("styleContext");
18
16
  function useStyleProvider(context) {
19
17
  provide(styleContextKey, context);
20
18
  }
@@ -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 { ThemeConfig } from './theme-context';
5
- export declare function getGlobalStyleHook(component: string, styleFn: (token: AliasToken) => CSSInterpolation): (theme?: ComputedRef<ThemeConfig | undefined>) => void;
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
- let oldGlobalClass = /* @__PURE__ */ new Set();
9
+ const oldGlobalClass = /* @__PURE__ */ new Set();
10
10
  function getGlobalStyleHook(component, styleFn) {
11
- return (theme) => {
12
- const { token, hashId } = useToken(theme);
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 { ThemeConfig } from './theme-context';
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, theme?: ComputedRef<ThemeConfig | undefined>) => {
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 = "", theme) => {
8
+ return (_prefixCls = "", themeManager) => {
9
9
  const prefixCls = computed(() => unref(_prefixCls));
10
- const { token, hashId } = useToken(theme);
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 { ThemeConfig } from './theme-context';
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, theme?: ComputedRef<ThemeConfig | undefined>) => {
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 = "", theme) => {
8
+ return (_prefixCls = "", themeManager) => {
9
9
  const prefixCls = computed(() => unref(_prefixCls));
10
- const { token, hashId } = useToken(theme);
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, } from './presetColors';
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: (theme: ComputedRef<ThemeConfig | undefined>) => void;
13
- export declare const useTheme: () => ThemeContext | null;
21
+ export declare const useThemeProvide: (themeManager: ThemeManager) => void;
22
+ export declare const useTheme: (themeManager?: ThemeManager) => ThemeManager;
@@ -1,11 +1,41 @@
1
- import { provide, inject } from 'vue';
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 = (theme) => {
5
- provide(themeContextKey, theme);
29
+ const useThemeProvide = (themeManager) => {
30
+ provide(themeContextKey, themeManager);
6
31
  };
7
- const useTheme = () => {
8
- return inject(themeContextKey, null);
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();