@gct-paas/render-web 0.1.4-dev.9 → 0.1.5-dev.1
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 +2 -0
- package/dist/loader.esm.min.js +1 -0
- package/es/Event/Events.d.ts +21 -0
- package/es/Event/Events.mjs +12 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +8 -0
- package/es/components/card-view-render/card-view-render.css +71 -0
- package/es/components/card-view-render/card-view-render.d.ts +38 -0
- package/es/components/card-view-render/card-view-render.mjs +85 -0
- package/es/components/design-render/design-render.css +71 -0
- package/es/components/design-render/design-render.d.ts +52 -0
- package/es/components/design-render/design-render.mjs +126 -0
- package/es/components/design-render-item/design-render-item.d.ts +16 -0
- package/es/components/design-render-item/design-render-item.mjs +24 -0
- package/es/components/form-component/FieldCheckbox.d.ts +43 -0
- package/es/components/form-component/FieldCheckbox.mjs +74 -0
- package/es/components/form-component/FieldRadio.d.ts +37 -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 +177 -0
- package/es/components/form-component/field-empty-value.d.ts +6 -0
- package/es/components/form-component/field-empty-value.mjs +17 -0
- package/es/components/form-component/field-label/ref-card-label-render.vue.d.ts +23 -0
- package/es/components/form-component/field-label/ref-card-label-render.vue.mjs +6 -0
- package/es/components/form-component/field-label/ref-card-label-render.vue_vue_type_script_setup_true_lang.mjs +140 -0
- package/es/components/form-component/field-label/ref-card-label-render.vue_vue_type_style_index_0_lang.css +10 -0
- package/es/components/form-component/field-label/selectTag.vue.d.ts +5 -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 +31 -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_name_TagLabel_lang.mjs +139 -0
- package/es/components/form-component/field-label/tag-label.vue_vue_type_style_index_0_scoped_8b3c7ae1_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_6c8c4c7a_lang.css +31 -0
- package/es/components/form-component/field-readonly.vue.d.ts +21 -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 +92 -0
- package/es/components/form-component/index.css +40 -0
- package/es/components/form-component/index.d.ts +10 -0
- package/es/components/form-component/index.mjs +9 -0
- package/es/components/index.d.ts +3 -0
- package/es/components/index.mjs +11 -0
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/refCardList.d.ts +23 -0
- package/es/hooks/refCardList.mjs +56 -0
- package/es/index.d.ts +3 -1
- package/es/index.mjs +18 -5
- package/es/loader.d.ts +1 -0
- package/package.json +18 -15
- package/dist/index.esm.min.mjs +0 -29007
- package/dist/index.min.cjs +0 -37
- package/dist/index.system.min.js +0 -37
- package/es/Event/EventsPc.d.ts +0 -16
- package/es/Event/EventsPc.mjs +0 -10
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EntityFormulaReturnTypeEnum, FIELD_TYPE } from '@gct-paas/core';
|
|
2
|
+
export interface Props {
|
|
3
|
+
tagWidgetStyle?: IObject;
|
|
4
|
+
type?: FIELD_TYPE | EntityFormulaReturnTypeEnum | undefined;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
label?: string | (string | number)[];
|
|
7
|
+
isDesign?: boolean;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
/** 外部控制是否显示标签样式 */
|
|
10
|
+
showTagStyle?: boolean;
|
|
11
|
+
/** 头像 */
|
|
12
|
+
avatar?: string;
|
|
13
|
+
iconExtraProps?: Record<string, {
|
|
14
|
+
icon: string;
|
|
15
|
+
iconColor: string;
|
|
16
|
+
textColor: string;
|
|
17
|
+
}>;
|
|
18
|
+
iconProps?: {
|
|
19
|
+
icon: string;
|
|
20
|
+
iconColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
|
+
"on-close": (...args: any[]) => void;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
27
|
+
"onOn-close"?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
showTagStyle: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
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_name_TagLabel_lang_default from "./tag-label.vue_vue_type_script_setup_true_name_TagLabel_lang.mjs";
|
|
3
|
+
import './tag-label.vue_vue_type_style_index_0_scoped_8b3c7ae1_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_name_TagLabel_lang_default, [["__scopeId", "data-v-8b3c7ae1"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { tag_label_default as default };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import tag_span_default from "./tag-span.vue.mjs";
|
|
2
|
+
import tag_layout_default from "./tag-layout.vue.mjs";
|
|
3
|
+
import { schemaToStyle } from "@gct-paas/render";
|
|
4
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, inject, normalizeStyle, openBlock, renderList, toDisplayString, toRef, unref, withCtx, withModifiers } from "vue";
|
|
5
|
+
import { FIELD_TYPE } from "@gct-paas/core";
|
|
6
|
+
import { IconNext, transformUrl } from "@gct-paas/core-web";
|
|
7
|
+
import { Avatar } from "ant-design-vue";
|
|
8
|
+
import { isString } from "lodash-es";
|
|
9
|
+
//#region src/components/form-component/field-label/tag-label.vue?vue&type=script&setup=true&name=TagLabel&lang.ts
|
|
10
|
+
var _hoisted_1 = { class: "select-text" };
|
|
11
|
+
var _hoisted_2 = { class: "select-text" };
|
|
12
|
+
var _hoisted_3 = { key: 0 };
|
|
13
|
+
var tag_label_vue_vue_type_script_setup_true_name_TagLabel_lang_default = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "tag-label",
|
|
15
|
+
props: {
|
|
16
|
+
tagWidgetStyle: {},
|
|
17
|
+
type: {},
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
label: {},
|
|
20
|
+
isDesign: { type: Boolean },
|
|
21
|
+
closable: { type: Boolean },
|
|
22
|
+
showTagStyle: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
avatar: {},
|
|
27
|
+
iconExtraProps: {},
|
|
28
|
+
iconProps: {}
|
|
29
|
+
},
|
|
30
|
+
emits: ["on-close"],
|
|
31
|
+
setup(__props) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
const themeSetting = _gct.platformStore.themeSetting;
|
|
34
|
+
const labelLayout = inject("labelLayout", {});
|
|
35
|
+
const showLabel = toRef(() => {
|
|
36
|
+
let showMsg = props.label ?? "";
|
|
37
|
+
if (props.showTagStyle && props.tagWidgetStyle?.tagStyleOpen || props.type === FIELD_TYPE.ENUM_MULTI || props.type === FIELD_TYPE.ENUM) return showMsg ? isString(showMsg) ? showMsg.split(",") : showMsg : [];
|
|
38
|
+
else if (showMsg instanceof Array) return showMsg.join(",");
|
|
39
|
+
else return showMsg + "";
|
|
40
|
+
});
|
|
41
|
+
const comStyle = toRef(() => {
|
|
42
|
+
const contentFont = props.tagWidgetStyle?.contentFont;
|
|
43
|
+
if (!contentFont) return {};
|
|
44
|
+
return schemaToStyle(contentFont);
|
|
45
|
+
});
|
|
46
|
+
const getMsgColor = (key = "") => {
|
|
47
|
+
const iconAttrs = props.iconExtraProps?.[key] || {};
|
|
48
|
+
const color = {};
|
|
49
|
+
if (iconAttrs?.textColor) Object.assign(color, { color: iconAttrs?.textColor });
|
|
50
|
+
if (comStyle.value?.color) return comStyle.value;
|
|
51
|
+
return {
|
|
52
|
+
wordBreak: "break-all",
|
|
53
|
+
...comStyle.value,
|
|
54
|
+
...color
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const iconNode = { render: ({ $attrs }) => {
|
|
58
|
+
if ($attrs.labelName) {
|
|
59
|
+
const iconAttrs = props.iconExtraProps?.[$attrs.labelName] || props.iconProps || {};
|
|
60
|
+
if (!iconAttrs?.icon) return;
|
|
61
|
+
return h(IconNext, {
|
|
62
|
+
size: 16,
|
|
63
|
+
value: iconAttrs?.icon,
|
|
64
|
+
color: iconAttrs?.iconColor || themeSetting.themeColor,
|
|
65
|
+
style: "vertical-align: text-bottom; margin-right: 3px"
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
} };
|
|
69
|
+
return (_ctx, _cache) => {
|
|
70
|
+
return __props.showTagStyle && __props.tagWidgetStyle?.tagStyleOpen ? (openBlock(), createBlock(tag_layout_default, {
|
|
71
|
+
key: 0,
|
|
72
|
+
disabled: !!__props.disabled,
|
|
73
|
+
"label-layout": unref(labelLayout)
|
|
74
|
+
}, {
|
|
75
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(showLabel.value, (i, index) => {
|
|
76
|
+
return openBlock(), createBlock(tag_span_default, {
|
|
77
|
+
key: index,
|
|
78
|
+
"tag-style": __props.tagWidgetStyle.tagStyle,
|
|
79
|
+
style: normalizeStyle(getMsgColor(i))
|
|
80
|
+
}, {
|
|
81
|
+
default: withCtx(() => [
|
|
82
|
+
props.avatar ? (openBlock(), createBlock(unref(Avatar), {
|
|
83
|
+
key: 0,
|
|
84
|
+
src: unref(transformUrl)(props.avatar),
|
|
85
|
+
size: 20,
|
|
86
|
+
style: { "margin-top": "-5px" },
|
|
87
|
+
class: "mr4px"
|
|
88
|
+
}, null, 8, ["src"])) : createCommentVNode("", true),
|
|
89
|
+
createVNode(iconNode, { "label-name": i }, null, 8, ["label-name"]),
|
|
90
|
+
createElementVNode("span", _hoisted_1, toDisplayString(i), 1),
|
|
91
|
+
__props.closable ? (openBlock(), createBlock(unref(IconNext), {
|
|
92
|
+
key: 1,
|
|
93
|
+
size: 15,
|
|
94
|
+
value: "icon-park:close-small",
|
|
95
|
+
style: {
|
|
96
|
+
verticalAlign: "text-bottom",
|
|
97
|
+
"--color": "rgba(0,0,0,.45)",
|
|
98
|
+
lineHeight: "1",
|
|
99
|
+
marginLeft: "2px"
|
|
100
|
+
},
|
|
101
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("on-close"), ["prevent", "stop"]))
|
|
102
|
+
})) : createCommentVNode("", true)
|
|
103
|
+
]),
|
|
104
|
+
_: 2
|
|
105
|
+
}, 1032, ["tag-style", "style"]);
|
|
106
|
+
}), 128))]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["disabled", "label-layout"])) : __props.type === unref(FIELD_TYPE).ENUM_MULTI || __props.type === unref(FIELD_TYPE).ENUM ? (openBlock(), createBlock(tag_layout_default, {
|
|
109
|
+
key: 1,
|
|
110
|
+
disabled: !!__props.disabled,
|
|
111
|
+
"label-layout": unref(labelLayout)
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(showLabel.value, (i, index) => {
|
|
114
|
+
return openBlock(), createElementBlock("span", {
|
|
115
|
+
key: index,
|
|
116
|
+
style: normalizeStyle(getMsgColor(i)),
|
|
117
|
+
class: "mr-5px"
|
|
118
|
+
}, [createVNode(iconNode, { "label-name": i }, null, 8, ["label-name"]), createElementVNode("span", _hoisted_2, toDisplayString(i) + toDisplayString(!__props.tagWidgetStyle?.tagStyleOpen && index < showLabel.value.length - 1 ? "," : ""), 1)], 4);
|
|
119
|
+
}), 128)), !showLabel.value.length ? (openBlock(), createElementBlock("span", _hoisted_3, "\xA0")) : createCommentVNode("", true)]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["disabled", "label-layout"])) : (openBlock(), createBlock(tag_layout_default, {
|
|
122
|
+
key: 2,
|
|
123
|
+
style: normalizeStyle(getMsgColor(showLabel.value)),
|
|
124
|
+
disabled: !!__props.disabled,
|
|
125
|
+
"label-layout": unref(labelLayout),
|
|
126
|
+
class: "select-text leading-none ell"
|
|
127
|
+
}, {
|
|
128
|
+
default: withCtx(() => [createTextVNode(toDisplayString(showLabel.value || "\xA0"), 1)]),
|
|
129
|
+
_: 1
|
|
130
|
+
}, 8, [
|
|
131
|
+
"style",
|
|
132
|
+
"disabled",
|
|
133
|
+
"label-layout"
|
|
134
|
+
]));
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
//#endregion
|
|
139
|
+
export { tag_label_vue_vue_type_script_setup_true_name_TagLabel_lang_default as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.tag-label-disabled[data-v-8b3c7ae1] {
|
|
2
|
+
opacity: 0.5;
|
|
3
|
+
}
|
|
4
|
+
.label-ellipsis[data-v-8b3c7ae1] {
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
text-overflow: ellipsis;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
}
|
|
9
|
+
.label-wrap[data-v-8b3c7ae1] {
|
|
10
|
+
word-break: break-all;
|
|
11
|
+
white-space: wrap;
|
|
12
|
+
}
|
|
13
|
+
.select-text[data-v-8b3c7ae1] {
|
|
14
|
+
min-width: 16px;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
labelLayout?: IObject;
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLSpanElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import tag_layout_vue_vue_type_script_setup_true_lang_default from "./tag-layout.vue_vue_type_script_setup_true_lang.mjs";
|
|
3
|
+
import './tag-layout.vue_vue_type_style_index_0_scoped_85e6a8f5_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/form-component/field-label/tag-layout.vue
|
|
5
|
+
var tag_layout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(tag_layout_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-85e6a8f5"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { tag_layout_default as default };
|
package/es/components/form-component/field-label/tag-layout.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot } from "vue";
|
|
2
|
+
//#region src/components/form-component/field-label/tag-layout.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var tag_layout_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "tag-layout",
|
|
5
|
+
props: {
|
|
6
|
+
labelLayout: {},
|
|
7
|
+
disabled: { type: Boolean }
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass([__props.disabled ? "tag-label-disabled" : null, !!__props.labelLayout?.hasLabelWidth && (__props.labelLayout?.layout.label === "left" || __props.labelLayout?.layout == "horizontal") ? __props.labelLayout?.overLabelDisplay == "ellipsis" ? "label-ellipsis" : "label-wrap" : ""]) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { tag_layout_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LowCodeWidget } from '@gct-paas/schema';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tagStyle?: LowCodeWidget.TagConfigStyle;
|
|
4
|
+
};
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: {
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLSpanElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import tag_span_vue_vue_type_script_setup_true_lang_default from "./tag-span.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
import './tag-span.vue_vue_type_style_index_0_scoped_6c8c4c7a_lang.css';/* empty css */
|
|
3
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
//#region src/components/form-component/field-label/tag-span.vue
|
|
5
|
+
var tag_span_default = /* @__PURE__ */ _plugin_vue_export_helper_default(tag_span_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6c8c4c7a"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { tag_span_default as default };
|
package/es/components/form-component/field-label/tag-span.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, toRef, useCssVars } from "vue";
|
|
2
|
+
import { TagTypeEnum } from "@gct-paas/core";
|
|
3
|
+
//#region src/components/form-component/field-label/tag-span.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var tag_span_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "tag-span",
|
|
6
|
+
props: { tagStyle: {} },
|
|
7
|
+
setup(__props) {
|
|
8
|
+
useCssVars((_ctx) => ({ "v2ae1b805": tagStyleColor.value }));
|
|
9
|
+
const props = __props;
|
|
10
|
+
const tagType = toRef(() => {
|
|
11
|
+
return props.tagStyle?.tagType || TagTypeEnum.RADIUS;
|
|
12
|
+
});
|
|
13
|
+
const tagStyleColor = toRef(() => {
|
|
14
|
+
return props.tagStyle?.color || "#f0f0f0";
|
|
15
|
+
});
|
|
16
|
+
const getTagClass = toRef(() => {
|
|
17
|
+
return `tag-${tagType.value}`;
|
|
18
|
+
});
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass(["tag cursor-pointer", getTagClass.value]) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { tag_span_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.tag[data-v-6c8c4c7a] {
|
|
2
|
+
padding: 4px 6px;
|
|
3
|
+
line-height: 1;
|
|
4
|
+
}
|
|
5
|
+
.tag + .tag[data-v-6c8c4c7a] {
|
|
6
|
+
margin-left: 5px;
|
|
7
|
+
}
|
|
8
|
+
.tag-radius[data-v-6c8c4c7a] {
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
background: var(--v2ae1b805);
|
|
11
|
+
}
|
|
12
|
+
.tag-linear_radius[data-v-6c8c4c7a] {
|
|
13
|
+
border: 1px solid var(--v2ae1b805);
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
}
|
|
16
|
+
.tag-big_radius[data-v-6c8c4c7a] {
|
|
17
|
+
border-radius: 100px;
|
|
18
|
+
background: var(--v2ae1b805);
|
|
19
|
+
}
|
|
20
|
+
.tag-linear_big_radius[data-v-6c8c4c7a] {
|
|
21
|
+
border: 1px solid var(--v2ae1b805);
|
|
22
|
+
border-radius: 100px;
|
|
23
|
+
}
|
|
24
|
+
.tag-dashed_radius[data-v-6c8c4c7a] {
|
|
25
|
+
border: 1px dashed var(--v2ae1b805);
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
}
|
|
28
|
+
.tag-status[data-v-6c8c4c7a] {
|
|
29
|
+
border-radius: 14px 4px 4px;
|
|
30
|
+
background: var(--v2ae1b805);
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** 与 FieldRadio 传入的 tagStyle 一致,避免依赖 @gct-paas/schema */
|
|
2
|
+
interface TagWidgetStyle {
|
|
3
|
+
tagStyleOpen?: boolean;
|
|
4
|
+
contentFont?: unknown;
|
|
5
|
+
tagStyle?: unknown;
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
isTooltip?: boolean;
|
|
9
|
+
label?: string | (string | number)[];
|
|
10
|
+
type?: string;
|
|
11
|
+
modelValue?: string;
|
|
12
|
+
tagWidgetStyle?: TagWidgetStyle;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
iconExtraProps?: Record<string, {
|
|
15
|
+
icon?: string;
|
|
16
|
+
iconColor?: string;
|
|
17
|
+
textColor?: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import field_readonly_vue_vue_type_script_setup_true_lang_default from "./field-readonly.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/components/form-component/field-readonly.vue
|
|
3
|
+
var field_readonly_default = field_readonly_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { field_readonly_default as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import tag_label_default from "./field-label/tag-label.vue.mjs";
|
|
2
|
+
import ref_card_label_render_default from "./field-label/ref-card-label-render.vue.mjs";
|
|
3
|
+
import { useGetRefCard } from "../../hooks/refCardList.mjs";
|
|
4
|
+
import "../../hooks/index.mjs";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, h, mergeProps, openBlock, ref, resolveComponent, toDisplayString, unref, withCtx } from "vue";
|
|
6
|
+
import { FIELD_TYPE } from "@gct-paas/core";
|
|
7
|
+
//#region src/components/form-component/field-readonly.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var _hoisted_1 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "w100% ell"
|
|
11
|
+
};
|
|
12
|
+
var _hoisted_2 = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "gct-custom-tag ml8px"
|
|
15
|
+
};
|
|
16
|
+
var field_readonly_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
17
|
+
__name: "field-readonly",
|
|
18
|
+
props: {
|
|
19
|
+
isTooltip: { type: Boolean },
|
|
20
|
+
label: {},
|
|
21
|
+
type: {},
|
|
22
|
+
modelValue: {},
|
|
23
|
+
tagWidgetStyle: {},
|
|
24
|
+
disabled: { type: Boolean },
|
|
25
|
+
iconExtraProps: {}
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const visible = ref(false);
|
|
30
|
+
const showLabel = computed(() => {
|
|
31
|
+
if (Array.isArray(props.label)) return props.label.join(",");
|
|
32
|
+
else return props.label;
|
|
33
|
+
});
|
|
34
|
+
const { refCardValues, trigger, getCardData, modelKey, refCardId } = useGetRefCard();
|
|
35
|
+
const FieldLabel = computed(() => {
|
|
36
|
+
if (refCardValues?.value?.length) return h(ref_card_label_render_default, {
|
|
37
|
+
values: refCardValues.value,
|
|
38
|
+
trigger,
|
|
39
|
+
getCardData,
|
|
40
|
+
modelKey,
|
|
41
|
+
refCardId
|
|
42
|
+
});
|
|
43
|
+
else return tag_label_default;
|
|
44
|
+
});
|
|
45
|
+
/**超出内容出现tip显示全部 */
|
|
46
|
+
function onMouseenter(e) {
|
|
47
|
+
if (!props.isTooltip) return;
|
|
48
|
+
const el = e.target?.parentNode;
|
|
49
|
+
if (el.scrollWidth > el.clientWidth) visible.value = true;
|
|
50
|
+
}
|
|
51
|
+
function onMouseleave() {
|
|
52
|
+
visible.value = false;
|
|
53
|
+
}
|
|
54
|
+
return (_ctx, _cache) => {
|
|
55
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
56
|
+
return openBlock(), createBlock(_component_a_tooltip, {
|
|
57
|
+
placement: "topLeft",
|
|
58
|
+
visible: visible.value
|
|
59
|
+
}, {
|
|
60
|
+
title: withCtx(() => [createTextVNode(toDisplayString(showLabel.value), 1)]),
|
|
61
|
+
default: withCtx(() => [props.type === unref(FIELD_TYPE).RDO_REF ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(FieldLabel), mergeProps(_ctx.$attrs, {
|
|
62
|
+
label: __props.label,
|
|
63
|
+
"tag-widget-style": props.tagWidgetStyle,
|
|
64
|
+
disabled: props.disabled,
|
|
65
|
+
"icon-extra-props": props.iconExtraProps,
|
|
66
|
+
onMouseenter,
|
|
67
|
+
onMouseleave
|
|
68
|
+
}), null, 16, [
|
|
69
|
+
"label",
|
|
70
|
+
"tag-widget-style",
|
|
71
|
+
"disabled",
|
|
72
|
+
"icon-extra-props"
|
|
73
|
+
]), props.type === unref(FIELD_TYPE).RDO_REF && props.modelValue && !props.modelValue?.includes(":") ? (openBlock(), createElementBlock("span", _hoisted_2, " 默认 ")) : createCommentVNode("", true)])) : (openBlock(), createBlock(unref(FieldLabel), mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
74
|
+
label: __props.label,
|
|
75
|
+
"tag-widget-style": props.tagWidgetStyle,
|
|
76
|
+
disabled: props.disabled,
|
|
77
|
+
"icon-extra-props": props.iconExtraProps,
|
|
78
|
+
onMouseenter,
|
|
79
|
+
onMouseleave
|
|
80
|
+
}), null, 16, [
|
|
81
|
+
"label",
|
|
82
|
+
"tag-widget-style",
|
|
83
|
+
"disabled",
|
|
84
|
+
"icon-extra-props"
|
|
85
|
+
]))]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["visible"]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { field_readonly_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.field-radio-group .ant-radio-wrapper.ant-radio-wrapper-disabled .ant-radio-checked.ant-radio-disabled .ant-radio-inner {
|
|
2
|
+
border: 1px solid var(--ant-primary-3) !important;
|
|
3
|
+
background-color: #fff;
|
|
4
|
+
}
|
|
5
|
+
.field-radio-group .ant-radio-wrapper.ant-radio-wrapper-disabled .ant-radio-checked.ant-radio-disabled .ant-radio-inner::after {
|
|
6
|
+
background: var(--ant-primary-3);
|
|
7
|
+
}
|
|
8
|
+
.field-radio-group--readonly .ant-radio-wrapper {
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
.field-radio-group--readonly .ant-radio-wrapper .ant-radio-checked .ant-radio-inner {
|
|
12
|
+
border: 1px solid var(--ant-primary-4) !important;
|
|
13
|
+
background-color: #fff;
|
|
14
|
+
}
|
|
15
|
+
.field-radio-group--readonly .ant-radio-wrapper .ant-radio-checked .ant-radio-inner::after {
|
|
16
|
+
background: var(--ant-primary-4);
|
|
17
|
+
}
|
|
18
|
+
.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled .ant-checkbox-inner {
|
|
19
|
+
border: 1px solid var(--ant-primary-3) !important;
|
|
20
|
+
background-color: var(--ant-primary-3);
|
|
21
|
+
}
|
|
22
|
+
.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled .ant-checkbox-inner::after {
|
|
23
|
+
border-color: #fff;
|
|
24
|
+
}
|
|
25
|
+
.field-checkbox-group .ant-checkbox-wrapper.ant-checkbox-wrapper-disabled .ant-checkbox-checked.ant-checkbox-disabled::after {
|
|
26
|
+
border: 1px solid var(--ant-primary-3) !important;
|
|
27
|
+
}
|
|
28
|
+
.field-checkbox-group--readonly .ant-checkbox-wrapper {
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
}
|
|
31
|
+
.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner {
|
|
32
|
+
border: 1px solid var(--ant-primary-4) !important;
|
|
33
|
+
background-color: var(--ant-primary-4);
|
|
34
|
+
}
|
|
35
|
+
.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner::after {
|
|
36
|
+
border-color: #fff;
|
|
37
|
+
}
|
|
38
|
+
.field-checkbox-group--readonly .ant-checkbox-wrapper .ant-checkbox-checked::after {
|
|
39
|
+
border: 1px solid var(--ant-primary-4) !important;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as FieldSelect } from './FieldSelect';
|
|
2
|
+
import { default as FieldRadio } from './FieldRadio';
|
|
3
|
+
import { default as FieldCheckbox } from './FieldCheckbox';
|
|
4
|
+
import { default as TagLabel } from './field-label/tag-label.vue';
|
|
5
|
+
import { default as selectTag } from './field-label/selectTag.vue';
|
|
6
|
+
import { default as fieldReadonly } from './field-readonly.vue';
|
|
7
|
+
import { default as refCardLabelRender } from './field-label/ref-card-label-render.vue';
|
|
8
|
+
import { default as Tag } from './field-label/tag-span.vue';
|
|
9
|
+
import { emptyValueDisplay } from './field-empty-value.tsx';
|
|
10
|
+
export { FieldSelect, FieldRadio, FieldCheckbox, selectTag, TagLabel as taglabel, fieldReadonly, refCardLabelRender, Tag, emptyValueDisplay, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./field-label/tag-span.vue.mjs";
|
|
2
|
+
import "./field-label/tag-label.vue.mjs";
|
|
3
|
+
import "./field-label/selectTag.vue.mjs";
|
|
4
|
+
import "./field-label/ref-card-label-render.vue.mjs";
|
|
5
|
+
import "./field-readonly.vue.mjs";
|
|
6
|
+
import "./FieldSelect.mjs";
|
|
7
|
+
import "./FieldRadio.mjs";
|
|
8
|
+
import "./FieldCheckbox.mjs";
|
|
9
|
+
import "./field-empty-value.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./design-render/design-render.mjs";
|
|
2
|
+
import "./form-component/field-label/tag-span.vue.mjs";
|
|
3
|
+
import "./form-component/field-label/tag-label.vue.mjs";
|
|
4
|
+
import "./form-component/field-label/selectTag.vue.mjs";
|
|
5
|
+
import "./form-component/field-label/ref-card-label-render.vue.mjs";
|
|
6
|
+
import "./form-component/field-readonly.vue.mjs";
|
|
7
|
+
import "./form-component/FieldSelect.mjs";
|
|
8
|
+
import "./form-component/FieldRadio.mjs";
|
|
9
|
+
import "./form-component/FieldCheckbox.mjs";
|
|
10
|
+
import "./form-component/field-empty-value.mjs";
|
|
11
|
+
import "./form-component/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './refCardList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./refCardList.mjs";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FIELD_TYPE } from '@gct-paas/core';
|
|
2
|
+
import { Select } from '@gct-paas/schema';
|
|
3
|
+
export declare function useRefCardData(props: {
|
|
4
|
+
widget: Select;
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare function useGetRefCard(): {
|
|
8
|
+
refCardValues?: undefined;
|
|
9
|
+
trigger?: undefined;
|
|
10
|
+
getCardData?: undefined;
|
|
11
|
+
modelKey?: undefined;
|
|
12
|
+
refCardId?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
refCardValues: any;
|
|
15
|
+
trigger: any;
|
|
16
|
+
getCardData: (...args: any[]) => any;
|
|
17
|
+
modelKey: any;
|
|
18
|
+
refCardId: any;
|
|
19
|
+
};
|
|
20
|
+
export declare function getDataByModelType({ fieldType, modelKey }: {
|
|
21
|
+
fieldType: FIELD_TYPE;
|
|
22
|
+
modelKey: string;
|
|
23
|
+
}, id: string): Promise<IObject | import('@gct-paas/render').RowData>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { transformDataToDict } from "@gct-paas/render";
|
|
2
|
+
import { inject, provide, toRef } from "vue";
|
|
3
|
+
import { EntityModelCategoryEnum, FIELD_TYPE, gctMemoizeAsync } from "@gct-paas/core";
|
|
4
|
+
//#region src/hooks/refCardList.ts
|
|
5
|
+
/**关联字段信息卡逻辑 */
|
|
6
|
+
function useRefCardData(props) {
|
|
7
|
+
const { fieldType, refCard, refCardId, readonly } = props.widget.props;
|
|
8
|
+
if ((fieldType === FIELD_TYPE.REF || fieldType === FIELD_TYPE.REF_MULTI || fieldType === FIELD_TYPE.RDO_REF) && refCard && refCardId && readonly) provide("refCardValues", {
|
|
9
|
+
refCardValues: toRef(() => {
|
|
10
|
+
const values = props.modelValue ?? [];
|
|
11
|
+
if (values instanceof Array) return values;
|
|
12
|
+
else return values.split(",");
|
|
13
|
+
}),
|
|
14
|
+
widget: props.widget
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function useGetRefCard() {
|
|
18
|
+
const refCardInfo = inject("refCardValues");
|
|
19
|
+
if (!refCardInfo) return {};
|
|
20
|
+
const { fieldType, bindModelKey, refCardId, cardTrigger } = refCardInfo?.widget?.props || {};
|
|
21
|
+
return {
|
|
22
|
+
refCardValues: refCardInfo?.refCardValues,
|
|
23
|
+
trigger: cardTrigger,
|
|
24
|
+
getCardData: gctMemoizeAsync(getDataByModelType, {
|
|
25
|
+
fieldType,
|
|
26
|
+
modelKey: bindModelKey
|
|
27
|
+
}),
|
|
28
|
+
modelKey: bindModelKey,
|
|
29
|
+
refCardId
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async function getDataByModelType({ fieldType, modelKey }, id) {
|
|
33
|
+
if (fieldType === FIELD_TYPE.RDO_REF) {
|
|
34
|
+
const { data = {}, dict = {} } = await _api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey({
|
|
35
|
+
modelKey,
|
|
36
|
+
bsKey: "rdoGetVersionByRefId",
|
|
37
|
+
modelCategory: EntityModelCategoryEnum.ENTITY
|
|
38
|
+
}, { foreignFields: [] }, {
|
|
39
|
+
includeDeleted: 1,
|
|
40
|
+
refId: id
|
|
41
|
+
});
|
|
42
|
+
return transformDataToDict(data, dict);
|
|
43
|
+
} else {
|
|
44
|
+
const { data = {}, dict = {} } = await _api.apaas.modelComprehensive.postBizServiceGeneralModelCategoryModelKeyBsKey({
|
|
45
|
+
modelKey,
|
|
46
|
+
bsKey: "getOne",
|
|
47
|
+
modelCategory: EntityModelCategoryEnum.ENTITY
|
|
48
|
+
}, {
|
|
49
|
+
query: { "id_.eq": id },
|
|
50
|
+
foreignFields: []
|
|
51
|
+
}, { includeDeleted: 1 });
|
|
52
|
+
return transformDataToDict(data, dict);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { getDataByModelType, useGetRefCard, useRefCardData };
|
package/es/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { setupPageEvent, usePageEvent, type ContextPcType, } from './Event/
|
|
1
|
+
export { setupPageEvent, usePageEvent, type ContextPcType, type EventsPC, } from './Event/Events';
|
|
2
|
+
export * from './components/index';
|
|
3
|
+
export * from './hooks';
|
|
2
4
|
export declare function run(): void;
|