@gct-paas/core-web 0.1.4-dev.6 → 0.1.4-dev.8

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 (183) hide show
  1. package/dist/index.esm.min.mjs +24964 -0
  2. package/dist/index.min.cjs +59 -12
  3. package/dist/index.min.css +1 -0
  4. package/dist/index.system.min.js +59 -12
  5. package/es/components/assets-svg-icon/assets-svg-icon.css +188 -0
  6. package/es/components/assets-svg-icon/assets-svg-icon.d.ts +134 -0
  7. package/es/components/assets-svg-icon/assets-svg-icon.mjs +238 -0
  8. package/es/components/assets-svg-icon/request.d.ts +2 -0
  9. package/es/components/assets-svg-icon/request.mjs +51 -0
  10. package/es/components/assets-svg-icon/utils.d.ts +9 -0
  11. package/es/components/assets-svg-icon/utils.mjs +21 -0
  12. package/es/components/assets-svg-icon/validate.d.ts +4 -0
  13. package/es/components/assets-svg-icon/validate.mjs +43 -0
  14. package/es/components/code-editor/code-editor.css +67 -0
  15. package/es/components/code-editor/code-editor.d.ts +35 -0
  16. package/es/components/code-editor/code-editor.mjs +15 -20
  17. package/es/components/index.d.ts +1 -0
  18. package/es/components/layout/flex-container/flex-container.css +67 -0
  19. package/es/components/layout/flex-container/flex-container.d.ts +4 -4
  20. package/es/components/layout/flex-item/flex-item.d.ts +4 -4
  21. package/es/components/layout/grid-container/grid-container.d.ts +4 -4
  22. package/es/components/layout/view-container/view-container.css +83 -0
  23. package/es/components/layout/view-container/view-container.d.ts +4 -4
  24. package/es/editor/gct-form-check-switch/gct-form-check-switch.d.ts +7 -7
  25. package/es/editor/gct-form-checkbox/gct-form-checkbox.d.ts +6 -6
  26. package/es/editor/gct-form-field-select/gct-form-field-select.d.ts +17 -7
  27. package/es/editor/gct-form-field-select/gct-model-select.vue.d.ts +3 -12
  28. package/es/editor/gct-form-i18n/gct-form-i18n.d.ts +8 -8
  29. package/es/editor/gct-form-icon-select/gct-form-icon-select.d.ts +8 -8
  30. package/es/editor/gct-form-info/gct-form-info.d.ts +7 -7
  31. package/es/editor/gct-form-length-unit/gct-form-length-unit.d.ts +6 -6
  32. package/es/editor/gct-form-modal-select/gct-form-modal-select.d.ts +8 -8
  33. package/es/editor/gct-form-number/gct-form-number.d.ts +7 -7
  34. package/es/editor/gct-form-picker/gct-form-picker.d.ts +8 -8
  35. package/es/editor/gct-form-radio/gct-form-radio.d.ts +7 -7
  36. package/es/editor/gct-form-select/gct-form-select.d.ts +7 -7
  37. package/es/editor/gct-form-span/gct-form-span.d.ts +5 -5
  38. package/es/editor/gct-form-switch/gct-form-switch.d.ts +6 -6
  39. package/es/editor/gct-form-text/gct-form-text.d.ts +7 -7
  40. package/es/editor/gct-form-textarea/gct-form-textarea.d.ts +7 -7
  41. package/es/hooks/index.d.ts +2 -0
  42. package/es/hooks/useLocale.d.ts +4 -0
  43. package/es/hooks/useLocale.mjs +32 -0
  44. package/es/hooks/useTheme.d.ts +8 -0
  45. package/es/hooks/useTheme.mjs +20 -0
  46. package/es/index.d.ts +5 -6
  47. package/es/index.mjs +19 -24
  48. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.css +72 -0
  49. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.d.ts +37 -0
  50. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.mjs +195 -0
  51. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.css +79 -0
  52. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.d.ts +29 -0
  53. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.mjs +98 -0
  54. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.css +70 -0
  55. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.d.ts +50 -0
  56. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.mjs +239 -0
  57. package/es/modules/gct-dnd/constants/index.d.ts +24 -0
  58. package/es/modules/gct-dnd/constants/index.mjs +9 -0
  59. package/es/modules/gct-dnd/index.d.ts +5 -0
  60. package/es/modules/gct-dnd/interface/i-gct-dnd-config.d.ts +101 -0
  61. package/es/modules/gct-dnd/interface/i-gct-dnd-data.d.ts +14 -0
  62. package/es/modules/gct-dnd/interface/i-gct-dnd-render-item-options.d.ts +28 -0
  63. package/es/modules/gct-dnd/interface/i-gct-drag-collect.d.ts +24 -0
  64. package/es/modules/gct-dnd/interface/i-gct-drag-dnd-data.d.ts +51 -0
  65. package/es/modules/gct-dnd/interface/i-gct-drop-collect.d.ts +32 -0
  66. package/es/modules/gct-dnd/interface/i-gct-drop-result.d.ts +47 -0
  67. package/es/modules/gct-dnd/interface/index.d.ts +7 -0
  68. package/es/types/index.d.ts +1 -1
  69. package/es/utils/with-install.mjs +0 -1
  70. package/es/widgets/gct-edit-form/gct-edit-form.d.ts +9 -9
  71. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.d.ts +6 -6
  72. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.d.ts +4 -4
  73. package/es/widgets/gct-form/gct-form-group/gct-form-group.d.ts +5 -5
  74. package/es/widgets/gct-form/gct-form-item/gct-form-item.d.ts +4 -4
  75. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.d.ts +4 -4
  76. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.d.ts +4 -4
  77. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.d.ts +5 -5
  78. package/es/widgets/gct-form/gct-form.d.ts +5 -5
  79. package/package.json +15 -13
  80. package/dist/core-web.css +0 -1
  81. package/es/components/code-editor/code-editor.scss +0 -3
  82. package/es/components/index.mjs +0 -7
  83. package/es/components/layout/flex-container/flex-container.mjs +0 -90
  84. package/es/components/layout/flex-container/flex-container.scss +0 -3
  85. package/es/components/layout/flex-item/flex-item.mjs +0 -53
  86. package/es/components/layout/flex-item/flex-item.scss +0 -17
  87. package/es/components/layout/grid-container/grid-container.mjs +0 -47
  88. package/es/components/layout/view-container/view-container.mjs +0 -39
  89. package/es/components/layout/view-container/view-container.scss +0 -19
  90. package/es/editor/gct-form-check-switch/gct-form-check-switch.mjs +0 -53
  91. package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.mjs +0 -6
  92. package/es/editor/gct-form-check-switch/gct-form-check-switch.scss +0 -10
  93. package/es/editor/gct-form-check-switch/index.mjs +0 -12
  94. package/es/editor/gct-form-checkbox/gct-form-checkbox.mjs +0 -70
  95. package/es/editor/gct-form-checkbox/gct-form-checkbox.scss +0 -56
  96. package/es/editor/gct-form-checkbox/index.mjs +0 -19
  97. package/es/editor/gct-form-color/gct-form-color.mjs +0 -45
  98. package/es/editor/gct-form-color/gct-form-color.provider.mjs +0 -6
  99. package/es/editor/gct-form-color/gct-form-color.scss +0 -3
  100. package/es/editor/gct-form-color/index.mjs +0 -17
  101. package/es/editor/gct-form-field-select/gct-form-field-select.mjs +0 -48
  102. package/es/editor/gct-form-field-select/gct-form-field-select.provider.mjs +0 -6
  103. package/es/editor/gct-form-field-select/gct-form-field-select.scss +0 -7
  104. package/es/editor/gct-form-field-select/gct-model-select.vue +0 -70
  105. package/es/editor/gct-form-field-select/index.mjs +0 -12
  106. package/es/editor/gct-form-i18n/gct-form-i18n.mjs +0 -62
  107. package/es/editor/gct-form-i18n/gct-form-i18n.provider.mjs +0 -6
  108. package/es/editor/gct-form-i18n/index.mjs +0 -12
  109. package/es/editor/gct-form-icon-select/gct-form-icon-select.mjs +0 -74
  110. package/es/editor/gct-form-icon-select/gct-form-icon-select.scss +0 -14
  111. package/es/editor/gct-form-icon-select/index.mjs +0 -14
  112. package/es/editor/gct-form-info/gct-form-info.mjs +0 -40
  113. package/es/editor/gct-form-info/gct-form-info.scss +0 -8
  114. package/es/editor/gct-form-info/index.mjs +0 -14
  115. package/es/editor/gct-form-length-unit/gct-form-length-unit.mjs +0 -43
  116. package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.mjs +0 -6
  117. package/es/editor/gct-form-length-unit/index.mjs +0 -12
  118. package/es/editor/gct-form-modal-select/gct-form-modal-select.mjs +0 -99
  119. package/es/editor/gct-form-modal-select/gct-form-modal-select.provider.mjs +0 -6
  120. package/es/editor/gct-form-modal-select/gct-form-modal-select.scss +0 -7
  121. package/es/editor/gct-form-modal-select/index.mjs +0 -12
  122. package/es/editor/gct-form-number/gct-form-number.mjs +0 -44
  123. package/es/editor/gct-form-number/gct-form-number.provider.mjs +0 -6
  124. package/es/editor/gct-form-number/gct-form-number.scss +0 -3
  125. package/es/editor/gct-form-number/index.mjs +0 -17
  126. package/es/editor/gct-form-picker/gct-form-picker.mjs +0 -92
  127. package/es/editor/gct-form-picker/gct-form-picker.provider.mjs +0 -6
  128. package/es/editor/gct-form-picker/index.mjs +0 -12
  129. package/es/editor/gct-form-radio/gct-form-radio.mjs +0 -70
  130. package/es/editor/gct-form-radio/gct-form-radio.scss +0 -68
  131. package/es/editor/gct-form-radio/index.mjs +0 -19
  132. package/es/editor/gct-form-select/gct-form-select.mjs +0 -50
  133. package/es/editor/gct-form-select/gct-form-select.provider.mjs +0 -6
  134. package/es/editor/gct-form-select/index.mjs +0 -12
  135. package/es/editor/gct-form-span/gct-form-span.mjs +0 -89
  136. package/es/editor/gct-form-span/gct-form-span.provider.mjs +0 -6
  137. package/es/editor/gct-form-span/gct-form-span.scss +0 -10
  138. package/es/editor/gct-form-span/index.mjs +0 -12
  139. package/es/editor/gct-form-switch/gct-form-switch.mjs +0 -35
  140. package/es/editor/gct-form-switch/gct-form-switch.provider.mjs +0 -6
  141. package/es/editor/gct-form-switch/index.mjs +0 -17
  142. package/es/editor/gct-form-text/gct-form-text.mjs +0 -45
  143. package/es/editor/gct-form-text/gct-form-text.provider.mjs +0 -6
  144. package/es/editor/gct-form-text/index.mjs +0 -17
  145. package/es/editor/gct-form-textarea/gct-form-textarea.mjs +0 -40
  146. package/es/editor/gct-form-textarea/gct-form-textarea.provider.mjs +0 -6
  147. package/es/editor/gct-form-textarea/index.mjs +0 -12
  148. package/es/editor/index.mjs +0 -51
  149. package/es/utils/index.mjs +0 -3
  150. package/es/vite-env.d.ts +0 -1
  151. package/es/widgets/gct-edit-form/gct-edit-form.mjs +0 -126
  152. package/es/widgets/gct-edit-form/index.mjs +0 -10
  153. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.mjs +0 -73
  154. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.mjs +0 -11
  155. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.scss +0 -62
  156. package/es/widgets/gct-form/gct-form-collapse/index.mjs +0 -15
  157. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.mjs +0 -71
  158. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.mjs +0 -13
  159. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.scss +0 -23
  160. package/es/widgets/gct-form/gct-form-collapse-pane/index.mjs +0 -15
  161. package/es/widgets/gct-form/gct-form-group/gct-form-group.mjs +0 -88
  162. package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.mjs +0 -11
  163. package/es/widgets/gct-form/gct-form-group/gct-form-group.scss +0 -28
  164. package/es/widgets/gct-form/gct-form-group/index.mjs +0 -15
  165. package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.mjs +0 -13
  166. package/es/widgets/gct-form/gct-form-item/gct-form-item.mjs +0 -141
  167. package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.mjs +0 -11
  168. package/es/widgets/gct-form/gct-form-item/gct-form-item.scss +0 -115
  169. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.mjs +0 -53
  170. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.mjs +0 -11
  171. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.scss +0 -63
  172. package/es/widgets/gct-form/gct-form-tab/index.mjs +0 -12
  173. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.mjs +0 -65
  174. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.mjs +0 -11
  175. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.scss +0 -16
  176. package/es/widgets/gct-form/gct-form-tab-pane/index.mjs +0 -15
  177. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.mjs +0 -71
  178. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.mjs +0 -11
  179. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.scss +0 -25
  180. package/es/widgets/gct-form/gct-form-title-group/index.mjs +0 -16
  181. package/es/widgets/gct-form/gct-form.mjs +0 -110
  182. package/es/widgets/gct-form/gct-form.scss +0 -11
  183. package/es/widgets/gct-form/index.mjs +0 -31
