@kp-ui/lowcode-pc-v2 0.0.5 → 0.0.7

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 (38) hide show
  1. package/assets/styles/style.css +72 -28
  2. package/core/src/components/common/render/RenderWidgetList.vue_vue_type_script_setup_true_lang.js +6 -4
  3. package/core/src/components/common/render/usePageContext.js +11 -8
  4. package/core/src/hooks/useAppRef.js +5 -3
  5. package/core/src/hooks/useField.js +0 -4
  6. package/core/src/hooks/useFieldRules.js +36 -9
  7. package/core/src/hooks/useLowcode.js +17 -17
  8. package/core/src/hooks/useRemoteData.js +4 -3
  9. package/core/src/hooks/useSelect.js +4 -13
  10. package/core/src/lang/en-US.js +22 -0
  11. package/core/src/lang/zh-CN.js +23 -1
  12. package/core/src/utils/smart-vue-i18n/index.js +6 -6
  13. package/install.js +2 -3
  14. package/package.json +1 -1
  15. package/src/components/public/ConfigView/CustomPageRender.vue_vue_type_script_setup_true_lang.js +10 -17
  16. package/src/hooks/useTableWidget.js +48 -15
  17. package/src/render/index.js +1 -1
  18. package/src/render/index.vue_vue_type_script_setup_true_lang.js +4 -3
  19. package/src/schemas/defaults/field.js +1 -0
  20. package/src/widgets/advanced/code-editor/index.js +1 -1
  21. package/src/widgets/advanced/code-editor/index.vue_vue_type_script_setup_true_lang.js +9 -2
  22. package/src/widgets/advanced/data-table/index.js +1 -1
  23. package/src/widgets/advanced/data-table/index.vue_vue_type_script_setup_true_lang.js +10 -12
  24. package/src/widgets/advanced/data-table/schema.js +2 -1
  25. package/src/widgets/containers/collapse/index-render.js +1 -1
  26. package/src/widgets/containers/collapse/index-render.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/src/widgets/containers/dialog/index-render.js +3 -1
  28. package/src/widgets/containers/dialog/index-render.vue_vue_type_script_setup_true_lang.js +5 -4
  29. package/src/widgets/containers/dialog/schema.js +1 -0
  30. package/src/widgets/containers/flex/index-render.js +7 -0
  31. package/src/widgets/containers/flex/index-render.vue_vue_type_script_setup_true_lang.js +93 -0
  32. package/src/widgets/containers/flex/schema.js +35 -0
  33. package/src/widgets/containers/space/schema.js +1 -0
  34. package/src/widgets/render.js +7 -3
  35. package/src/widgets/widgetTypes.js +1 -0
  36. package/src/widgets/wrapper/form-item-wrapper.js +1 -1
  37. package/src/widgets/wrapper/form-item-wrapper.vue_vue_type_script_setup_true_lang.js +15 -10
  38. package/stats.html +1 -1
@@ -135,35 +135,66 @@
135
135
  border-radius: 4px;
136
136
  color: #333;
137
137
  }
