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
@@ -1,16 +1,20 @@
1
1
  import { ElMention } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
+ import { useLocale } from '../../../../hooks/useLocale.js';
3
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
4
5
 
5
6
  var stdin_default = defineComponent((props, {
6
7
  slots
7
8
  }) => {
9
+ const {
10
+ t
11
+ } = useLocale();
8
12
  return () => {
9
13
  if (props.readonly) {
10
14
  return addNullablePlaceholder(props.componentProps?.modelValue);
11
15
  }
12
16
  return h(ElMention, mergeProps({
13
- placeholder: "\u8BF7\u8F93\u5165",
17
+ placeholder: t("co.common.pleaseInput"),
14
18
  clearable: true,
15
19
  style: {
16
20
  display: "flex"
@@ -2,18 +2,22 @@ import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
4
  import { MONTH_FORMAT } from '../../../../utils/date.js';
5
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
6
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => dayjs(val).format(MONTH_FORMAT));
14
18
  }
15
19
  return h(ElDatePicker, mergeProps({
16
- placeholder: "\u8BF7\u9009\u62E9",
20
+ placeholder: t("co.common.pleaseSelect"),
17
21
  style: {
18
22
  display: "flex",
19
23
  width: "100%"
@@ -1,20 +1,24 @@
1
1
  import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
  import { MONTH_FORMAT } from '../../../../utils/date.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => val.map(item => dayjs(item).format(MONTH_FORMAT)).join(" - "));
14
18
  }
15
19
  return h(ElDatePicker, mergeProps({
16
- startPlaceholder: "\u8BF7\u9009\u62E9",
17
- endPlaceholder: "\u8BF7\u9009\u62E9",
20
+ startPlaceholder: t("co.common.pleaseSelect"),
21
+ endPlaceholder: t("co.common.pleaseSelect"),
18
22
  style: {
19
23
  display: "flex",
20
24
  width: "100%"
@@ -1,19 +1,23 @@
1
1
  import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
  import { MONTH_FORMAT } from '../../../../utils/date.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => val.map(item => dayjs(item).format(MONTH_FORMAT)).join(", "));
14
18
  }
15
19
  return h(ElDatePicker, mergeProps({
16
- placeholder: "\u8BF7\u9009\u62E9",
20
+ placeholder: t("co.common.pleaseSelect"),
17
21
  style: {
18
22
  display: "flex",
19
23
  width: "100%"
@@ -1,11 +1,15 @@
1
1
  import { useNamespace, ElInput, ElIcon } from 'element-plus';
2
2
  import { defineComponent, ref, computed, h, mergeProps } from 'vue';
3
3
  import { View, Hide } from '@element-plus/icons-vue';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
 
6
7
  var stdin_default = defineComponent((props, {
7
8
  slots
8
9
  }) => {
10
+ const {
11
+ t
12
+ } = useLocale();
9
13
  const nsInput = useNamespace("input");
10
14
  const passwordVisible = ref(false);
11
15
  const passwordIcon = computed(() => passwordVisible.value ? View : Hide);
@@ -23,7 +27,7 @@ var stdin_default = defineComponent((props, {
23
27
  }, () => h(passwordIcon.value))]));
24
28
  }
25
29
  return h(ElInput, mergeProps({
26
- placeholder: "\u8BF7\u8F93\u5165",
30
+ placeholder: t("co.common.pleaseInput"),
27
31
  clearable: true,
28
32
  showPassword: true,
29
33
  type: "password",
@@ -18,7 +18,7 @@ export interface FieldSelectConvertedGroup {
18
18
  }
19
19
  export type FieldSelectConvertedOption = FieldSelectConvertedGroup | FieldSelectObjectOption;
20
20
  export interface FieldSelectProps extends FieldComponentCommonProps {
21
- componentProps?: Partial<ExtractPropTypes<typeof SelectProps>> & {
21
+ componentProps?: Partial<ExtractPropTypes<SelectProps>> & {
22
22
  'onUpdate:modelValue'?: (value: any) => void;
23
23
  onChange?: (value: any) => void;
24
24
  onVisibleChange?: (visible: boolean) => void;
@@ -59,4 +59,4 @@ export type FieldSelectExpose = {
59
59
  focus: () => void;
60
60
  blur: () => void;
61
61
  };
62
- export declare function flatGroup(options: FieldSelectConvertedOption[]): any[];
62
+ export declare function flatGroup(options: FieldSelectConvertedOption[], children?: string): any[];
@@ -1,8 +1,8 @@
1
1
  const fieldSelectOmitKeys = ["options", "labelKey", "valueKey"];
2
- function flatGroup(options) {
2
+ function flatGroup(options, children = "children") {
3
3
  return options.map((option) => {
4
- if ("children" in option) {
5
- return option.children;
4
+ if (children in option) {
5
+ return option[children];
6
6
  }
7
7
  return option;
8
8
  }).flat();
@@ -2,12 +2,16 @@ import { ElSelect, ElOptionGroup, ElOption } from 'element-plus';
2
2
  import { defineComponent, computed, unref, h, mergeProps } from 'vue';
3
3
  import { fieldSelectOmitKeys, flatGroup } from './select.js';
4
4
  import { omit } from 'lodash-es';
5
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
6
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
7
  import { getLabelByValue } from '../../../../utils/collection.js';
7
8
 
8
9
  var stdin_default = defineComponent((props, {
9
10
  slots
10
11
  }) => {
12
+ const {
13
+ t
14
+ } = useLocale();
11
15
  const componentProps = computed(() => props.componentProps || {});
12
16
  const omittedProps = computed(() => omit(componentProps.value, fieldSelectOmitKeys));
13
17
  function convertRecur(options) {
@@ -49,7 +53,7 @@ var stdin_default = defineComponent((props, {
49
53
  });
50
54
  }
51
55
  return h(ElSelect, mergeProps({
52
- placeholder: "\u8BF7\u9009\u62E9",
56
+ placeholder: t("co.common.pleaseSelect"),
53
57
  clearable: true,
54
58
  style: {
55
59
  verticalAlign: "top"
@@ -1,8 +1,7 @@
1
1
  import { type FieldComponentCommonProps } from '../common';
2
- import { type ExtractPropTypes } from 'vue';
3
- import { SelectProps } from 'element-plus/es/components/select-v2/src/defaults.mjs';
2
+ import { type SelectV2Props } from 'element-plus/es/components/select-v2/src/defaults.mjs';
4
3
  export interface FieldSelectV2Props extends FieldComponentCommonProps {
5
- componentProps?: Partial<ExtractPropTypes<typeof SelectProps>> & {
4
+ componentProps?: Partial<SelectV2Props> & {
6
5
  'onUpdate:modelValue'?: (value: any) => void;
7
6
  onChange?: (value: any) => void;
8
7
  onVisibleChange?: (visible: boolean) => void;
@@ -11,6 +10,9 @@ export interface FieldSelectV2Props extends FieldComponentCommonProps {
11
10
  onBlur?: (event: FocusEvent) => void;
12
11
  onFocus?: (event: FocusEvent) => void;
13
12
  [key: PropertyKey]: any;
13
+ } & {
14
+ labelKey?: string;
15
+ valueKey?: string;
14
16
  };
15
17
  componentSlots?: Partial<FieldSelectV2Slots>;
16
18
  }
@@ -37,3 +39,4 @@ export type FieldSelectV2Expose = {
37
39
  focus: () => void;
38
40
  blur: () => void;
39
41
  };
42
+ export declare function flatGroup(options: SelectV2Props['options'], children?: string): any[];
@@ -1 +1,10 @@
1
+ function flatGroup(options, children = "options") {
2
+ return options.map((option) => {
3
+ if (children in option) {
4
+ return option[children];
5
+ }
6
+ return option;
7
+ }).flat();
8
+ }
1
9
 
10
+ export { flatGroup };
@@ -1,14 +1,32 @@
1
1
  import { ElSelectV2 } from 'element-plus';
2
- import { defineComponent, h } from 'vue';
2
+ import { defineComponent, computed, h, mergeProps } from 'vue';
3
+ import { flatGroup } from './select-v2.js';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
+ import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
+ import { getLabelByValue } from '../../../../utils/collection.js';
3
7
 
4
8
  var stdin_default = defineComponent((props, {
5
9
  slots
6
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
14
+ const componentProps = computed(() => props.componentProps || {});
7
15
  return () => {
8
16
  if (props.readonly) {
9
- return props.componentProps?.modelValue;
17
+ const value = componentProps.value.modelValue;
18
+ return addNullablePlaceholder(value, val => {
19
+ const label = getLabelByValue(flatGroup(componentProps.value.options || [], componentProps.value.props?.options), val);
20
+ return Array.isArray(label) ? label.join(", ") : label;
21
+ });
10
22
  }
11
- return h(ElSelectV2, props.componentProps, slots);
23
+ return h(ElSelectV2, mergeProps({
24
+ placeholder: t("co.common.pleaseSelect"),
25
+ clearable: true,
26
+ style: {
27
+ verticalAlign: "top"
28
+ }
29
+ }, componentProps.value), slots);
12
30
  };
13
31
  }, {
14
32
  name: "FieldSelectV2",
@@ -1,16 +1,20 @@
1
1
  import { ElInput } from 'element-plus';
2
2
  import { defineComponent, h } from 'vue';
3
+ import { useLocale } from '../../../../hooks/useLocale.js';
3
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
4
5
 
5
6
  var stdin_default = defineComponent((props, {
6
7
  slots
7
8
  }) => {
9
+ const {
10
+ t
11
+ } = useLocale();
8
12
  return () => {
9
13
  if (props.readonly) {
10
14
  return addNullablePlaceholder(props.componentProps?.modelValue);
11
15
  }
12
16
  return h(ElInput, {
13
- placeholder: "\u8BF7\u8F93\u5165",
17
+ placeholder: t("co.common.pleaseInput"),
14
18
  clearable: true,
15
19
  ...props.componentProps,
16
20
  type: "textarea"
@@ -2,18 +2,22 @@ import { ElTimePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
4
  import { TIME_FORMAT } from '../../../../utils/date.js';
5
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
6
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => dayjs(val).format(TIME_FORMAT));
14
18
  }
15
19
  return h(ElTimePicker, mergeProps({
16
- placeholder: "\u8BF7\u9009\u62E9",
20
+ placeholder: t("co.common.pleaseSelect"),
17
21
  style: {
18
22
  display: "flex",
19
23
  width: "100%"
@@ -1,20 +1,24 @@
1
1
  import { ElTimePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
  import { TIME_FORMAT } from '../../../../utils/date.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => val.map(item => dayjs(item).format(TIME_FORMAT)).join(" - "));
14
18
  }
15
19
  return h(ElTimePicker, mergeProps({
16
- startPlaceholder: "\u8BF7\u9009\u62E9",
17
- endPlaceholder: "\u8BF7\u9009\u62E9",
20
+ startPlaceholder: t("co.common.pleaseSelect"),
21
+ endPlaceholder: t("co.common.pleaseSelect"),
18
22
  style: {
19
23
  display: "flex",
20
24
  width: "100%"
@@ -1,16 +1,20 @@
1
1
  import { ElTimeSelect } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
+ import { useLocale } from '../../../../hooks/useLocale.js';
3
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
4
5
 
5
6
  var stdin_default = defineComponent((props, {
6
7
  slots
7
8
  }) => {
9
+ const {
10
+ t
11
+ } = useLocale();
8
12
  return () => {
9
13
  if (props.readonly) {
10
14
  return addNullablePlaceholder(props.componentProps?.modelValue);
11
15
  }
12
16
  return h(ElTimeSelect, mergeProps({
13
- placeholder: "\u8BF7\u9009\u62E9",
17
+ placeholder: t("co.common.pleaseSelect"),
14
18
  style: {
15
19
  verticalAlign: "top"
16
20
  }
@@ -1,11 +1,15 @@
1
1
  import { ElTreeSelect } from 'element-plus';
2
2
  import { defineComponent, computed, h, mergeProps } from 'vue';
3
+ import { useLocale } from '../../../../hooks/useLocale.js';
3
4
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
4
5
  import { getTreeLabelByValue } from '../../../../utils/collection.js';
5
6
 
6
7
  var stdin_default = defineComponent((props, {
7
8
  slots
8
9
  }) => {
10
+ const {
11
+ t
12
+ } = useLocale();
9
13
  const componentProps = computed(() => {
10
14
  return props.componentProps ?? {};
11
15
  });
@@ -23,7 +27,7 @@ var stdin_default = defineComponent((props, {
23
27
  return addNullablePlaceholder(value, val => getTreeLabelByValue(componentProps.value.data ?? [], val, mergedOptionProps.value).pop());
24
28
  }
25
29
  return h(ElTreeSelect, mergeProps({
26
- placeholder: "\u8BF7\u9009\u62E9",
30
+ placeholder: t("co.common.pleaseSelect"),
27
31
  clearable: true,
28
32
  style: {
29
33
  verticalAlign: "top"
@@ -2,19 +2,23 @@ import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
4
  import weekOfYear from 'dayjs/plugin/weekOfYear.js';
5
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
6
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
7
 
7
8
  dayjs.extend(weekOfYear);
8
9
  var stdin_default = defineComponent((props, {
9
10
  slots
10
11
  }) => {
12
+ const {
13
+ t
14
+ } = useLocale();
11
15
  return () => {
12
16
  if (props.readonly) {
13
17
  const value = props.componentProps?.modelValue;
14
- return addNullablePlaceholder(value, val => dayjs(val).format("YYYY-\u7B2Cw\u5468"));
18
+ return addNullablePlaceholder(value, val => dayjs(val).format(t("co.editor.weekOfYear")));
15
19
  }
16
20
  return h(ElDatePicker, mergeProps({
17
- placeholder: "\u8BF7\u9009\u62E9",
21
+ placeholder: t("co.common.pleaseSelect"),
18
22
  style: {
19
23
  display: "flex",
20
24
  width: "100%"
@@ -1,18 +1,22 @@
1
1
  import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
 
6
7
  var stdin_default = defineComponent((props, {
7
8
  slots
8
9
  }) => {
10
+ const {
11
+ t
12
+ } = useLocale();
9
13
  return () => {
10
14
  if (props.readonly) {
11
15
  const value = props.componentProps?.modelValue;
12
16
  return addNullablePlaceholder(value, val => dayjs(val).get("y"));
13
17
  }
14
18
  return h(ElDatePicker, mergeProps({
15
- placeholder: "\u8BF7\u9009\u62E9",
19
+ placeholder: t("co.common.pleaseSelect"),
16
20
  style: {
17
21
  display: "flex",
18
22
  width: "100%"
@@ -2,19 +2,23 @@ import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
4
  import { YEAR_FORMAT } from '../../../../utils/date.js';
5
+ import { useLocale } from '../../../../hooks/useLocale.js';
5
6
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
6
7
 
7
8
  var stdin_default = defineComponent((props, {
8
9
  slots
9
10
  }) => {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  return () => {
11
15
  if (props.readonly) {
12
16
  const value = props.componentProps?.modelValue;
13
17
  return addNullablePlaceholder(value, val => val.map(item => dayjs(item).format(YEAR_FORMAT)).join(" - "));
14
18
  }
15
19
  return h(ElDatePicker, mergeProps({
16
- startPlaceholder: "\u8BF7\u9009\u62E9",
17
- endPlaceholder: "\u8BF7\u9009\u62E9",
20
+ startPlaceholder: t("co.common.pleaseSelect"),
21
+ endPlaceholder: t("co.common.pleaseSelect"),
18
22
  style: {
19
23
  display: "flex",
20
24
  width: "100%"
@@ -1,18 +1,22 @@
1
1
  import { ElDatePicker } from 'element-plus';
2
2
  import { defineComponent, h, mergeProps } from 'vue';
3
3
  import dayjs from 'dayjs';
4
+ import { useLocale } from '../../../../hooks/useLocale.js';
4
5
  import { addNullablePlaceholder } from '../../../../utils/vue.js';
5
6
 
6
7
  var stdin_default = defineComponent((props, {
7
8
  slots
8
9
  }) => {
10
+ const {
11
+ t
12
+ } = useLocale();
9
13
  return () => {
10
14
  if (props.readonly) {
11
15
  const value = props.componentProps?.modelValue;
12
16
  return addNullablePlaceholder(value, val => val.map(item => dayjs(item).get("y")).join(", "));
13
17
  }
14
18
  return h(ElDatePicker, mergeProps({
15
- placeholder: "\u8BF7\u9009\u62E9",
19
+ placeholder: t("co.common.pleaseSelect"),
16
20
  style: {
17
21
  display: "flex",
18
22
  width: "100%"
@@ -95,7 +95,7 @@ export declare const formItemProps: {
95
95
  };
96
96
  error: StringConstructor;
97
97
  validateStatus: {
98
- readonly type: PropType<"" | "success" | "error" | "validating">;
98
+ readonly type: PropType<"" | "error" | "success" | "validating">;
99
99
  readonly required: false;
100
100
  readonly validator: ((val: unknown) => boolean) | undefined;
101
101
  __epPropKey: true;
@@ -113,6 +113,8 @@ export declare const formProps: {
113
113
  readonly required: false;
114
114
  readonly validator: ((val: unknown) => boolean) | undefined;
115
115
  __epPropKey: true;
116
+ } & {
117
+ readonly default: true;
116
118
  };
117
119
  size: {
118
120
  readonly type: PropType<"" | "default" | "large" | "small">;
@@ -27,11 +27,11 @@ const formProps = {
27
27
  },
28
28
  submitText: {
29
29
  type: String,
30
- default: "\u63D0\u4EA4"
30
+ default: "co.form.submit"
31
31
  },
32
32
  resetText: {
33
33
  type: String,
34
- default: "\u91CD\u7F6E"
34
+ default: "co.form.reset"
35
35
  },
36
36
  submitProps: {
37
37
  type: Object
@@ -109,6 +109,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
109
109
  readonly required: false;
110
110
  readonly validator: ((val: unknown) => boolean) | undefined;
111
111
  __epPropKey: true;
112
+ } & {
113
+ readonly default: true;
112
114
  };
113
115
  size: {
114
116
  readonly type: import("vue").PropType<"" | "default" | "large" | "small">;
@@ -236,6 +238,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
236
238
  readonly required: false;
237
239
  readonly validator: ((val: unknown) => boolean) | undefined;
238
240
  __epPropKey: true;
241
+ } & {
242
+ readonly default: true;
239
243
  };
240
244
  size: {
241
245
  readonly type: import("vue").PropType<"" | "default" | "large" | "small">;
@@ -265,6 +269,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
265
269
  validateOnRuleChange: boolean;
266
270
  hideRequiredAsterisk: boolean;
267
271
  scrollToError: boolean;
272
+ scrollIntoViewOptions: boolean | Record<string, any>;
268
273
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
269
274
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
270
275
  export default _default;
@@ -7,6 +7,7 @@ import { OptionalWrapper as _OptionalWrapper } from '../optional-wrapper/index.j
7
7
  import stdin_default$2 from './form-item.vue.js';
8
8
  import stdin_default$1 from './style/index.js';
9
9
  import { useComponentConfig } from '../config-provider/config-provider.js';
10
+ import { useLocale } from '../../hooks/useLocale.js';
10
11
 
11
12
  var stdin_default = /* @__PURE__ */defineComponent({
12
13
  ...{
@@ -24,6 +25,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
24
25
  const {
25
26
  hashId
26
27
  } = stdin_default$1(prefixCls);
28
+ const {
29
+ t
30
+ } = useLocale();
27
31
  const {
28
32
  elFormProps,
29
33
  expose,
@@ -70,7 +74,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
70
74
  loading: unref(submitting),
71
75
  onClick: _cache[0] || (_cache[0] = () => unref(submit)())
72
76
  }), {
73
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.submitText), 1
77
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)(_ctx.submitText)), 1
74
78
  /* TEXT */)]),
75
79
  _: 1
76
80
  /* STABLE */
@@ -79,7 +83,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
79
83
  }, _ctx.resetProps, {
80
84
  onClick: unref(reset)
81
85
  }), {
82
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.resetText), 1
86
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(t)(_ctx.resetText)), 1
83
87
  /* TEXT */)]),
84
88
  _: 1
85
89
  /* STABLE */
@@ -113,6 +113,8 @@ declare const _Form: {
113
113
  readonly required: false;
114
114
  readonly validator: ((val: unknown) => boolean) | undefined;
115
115
  __epPropKey: true;
116
+ } & {
117
+ readonly default: true;
116
118
  };
117
119
  size: {
118
120
  readonly type: import("vue").PropType<"" | "default" | "large" | "small">;
@@ -152,6 +154,7 @@ declare const _Form: {
152
154
  validateOnRuleChange: boolean;
153
155
  hideRequiredAsterisk: boolean;
154
156
  scrollToError: boolean;
157
+ scrollIntoViewOptions: boolean | Record<string, any>;
155
158
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
156
159
  P: {};
157
160
  B: {};
@@ -268,6 +271,8 @@ declare const _Form: {
268
271
  readonly required: false;
269
272
  readonly validator: ((val: unknown) => boolean) | undefined;
270
273
  __epPropKey: true;
274
+ } & {
275
+ readonly default: true;
271
276
  };
272
277
  size: {
273
278
  readonly type: import("vue").PropType<"" | "default" | "large" | "small">;
@@ -305,6 +310,7 @@ declare const _Form: {
305
310
  validateOnRuleChange: boolean;
306
311
  hideRequiredAsterisk: boolean;
307
312
  scrollToError: boolean;
313
+ scrollIntoViewOptions: boolean | Record<string, any>;
308
314
  }>;
309
315
  __isFragment?: never;
310
316
  __isTeleport?: never;
@@ -418,6 +424,8 @@ declare const _Form: {
418
424
  readonly required: false;
419
425
  readonly validator: ((val: unknown) => boolean) | undefined;
420
426
  __epPropKey: true;
427
+ } & {
428
+ readonly default: true;
421
429
  };
422
430
  size: {
423
431
  readonly type: import("vue").PropType<"" | "default" | "large" | "small">;
@@ -457,6 +465,7 @@ declare const _Form: {
457
465
  validateOnRuleChange: boolean;
458
466
  hideRequiredAsterisk: boolean;
459
467
  scrollToError: boolean;
468
+ scrollIntoViewOptions: boolean | Record<string, any>;
460
469
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
461
470
  $slots: import("./form").FormSlots;
462
471
  }) & import("vue").Plugin;
@@ -489,7 +498,7 @@ declare const _FormItem: (<T extends import("..").FieldType>(__VLS_props: NonNul
489
498
  readonly error?: string | undefined;
490
499
  readonly required?: boolean | undefined;
491
500
  readonly rules?: (import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | undefined;
492
- readonly validateStatus?: ("" | "success" | "error" | "validating") | undefined;
501
+ readonly validateStatus?: ("" | "error" | "success" | "validating") | undefined;
493
502
  readonly for?: string | undefined;
494
503
  } & import("vue").PublicProps;
495
504
  expose(exposed: import("vue").ShallowUnwrapRef<import("element-plus").FormItemInstance>): void;