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.
- package/README.md +61 -0
- package/components/close/style/index.js +2 -2
- package/components/col/col.vue.js +1 -1
- package/components/col/style/index.js +3 -3
- package/components/config-provider/config-provider.d.ts +2 -0
- package/components/config-provider/config-provider.vue.js +13 -3
- package/components/context-menu/context-menu.vue.js +4 -4
- package/components/context-menu/context-sub-menu.vue.js +2 -2
- package/components/context-menu/style/index.js +2 -2
- package/components/editor/components/color-picker/color-picker.vue.js +15 -11
- package/components/editor/components/color-picker/useHistoryColor.js +3 -3
- package/components/editor/components/resize/resize.js +9 -9
- package/components/editor/components/resize/resize.style.js +20 -20
- package/components/editor/components/resize/resize.vue.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
- package/components/editor/components/toolbar/formats/font.vue.js +5 -1
- package/components/editor/components/toolbar/formats/header.vue.js +6 -2
- package/components/editor/components/toolbar/formats/link.vue.js +17 -13
- package/components/editor/components/toolbar/formats/size.vue.js +5 -1
- package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
- package/components/editor/components/toolbar/formats/source.vue.js +78 -0
- package/components/editor/components/toolbar/formats/table.style.js +2 -2
- package/components/editor/components/toolbar/formats/video.vue.js +9 -5
- package/components/editor/components/toolbar/toolbar.vue.js +5 -0
- package/components/editor/formats/font.js +2 -2
- package/components/editor/formats/indent.js +1 -1
- package/components/editor/formats/kbd.d.ts +7 -0
- package/components/editor/formats/kbd.js +13 -0
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
- package/components/editor/quill.js +8 -6
- package/components/editor/style/index.js +25 -16
- package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
- package/components/field/components/cascader/cascader.vue.js +5 -1
- package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
- package/components/field/components/checkbox-group/panel.vue.js +10 -5
- package/components/field/components/date/date.vue.js +5 -1
- package/components/field/components/date-range/date-range.vue.js +6 -2
- package/components/field/components/date-time/date-time.vue.js +5 -1
- package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
- package/components/field/components/dates/dates.vue.js +5 -1
- package/components/field/components/input/input.vue.js +5 -1
- package/components/field/components/input-tag/input-tag.vue.js +5 -1
- package/components/field/components/mention/mention.vue.js +5 -1
- package/components/field/components/month/month.vue.js +5 -1
- package/components/field/components/month-range/month-range.vue.js +6 -2
- package/components/field/components/months/months.vue.js +5 -1
- package/components/field/components/password/password.vue.js +5 -1
- package/components/field/components/select/select.d.ts +2 -2
- package/components/field/components/select/select.js +3 -3
- package/components/field/components/select/select.vue.js +5 -1
- package/components/field/components/select-v2/select-v2.d.ts +6 -3
- package/components/field/components/select-v2/select-v2.js +9 -0
- package/components/field/components/select-v2/select-v2.vue.js +21 -3
- package/components/field/components/textarea/textarea.vue.js +5 -1
- package/components/field/components/time/time.vue.js +5 -1
- package/components/field/components/time-range/time-range.vue.js +6 -2
- package/components/field/components/time-select/time-select.vue.js +5 -1
- package/components/field/components/tree-select/tree-select.vue.js +5 -1
- package/components/field/components/week/week.vue.js +6 -2
- package/components/field/components/year/year.vue.js +5 -1
- package/components/field/components/year-range/year-range.vue.js +6 -2
- package/components/field/components/years/years.vue.js +5 -1
- package/components/form/form-item.d.ts +1 -1
- package/components/form/form.d.ts +2 -0
- package/components/form/form.js +2 -2
- package/components/form/form.vue.d.ts +5 -0
- package/components/form/form.vue.js +6 -2
- package/components/form/index.d.ts +10 -1
- package/components/form/useBubbleTemplate.js +13 -5
- package/components/form-dialog/form-dialog.js +2 -2
- package/components/form-dialog/index.d.ts +4 -1552
- package/components/form-list/form-list.js +1 -1
- package/components/form-list/form-list.vue.js +5 -1
- package/components/form-list/index.d.ts +1 -1
- package/components/form-query/form-query.d.ts +2 -0
- package/components/form-query/form-query.vue.d.ts +5 -0
- package/components/form-query/form-query.vue.js +13 -7
- package/components/form-query/index.d.ts +9 -0
- package/components/highlight/style/index.js +2 -2
- package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
- package/components/image-card/image-card.d.ts +1 -8
- package/components/image-card/image-card.vue.d.ts +4 -18
- package/components/image-card/index.d.ts +8 -29
- package/components/long-text/style/index.js +2 -2
- package/components/mask/style/index.js +2 -2
- package/components/row/row.vue.js +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -1
- package/components/scroll-view/style/index.js +9 -9
- package/components/table/index.d.ts +73 -78
- package/components/table/table-column/renderer.d.ts +2 -1
- package/components/table/table-column/renderer.js +2 -2
- package/components/table/table-column/table-column.d.ts +15 -15
- package/components/table/table-column/table-column.vue.d.ts +9 -5
- package/components/table/table-column/table-column.vue.js +5 -1
- package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
- package/components/table/table-export/table-export.vue.js +31 -26
- package/components/table/table-query/table-query.d.ts +2 -0
- package/components/table/table-query/table-query.vue.d.ts +5 -0
- package/components/table/table.d.ts +22 -25
- package/components/table/table.vue.d.ts +45 -51
- package/components/table/table.vue.js +13 -9
- package/components/table/useTable.d.ts +2 -1
- package/components/table/useTable.js +2 -2
- package/components/table-action/index.d.ts +48 -6
- package/components/table-action/item.d.ts +16 -2
- package/components/table-action/item.vue.d.ts +34 -6
- package/components/table-action/item.vue.js +15 -9
- package/components/table-action/table-action.vue.d.ts +16 -2
- package/components/toggle/toggle.vue.js +5 -1
- package/components/upload/style/index.js +2 -2
- package/components/upload/upload-item.vue.d.ts +2 -2
- package/components/upload/upload-item.vue.js +16 -9
- package/components/upload/upload.vue.js +7 -1
- package/config/index.d.ts +1 -2
- package/config/index.js +2 -2
- package/config/nprogress.style.js +5 -5
- package/config/root-config-provider.vue.js +5 -5
- package/constant.d.ts +2 -2
- package/constant.js +2 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useColorScheme.js +4 -4
- package/hooks/useDir.d.ts +2 -0
- package/hooks/useDir.js +20 -0
- package/hooks/useEcharts.d.ts +3 -2
- package/hooks/useEcharts.js +15 -3
- package/hooks/useLocale.d.ts +23 -371
- package/hooks/useLocale.js +26 -35
- package/hooks/useUpsert.d.ts +5 -3
- package/hooks/useUpsert.js +33 -25
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/layout/layout-auth/style/index.js +6 -6
- package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
- package/layout/layout-change-password/layout-change-password.vue.js +28 -22
- package/layout/layout-content/layout-content.vue.js +1 -1
- package/layout/layout-content/style/index.js +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
- package/layout/layout-header/layout-header.vue.js +4 -4
- package/layout/layout-header/style/index.js +3 -3
- package/layout/layout-iframe/style/index.js +2 -2
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
- package/layout/layout-login/layout-login.vue.js +19 -14
- package/layout/layout-main/layout-main.vue.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -1
- package/layout/layout-menu/style/index.js +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +11 -6
- package/layout/layout-search/layout-search.vue.js +22 -14
- package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
- package/layout/layout-sidebar/style/index.js +2 -2
- package/layout/layout-snug-aside/style/index.js +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
- package/layout/layout-tabbar/style/index.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
- package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
- package/locale/index.d.ts +10 -0
- package/locale/index.js +2 -0
- package/locale/lang/ar.d.ts +280 -0
- package/locale/lang/ar.js +129 -0
- package/locale/lang/en.d.ts +302 -0
- package/locale/lang/en.js +129 -0
- package/locale/lang/zh-cn.d.ts +301 -0
- package/locale/lang/zh-cn.js +129 -0
- package/package.json +10 -8
- package/request/useRequest.js +31 -23
- package/store/index.d.ts +1 -1
- package/store/index.js +6 -3
- package/store/layout.js +208 -190
- package/store/plugin.d.ts +9 -0
- package/store/plugin.js +22 -0
- package/store/user.d.ts +1 -1
- package/utils/css.d.ts +4 -0
- package/utils/css.js +5 -2
- package/utils/excel/bookFormats.js +5 -5
- package/utils/excel/xlsx.js +2 -2
- package/utils/index.js +1 -1
- package/utils/message-box.js +3 -1
- package/utils/tree.js +2 -2
- 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: "
|
|
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: "
|
|
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: "
|
|
17
|
-
endPlaceholder: "
|
|
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: "
|
|
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: "
|
|
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<
|
|
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 (
|
|
5
|
-
return option
|
|
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: "
|
|
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
|
|
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<
|
|
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,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
|
-
|
|
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,
|
|
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: "
|
|
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: "
|
|
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: "
|
|
17
|
-
endPlaceholder: "
|
|
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: "
|
|
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: "
|
|
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("
|
|
18
|
+
return addNullablePlaceholder(value, val => dayjs(val).format(t("co.editor.weekOfYear")));
|
|
15
19
|
}
|
|
16
20
|
return h(ElDatePicker, mergeProps({
|
|
17
|
-
placeholder: "
|
|
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: "
|
|
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: "
|
|
17
|
-
endPlaceholder: "
|
|
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: "
|
|
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<"" | "
|
|
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">;
|
package/components/form/form.js
CHANGED
|
@@ -27,11 +27,11 @@ const formProps = {
|
|
|
27
27
|
},
|
|
28
28
|
submitText: {
|
|
29
29
|
type: String,
|
|
30
|
-
default: "
|
|
30
|
+
default: "co.form.submit"
|
|
31
31
|
},
|
|
32
32
|
resetText: {
|
|
33
33
|
type: String,
|
|
34
|
-
default: "
|
|
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?: ("" | "
|
|
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;
|