cosey 0.1.4 → 0.2.0

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 (180) hide show
  1. package/README.md +61 -0
  2. package/components/close/style/index.js +2 -2
  3. package/components/col/col.vue.js +1 -1
  4. package/components/col/style/index.js +3 -3
  5. package/components/config-provider/config-provider.d.ts +2 -0
  6. package/components/config-provider/config-provider.vue.js +13 -3
  7. package/components/context-menu/context-menu.vue.js +4 -4
  8. package/components/context-menu/context-sub-menu.vue.js +2 -2
  9. package/components/context-menu/style/index.js +2 -2
  10. package/components/editor/components/color-picker/color-picker.vue.js +15 -11
  11. package/components/editor/components/color-picker/useHistoryColor.js +3 -3
  12. package/components/editor/components/resize/resize.js +9 -9
  13. package/components/editor/components/resize/resize.style.js +20 -20
  14. package/components/editor/components/resize/resize.vue.js +2 -2
  15. package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
  16. package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
  17. package/components/editor/components/toolbar/formats/font.vue.js +5 -1
  18. package/components/editor/components/toolbar/formats/header.vue.js +6 -2
  19. package/components/editor/components/toolbar/formats/link.vue.js +17 -13
  20. package/components/editor/components/toolbar/formats/size.vue.js +5 -1
  21. package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
  22. package/components/editor/components/toolbar/formats/source.vue.js +78 -0
  23. package/components/editor/components/toolbar/formats/table.style.js +2 -2
  24. package/components/editor/components/toolbar/formats/video.vue.js +9 -5
  25. package/components/editor/components/toolbar/toolbar.vue.js +5 -0
  26. package/components/editor/formats/font.js +2 -2
  27. package/components/editor/formats/indent.js +1 -1
  28. package/components/editor/formats/kbd.d.ts +7 -0
  29. package/components/editor/formats/kbd.js +13 -0
  30. package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
  31. package/components/editor/quill.js +8 -6
  32. package/components/editor/style/index.js +25 -16
  33. package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
  34. package/components/field/components/cascader/cascader.vue.js +5 -1
  35. package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
  36. package/components/field/components/checkbox-group/panel.vue.js +10 -5
  37. package/components/field/components/date/date.vue.js +5 -1
  38. package/components/field/components/date-range/date-range.vue.js +6 -2
  39. package/components/field/components/date-time/date-time.vue.js +5 -1
  40. package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
  41. package/components/field/components/dates/dates.vue.js +5 -1
  42. package/components/field/components/input/input.vue.js +5 -1
  43. package/components/field/components/input-tag/input-tag.vue.js +5 -1
  44. package/components/field/components/mention/mention.vue.js +5 -1
  45. package/components/field/components/month/month.vue.js +5 -1
  46. package/components/field/components/month-range/month-range.vue.js +6 -2
  47. package/components/field/components/months/months.vue.js +5 -1
  48. package/components/field/components/password/password.vue.js +5 -1
  49. package/components/field/components/select/select.d.ts +2 -2
  50. package/components/field/components/select/select.js +3 -3
  51. package/components/field/components/select/select.vue.js +5 -1
  52. package/components/field/components/select-v2/select-v2.d.ts +6 -3
  53. package/components/field/components/select-v2/select-v2.js +9 -0
  54. package/components/field/components/select-v2/select-v2.vue.js +21 -3
  55. package/components/field/components/textarea/textarea.vue.js +5 -1
  56. package/components/field/components/time/time.vue.js +5 -1
  57. package/components/field/components/time-range/time-range.vue.js +6 -2
  58. package/components/field/components/time-select/time-select.vue.js +5 -1
  59. package/components/field/components/tree-select/tree-select.vue.js +5 -1
  60. package/components/field/components/week/week.vue.js +6 -2
  61. package/components/field/components/year/year.vue.js +5 -1
  62. package/components/field/components/year-range/year-range.vue.js +6 -2
  63. package/components/field/components/years/years.vue.js +5 -1
  64. package/components/form/form-item.d.ts +1 -1
  65. package/components/form/form.d.ts +2 -0
  66. package/components/form/form.js +2 -2
  67. package/components/form/form.vue.d.ts +5 -0
  68. package/components/form/form.vue.js +6 -2
  69. package/components/form/index.d.ts +10 -1
  70. package/components/form/useBubbleTemplate.js +13 -5
  71. package/components/form-dialog/form-dialog.js +2 -2
  72. package/components/form-dialog/index.d.ts +4 -1552
  73. package/components/form-list/form-list.js +1 -1
  74. package/components/form-list/form-list.vue.js +5 -1
  75. package/components/form-list/index.d.ts +1 -1
  76. package/components/form-query/form-query.d.ts +2 -0
  77. package/components/form-query/form-query.vue.d.ts +5 -0
  78. package/components/form-query/form-query.vue.js +13 -7
  79. package/components/form-query/index.d.ts +9 -0
  80. package/components/highlight/style/index.js +2 -2
  81. package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
  82. package/components/image-card/image-card.d.ts +1 -8
  83. package/components/image-card/image-card.vue.d.ts +4 -18
  84. package/components/image-card/index.d.ts +8 -29
  85. package/components/long-text/style/index.js +2 -2
  86. package/components/mask/style/index.js +2 -2
  87. package/components/row/row.vue.js +1 -1
  88. package/components/scroll-view/scroll-view.vue.js +1 -1
  89. package/components/scroll-view/style/index.js +9 -9
  90. package/components/table/index.d.ts +73 -78
  91. package/components/table/table-column/renderer.d.ts +2 -1
  92. package/components/table/table-column/renderer.js +2 -2
  93. package/components/table/table-column/table-column.d.ts +15 -15
  94. package/components/table/table-column/table-column.vue.d.ts +9 -5
  95. package/components/table/table-column/table-column.vue.js +5 -1
  96. package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
  97. package/components/table/table-export/table-export.vue.js +31 -26
  98. package/components/table/table-query/table-query.d.ts +2 -0
  99. package/components/table/table-query/table-query.vue.d.ts +5 -0
  100. package/components/table/table.d.ts +22 -25
  101. package/components/table/table.vue.d.ts +45 -51
  102. package/components/table/table.vue.js +13 -9
  103. package/components/table/useTable.d.ts +2 -1
  104. package/components/table/useTable.js +2 -2
  105. package/components/table-action/index.d.ts +48 -6
  106. package/components/table-action/item.d.ts +16 -2
  107. package/components/table-action/item.vue.d.ts +34 -6
  108. package/components/table-action/item.vue.js +15 -9
  109. package/components/table-action/table-action.vue.d.ts +16 -2
  110. package/components/toggle/toggle.vue.js +5 -1
  111. package/components/upload/style/index.js +2 -2
  112. package/components/upload/upload-item.vue.d.ts +2 -2
  113. package/components/upload/upload-item.vue.js +16 -9
  114. package/components/upload/upload.vue.js +7 -1
  115. package/config/index.d.ts +1 -2
  116. package/config/index.js +2 -2
  117. package/config/nprogress.style.js +5 -5
  118. package/config/root-config-provider.vue.js +5 -5
  119. package/constant.d.ts +2 -2
  120. package/constant.js +2 -2
  121. package/hooks/index.d.ts +1 -0
  122. package/hooks/index.js +2 -1
  123. package/hooks/useColorScheme.js +4 -4
  124. package/hooks/useDir.d.ts +2 -0
  125. package/hooks/useDir.js +20 -0
  126. package/hooks/useEcharts.d.ts +3 -2
  127. package/hooks/useEcharts.js +15 -3
  128. package/hooks/useLocale.d.ts +23 -371
  129. package/hooks/useLocale.js +26 -35
  130. package/hooks/useUpsert.d.ts +5 -3
  131. package/hooks/useUpsert.js +33 -25
  132. package/index.d.ts +1 -1
  133. package/index.js +4 -4
  134. package/layout/layout-auth/style/index.js +6 -6
  135. package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
  136. package/layout/layout-change-password/layout-change-password.vue.js +28 -22
  137. package/layout/layout-content/layout-content.vue.js +1 -1
  138. package/layout/layout-content/style/index.js +1 -1
  139. package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
  140. package/layout/layout-header/layout-header.vue.js +4 -4
  141. package/layout/layout-header/style/index.js +3 -3
  142. package/layout/layout-iframe/style/index.js +2 -2
  143. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
  144. package/layout/layout-login/layout-login.vue.js +19 -14
  145. package/layout/layout-main/layout-main.vue.js +1 -1
  146. package/layout/layout-menu/layout-menu.vue.js +5 -1
  147. package/layout/layout-menu/style/index.js +1 -1
  148. package/layout/layout-not-found/layout-not-found.vue.js +11 -6
  149. package/layout/layout-search/layout-search.vue.js +22 -14
  150. package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
  151. package/layout/layout-sidebar/style/index.js +2 -2
  152. package/layout/layout-snug-aside/style/index.js +1 -1
  153. package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
  154. package/layout/layout-tabbar/style/index.js +1 -1
  155. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
  156. package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
  157. package/locale/index.d.ts +10 -0
  158. package/locale/index.js +2 -0
  159. package/locale/lang/ar.d.ts +280 -0
  160. package/locale/lang/ar.js +129 -0
  161. package/locale/lang/en.d.ts +302 -0
  162. package/locale/lang/en.js +129 -0
  163. package/locale/lang/zh-cn.d.ts +301 -0
  164. package/locale/lang/zh-cn.js +129 -0
  165. package/package.json +10 -8
  166. package/request/useRequest.js +31 -23
  167. package/store/index.d.ts +1 -1
  168. package/store/index.js +6 -3
  169. package/store/layout.js +208 -190
  170. package/store/plugin.d.ts +9 -0
  171. package/store/plugin.js +22 -0
  172. package/store/user.d.ts +1 -1
  173. package/utils/css.d.ts +4 -0
  174. package/utils/css.js +5 -2
  175. package/utils/excel/bookFormats.js +5 -5
  176. package/utils/excel/xlsx.js +2 -2
  177. package/utils/index.js +1 -1
  178. package/utils/message-box.js +3 -1
  179. package/utils/tree.js +2 -2
  180. package/components/form-dialog/form-dialog.vue.d.ts +0 -675
