cosey 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/components/audio-card/audio-card.vue.js +1 -1
  2. package/components/close/close.vue.js +1 -1
  3. package/components/components.d.ts +98 -44
  4. package/components/config-provider/config-provider.js +1 -3
  5. package/components/config-provider/config-provider.vue.d.ts +2 -7
  6. package/components/config-provider/index.d.ts +1 -1
  7. package/components/context-menu/content.vue.js +1 -1
  8. package/components/context-menu/context-menu.vue.js +2 -2
  9. package/components/copy/copy.vue.js +1 -1
  10. package/components/cssinjs/parser.js +8 -25
  11. package/components/dnd-sort/dnd-sort-item.vue.js +2 -3
  12. package/components/dnd-sort/dnd-sort.vue.js +1 -2
  13. package/components/dnd-sort/index.d.ts +1 -1
  14. package/components/editor/components/button-group.vue.d.ts +2 -7
  15. package/components/editor/components/button.vue.d.ts +2 -7
  16. package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
  17. package/components/editor/components/color-picker/color-picker.vue.js +14 -11
  18. package/components/editor/components/picker/picker.vue.d.ts +2 -15
  19. package/components/editor/components/resize/resize.js +4 -4
  20. package/components/editor/components/resize/resize.style.js +9 -32
  21. package/components/editor/components/resize/resize.vue.js +21 -14
  22. package/components/editor/components/select-button.vue.d.ts +2 -9
  23. package/components/editor/components/select-button.vue.js +1 -1
  24. package/components/editor/components/split-button.vue.d.ts +2 -19
  25. package/components/editor/components/split-button.vue.js +1 -1
  26. package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
  27. package/components/editor/components/toolbar/formats/align.vue.js +4 -4
  28. package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
  29. package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
  30. package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
  31. package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
  32. package/components/editor/components/toolbar/formats/code.vue.js +1 -1
  33. package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
  34. package/components/editor/components/toolbar/formats/image.vue.js +1 -1
  35. package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
  36. package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
  37. package/components/editor/components/toolbar/formats/link.vue.js +15 -13
  38. package/components/editor/components/toolbar/formats/list.vue.js +3 -3
  39. package/components/editor/components/toolbar/formats/script.vue.js +2 -2
  40. package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
  41. package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
  42. package/components/editor/components/toolbar/formats/table.vue.js +1 -1
  43. package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
  44. package/components/editor/components/toolbar/formats/video.vue.js +1 -1
  45. package/components/editor/components/toolbar/toolbar.d.ts +1 -2
  46. package/components/editor/components/toolbar/toolbar.js +17 -21
  47. package/components/editor/components/toolbar/toolbarContext.js +1 -3
  48. package/components/editor/formats/image.d.ts +13 -0
  49. package/components/editor/formats/image.js +46 -0
  50. package/components/editor/formats/indent.d.ts +2 -0
  51. package/components/editor/formats/indent.js +12 -7
  52. package/components/editor/formats/link.js +1 -5
  53. package/components/editor/formats/list.d.ts +0 -4
  54. package/components/editor/formats/list.js +10 -5
  55. package/components/editor/formats/video.js +6 -9
  56. package/components/editor/modules/custom-list.js +1 -6
  57. package/components/editor/modules/image-uploader/formats/image-loading.style.js +3 -3
  58. package/components/editor/modules/image-uploader/image-uploader.js +1 -3
  59. package/components/editor/quill.js +7 -4
  60. package/components/editor/quillContext.js +1 -3
  61. package/components/editor/style/index.js +1 -5
  62. package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
  63. package/components/field/components/checkbox-group/panel.vue.js +2 -2
  64. package/components/field/components/tree-select/tree-select.d.ts +1 -2
  65. package/components/field/components/tree-select/tree-select.js +69 -0
  66. package/components/file-card/file-card.vue.js +1 -1
  67. package/components/form/form-item.vue.js +1 -1
  68. package/components/form/useFormItemWidth.js +1 -1
  69. package/components/form/useFormTemplate.js +2 -10
  70. package/components/form-dialog/form-dialog.vue.d.ts +0 -1
  71. package/components/form-dialog/form-dialog.vue.js +1 -1
  72. package/components/form-dialog/index.d.ts +0 -3
  73. package/components/form-group/form-group.vue.js +1 -1
  74. package/components/form-list/form-list.js +1 -6
  75. package/components/form-list/form-list.vue.js +2 -2
  76. package/components/form-query/form-query.vue.js +5 -5
  77. package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
  78. package/components/iconify-icon/iconify-icon.d.ts +3 -0
  79. package/components/iconify-icon/iconify-icon.js +9 -0
  80. package/components/iconify-icon/iconify-icon.vue.js +2 -5
  81. package/components/iconify-icon/index.js +1 -0
  82. package/components/index.js +3 -2
  83. package/components/media-card-group/media-card-group.vue.js +4 -3
  84. package/components/scroll-view/scroll-view.vue.js +1 -2
  85. package/components/snug-menu/snug-menu.vue.js +1 -2
  86. package/components/style/animation.d.ts +5 -0
  87. package/components/style/animation.js +33 -0
  88. package/components/style/index.d.ts +1 -1
  89. package/components/style/index.js +2 -2
  90. package/components/style/mixins.d.ts +2 -0
  91. package/components/style/mixins.js +10 -1
  92. package/components/table/index.d.ts +0 -8
  93. package/components/table/style/index.js +2 -2
  94. package/components/table/table-column/renderer.js +22 -18
  95. package/components/table/table-column-editor/item.vue.js +4 -7
  96. package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
  97. package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
  98. package/components/table/table-export/table-export.vue.js +2 -2
  99. package/components/table/table-query/table-query.d.ts +0 -4
  100. package/components/table/table-query/table-query.js +0 -4
  101. package/components/table/table-query/table-query.vue.d.ts +0 -9
  102. package/components/table/table-query/table-query.vue.js +14 -12
  103. package/components/table/table.js +1 -3
  104. package/components/table/table.vue.js +22 -24
  105. package/components/table/useTable.js +1 -4
  106. package/components/table/utils.js +1 -3
  107. package/components/table-action/item.vue.js +5 -5
  108. package/components/table-action/table-action.vue.js +4 -3
  109. package/components/theme/StyleContext.js +1 -3
  110. package/components/theme/createCacheToken.js +1 -4
  111. package/components/theme/getGlobalStyleHook.js +2 -5
  112. package/components/theme/getSimpleStyleHook.js +1 -4
  113. package/components/theme/getStyleHook.js +1 -4
  114. package/components/theme/interface/index.d.ts +1 -1
  115. package/components/theme/themes/shared/genColorMapToken.js +1 -4
  116. package/components/theme/useStyleRegister.js +1 -3
  117. package/components/theme/util/alias.js +4 -16
  118. package/components/theme/util/getAlphaColor.js +1 -6
  119. package/components/theme/util/normalizeStyle.js +1 -1
  120. package/components/theme/util/statistic.js +4 -1
  121. package/components/theme/util/useToken.js +1 -4
  122. package/components/toggle/toggle.vue.js +1 -1
  123. package/components/transition/transition.vue.js +1 -2
  124. package/components/upload/upload-item.vue.js +8 -8
  125. package/components/upload/upload.vue.js +1 -1
  126. package/components/video-card/video-card.vue.js +1 -1
  127. package/config/index.d.ts +1 -0
  128. package/config/index.js +2 -7
  129. package/config/layout.d.ts +36 -0
  130. package/config/layout.js +37 -1
  131. package/config/nprogress.style.d.ts +2 -0
  132. package/config/nprogress.style.js +51 -0
  133. package/config/root-config-provider.vue.d.ts +2 -20
  134. package/config/root-config-provider.vue.js +2 -0
  135. package/hooks/useColorScheme.js +5 -9
  136. package/hooks/useEcharts.js +2 -4
  137. package/hooks/useFetch.d.ts +1 -1
  138. package/hooks/useFetch.js +1 -7
  139. package/hooks/useFullPage.js +7 -9
  140. package/hooks/useLocale.js +1 -3
  141. package/hooks/useLockscreenObserver.js +1 -1
  142. package/hooks/usePersist.js +1 -3
  143. package/hooks/useTreeCheck.js +13 -26
  144. package/hooks/useUpsert.d.ts +3 -3
  145. package/index.d.ts +1 -0
  146. package/index.js +5 -4
  147. package/layout/index.js +2 -2
  148. package/layout/layout-aside/layout-aside.vue.js +2 -1
  149. package/layout/layout-base/layout-base.vue.js +1 -1
  150. package/layout/layout-change-password/layout-change-password.vue.js +8 -8
  151. package/layout/layout-change-password/style/index.js +1 -1
  152. package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
  153. package/layout/layout-color-scheme/style/index.d.ts +0 -3
  154. package/layout/layout-color-scheme/style/index.js +26 -44
  155. package/layout/layout-content/layout-content.vue.d.ts +2 -13
  156. package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
  157. package/layout/layout-header/layout-header.vue.d.ts +2 -14
  158. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
  159. package/layout/layout-login/layout-login.vue.js +5 -5
  160. package/layout/layout-login/style/index.js +1 -1
  161. package/layout/layout-mask/style/index.js +1 -1
  162. package/layout/layout-not-found/layout-not-found.vue.js +2 -2
  163. package/layout/layout-search/layout-search.vue.js +37 -34
  164. package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
  165. package/layout/layout-sidebar/style/index.js +1 -1
  166. package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
  167. package/layout/layout-tabbar/layout-tabbar.vue.js +2 -2
  168. package/layout/layout-tabbar/reload.vue.js +1 -1
  169. package/layout/layout-tabbar/style/index.js +2 -2
  170. package/layout/layout-toggle/layout-toggle.vue.js +1 -1
  171. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
  172. package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
  173. package/layout/layout-user-menu/index.d.ts +1 -0
  174. package/layout/layout-user-menu/index.js +1 -0
  175. package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
  176. package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
  177. package/layout/layout.d.ts +1 -1
  178. package/layout/layout.js +1 -1
  179. package/layout/merged/index.d.ts +1 -1
  180. package/layout/merged/index.js +1 -1
  181. package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
  182. package/layout/utils.js +1 -4
  183. package/package.json +16 -6
  184. package/request/useRequest.js +1 -1
  185. package/router/guard/auth.js +2 -5
  186. package/router/guard/index.js +0 -2
  187. package/router/guard/progress.js +11 -1
  188. package/router/index.d.ts +22 -0
  189. package/store/layout.d.ts +2 -8
  190. package/store/layout.js +19 -31
  191. package/store/user.d.ts +1 -1
  192. package/store/user.js +1 -1
  193. package/utils/array.js +3 -0
  194. package/utils/excel/index.js +1 -3
  195. package/utils/excel/utils.js +1 -5
  196. package/utils/file.js +1 -3
  197. package/utils/object.js +1 -3
  198. package/utils/tree.js +2 -11
  199. package/utils/vue.js +1 -1
  200. package/components/global.d.js +0 -1
  201. package/components/style/motion/index.d.ts +0 -1
  202. package/components/style/motion/index.js +0 -1
  203. package/components/style/motion/loading.d.ts +0 -3
  204. package/components/style/motion/loading.js +0 -23
  205. package/layout/layout-user/index.d.ts +0 -1
  206. package/layout/layout-user/index.js +0 -1
  207. package/router/guard/popup.d.ts +0 -2
  208. package/router/guard/popup.js +0 -6
  209. package/types/vue-router.d.js +0 -1
  210. package/types/vue.d.js +0 -1
  211. /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
  212. /package/layout/{layout-user → layout-user-menu}/style/index.d.ts +0 -0
  213. /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
