@gct-paas/render-web 0.1.4-dev.8 → 0.1.5-dev.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 (59) hide show
  1. package/dist/index.min.css +2 -0
  2. package/dist/loader.esm.min.js +1 -0
  3. package/es/Event/Events.d.ts +21 -0
  4. package/es/Event/Events.mjs +12 -0
  5. package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
  6. package/es/components/card-view-render/card-view-render.css +71 -0
  7. package/es/components/card-view-render/card-view-render.d.ts +38 -0
  8. package/es/components/card-view-render/card-view-render.mjs +85 -0
  9. package/es/components/design-render/design-render.css +71 -0
  10. package/es/components/design-render/design-render.d.ts +52 -0
  11. package/es/components/design-render/design-render.mjs +126 -0
  12. package/es/components/design-render-item/design-render-item.d.ts +16 -0
  13. package/es/components/design-render-item/design-render-item.mjs +24 -0
  14. package/es/components/form-component/FieldCheckbox.d.ts +43 -0
  15. package/es/components/form-component/FieldCheckbox.mjs +74 -0
  16. package/es/components/form-component/FieldRadio.d.ts +37 -0
  17. package/es/components/form-component/FieldRadio.mjs +64 -0
  18. package/es/components/form-component/FieldSelect.d.ts +82 -0
  19. package/es/components/form-component/FieldSelect.mjs +177 -0
  20. package/es/components/form-component/field-empty-value.d.ts +6 -0
  21. package/es/components/form-component/field-empty-value.mjs +17 -0
  22. package/es/components/form-component/field-label/ref-card-label-render.vue.d.ts +23 -0
  23. package/es/components/form-component/field-label/ref-card-label-render.vue.mjs +6 -0
  24. package/es/components/form-component/field-label/ref-card-label-render.vue_vue_type_script_setup_true_lang.mjs +140 -0
  25. package/es/components/form-component/field-label/ref-card-label-render.vue_vue_type_style_index_0_lang.css +10 -0
  26. package/es/components/form-component/field-label/selectTag.vue.d.ts +5 -0
  27. package/es/components/form-component/field-label/selectTag.vue.mjs +5 -0
  28. package/es/components/form-component/field-label/selectTag.vue_vue_type_script_setup_true_lang.mjs +22 -0
  29. package/es/components/form-component/field-label/tag-label.vue.d.ts +31 -0
  30. package/es/components/form-component/field-label/tag-label.vue.mjs +7 -0
  31. package/es/components/form-component/field-label/tag-label.vue_vue_type_script_setup_true_name_TagLabel_lang.mjs +139 -0
  32. package/es/components/form-component/field-label/tag-label.vue_vue_type_style_index_0_scoped_8b3c7ae1_lang.css +15 -0
  33. package/es/components/form-component/field-label/tag-layout.vue.d.ts +21 -0
  34. package/es/components/form-component/field-label/tag-layout.vue.mjs +7 -0
  35. package/es/components/form-component/field-label/tag-layout.vue_vue_type_script_setup_true_lang.mjs +16 -0
  36. package/es/components/form-component/field-label/tag-layout.vue_vue_type_style_index_0_scoped_85e6a8f5_lang.css +12 -0
  37. package/es/components/form-component/field-label/tag-span.vue.d.ts +21 -0
  38. package/es/components/form-component/field-label/tag-span.vue.mjs +7 -0
  39. package/es/components/form-component/field-label/tag-span.vue_vue_type_script_setup_true_lang.mjs +25 -0
  40. package/es/components/form-component/field-label/tag-span.vue_vue_type_style_index_0_scoped_6c8c4c7a_lang.css +31 -0
  41. package/es/components/form-component/field-readonly.vue.d.ts +21 -0
  42. package/es/components/form-component/field-readonly.vue.mjs +5 -0
  43. package/es/components/form-component/field-readonly.vue_vue_type_script_setup_true_lang.mjs +92 -0
  44. package/es/components/form-component/index.css +40 -0
  45. package/es/components/form-component/index.d.ts +10 -0
  46. package/es/components/form-component/index.mjs +9 -0
  47. package/es/components/index.d.ts +3 -0
  48. package/es/components/index.mjs +11 -0
  49. package/es/hooks/index.d.ts +1 -0
  50. package/es/hooks/index.mjs +1 -0
  51. package/es/hooks/refCardList.d.ts +23 -0
  52. package/es/hooks/refCardList.mjs +56 -0
  53. package/es/index.d.ts +3 -0
  54. package/es/index.mjs +18 -3
  55. package/es/loader.d.ts +1 -0
  56. package/package.json +22 -13
  57. package/dist/index.esm.min.mjs +0 -6
  58. package/dist/index.min.cjs +0 -1
  59. package/dist/index.system.min.js +0 -1