138
- .field-wrapper[data-v-9c668962] {
138
+ .field-wrapper[data-v-254940bd] {
139
139
  position: relative;
140
140
  }
141
- .field-wrapper.hidden[data-v-9c668962] {
141
+ .field-wrapper.hidden[data-v-254940bd] {
142
142
  display: none;
143
143
  }
144
- .ant-form-item[data-v-9c668962] {
144
+ .ant-form-item[data-v-254940bd] {
145
145
  position: relative;
146
146
  }
147
- .ant-form-item[data-v-9c668962] .ant-form-item-label {
147
+ .ant-form-item[data-v-254940bd] .ant-form-item-label {
148
148
  white-space: nowrap;
149
149
  text-overflow: ellipsis;
150
150
  }
151
- .ant-form-item .label-box[data-v-9c668962] {
151
+ .ant-form-item .label-box[data-v-254940bd] {
152
152
  display: flex;
153
153
  align-items: center;
154
+ width: 100%;
155
+ height: auto;
156
+ min-height: 30px;
157
+ min-width: 0;
154
158
  }
155
- .ant-form-item .label-box .label-text[data-v-9c668962] {
156
- overflow: hidden;
157
- text-overflow: ellipsis;
159
+ .ant-form-item .label-box .label-text[data-v-254940bd] {
160
+ min-width: 0;
161
+ display: inline;
162
+ overflow: visible;
163
+ text-overflow: initial;
164
+ white-space: normal;
165
+ text-align: inherit;
166
+ word-break: break-all;
167
+ -webkit-line-clamp: initial;
168
+ -webkit-box-orient: initial;
169
+ }
170
+ .ant-form-item .label-box--left[data-v-254940bd] {
171
+ justify-content: flex-start;
172
+ }
173
+ .ant-form-item .label-box--left .label-text[data-v-254940bd] {
174
+ text-align: start;
175
+ }
176
+ .ant-form-item .label-box--right[data-v-254940bd] {
177
+ justify-content: flex-end;
158
178
  }
159
- .ant-form-item .custom-label[data-v-9c668962] {
160
- display: flex;
179
+ .ant-form-item .label-box--right .label-text[data-v-254940bd] {
180
+ text-align: end;
181
+ }
182
+ .ant-form-item .custom-label[data-v-254940bd] {
183
+ display: inline-flex;
161
184
  align-items: center;
185
+ width: 100%;
186
+ min-width: 0;
162
187
  gap: 4px;
163
- }.designer[data-v-b5e7230e] {
188
+ }
189
+ .ant-form-item .custom-label .label-text[data-v-254940bd] {
190
+ flex: 1 1 auto;
191
+ }
192
+ .ant-form-item .custom-label[data-v-254940bd] .svg-icon {
193
+ flex: 0 0 auto;
194
+ }.designer[data-v-8c04a069] {
164
195
  position: relative;
165
196
  }
166
- .designer[data-v-b5e7230e]::before {
197
+ .designer[data-v-8c04a069]::before {
167
198
  position: absolute;
168
199
  z-index: 99;
169
200
  content: "";
@@ -275,11 +306,13 @@
275
306
  }
276
307
  .button-list-container .button-icon[data-v-37429548] {
277
308
  margin-right: 4px;
278
- }.talbe-wrapper[data-v-218c688c] {
279
- width: 100%;
309
+ }.talbe-wrapper[data-v-19607d37] {
280
310
  position: relative;
311
+ height: var(--0622be28);
312
+ display: flex;
313
+ flex: var(--3bd67a87);
281
314
  }
282
- .talbe-wrapper .table-toolbar[data-v-218c688c] {
315
+ .talbe-wrapper .table-toolbar[data-v-19607d37] {
283
316
  padding: 8px 0;
284
317
  margin-bottom: 8px;
285
318
  position: absolute;
@@ -288,10 +321,10 @@
288
321
  right: 0;
289
322
  width: 30px;
290
323
  }
291
- .talbe-wrapper .vxe-grid[data-v-218c688c] {
324
+ .talbe-wrapper .vxe-grid[data-v-19607d37] {
292
325
  width: 100%;
293
326
  }
294
- .talbe-wrapper__pagination[data-v-218c688c] {
327
+ .talbe-wrapper__pagination[data-v-19607d37] {
295
328
  margin-top: 10px;
296
329
  display: flex;
297
330
  justify-content: end;
@@ -412,32 +445,38 @@
412
445
  }
413
446
  .vf-box-widget .vf-box-content[data-v-d52cfec5] {
414
447
  min-height: 60px;
415
- }.collapse-container[data-v-cf9e4069] {
448
+ }.collapse-container[data-v-198dcc4f] {
416
449
  display: flex;
417
450
  margin: 2px;
418
- height: 100%;
419
451
  width: 100%;
420
- flex: 1 0 0;
421
452
  }
422
- .collapse-container .form-widget-list[data-v-cf9e4069] {
453
+ .collapse-container .form-widget-list[data-v-198dcc4f] {
423
454
  min-height: 28px;
424
455
  }
425
- .collapse-container[data-v-cf9e4069] .header-right .form-widget-list {
456
+ .collapse-container[data-v-198dcc4f] .header-right .form-widget-list {
426
457
  min-width: 200px;
427
458
  }
428
- .tpf-collapse[data-v-cf9e4069] {
459
+ .tpf-collapse[data-v-198dcc4f] {
429
460
  padding: 5px;
430
461
  }
431
- .tpf-collapse .collapse-right[data-v-cf9e4069] {
462
+ .tpf-collapse .collapse-right[data-v-198dcc4f] {
432
463
  min-width: 200px;
433
464
  min-height: 30px;
434
465
  }
435
- .tpf-collapse[data-v-cf9e4069] .tpf-collapse-content-wrapper {
466
+ .tpf-collapse[data-v-198dcc4f] .tpf-collapse-content-wrapper {
436
467
  overflow: hidden;
437
468
  background-color: #fff;
438
469
  padding: 16px;
439
470
  }
440
- .form-widget[data-v-4c8924c1] {
471
+ [data-v-17ae4bcb] .ant-modal-body .ime-table {
472
+ height: 100%;
473
+ }.flex-container[data-v-4ac728a4] {
474
+ width: 100%;
475
+ min-height: 42px;
476
+ }
477
+ .flex-container[data-v-4ac728a4] .ant-form-item {
478
+ margin-bottom: 0;
479
+ }.form-widget[data-v-4c8924c1] {
441
480
  width: 100%;
442
481
  min-height: 60px;
443
482
  }.grid-cell[data-v-598209c1] {
@@ -490,11 +529,16 @@
490
529
  .page-template-widget[data-v-dc2a06fa] .addInfoLayout-footer .ant-form-item {
491
530
  margin-bottom: 0;
492
531
  }
493
- .loading-wrapper[data-v-039c10e2] {
532
+ .layout-render-wrapper[data-v-464184f3] {
533
+ overflow-y: auto;
534
+ overflow-x: hidden;
535
+ background: var(--4a7fb80b);
536
+ }
537
+ .loading-wrapper[data-v-464184f3] {
494
538
  min-height: 300px;
495
539
  padding: 20px;
496
540
  }
497
- .ant-form .ant-form-item-explain.ant-form-item-explain-connected[data-v-039c10e2] {
541
+ .ant-form .ant-form-item-explain.ant-form-item-explain-connected[data-v-464184f3] {
498
542
  display: none;
499
543
  }
500
544
  /*$vite$:1*/
@@ -1,4 +1,4 @@
1
- import { Fragment, createBlock, createElementBlock, defineComponent, inject, mergeModels, openBlock, provide, renderList, resolveDynamicComponent, toRef, unref, useModel } from "vue";
1
+ import { Fragment, createBlock, createElementBlock, defineComponent, inject, mergeModels, normalizeStyle, openBlock, provide, renderList, resolveDynamicComponent, toRef, unref, useModel } from "vue";
2
2
  //#region ../core/src/components/common/render/RenderWidgetList.vue?vue&type=script&setup=true&lang.ts
3
3
  var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4
4
  inheritAttrs: false,
@@ -12,7 +12,8 @@ var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
12
12
  },
13
13
  allowTypes: { default: () => [] },
14
14
  notAllowTypes: { default: () => [] },
15
- parentWidget: {}
15
+ parentWidget: {},
16
+ itemStyle: {}
16
17
  }, {
17
18
  "list": {
18
19
  type: Array,
@@ -28,16 +29,17 @@ var RenderWidgetList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
28
29
  const list = useModel(__props, "list");
29
30
  return (_ctx, _cache) => {
30
31
  return openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (widget, index) => {
32
+ var _ctx$itemStyle;
31
33
  return openBlock(), createBlock(resolveDynamicComponent(unref(getWidget)(widget)), {
32
34
  key: `${widget.id}_${index}`,
33
35
  id: widget.id,
34
- stlyle: widget.style,
36
+ style: normalizeStyle([widget.style, (_ctx$itemStyle = _ctx.itemStyle) === null || _ctx$itemStyle === void 0 ? void 0 : _ctx$itemStyle.call(_ctx, widget, index)]),
35
37
  widget,
36
38
  field: widget,
37
39
  index
38
40
  }, null, 8, [
39
41
  "id",
40
- "stlyle",
42
+ "style",
41
43
  "widget",
42
44
  "field",
43
45
  "index"
@@ -26,6 +26,7 @@ var usePageContext = ({ props }) => {
26
26
  const childFormRef = ref();
27
27
  const serveList = computed(() => formConfig.value.serveList);
28
28
  const formWidgetId = Symbol("formWidget");
29
+ const formCustomCodeId = "vfRender" + generateId();
29
30
  const dialogOrDrawerRef = ref();
30
31
  const { context, execHttpFunction, asyncExecuteFunction } = useExecFunction();
31
32
  const { getPageInstance, getInstance, registerToRefList } = useAppRef(widgetRefList, formWidgetId);
@@ -122,16 +123,18 @@ var usePageContext = ({ props }) => {
122
123
  * @param formId 表单ID
123
124
  */
124
125
  const insertCustomCode = () => {
125
- const formId = "vfRender" + generateId();
126
126
  const { cssCode, functions } = formConfig.value;
127
- if (cssCode) insertCustomCssToHead(cssCode, formId || "");
128
- if (functions) insertGlobalFunctionsToHtml(functions, formId || "");
127
+ if (cssCode) insertCustomCssToHead(cssCode, formCustomCodeId);
128
+ else removeCustomCssToHead(formCustomCodeId);
129
+ if (functions) {
130
+ removeScriptToHead(formCustomCodeId);
131
+ insertGlobalFunctionsToHtml(functions, formCustomCodeId);
132
+ } else removeScriptToHead(formCustomCodeId);
129
133
  };
130
134
  const removeCustomCode = () => {
131
- const formId = "vfRender" + generateId();
132
135
  const { cssCode, functions } = formConfig.value;
133
- if (cssCode) removeCustomCssToHead(formId || "");
134
- if (functions) removeScriptToHead(formId || "");
136
+ if (cssCode) removeCustomCssToHead(formCustomCodeId);
137
+ if (functions) removeScriptToHead(formCustomCodeId);
135
138
  };
136
139
  const reload = () => {
137
140
  var _context$value;
@@ -153,7 +156,7 @@ var usePageContext = ({ props }) => {
153
156
  const getFieldValue = (field) => {
154
157
  return formDataModel.value[field];
155
158
  };
156
- const setFiledValue = (field, value) => {
159
+ const setFieldValue = (field, value) => {
157
160
  formDataModel.value[field] = value;
158
161
  };
159
162
  const setVfCtx = (vfCtx) => {
@@ -195,7 +198,7 @@ var usePageContext = ({ props }) => {
195
198
  setPageJson,
196
199
  setLoading,
197
200
  formDataModel,
198
- setFiledValue,
201
+ setFieldValue,
199
202
  isLoading,
200
203
  vfCtx: props.vfCtx,
201
204
  formConfig,
@@ -1,5 +1,5 @@
1
1
  import { useI18n } from "../utils/i18n.js";
2
- import { computed, getCurrentInstance, inject, ref } from "vue";
2
+ import { computed, getCurrentInstance, inject, proxyRefs, ref } from "vue";
3
3
  import { message } from "ant-design-vue";
4
4
  //#region ../core/src/hooks/useAppRef.ts
5
5
  function useAppRef(widgetRefList, formWidgetId) {
@@ -18,12 +18,14 @@ function useAppRef(widgetRefList, formWidgetId) {
18
18
  return foundRef;
19
19
  };
20
20
  const registerToRefList = (widgetName) => {
21
- (isRoot ? widgetRefList === null || widgetRefList === void 0 ? void 0 : widgetRefList.value : refList.value).set(widgetName || widgetId.value, {
21
+ const list = isRoot ? widgetRefList === null || widgetRefList === void 0 ? void 0 : widgetRefList.value : refList.value;
22
+ const exposed = {
22
23
  instance,
23
24
  proxy: instance === null || instance === void 0 ? void 0 : instance.proxy,
24
25
  ...instance === null || instance === void 0 ? void 0 : instance.appContext.config.globalProperties,
25
26
  ...instance === null || instance === void 0 ? void 0 : instance.exposed
26
- });
27
+ };
28
+ list.set(widgetName || widgetId.value, proxyRefs(exposed));
27
29
  };
28
30
  /**
29
31
  * 从引用列表中注销
@@ -202,10 +202,6 @@ function useField(widget) {
202
202
  if (eq(fieldModel.value, newValue)) return;
203
203
  const oldValue = deepClone(fieldModel.value);
204
204
  if (widget.type === "file-upload") newValue = showFileList(newValue || []);
205
- else if (widget.type === "code-editor") {
206
- var _getFieldEditor;
207
- (_getFieldEditor = getFieldEditor()) === null || _getFieldEditor === void 0 || _getFieldEditor.setValue(newValue);
208
- }
209
205
  fieldModel.value = newValue;
210
206
  if (!disableChangeEvent) emitFieldDataChange(newValue, oldValue);
211
207
  };
@@ -15,23 +15,24 @@ function useFieldRules({ widget, getPropName, getPageInstance, designState }) {
15
15
  });
16
16
  /** 构建字段规则 */
17
17
  const buildFieldRules = () => {
18
- var _widget$props, _widget$validation, _widget$validation2, _widget$validation5, _widget$validation6;
18
+ var _widget$props, _widget$validation, _widget$events, _widget$validation2, _widget$validation3, _widget$validation6, _widget$validation8;
19
19
  if (!("formItemFlag" in widget) || !widget.formItemFlag || ((_widget$props = widget.props) === null || _widget$props === void 0 ? void 0 : _widget$props.hidden)) return;
20
20
  rules.value = [];
21
- if ((_widget$validation = widget.validation) === null || _widget$validation === void 0 ? void 0 : _widget$validation.required) rules.value.push({
21
+ const customValidate = ((_widget$validation = widget.validation) === null || _widget$validation === void 0 ? void 0 : _widget$validation.onValidate) || ((_widget$events = widget.events) === null || _widget$events === void 0 ? void 0 : _widget$events.onValidate);
22
+ if ((_widget$validation2 = widget.validation) === null || _widget$validation2 === void 0 ? void 0 : _widget$validation2.required) rules.value.push({
22
23
  required: true,
23
24
  trigger: ["blur"],
24
25
  message: widget.validation.requiredHint || i18nt("render.hint.fieldRequired")
25
26
  });
26
- if ((_widget$validation2 = widget.validation) === null || _widget$validation2 === void 0 ? void 0 : _widget$validation2.validation) {
27
- var _widget$validation3;
28
- const rulesFn = unref(rulesMap)[(_widget$validation3 = widget.validation) === null || _widget$validation3 === void 0 ? void 0 : _widget$validation3.validation];
27
+ if ((_widget$validation3 = widget.validation) === null || _widget$validation3 === void 0 ? void 0 : _widget$validation3.validation) {
28
+ var _widget$validation4;
29
+ const rulesFn = unref(rulesMap)[(_widget$validation4 = widget.validation) === null || _widget$validation4 === void 0 ? void 0 : _widget$validation4.validation];
29
30
  if (rulesFn) {
30
- var _widget$validation4;
31
- rules.value.push(rulesFn((_widget$validation4 = widget.validation) === null || _widget$validation4 === void 0 ? void 0 : _widget$validation4.validationHint));
31
+ var _widget$validation5;
32
+ rules.value.push(rulesFn((_widget$validation5 = widget.validation) === null || _widget$validation5 === void 0 ? void 0 : _widget$validation5.validationHint));
32
33
  }
33
34
  }
34
- (_widget$validation5 = widget.validation) === null || _widget$validation5 === void 0 || (_widget$validation5 = _widget$validation5.rules) === null || _widget$validation5 === void 0 || _widget$validation5.forEach((rule) => {
35
+ (_widget$validation6 = widget.validation) === null || _widget$validation6 === void 0 || (_widget$validation6 = _widget$validation6.rules) === null || _widget$validation6 === void 0 || _widget$validation6.forEach((rule) => {
35
36
  if (rule.type === "pattern" && rule.value) rules.value.push({
36
37
  pattern: new RegExp(rule.value),
37
38
  trigger: rule.trigger || ["blur", "change"],
@@ -42,7 +43,33 @@ function useFieldRules({ widget, getPropName, getPageInstance, designState }) {
42
43
  trigger: rule.trigger || ["blur"]
43
44
  });
44
45
  });
45
- if ((_widget$validation6 = widget.validation) === null || _widget$validation6 === void 0 ? void 0 : _widget$validation6.rules) {}
46
+ if (customValidate) rules.value.push({
47
+ validator: async (rule, value) => {
48
+ let executeError;
49
+ let result = await Promise.resolve(executeFunction({
50
+ functionBody: customValidate,
51
+ params: {
52
+ rule,
53
+ value
54
+ },
55
+ keys: ["rule", "value"],
56
+ errorCallback: (error) => {
57
+ executeError = error;
58
+ }
59
+ }));
60
+ if (typeof result === "function") result = await result();
61
+ if (executeError) return Promise.reject(executeError);
62
+ if (result === false) {
63
+ var _widget$validation7;
64
+ return Promise.reject(new Error(((_widget$validation7 = widget.validation) === null || _widget$validation7 === void 0 ? void 0 : _widget$validation7.validationHint) || rule.message || ""));
65
+ }
66
+ if (typeof result === "string") return Promise.reject(new Error(result));
67
+ if (result instanceof Error) return Promise.reject(result);
68
+ return Promise.resolve();
69
+ },
70
+ trigger: ["blur", "change"]
71
+ });
72
+ if ((_widget$validation8 = widget.validation) === null || _widget$validation8 === void 0 ? void 0 : _widget$validation8.rules) {}
46
73
  };
47
74
  /** 清除字段规则 */
48
75
  const clearFieldRules = () => {
@@ -2,7 +2,6 @@ import { ref } from "vue";
2
2
  import { message } from "ant-design-vue";
3
3
  import { http, routerReloadStatus, useDataQueryApi, useRouteBackTab } from "tmgc2-share";
4
4
  import { cloneDeep } from "lodash-es";
5
- import { getLocat } from "@kp-ui/tool";
6
5
  //#region ../core/src/hooks/useLowcode.ts
7
6
  var defaultPageJson = {
8
7
  widgetList: [],
@@ -12,25 +11,25 @@ var pageJsonCache = /* @__PURE__ */ new Map();
12
11
  var pageJsonRequestCache = /* @__PURE__ */ new Map();
13
12
  var normalizePageJson = (json) => ({
14
13
  ...defaultPageJson,
15
- ...json || {}
14
+ ...json
16
15
  });
17
- var getCachedPageJson = (formCode, useDataQuery) => {
18
- const cached = pageJsonCache.get(formCode);
16
+ var getCachedPageJson = (pageCode, useDataQuery) => {
17
+ const cached = pageJsonCache.get(pageCode);
19
18
  if (cached) return Promise.resolve(cached);
20
- const pending = pageJsonRequestCache.get(formCode);
19
+ const pending = pageJsonRequestCache.get(pageCode);
21
20
  if (pending) return pending;
22
- const request = useDataQuery.dataQueryDetail({ code: formCode }, "FormDefinitionV2").then((res) => {
21
+ const request = useDataQuery.dataQueryDetail({ code: pageCode }, "FormDefinitionV2").then((res) => {
23
22
  const data = res.data.object || {};
24
23
  const cache = {
25
24
  formId: data.formId,
26
25
  json: normalizePageJson(JSON.parse(data.frontendDefinition || "{}"))
27
26
  };
28
- pageJsonCache.set(formCode, cache);
27
+ pageJsonCache.set(pageCode, cache);
29
28
  return cache;
30
29
  }).finally(() => {
31
- pageJsonRequestCache.delete(formCode);
30
+ pageJsonRequestCache.delete(pageCode);
32
31
  });
33
- pageJsonRequestCache.set(formCode, request);
32
+ pageJsonRequestCache.set(pageCode, request);
34
33
  return request;
35
34
  };
36
35
  var useLowcode = (options = {}) => {
@@ -40,14 +39,16 @@ var useLowcode = (options = {}) => {
40
39
  const formId = ref();
41
40
  const formConfig = ref();
42
41
  const { routeBackTab } = useRouteBackTab();
43
- const getPageJson = async (formCode) => {
42
+ const pageCode = ref(options.pageCode || "");
43
+ const getPageJson = async (_pageCode) => {
44
44
  let json = cloneDeep(defaultPageJson);
45
- formCode = formCode || options.formCode || getLocat().formCode;
46
- if (formCode) {
45
+ pageCode.value = _pageCode || options.pageCode || "";
46
+ console.log(pageCode.value);
47
+ if (pageCode.value) {
47
48
  var _vfdRef$value;
48
49
  (_vfdRef$value = vfdRef.value) === null || _vfdRef$value === void 0 || _vfdRef$value.setLoading(true);
49
50
  try {
50
- const cache = await getCachedPageJson(formCode, useDataQuery);
51
+ const cache = await getCachedPageJson(pageCode.value, useDataQuery);
51
52
  json = cloneDeep(cache.json);
52
53
  formId.value = cache.formId;
53
54
  } finally {
@@ -60,7 +61,7 @@ var useLowcode = (options = {}) => {
60
61
  vfdRef.value.setPageJson(json);
61
62
  return json;
62
63
  };
63
- const getComponentJson = async (..._args) => getPageJson(options.formCode);
64
+ const getComponentJson = async (..._args) => getPageJson(options.pageCode);
64
65
  const getFieldList = async (entityCode) => {
65
66
  isLoading.value = true;
66
67
  const p = {
@@ -91,14 +92,13 @@ var useLowcode = (options = {}) => {
91
92
  routeBackTab(reloadStatus, cb);
92
93
  };
93
94
  const saveJsonApi = async (json) => {
94
- const { formCode } = getLocat();
95
95
  const params = {
96
- formCode,
96
+ pageCode: pageCode.value,
97
97
  formId: formId.value,
98
98
  frontendDefinition: JSON.stringify(json)
99
99
  };
100
100
  await http.post(`/api/tmgc2-mgt/formDefinition/formDefinitionV2/save`, params);
101
- if (formCode) pageJsonCache.set(formCode, {
101
+ if (pageCode.value) pageJsonCache.set(pageCode.value, {
102
102
  formId: formId.value,
103
103
  json: normalizePageJson(cloneDeep(json))
104
104
  });
@@ -1,7 +1,7 @@
1
1
  import { usePagination } from "./usePagination.js";
2
2
  import { computed, ref, watch } from "vue";
3
3
  import { useExecFunction } from "tmgc2-share";
4
- import { debounce } from "lodash-es";
4
+ import { debounce, isArray } from "lodash-es";
5
5
  //#region ../core/src/hooks/useRemoteData.ts
6
6
  function useRemoteData({ widget, onLoaded, formConfig }) {
7
7
  var _widget$dataSource;
@@ -68,8 +68,9 @@ function useRemoteData({ widget, onLoaded, formConfig }) {
68
68
  pagination.value.total = result.total || 0;
69
69
  pagination.value.totalPage = result.totalPage || 0;
70
70
  }
71
- data.value = result.list;
72
- onLoaded === null || onLoaded === void 0 || onLoaded(result);
71
+ if (isArray(result)) data.value = result;
72
+ else data.value = result.list;
73
+ onLoaded === null || onLoaded === void 0 || onLoaded(data.value);
73
74
  } catch (err) {
74
75
  console.error("remote data load error:", err);
75
76
  } finally {
@@ -12,18 +12,9 @@ function findInArray(arrayObject, element) {
12
12
  }
13
13
  function useSelect({ widget, designState, fieldModel, formConfig }) {
14
14
  const keyword = ref({ val: "" });
15
- const apiResult = ref({ list: [] });
16
- const onLoaded = (result) => {
17
- const data = result.data || {};
18
- if (data) apiResult.value = isArray(data) ? { list: [...unref(apiResult).list, ...data] } : {
19
- ...data,
20
- list: [...unref(apiResult).list, ...data.list]
21
- };
22
- };
23
- const { loadData, loadMore, refresh, data, pager, loading } = useRemoteData({
15
+ const { loadData, loadMore, refresh, data, pagination, loading } = useRemoteData({
24
16
  widget,
25
17
  designState,
26
- onLoaded,
27
18
  formConfig
28
19
  });
29
20
  const mapping = computed(() => {
@@ -57,7 +48,6 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
57
48
  keyword.value.val = _keyword;
58
49
  };
59
50
  const selectOps = computed(() => {
60
- var _apiResult$value;
61
51
  const showSearch = true;
62
52
  const useServer = widget.props.showSearch;
63
53
  return {
@@ -68,7 +58,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
68
58
  onSearch: remoteQuery,
69
59
  filterOption: !useServer && filterOption,
70
60
  listHeight: 240,
71
- options: cloneDeep(((_apiResult$value = apiResult.value) === null || _apiResult$value === void 0 ? void 0 : _apiResult$value.list) || [])
61
+ options: cloneDeep(data.value) || []
72
62
  };
73
63
  });
74
64
  const getOptionItems = () => {
@@ -106,6 +96,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
106
96
  };
107
97
  return {
108
98
  selectDefineExpose: {
99
+ loadData,
109
100
  loadOptions: loadData,
110
101
  initOptionItems: loadData,
111
102
  getSelectedItem,
@@ -128,7 +119,7 @@ function useSelect({ widget, designState, fieldModel, formConfig }) {
128
119
  optionLabel,
129
120
  filterOption,
130
121
  keyword,
131
- pager,
122
+ pager: pagination,
132
123
  loading,
133
124
  selectOps,
134
125
  initOptionItems: loadData,
@@ -45,6 +45,7 @@ var en_US_default = {
45
45
  popover: "Popover",
46
46
  "custom-render": "Custom Render",
47
47
  space: "Space",
48
+ flex: "Flex",
48
49
  image: "Image",
49
50
  cell: "Cell",
50
51
  input: "Input",
@@ -209,6 +210,7 @@ var en_US_default = {
209
210
  alignEnd: "End",
210
211
  alignCenter: "Center",
211
212
  alignBaseline: "Baseline",
213
+ alignStretch: "Stretch",
212
214
  wrap: "Wrap",
213
215
  fill: "Fill",
214
216
  defaultExpand: "Default Expand",
@@ -231,6 +233,7 @@ var en_US_default = {
231
233
  buttonListConfig: "Button Group Config",
232
234
  buttonPosition: "Position",
233
235
  autoWidth: "Auto Width",
236
+ autoHeight: "Auto Height",
234
237
  dataSoureEdit: "dataSoure Edit",
235
238
  fixed: "Fixed Position",
236
239
  fixedRight: "Fixed Right",
@@ -344,9 +347,12 @@ var en_US_default = {
344
347
  gridJustify: "Horizontal Align",
345
348
  justifyStart: "Start",
346
349
  justifyEnd: "End",
350
+ justifyFlexStart: "Flex Start",
351
+ justifyFlexEnd: "Flex End",
347
352
  justifyCenter: "Center",
348
353
  justifySpaceAround: "Space Around",
349
354
  justifySpaceBetween: "Space Between",
355
+ justifySpaceEvenly: "Space Evenly",
350
356
  gridAlign: "Vertical Align",
351
357
  alignTop: "Top",
352
358
  alignCenter: "Center",
@@ -426,6 +432,14 @@ var en_US_default = {
426
432
  leftAlign: "Left",
427
433
  centerAlign: "Center",
428
434
  rightAlign: "Right",
435
+ rowReverse: "Row Reverse",
436
+ columnReverse: "Column Reverse",
437
+ flexHeightMode: "Height Mode",
438
+ inheritHeight: "Inherit",
439
+ fixedHeight: "Fixed",
440
+ flexHeight: "Fixed Height",
441
+ componentSort: "Component Sort",
442
+ noSortableComponents: "No sortable components",
429
443
  formCss: "Form CSS",
430
444
  addCss: "Edit",
431
445
  customClass: "Custom Class",
@@ -452,6 +466,7 @@ var en_US_default = {
452
466
  drawDirection: "Direction",
453
467
  tableWidth: "Width(px/%)",
454
468
  tableHeight: "Height(px/%)",
469
+ tableHeightMode: "Height Mode",
455
470
  showCheckBox: "Show CheckBox",
456
471
  showColumnManager: "Column Manager",
457
472
  showIndex: "Show Row Number",
@@ -611,8 +626,15 @@ var en_US_default = {
611
626
  justifyContent: "Justify Content",
612
627
  alignItems: "Align Items",
613
628
  flexWrap: "Flex Wrap",
629
+ flexBlockConfig: "Block Config",
614
630
  flexGrow: "Flex Grow",
615
631
  flexShrink: "Flex Shrink",
632
+ flexItemWidthMode: "Item Width",
633
+ flexItemWidth: "Fixed Width",
634
+ fixedWidth: "Fixed",
635
+ fullWidth: "Full",
636
+ flexItemWidthPlaceholder: "e.g. 240px, 50%, calc(50% - 8px)",
637
+ flexItemHeightPlaceholder: "e.g. 240px, 50%, calc(100% - 8px)",
616
638
  gap: "Gap",
617
639
  positionOffset: "Position Offset",
618
640
  top: "Top",