@@ -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 */
@@ -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
  });
@@ -6,7 +6,7 @@ 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
11
  return (theme) => {
12
12
  const { token, hashId } = useToken(theme);
@@ -19,10 +19,7 @@ function getGlobalStyleHook(component, styleFn) {
19
19
  global: true
20
20
  })),
21
21
  () => {
22
- const cssVar = tokenValueToCssVar(
23
- token.value,
24
- configContext.prefixCls.value
25
- );
22
+ const cssVar = tokenValueToCssVar(token.value, configContext.prefixCls.value);
26
23
  return styleFn(cssVar);
27
24
  }
28
25
  );
@@ -17,10 +17,7 @@ function getSimpleStyleHook(component, styleFn) {
17
17
  })),
18
18
  () => {
19
19
  const componentCls = `.${prefixCls.value}`;
20
- const cssVar = tokenValueToCssVar(
21
- token.value,
22
- configContext.prefixCls.value
23
- );
20
+ const cssVar = tokenValueToCssVar(token.value, configContext.prefixCls.value);
24
21
  return styleFn({
25
22
  ...cssVar,
26
23
  componentCls,
@@ -26,10 +26,7 @@ function getStyleHook(component, styleFn, getDefaultToken) {
26
26
  ...token.value,
27
27
  ...mergedComponentToken
28
28
  };
29
- const cssVar = tokenValueToCssVar(
30
- mergedToken,
31
- configContext.prefixCls.value
32
- );
29
+ const cssVar = tokenValueToCssVar(mergedToken, configContext.prefixCls.value);
33
30
  return styleFn(
34
31
  {
35
32
  ...cssVar,
@@ -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>;
@@ -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();
@@ -7,9 +7,7 @@ import { useStyleInection } from './StyleContext.js';
7
7
  import { updateCSS } from '../../utils/dynamicCSS.js';
8
8
 
9
9
  function useStyleRegister(info, styleFn) {
10
- const pathHash = computed(
11
- () => hash([...info.value.path, info.value.hashId].join("|"))
12
- );
10
+ const pathHash = computed(() => hash([...info.value.path, info.value.hashId].join("|")));
13
11
  const HMRUpdate = stdin_default();
14
12
  const { cache } = useStyleInection();
15
13
  watch(
@@ -33,10 +33,7 @@ function formatToken(derivativeToken) {
33
33
  colorBgContainerDisabled: mergedToken.colorFillTertiary,
34
34
  // ============== Split ============== //
35
35
  colorBorderBg: mergedToken.colorBgContainer,
36
- colorSplit: stdin_default$1(
37
- mergedToken.colorBorderSecondary,
38
- mergedToken.colorBgContainer
39
- ),
36
+ colorSplit: stdin_default$1(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
40
37
  // ============== Text ============== //
41
38
  colorTextPlaceholder: mergedToken.colorTextQuaternary,
42
39
  colorTextDisabled: mergedToken.colorTextQuaternary,
@@ -49,14 +46,8 @@ function formatToken(derivativeToken) {
49
46
  colorBgTextActive: mergedToken.colorFill,
50
47
  colorIcon: mergedToken.colorTextTertiary,
51
48
  colorIconHover: mergedToken.colorText,
52
- colorErrorOutline: stdin_default$1(
53
- mergedToken.colorErrorBg,
54
- mergedToken.colorBgContainer
55
- ),
56
- colorWarningOutline: stdin_default$1(
57
- mergedToken.colorWarningBg,
58
- mergedToken.colorBgContainer
59
- ),
49
+ colorErrorOutline: stdin_default$1(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
50
+ colorWarningOutline: stdin_default$1(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
60
51
  // Font
61
52
  fontSizeIcon: mergedToken.fontSizeSM,
62
53
  // Line
@@ -71,10 +62,7 @@ function formatToken(derivativeToken) {
71
62
  controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
72
63
  controlItemBgActiveDisabled: mergedToken.colorFill,
73
64
  controlTmpOutline: mergedToken.colorFillQuaternary,
74
- controlOutline: stdin_default$1(
75
- mergedToken.colorPrimaryBg,
76
- mergedToken.colorBgContainer
77
- ),
65
+ controlOutline: stdin_default$1(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
78
66
  lineType: mergedToken.lineType,
79
67
  borderRadius: mergedToken.borderRadius,
80
68
  borderRadiusXS: mergedToken.borderRadiusXS,
@@ -4,12 +4,7 @@ function isStableColor(color) {
4
4
  return color >= 0 && color <= 255;
5
5
  }
6
6
  function getAlphaColor(frontColor, backgroundColor) {
7
- const {
8
- r: fR,
9
- g: fG,
10
- b: fB,
11
- a: originAlpha
12
- } = new TinyColor(frontColor).toRgb();
7
+ const { r: fR, g: fG, b: fB, a: originAlpha } = new TinyColor(frontColor).toRgb();
13
8
  if (originAlpha < 1) {
14
9
  return frontColor;
15
10
  }
@@ -2,7 +2,7 @@ import { serialize, compile, stringify } from 'stylis';
2
2
 
3
3
  function normalizeStyle(styleStr) {
4
4
  const serialized = serialize(compile(styleStr), stringify);
5
- return serialized.replace(/\{%%%\:[^;];}/g, ";");
5
+ return serialized.replace(/\{%%%:[^;];}/g, ";");
6
6
  }
7
7
 
8
8
  export { normalizeStyle };
@@ -38,7 +38,10 @@ function statisticToken(token) {
38
38
  }
39
39
  });
40
40
  flush = (componentName, componentToken) => {
41
- statistic[componentName] = { global: Array.from(tokenKeys), component: componentToken };
41
+ statistic[componentName] = {
42
+ global: Array.from(tokenKeys),
43
+ component: componentToken
44
+ };
42
45
  };
43
46
  }
44
47
  return { token: proxy, keys: tokenKeys, flush };
@@ -48,10 +48,7 @@ function useToken(theme) {
48
48
  if (cache.has(hashId.value)) {
49
49
  return;
50
50
  }
51
- let styleStr = stringifyTokenToCssVar(
52
- token.value,
53
- configContext.prefixCls.value
54
- );
51
+ let styleStr = stringifyTokenToCssVar(token.value, configContext.prefixCls.value);
55
52
  styleStr = normalizeStyle(`.${hashId.value}{${styleStr}}`);
56
53
  updateCSS(styleStr, hashId.value);
57
54
  cache.set(hashId.value, styleStr);
@@ -38,7 +38,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
38
38
  }, {
39
39
  default: withCtx(() => [createTextVNode(toDisplayString(text.value) + " ", 1
40
40
  /* TEXT */), createVNode(stdin_default$1, {
41
- name: innerValue.value ? "mdi:chevron-down" : "mdi:chevron-up",
41
+ name: innerValue.value ? "co:chevron-down" : "co:chevron-up",
42
42
  size: "xl"
43
43
  }, null, 8, ["name"])]),
44
44
  _: 1
@@ -1,4 +1,4 @@
1
- import { defineComponent, useSlots, computed, createBlock, openBlock, Transition, normalizeProps, guardReactiveProps, withCtx, renderSlot } from 'vue';
1
+ import { defineComponent, computed, createBlock, openBlock, Transition, normalizeProps, guardReactiveProps, withCtx, renderSlot } from 'vue';
2
2
  import stdin_default$1 from './style/index.js';
3
3
  import { reactiveOmit } from '@vueuse/core';
4
4
  import { useComponentConfig } from '../config-provider/config-provider.js';
@@ -126,7 +126,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
126
126
  },
127
127
  setup(__props) {
128
128
  const props = __props;
129
- useSlots();
130
129
  const {
131
130
  prefixCls
132
131
  } = useComponentConfig("transition");
@@ -72,7 +72,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
72
72
  percentage
73
73
  }) => [_ctx.file.status === "error" ? (openBlock(), createBlock(stdin_default$1, {
74
74
  key: 0,
75
- name: "mdi:close-circle",
75
+ name: "co:close-filled",
76
76
  size: "lg"
77
77
  })) : (openBlock(), createElementBlock("span", {
78
78
  key: 1,
@@ -91,8 +91,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
91
91
  onClick: _cache[0] || (_cache[0] = $event => emit("cancel"))
92
92
  }, {
93
93
  default: withCtx(() => _cache[4] || (_cache[4] = [createTextVNode(" \u53D6\u6D88\u4E0A\u4F20 ")])),
94
- _: 1
95
- /* STABLE */
94
+ _: 1,
95
+ __: [4]
96
96
  })) : createCommentVNode("v-if", true), _ctx.file.status === "error" ? (openBlock(), createBlock(unref(ElButton), {
97
97
  key: 1,
98
98
  link: "",
@@ -104,8 +104,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
104
104
  onClick: _cache[1] || (_cache[1] = $event => emit("re-upload"))
105
105
  }, {
106
106
  default: withCtx(() => _cache[5] || (_cache[5] = [createTextVNode(" \u91CD\u65B0\u4E0A\u4F20 ")])),
107
- _: 1
108
- /* STABLE */
107
+ _: 1,
108
+ __: [5]
109
109
  })) : createCommentVNode("v-if", true), createVNode(unref(ElButton), {
110
110
  link: "",
111
111
  size: "small",
@@ -116,8 +116,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
116
116
  onClick: _cache[2] || (_cache[2] = $event => emit("remove"))
117
117
  }, {
118
118
  default: withCtx(() => _cache[6] || (_cache[6] = [createTextVNode(" \u5220\u9664 ")])),
119
- _: 1
120
- /* STABLE */
119
+ _: 1,
120
+ __: [6]
121
121
  })], 2
122
122
  /* CLASS */)], 2
123
123
  /* CLASS */)) : createCommentVNode("v-if", true)]),
@@ -129,7 +129,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
129
129
  class: normalizeClass(`${unref(prefixCls)}-remove`),
130
130
  onClick: _cache[3] || (_cache[3] = $event => emit("remove"))
131
131
  }, [createVNode(stdin_default$1, {
132
- name: "mdi:close"
132
+ name: "co:close-large"
133
133
  })], 2
134
134
  /* CLASS */)) : createCommentVNode("v-if", true)], 2
135
135
  /* CLASS */);