@@ -0,0 +1,74 @@
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: {
23
+ type: [String, Array],
24
+ required: true
25
+ }
26
+ },
27
+ setup(props, { emit }) {
28
+ const isBool = props.fieldType === FIELD_TYPE.BOOLEAN;
29
+ const currentValue = computed({
30
+ get() {
31
+ if (isBool) return [props.value];
32
+ return Array.isArray(props.value) ? props.value : props.value ? props.value.split(",") : void 0;
33
+ },
34
+ set(value) {
35
+ if (isBool) {
36
+ const bool = value?.[0];
37
+ if (bool === void 0 || bool === null || typeof bool !== "boolean") emit("update:value", Boolean(bool));
38
+ else emit("update:value", !!bool);
39
+ } else emit("update:value", value);
40
+ }
41
+ });
42
+ const options = computed(() => {
43
+ if (isBool) return (props.options ?? []).filter((item) => item.value);
44
+ return props.options ?? [];
45
+ });
46
+ return () => {
47
+ return createVNode(CheckboxGroup, {
48
+ "value": currentValue.value,
49
+ "onUpdate:value": ($event) => currentValue.value = $event,
50
+ "disabled": props.disabled,
51
+ "class": ["field-checkbox-group", props.readonly ? "field-checkbox-group--readonly" : ""]
52
+ }, { default: () => [options.value?.map((option) => {
53
+ const optionItem = option;
54
+ const { icon, iconColor, textColor } = optionItem?._item || {};
55
+ return createVNode(Checkbox, {
56
+ "key": optionItem.value,
57
+ "value": optionItem.value
58
+ }, { default: () => [createVNode(field_readonly_default, {
59
+ "tagWidgetStyle": props.tagStyle,
60
+ "type": props.fieldType,
61
+ "label": optionItem.label,
62
+ "disabled": props.disabled,
63
+ "iconExtraProps": { [optionItem.label]: {
64
+ icon,
65
+ iconColor,
66
+ textColor
67
+ } }
68
+ }, null)] });
69
+ })] });
70
+ };
71
+ }
72
+ });
73
+ //#endregion
74
+ export { FieldCheckbox_default as default };
@@ -0,0 +1,37 @@
1
+ import { PropType } from 'vue';
2
+ import { RadioGroupProps } from 'ant-design-vue';
3
+ import { FIELD_TYPE } from '@gct-paas/core';
4
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ design: BooleanConstructor;
6
+ disabled: BooleanConstructor;
7
+ readonly: BooleanConstructor;
8
+ fieldType: {
9
+ type: PropType<FIELD_TYPE>;
10
+ required: true;
11
+ };
12
+ tagStyle: {
13
+ type: ObjectConstructor;
14
+ required: true;
15
+ };
16
+ options: PropType<RadioGroupProps["options"]>;
17
+ value: (StringConstructor | NumberConstructor)[];
18
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
19
+ design: BooleanConstructor;
20
+ disabled: BooleanConstructor;
21
+ readonly: BooleanConstructor;
22
+ fieldType: {
23
+ type: PropType<FIELD_TYPE>;
24
+ required: true;
25
+ };
26
+ tagStyle: {
27
+ type: ObjectConstructor;
28
+ required: true;
29
+ };
30
+ options: PropType<RadioGroupProps["options"]>;
31
+ value: (StringConstructor | NumberConstructor)[];
32
+ }>> & Readonly<{}>, {
33
+ disabled: boolean;
34
+ readonly: boolean;
35
+ design: boolean;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
37
+ 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 { FIELD_TYPE, FormComponents } from '@gct-paas/core';
2
+ import { LowCodeWidget } from '@gct-paas/schema';
3
+ import { SelectProps } from 'ant-design-vue';
4
+ import { PropType } from 'vue';
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<Partial<LowCodeWidget.BasicStyle>>;
28
+ required: true;
29
+ };
30
+ options: PropType<SelectProps["options"]>;
31
+ value: (StringConstructor | ArrayConstructor | 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<Partial<LowCodeWidget.BasicStyle>>;
60
+ required: true;
61
+ };
62
+ options: PropType<SelectProps["options"]>;
63
+ value: (StringConstructor | ArrayConstructor | 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,177 @@
1
+ import tag_label_default from "./field-label/tag-label.vue.mjs";
2
+ import selectTag_default from "./field-label/selectTag.vue.mjs";
3
+ import field_readonly_default from "./field-readonly.vue.mjs";
4
+ import './index.css';/* empty css */
5
+ import { computed, createVNode, defineComponent, h, mergeProps } from "vue";
6
+ import { FormComponents } from "@gct-paas/core";
7
+ import { transformUrl } from "@gct-paas/core-web";
8
+ import { Avatar, Select } from "ant-design-vue";
9
+ import { pick } from "lodash-es";
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: [
32
+ String,
33
+ Number,
34
+ Array
35
+ ],
36
+ maxTagCount: {
37
+ type: [Number, String],
38
+ default: 5
39
+ },
40
+ maxTagTextLength: {
41
+ type: Number,
42
+ default: 6
43
+ },
44
+ selectOptionLabel: { type: String }
45
+ },
46
+ setup(props, { emit }) {
47
+ const currentValue = computed({
48
+ get() {
49
+ return props.value;
50
+ },
51
+ set(value) {
52
+ emit("update:value", value);
53
+ }
54
+ });
55
+ const renderTag = (com, { name, iconExtraProps, otherParams = {} }) => {
56
+ return h(com, {
57
+ tagWidgetStyle: props.tagStyle,
58
+ type: props.fieldType,
59
+ label: name,
60
+ disabled: props.disabled,
61
+ iconExtraProps,
62
+ ...otherParams
63
+ });
64
+ };
65
+ const renderSelectTag = ({ name, title, iconExtraProps, avatar, otherParams = {} }) => {
66
+ return createVNode(selectTag_default, mergeProps({
67
+ "tagWidgetStyle": props.tagStyle,
68
+ "type": props.fieldType,
69
+ "label": name,
70
+ "avatar": avatar,
71
+ "title": title?.length > props.maxTagTextLength ? title : null,
72
+ "disabled": props.disabled,
73
+ "iconExtraProps": iconExtraProps
74
+ }, otherParams), null);
75
+ };
76
+ const options = computed(() => {
77
+ return (props.options ?? []).map((item) => {
78
+ const { iconColor, icon, textColor } = item._item || {};
79
+ return {
80
+ ...item,
81
+ [props.selectExtraProps?.optionLabelProp || "titleLabel"]: renderTag(tag_label_default, {
82
+ name: item.label,
83
+ iconExtraProps: { [item.label]: {
84
+ icon,
85
+ iconColor,
86
+ textColor
87
+ } }
88
+ })
89
+ };
90
+ });
91
+ });
92
+ function getLabelByDict(item, key) {
93
+ const { _DICT = {} } = item;
94
+ const value = item[key];
95
+ return _DICT[key]?.[value]?.join(",") ?? value ?? item.id_;
96
+ }
97
+ const selectInfo = computed(() => {
98
+ if (props.readonly) {
99
+ const list = options.value?.filter((item) => {
100
+ if (props.selectExtraProps?.mode === "multiple") return Array.isArray(currentValue.value) && currentValue.value.includes(item.value);
101
+ }) ?? [];
102
+ const icons = Object.fromEntries(list?.map((item) => {
103
+ return [item.label, pick(item?._item || {}, [
104
+ "iconColor",
105
+ "icon",
106
+ "textColor"
107
+ ])];
108
+ }) ?? []);
109
+ return {
110
+ labels: list.map((e) => e.label),
111
+ icons
112
+ };
113
+ }
114
+ return {};
115
+ });
116
+ const slot = { option: (data) => {
117
+ const { label, _item = {} } = data;
118
+ if (props.type === FormComponents.Userpicker) return createVNode("div", { "class": "flex items-center" }, [createVNode(Avatar, {
119
+ "size": 30,
120
+ "style": "margin: 0 8px;min-width:32px",
121
+ "src": transformUrl(_item.avatar)
122
+ }, null), createVNode("div", { "style": "width:calc(100% - 35px)" }, [createVNode("div", {
123
+ "class": " w100% ell",
124
+ "title": label
125
+ }, [label]), createVNode("div", { "class": "text-[#8F8F8F] text-[12px] mt2px" }, [_item.masterOrgName])])]);
126
+ else return renderTag(tag_label_default, {
127
+ name: props.selectOptionLabel ? getLabelByDict(_item, props.selectOptionLabel) : label,
128
+ iconExtraProps: { [label]: pick(_item, [
129
+ "iconColor",
130
+ "icon",
131
+ "textColor"
132
+ ]) },
133
+ otherParams: { showTagStyle: false }
134
+ });
135
+ } };
136
+ const tagRender = (data) => {
137
+ const { label, option, closable, onClose } = data;
138
+ const { _item = {} } = option || {};
139
+ return renderSelectTag({
140
+ name: label,
141
+ title: option?.label,
142
+ avatar: option?._item?.avatar,
143
+ iconExtraProps: { [label]: pick(_item, [
144
+ "iconColor",
145
+ "icon",
146
+ "textColor"
147
+ ]) },
148
+ otherParams: {
149
+ closable,
150
+ "onOn-close": onClose,
151
+ style: "margin-right: 4px"
152
+ }
153
+ });
154
+ };
155
+ return () => {
156
+ return props.readonly ? renderTag(field_readonly_default, {
157
+ name: selectInfo.value?.labels,
158
+ iconExtraProps: selectInfo.value?.icons
159
+ }) : createVNode(Select, mergeProps({
160
+ "class": ["field-select", "w100%"],
161
+ "value": currentValue.value,
162
+ "onUpdate:value": ($event) => currentValue.value = $event,
163
+ "options": options.value,
164
+ "disabled": props.disabled,
165
+ "optionLabelProp": "titleLabel",
166
+ "tagRender": tagRender,
167
+ "showArrow": true,
168
+ "maxTagCount": props.maxTagCount,
169
+ "maxTagTextLength": props.maxTagTextLength,
170
+ "dropdownMatchSelectWidth": 180,
171
+ "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"
172
+ }, props.selectExtraProps), props.selectExtraProps?.optionNoStyle ? null : slot);
173
+ };
174
+ }
175
+ });
176
+ //#endregion
177
+ 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,17 @@
1
+ import { computed, defineComponent } from "vue";
2
+ //#region src/components/form-component/field-empty-value.tsx
3
+ /**空值显示逻辑 */
4
+ function emptyValueDisplay(widget, value) {
5
+ /**部分字段排除空值显示 */
6
+ const exclude = [];
7
+ const fieldType = widget.props.fieldType;
8
+ const isEmpty = computed(() => {
9
+ return widget.props.readonly && fieldType && !exclude.includes(fieldType) && (value.value === void 0 || value.value === "" || value.value === null);
10
+ });
11
+ return {
12
+ RenderEmptyValue: /* @__PURE__ */ defineComponent((_props, _slots) => () => _gct.store.getEmptyDisplay),
13
+ isEmpty
14
+ };
15
+ }
16
+ //#endregion
17
+ export { emptyValueDisplay };
@@ -0,0 +1,23 @@
1
+ import { LowCodeWidget } from '@gct-paas/schema';
2
+ import { CARD_TRIGGER_ENUM } from '@gct-paas/core';
3
+ export interface Props {
4
+ tagWidgetStyle?: {
5
+ tagStyleOpen: boolean;
6
+ contentFont: LowCodeWidget.FontStyle;
7
+ tagStyle?: LowCodeWidget.TagConfigStyle;
8
+ };
9
+ disabled?: boolean;
10
+ values?: string[];
11
+ label?: (string | number)[];
12
+ /** 外部控制是否显示标签样式 */
13
+ showTagStyle?: boolean;
14
+ trigger: CARD_TRIGGER_ENUM;
15
+ getCardData: (id: string) => Promise<object>;
16
+ modelKey: string;
17
+ /**信息卡的id */
18
+ refCardId: string;
19
+ }
20
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
21
+ showTagStyle: boolean;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import ref_card_label_render_vue_vue_type_script_setup_true_lang_default from "./ref-card-label-render.vue_vue_type_script_setup_true_lang.mjs";
2
+ import './ref-card-label-render.vue_vue_type_style_index_0_lang.css';/* empty css */
3
+ //#region src/components/form-component/field-label/ref-card-label-render.vue
4
+ var ref_card_label_render_default = ref_card_label_render_vue_vue_type_script_setup_true_lang_default;
5
+ //#endregion
6
+ export { ref_card_label_render_default as default };
@@ -0,0 +1,140 @@
1
+ import tag_span_default from "./tag-span.vue.mjs";
2
+ import tag_layout_default from "./tag-layout.vue.mjs";
3
+ import { CardViewRender } from "../../card-view-render/card-view-render.mjs";
4
+ import { schemaToStyle } from "@gct-paas/render";
5
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, inject, normalizeClass, normalizeStyle, openBlock, reactive, renderList, resolveComponent, toDisplayString, toRef, unref, withCtx, withModifiers } from "vue";
6
+ import { CARD_TRIGGER_ENUM } from "@gct-paas/core";
7
+ //#region src/components/form-component/field-label/ref-card-label-render.vue?vue&type=script&setup=true&lang.ts
8
+ var _hoisted_1 = ["onMouseup"];
9
+ var _hoisted_2 = { key: 1 };
10
+ var ref_card_label_render_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
11
+ __name: "ref-card-label-render",
12
+ props: {
13
+ tagWidgetStyle: {},
14
+ disabled: { type: Boolean },
15
+ values: {},
16
+ label: {},
17
+ showTagStyle: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ trigger: {},
22
+ getCardData: {},
23
+ modelKey: {},
24
+ refCardId: {}
25
+ },
26
+ setup(__props) {
27
+ const props = __props;
28
+ const classData = props.trigger === CARD_TRIGGER_ENUM.HOVER ? "primary-gct-hover" : "primary-gct";
29
+ const labelLayout = inject("labelLayout", {});
30
+ const tipMap = reactive({});
31
+ const showLabel = computed(() => {
32
+ const labels = (typeof props.label === "string" ? (props.label ?? "").split(",") : props.label) ?? [];
33
+ return props.values?.filter((_, index) => labels[index]).map((i, index) => {
34
+ return {
35
+ value: i,
36
+ label: labels[index]
37
+ };
38
+ }) ?? [];
39
+ });
40
+ const comStyle = toRef(() => {
41
+ const contentFont = props.tagWidgetStyle?.contentFont;
42
+ if (!contentFont) return {};
43
+ return schemaToStyle(contentFont);
44
+ });
45
+ const getMsgColor = toRef(() => {
46
+ if (comStyle.value?.color) return comStyle.value;
47
+ return {
48
+ wordBreak: "break-all",
49
+ ...comStyle.value
50
+ };
51
+ });
52
+ const visibleChange = async (visible, row) => {
53
+ tipMap[row.value] = visible;
54
+ };
55
+ function mouseup(row) {
56
+ visibleChange(true, row);
57
+ }
58
+ function cardFetch(id) {
59
+ return props.getCardData.bind(null, id);
60
+ }
61
+ return (_ctx, _cache) => {
62
+ const _component_a_popover = resolveComponent("a-popover");
63
+ return !!showLabel.value.length ? (openBlock(), createBlock(tag_layout_default, {
64
+ key: 0,
65
+ disabled: !!__props.disabled,
66
+ "label-layout": unref(labelLayout)
67
+ }, {
68
+ default: withCtx(() => [__props.showTagStyle && __props.tagWidgetStyle?.tagStyleOpen ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(showLabel.value, (i, index) => {
69
+ return openBlock(), createBlock(_component_a_popover, {
70
+ key: index,
71
+ trigger: __props.trigger,
72
+ visible: !!tipMap[i.value],
73
+ placement: "bottomLeft",
74
+ color: "#fff",
75
+ "overlay-class-name": "gct-ref-card-popover min-w100px min-h30px max-h96vh",
76
+ onVisibleChange: (v) => visibleChange(v, i)
77
+ }, {
78
+ content: withCtx(() => [createVNode(unref(CardViewRender), {
79
+ id: __props.refCardId,
80
+ "model-key": __props.modelKey,
81
+ fetch: cardFetch(i.value)
82
+ }, null, 8, [
83
+ "id",
84
+ "model-key",
85
+ "fetch"
86
+ ])]),
87
+ default: withCtx(() => [createVNode(tag_span_default, {
88
+ "tag-style": __props.tagWidgetStyle.tagStyle,
89
+ onMouseup: ($event) => mouseup(i)
90
+ }, {
91
+ default: withCtx(() => [createElementVNode("span", {
92
+ class: normalizeClass(["select-text cursor-pointer", unref(classData)]),
93
+ style: normalizeStyle(getMsgColor.value)
94
+ }, toDisplayString(i.label), 7)]),
95
+ _: 2
96
+ }, 1032, ["tag-style", "onMouseup"])]),
97
+ _: 2
98
+ }, 1032, [
99
+ "trigger",
100
+ "visible",
101
+ "onVisibleChange"
102
+ ]);
103
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(showLabel.value, (i, index) => {
104
+ return openBlock(), createElementBlock(Fragment, { key: index }, [createElementVNode("span", null, toDisplayString(!!index ? "," : ""), 1), createVNode(_component_a_popover, {
105
+ "overlay-class-name": "gct-ref-card-popover min-w100px min-h30px max-h96vh",
106
+ visible: !!tipMap[i.value],
107
+ trigger: __props.trigger,
108
+ color: "#fff",
109
+ placement: "bottomLeft",
110
+ onVisibleChange: (v) => visibleChange(v, i)
111
+ }, {
112
+ content: withCtx(() => [createVNode(unref(CardViewRender), {
113
+ id: __props.refCardId,
114
+ "model-key": __props.modelKey,
115
+ fetch: cardFetch(i.value)
116
+ }, null, 8, [
117
+ "id",
118
+ "model-key",
119
+ "fetch"
120
+ ])]),
121
+ default: withCtx(() => [createElementVNode("span", {
122
+ class: normalizeClass(["select-text cursor-pointer", unref(classData)]),
123
+ style: normalizeStyle(getMsgColor.value),
124
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
125
+ onMouseup: ($event) => mouseup(i)
126
+ }, toDisplayString(i.label), 47, _hoisted_1)]),
127
+ _: 2
128
+ }, 1032, [
129
+ "visible",
130
+ "trigger",
131
+ "onVisibleChange"
132
+ ])], 64);
133
+ }), 128))]),
134
+ _: 1
135
+ }, 8, ["disabled", "label-layout"])) : (openBlock(), createElementBlock("span", _hoisted_2, "\xA0"));
136
+ };
137
+ }
138
+ });
139
+ //#endregion
140
+ export { ref_card_label_render_vue_vue_type_script_setup_true_lang_default as default };
@@ -0,0 +1,10 @@
1
+ .gct-ref-card-popover {
2
+ overflow-y: auto;
3
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
4
+ }
5
+ .gct-ref-card-popover .ant-popover-inner-content {
6
+ padding: 0;
7
+ }
8
+ .gct-ref-card-popover .ant-popover-arrow {
9
+ display: none;
10
+ }
@@ -0,0 +1,5 @@
1
+ export interface Props {
2
+ tagWidgetStyle: IObject;
3
+ }
4
+ 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>;
5
+ 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 };
@@ -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 };