@@ -13,6 +13,7 @@ import stdin_default$1 from './style/index.js';
13
13
  import { useComponentConfig, useConfig } from '../config-provider/config-provider.js';
14
14
  import { useFetch } from '../../hooks/useFetch.js';
15
15
  import { useFullPage } from '../../hooks/useFullPage.js';
16
+ import { useLocale } from '../../hooks/useLocale.js';
16
17
  import { addPxUnit } from '../../utils/css.js';
17
18
  import { createMergedExpose } from '../../utils/vue.js';
18
19
  import { walkTree } from '../../utils/tree.js';
@@ -41,6 +42,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
41
42
  }) {
42
43
  const props = __props;
43
44
  const slots = useSlots();
45
+ const {
46
+ t
47
+ } = useLocale();
44
48
  const {
45
49
  prefixCls
46
50
  } = useComponentConfig("table");
@@ -243,7 +247,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
243
247
  key: 0,
244
248
  class: normalizeClass(`${unref(prefixCls)}-toolbar-preset`)
245
249
  }, [_ctx.toolbarConfig.reload ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_el_tooltip, {
246
- content: "\u5237\u65B0",
250
+ content: unref(t)("co.common.reload"),
247
251
  placement: "top",
248
252
  "show-after": 200,
249
253
  "hide-after": 0
@@ -264,8 +268,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
264
268
  })]),
