@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.
Files changed (172) hide show
  1. package/dist/core-web.css +1 -0
  2. package/dist/index.min.cjs +3 -3
  3. package/dist/index.system.min.js +3 -3
  4. package/es/components/code-editor/code-editor.d.ts +28 -2
  5. package/es/components/code-editor/code-editor.mjs +39 -8
  6. package/es/components/code-editor/code-editor.scss +1 -1
  7. package/es/components/index.d.ts +4 -0
  8. package/es/components/index.mjs +4 -0
  9. package/es/components/layout/flex-container/flex-container.d.ts +15 -0
  10. package/es/components/layout/flex-container/flex-container.mjs +90 -0
  11. package/es/components/layout/flex-container/flex-container.scss +3 -0
  12. package/es/components/layout/flex-item/flex-item.d.ts +14 -0
  13. package/es/components/layout/flex-item/flex-item.mjs +53 -0
  14. package/es/components/layout/flex-item/flex-item.scss +17 -0
  15. package/es/components/layout/grid-container/grid-container.d.ts +13 -0
  16. package/es/components/layout/grid-container/grid-container.mjs +47 -0
  17. package/es/components/layout/view-container/view-container.d.ts +25 -0
  18. package/es/components/layout/view-container/view-container.mjs +39 -0
  19. package/es/components/layout/view-container/view-container.scss +19 -0
  20. package/es/editor/gct-form-check-switch/gct-form-check-switch.d.ts +40 -0
  21. package/es/editor/gct-form-check-switch/gct-form-check-switch.mjs +53 -0
  22. package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.d.ts +13 -0
  23. package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.mjs +6 -0
  24. package/es/editor/gct-form-check-switch/gct-form-check-switch.scss +10 -0
  25. package/es/editor/gct-form-check-switch/index.d.ts +4 -0
  26. package/es/editor/gct-form-check-switch/index.mjs +12 -0
  27. package/es/editor/gct-form-checkbox/gct-form-checkbox.d.ts +41 -0
  28. package/es/editor/gct-form-checkbox/gct-form-checkbox.mjs +70 -0
  29. package/es/editor/gct-form-checkbox/gct-form-checkbox.scss +56 -0
  30. package/es/editor/gct-form-checkbox/index.d.ts +11 -0
  31. package/es/editor/gct-form-checkbox/index.mjs +19 -0
  32. package/es/editor/gct-form-color/gct-form-color.d.ts +37 -0
  33. package/es/editor/gct-form-color/gct-form-color.mjs +43 -0
  34. package/es/editor/gct-form-color/gct-form-color.provider.d.ts +13 -0
  35. package/es/editor/gct-form-color/gct-form-color.provider.mjs +6 -0
  36. package/es/editor/gct-form-color/gct-form-color.scss +3 -0
  37. package/es/editor/gct-form-color/index.d.ts +4 -0
  38. package/es/editor/gct-form-color/index.mjs +12 -0
  39. package/es/editor/gct-form-i18n/gct-form-i18n.d.ts +38 -0
  40. package/es/editor/gct-form-i18n/gct-form-i18n.mjs +62 -0
  41. package/es/editor/gct-form-i18n/gct-form-i18n.provider.d.ts +13 -0
  42. package/es/editor/gct-form-i18n/gct-form-i18n.provider.mjs +6 -0
  43. package/es/editor/gct-form-i18n/index.d.ts +4 -0
  44. package/es/editor/gct-form-i18n/index.mjs +12 -0
  45. package/es/editor/gct-form-icon-select/gct-form-icon-select.d.ts +29 -0
  46. package/es/editor/gct-form-icon-select/gct-form-icon-select.mjs +74 -0
  47. package/es/editor/gct-form-icon-select/gct-form-icon-select.scss +14 -0
  48. package/es/editor/gct-form-icon-select/index.d.ts +8 -0
  49. package/es/editor/gct-form-icon-select/index.mjs +14 -0
  50. package/es/editor/gct-form-info/gct-form-info.d.ts +28 -0
  51. package/es/editor/gct-form-info/gct-form-info.mjs +40 -0
  52. package/es/editor/gct-form-info/gct-form-info.scss +8 -0
  53. package/es/editor/gct-form-info/index.d.ts +8 -0
  54. package/es/editor/gct-form-info/index.mjs +14 -0
  55. package/es/editor/gct-form-length-unit/gct-form-length-unit.d.ts +39 -0
  56. package/es/editor/gct-form-length-unit/gct-form-length-unit.mjs +43 -0
  57. package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.d.ts +13 -0
  58. package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.mjs +6 -0
  59. package/es/editor/gct-form-length-unit/index.d.ts +4 -0
  60. package/es/editor/gct-form-length-unit/index.mjs +12 -0
  61. package/es/editor/gct-form-number/gct-form-number.d.ts +29 -0
  62. package/es/editor/gct-form-number/gct-form-number.mjs +46 -0
  63. package/es/editor/gct-form-number/gct-form-number.provider.d.ts +4 -0
  64. package/es/editor/gct-form-number/gct-form-number.provider.mjs +6 -0
  65. package/es/editor/gct-form-number/index.d.ts +4 -0
  66. package/es/editor/gct-form-number/index.mjs +12 -0
  67. package/es/editor/gct-form-picker/gct-form-picker.d.ts +39 -0
  68. package/es/editor/gct-form-picker/gct-form-picker.mjs +92 -0
  69. package/es/editor/gct-form-picker/gct-form-picker.provider.d.ts +13 -0
  70. package/es/editor/gct-form-picker/gct-form-picker.provider.mjs +6 -0
  71. package/es/editor/gct-form-picker/index.d.ts +4 -0
  72. package/es/editor/gct-form-picker/index.mjs +12 -0
  73. package/es/editor/gct-form-radio/gct-form-radio.d.ts +37 -0
  74. package/es/editor/gct-form-radio/gct-form-radio.mjs +70 -0
  75. package/es/editor/gct-form-radio/gct-form-radio.scss +68 -0
  76. package/es/editor/gct-form-radio/index.d.ts +11 -0
  77. package/es/editor/gct-form-radio/index.mjs +19 -0
  78. package/es/editor/gct-form-select/gct-form-select.d.ts +38 -0
  79. package/es/editor/gct-form-select/gct-form-select.mjs +50 -0
  80. package/es/editor/gct-form-select/gct-form-select.provider.d.ts +13 -0
  81. package/es/editor/gct-form-select/gct-form-select.provider.mjs +6 -0
  82. package/es/editor/gct-form-select/index.d.ts +4 -0
  83. package/es/editor/gct-form-select/index.mjs +12 -0
  84. package/es/editor/gct-form-span/gct-form-span.d.ts +43 -0
  85. package/es/editor/gct-form-span/gct-form-span.mjs +89 -0
  86. package/es/editor/gct-form-span/gct-form-span.provider.d.ts +13 -0
  87. package/es/editor/gct-form-span/gct-form-span.provider.mjs +6 -0
  88. package/es/editor/gct-form-span/gct-form-span.scss +10 -0
  89. package/es/editor/gct-form-span/index.d.ts +4 -0
  90. package/es/editor/gct-form-span/index.mjs +12 -0
  91. package/es/editor/gct-form-switch/gct-form-switch.d.ts +26 -0
  92. package/es/editor/gct-form-switch/gct-form-switch.mjs +35 -0
  93. package/es/editor/gct-form-switch/gct-form-switch.provider.d.ts +13 -0
  94. package/es/editor/gct-form-switch/gct-form-switch.provider.mjs +6 -0
  95. package/es/editor/gct-form-switch/index.d.ts +7 -0
  96. package/es/editor/gct-form-switch/index.mjs +17 -0
  97. package/es/editor/gct-form-text/gct-form-text.d.ts +32 -0
  98. package/es/editor/gct-form-text/gct-form-text.mjs +45 -0
  99. package/es/editor/gct-form-text/gct-form-text.provider.d.ts +13 -0
  100. package/es/editor/gct-form-text/gct-form-text.provider.mjs +6 -0
  101. package/es/editor/gct-form-text/index.d.ts +7 -0
  102. package/es/editor/gct-form-text/index.mjs +17 -0
  103. package/es/editor/gct-form-textarea/gct-form-textarea.d.ts +28 -0
  104. package/es/editor/gct-form-textarea/gct-form-textarea.mjs +40 -0
  105. package/es/editor/gct-form-textarea/gct-form-textarea.provider.d.ts +4 -0
  106. package/es/editor/gct-form-textarea/gct-form-textarea.provider.mjs +6 -0
  107. package/es/editor/gct-form-textarea/index.d.ts +4 -0
  108. package/es/editor/gct-form-textarea/index.mjs +12 -0
  109. package/es/editor/index.d.ts +5 -0
  110. package/es/editor/index.mjs +42 -0
  111. package/es/index.d.ts +1 -0
  112. package/es/index.mjs +15 -1
  113. package/es/types/index.d.ts +1 -0
  114. package/es/widgets/gct-edit-form/gct-edit-form.d.ts +62 -0
  115. package/es/widgets/gct-edit-form/gct-edit-form.mjs +126 -0
  116. package/es/widgets/gct-edit-form/index.d.ts +5 -0
  117. package/es/widgets/gct-edit-form/index.mjs +10 -0
  118. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.d.ts +31 -0
  119. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.mjs +73 -0
  120. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.d.ts +5 -0
  121. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.mjs +11 -0
  122. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.scss +62 -0
  123. package/es/widgets/gct-form/gct-form-collapse/index.d.ts +5 -0
  124. package/es/widgets/gct-form/gct-form-collapse/index.mjs +15 -0
  125. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.d.ts +29 -0
  126. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.mjs +71 -0
  127. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.d.ts +5 -0
  128. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.mjs +13 -0
  129. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.scss +23 -0
  130. package/es/widgets/gct-form/gct-form-collapse-pane/index.d.ts +5 -0
  131. package/es/widgets/gct-form/gct-form-collapse-pane/index.mjs +15 -0
  132. package/es/widgets/gct-form/gct-form-group/gct-form-group.d.ts +30 -0
  133. package/es/widgets/gct-form/gct-form-group/gct-form-group.mjs +88 -0
  134. package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.d.ts +5 -0
  135. package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.mjs +11 -0
  136. package/es/widgets/gct-form/gct-form-group/gct-form-group.scss +28 -0
  137. package/es/widgets/gct-form/gct-form-group/index.d.ts +5 -0
  138. package/es/widgets/gct-form/gct-form-group/index.mjs +15 -0
  139. package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.d.ts +5 -0
  140. package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.mjs +13 -0
  141. package/es/widgets/gct-form/gct-form-item/gct-form-item.d.ts +35 -0
  142. package/es/widgets/gct-form/gct-form-item/gct-form-item.mjs +141 -0
  143. package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.d.ts +5 -0
  144. package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.mjs +11 -0
  145. package/es/widgets/gct-form/gct-form-item/gct-form-item.scss +115 -0
  146. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.d.ts +28 -0
  147. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.mjs +53 -0
  148. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.d.ts +5 -0
  149. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.mjs +11 -0
  150. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.scss +63 -0
  151. package/es/widgets/gct-form/gct-form-tab/index.d.ts +5 -0
  152. package/es/widgets/gct-form/gct-form-tab/index.mjs +12 -0
  153. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.d.ts +29 -0
  154. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.mjs +65 -0
  155. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.d.ts +5 -0
  156. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.mjs +11 -0
  157. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.scss +16 -0
  158. package/es/widgets/gct-form/gct-form-tab-pane/index.d.ts +5 -0
  159. package/es/widgets/gct-form/gct-form-tab-pane/index.mjs +15 -0
  160. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.d.ts +30 -0
  161. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.mjs +71 -0
  162. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.d.ts +5 -0
  163. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.mjs +11 -0
  164. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.scss +25 -0
  165. package/es/widgets/gct-form/gct-form-title-group/index.d.ts +5 -0
  166. package/es/widgets/gct-form/gct-form-title-group/index.mjs +16 -0
  167. package/es/widgets/gct-form/gct-form.d.ts +31 -0
  168. package/es/widgets/gct-form/gct-form.mjs +109 -0
  169. package/es/widgets/gct-form/gct-form.scss +11 -0
  170. package/es/widgets/gct-form/index.d.ts +5 -0
  171. package/es/widgets/gct-form/index.mjs +31 -0
  172. package/package.json +7 -5
