@gct-paas/core-web 0.1.6-dev.17 → 0.1.6-dev.18

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 (130) hide show
  1. package/dist/{JsBarcode-hbJ0aUTj.js → JsBarcode-BHGaO9dz.js} +2 -2
  2. package/dist/{_plugin-vue_export-helper-B8JDTS5A.js → _plugin-vue_export-helper-CVA7dXVu.js} +2 -2
  3. package/dist/{chunk-FrdinjiM.js → chunk-BNkb119g.js} +1 -1
  4. package/dist/components-DjUk_DX6.js +2 -0
  5. package/dist/{cropper-kXOaEuXy.js → cropper-CYj8Bfd1.js} +2 -2
  6. package/dist/{de_DE-CMOqPpMk.js → de_DE-CqvjMewI.js} +2 -2
  7. package/dist/{defineProperty-DAxeR2uH.js → defineProperty-YzDFxjHJ.js} +1 -1
  8. package/dist/{diagram-config-item-DUh3mUtV.js → diagram-config-item-C0dNHnv8.js} +2 -2
  9. package/dist/{diagram-config-item-reverse-C-lK_M8W.js → diagram-config-item-reverse-CPqmFsFd.js} +2 -2
  10. package/dist/{diagram-config-item-virtual-2m1EFdOj.js → diagram-config-item-virtual-CqPkYosK.js} +2 -2
  11. package/dist/{en_US-DW_aBniN.js → en_US-Cy3_1Rt6.js} +2 -2
  12. package/dist/{es_ES-Bog1JAla.js → es_ES-C6ghJagB.js} +2 -2
  13. package/dist/{fr_FR-B88CF-a2.js → fr_FR-B_boR4BS.js} +2 -2
  14. package/dist/{hooks-xq807tVG.js → hooks-BqvX2KLt.js} +2 -2
  15. package/dist/{icon-next-picker-COelGwZZ.js → icon-next-picker-CMsbLe7r.js} +1 -1
  16. package/dist/index.min.css +1 -1
  17. package/dist/{ja_JP-DQorABU8.js → ja_JP-DhLuasFw.js} +2 -2
  18. package/dist/loader.esm.min.js +2 -2
  19. package/dist/{monaco-editor-C9gHdPuf.js → monaco-editor-Cl_E7g__.js} +2 -2
  20. package/dist/{objectSpread2-DPfqyX1h.js → objectSpread2-B962Mxf_.js} +1 -1
  21. package/dist/{overlayscrollbars-vue-DMDFLsJ4.js → overlayscrollbars-vue-BfwUd3EM.js} +1 -1
  22. package/dist/{pt_PT-fO3ABuZp.js → pt_PT-BdlIINyT.js} +2 -2
  23. package/dist/{relationship-diagram-config-D7HC1Hk4.js → relationship-diagram-config-GxEGtkql.js} +2 -2
  24. package/dist/{rich-editor-BYF_B5mz.js → rich-editor-D7vzpB9U.js} +2 -2
  25. package/dist/{ru_RU-DqC5EhBW.js → ru_RU-Bw0Fk9MV.js} +2 -2
  26. package/dist/template-CbCwf9Cr.js +2 -0
  27. package/dist/{tr_TR-Dau_nW2e.js → tr_TR-CUUs9qjY.js} +2 -2
  28. package/dist/{useMonacoEditor-Zk3dJDl-.js → useMonacoEditor-BDC4VLbE.js} +2 -2
  29. package/dist/{vi_VN-BWVyxMZC.js → vi_VN--jG2lM6p.js} +2 -2
  30. package/dist/{zh_CN-CwWZ2JFL.js → zh_CN-Br1qCqWn.js} +2 -2
  31. package/dist/{zh_TW-NtzRUp8G.js → zh_TW-BMGkBv3z.js} +2 -2
  32. package/es/components/UserPick/src/user-pick.vue_vue_type_script_setup_true_lang.mjs +3 -3
  33. package/es/components/app-drawer/app-drawer-component.css +82 -0
  34. package/es/components/app-drawer/app-drawer-component.d.ts +26 -0
  35. package/es/components/app-drawer/app-drawer-component.mjs +84 -0
  36. package/es/components/batch-select-list/batch-select-list.css +119 -0
  37. package/es/components/batch-select-list/batch-select-list.d.ts +158 -0
  38. package/es/components/batch-select-list/batch-select-list.mjs +133 -0
  39. package/es/components/data-rules-modal/data-rules-modal.d.ts +67 -0
  40. package/es/components/data-rules-modal/data-rules-modal.mjs +99 -0
  41. package/es/components/design-save-tip/design-save-tip.css +107 -0
  42. package/es/components/design-save-tip/design-save-tip.d.ts +44 -0
  43. package/es/components/design-save-tip/design-save-tip.mjs +81 -0
  44. package/es/components/design-step-check/design-step-check.css +133 -0
  45. package/es/components/design-step-check/design-step-check.d.ts +30 -0
  46. package/es/components/design-step-check/design-step-check.mjs +96 -0
  47. package/es/components/design-view-layout/design-view-layout.css +157 -0
  48. package/es/components/design-view-layout/design-view-layout.d.ts +1 -0
  49. package/es/components/design-view-layout/design-view-layout.mjs +139 -0
  50. package/es/components/field-cascader/index.d.ts +2 -1
  51. package/es/components/index.d.ts +9 -2
  52. package/es/components/index.mjs +16 -0
  53. package/es/components/label-design/designer.vue.d.ts +2 -0
  54. package/es/components/label-design/designer.vue.mjs +7 -0
  55. package/es/components/label-design/designer.vue_vue_type_script_setup_true_lang.mjs +32 -0
  56. package/es/components/label-design/designer.vue_vue_type_style_index_0_scoped_260222c9_lang.css +32 -0
  57. package/es/components/label-design/header/header.vue.d.ts +6 -0
  58. package/es/components/label-design/header/header.vue.mjs +7 -0
  59. package/es/components/label-design/header/header.vue_vue_type_script_setup_true_lang.mjs +232 -0
  60. package/es/components/label-design/header/header.vue_vue_type_style_index_0_scoped_aa2b4235_lang.css +39 -0
  61. package/es/components/label-design/header/test-var-modal.vue.d.ts +204 -0
  62. package/es/components/label-design/header/test-var-modal.vue.mjs +7 -0
  63. package/es/components/label-design/header/test-var-modal.vue_vue_type_script_setup_true_lang.mjs +202 -0
  64. package/es/components/label-design/header/test-var-modal.vue_vue_type_style_index_0_scoped_972496bb_lang.css +69 -0
  65. package/es/components/label-design/index.d.ts +11 -1
  66. package/es/components/label-design/index.mjs +9 -0
  67. package/es/components/label-design/modal/template.vue_vue_type_script_setup_true_lang.mjs +1 -1
  68. package/es/components/label-design/panels/panel.vue_vue_type_script_setup_true_lang.mjs +1 -1
  69. package/es/components/label-design/panels/widget/components/label-params-select.vue.d.ts +35 -0
  70. package/es/components/label-design/panels/widget/controls/VariableSelect.vue_vue_type_script_setup_true_name_variable-select_lang.mjs +1 -1
  71. package/es/components/label-design/stage/stage.vue_vue_type_script_setup_true_lang.mjs +1 -1
  72. package/es/components/label-design/type/index.d.ts +15 -0
  73. package/es/components/label-design/type/index.mjs +11 -0
  74. package/es/components/modal-name-editor/modal-name-editor.css +117 -0
  75. package/es/components/modal-name-editor/modal-name-editor.d.ts +34 -0
  76. package/es/components/modal-name-editor/modal-name-editor.mjs +124 -0
  77. package/es/components/shrink-panel/shrink-panel.css +130 -0
  78. package/es/components/shrink-panel/shrink-panel.d.ts +23 -0
  79. package/es/components/shrink-panel/shrink-panel.mjs +41 -0
  80. package/es/create-app-vue.mjs +1 -1
  81. package/es/hooks/index.d.ts +1 -0
  82. package/es/hooks/index.mjs +1 -0
  83. package/es/hooks/usePrinter.d.ts +19 -0
  84. package/es/hooks/usePrinter.mjs +50 -0
  85. package/es/index.mjs +21 -3
  86. package/es/interface/i-view-step/i-view-step.d.ts +32 -0
  87. package/es/interface/index.d.ts +1 -0
  88. package/es/modules/category/category-sider.vue.d.ts +1 -1
  89. package/es/modules/category/category-sider.vue.mjs +2 -2
  90. package/es/modules/category/{category-sider.vue_vue_type_style_index_0_scoped_5b8c3a8d_lang.css → category-sider.vue_vue_type_style_index_0_scoped_2ad0d132_lang.css} +33 -33
  91. package/es/modules/color-picker/index.mjs +1 -1
  92. package/es/modules/gct-form/controller/editor-item/editor-item.controller.d.ts +1 -0
  93. package/es/modules/gct-form/controller/editor-item/editor-item.controller.mjs +11 -0
  94. package/es/modules/gct-form/editor/gct-form-date-range/form-date-range.css +67 -0
  95. package/es/modules/gct-form/editor/gct-form-date-range/form-date-range.d.ts +50 -0
  96. package/es/modules/gct-form/editor/gct-form-date-range/form-date-range.mjs +61 -0
  97. package/es/modules/gct-form/editor/gct-form-date-range/form-date-range.provider.d.ts +13 -0
  98. package/es/modules/gct-form/editor/gct-form-date-range/form-date-range.provider.mjs +15 -0
  99. package/es/modules/gct-form/editor/gct-form-date-range/index.d.ts +4 -0
  100. package/es/modules/gct-form/editor/gct-form-date-range/index.mjs +8 -0
  101. package/es/modules/gct-form/editor/gct-form-select/gct-form-select.mjs +1 -1
  102. package/es/modules/gct-form/editor/index.mjs +2 -1
  103. package/es/modules/gct-form/hooks/index.d.ts +1 -0
  104. package/es/modules/gct-form/hooks/index.mjs +1 -0
  105. package/es/modules/gct-form/hooks/use-form-value/use-form-value.d.ts +11 -0
  106. package/es/modules/gct-form/hooks/use-form-value/use-form-value.mjs +27 -0
  107. package/es/modules/gct-form/index.mjs +3 -0
  108. package/es/modules/gct-form/widgets/gct-search-form/form/app-form.css +70 -0
  109. package/es/modules/gct-form/widgets/gct-search-form/form/app-form.d.ts +22 -0
  110. package/es/modules/gct-form/widgets/gct-search-form/form/app-form.mjs +106 -0
  111. package/es/modules/gct-form/widgets/gct-search-form/form-item/form-item.css +73 -0
  112. package/es/modules/gct-form/widgets/gct-search-form/form-item/form-item.d.ts +15 -0
  113. package/es/modules/gct-form/widgets/gct-search-form/form-item/form-item.mjs +22 -0
  114. package/es/modules/gct-form/widgets/gct-search-form/form.controller.d.ts +46 -0
  115. package/es/modules/gct-form/widgets/gct-search-form/form.controller.mjs +69 -0
  116. package/es/modules/gct-form/widgets/gct-search-form/form.state.d.ts +10 -0
  117. package/es/modules/gct-form/widgets/gct-search-form/form.state.mjs +13 -0
  118. package/es/modules/gct-form/widgets/gct-search-form/gct-search-form.css +83 -0
  119. package/es/modules/gct-form/widgets/gct-search-form/gct-search-form.d.ts +33 -0
  120. package/es/modules/gct-form/widgets/gct-search-form/gct-search-form.mjs +56 -0
  121. package/es/modules/gct-table/editor/gct-table-date/gct-table-date.mjs +1 -1
  122. package/es/modules/gct-table/editor/gct-table-text/gct-table-text.mjs +1 -1
  123. package/es/modules/global-modal/src/components/ModalWrapper.vue_vue_type_script_lang.mjs +1 -1
  124. package/es/types/index.d.ts +1 -1
  125. package/es/utils/overlay-controller/overlay-controller.d.ts +3 -1
  126. package/es/utils/overlay-controller/overlay-controller.mjs +9 -0
  127. package/package.json +10 -8
  128. package/dist/ColorPicker-BGXmyt7q.js +0 -2
  129. package/dist/template-DwBghb9z.js +0 -2
  130. /package/es/modules/gct-table/editor/{gct-table-date/gct-table-date.css → gct-table-text/gct-table-text.css} +0 -0