265
269
  _: 1
266
270
  /* STABLE */
267
- })])) : createCommentVNode("v-if", true), _ctx.toolbarConfig.export ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(_component_el_tooltip, {
268
- content: "\u5BFC\u51FA",
271
+ }, 8, ["content"])])) : createCommentVNode("v-if", true), _ctx.toolbarConfig.export ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(_component_el_tooltip, {
272
+ content: unref(t)("co.table.export"),
269
273
  placement: "top",
270
274
  "show-after": 200,
271
275
  "hide-after": 0
@@ -283,14 +287,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
283
287
  })]),
284
288
  _: 1
285
289
  /* STABLE */
286
- }), createVNode(stdin_default$4, {
290
+ }, 8, ["content"]), createVNode(stdin_default$4, {
287
291
  modelValue: exportVisible.value,
288
292
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => exportVisible.value = $event),
289
- title: "\u5BFC\u51FA\u6570\u636E",
293
+ title: unref(t)("co.table.exportData"),
290
294
  columns: renderedColumns.value,
291
295
  data: tableData.value
292
- }, null, 8, ["modelValue", "columns", "data"])])) : createCommentVNode("v-if", true), _ctx.toolbarConfig.fullScreen ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(_component_el_tooltip, {
293
- content: unref(isFullPage) ? "\u9000\u51FA\u5168\u5C4F" : "\u5168\u5C4F",
296
+ }, null, 8, ["modelValue", "title", "columns", "data"])])) : createCommentVNode("v-if", true), _ctx.toolbarConfig.fullScreen ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(_component_el_tooltip, {
297
+ content: unref(isFullPage) ? unref(t)("co.table.exitFullScreen") : unref(t)("co.table.fullScreen"),
294
298
  placement: "top",
295
299
  "show-after": 200,
296
300
  "hide-after": 0
@@ -309,7 +313,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
309
313
  _: 1
310
314
  /* STABLE */
311
315
  }, 8, ["content"])])) : createCommentVNode("v-if", true), _ctx.toolbarConfig.setting ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(_component_el_tooltip, {
312
- content: "\u5217\u8BBE\u7F6E",
316
+ content: unref(t)("co.table.columnSettings"),
313
317
  placement: "top",
314
318
  "show-after": 200,
315
319
  "hide-after": 0
@@ -328,7 +332,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
328
332
  /* NEED_PATCH */)]),
329
333
  _: 1
330
334
  /* STABLE */
331
- }), createVNode(stdin_default$5, {
335
+ }, 8, ["content"]), createVNode(stdin_default$5, {
332
336
  modelValue: renderedColumns.value,
333
337
  "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => renderedColumns.value = $event),
334
338
  "virtual-ref": settingRef.value,
@@ -1,5 +1,6 @@
1
+ import { MaybeRef } from 'vue';
1
2
  import { type TableExpose, type TableProps } from './table';
2
3
  export type UseTableProps = TableProps & {
3
4
  [prop: PropertyKey]: any;
4
5
  };
5
- export declare function useTable(props: UseTableProps): [UseTableProps, TableExpose];
6
+ export declare function useTable(props: MaybeRef<UseTableProps>): [UseTableProps, TableExpose];
@@ -1,4 +1,4 @@
1
- import { computed, mergeProps } from 'vue';
1
+ import { computed, mergeProps, unref } from 'vue';
2
2
  import { tableExposeKeys } from './table.js';
3
3
  import { createMergedExpose } from '../../utils/vue.js';
4
4
 
@@ -12,7 +12,7 @@ function useTable(props) {
12
12
  {
13
13
  getExpose
14
14
  },
15
- props
15
+ unref(props)
16
16
  );
17
17
  });
