@gct-paas/core-web 0.0.1-dev.14 → 0.0.1-dev.16
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/core-web.css +1 -0
- package/dist/index.min.cjs +3 -3
- package/dist/index.system.min.js +3 -3
- package/es/components/code-editor/code-editor.d.ts +28 -2
- package/es/components/code-editor/code-editor.mjs +39 -8
- package/es/components/code-editor/code-editor.scss +1 -1
- package/es/components/index.d.ts +4 -0
- package/es/components/index.mjs +4 -0
- package/es/components/layout/flex-container/flex-container.d.ts +15 -0
- package/es/components/layout/flex-container/flex-container.mjs +90 -0
- package/es/components/layout/flex-container/flex-container.scss +3 -0
- package/es/components/layout/flex-item/flex-item.d.ts +14 -0
- package/es/components/layout/flex-item/flex-item.mjs +53 -0
- package/es/components/layout/flex-item/flex-item.scss +17 -0
- package/es/components/layout/grid-container/grid-container.d.ts +13 -0
- package/es/components/layout/grid-container/grid-container.mjs +47 -0
- package/es/components/layout/view-container/view-container.d.ts +25 -0
- package/es/components/layout/view-container/view-container.mjs +39 -0
- package/es/components/layout/view-container/view-container.scss +19 -0
- package/es/editor/gct-form-check-switch/gct-form-check-switch.d.ts +40 -0
- package/es/editor/gct-form-check-switch/gct-form-check-switch.mjs +53 -0
- package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.d.ts +13 -0
- package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.mjs +6 -0
- package/es/editor/gct-form-check-switch/gct-form-check-switch.scss +10 -0
- package/es/editor/gct-form-check-switch/index.d.ts +4 -0
- package/es/editor/gct-form-check-switch/index.mjs +12 -0
- package/es/editor/gct-form-checkbox/gct-form-checkbox.d.ts +41 -0
- package/es/editor/gct-form-checkbox/gct-form-checkbox.mjs +70 -0
- package/es/editor/gct-form-checkbox/gct-form-checkbox.scss +56 -0
- package/es/editor/gct-form-checkbox/index.d.ts +11 -0
- package/es/editor/gct-form-checkbox/index.mjs +19 -0
- package/es/editor/gct-form-color/gct-form-color.d.ts +37 -0
- package/es/editor/gct-form-color/gct-form-color.mjs +43 -0
- package/es/editor/gct-form-color/gct-form-color.provider.d.ts +13 -0
- package/es/editor/gct-form-color/gct-form-color.provider.mjs +6 -0
- package/es/editor/gct-form-color/gct-form-color.scss +3 -0
- package/es/editor/gct-form-color/index.d.ts +4 -0
- package/es/editor/gct-form-color/index.mjs +12 -0
- package/es/editor/gct-form-i18n/gct-form-i18n.d.ts +38 -0
- package/es/editor/gct-form-i18n/gct-form-i18n.mjs +62 -0
- package/es/editor/gct-form-i18n/gct-form-i18n.provider.d.ts +13 -0
- package/es/editor/gct-form-i18n/gct-form-i18n.provider.mjs +6 -0
- package/es/editor/gct-form-i18n/index.d.ts +4 -0
- package/es/editor/gct-form-i18n/index.mjs +12 -0
- package/es/editor/gct-form-icon-select/gct-form-icon-select.d.ts +29 -0
- package/es/editor/gct-form-icon-select/gct-form-icon-select.mjs +74 -0
- package/es/editor/gct-form-icon-select/gct-form-icon-select.scss +14 -0
- package/es/editor/gct-form-icon-select/index.d.ts +8 -0
- package/es/editor/gct-form-icon-select/index.mjs +14 -0
- package/es/editor/gct-form-info/gct-form-info.d.ts +28 -0
- package/es/editor/gct-form-info/gct-form-info.mjs +40 -0
- package/es/editor/gct-form-info/gct-form-info.scss +8 -0
- package/es/editor/gct-form-info/index.d.ts +8 -0
- package/es/editor/gct-form-info/index.mjs +14 -0
- package/es/editor/gct-form-length-unit/gct-form-length-unit.d.ts +39 -0
- package/es/editor/gct-form-length-unit/gct-form-length-unit.mjs +43 -0
- package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.d.ts +13 -0
- package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.mjs +6 -0
- package/es/editor/gct-form-length-unit/index.d.ts +4 -0
- package/es/editor/gct-form-length-unit/index.mjs +12 -0
- package/es/editor/gct-form-number/gct-form-number.d.ts +29 -0
- package/es/editor/gct-form-number/gct-form-number.mjs +46 -0
- package/es/editor/gct-form-number/gct-form-number.provider.d.ts +4 -0
- package/es/editor/gct-form-number/gct-form-number.provider.mjs +6 -0
- package/es/editor/gct-form-number/index.d.ts +4 -0
- package/es/editor/gct-form-number/index.mjs +12 -0
- package/es/editor/gct-form-picker/gct-form-picker.d.ts +39 -0
- package/es/editor/gct-form-picker/gct-form-picker.mjs +92 -0
- package/es/editor/gct-form-picker/gct-form-picker.provider.d.ts +13 -0
- package/es/editor/gct-form-picker/gct-form-picker.provider.mjs +6 -0
- package/es/editor/gct-form-picker/index.d.ts +4 -0
- package/es/editor/gct-form-picker/index.mjs +12 -0
- package/es/editor/gct-form-radio/gct-form-radio.d.ts +37 -0
- package/es/editor/gct-form-radio/gct-form-radio.mjs +70 -0
- package/es/editor/gct-form-radio/gct-form-radio.scss +68 -0
- package/es/editor/gct-form-radio/index.d.ts +11 -0
- package/es/editor/gct-form-radio/index.mjs +19 -0
- package/es/editor/gct-form-select/gct-form-select.d.ts +38 -0
- package/es/editor/gct-form-select/gct-form-select.mjs +50 -0
- package/es/editor/gct-form-select/gct-form-select.provider.d.ts +13 -0
- package/es/editor/gct-form-select/gct-form-select.provider.mjs +6 -0
- package/es/editor/gct-form-select/index.d.ts +4 -0
- package/es/editor/gct-form-select/index.mjs +12 -0
- package/es/editor/gct-form-span/gct-form-span.d.ts +43 -0
- package/es/editor/gct-form-span/gct-form-span.mjs +89 -0
- package/es/editor/gct-form-span/gct-form-span.provider.d.ts +13 -0
- package/es/editor/gct-form-span/gct-form-span.provider.mjs +6 -0
- package/es/editor/gct-form-span/gct-form-span.scss +10 -0
- package/es/editor/gct-form-span/index.d.ts +4 -0
- package/es/editor/gct-form-span/index.mjs +12 -0
- package/es/editor/gct-form-switch/gct-form-switch.d.ts +26 -0
- package/es/editor/gct-form-switch/gct-form-switch.mjs +35 -0
- package/es/editor/gct-form-switch/gct-form-switch.provider.d.ts +13 -0
- package/es/editor/gct-form-switch/gct-form-switch.provider.mjs +6 -0
- package/es/editor/gct-form-switch/index.d.ts +7 -0
- package/es/editor/gct-form-switch/index.mjs +17 -0
- package/es/editor/gct-form-text/gct-form-text.d.ts +32 -0
- package/es/editor/gct-form-text/gct-form-text.mjs +45 -0
- package/es/editor/gct-form-text/gct-form-text.provider.d.ts +13 -0
- package/es/editor/gct-form-text/gct-form-text.provider.mjs +6 -0
- package/es/editor/gct-form-text/index.d.ts +7 -0
- package/es/editor/gct-form-text/index.mjs +17 -0
- package/es/editor/gct-form-textarea/gct-form-textarea.d.ts +28 -0
- package/es/editor/gct-form-textarea/gct-form-textarea.mjs +40 -0
- package/es/editor/gct-form-textarea/gct-form-textarea.provider.d.ts +4 -0
- package/es/editor/gct-form-textarea/gct-form-textarea.provider.mjs +6 -0
- package/es/editor/gct-form-textarea/index.d.ts +4 -0
- package/es/editor/gct-form-textarea/index.mjs +12 -0
- package/es/editor/index.d.ts +5 -0
- package/es/editor/index.mjs +42 -0
- package/es/index.d.ts +1 -0
- package/es/index.mjs +15 -1
- package/es/types/index.d.ts +1 -0
- package/es/widgets/gct-edit-form/gct-edit-form.d.ts +62 -0
- package/es/widgets/gct-edit-form/gct-edit-form.mjs +126 -0
- package/es/widgets/gct-edit-form/index.d.ts +5 -0
- package/es/widgets/gct-edit-form/index.mjs +10 -0
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.d.ts +31 -0
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.mjs +73 -0
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.scss +62 -0
- package/es/widgets/gct-form/gct-form-collapse/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-collapse/index.mjs +15 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.d.ts +29 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.mjs +71 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.mjs +13 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.scss +23 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-collapse-pane/index.mjs +15 -0
- package/es/widgets/gct-form/gct-form-group/gct-form-group.d.ts +30 -0
- package/es/widgets/gct-form/gct-form-group/gct-form-group.mjs +88 -0
- package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-group/gct-form-group.scss +28 -0
- package/es/widgets/gct-form/gct-form-group/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-group/index.mjs +15 -0
- package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.mjs +13 -0
- package/es/widgets/gct-form/gct-form-item/gct-form-item.d.ts +35 -0
- package/es/widgets/gct-form/gct-form-item/gct-form-item.mjs +141 -0
- package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-item/gct-form-item.scss +115 -0
- package/es/widgets/gct-form/gct-form-tab/gct-form-tab.d.ts +28 -0
- package/es/widgets/gct-form/gct-form-tab/gct-form-tab.mjs +53 -0
- package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-tab/gct-form-tab.scss +63 -0
- package/es/widgets/gct-form/gct-form-tab/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-tab/index.mjs +12 -0
- package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.d.ts +29 -0
- package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.mjs +65 -0
- package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.scss +16 -0
- package/es/widgets/gct-form/gct-form-tab-pane/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-tab-pane/index.mjs +15 -0
- package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.d.ts +30 -0
- package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.mjs +71 -0
- package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.mjs +11 -0
- package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.scss +25 -0
- package/es/widgets/gct-form/gct-form-title-group/index.d.ts +5 -0
- package/es/widgets/gct-form/gct-form-title-group/index.mjs +16 -0
- package/es/widgets/gct-form/gct-form.d.ts +31 -0
- package/es/widgets/gct-form/gct-form.mjs +109 -0
- package/es/widgets/gct-form/gct-form.scss +11 -0
- package/es/widgets/gct-form/index.d.ts +5 -0
- package/es/widgets/gct-form/index.mjs +31 -0
- package/package.json +7 -5
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { isVNode, defineComponent, h, resolveComponent, createVNode, computed } from 'vue';
|
|
2
|
+
import { EditorRegisterConst, useNamespace } from '@gct-paas/core';
|
|
3
|
+
import './gct-form-item.scss';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function _isSlot(s) {
|
|
7
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
8
|
+
}
|
|
9
|
+
const GctFormItem = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "GctFormItem",
|
|
11
|
+
props: {
|
|
12
|
+
c: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
formModel: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
model: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(props) {
|
|
26
|
+
const ns = useNamespace("gct-form-item");
|
|
27
|
+
const style = {};
|
|
28
|
+
if (props.formModel.labelWidth) {
|
|
29
|
+
style[ns.cssVarName("form-item-label-width")] = props.formModel.labelWidth;
|
|
30
|
+
}
|
|
31
|
+
if (props.model.labelWidth) {
|
|
32
|
+
style[ns.cssVarName("form-item-label-width")] = props.model.labelWidth;
|
|
33
|
+
}
|
|
34
|
+
if (props.model.labelAlign) {
|
|
35
|
+
style[ns.cssVarName("form-item-label-align")] = props.model.labelAlign;
|
|
36
|
+
}
|
|
37
|
+
if (props.model.editorAlign) {
|
|
38
|
+
style[ns.cssVarName("form-item-editor-align")] = props.model.editorAlign;
|
|
39
|
+
}
|
|
40
|
+
if (props.model.width) {
|
|
41
|
+
style[ns.cssVarName("form-item-width")] = props.model.width;
|
|
42
|
+
}
|
|
43
|
+
if (props.model.margin) {
|
|
44
|
+
style.margin = props.model.margin;
|
|
45
|
+
}
|
|
46
|
+
if (props.model.padding) {
|
|
47
|
+
style.padding = props.model.padding;
|
|
48
|
+
}
|
|
49
|
+
const required = computed(() => {
|
|
50
|
+
return !!props.model.rules?.find((item) => item.required);
|
|
51
|
+
});
|
|
52
|
+
const renderLabelTooltip = () => {
|
|
53
|
+
if (!props.model.labelTooltip) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return createVNode(resolveComponent("a-tooltip"), {
|
|
57
|
+
"class": ns.e("label-tooltip"),
|
|
58
|
+
"placement": "topLeft",
|
|
59
|
+
"title": props.model.labelTooltip
|
|
60
|
+
}, {
|
|
61
|
+
default: () => [createVNode("span", {
|
|
62
|
+
"class": "iconfont icon-assist ml5px text-[#bfbfbf]"
|
|
63
|
+
}, null)]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
ns,
|
|
68
|
+
style,
|
|
69
|
+
required,
|
|
70
|
+
renderLabelTooltip
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
render() {
|
|
74
|
+
const provider = _gct.register.editor.get(EditorRegisterConst.PREFIX + this.model.editor.type);
|
|
75
|
+
if (!provider) {
|
|
76
|
+
console.error(`\u672A\u627E\u5230\u8868\u5355\u9879${this.model.name}\u7684\u7F16\u8F91\u5668${this.model.editor.type}\u7684\u9002\u914D\u5668\u5B9E\u4F8B\uFF1A`, this.model);
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const labelPosition = this.model.labelPosition || "left";
|
|
80
|
+
let content = null;
|
|
81
|
+
if (provider) {
|
|
82
|
+
if (provider.render) {
|
|
83
|
+
content = provider.render(this.c.editorValue, this.c.data, this.model);
|
|
84
|
+
} else {
|
|
85
|
+
if (provider.component) {
|
|
86
|
+
content = h(typeof provider.component === "string" ? resolveComponent(provider.component) : provider.component, {
|
|
87
|
+
key: this.model.name,
|
|
88
|
+
c: this.c,
|
|
89
|
+
value: this.c.editorValue,
|
|
90
|
+
itemModel: this.model,
|
|
91
|
+
model: this.model.editor,
|
|
92
|
+
data: this.c.data,
|
|
93
|
+
disabled: this.c.state.disabled,
|
|
94
|
+
readonly: this.c.state.readonly,
|
|
95
|
+
keepalive: this.c.state.keepalive,
|
|
96
|
+
visible: this.c.state.visible,
|
|
97
|
+
class: [this.ns.e("editor"), this.ns.e(labelPosition), this.model.editor.class],
|
|
98
|
+
style: this.model.editor.style,
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
"onUpdate:value": (value) => {
|
|
101
|
+
this.c.editorValue = value;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
console.error(`\u672A\u627E\u5230\u7F16\u8F91\u5668\u7ED8\u5236\u7EC4\u4EF6\uFF1A${this.model.name} - ${this.model.editor.type}\uFF0C\u8BF7\u5B9E\u73B0 component \u6216 render \u65B9\u6CD5`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
console.error(`\u672A\u627E\u5230\u7F16\u8F91\u5668\u9002\u914D\u5668\uFF1A${this.model.name} - ${this.model.editor.type}`);
|
|
110
|
+
}
|
|
111
|
+
if (this.model.label && labelPosition === "top") {
|
|
112
|
+
content = [createVNode("div", {
|
|
113
|
+
"class": [this.ns.e("label"), this.ns.em("label", labelPosition)]
|
|
114
|
+
}, [this.model.label, this.renderLabelTooltip()]), content];
|
|
115
|
+
}
|
|
116
|
+
const itemSlots = {
|
|
117
|
+
default: () => {
|
|
118
|
+
return content;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
if (labelPosition === "left" && this.model.label) {
|
|
122
|
+
itemSlots.label = () => {
|
|
123
|
+
return [createVNode("span", null, [this.model.label]), this.renderLabelTooltip()];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return createVNode(resolveComponent("a-form-item"), {
|
|
127
|
+
"key": this.c.model.name,
|
|
128
|
+
"colon": this.formModel.noColon === true ? false : this.model.noColon === true ? false : true,
|
|
129
|
+
"name": this.model.name,
|
|
130
|
+
"label": void 0,
|
|
131
|
+
"class": [this.ns.b(), this.ns.is("readonly", this.model.editor.readonly === true), this.ns.is("required", this.required), this.ns.is("hidden", this.c.state.visible === false), this.ns.is("hidden-label", !this.model.label), this.ns.m("label-" + labelPosition)],
|
|
132
|
+
"style": this.style,
|
|
133
|
+
"rules": this.c.state.visible === true ? this.model.rules : [],
|
|
134
|
+
"layout": "horizontal"
|
|
135
|
+
}, _isSlot(itemSlots) ? itemSlots : {
|
|
136
|
+
default: () => [itemSlots]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export { GctFormItem, GctFormItem as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IFormController, IFormItemBasic, IFormItemController, IFormItemProvider } from '@gct-paas/core';
|
|
2
|
+
export declare class GctFormItemProvider implements IFormItemProvider {
|
|
3
|
+
component: string;
|
|
4
|
+
createController(form: IFormController, item: IFormItemBasic): IFormItemController;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useFormItemController, FormItemController } from '@gct-paas/core';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class GctFormItemProvider {
|
|
5
|
+
component = "gct-form-item";
|
|
6
|
+
createController(form, item) {
|
|
7
|
+
return useFormItemController(() => new FormItemController(form, item));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { GctFormItemProvider };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
$gct-form-item: (
|
|
2
|
+
min-height: 32px,
|
|
3
|
+
height: auto,
|
|
4
|
+
width: auto,
|
|
5
|
+
label-width: 100px,
|
|
6
|
+
readonly-color: #999,
|
|
7
|
+
label-align: right,
|
|
8
|
+
editor-align: left,
|
|
9
|
+
label-color: #252525,
|
|
10
|
+
label-font-size: 14px,
|
|
11
|
+
checkbox-width: 6px,
|
|
12
|
+
checkbox-height: 9px,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
@include b(gct-form-item) {
|
|
16
|
+
@include set-component-css-var('form-item', $gct-form-item);
|
|
17
|
+
|
|
18
|
+
width: getCssVar(form-item, width);
|
|
19
|
+
height: getCssVar(form-item, height);
|
|
20
|
+
min-height: getCssVar(form-item, min-height);
|
|
21
|
+
|
|
22
|
+
@include when(hidden-label) {
|
|
23
|
+
.gct-gct-form-item__editor {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include when(hidden) {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include when(readonly) {
|
|
33
|
+
margin-bottom: 18px !important;
|
|
34
|
+
#{getCssVarName(form-item, min-height)}: 22px;
|
|
35
|
+
|
|
36
|
+
.ant-form-item-label {
|
|
37
|
+
padding: 0;
|
|
38
|
+
|
|
39
|
+
label {
|
|
40
|
+
color: getCssVar(form-item, readonly-color);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@include e(label) {
|
|
45
|
+
color: getCssVar(form-item, readonly-color);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include when(required) {
|
|
50
|
+
@include e(label) {
|
|
51
|
+
&::before {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
margin-inline-end: 4px;
|
|
54
|
+
color: #ff4d4f;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-family: SimSun, sans-serif;
|
|
57
|
+
line-height: 1;
|
|
58
|
+
content: '*';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ant-form-item-label {
|
|
64
|
+
width: getCssVar(form-item, label-width);
|
|
65
|
+
text-align: getCssVar(form-item, label-align);
|
|
66
|
+
|
|
67
|
+
label {
|
|
68
|
+
color: getCssVar(form-item, label-color);
|
|
69
|
+
font-size: getCssVar(form-item, label-font-size);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ant-form-item-control-input-content {
|
|
74
|
+
text-align: getCssVar(form-item, editor-align);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@include e(label) {
|
|
78
|
+
width: getCssVar(form-item, label-width);
|
|
79
|
+
line-height: 1.5715;
|
|
80
|
+
font-size: getCssVar(form-item, label-font-size);
|
|
81
|
+
|
|
82
|
+
@include m(top) {
|
|
83
|
+
width: 100%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include m(label-top) {
|
|
88
|
+
@include e(label) {
|
|
89
|
+
margin-bottom: 8px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 组件样式压
|
|
94
|
+
.ant-form-item-control-input {
|
|
95
|
+
flex-grow: 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ant-checkbox-group {
|
|
99
|
+
font-size: getCssVar(form-item, label-font-size);
|
|
100
|
+
|
|
101
|
+
.ant-checkbox-wrapper {
|
|
102
|
+
font-size: getCssVar(form-item, label-font-size);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ant-form input[type="checkbox"], .ant-checkbox-inner {
|
|
106
|
+
width: getCssVar(form-item, label-font-size);
|
|
107
|
+
height: getCssVar(form-item, label-font-size);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ant-checkbox-inner::after {
|
|
111
|
+
width: getCssVar(form-item, checkbox-width);
|
|
112
|
+
height: getCssVar(form-item, checkbox-height);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormTab, IFormTabController } from '@gct-paas/core';
|
|
3
|
+
/**
|
|
4
|
+
* 表单分页
|
|
5
|
+
*/
|
|
6
|
+
export declare const GctFormTab: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
c: {
|
|
8
|
+
type: PropType<IFormTabController>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
model: {
|
|
12
|
+
type: PropType<IFormTab>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>, {
|
|
16
|
+
ns: import('@gct-paas/core').Namespace;
|
|
17
|
+
style: IParams;
|
|
18
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
19
|
+
c: {
|
|
20
|
+
type: PropType<IFormTabController>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
model: {
|
|
24
|
+
type: PropType<IFormTab>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export default GctFormTab;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent, createVNode, resolveComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@gct-paas/core';
|
|
3
|
+
import './gct-form-tab.scss';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const GctFormTab = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "GctFormTab",
|
|
8
|
+
props: {
|
|
9
|
+
c: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
model: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(props) {
|
|
19
|
+
const ns = useNamespace("form-tab");
|
|
20
|
+
const style = {};
|
|
21
|
+
if (props.model.width) {
|
|
22
|
+
style[ns.cssVarName("form-tab-width")] = props.model.width;
|
|
23
|
+
}
|
|
24
|
+
if (props.model.height) {
|
|
25
|
+
style[ns.cssVarName("form-tab-height")] = props.model.height;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
ns,
|
|
29
|
+
style
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
render() {
|
|
33
|
+
if (this.c.state.keepalive !== true && this.c.state.visible === false) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const items = this.$slots.default?.() || [];
|
|
37
|
+
return createVNode(resolveComponent("a-tabs"), {
|
|
38
|
+
"class": [this.ns.b(), this.ns.is("hidden", this.c.state.visible === false), this.ns.m(this.model.navPosition || "left")],
|
|
39
|
+
"style": this.style
|
|
40
|
+
}, {
|
|
41
|
+
default: () => [this.model.children?.map((item, index) => {
|
|
42
|
+
return createVNode(resolveComponent("a-tab-pane"), {
|
|
43
|
+
"key": item.name,
|
|
44
|
+
"tab": item.title
|
|
45
|
+
}, {
|
|
46
|
+
default: () => [items[index]]
|
|
47
|
+
});
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export { GctFormTab, GctFormTab as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IFormController, IFormTabController, IFormItemBasic, IFormItemProvider } from '@gct-paas/core';
|
|
2
|
+
export declare class GctFormTabProvider implements IFormItemProvider {
|
|
3
|
+
component: string;
|
|
4
|
+
createController(form: IFormController, item: IFormItemBasic): IFormTabController;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useFormItemController, FormTabController } from '@gct-paas/core';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class GctFormTabProvider {
|
|
5
|
+
component = "gct-form-tab";
|
|
6
|
+
createController(form, item) {
|
|
7
|
+
return useFormItemController(() => new FormTabController(form, item));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { GctFormTabProvider };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
$gct-form-tab: (
|
|
2
|
+
tab-spacing: 52px,
|
|
3
|
+
width: auto,
|
|
4
|
+
height: auto,
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
@include b(form-tab) {
|
|
8
|
+
@include set-component-css-var('form-tab', $gct-form-tab);
|
|
9
|
+
|
|
10
|
+
width: getCssVar(form-tab, width);
|
|
11
|
+
height: getCssVar(form-tab, height);
|
|
12
|
+
|
|
13
|
+
@include when(hidden) {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 原组件样式调整
|
|
18
|
+
>.ant-tabs-nav{
|
|
19
|
+
margin-bottom: 0 !important;
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
|
|
22
|
+
>.ant-tabs-nav-wrap{
|
|
23
|
+
border-bottom: 1px solid #E0E3EA;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ant-tabs-tab+.ant-tabs-tab{
|
|
27
|
+
margin-left: getCssVar(form-tab, tab-spacing);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* stylelint-disable-next-line no-descending-specificity */
|
|
31
|
+
.ant-tabs-tab {
|
|
32
|
+
padding: 7px 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.ant-tabs {
|
|
37
|
+
.ant-tabs-tabpane {
|
|
38
|
+
overflow: hidden auto;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
>.ant-tabs-content-holder >.ant-tabs-content{
|
|
43
|
+
height: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include m(left){
|
|
47
|
+
>.ant-tabs-nav .ant-tabs-nav-wrap{
|
|
48
|
+
justify-content: flex-start;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include m(right){
|
|
53
|
+
>.ant-tabs-nav .ant-tabs-nav-wrap{
|
|
54
|
+
justify-content: flex-end;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@include m(center){
|
|
59
|
+
>.ant-tabs-nav .ant-tabs-nav-wrap{
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GctFormTabProvider } from './gct-form-tab.provider.mjs';
|
|
2
|
+
import { GctFormTab as GctFormTab$1 } from './gct-form-tab.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var GctFormTab = {
|
|
6
|
+
install(app) {
|
|
7
|
+
_gct.register.formItem.register("tab", () => new GctFormTabProvider());
|
|
8
|
+
app.component(GctFormTab$1.name, GctFormTab$1);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { GctFormTab as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormTabPane, IFormTabPaneController } from '@gct-paas/core';
|
|
3
|
+
/**
|
|
4
|
+
* 表单分页pane
|
|
5
|
+
*/
|
|
6
|
+
export declare const GctFormTabPane: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
c: {
|
|
8
|
+
type: PropType<IFormTabPaneController>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
model: {
|
|
12
|
+
type: PropType<IFormTabPane>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>, {
|
|
16
|
+
ns: import('@gct-paas/core').Namespace;
|
|
17
|
+
style: IParams;
|
|
18
|
+
renderContainer: (items: unknown[]) => import("vue/jsx-runtime").JSX.Element | undefined;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
c: {
|
|
21
|
+
type: PropType<IFormTabPaneController>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
model: {
|
|
25
|
+
type: PropType<IFormTabPane>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
export default GctFormTabPane;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { isVNode, defineComponent, createVNode, resolveComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@gct-paas/core';
|
|
3
|
+
import './gct-form-tab-pane.scss';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function _isSlot(s) {
|
|
7
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
8
|
+
}
|
|
9
|
+
const GctFormTabPane = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "GctFormTabPane",
|
|
11
|
+
props: {
|
|
12
|
+
c: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
model: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(props) {
|
|
22
|
+
const ns = useNamespace("form-tab-pane");
|
|
23
|
+
const style = {};
|
|
24
|
+
function renderContainer(items) {
|
|
25
|
+
if (props.model.layout === "flex") {
|
|
26
|
+
return createVNode(resolveComponent("flex-container"), {
|
|
27
|
+
"layout": props.model.flex
|
|
28
|
+
}, _isSlot(items) ? items : {
|
|
29
|
+
default: () => [items]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (props.model.layout === "grid") {
|
|
33
|
+
return createVNode(resolveComponent("grid-container"), {
|
|
34
|
+
"layout": props.model.grid
|
|
35
|
+
}, _isSlot(items) ? items : {
|
|
36
|
+
default: () => [items]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
console.error("\u4E0D\u652F\u6301\u7684layout\u7C7B\u578B" + props.model.layout);
|
|
40
|
+
}
|
|
41
|
+
if (props.model.width) {
|
|
42
|
+
style[ns.cssVarName("form-tab-pane-width")] = props.model.width;
|
|
43
|
+
}
|
|
44
|
+
if (props.model.height) {
|
|
45
|
+
style[ns.cssVarName("form-tab-pane-height")] = props.model.height;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
ns,
|
|
49
|
+
style,
|
|
50
|
+
renderContainer
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
render() {
|
|
54
|
+
if (this.c.state.keepalive !== true && this.c.state.visible === false) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const items = this.$slots.default?.() || [];
|
|
58
|
+
return createVNode("div", {
|
|
59
|
+
"class": [this.ns.b(), this.ns.is("hidden", this.c.state.visible === false)],
|
|
60
|
+
"style": this.style
|
|
61
|
+
}, [this.renderContainer(items)]);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export { GctFormTabPane, GctFormTabPane as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IFormController, IFormTabPaneController, IFormItemBasic, IFormItemProvider } from '@gct-paas/core';
|
|
2
|
+
export declare class GctFormTabPaneProvider implements IFormItemProvider {
|
|
3
|
+
component: string;
|
|
4
|
+
createController(form: IFormController, item: IFormItemBasic): IFormTabPaneController;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useFormItemController, FormTabPaneController } from '@gct-paas/core';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class GctFormTabPaneProvider {
|
|
5
|
+
component = "gct-form-tab-pane";
|
|
6
|
+
createController(form, item) {
|
|
7
|
+
return useFormItemController(() => new FormTabPaneController(form, item));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { GctFormTabPaneProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
$gct-form-tab-pane: (
|
|
2
|
+
width: auto,
|
|
3
|
+
height: auto,
|
|
4
|
+
);
|
|
5
|
+
|
|
6
|
+
@include b(form-tab-pane) {
|
|
7
|
+
@include set-component-css-var('form-tab-pane', $gct-form-tab-pane);
|
|
8
|
+
|
|
9
|
+
width: getCssVar(form-tab-pane, width);
|
|
10
|
+
height: 100%;
|
|
11
|
+
background-color: #fff;
|
|
12
|
+
|
|
13
|
+
@include when(hidden) {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GctFormTabPaneProvider } from './gct-form-tab-pane.provider.mjs';
|
|
2
|
+
import { GctFormTabPane as GctFormTabPane$1 } from './gct-form-tab-pane.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var GctFormTabPane = {
|
|
6
|
+
install(app) {
|
|
7
|
+
_gct.register.formItem.register(
|
|
8
|
+
"tab-pane",
|
|
9
|
+
() => new GctFormTabPaneProvider()
|
|
10
|
+
);
|
|
11
|
+
app.component(GctFormTabPane$1.name, GctFormTabPane$1);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { GctFormTabPane as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormGroup, IFormGroupController } from '@gct-paas/core';
|
|
3
|
+
/**
|
|
4
|
+
* 表单分组
|
|
5
|
+
*/
|
|
6
|
+
export declare const GctFormTitleGroup: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
|
+
c: {
|
|
8
|
+
type: PropType<IFormGroupController>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
model: {
|
|
12
|
+
type: PropType<IFormGroup>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>, {
|
|
16
|
+
ns: import('@gct-paas/core').Namespace;
|
|
17
|
+
keys: import('vue').Ref<number[], number[]>;
|
|
18
|
+
style: IParams;
|
|
19
|
+
renderContainer: (items: unknown[]) => import("vue/jsx-runtime").JSX.Element | undefined;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
c: {
|
|
22
|
+
type: PropType<IFormGroupController>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
model: {
|
|
26
|
+
type: PropType<IFormGroup>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
export default GctFormTitleGroup;
|