@@ -0,0 +1,67 @@
1
+ @charset "UTF-8";
2
+ /* stylelint-disable scss/no-global-function-names */
3
+ /* bem('block', 'element', 'modifier') => 'ibiz-block__element--modifier' */
4
+ /**
5
+ * 定义 Block 块
6
+ * @param {String} $block - Block 块名称
7
+ * @example
8
+ * @include b('button') {
9
+ * padding: 10px;
10
+ * }
11
+ */
12
+ /**
13
+ * 定义 Element 元素
14
+ * @param {String|List} $element - Element 元素名称,支持单个或多个
15
+ * @example
16
+ * @include b('button') {
17
+ * @include e('text') {
18
+ * color: #000;
19
+ * }
20
+ * }
21
+ * // 或传入多个元素
22
+ * @include b('button') {
23
+ * @include e(('text', 'icon')) {
24
+ * margin: 5px;
25
+ * }
26
+ * }
27
+ */
28
+ /**
29
+ * 定义 Modifier 修饰符
30
+ * @param {String|List} $modifier - Modifier 修饰符名称,支持单个或多个
31
+ * @example
32
+ * @include b('button') {
33
+ * @include m('primary') {
34
+ * background: blue;
35
+ * }
36
+ * }
37
+ * // 或传入多个修饰符
38
+ * @include b('button') {
39
+ * @include m(('primary', 'large')) {
40
+ * background: blue;
41
+ * font-size: 16px;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * 定义状态选择器
47
+ * @param {String} $state - 状态名称
48
+ * @example
49
+ * @include b('button') {
50
+ * @include when('disabled') {
51
+ * opacity: 0.5;
52
+ * }
53
+ * }
54
+ */
55
+ /**
56
+ * 深色主题样式
57
+ * @param {String} $block - Block 块名称
58
+ * @example
59
+ * @include dark('button') {
60
+ * background: #333;
61
+ * color: #fff;
62
+ * }
63
+ */
64
+ /* stylelint-disable scss/no-global-function-names */
65
+ .gct-gct-form-date-range {
66
+ width: 100%;
67
+ }
@@ -0,0 +1,50 @@
1
+ import { PropType } from 'vue';
2
+ import { default as dayjs, Dayjs } from 'dayjs';
3
+ import { IEditorBasic, IFormItem } from '../../interface';
4
+ export declare const GctFormDateRange: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ itemModel: {
6
+ type: PropType<IFormItem & {
7
+ default?: string[];
8
+ }>;
9
+ required: true;
10
+ };
11
+ model: {
12
+ type: PropType<IEditorBasic>;
13
+ required: true;
14
+ };
15
+ data: {
16
+ type: PropType<IData>;
17
+ required: true;
18
+ };
19
+ value: {
20
+ type: PropType<Dayjs[]>;
21
+ default: () => Dayjs[];
22
+ };
23
+ }>, {
24
+ ns: import('@gct-paas/core').Namespace;
25
+ val: import('vue').Ref<dayjs.Dayjs[], dayjs.Dayjs[]>;
26
+ editorProps: IObject;
27
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:value"[], "update:value", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
28
+ itemModel: {
29
+ type: PropType<IFormItem & {
30
+ default?: string[];
31
+ }>;
32
+ required: true;
33
+ };
34
+ model: {
35
+ type: PropType<IEditorBasic>;
36
+ required: true;
37
+ };
38
+ data: {
39
+ type: PropType<IData>;
40
+ required: true;
41
+ };
42
+ value: {
43
+ type: PropType<Dayjs[]>;
44
+ default: () => Dayjs[];
45
+ };
46
+ }>> & Readonly<{
47
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
48
+ }>, {
49
+ value: dayjs.Dayjs[];
50
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,61 @@
1
+ import { useFormValue } from "../../hooks/use-form-value/use-form-value.mjs";
2
+ import "../../hooks/index.mjs";
3
+ import './form-date-range.css';/* empty css */
4
+ import { createVNode, defineComponent, mergeProps, resolveComponent, watch } from "vue";
5
+ import { useNamespace } from "@gct-paas/core";
6
+ import dayjs from "dayjs";
7
+ //#region src/modules/gct-form/editor/gct-form-date-range/form-date-range.tsx
8
+ var GctFormDateRange = /* @__PURE__ */ defineComponent({
9
+ name: "GctFormDateRange",
10
+ props: {
11
+ itemModel: {
12
+ type: Object,
13
+ required: true
14
+ },
15
+ model: {
16
+ type: Object,
17
+ required: true
18
+ },
19
+ data: {
20
+ type: Object,
21
+ required: true
22
+ },
23
+ value: {
24
+ type: Object,
25
+ default: () => []
26
+ }
27
+ },
28
+ emits: ["update:value"],
29
+ setup(props) {
30
+ const ns = useNamespace("gct-form-date-range");
31
+ const format = props.model.format || "YYYY-MM-DD HH:mm:ss";
32
+ const val = useFormValue();
33
+ const editorProps = props.model.props || {};
34
+ const [startKey, endKey] = props.itemModel.fields || [];
35
+ const defaultVal = props.itemModel?.default;
36
+ if (defaultVal && defaultVal.length > 0) val.value = defaultVal.map((item) => item ? dayjs(item) : null);
37
+ watch(val, () => {
38
+ if (val.value) {
39
+ const [start, end] = val.value;
40
+ if (start) props.data[startKey] = start.format(format);
41
+ if (end) props.data[endKey] = end.format(format);
42
+ }
43
+ });
44
+ return {
45
+ ns,
46
+ val,
47
+ editorProps
48
+ };
49
+ },
50
+ render() {
51
+ return createVNode(resolveComponent("a-range-picker"), mergeProps(this.editorProps, {
52
+ "value": this.val,
53
+ "onUpdate:value": ($event) => this.val = $event,
54
+ "class": this.ns.b(),
55
+ "show-time": true,
56
+ "placeholder": this.model.placeholder
57
+ }), null);
58
+ }
59
+ });
60
+ //#endregion
61
+ export { GctFormDateRange };
@@ -0,0 +1,13 @@
1
+ import { IEditorProvider } from '../../interface';
2
+ /**
3
+ * 日期时间范围选择编辑器
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-03-27 14:03:14
7
+ * @export
8
+ * @class FormDateRangeProvider
9
+ * @implements {IEditorProvider}
10
+ */
11
+ export declare class FormDateRangeProvider implements IEditorProvider {
12
+ component: string;
13
+ }
@@ -0,0 +1,15 @@
1
+ //#region src/modules/gct-form/editor/gct-form-date-range/form-date-range.provider.ts
2
+ /**
3
+ * 日期时间范围选择编辑器
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-03-27 14:03:14
7
+ * @export
8
+ * @class FormDateRangeProvider
9
+ * @implements {IEditorProvider}
10
+ */
11
+ var FormDateRangeProvider = class {
12
+ component = "gct-form-date-range";
13
+ };
14
+ //#endregion
15
+ export { FormDateRangeProvider };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ install(app: import('vue').App): void;
3
+ };
4
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { EditorType } from "../../constants/editor-type/editor-type.mjs";
2
+ import { widthEditorInstall } from "../../utils/width-install/width-install.mjs";
3
+ import { FormDateRangeProvider } from "./form-date-range.provider.mjs";
4
+ import { GctFormDateRange } from "./form-date-range.mjs";
5
+ //#region src/modules/gct-form/editor/gct-form-date-range/index.ts
6
+ var gct_form_date_range_default = widthEditorInstall(EditorType.DATE_RANGE, () => new FormDateRangeProvider(), GctFormDateRange);
7
+ //#endregion
8
+ export { gct_form_date_range_default as default };
@@ -55,7 +55,7 @@ var GctFormSelect = /* @__PURE__ */ defineComponent({
55
55
  }
56
56
  });