@@ -1,12 +0,0 @@
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 };
@@ -1,65 +0,0 @@
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 };
@@ -1,11 +0,0 @@
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 };
@@ -1,16 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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 };
@@ -1,71 +0,0 @@
1
- import { isVNode, defineComponent, createVNode, ref, resolveComponent } from 'vue';
2
- import { useNamespace } from '@gct-paas/core';
3
- import './gct-form-title-group.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 GctFormTitleGroup = /* @__PURE__ */ defineComponent({
10
- name: "GctFormTitleGroup",
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("gct-form-title-group");
23
- const keys = ref([0]);
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
- const style = {};
42
- if (props.model.width) {
43
- style[ns.cssVarName("form-title-group-width")] = props.model.width;
44
- }
45
- if (props.model.height) {
46
- style[ns.cssVarName("form-title-group-height")] = props.model.height;
47
- }
48
- return {
49
- ns,
50
- keys,
51
- style,
52
- renderContainer
53
- };
54
- },
55
- render() {
56
- if (this.c.state.keepalive !== true && this.c.state.visible === false) {
57
- return null;
58
- }
59
- const items = this.$slots.default?.() || [];
60
- return createVNode("div", {
61
- "class": [this.ns.b(), this.ns.is("hidden", this.c.state.visible === false)],
62
- "style": this.style
63
- }, [createVNode("div", {
64
- "class": this.ns.e("title")
65
- }, [this.model.title]), createVNode("div", {
66
- "class": this.ns.e("content")
67
- }, [this.renderContainer(items)])]);
68
- }
69
- });
70
-
71
- export { GctFormTitleGroup, GctFormTitleGroup as default };
@@ -1,11 +0,0 @@
1
- import { useFormItemController, FormGroupController } from '@gct-paas/core';
2
-
3
- "use strict";
4
- class GctFormTitleGroupProvider {
5
- component = "gct-form-title-group";
6
- createController(form, item) {
7
- return useFormItemController(() => new FormGroupController(form, item));
8
- }
9
- }
10
-
11
- export { GctFormTitleGroupProvider };
@@ -1,25 +0,0 @@
1
- $gct-form-title-group: (
2
- min-height: 32px,
3
- width: auto,
4
- height: auto,
5
- );
6
-
7
- @include b(gct-form-title-group) {
8
- @include set-component-css-var('form-title-group', $gct-form-title-group);
9
-
10
- @include when(hidden) {
11
- display: none;
12
- }
13
-
14
- @include e(title) {
15
- color: #252525;
16
- font-size: 12px;
17
- padding: 8px 0;
18
- }
19
-
20
- @include e(content) {
21
- .ant-form-item-label {
22
- --gct-form-item-label-color: #797A7D;
23
- }
24
- }
25
- }
@@ -1,16 +0,0 @@
1
- import { FormContainerType } from '@gct-paas/core';
2
- import { GctFormTitleGroupProvider } from './gct-form-title-group.provider.mjs';
3
- import { GctFormTitleGroup as GctFormTitleGroup$1 } from './gct-form-title-group.mjs';
4
-
5
- "use strict";
6
- var GctFormTitleGroup = {
7
- install(app) {
8
- _gct.register.formItem.register(
9
- FormContainerType.FORM_TITLE_GROUP,
10
- () => new GctFormTitleGroupProvider()
11
- );
12
- app.component(GctFormTitleGroup$1.name, GctFormTitleGroup$1);
13
- }
14
- };
15
-
16
- export { GctFormTitleGroup as default };
@@ -1,110 +0,0 @@
1
- import { isVNode, defineComponent, createVNode, resolveComponent, provide, ref, reactive, h } from 'vue';
2
- import { useNamespace } from '@gct-paas/core';
3
- import './gct-form.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 GctForm = /* @__PURE__ */ defineComponent({
10
- name: "GctForm",
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("gct-form");
23
- provide("formController", props.c);
24
- const formRef = ref(null);
25
- const c = props.c;
26
- const keys = Object.keys(c.item);
27
- keys.forEach((key) => {
28
- const item = c.item[key];
29
- item.state = reactive(item.state);
30
- });
31
- const renderItem = (item) => {
32
- return createVNode(resolveComponent("gct-form-item"), {
33
- "class": item.class,
34
- "style": item.style,
35
- "c": c.item[item.name],
36
- "formModel": props.model,
37
- "model": item
38
- }, null);
39
- };
40
- const renderContainer = (item) => {
41
- const provider = c.provider[item.name];
42
- if (!provider) {
43
- console.error(`\u672A\u627E\u5230\u8868\u5355\u9879\u9002\u914D\u5668\u5B9E\u4F8B\uFF1A${item.name}`, item);
44
- return null;
45
- }
46
- if (provider) {
47
- return h(typeof provider.component === "string" ? resolveComponent(provider.component) : provider.component, {
48
- key: item.name,
49
- model: item,
50
- formModel: props.model,
51
- c: c.item[item.name],
52
- data: c.state.data,
53
- class: item.class,
54
- style: item.style
55
- }, renderChildren(item.children || []));
56
- } else {
57
- console.error(`\u672A\u627E\u5230\u8868\u5355\u5BB9\u5668\u9002\u914D\u5668\uFF1A${item.name} - ${item.type}`);
58
- }
59
- };
60
- const renderChildren = (children) => {
61
- if (!children) {
62
- return [];
63
- }
64
- const nodes = [];
65
- children.forEach((item) => {
66
- if (item.type === "hidden") {
67
- return null;
68
- }
69
- let node = null;
70
- const container = item;
71
- if (container.type === "container" || container.container) {
72
- node = renderContainer(container);
73
- } else {
74
- node = renderItem(item);
75
- }
76
- if (node) {
77
- nodes.push(node);
78
- }
79
- });
80
- return nodes;
81
- };
82
- const staticStyle = {};
83
- if (props.model.labelWidth) {
84
- staticStyle[ns.cssVarName("form-item-label-width")] = props.model.labelWidth;
85
- }
86
- return {
87
- ns,
88
- formRef,
89
- staticStyle,
90
- renderItem,
91
- renderContainer,
92
- renderChildren
93
- };
94
- },
95
- render() {
96
- let _slot;
97
- return createVNode(resolveComponent("a-form"), {
98
- "ref": "formRef",
99
- "layout": this.model.layout,
100
- "model": this.c.state.data,
101
- "class": [this.ns.b(), this.ns.is("info", this.model.info === true)],
102
- "autocomplete": "off",
103
- "style": this.staticStyle
104
- }, _isSlot(_slot = this.model.children.map((item) => this.renderContainer(item))) ? _slot : {
105
- default: () => [_slot]
106
- });
107
- }
108
- });
109
-
110
- export { GctForm, GctForm as default };
@@ -1,11 +0,0 @@
1
- $gct-form: (
2
- // 'label-width': 100px,
3
- );
4
-
5
- @include b(gct-form) {
6
- @include set-component-css-var('form', $gct-form);
7
-
8
- @include when(info) {
9
- padding: 18px 12px 2px;
10
- }
11
- }
@@ -1,31 +0,0 @@
1
- import { GctFormItem } from './gct-form-item/gct-form-item.mjs';
2
- import { GctForm as GctForm$1 } from './gct-form.mjs';
3
- import { GctFormItemProvider } from './gct-form-item/gct-form-item.provider.mjs';
4
- import { GctFormHiddenItemProvider } from './gct-form-hidden-item/gct-form-hidden-item.provider.mjs';
5
- import GctFormCollapsePane from './gct-form-collapse-pane/index.mjs';
6
- import GctFormCollapse from './gct-form-collapse/index.mjs';
7
- import GctFormGroup from './gct-form-group/index.mjs';
8
- import GctFormTab from './gct-form-tab/index.mjs';
9
- import GctFormTabPane from './gct-form-tab-pane/index.mjs';
10
- import GctFormTitleGroup from './gct-form-title-group/index.mjs';
11
-
12
- "use strict";
13
- var GctForm = {
14
- install(app) {
15
- _gct.register.formItem.register("item", () => new GctFormItemProvider());
16
- _gct.register.formItem.register(
17
- "hidden",
18
- () => new GctFormHiddenItemProvider()
19
- );
20
- app.use(GctFormCollapsePane);
21
- app.use(GctFormCollapse);
22
- app.use(GctFormGroup);
23
- app.use(GctFormTab);
24
- app.use(GctFormTabPane);
25
- app.use(GctFormTitleGroup);
26
- app.component(GctForm$1.name, GctForm$1);
27
- app.component(GctFormItem.name, GctFormItem);
28
- }
29
- };
30
-
31
- export { GctForm as default };