@@ -248,7 +248,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
248
248
  class: normalizeClass([`${unref(prefixCls)}-select`, `is-${_ctx.size}`]),
249
249
  onClick: onSelect
250
250
  }, [createVNode(stdin_default$3, {
251
- name: "mdi:plus",
251
+ name: "co:add-large",
252
252
  size: "24"
253
253
  })], 2
254
254
  /* CLASS */)) : createCommentVNode("v-if", true)]),
@@ -91,7 +91,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
91
91
  }, null, 10, _hoisted_2), createElementVNode("div", {
92
92
  class: normalizeClass(`${unref(prefixCls)}-play-mask`)
93
93
  }, [createVNode(stdin_default$2, {
94
- name: "mdi:play-circle-outline",
94
+ name: "co:play-filled",
95
95
  class: normalizeClass(`${unref(prefixCls)}-play-icon`)
96
96
  }, null, 8, ["class"])], 2
97
97
  /* CLASS */)], 16, _hoisted_1), viewerVisible.value ? (openBlock(), createBlock(stdin_default$3, {
package/config/index.d.ts CHANGED
@@ -42,6 +42,7 @@ export interface LayoutComponents {
42
42
  export interface LayoutSlots {
43
43
  topbarRight?: () => VNodeChild;
44
44
  authWidget?: () => VNodeChild;
45
+ userMenu?: () => VNodeChild;
45
46
  }
46
47
  export type CoseyOptions = {
47
48
  router?: CoseyRouterOptions & RouterConfig;
package/config/index.js CHANGED
@@ -8,9 +8,7 @@ import { defaultsDeep } from 'lodash-es';
8
8
  import { inject } from 'vue';
9
9
  import { createPersist } from '../hooks/usePersist.js';
10
10
 
11
- const globalConfigContextKey = Symbol(
12
- "globalConfigContext"
13
- );
11
+ const globalConfigContextKey = Symbol("globalConfigContext");
14
12
  function provideGlobalConfig(app, options) {
15
13
  const {
16
14
  router: { homePath, loginPath, changePasswordPath } = {},
@@ -27,10 +25,7 @@ function provideGlobalConfig(app, options) {
27
25
  const persistConfig = defaultsDeep(persist, defaultPersistConfig);
28
26
  app.provide(globalConfigContextKey, {
29
27
  persist: createPersist(persistConfig.name, persistConfig.type),
30
- router: defaultsDeep(
31
- { homePath, loginPath, changePasswordPath },
32
- defaultRouterConfig
33
- ),
28
+ router: defaultsDeep({ homePath, loginPath, changePasswordPath }, defaultRouterConfig),
34
29
  http: defaultsDeep(http, defaultHttpConfig),
35
30
  layout: defaultsDeep(layout, defaultLayoutConfig),
36
31
  site: defaultsDeep(site, defaultSiteConfig),
@@ -11,6 +11,42 @@ export declare const defaultLayoutConfig: {
11
11
  * 是否启用标签页缓存
12
12
  */
13
13
  keepAlive: boolean;
14
+ /**
15
+ * 是否默认显示侧边栏
16
+ */
17
+ sidebarVisible: boolean;
18
+ /**
19
+ * 是否默认折叠收起垂直菜单
20
+ */
21
+ collapse: boolean;
22
+ /**
23
+ * 菜单类型
24
+ */
25
+ menuType: "vertical" | "biserial" | "horizontal" | "horizontal-vertical" | "horizontal-biserial";
26
+ /**
27
+ * 是否显示标签页
28
+ */
29
+ tabbarVisible: boolean;
30
+ /**
31
+ * 侧边菜单宽度
32
+ */
33
+ asideWidth: number;
34
+ /**
35
+ * 折叠时侧边栏菜单宽度
36
+ */
37
+ collapsedAsideWidth: number;
38
+ /**
39
+ * 紧凑侧边菜单宽度
40
+ */
41
+ snugAsideWidth: number;
42
+ /**
43
+ * 顶部栏高度
44
+ */
45
+ topbarHeight: number;
46
+ /**
47
+ * 标签栏高度
48
+ */
49
+ tabbarHeight: number;
14
50
  };
15
51
  export type LayoutConfig = DeepPartial<typeof defaultLayoutConfig>;
16
52
  export type RequiredLayoutConfig = typeof defaultLayoutConfig;