@@ -0,0 +1,12 @@
1
+ import { widthEditorInstall, EditorType } from '@gct-paas/core';
2
+ import { GctFormSpanProvider } from './gct-form-span.provider.mjs';
3
+ import { GctFormSpan as GctFormSpan$1 } from './gct-form-span.mjs';
4
+
5
+ "use strict";
6
+ var GctFormSpan = widthEditorInstall(
7
+ EditorType.SPAN,
8
+ () => new GctFormSpanProvider(),
9
+ GctFormSpan$1
10
+ );
11
+
12
+ export { GctFormSpan as default };
@@ -0,0 +1,26 @@
1
+ import { PropType } from 'vue';
2
+ import { ISwitchEditor } from '@gct-paas/core';
3
+ export declare const GctFormSwitch: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ model: {
5
+ type: PropType<ISwitchEditor>;
6
+ required: true;
7
+ };
8
+ value: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, {
13
+ ns: import('@gct-paas/core').Namespace;
14
+ val: import('vue').WritableComputedRef<any, any>;
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
16
+ model: {
17
+ type: PropType<ISwitchEditor>;
18
+ required: true;
19
+ };
20
+ value: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ }>> & Readonly<{}>, {
25
+ value: string;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,35 @@
1
+ import { defineComponent, createVNode, resolveComponent, mergeProps } from 'vue';
2
+ import { useNamespace, useGctFormValue } from '@gct-paas/core';
3
+
4
+ "use strict";
5
+ const GctFormSwitch = /* @__PURE__ */ defineComponent({
6
+ name: "GctFormSwitch",
7
+ props: {
8
+ model: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ value: {
13
+ type: String,
14
+ default: ""
15
+ }
16
+ },
17
+ setup() {
18
+ const ns = useNamespace("gct-form-switch");
19
+ const val = useGctFormValue();
20
+ return {
21
+ ns,
22
+ val
23
+ };
24
+ },
25
+ render() {
26
+ return createVNode("div", {
27
+ "class": this.ns.b()
28
+ }, [createVNode(resolveComponent("a-switch"), mergeProps({
29
+ "checked": this.val,
30
+ "onUpdate:checked": ($event) => this.val = $event
31
+ }, this.model.props || {}), null)]);
32
+ }
33
+ });
34
+
35
+ export { GctFormSwitch };
@@ -0,0 +1,13 @@
1
+ import { IEditorProvider } from '@gct-paas/core';
2
+ /**
3
+ * 开关编辑器
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-07-29 11:07:49
7
+ * @export
8
+ * @class GctFormSwitchProvider
9
+ * @implements {IEditorProvider}
10
+ */
11
+ export declare class GctFormSwitchProvider implements IEditorProvider {
12
+ component: string;
13
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ class GctFormSwitchProvider {
3
+ component = "gct-form-switch";
4
+ }
5
+
6
+ export { GctFormSwitchProvider };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ install(app: import('vue').App): void;
3
+ };
4
+ export default _default;
5
+ export declare const oldSwitchCom: {
6
+ install(app: import('vue').App): void;
7
+ };
@@ -0,0 +1,17 @@
1
+ import { widthEditorInstall, EditorType, EditorTypeOld } from '@gct-paas/core';
2
+ import { GctFormSwitchProvider } from './gct-form-switch.provider.mjs';
3
+ import { GctFormSwitch as GctFormSwitch$1 } from './gct-form-switch.mjs';
4
+
5
+ "use strict";
6
+ var GctFormSwitch = widthEditorInstall(
7
+ EditorType.SWITCH,
8
+ () => new GctFormSwitchProvider(),
9
+ GctFormSwitch$1
10
+ );
11
+ const oldSwitchCom = widthEditorInstall(
12
+ EditorTypeOld.SWITCH,
13
+ () => new GctFormSwitchProvider(),
14
+ GctFormSwitch$1
15
+ );
16
+
17
+ export { GctFormSwitch as default, oldSwitchCom };
@@ -0,0 +1,32 @@
1
+ import { PropType } from 'vue';
2
+ import { ITextEditor, EditorController } from '@gct-paas/core';
3
+ /**
4
+ * 文本编辑器
5
+ */
6
+ export declare const GctFormText: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
7
+ model: {
8
+ type: PropType<ITextEditor>;
9
+ required: true;
10
+ };
11
+ value: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ }>, {
16
+ ns: import('@gct-paas/core').Namespace;
17
+ c: EditorController<ITextEditor>;
18
+ val: import('vue').WritableComputedRef<string, string>;
19
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
20
+ model: {
21
+ type: PropType<ITextEditor>;
22
+ required: true;
23
+ };
24
+ value: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ }>> & Readonly<{
29
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
30
+ }>, {
31
+ value: string;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,45 @@
1
+ import { defineComponent, createVNode, resolveComponent, mergeProps } from 'vue';
2
+ import { useNamespace, EditorController, useGctFormValueByText } from '@gct-paas/core';
3
+
4
+ "use strict";
5
+ const GctFormText = /* @__PURE__ */ defineComponent({
6
+ name: "GctFormText",
7
+ props: {
8
+ model: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ value: {
13
+ type: String,
14
+ default: ""
15
+ }
16
+ },
17
+ emits: ["update:value"],
18
+ setup(props) {
19
+ const ns = useNamespace("gct-form-text");
20
+ const c = new EditorController(props.model);
21
+ const val = useGctFormValueByText(props.model.prefix || props.model.addonBefore, props.model.suffix || props.model.addonAfter);
22
+ return {
23
+ ns,
24
+ c,
25
+ val
26
+ };
27
+ },
28
+ render() {
29
+ return createVNode(resolveComponent("a-input"), mergeProps({
30
+ "value": this.val,
31
+ "onUpdate:value": ($event) => this.val = $event
32
+ }, this.model.props || {}, {
33
+ "class": this.ns.b(),
34
+ "prefix": this.model.prefix,
35
+ "suffix": this.model.suffix,
36
+ "addonBefore": this.model.addonBefore,
37
+ "addonAfter": this.model.addonAfter,
38
+ "placeholder": this.model.placeholder,
39
+ "show-count": this.model.max != null,
40
+ "maxlength": this.model.max
41
+ }), null);
42
+ }
43
+ });
44
+
45
+ export { GctFormText };
@@ -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 GctFormTextProvider
9
+ * @implements {IEditorProvider}
10
+ */
11
+ export declare class GctFormTextProvider implements IEditorProvider {
12
+ component: string;
13
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ class GctFormTextProvider {
3
+ component = "gct-form-text";
4
+ }
5
+
6
+ export { GctFormTextProvider };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ install(app: import('vue').App): void;
3
+ };
4
+ export default _default;
5
+ export declare const oldTextCom: {
6
+ install(app: import('vue').App): void;
7
+ };
@@ -0,0 +1,17 @@
1
+ import { widthEditorInstall, EditorType, EditorTypeOld } from '@gct-paas/core';
2
+ import { GctFormTextProvider } from './gct-form-text.provider.mjs';
3
+ import { GctFormText as GctFormText$1 } from './gct-form-text.mjs';
4
+
5
+ "use strict";
6
+ var GctFormText = widthEditorInstall(
7
+ EditorType.TEXT,
8
+ () => new GctFormTextProvider(),
9
+ GctFormText$1
10
+ );
11
+ const oldTextCom = widthEditorInstall(
12
+ EditorTypeOld.TEXT,
13
+ () => new GctFormTextProvider(),
14
+ GctFormText$1
15
+ );
16
+
17
+ export { GctFormText as default, oldTextCom };
@@ -0,0 +1,28 @@
1
+ import { PropType } from 'vue';
2
+ import { ITextareaEditor } from '@gct-paas/core';
3
+ export declare const GctFormTextarea: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ model: {
5
+ type: PropType<ITextareaEditor>;
6
+ required: true;
7
+ };
8
+ value: {
9
+ type: StringConstructor;
10
+ default: null;
11
+ };
12
+ }>, {
13
+ ns: import('@gct-paas/core').Namespace;
14
+ val: import('vue').WritableComputedRef<any, any>;
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
16
+ model: {
17
+ type: PropType<ITextareaEditor>;
18
+ required: true;
19
+ };
20
+ value: {
21
+ type: StringConstructor;
22
+ default: null;
23
+ };
24
+ }>> & Readonly<{
25
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
26
+ }>, {
27
+ value: string;
28
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,40 @@
1
+ import { defineComponent, createVNode, resolveComponent, mergeProps } from 'vue';
2
+ import { useNamespace, useGctFormValue } from '@gct-paas/core';
3
+
4
+ "use strict";
5
+ const GctFormTextarea = /* @__PURE__ */ defineComponent({
6
+ name: "GctFormTextarea",
7
+ props: {
8
+ model: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ value: {
13
+ type: String,
14
+ default: null
15
+ }
16
+ },
17
+ emits: ["update:value"],
18
+ setup() {
19
+ const ns = useNamespace("gct-form-textarea");
20
+ const val = useGctFormValue();
21
+ return {
22
+ ns,
23
+ val
24
+ };
25
+ },
26
+ render() {
27
+ return createVNode(resolveComponent("a-textarea"), mergeProps({
28
+ "value": this.val,
29
+ "onUpdate:value": ($event) => this.val = $event
30
+ }, this.model.props || {}, {
31
+ "class": this.ns.b(),
32
+ "auto-size": this.model.autoSize,
33
+ "show-count": this.model.max != null,
34
+ "maxlength": this.model.max,
35
+ "placeholder": this.model.placeholder
36
+ }), null);
37
+ }
38
+ });
39
+
40
+ export { GctFormTextarea };
@@ -0,0 +1,4 @@
1
+ import { IEditorProvider } from '@gct-paas/core';
2
+ export declare class GctFormTextareaProvider implements IEditorProvider {
3
+ component: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ class GctFormTextareaProvider {
3
+ component = "gct-form-textarea";
4
+ }
5
+
6
+ export { GctFormTextareaProvider };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ install(app: import('vue').App): void;
3
+ };
4
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { widthEditorInstall, EditorType } from '@gct-paas/core';
2
+ import { GctFormTextareaProvider } from './gct-form-textarea.provider.mjs';
3
+ import { GctFormTextarea as GctFormTextarea$1 } from './gct-form-textarea.mjs';
4
+
5
+ "use strict";
6
+ var GctFormTextarea = widthEditorInstall(
7
+ EditorType.TEXTAREA,
8
+ () => new GctFormTextareaProvider(),
9
+ GctFormTextarea$1
10
+ );
11
+
12
+ export { GctFormTextarea as default };
@@ -0,0 +1,5 @@
1
+ import { App } from 'vue';
2
+ declare const _default: {
3
+ install(app: App): void;
4
+ };
5
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import GctFormLengthUnit from './gct-form-length-unit/index.mjs';
2
+ import GctFormColor from './gct-form-color/index.mjs';
3
+ import GctFormCheckSwitch from './gct-form-check-switch/index.mjs';
4
+ import GctFormI18n from './gct-form-i18n/index.mjs';
5
+ import GctFormIconSelect from './gct-form-icon-select/index.mjs';
6
+ import GctFormNumber from './gct-form-number/index.mjs';
7
+ import GctFormPicker from './gct-form-picker/index.mjs';
8
+ import GctFormSelect from './gct-form-select/index.mjs';
9
+ import GctFormSpan from './gct-form-span/index.mjs';
10
+ import GctFormSwitch, { oldSwitchCom } from './gct-form-switch/index.mjs';
11
+ import GctFormText, { oldTextCom } from './gct-form-text/index.mjs';
12
+ import GctFormTextarea from './gct-form-textarea/index.mjs';
13
+ import GctFormRadio, { oldRadioCom } from './gct-form-radio/index.mjs';
14
+ import GctFormInfo from './gct-form-info/index.mjs';
15
+ import GctFormCheckbox, { oldCheckboxCom } from './gct-form-checkbox/index.mjs';
16
+
17
+ "use strict";
18
+ var Editor = {
19
+ install(app) {
20
+ app.use(GctFormLengthUnit);
21
+ app.use(GctFormColor);
22
+ app.use(GctFormCheckSwitch);
23
+ app.use(GctFormI18n);
24
+ app.use(GctFormIconSelect);
25
+ app.use(GctFormNumber);
26
+ app.use(GctFormPicker);
27
+ app.use(GctFormSelect);
28
+ app.use(GctFormSpan);
29
+ app.use(GctFormSwitch);
30
+ app.use(GctFormText);
31
+ app.use(GctFormTextarea);
32
+ app.use(GctFormRadio);
33
+ app.use(GctFormInfo);
34
+ app.use(GctFormCheckbox);
35
+ app.use(oldCheckboxCom);
36
+ app.use(oldRadioCom);
37
+ app.use(oldSwitchCom);
38
+ app.use(oldTextCom);
39
+ }
40
+ };
41
+
42
+ export { Editor as default };
package/es/index.d.ts CHANGED
@@ -3,3 +3,4 @@ declare const _default: {
3
3
  install(app: App): void;
4
4
  };
5
5
  export default _default;
6
+ export * from './components';
package/es/index.mjs CHANGED
@@ -1,11 +1,25 @@
1
1
  import './components/index.mjs';
2
+ import Editor from './editor/index.mjs';
3
+ import GctEditForm from './widgets/gct-edit-form/index.mjs';
4
+ import GctForm from './widgets/gct-form/index.mjs';
2
5
  import { CodeEditor } from './components/code-editor/code-editor.mjs';
6
+ import { FlexContainer } from './components/layout/flex-container/flex-container.mjs';
7
+ import { FlexItem } from './components/layout/flex-item/flex-item.mjs';
8
+ import { GridContainer } from './components/layout/grid-container/grid-container.mjs';
9
+ import { ViewContainer } from './components/layout/view-container/view-container.mjs';
3
10
 
4
11
  "use strict";
5
12
  var index = {
6
13
  install(app) {
14
+ app.use(Editor);
15
+ app.use(GctEditForm);
16
+ app.use(GctForm);
7
17
  app.component(CodeEditor.name, CodeEditor);
18
+ app.component(FlexContainer.name, FlexContainer);
19
+ app.component(FlexItem.name, FlexItem);
20
+ app.component(GridContainer.name, GridContainer);
21
+ app.component(ViewContainer.name, ViewContainer);
8
22
  }
9
23
  };
10
24
 
11
- export { index as default };
25
+ export { CodeEditor, FlexContainer, FlexItem, GridContainer, ViewContainer, index as default };
@@ -0,0 +1 @@
1
+ import '@gct-paas/core/es/types';
@@ -0,0 +1,62 @@
1
+ import { PropType } from 'vue';
2
+ import { IEditForm, IEditFormController } from '@gct-paas/core';
3
+ /**
4
+ * 编辑表单组件
5
+ */
6
+ export declare const GctEditForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
7
+ embed: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ context: {
12
+ type: PropType<IParams>;
13
+ default: () => {};
14
+ };
15
+ params: {
16
+ type: PropType<IParams>;
17
+ default: () => {};
18
+ };
19
+ controller: {
20
+ type: PropType<IEditFormController>;
21
+ };
22
+ model: {
23
+ type: PropType<IEditForm>;
24
+ required: true;
25
+ };
26
+ data: {
27
+ type: PropType<IData>;
28
+ };
29
+ }>, {
30
+ ns: import('@gct-paas/core').Namespace;
31
+ c: IEditFormController;
32
+ formRef: import('vue').Ref<any, any>;
33
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:data"[], "update:data", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
34
+ embed: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ context: {
39
+ type: PropType<IParams>;
40
+ default: () => {};
41
+ };
42
+ params: {
43
+ type: PropType<IParams>;
44
+ default: () => {};
45
+ };
46
+ controller: {
47
+ type: PropType<IEditFormController>;
48
+ };
49
+ model: {
50
+ type: PropType<IEditForm>;
51
+ required: true;
52
+ };
53
+ data: {
54
+ type: PropType<IData>;
55
+ };
56
+ }>> & Readonly<{
57
+ "onUpdate:data"?: ((...args: any[]) => any) | undefined;
58
+ }>, {
59
+ embed: boolean;
60
+ context: IParams;
61
+ params: IParams;
62
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,126 @@
1
+ import { defineComponent, createVNode, resolveComponent, ref, watch } from 'vue';
2
+ import { cloneDeep } from 'lodash-es';
3
+ import { useNamespace, useEditFormController, EditFormController, useModal } from '@gct-paas/core';
4
+
5
+ "use strict";
6
+ const GctEditForm = /* @__PURE__ */ defineComponent({
7
+ name: "GctEditForm",
8
+ props: {
9
+ // 是否为嵌入表单组件
10
+ embed: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ context: {
15
+ type: Object,
16
+ default: () => ({})
17
+ },
18
+ params: {
19
+ type: Object,
20
+ default: () => ({})
21
+ },
22
+ controller: {
23
+ type: Object
24
+ },
25
+ model: {
26
+ type: Object,
27
+ required: true
28
+ },
29
+ data: {
30
+ type: Object
31
+ }
32
+ },
33
+ emits: ["update:data"],
34
+ setup(props, {
35
+ emit
36
+ }) {
37
+ const ns = useNamespace("gct-edit-form");
38
+ if (!props.model) {
39
+ throw new Error("\u672A\u4F20\u9012\u8868\u5355\u6A21\u578B\u914D\u7F6E");
40
+ }
41
+ const c = props.controller || useEditFormController(() => new EditFormController(props.model));
42
+ const formRef = ref(null);
43
+ const validate = async () => {
44
+ try {
45
+ await formRef.value.formRef.validate();
46
+ } catch (error) {
47
+ console.error(error);
48
+ return false;
49
+ }
50
+ return true;
51
+ };
52
+ const validateField = async (field) => {
53
+ try {
54
+ await formRef.value.formRef.validateFields(field);
55
+ } catch (error) {
56
+ console.error(error);
57
+ return false;
58
+ }
59
+ return true;
60
+ };
61
+ c.validate = validate;
62
+ c.validateItem = validateField;
63
+ watch(props.context, () => {
64
+ Object.assign(c.context, props.context);
65
+ c.state.isNew = !c.context.id;
66
+ }, {
67
+ immediate: true
68
+ });
69
+ watch(props.params, () => {
70
+ Object.assign(c.params, props.params);
71
+ });
72
+ useModal(async () => {
73
+ try {
74
+ await formRef.value.formRef.validate();
75
+ const data = await c.save();
76
+ if (data) {
77
+ return {
78
+ ok: true,
79
+ data: [cloneDeep(data)]
80
+ };
81
+ }
82
+ } catch (error) {
83
+ console.error(error);
84
+ }
85
+ return {
86
+ ok: false
87
+ };
88
+ });
89
+ if (props.data) {
90
+ Object.assign(c.state.data, props.data);
91
+ c.loaded();
92
+ } else if (c.state.isNew !== true) {
93
+ c.load().then(() => {
94
+ c.loaded();
95
+ });
96
+ } else {
97
+ c.loaded();
98
+ }
99
+ if (props.embed) {
100
+ c.evt.on("change", () => {
101
+ emit("update:data", c.getData());
102
+ });
103
+ }
104
+ return {
105
+ ns,
106
+ c,
107
+ formRef
108
+ };
109
+ },
110
+ render() {
111
+ let content = null;
112
+ if (this.c.state.isNew || this.c.state.isNew == false && this.c.state.loaded) {
113
+ content = createVNode(resolveComponent("gct-form"), {
114
+ "class": "h-full",
115
+ "ref": "formRef",
116
+ "model": this.model,
117
+ "c": this.c
118
+ }, null);
119
+ }
120
+ return createVNode("div", {
121
+ "class": this.ns.b()
122
+ }, [content]);
123
+ }
124
+ });
125
+
126
+ export { GctEditForm };
@@ -0,0 +1,5 @@
1
+ import { App } from 'vue';
2
+ declare const _default: {
3
+ install(app: App): void;
4
+ };
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { GctEditForm as GctEditForm$1 } from './gct-edit-form.mjs';
2
+
3
+ "use strict";
4
+ var GctEditForm = {
5
+ install(app) {
6
+ app.component(GctEditForm$1.name, GctEditForm$1);
7
+ }
8
+ };
9
+
10
+ export { GctEditForm as default };