18
18
  const expose = createMergedExpose(tableExposeKeys, () => tableRef);
@@ -53,11 +53,25 @@ declare const _TableAction: {
53
53
  } & {
54
54
  readonly default: () => any;
55
55
  };
56
- plain: BooleanConstructor;
56
+ plain: {
57
+ readonly type: import("vue").PropType<boolean>;
58
+ readonly required: false;
59
+ readonly validator: ((val: unknown) => boolean) | undefined;
60
+ __epPropKey: true;
61
+ } & {
62
+ readonly default: undefined;
63
+ };
57
64
  text: BooleanConstructor;
58
65
  bg: BooleanConstructor;
59
66
  autofocus: BooleanConstructor;
60
- round: BooleanConstructor;
67
+ round: {
68
+ readonly type: import("vue").PropType<boolean>;
69
+ readonly required: false;
70
+ readonly validator: ((val: unknown) => boolean) | undefined;
71
+ __epPropKey: true;
72
+ } & {
73
+ readonly default: undefined;
74
+ };
61
75
  circle: BooleanConstructor;
62
76
  color: StringConstructor;
63
77
  dark: BooleanConstructor;
@@ -138,11 +152,25 @@ declare const _TableAction: {
138
152
  } & {
139
153
  readonly default: () => any;
140
154
  };
141
- plain: BooleanConstructor;
155
+ plain: {
156
+ readonly type: import("vue").PropType<boolean>;
157
+ readonly required: false;
158
+ readonly validator: ((val: unknown) => boolean) | undefined;
159
+ __epPropKey: true;
160
+ } & {
161
+ readonly default: undefined;
162
+ };
142
163
  text: BooleanConstructor;
143
164
  bg: BooleanConstructor;
144
165
  autofocus: BooleanConstructor;
145
- round: BooleanConstructor;
166
+ round: {
167
+ readonly type: import("vue").PropType<boolean>;
168
+ readonly required: false;
169
+ readonly validator: ((val: unknown) => boolean) | undefined;
170
+ __epPropKey: true;
171
+ } & {
172
+ readonly default: undefined;
173
+ };
146
174
  circle: BooleanConstructor;
147
175
  color: StringConstructor;
148
176
  dark: BooleanConstructor;
@@ -220,11 +248,25 @@ declare const _TableAction: {
220
248
  } & {
221
249
  readonly default: () => any;
222
250
  };
223
- plain: BooleanConstructor;
251
+ plain: {
252
+ readonly type: import("vue").PropType<boolean>;
253
+ readonly required: false;
254
+ readonly validator: ((val: unknown) => boolean) | undefined;
255
+ __epPropKey: true;
256
+ } & {
257
+ readonly default: undefined;
258
+ };
224
259
  text: BooleanConstructor;
225
260
  bg: BooleanConstructor;
226
261
  autofocus: BooleanConstructor;
227
- round: BooleanConstructor;
262
+ round: {
263
+ readonly type: import("vue").PropType<boolean>;
264
+ readonly required: false;
265
+ readonly validator: ((val: unknown) => boolean) | undefined;
266
+ __epPropKey: true;
267
+ } & {
268
+ readonly default: undefined;
269
+ };
228
270
  circle: BooleanConstructor;
229
271
  color: StringConstructor;
230
272
  dark: BooleanConstructor;
@@ -52,11 +52,25 @@ export declare const tableActionItemProps: {
52
52
  } & {
53
53
  readonly default: () => any;
54
54
  };
55
- plain: BooleanConstructor;
55
+ plain: {
56
+ readonly type: PropType<boolean>;
57
+ readonly required: false;
58
+ readonly validator: ((val: unknown) => boolean) | undefined;
59
+ __epPropKey: true;
60
+ } & {
61
+ readonly default: undefined;
62
+ };
56
63
  text: BooleanConstructor;
57
64
  bg: BooleanConstructor;
58
65
  autofocus: BooleanConstructor;
59
- round: BooleanConstructor;
66
+ round: {
67
+ readonly type: PropType<boolean>;
68
+ readonly required: false;
69
+ readonly validator: ((val: unknown) => boolean) | undefined;
70
+ __epPropKey: true;
71
+ } & {
72
+ readonly default: undefined;
73
+ };
60
74
  circle: BooleanConstructor;
61
75
  color: StringConstructor;
62
76
  dark: BooleanConstructor;
