@gct-paas/design-web 0.1.4-dev.13 → 0.1.4-dev.14
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/dist/index.min.css +1 -1
- package/dist/loader.esm.min.js +1 -778
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +2 -2
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +1 -1
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_style_index_0_scoped_64c5221c_lang.css +3 -0
- package/es/components/form-component/FieldCheckbox.d.ts +38 -0
- package/es/components/form-component/FieldCheckbox.mjs +71 -0
- package/es/components/form-component/FieldRadio.d.ts +38 -0
- package/es/components/form-component/FieldRadio.mjs +64 -0
- package/es/components/form-component/FieldSelect.d.ts +82 -0
- package/es/components/form-component/FieldSelect.mjs +174 -0
- package/es/components/form-component/field-emptyValue.d.ts +6 -0
- package/es/components/form-component/field-label/selectTag.vue.d.ts +10 -0
- package/es/components/form-component/field-label/selectTag.vue.mjs +5 -0
- package/es/components/form-component/field-label/selectTag.vue_vue_type_script_setup_true_lang.mjs +22 -0
- package/es/components/form-component/field-label/tag-label.vue.d.ts +36 -0
- package/es/components/form-component/field-label/tag-label.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_script_setup_true_lang.mjs +143 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_style_index_0_scoped_a1ded441_lang.css +15 -0
- package/es/components/form-component/field-label/tag-layout.vue.d.ts +21 -0
- package/es/components/form-component/field-label/tag-layout.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-layout.vue_vue_type_script_setup_true_lang.mjs +16 -0
- package/es/components/form-component/field-label/tag-layout.vue_vue_type_style_index_0_scoped_85e6a8f5_lang.css +12 -0
- package/es/components/form-component/field-label/tag-span.vue.d.ts +21 -0
- package/es/components/form-component/field-label/tag-span.vue.mjs +7 -0
- package/es/components/form-component/field-label/tag-span.vue_vue_type_script_setup_true_lang.mjs +25 -0
- package/es/components/form-component/field-label/tag-span.vue_vue_type_style_index_0_scoped_3bf855f6_lang.css +31 -0
- package/es/components/form-component/field-readonly.vue.d.ts +22 -0
- package/es/components/form-component/field-readonly.vue.mjs +5 -0
- package/es/components/form-component/field-readonly.vue_vue_type_script_setup_true_lang.mjs +82 -0
- package/es/components/form-component/index.css +40 -0
- package/es/components/form-component/index.d.ts +7 -0
- package/es/components/form-component/index.mjs +6 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +7 -0
- package/es/index.mjs +7 -1
- package/package.json +8 -12
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_style_index_0_scoped_412e1309_lang.css +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
2
|
import i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default from "./i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs";
|
|
3
|
-
import './i18n-select-input.
|
|
3
|
+
import './i18n-select-input.vue_vue_type_style_index_0_scoped_64c5221c_lang.css';/* empty css */
|
|
4
4
|
//#region src/components/I18nSelect/src/i18n-select-input.vue
|
|
5
|
-
var i18n_select_input_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default, [["__scopeId", "data-v-
|
|
5
|
+
var i18n_select_input_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default, [["__scopeId", "data-v-64c5221c"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { i18n_select_input_default as default };
|
|
@@ -46,7 +46,7 @@ var i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang
|
|
|
46
46
|
return props.i18nConfig ?? {};
|
|
47
47
|
});
|
|
48
48
|
const i18nValue = computed(() => {
|
|
49
|
-
return i18nConfigState.value?.[props.attr];
|
|
49
|
+
return i18nConfigState.value?.[props.attr] ?? "";
|
|
50
50
|
});
|
|
51
51
|
const handleSelectI18n = (params) => {
|
|
52
52
|
console.log("emit", params);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { CheckboxGroupProps } from 'ant-design-vue';
|
|
3
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
4
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
5
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
design: BooleanConstructor;
|
|
7
|
+
disabled: BooleanConstructor;
|
|
8
|
+
readonly: BooleanConstructor;
|
|
9
|
+
fieldType: {
|
|
10
|
+
type: PropType<FIELD_TYPE>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
tagStyle: {
|
|
14
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
options: PropType<CheckboxGroupProps["options"]>;
|
|
18
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
design: BooleanConstructor;
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
readonly: BooleanConstructor;
|
|
23
|
+
fieldType: {
|
|
24
|
+
type: PropType<FIELD_TYPE>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
tagStyle: {
|
|
28
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
options: PropType<CheckboxGroupProps["options"]>;
|
|
32
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
design: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import { computed, createVNode, defineComponent } from "vue";
|
|
4
|
+
import { FIELD_TYPE } from "@gct-paas/core";
|
|
5
|
+
import { Checkbox, CheckboxGroup } from "ant-design-vue";
|
|
6
|
+
//#region src/components/form-component/FieldCheckbox.tsx
|
|
7
|
+
var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "FieldCheckbox",
|
|
9
|
+
props: {
|
|
10
|
+
design: Boolean,
|
|
11
|
+
disabled: Boolean,
|
|
12
|
+
readonly: Boolean,
|
|
13
|
+
fieldType: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
tagStyle: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
options: Array,
|
|
22
|
+
value: [String, Number]
|
|
23
|
+
},
|
|
24
|
+
setup(props, { emit }) {
|
|
25
|
+
const isBool = props.fieldType === FIELD_TYPE.BOOLEAN;
|
|
26
|
+
const currentValue = computed({
|
|
27
|
+
get() {
|
|
28
|
+
if (isBool) return [props.value];
|
|
29
|
+
return Array.isArray(props.value) ? props.value : props.value ? props.value.split(",") : void 0;
|
|
30
|
+
},
|
|
31
|
+
set(value) {
|
|
32
|
+
if (isBool) {
|
|
33
|
+
const bool = value?.[0];
|
|
34
|
+
if (bool === void 0 || bool === null || typeof bool !== "boolean") emit("update:value", Boolean(bool));
|
|
35
|
+
else emit("update:value", !!bool);
|
|
36
|
+
} else emit("update:value", value);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const options = computed(() => {
|
|
40
|
+
if (isBool) return (props.options ?? []).filter((item) => item.value);
|
|
41
|
+
return props.options ?? [];
|
|
42
|
+
});
|
|
43
|
+
return () => {
|
|
44
|
+
return createVNode(CheckboxGroup, {
|
|
45
|
+
"value": currentValue.value,
|
|
46
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
47
|
+
"disabled": props.disabled,
|
|
48
|
+
"class": ["field-checkbox-group", props.readonly ? "field-checkbox-group--readonly" : ""]
|
|
49
|
+
}, { default: () => [options.value?.map((option) => {
|
|
50
|
+
const optionItem = option;
|
|
51
|
+
const { icon, iconColor, textColor } = optionItem?._item || {};
|
|
52
|
+
return createVNode(Checkbox, {
|
|
53
|
+
"key": optionItem.value,
|
|
54
|
+
"value": optionItem.value
|
|
55
|
+
}, { default: () => [createVNode(field_readonly_default, {
|
|
56
|
+
"tagWidgetStyle": props.tagStyle,
|
|
57
|
+
"type": props.fieldType,
|
|
58
|
+
"label": optionItem.label,
|
|
59
|
+
"disabled": props.disabled,
|
|
60
|
+
"iconExtraProps": { [optionItem.label]: {
|
|
61
|
+
icon,
|
|
62
|
+
iconColor,
|
|
63
|
+
textColor
|
|
64
|
+
} }
|
|
65
|
+
}, null)] });
|
|
66
|
+
})] });
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { FieldCheckbox_default as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { RadioGroupProps } from 'ant-design-vue';
|
|
3
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
4
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
5
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
design: BooleanConstructor;
|
|
7
|
+
disabled: BooleanConstructor;
|
|
8
|
+
readonly: BooleanConstructor;
|
|
9
|
+
fieldType: {
|
|
10
|
+
type: PropType<FIELD_TYPE>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
tagStyle: {
|
|
14
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
options: PropType<RadioGroupProps["options"]>;
|
|
18
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
design: BooleanConstructor;
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
readonly: BooleanConstructor;
|
|
23
|
+
fieldType: {
|
|
24
|
+
type: PropType<FIELD_TYPE>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
tagStyle: {
|
|
28
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
options: PropType<RadioGroupProps["options"]>;
|
|
32
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
design: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import { computed, createVNode, defineComponent, isVNode } from "vue";
|
|
4
|
+
import { Radio, RadioGroup } from "ant-design-vue";
|
|
5
|
+
//#region src/components/form-component/FieldRadio.tsx
|
|
6
|
+
function _isSlot(s) {
|
|
7
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
8
|
+
}
|
|
9
|
+
var FieldRadio_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "FieldRadio",
|
|
11
|
+
props: {
|
|
12
|
+
design: Boolean,
|
|
13
|
+
disabled: Boolean,
|
|
14
|
+
readonly: Boolean,
|
|
15
|
+
fieldType: {
|
|
16
|
+
type: Object,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
tagStyle: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
options: Array,
|
|
24
|
+
value: [String, Number]
|
|
25
|
+
},
|
|
26
|
+
setup(props, { emit }) {
|
|
27
|
+
const currentValue = computed({
|
|
28
|
+
get() {
|
|
29
|
+
return props.value;
|
|
30
|
+
},
|
|
31
|
+
set(value) {
|
|
32
|
+
emit("update:value", value);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return () => {
|
|
36
|
+
let _slot;
|
|
37
|
+
return createVNode(RadioGroup, {
|
|
38
|
+
"value": currentValue.value,
|
|
39
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
40
|
+
"disabled": props.disabled,
|
|
41
|
+
"class": ["field-radio-group", props.readonly ? "field-radio-group--readonly" : ""]
|
|
42
|
+
}, _isSlot(_slot = (props.options ?? []).map((option) => {
|
|
43
|
+
const optionItem = option;
|
|
44
|
+
const { icon, iconColor, textColor } = optionItem?._item || {};
|
|
45
|
+
return createVNode(Radio, {
|
|
46
|
+
"key": optionItem.value,
|
|
47
|
+
"value": optionItem.value
|
|
48
|
+
}, { default: () => [createVNode(field_readonly_default, {
|
|
49
|
+
"tagWidgetStyle": props.tagStyle,
|
|
50
|
+
"type": props.fieldType,
|
|
51
|
+
"label": optionItem.label,
|
|
52
|
+
"disabled": props.disabled,
|
|
53
|
+
"iconExtraProps": { [optionItem.label]: {
|
|
54
|
+
icon,
|
|
55
|
+
iconColor,
|
|
56
|
+
textColor
|
|
57
|
+
} }
|
|
58
|
+
}, null)] });
|
|
59
|
+
})) ? _slot : { default: () => [_slot] });
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { FieldRadio_default as default };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { SelectProps } from 'ant-design-vue';
|
|
3
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
4
|
+
import { FIELD_TYPE, FormComponents } from '@gct-paas/core';
|
|
5
|
+
interface ISelectExtraProps {
|
|
6
|
+
mode?: 'multiple' | undefined;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
optionLabelProp?: string | undefined;
|
|
9
|
+
allowClear?: boolean;
|
|
10
|
+
showSearch?: boolean;
|
|
11
|
+
optionNoStyle?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
14
|
+
design: BooleanConstructor;
|
|
15
|
+
disabled: BooleanConstructor;
|
|
16
|
+
readonly: BooleanConstructor;
|
|
17
|
+
selectExtraProps: PropType<ISelectExtraProps>;
|
|
18
|
+
fieldType: {
|
|
19
|
+
type: PropType<FIELD_TYPE>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
type: {
|
|
23
|
+
type: PropType<FormComponents>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
tagStyle: {
|
|
27
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
options: PropType<SelectProps["options"]>;
|
|
31
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
32
|
+
maxTagCount: {
|
|
33
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
maxTagTextLength: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
selectOptionLabel: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
};
|
|
43
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
design: BooleanConstructor;
|
|
47
|
+
disabled: BooleanConstructor;
|
|
48
|
+
readonly: BooleanConstructor;
|
|
49
|
+
selectExtraProps: PropType<ISelectExtraProps>;
|
|
50
|
+
fieldType: {
|
|
51
|
+
type: PropType<FIELD_TYPE>;
|
|
52
|
+
required: true;
|
|
53
|
+
};
|
|
54
|
+
type: {
|
|
55
|
+
type: PropType<FormComponents>;
|
|
56
|
+
required: true;
|
|
57
|
+
};
|
|
58
|
+
tagStyle: {
|
|
59
|
+
type: PropType<LowCodeWidget.BasicStyle>;
|
|
60
|
+
required: true;
|
|
61
|
+
};
|
|
62
|
+
options: PropType<SelectProps["options"]>;
|
|
63
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
64
|
+
maxTagCount: {
|
|
65
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
66
|
+
default: number;
|
|
67
|
+
};
|
|
68
|
+
maxTagTextLength: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
selectOptionLabel: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{}>, {
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
readonly: boolean;
|
|
78
|
+
maxTagCount: string | number;
|
|
79
|
+
maxTagTextLength: number;
|
|
80
|
+
design: boolean;
|
|
81
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
82
|
+
export default _default;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import tag_label_default from "./field-label/tag-label.vue.mjs";
|
|
2
|
+
import field_readonly_default from "./field-readonly.vue.mjs";
|
|
3
|
+
import selectTag_default from "./field-label/selectTag.vue.mjs";
|
|
4
|
+
import './index.css';/* empty css */
|
|
5
|
+
import { computed, createVNode, defineComponent, h, mergeProps } from "vue";
|
|
6
|
+
import { pick } from "lodash-es";
|
|
7
|
+
import { transformUrl } from "@gct-paas/core-web";
|
|
8
|
+
import { FormComponents } from "@gct-paas/core";
|
|
9
|
+
import { Avatar, Select } from "ant-design-vue";
|
|
10
|
+
//#region src/components/form-component/FieldSelect.tsx
|
|
11
|
+
var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
12
|
+
name: "FieldSelect",
|
|
13
|
+
props: {
|
|
14
|
+
design: Boolean,
|
|
15
|
+
disabled: Boolean,
|
|
16
|
+
readonly: Boolean,
|
|
17
|
+
selectExtraProps: Object,
|
|
18
|
+
fieldType: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
tagStyle: {
|
|
27
|
+
type: Object,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
options: Array,
|
|
31
|
+
value: [String, Number],
|
|
32
|
+
maxTagCount: {
|
|
33
|
+
type: [Number, String],
|
|
34
|
+
default: 5
|
|
35
|
+
},
|
|
36
|
+
maxTagTextLength: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 6
|
|
39
|
+
},
|
|
40
|
+
selectOptionLabel: { type: String }
|
|
41
|
+
},
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
const currentValue = computed({
|
|
44
|
+
get() {
|
|
45
|
+
return props.value;
|
|
46
|
+
},
|
|
47
|
+
set(value) {
|
|
48
|
+
emit("update:value", value);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const renderTag = (com, { name, iconExtraProps, otherParams = {} }) => {
|
|
52
|
+
return h(com, {
|
|
53
|
+
tagWidgetStyle: props.tagStyle,
|
|
54
|
+
type: props.fieldType,
|
|
55
|
+
label: name,
|
|
56
|
+
disabled: props.disabled,
|
|
57
|
+
iconExtraProps,
|
|
58
|
+
...otherParams
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const renderSelectTag = ({ name, title, iconExtraProps, avatar, otherParams = {} }) => {
|
|
62
|
+
return createVNode(selectTag_default, mergeProps({
|
|
63
|
+
"tagWidgetStyle": props.tagStyle,
|
|
64
|
+
"type": props.fieldType,
|
|
65
|
+
"label": name,
|
|
66
|
+
"avatar": avatar,
|
|
67
|
+
"title": title?.length > props.maxTagTextLength ? title : null,
|
|
68
|
+
"disabled": props.disabled,
|
|
69
|
+
"iconExtraProps": iconExtraProps
|
|
70
|
+
}, otherParams), null);
|
|
71
|
+
};
|
|
72
|
+
const options = computed(() => {
|
|
73
|
+
return (props.options ?? []).map((item) => {
|
|
74
|
+
const { iconColor, icon, textColor } = item._item || {};
|
|
75
|
+
return {
|
|
76
|
+
...item,
|
|
77
|
+
[props.selectExtraProps?.optionLabelProp || "titleLabel"]: renderTag(tag_label_default, {
|
|
78
|
+
name: item.label,
|
|
79
|
+
iconExtraProps: { [item.label]: {
|
|
80
|
+
icon,
|
|
81
|
+
iconColor,
|
|
82
|
+
textColor
|
|
83
|
+
} }
|
|
84
|
+
})
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
function getLabelByDict(item, key) {
|
|
89
|
+
const { _DICT = {} } = item;
|
|
90
|
+
const value = item[key];
|
|
91
|
+
return _DICT[key]?.[value]?.join(",") ?? value ?? item.id_;
|
|
92
|
+
}
|
|
93
|
+
const selectInfo = computed(() => {
|
|
94
|
+
if (props.readonly) {
|
|
95
|
+
const list = options.value?.filter((item) => {
|
|
96
|
+
if (props.selectExtraProps?.mode === "multiple") return Array.isArray(currentValue.value) && currentValue.value.includes(item.value);
|
|
97
|
+
return item.value === currentValue.value;
|
|
98
|
+
}) ?? [];
|
|
99
|
+
const icons = Object.fromEntries(list?.map((item) => {
|
|
100
|
+
return [item.label, pick(item?._item || {}, [
|
|
101
|
+
"iconColor",
|
|
102
|
+
"icon",
|
|
103
|
+
"textColor"
|
|
104
|
+
])];
|
|
105
|
+
}) ?? []);
|
|
106
|
+
return {
|
|
107
|
+
labels: list.map((e) => e.label),
|
|
108
|
+
icons
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {};
|
|
112
|
+
});
|
|
113
|
+
const slot = { option: (data) => {
|
|
114
|
+
const { label, _item = {} } = data;
|
|
115
|
+
if (props.type === FormComponents.Userpicker) return createVNode("div", { "class": "flex items-center" }, [createVNode(Avatar, {
|
|
116
|
+
"size": 30,
|
|
117
|
+
"style": "margin: 0 8px;min-width:32px",
|
|
118
|
+
"src": transformUrl(_item.avatar)
|
|
119
|
+
}, null), createVNode("div", { "style": "width:calc(100% - 35px)" }, [createVNode("div", {
|
|
120
|
+
"class": " w100% ell",
|
|
121
|
+
"title": label
|
|
122
|
+
}, [label]), createVNode("div", { "class": "text-[#8F8F8F] text-[12px] mt2px" }, [_item.masterOrgName])])]);
|
|
123
|
+
else return renderTag(tag_label_default, {
|
|
124
|
+
name: props.selectOptionLabel ? getLabelByDict(_item, props.selectOptionLabel) : label,
|
|
125
|
+
iconExtraProps: { [label]: pick(_item, [
|
|
126
|
+
"iconColor",
|
|
127
|
+
"icon",
|
|
128
|
+
"textColor"
|
|
129
|
+
]) },
|
|
130
|
+
otherParams: { showTagStyle: false }
|
|
131
|
+
});
|
|
132
|
+
} };
|
|
133
|
+
const tagRender = (data) => {
|
|
134
|
+
const { label, option, closable, onClose } = data;
|
|
135
|
+
const { _item = {} } = option || {};
|
|
136
|
+
return renderSelectTag({
|
|
137
|
+
name: label,
|
|
138
|
+
title: option?.label,
|
|
139
|
+
avatar: option?._item?.avatar,
|
|
140
|
+
iconExtraProps: { [label]: pick(_item, [
|
|
141
|
+
"iconColor",
|
|
142
|
+
"icon",
|
|
143
|
+
"textColor"
|
|
144
|
+
]) },
|
|
145
|
+
otherParams: {
|
|
146
|
+
closable,
|
|
147
|
+
"onOn-close": onClose,
|
|
148
|
+
style: "margin-right: 4px"
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
return () => {
|
|
153
|
+
return props.readonly ? renderTag(field_readonly_default, {
|
|
154
|
+
name: selectInfo.value?.labels,
|
|
155
|
+
iconExtraProps: selectInfo.value?.icons
|
|
156
|
+
}) : createVNode(Select, mergeProps({
|
|
157
|
+
"class": ["field-select", "w100%"],
|
|
158
|
+
"value": currentValue.value,
|
|
159
|
+
"onUpdate:value": ($event) => currentValue.value = $event,
|
|
160
|
+
"options": options.value,
|
|
161
|
+
"disabled": props.disabled,
|
|
162
|
+
"optionLabelProp": "titleLabel",
|
|
163
|
+
"tagRender": tagRender,
|
|
164
|
+
"showArrow": true,
|
|
165
|
+
"maxTagCount": props.maxTagCount,
|
|
166
|
+
"maxTagTextLength": props.maxTagTextLength,
|
|
167
|
+
"dropdownMatchSelectWidth": 180,
|
|
168
|
+
"dropdownClassName": props.selectExtraProps?.mode === "multiple" ? "gct-project-select-dropdown gct-project-select-multiple vxe-table--ignore-clear" : "gct-project-select-dropdown vxe-table--ignore-clear"
|
|
169
|
+
}, props.selectExtraProps), props.selectExtraProps?.optionNoStyle ? null : slot);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
//#endregion
|
|
174
|
+
export { FieldSelect_default as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
/**空值显示逻辑 */
|
|
3
|
+
export declare function emptyValueDisplay(widget: LowCodeWidget.FieldSchema, value: IObject): {
|
|
4
|
+
RenderEmptyValue: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
|
|
5
|
+
isEmpty: import('vue').ComputedRef<boolean | undefined>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
export interface Props {
|
|
3
|
+
tagWidgetStyle: {
|
|
4
|
+
tagStyleOpen: boolean;
|
|
5
|
+
contentFont: LowCodeWidget.FontStyle;
|
|
6
|
+
tagStyle?: LowCodeWidget.TagConfigStyle;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import selectTag_vue_vue_type_script_setup_true_lang_default from "./selectTag.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/components/form-component/field-label/selectTag.vue
|
|
3
|
+
var selectTag_default = selectTag_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { selectTag_default as default };
|
package/es/components/form-component/field-label/selectTag.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import tag_label_default from "./tag-label.vue.mjs";
|
|
2
|
+
import { createBlock, defineComponent, openBlock, toRef } from "vue";
|
|
3
|
+
//#region src/components/form-component/field-label/selectTag.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var selectTag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "selectTag",
|
|
6
|
+
props: { tagWidgetStyle: {} },
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const props = __props;
|
|
9
|
+
const tagWidgetStyle = toRef(() => {
|
|
10
|
+
if (!props.tagWidgetStyle.tagStyleOpen) return {
|
|
11
|
+
tagStyleOpen: true,
|
|
12
|
+
contentFont: props.tagWidgetStyle?.contentFont
|
|
13
|
+
};
|
|
14
|
+
else return props.tagWidgetStyle;
|
|
15
|
+
});
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createBlock(tag_label_default, { "tag-widget-style": tagWidgetStyle.value }, null, 8, ["tag-widget-style"]);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { selectTag_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
3
|
+
export interface Props {
|
|
4
|
+
tagWidgetStyle?: {
|
|
5
|
+
tagStyleOpen?: boolean;
|
|
6
|
+
contentFont?: LowCodeWidget.FontStyle;
|
|
7
|
+
tagStyle?: LowCodeWidget.TagConfigStyle;
|
|
8
|
+
};
|
|
9
|
+
type?: FIELD_TYPE | undefined;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
label?: string | (string | number)[];
|
|
12
|
+
isDesign?: boolean;
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
/** 外部控制是否显示标签样式 */
|
|
15
|
+
showTagStyle?: boolean;
|
|
16
|
+
/** 头像 */
|
|
17
|
+
avatar?: string;
|
|
18
|
+
iconExtraProps?: Record<string, {
|
|
19
|
+
icon?: string;
|
|
20
|
+
iconColor?: string;
|
|
21
|
+
textColor?: string;
|
|
22
|
+
}>;
|
|
23
|
+
iconProps?: {
|
|
24
|
+
icon: string;
|
|
25
|
+
iconColor: string;
|
|
26
|
+
textColor: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
+
"on-close": (...args: any[]) => void;
|
|
31
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
32
|
+
"onOn-close"?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
showTagStyle: boolean;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import tag_label_vue_vue_type_script_setup_true_lang_default from "./tag-label.vue_vue_type_script_setup_true_lang.mjs";
|
|
3
|
+
import './tag-label.vue_vue_type_style_index_0_scoped_a1ded441_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/form-component/field-label/tag-label.vue
|
|
5
|
+
var tag_label_default = /* @__PURE__ */ _plugin_vue_export_helper_default(tag_label_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a1ded441"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { tag_label_default as default };
|