57
57
  const options = computed(() => {
58
- if (props.c.state.options && props.c.state.options.length > 0) return props.c.state.options;
58
+ if (props.c?.state?.options && props.c?.state?.options?.length > 0) return props.c.state.options;
59
59
  return editorC.options;
60
60
  });
61
61
  onUnmounted(() => {
@@ -24,9 +24,10 @@ import gct_form_model_select_default from "./gct-form-model-select/index.mjs";
24
24
  import gct_form_multiple_choice_default from "./gct-form-multiple-choice/index.mjs";
25
25
  import gct_form_table_default from "./gct-form-table/index.mjs";
26
26
  import gct_select_form_table_default from "./gct-select-form-table/index.mjs";
27
+ import gct_form_date_range_default from "./gct-form-date-range/index.mjs";
27
28
  //#region src/modules/gct-form/editor/index.ts
28
29
  var editor_default = { install(app) {
29
- app.use(gct_form_length_unit_default).use(gct_form_color_default).use(gct_form_date_format_select_default).use(gct_form_date_default).use(gct_form_formula_default).use(gct_form_check_switch_default).use(gct_form_i18n_default).use(gct_form_group_select_default).use(gct_form_icon_select_default).use(gct_form_number_default).use(gct_form_picker_default).use(gct_form_pixel_config_default).use(gct_form_select_default).use(gct_form_span_default).use(gct_form_switch_default).use(gct_form_text_default).use(gct_form_textarea_default).use(gct_form_radio_default).use(gct_form_info_default).use(gct_form_checkbox_default).use(gct_form_date_default).use(gct_form_model_select_default).use(gct_form_multiple_choice_default).use(gct_form_table_default).use(gct_select_form_table_default).use(gct_form_action_default).use(gct_form_empty_default);
30
+ app.use(gct_form_length_unit_default).use(gct_form_color_default).use(gct_form_date_format_select_default).use(gct_form_date_default).use(gct_form_formula_default).use(gct_form_check_switch_default).use(gct_form_i18n_default).use(gct_form_group_select_default).use(gct_form_icon_select_default).use(gct_form_number_default).use(gct_form_picker_default).use(gct_form_pixel_config_default).use(gct_form_select_default).use(gct_form_span_default).use(gct_form_switch_default).use(gct_form_text_default).use(gct_form_textarea_default).use(gct_form_radio_default).use(gct_form_info_default).use(gct_form_checkbox_default).use(gct_form_date_default).use(gct_form_model_select_default).use(gct_form_multiple_choice_default).use(gct_form_table_default).use(gct_select_form_table_default).use(gct_form_action_default).use(gct_form_empty_default).use(gct_form_date_range_default);
30
31
  } };
31
32
  //#endregion
32
33
  export { editor_default as default };
@@ -1,2 +1,3 @@
1
1
  export { useForm } from './use-form/use-form';
2
2
  export { useGctFormValue, useGctFormValueByText, } from './use-gct-form-value/use-gct-form-value';
3
+ export { useFormValue } from './use-form-value/use-form-value';
@@ -1,2 +1,3 @@
1
1
  import "./use-form/use-form.mjs";
2
2
  import "./use-gct-form-value/use-gct-form-value.mjs";
3
+ import "./use-form-value/use-form-value.mjs";
@@ -0,0 +1,11 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 返回一个编辑用的双向数据绑定的值
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-03-27 15:03:50
7
+ * @export
8
+ * @template T
9
+ * @return {*} {Ref<T>}
10
+ */
11
+ export declare function useFormValue<T = any>(): Ref<T>;
@@ -0,0 +1,27 @@
1
+ import { getCurrentInstance, ref, watch } from "vue";
2
+ //#region src/modules/gct-form/hooks/use-form-value/use-form-value.ts
3
+ /**
4
+ * 返回一个编辑用的双向数据绑定的值
5
+ *
6
+ * @author zhanghanrui
7
+ * @date 2024-03-27 15:03:50
8
+ * @export
9
+ * @template T
10
+ * @return {*} {Ref<T>}
11
+ */
12
+ function useFormValue() {
13
+ let vue = getCurrentInstance().proxy;
14
+ const props = vue.$props;
15
+ const emit = vue.$emit;
16
+ const val = ref(props.value);
17
+ watch(() => props.value, (newVal) => {
18
+ if (val.value !== newVal) val.value = newVal;
19
+ });
20
+ watch(val, (newVal, oldVal) => {
21
+ if (oldVal !== newVal) emit("update:value", newVal);
22
+ });
23
+ vue = null;
24
+ return val;
25
+ }
26
+ //#endregion
27
+ export { useFormValue };
@@ -29,6 +29,7 @@ import "./controller/form-line/form-line.controller.mjs";
29
29
  import "./controller/index.mjs";
30
30
  import "./hooks/use-form/use-form.mjs";
31
31
  import "./hooks/use-gct-form-value/use-gct-form-value.mjs";
32
+ import "./hooks/use-form-value/use-form-value.mjs";
32
33
  import "./hooks/index.mjs";
33
34
  import "./props/gct-form-item/gct-form-item.props.mjs";
34
35
  import "./register/editor-register/editor-register.mjs";
@@ -49,6 +50,7 @@ import { GridContainer } from "./components/grid-container/grid-container.mjs";
49
50
  import "./components/index.mjs";
50
51
  import editor_default from "./editor/index.mjs";
51
52
  import { GctEditForm } from "./widgets/gct-edit-form/gct-edit-form.mjs";
53
+ import GctSearchForm from "./widgets/gct-search-form/gct-search-form.mjs";
52
54
  //#region src/modules/gct-form/index.ts
53
55
  var gct_form_default = { install(app) {
54
56
  app.use(editor_default);
@@ -56,6 +58,7 @@ var gct_form_default = { install(app) {
56
58
  app.component(FlexItem.name, FlexItem);
57
59
  app.component(GridContainer.name, GridContainer);
58
60
  app.component(GctEditForm.name, GctEditForm);
61
+ app.component(GctSearchForm.name, GctSearchForm);
59
62
  app.use(gct_form_default$1);
60
63
  } };
61
64
  //#endregion
@@ -0,0 +1,70 @@
1
+ @charset "UTF-8";
2
+ /* stylelint-disable scss/no-global-function-names */
3
+ /* bem('block', 'element', 'modifier') => 'ibiz-block__element--modifier' */
4
+ /**
5
+ * 定义 Block 块
6
+ * @param {String} $block - Block 块名称
7
+ * @example
8
+ * @include b('button') {
9
+ * padding: 10px;
10
+ * }
11
+ */
12
+ /**
13
+ * 定义 Element 元素
14
+ * @param {String|List} $element - Element 元素名称,支持单个或多个
15
+ * @example
16
+ * @include b('button') {
17
+ * @include e('text') {
18
+ * color: #000;
19
+ * }
20
+ * }
21
+ * // 或传入多个元素
22
+ * @include b('button') {
23
+ * @include e(('text', 'icon')) {
24
+ * margin: 5px;
25
+ * }
26
+ * }
27
+ */
28
+ /**
29
+ * 定义 Modifier 修饰符
30
+ * @param {String|List} $modifier - Modifier 修饰符名称,支持单个或多个
31
+ * @example
32
+ * @include b('button') {
33
+ * @include m('primary') {
34
+ * background: blue;
35
+ * }
36
+ * }
37
+ * // 或传入多个修饰符
38
+ * @include b('button') {
39
+ * @include m(('primary', 'large')) {
40
+ * background: blue;
41
+ * font-size: 16px;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * 定义状态选择器
47
+ * @param {String} $state - 状态名称
48
+ * @example
49
+ * @include b('button') {
50
+ * @include when('disabled') {
51
+ * opacity: 0.5;
52
+ * }
53
+ * }
54
+ */
55
+ /**
56
+ * 深色主题样式
57
+ * @param {String} $block - Block 块名称
58
+ * @example
59
+ * @include dark('button') {
60
+ * background: #333;
61
+ * color: #fff;
62
+ * }
63
+ */
64
+ /* stylelint-disable scss/no-global-function-names */
65
+ .gct-app-form {
66
+ padding: 16px 16px 0;
67
+ }
68
+ .gct-app-form .gct-grid-container > .ant-col:first-child .gct-app-form-item {
69
+ padding-left: 0;
70
+ }
@@ -0,0 +1,22 @@
1
+ import { PropType, VNode } from 'vue';
2
+ import { IForm, IFormContainer, IFormItem, IFormItemBasic } from '../../..';
3
+ export declare const AppForm: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ model: {
5
+ type: PropType<IForm>;
6
+ required: true;
7
+ };
8
+ }>, {
9
+ ns: import('@gct-paas/core').Namespace;
10
+ c: import('../form.controller').FormController;
11
+ renderItem: (item: IFormItem) => import("vue/jsx-runtime").JSX.Element | null;
12
+ renderContainer: (container: IFormContainer) => import("vue/jsx-runtime").JSX.Element | undefined;
13
+ renderChildren: (children: IFormItemBasic[]) => (VNode<import('vue').RendererNode, import('vue').RendererElement, {
14
+ [key: string]: any;
15
+ }> | null)[] | null;
16
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
17
+ model: {
18
+ type: PropType<IForm>;
19
+ required: true;
20
+ };
21
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
22
+ export default AppForm;
@@ -0,0 +1,106 @@
1
+ import { EditorRegisterConst as EditorRegisterConst$1 } from "../../../constants/editor-register/editor-register.mjs";
2
+ import { FlexContainer } from "../../../components/flex-container/flex-container.mjs";
3
+ import { GridContainer } from "../../../components/grid-container/grid-container.mjs";
4
+ import "../../../components/index.mjs";
5
+ import { useFormController } from "../form.controller.mjs";
6
+ import './app-form.css';/* empty css */
7
+ import { AppFormItem } from "../form-item/form-item.mjs";
8
+ import "../../../index.mjs";
9
+ import { createVNode, defineComponent, h, isVNode, resolveComponent } from "vue";
10
+ import { useNamespace } from "@gct-paas/core";
11
+ //#region src/modules/gct-form/widgets/gct-search-form/form/app-form.tsx
12
+ function _isSlot(s) {
13
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
14
+ }
15
+ var AppForm = /* @__PURE__ */ defineComponent({
16
+ name: "AppForm",
17
+ props: { model: {
18
+ type: Object,
19
+ required: true
20
+ } },
21
+ setup(props) {
22
+ const ns = useNamespace("app-form");
23
+ const c = useFormController(props.model);
24
+ /**
25
+ * 绘制表单项
26
+ *
27
+ * @author zhanghanrui
28
+ * @date 2024-03-26 21:03:52
29
+ * @param {IFormItem} item
30
+ * @return {*}
31
+ */
32
+ const renderItem = (item) => {
33
+ if (item.editor.type === "hidden") return null;
34
+ const provider = _gct.register.editor.get(EditorRegisterConst$1.PREFIX + item.editor.type);
35
+ console.log("item--------------", c, item, provider);
36
+ let content = null;
37
+ if (provider) if (provider.render) content = provider.render(c.state.data[item.name], c.state.data, item);
38
+ else if (provider.component) content = h(typeof provider.component === "string" ? resolveComponent(provider.component) : provider.component, {
39
+ c,
40
+ value: c.state.data[item.name],
41
+ itemModel: item,
42
+ model: item.editor,
43
+ data: c.state.data,
44
+ "onUpdate:value": (value) => {
45
+ console.log("onUpdate:value", value, c.state.data);
46
+ c.state.data[item.name] = value;
47
+ console.log("c.state.data----------", c.state.data);
48
+ }
49
+ });
50
+ else console.error(`未找到编辑器绘制组件:${item.name} - ${item.editor.type},请实现 component 或 render 方法`);
51
+ else console.error(`未找到编辑器适配器:${item.name} - ${item.editor.type}`);
52
+ return createVNode(AppFormItem, { "model": item }, _isSlot(content) ? content : { default: () => [content] });
53
+ };
54
+ /**
55
+ * 绘制表单容器
56
+ *
57
+ * @author zhanghanrui
58
+ * @date 2024-03-26 21:03:17
59
+ * @param {IFormContainer} container
60
+ * @return {*}
61
+ */
62
+ const renderContainer = (container) => {
63
+ if (container.layout === "flex") {
64
+ let _slot;
65
+ return createVNode(FlexContainer, { "layout": container.flex }, _isSlot(_slot = renderChildren(container.children)) ? _slot : { default: () => [_slot] });
66
+ }
67
+ if (container.layout === "grid") {
68
+ let _slot2;
69
+ return createVNode(GridContainer, { "layout": container.grid }, _isSlot(_slot2 = renderChildren(container.children)) ? _slot2 : { default: () => [_slot2] });
70
+ }
71
+ console.error("不支持的layout类型" + container.layout);
72
+ };
73
+ /**
74
+ * 绘制子元素
75
+ *
76
+ * @author zhanghanrui
77
+ * @date 2024-03-26 21:03:22
78
+ * @param {IFormItemBasic[]} children
79
+ * @return {*}
80
+ */
81
+ const renderChildren = (children) => {
82
+ if (!children) return null;
83
+ return children.flatMap((item) => {
84
+ const container = item;
85
+ if (container.children) return renderChildren(container.children);
86
+ return renderItem(item);
87
+ });
88
+ };
89
+ return {
90
+ ns,
91
+ c,
92
+ renderItem,
93
+ renderContainer,
94
+ renderChildren
95
+ };
96
+ },
97
+ render() {
98
+ let _slot3;
99
+ return createVNode(resolveComponent("a-form"), {
100
+ "model": this.c.state.data,
101
+ "class": this.ns.b()
102
+ }, _isSlot(_slot3 = this.model.children.map((item) => this.renderContainer(item))) ? _slot3 : { default: () => [_slot3] });
103
+ }
104
+ });
105
+ //#endregion
106
+ export { AppForm as default };
@@ -0,0 +1,73 @@
1
+ @charset "UTF-8";
2
+ /* stylelint-disable scss/no-global-function-names */
3
+ /* bem('block', 'element', 'modifier') => 'ibiz-block__element--modifier' */
4
+ /**
5
+ * 定义 Block 块
6
+ * @param {String} $block - Block 块名称
7
+ * @example
8
+ * @include b('button') {
9
+ * padding: 10px;
10
+ * }
11
+ */
12
+ /**
13
+ * 定义 Element 元素
14
+ * @param {String|List} $element - Element 元素名称,支持单个或多个
15
+ * @example
16
+ * @include b('button') {
17
+ * @include e('text') {
18
+ * color: #000;
19
+ * }
20
+ * }
21
+ * // 或传入多个元素
22
+ * @include b('button') {
23
+ * @include e(('text', 'icon')) {
24
+ * margin: 5px;
25
+ * }
26
+ * }
27
+ */
28
+ /**
29
+ * 定义 Modifier 修饰符
30
+ * @param {String|List} $modifier - Modifier 修饰符名称,支持单个或多个
31
+ * @example
32
+ * @include b('button') {
33
+ * @include m('primary') {
34
+ * background: blue;
35
+ * }
36
+ * }
37
+ * // 或传入多个修饰符
38
+ * @include b('button') {
39
+ * @include m(('primary', 'large')) {
40
+ * background: blue;
41
+ * font-size: 16px;
42
+ * }
43
+ * }
44
+ */
45
+ /**
46
+ * 定义状态选择器
47
+ * @param {String} $state - 状态名称
48
+ * @example
49
+ * @include b('button') {
50
+ * @include when('disabled') {
51
+ * opacity: 0.5;
52
+ * }
53
+ * }
54
+ */
55
+ /**
56
+ * 深色主题样式
57
+ * @param {String} $block - Block 块名称
58
+ * @example
59
+ * @include dark('button') {
60
+ * background: #333;
61
+ * color: #fff;
62
+ * }
63
+ */
64
+ /* stylelint-disable scss/no-global-function-names */
65
+ .gct-app-form-item {
66
+ padding-left: 20px;
67
+ }
68
+ .gct-app-form-item .ant-form-item-label {
69
+ font-family: "PingFang SC", sans-serif;
70
+ font-size: 14px;
71
+ font-weight: 400;
72
+ color: #212528;
73
+ }
@@ -0,0 +1,15 @@
1
+ import { PropType } from 'vue';
2
+ import { IFormItem } from '../../..';
3
+ export declare const AppFormItem: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ model: {
5
+ type: PropType<IFormItem>;
6
+ required: true;
7
+ };
8
+ }>, {
9
+ ns: import('@gct-paas/core').Namespace;
10
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
11
+ model: {
12
+ type: PropType<IFormItem>;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,22 @@
1
+ import './form-item.css';/* empty css */
2
+ import { createVNode, defineComponent, resolveComponent } from "vue";
3
+ import { useNamespace } from "@gct-paas/core";
4
+ //#region src/modules/gct-form/widgets/gct-search-form/form-item/form-item.tsx
5
+ var AppFormItem = /* @__PURE__ */ defineComponent({
6
+ name: "AppFormItem",
7
+ props: { model: {
8
+ type: Object,
9
+ required: true
10
+ } },
11
+ setup() {
12
+ return { ns: useNamespace("app-form-item") };
13
+ },
14
+ render() {
15
+ return createVNode(resolveComponent("a-form-item"), {
16
+ "label": this.model.label,
17
+ "class": this.ns.b()
18
+ }, { default: () => [this.$slots.default?.()] });
19
+ }
20
+ });
21
+ //#endregion
22
+ export { AppFormItem };