@@ -50,11 +50,25 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
50
50
  } & {
51
51
  readonly default: () => any;
52
52
  };
53
- plain: BooleanConstructor;
53
+ plain: {
54
+ readonly type: import("vue").PropType<boolean>;
55
+ readonly required: false;
56
+ readonly validator: ((val: unknown) => boolean) | undefined;
57
+ __epPropKey: true;
58
+ } & {
59
+ readonly default: undefined;
60
+ };
54
61
  text: BooleanConstructor;
55
62
  bg: BooleanConstructor;
56
63
  autofocus: BooleanConstructor;
57
- round: BooleanConstructor;
64
+ round: {
65
+ readonly type: import("vue").PropType<boolean>;
66
+ readonly required: false;
67
+ readonly validator: ((val: unknown) => boolean) | undefined;
68
+ __epPropKey: true;
69
+ } & {
70
+ readonly default: undefined;
71
+ };
58
72
  circle: BooleanConstructor;
59
73
  color: StringConstructor;
60
74
  dark: BooleanConstructor;
@@ -126,11 +140,25 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
126
140
  } & {
127
141
  readonly default: () => any;
128
142
  };
129
- plain: BooleanConstructor;
143
+ plain: {
144
+ readonly type: import("vue").PropType<boolean>;
145
+ readonly required: false;
146
+ readonly validator: ((val: unknown) => boolean) | undefined;
147
+ __epPropKey: true;
148
+ } & {
149
+ readonly default: undefined;
150
+ };
130
151
  text: BooleanConstructor;
131
152
  bg: BooleanConstructor;
132
153
  autofocus: BooleanConstructor;
133
- round: BooleanConstructor;
154
+ round: {
155
+ readonly type: import("vue").PropType<boolean>;
156
+ readonly required: false;
157
+ readonly validator: ((val: unknown) => boolean) | undefined;
158
+ __epPropKey: true;
159
+ } & {
160
+ readonly default: undefined;
161
+ };
134
162
  circle: BooleanConstructor;
135
163
  color: StringConstructor;
136
164
  dark: BooleanConstructor;
@@ -157,12 +185,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
157
185
  text: boolean;
158
186
  circle: boolean;
159
187
  disabled: boolean;
160
- type: "text" | "success" | "warning" | "info" | "primary" | "danger";
188
+ type: "text" | "warning" | "success" | "primary" | "info" | "danger";
161
189
  link: boolean;
162
190
  tag: string | import("vue").Component;
191
+ loading: boolean;
163
192
  plain: boolean;
164
193
  nativeType: "button" | "reset" | "submit";
165
- loading: boolean;
166
194
  loadingIcon: string | import("vue").Component;
167
195
  bg: boolean;
168
196
  autofocus: boolean;
@@ -1,9 +1,10 @@
1
- import { defineComponent, computed, ref, resolveComponent, createElementBlock, createCommentVNode, openBlock, Fragment, createBlock, normalizeProps, mergeProps, withCtx, createVNode, unref, createTextVNode, normalizeStyle, toDisplayString } from 'vue';
1
+ import { defineComponent, computed, ref, resolveComponent, createElementBlock, createCommentVNode, openBlock, Fragment, createBlock, normalizeProps, mergeProps, withCtx, createVNode, unref, createTextVNode, toDisplayString, normalizeStyle } from 'vue';
2
2
  import { omit } from 'lodash-es';
3
3
  import { ElButton } from 'element-plus';
4
4
  import { tableActionItemProps } from './item.js';
5
5
  import stdin_default$1 from '../icon/icon.vue.js';
6
6
  import { useToken } from '../theme/util/useToken.js';
7
+ import { useLocale } from '../../hooks/useLocale.js';
7
8
 
8
9
  var stdin_default = /* @__PURE__ */defineComponent({
9
10
  ...{
@@ -14,6 +15,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
14
15
  props: tableActionItemProps,
15
16
  setup(__props) {
16
17
  const props = __props;
18
+ const {
19
+ t
20
+ } = useLocale();
17
21
  const {
18
22
  token
19
23
  } = useToken();
@@ -49,7 +53,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
49
53
  key: 0,
50
54
  name: _ctx.icon,
51
55
  style: normalizeStyle({
52
- marginRight: unref(token).marginXXS + "px"
56
+ marginInlineEnd: unref(token).marginXXS + "px"
53
57
  })
54
58
  }, null, 8, ["name", "style"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(_ctx.label), 1
55
59
  /* TEXT */)]),
@@ -64,18 +68,20 @@ var stdin_default = /* @__PURE__ */defineComponent({
64
68
  size: "small",
65
69
  onClick: event => onCancel(event, cancel)
66
70
  }, {
67
- default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode("\u5426")])),
68
- _: 2,
69
- __: [0]
71
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.no")), 1
72
+ /* TEXT */)]),
73
+ _: 2
74
+ /* DYNAMIC */
70
75
  }, 1032, ["onClick"]), createVNode(unref(ElButton), {
71
76
  type: "danger",
72
77
  size: "small",
73
78
  loading: loading.value,
74
79
  onClick: event => onConfirm(event, confirm)
75
80
  }, {
76
- default: withCtx(() => _cache[1] || (_cache[1] = [createTextVNode(" \u662F ")])),
77
- _: 2,
78
- __: [1]
81
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.yes")), 1
82
+ /* TEXT */)]),
83
+ _: 2
84
+ /* DYNAMIC */
79
85
  }, 1032, ["loading", "onClick"])]),
