@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,39 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormItemController, IPickerEditor } from '@gct-paas/core';
|
|
3
|
+
export declare const GctFormPicker: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
c: {
|
|
5
|
+
type: PropType<IFormItemController>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
model: {
|
|
9
|
+
type: PropType<IPickerEditor>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
value: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: null;
|
|
15
|
+
};
|
|
16
|
+
}>, {
|
|
17
|
+
ns: import('@gct-paas/core').Namespace;
|
|
18
|
+
val: import('vue').WritableComputedRef<any, any>;
|
|
19
|
+
nameVal: import('vue').WritableComputedRef<any, any>;
|
|
20
|
+
loadOptions: () => Promise<import('@gct-paas/core').IDictionaryItem[]>;
|
|
21
|
+
onChange: (_val: any, data: any) => void;
|
|
22
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
23
|
+
c: {
|
|
24
|
+
type: PropType<IFormItemController>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
model: {
|
|
28
|
+
type: PropType<IPickerEditor>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
value: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: null;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{
|
|
36
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
value: string;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineComponent, createVNode, resolveComponent, mergeProps, computed } from 'vue';
|
|
2
|
+
import { useNamespace } from '@gct-paas/core';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
const GctFormPicker = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "GctFormPicker",
|
|
7
|
+
props: {
|
|
8
|
+
c: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
model: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: null
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:value"],
|
|
22
|
+
setup(props, {
|
|
23
|
+
emit
|
|
24
|
+
}) {
|
|
25
|
+
const ns = useNamespace("gct-form-picker");
|
|
26
|
+
const nameVal = computed({
|
|
27
|
+
get() {
|
|
28
|
+
if (props.model.nameField) {
|
|
29
|
+
return props.c.data[props.model.nameField];
|
|
30
|
+
}
|
|
31
|
+
return "";
|
|
32
|
+
},
|
|
33
|
+
set(v) {
|
|
34
|
+
if (props.model.nameField) {
|
|
35
|
+
props.c.data[props.model.nameField] = v;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const val = computed({
|
|
40
|
+
get: () => {
|
|
41
|
+
const opt = props.c.state.options.find((_) => {
|
|
42
|
+
return _.value === props.value;
|
|
43
|
+
});
|
|
44
|
+
if (!opt && nameVal.value) {
|
|
45
|
+
return nameVal.value;
|
|
46
|
+
}
|
|
47
|
+
return props.value;
|
|
48
|
+
},
|
|
49
|
+
set: (newVal) => {
|
|
50
|
+
if (typeof newVal === "string") {
|
|
51
|
+
newVal = newVal.trim();
|
|
52
|
+
}
|
|
53
|
+
if (typeof newVal != "object" && props.value == newVal) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
emit("update:value", newVal);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const loadOptions = () => {
|
|
60
|
+
return props.c.loadDictionary();
|
|
61
|
+
};
|
|
62
|
+
if (val.value != null) {
|
|
63
|
+
props.c.loadDictionary();
|
|
64
|
+
}
|
|
65
|
+
const onChange = (_val, data) => {
|
|
66
|
+
nameVal.value = data.label;
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
ns,
|
|
70
|
+
val,
|
|
71
|
+
nameVal,
|
|
72
|
+
loadOptions,
|
|
73
|
+
onChange
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
render() {
|
|
77
|
+
return createVNode(resolveComponent("a-select"), mergeProps({
|
|
78
|
+
"value": this.val,
|
|
79
|
+
"onUpdate:value": ($event) => this.val = $event
|
|
80
|
+
}, this.model.props || {}, {
|
|
81
|
+
"class": this.ns.b(),
|
|
82
|
+
"disabled": this.c.state.disabled,
|
|
83
|
+
"loading": this.c.state.loading,
|
|
84
|
+
"options": this.c.state.options,
|
|
85
|
+
"placeholder": this.model.placeholder,
|
|
86
|
+
"onDropdownVisibleChange": this.loadOptions,
|
|
87
|
+
"onChange": this.onChange
|
|
88
|
+
}), null);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export { GctFormPicker };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEditorProvider } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 数据选择器编辑器
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-03-27 10:03:03
|
|
7
|
+
* @export
|
|
8
|
+
* @class GctFormPickerProvider
|
|
9
|
+
* @implements {IEditorProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class GctFormPickerProvider implements IEditorProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { widthEditorInstall, EditorType } from '@gct-paas/core';
|
|
2
|
+
import { GctFormPickerProvider } from './gct-form-picker.provider.mjs';
|
|
3
|
+
import { GctFormPicker as GctFormPicker$1 } from './gct-form-picker.mjs';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var GctFormPicker = widthEditorInstall(
|
|
7
|
+
EditorType.PICKER,
|
|
8
|
+
() => new GctFormPickerProvider(),
|
|
9
|
+
GctFormPicker$1
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { GctFormPicker as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormItemController, IRadioEditor } from '@gct-paas/core';
|
|
3
|
+
export declare const GctFormRadio: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
c: {
|
|
5
|
+
type: PropType<IFormItemController>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
model: {
|
|
9
|
+
type: PropType<IRadioEditor>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
value: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>, {
|
|
17
|
+
ns: import('@gct-paas/core').Namespace;
|
|
18
|
+
val: import('vue').WritableComputedRef<any, any>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
c: {
|
|
21
|
+
type: PropType<IFormItemController>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
model: {
|
|
25
|
+
type: PropType<IRadioEditor>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
value: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
}>> & Readonly<{
|
|
33
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
value: string;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
37
|
+
export default GctFormRadio;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { isVNode, defineComponent, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { useNamespace, useGctFormValue } from '@gct-paas/core';
|
|
3
|
+
import { RadioGroup, RadioButton } from 'ant-design-vue';
|
|
4
|
+
import './gct-form-radio.scss';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function _isSlot(s) {
|
|
8
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
9
|
+
}
|
|
10
|
+
const GctFormRadio = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "GctFormRadio",
|
|
12
|
+
props: {
|
|
13
|
+
c: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
model: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["update:value"],
|
|
27
|
+
setup() {
|
|
28
|
+
const ns = useNamespace("gct-form-radio");
|
|
29
|
+
const val = useGctFormValue();
|
|
30
|
+
return {
|
|
31
|
+
ns,
|
|
32
|
+
val
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
render() {
|
|
36
|
+
const attrs = {
|
|
37
|
+
...this.model.props || {},
|
|
38
|
+
class: [this.ns.b()],
|
|
39
|
+
allowClear: true,
|
|
40
|
+
disabled: this.c.state.disabled
|
|
41
|
+
};
|
|
42
|
+
if (this.model.buttonMode) {
|
|
43
|
+
let _slot;
|
|
44
|
+
attrs.class.push(this.ns.m("button"));
|
|
45
|
+
return createVNode(RadioGroup, mergeProps({
|
|
46
|
+
"value": this.val,
|
|
47
|
+
"onUpdate:value": ($event) => this.val = $event,
|
|
48
|
+
"size": "small",
|
|
49
|
+
"button-style": "solid"
|
|
50
|
+
}, attrs), _isSlot(_slot = this.c.state.options.map((option) => {
|
|
51
|
+
return createVNode(RadioButton, {
|
|
52
|
+
"key": option.value,
|
|
53
|
+
"value": option.value
|
|
54
|
+
}, {
|
|
55
|
+
default: () => [option.label]
|
|
56
|
+
});
|
|
57
|
+
})) ? _slot : {
|
|
58
|
+
default: () => [_slot]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
attrs.class.push(this.ns.m("radio"));
|
|
62
|
+
return createVNode(RadioGroup, mergeProps({
|
|
63
|
+
"value": this.val,
|
|
64
|
+
"onUpdate:value": ($event) => this.val = $event,
|
|
65
|
+
"options": this.c.state.options
|
|
66
|
+
}, attrs), null);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export { GctFormRadio, GctFormRadio as default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@include b(gct-form-radio) {
|
|
2
|
+
@include m(radio){
|
|
3
|
+
&.ant-radio-group {
|
|
4
|
+
height: 32px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{bem(gct-form-radio)}.#{bem(gct-form-radio,'',button)}.ant-radio-group{
|
|
12
|
+
width: 100%;
|
|
13
|
+
padding: 2px;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
background-color: #f2f4f7;
|
|
16
|
+
display: inline-block;
|
|
17
|
+
display: flex;
|
|
18
|
+
|
|
19
|
+
.ant-radio-button-wrapper {
|
|
20
|
+
border-width: 0;
|
|
21
|
+
background-color: transparent;
|
|
22
|
+
color: #212528;
|
|
23
|
+
border-radius: 2px;
|
|
24
|
+
padding: 0;
|
|
25
|
+
flex: 1;
|
|
26
|
+
text-align: center;
|
|
27
|
+
|
|
28
|
+
&:not(:first-child)::before {
|
|
29
|
+
width: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
span:last-child {
|
|
33
|
+
padding: 4px;
|
|
34
|
+
border-radius: 2px;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
vertical-align: -1px;
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
background-color: #e6e9ef;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ant-radio-button-wrapper-checked {
|
|
45
|
+
background-color: #fff;
|
|
46
|
+
|
|
47
|
+
span:last-child:hover {
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.ant-radio-group-solid
|
|
54
|
+
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
|
|
55
|
+
box-shadow: 0 0 0 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.ant-radio-group-solid
|
|
59
|
+
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {
|
|
60
|
+
color: #212528;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.ant-radio-group-small .ant-radio-button-wrapper {
|
|
64
|
+
height: 24px;
|
|
65
|
+
line-height: 24px;
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IEditorProvider } from '@gct-paas/core';
|
|
2
|
+
export declare class Provider implements IEditorProvider {
|
|
3
|
+
component: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
install(app: import('vue').App): void;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const oldRadioCom: {
|
|
10
|
+
install(app: import('vue').App): void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { widthEditorInstall, EditorType, EditorTypeOld } from '@gct-paas/core';
|
|
2
|
+
import { GctFormRadio as GctFormRadio$1 } from './gct-form-radio.mjs';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
class Provider {
|
|
6
|
+
component = "gct-form-radio";
|
|
7
|
+
}
|
|
8
|
+
var GctFormRadio = widthEditorInstall(
|
|
9
|
+
EditorType.RADIO,
|
|
10
|
+
() => new Provider(),
|
|
11
|
+
GctFormRadio$1
|
|
12
|
+
);
|
|
13
|
+
const oldRadioCom = widthEditorInstall(
|
|
14
|
+
EditorTypeOld.RADIO,
|
|
15
|
+
() => new Provider(),
|
|
16
|
+
GctFormRadio$1
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export { Provider, GctFormRadio as default, oldRadioCom };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormItemController, ISelectEditor } from '@gct-paas/core';
|
|
3
|
+
export declare const GctFormSelect: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
c: {
|
|
5
|
+
type: PropType<IFormItemController>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
model: {
|
|
9
|
+
type: PropType<ISelectEditor>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
value: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>, {
|
|
17
|
+
ns: import('@gct-paas/core').Namespace;
|
|
18
|
+
val: import('vue').WritableComputedRef<any, any>;
|
|
19
|
+
options: import('vue').ComputedRef<import('@gct-paas/core').IDictionaryItem[]>;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
c: {
|
|
22
|
+
type: PropType<IFormItemController>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
model: {
|
|
26
|
+
type: PropType<ISelectEditor>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
value: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{
|
|
34
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
value: string;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
export default GctFormSelect;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, createVNode, resolveComponent, mergeProps, computed } from 'vue';
|
|
2
|
+
import { useNamespace, useGctFormValue } from '@gct-paas/core';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
const GctFormSelect = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "GctFormSelect",
|
|
7
|
+
props: {
|
|
8
|
+
c: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
model: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:value"],
|
|
22
|
+
setup(props) {
|
|
23
|
+
const ns = useNamespace("gct-form-select");
|
|
24
|
+
const val = useGctFormValue();
|
|
25
|
+
const options = computed(() => {
|
|
26
|
+
if (props.c.state.options && props.c.state.options.length > 0) {
|
|
27
|
+
return props.c.state.options;
|
|
28
|
+
}
|
|
29
|
+
return [];
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
ns,
|
|
33
|
+
val,
|
|
34
|
+
options
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
render() {
|
|
38
|
+
return createVNode(resolveComponent("a-select"), mergeProps({
|
|
39
|
+
"value": this.val,
|
|
40
|
+
"onUpdate:value": ($event) => this.val = $event
|
|
41
|
+
}, this.model.props || {}, {
|
|
42
|
+
"class": this.ns.b(),
|
|
43
|
+
"options": this.options,
|
|
44
|
+
"allowClear": true,
|
|
45
|
+
"disabled": this.c.state.disabled
|
|
46
|
+
}), null);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { GctFormSelect, GctFormSelect as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEditorProvider } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 纯预览编辑器
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-03-27 10:03:03
|
|
7
|
+
* @export
|
|
8
|
+
* @class FormSelectProvider
|
|
9
|
+
* @implements {IEditorProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class GctFormSelectProvider implements IEditorProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { widthEditorInstall, EditorType } from '@gct-paas/core';
|
|
2
|
+
import { GctFormSelectProvider } from './gct-form-select.provider.mjs';
|
|
3
|
+
import { GctFormSelect as GctFormSelect$1 } from './gct-form-select.mjs';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var GctFormSelect = widthEditorInstall(
|
|
7
|
+
EditorType.SELECT,
|
|
8
|
+
() => new GctFormSelectProvider(),
|
|
9
|
+
GctFormSelect$1
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { GctFormSelect as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IFormItem, IFormItemController, ISpanEditor } from '@gct-paas/core';
|
|
3
|
+
export declare const GctFormSpan: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
c: {
|
|
5
|
+
type: PropType<IFormItemController>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
itemModel: {
|
|
9
|
+
type: PropType<IFormItem>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
model: {
|
|
13
|
+
type: PropType<ISpanEditor>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
value: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
}>, {
|
|
21
|
+
ns: import('@gct-paas/core').Namespace;
|
|
22
|
+
val: import('vue').ComputedRef<string>;
|
|
23
|
+
handleClipboardKey: () => void;
|
|
24
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
25
|
+
c: {
|
|
26
|
+
type: PropType<IFormItemController>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
itemModel: {
|
|
30
|
+
type: PropType<IFormItem>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
model: {
|
|
34
|
+
type: PropType<ISpanEditor>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
value: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
}>> & Readonly<{}>, {
|
|
42
|
+
value: string;
|
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent, createVNode, toRefs, computed } from 'vue';
|
|
2
|
+
import { useNamespace, useCopyToClipboard } from '@gct-paas/core';
|
|
3
|
+
import { message } from 'ant-design-vue';
|
|
4
|
+
import './gct-form-span.scss';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const GctFormSpan = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "GctFormSpan",
|
|
9
|
+
props: {
|
|
10
|
+
c: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
itemModel: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
model: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
value: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(props) {
|
|
28
|
+
const ns = useNamespace("form-span");
|
|
29
|
+
const {
|
|
30
|
+
model,
|
|
31
|
+
itemModel,
|
|
32
|
+
c
|
|
33
|
+
} = toRefs(props);
|
|
34
|
+
function handleClipboardKey() {
|
|
35
|
+
const {
|
|
36
|
+
isSuccessRef
|
|
37
|
+
} = useCopyToClipboard(props.value);
|
|
38
|
+
if (isSuccessRef.value) {
|
|
39
|
+
message.success(_gct.t("sys.copySuccess"));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
c.value.loadDictionary();
|
|
43
|
+
const val = computed(() => {
|
|
44
|
+
if (model.value.format && typeof model.value.format === "function") {
|
|
45
|
+
return model.value.format(c.value.data, itemModel.value, c.value);
|
|
46
|
+
}
|
|
47
|
+
if (props.value == null || props.value === "") {
|
|
48
|
+
return props.value;
|
|
49
|
+
}
|
|
50
|
+
if (itemModel.value.dictionary) {
|
|
51
|
+
const items = itemModel.value.dictionary.items || [];
|
|
52
|
+
const dictionaryItem = items.find((item) => {
|
|
53
|
+
return item.value == props.value;
|
|
54
|
+
});
|
|
55
|
+
if (dictionaryItem) {
|
|
56
|
+
return dictionaryItem.label;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (c.value.state.options.length > 0) {
|
|
60
|
+
const item = c.value.state.options.find((item2) => {
|
|
61
|
+
return item2.value == props.value;
|
|
62
|
+
});
|
|
63
|
+
if (item) {
|
|
64
|
+
return item.label;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return props.value;
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
ns,
|
|
71
|
+
val,
|
|
72
|
+
handleClipboardKey
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
render() {
|
|
76
|
+
return createVNode("div", {
|
|
77
|
+
"class": this.ns.b()
|
|
78
|
+
}, [createVNode("span", {
|
|
79
|
+
"class": this.ns.e("info")
|
|
80
|
+
}, [this.val]), this.model.copy && createVNode("span", {
|
|
81
|
+
"class": this.ns.e("copy")
|
|
82
|
+
}, [createVNode("i", {
|
|
83
|
+
"class": "iconfont icon-fuzhi primary-gct",
|
|
84
|
+
"onClick": this.handleClipboardKey
|
|
85
|
+
}, null)])]);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export { GctFormSpan };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEditorProvider } from '@gct-paas/core';
|
|
2
|
+
/**
|
|
3
|
+
* 纯文本展示编辑器
|
|
4
|
+
*
|
|
5
|
+
* @author zhanghanrui
|
|
6
|
+
* @date 2024-04-08 13:04:50
|
|
7
|
+
* @export
|
|
8
|
+
* @class GctFormSpanProvider
|
|
9
|
+
* @implements {IEditorProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class GctFormSpanProvider implements IEditorProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|