80
86
  _: 1
81
87
  /* STABLE */
@@ -91,7 +97,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
91
97
  key: 0,
92
98
  name: _ctx.icon,
93
99
  style: normalizeStyle({
94
- marginRight: unref(token).marginXXS + "px"
100
+ marginInlineEnd: unref(token).marginXXS + "px"
95
101
  })
96
102
  }, null, 8, ["name", "style"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(_ctx.label), 1
97
103
  /* TEXT */)]),
@@ -52,11 +52,25 @@ declare const _default: import("vue").DefineComponent<TableActionProps, {}, {},
52
52
  } & {
53
53
  readonly default: () => any;
54
54
  };
55
- plain: BooleanConstructor;
55
+ plain: {
56
+ readonly type: import("vue").PropType<boolean>;
57
+ readonly required: false;
58
+ readonly validator: ((val: unknown) => boolean) | undefined;
59
+ __epPropKey: true;
60
+ } & {
61
+ readonly default: undefined;
62
+ };
56
63
  text: BooleanConstructor;
57
64
  bg: BooleanConstructor;
58
65
  autofocus: BooleanConstructor;
59
- round: BooleanConstructor;
66
+ round: {
67
+ readonly type: import("vue").PropType<boolean>;
68
+ readonly required: false;
69
+ readonly validator: ((val: unknown) => boolean) | undefined;
70
+ __epPropKey: true;
71
+ } & {
72
+ readonly default: undefined;
73
+ };
60
74
  circle: BooleanConstructor;
61
75
  color: StringConstructor;
62
76
  dark: BooleanConstructor;
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, ref, watch, computed, createBlock, openBlock, unref, withCtx, createTextVNode, createVNode, toDisplayString } from 'vue';
2
2
  import { ElButton } from 'element-plus';
3
3
  import stdin_default$1 from '../icon/icon.vue.js';
4
+ import { useLocale } from '../../hooks/useLocale.js';
4
5
 
5
6
  var stdin_default = /* @__PURE__ */defineComponent({
6
7
  ...{
@@ -19,12 +20,15 @@ var stdin_default = /* @__PURE__ */defineComponent({
19
20
  }) {
20
21
  const props = __props;
21
22
  const emit = __emit;
23
+ const {
24
+ t
25
+ } = useLocale();
22
26
  const innerValue = ref(props.modelValue);
23
27
  watch(() => props.modelValue, () => {
24
28
  innerValue.value = props.modelValue;
25
29
  });
26
30
  const text = computed(() => {
27
- return innerValue.value ? "\u5C55\u5F00" : "\u6536\u8D77";
31
+ return innerValue.value ? t("co.toggle.unfold") : t("co.toggle.fold");
28
32
  });
29
33
  const handleClick = () => {
30
34
  innerValue.value = !innerValue.value;
@@ -47,8 +47,8 @@ const getUploadStyle = (token) => {
47
47
  },
48
48
  [`${componentCls}-remove`]: {
49
49
  position: "absolute",
50
- top: 0,
51
- right: 0,
50
+ insetBlockStart: 0,
51
+ insetInlineEnd: 0,
52
52
  zIndex: 10,
53
53
  display: "flex",
54
54
  width: token.sizeMD,
@@ -1,11 +1,11 @@
1
1
  import { type UploadItemProps } from './upload';
2
2
  declare const _default: import("vue").DefineComponent<UploadItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
3
  cancel: () => any;
4
- remove: () => any;
5
4
  "re-upload": () => any;
5
+ remove: () => any;
6
6
  }, string, import("vue").PublicProps, Readonly<UploadItemProps> & Readonly<{
7
7
  onCancel?: (() => any) | undefined;
8
- onRemove?: (() => any) | undefined;
9
8
  "onRe-upload"?: (() => any) | undefined;
9
+ onRemove?: (() => any) | undefined;
10
10
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  export default _default;
@@ -3,6 +3,7 @@ import { ElButton } from 'element-plus';
3
3
  import { MediaCard as _MediaCard } from '../media-card/index.js';
4
4
  import stdin_default$1 from '../icon/icon.vue.js';
5
5
  import { useComponentConfig } from '../config-provider/config-provider.js';
6
+ import { useLocale } from '../../hooks/useLocale.js';
6
7
  import { isString } from '../../utils/is.js';
7
8
 
8
9
  var stdin_default = /* @__PURE__ */defineComponent({
@@ -33,6 +34,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
33
34
  const {
34
35
  prefixCls
35
36
  } = useComponentConfig("upload");
37
+ const {
38
+ t
39
+ } = useLocale();
36
40
  const progressStatus = {
37
41
  success: "success",
38
42
  error: "exception"
@@ -90,9 +94,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
90
94
  type: "primary",
91
95
  onClick: _cache[0] || (_cache[0] = $event => emit("cancel"))
92
96
  }, {
93
- default: withCtx(() => _cache[4] || (_cache[4] = [createTextVNode(" \u53D6\u6D88\u4E0A\u4F20 ")])),
94
- _: 1,
95
- __: [4]
97
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.upload.cancelUpload")), 1
98
+ /* TEXT */)]),
99
+ _: 1
100
+ /* STABLE */
96
101
  })) : createCommentVNode("v-if", true), _ctx.file.status === "error" ? (openBlock(), createBlock(unref(ElButton), {
97
102
  key: 1,
98
103
  link: "",
@@ -103,9 +108,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
103
108
  },
104
109
  onClick: _cache[1] || (_cache[1] = $event => emit("re-upload"))
105
110
  }, {
106
- default: withCtx(() => _cache[5] || (_cache[5] = [createTextVNode(" \u91CD\u65B0\u4E0A\u4F20 ")])),
107
- _: 1,
108
- __: [5]
111
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.upload.reUpload")), 1
112
+ /* TEXT */)]),
113
+ _: 1
114
+ /* STABLE */
109
115
  })) : createCommentVNode("v-if", true), createVNode(unref(ElButton), {
110
116
  link: "",
111
117
  size: "small",
@@ -115,9 +121,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
115
121
  },
116
122
  onClick: _cache[2] || (_cache[2] = $event => emit("remove"))
117
123
  }, {
118
- default: withCtx(() => _cache[6] || (_cache[6] = [createTextVNode(" \u5220\u9664 ")])),
119
- _: 1,
120
- __: [6]
124
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("co.common.delete")), 1
125
+ /* TEXT */)]),
126
+ _: 1
127
+ /* STABLE */
121
128
  })], 2
122
129
  /* CLASS */)], 2
123
130
  /* CLASS */)) : createCommentVNode("v-if", true)]),
@@ -8,6 +8,7 @@ import stdin_default$3 from '../icon/icon.vue.js';
8
8
  import stdin_default$1 from './style/index.js';
9
9
  import { useUpload } from '../upload-context.js';
10
10
  import { getFileType, chooseFiles } from '../../utils/file.js';
11
+ import { useLocale } from '../../hooks/useLocale.js';
11
12
  import { useComponentConfig } from '../config-provider/config-provider.js';
12
13
  import { uuid } from '../../utils/string.js';
13
14
  import { getBasename } from '../../utils/path.js';
@@ -71,6 +72,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
71
72
  }) {
72
73
  const props = __props;
73
74
  const emit = __emit;
75
+ const {
76
+ t
77
+ } = useLocale();
74
78
  const {
75
79
  prefixCls
76
80
  } = useComponentConfig("upload");
@@ -130,7 +134,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
130
134
  });
131
135
  if (mergedLimit.value && fileList.value.length + files.length > mergedLimit.value) {
132
136
  emit("exceed");
133
- ElMessage.warning(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${mergedLimit.value}\u4E2A\u6587\u4EF6`);
137
+ ElMessage.warning(t("co.upload.maxUpload", {
138
+ num: mergedLimit.value
139
+ }));
134
140
  return;
135
141
  }
136
142
  files.forEach(rawFile => {
package/config/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import { type LayoutConfig, type RequiredLayoutConfig } from './layout';
4
4
  import { type SiteConfig, type RequiredSiteConfig } from './site';
5
5
  import { type RequiredHttpConfig, type HttpConfig } from './http';
6
6
  import { type RequiredApiConfig, type ApiConfig } from './api';
7
- import Persist from '@gunny/persist';
8
7
  import { type App, type Component, type VNodeChild } from 'vue';
9
8
  import { type CoseyRouterOptions } from '../router';
10
9
  import { type RouteRecordRaw } from 'vue-router';
@@ -38,6 +37,7 @@ export interface LayoutComponents {
38
37
  notFound?: string | Component;
39
38
  internalServerError?: string | Component;
40
39
  empty?: string | Component;
40
+ locale?: string | Component;
41
41
  }
42
42
  export interface LayoutSlots {
43
43
  topbarRight?: () => VNodeChild;
@@ -57,7 +57,6 @@ export type CoseyOptions = {
57
57
  slots?: LayoutSlots;
58
58
  };
59
59
  export interface GlobalConfig {
60
- persist?: Persist;
61
60
  router: RequiredRouterConfig;
62
61
  http: RequiredHttpConfig;
63
62
  layout: RequiredLayoutConfig;
package/config/index.js CHANGED
@@ -6,7 +6,7 @@ import { defaultHttpConfig } from './http.js';
6
6
  import { defaultApiConfig } from './api.js';
7
7
  import { defaultsDeep } from 'lodash-es';
8
8
  import { inject } from 'vue';
9
- import { createPersist } from '../hooks/usePersist.js';
9
+ import { persistContextKey, createPersist } from '../hooks/usePersist.js';
10
10
 
11
11
  const globalConfigContextKey = Symbol("globalConfigContext");
12
12
  function provideGlobalConfig(app, options) {
@@ -23,8 +23,8 @@ function provideGlobalConfig(app, options) {
23
23
  slots = {}
24
24
  } = options;
25
25
  const persistConfig = defaultsDeep(persist, defaultPersistConfig);
26
+ app.provide(persistContextKey, createPersist(persistConfig.name, persistConfig.type));
26
27
  app.provide(globalConfigContextKey, {
27
- persist: createPersist(persistConfig.name, persistConfig.type),
28
28
  router: defaultsDeep({ homePath, loginPath, changePasswordPath }, defaultRouterConfig),
29
29
  http: defaultsDeep(http, defaultHttpConfig),
30
30
  layout: defaultsDeep(layout, defaultLayoutConfig),
@@ -7,8 +7,8 @@ var stdin_default = getGlobalStyleHook("NProgress", (token) => {
7
7
  pointerEvents: "none",
8
8
  ".bar": {
9
9
  position: "fixed",
10
- top: 0,
11
- left: 0,
10
+ insetBlockStart: 0,
11
+ insetInlineStart: 0,
12
12
  zIndex: 1030,
13
13
  width: "100%",
14
14
  height: "2px",
@@ -17,7 +17,7 @@ var stdin_default = getGlobalStyleHook("NProgress", (token) => {
17
17
  ".peg": {
18
18
  display: "block",
19
19
  position: "absolute",
20
- right: 0,
20
+ insetInlineEnd: 0,
21
21
  width: 100,
22
22
  height: "100%",
23
23
  boxShadow: `0 0 10px ${token.colorPrimary}, 0 0 5px ${token.colorPrimary}`,
@@ -26,8 +26,8 @@ var stdin_default = getGlobalStyleHook("NProgress", (token) => {
26
26
  },
27
27
  ".spinner": {
28
28
  position: "fixed",
29
- top: 15,
30
- right: 15,
29
+ insetBlockStart: 15,
30
+ insetInlineEnd: 15,
31
31
  zIndex: 1030,
32
32
  display: "block"
33
33
  },
@@ -6,7 +6,6 @@ import stdin_default$1 from './nprogress.style.js';
6
6
  import 'element-plus/dist/index.css';
7
7
  import 'element-plus/theme-chalk/dark/css-vars.css';
8
8
  import { useColorSchemeProvide } from '../hooks/useColorScheme.js';
9
- import { useLocaleProvide } from '../hooks/useLocale.js';
10
9
  import { useUploadProvide } from '../components/upload-context.js';
11
10
  import { containerContextKey } from '../components/container/container.js';
12
11
  import { ConfigProvider as _ConfigProvider } from '../components/config-provider/index.js';
@@ -28,6 +27,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
28
27
  table: {
29
28
  type: Object,
30
29
  required: false
30
+ },
31
+ locale: {
32
+ type: Object,
33
+ required: false
31
34
  }
32
35
  },
33
36
  setup(__props) {
@@ -48,9 +51,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
48
51
  theme: themeConfig.value
49
52
  };
50
53
  });
51
- const {
52
- locale
53
- } = useLocaleProvide();
54
54
  const apiConfig = useGlobalConfig()?.api;
55
55
  if (apiConfig) {
56
56
  const uploadApi = apiConfig.upload?.();
@@ -66,7 +66,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
66
66
  const _component_ElConfigProvider = resolveComponent("ElConfigProvider");
67
67
  return openBlock(), createBlock(unref(_ConfigProvider), normalizeProps(guardReactiveProps(mergedConfigProviderProps.value)), {
68
68
  default: withCtx(() => [createVNode(_component_ElConfigProvider, {
69
- locale: unref(locale)
69
+ locale: _ctx.locale
70
70
  }, {
71
71
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
72
72
  _: 3
package/constant.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const TOKEN_NAME = "token";
2
- export declare const ROUTER_TO = "routerTo";
1
+ export declare const TOKEN_NAME = "Cosey:token";
2
+ export declare const ROUTER_TO = "Cosey:routerTo";
package/constant.js CHANGED
@@ -1,4 +1,4 @@
1
- const TOKEN_NAME = "token";
2
- const ROUTER_TO = "routerTo";
1
+ const TOKEN_NAME = "Cosey:token";
2
+ const ROUTER_TO = "Cosey:routerTo";
3
3
 
4
4
  export { ROUTER_TO, TOKEN_NAME };
package/hooks/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export * from './useRectObserver';
19
19
  export * from './useTreeCheck';
20
20
  export * from './useOptionalComponent';
21
21
  export * from './useMounted';
22
+ export * from './useDir';