@kp-ui/lowcode 1.0.41 → 1.0.43

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 (58) hide show
  1. package/_virtual/virtual_svg-icons-register.js +2 -2
  2. package/designer.js +13 -22
  3. package/index.js +6 -2
  4. package/package.json +28 -28
  5. package/render.js +58 -6
  6. package/src/components/form-designer/designer.js +16 -11
  7. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +1 -1
  8. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +0 -1
  9. package/src/components/form-designer/form-widget/field-widget/button-list-widget.vue.js +149 -0
  10. package/src/components/form-designer/form-widget/field-widget/index.js +1 -1
  11. package/src/components/form-designer/setting-panel/form-setting.vue.js +114 -152
  12. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue.js +276 -11
  13. package/src/components/form-designer/setting-panel/property-editor/button-postion-editor.vue.js +23 -0
  14. package/src/components/form-designer/setting-panel/property-editor/button-postion-editor.vue2.js +16 -0
  15. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +5 -3
  16. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +193 -223
  17. package/src/components/form-designer/setting-panel/property-editor/flex-editor.vue.js +64 -0
  18. package/src/components/form-designer/setting-panel/property-editor/index.js +3 -1
  19. package/src/components/form-designer/setting-panel/propertyRegister.js +3 -1
  20. package/src/components/form-designer/toolbar-panel/index.vue.js +2 -1
  21. package/src/components/form-designer/widget-panel/advancedFieldsEnums.js +0 -2
  22. package/src/components/form-designer/widget-panel/{advanced/toolbar.js → basicFields/buttonList.js} +5 -4
  23. package/src/components/form-designer/widget-panel/basicFieldsEnums.js +2 -0
  24. package/src/components/form-render/SubmitButtonRender.vue.js +108 -0
  25. package/src/components/form-render/SubmitButtonRender.vue2.js +4 -0
  26. package/src/components/form-render/container-item/data-table-item.vue.js +1 -2
  27. package/src/components/form-render/dynamic-dialog.vue.js +87 -33
  28. package/src/components/public/methoad-item.vue.js +132 -0
  29. package/src/components/public/methoad-item.vue2.js +4 -0
  30. package/src/constants/index.js +13 -0
  31. package/src/lang/en-US.js +1 -0
  32. package/src/lang/zh-CN.js +4 -0
  33. package/src/utils/i18n.js +2 -2
  34. package/src/utils/smart-vue-i18n/index.js +1 -1
  35. package/src/utils/util.js +6 -0
  36. package/styles/style.css +1 -1
  37. package/types/install.d.ts +3 -1
  38. package/types/install.d.ts.map +1 -1
  39. package/types/src/components/form-designer/index.d.ts +1 -3
  40. package/types/src/components/form-designer/index.d.ts.map +1 -1
  41. package/types/src/components/form-designer/setting-panel/index.d.ts +2 -0
  42. package/types/src/components/form-designer/widget-panel/advanced/index.d.ts +1 -1
  43. package/types/src/components/form-designer/widget-panel/advanced/index.d.ts.map +1 -1
  44. package/types/src/components/form-designer/widget-panel/advancedFieldsEnums.d.ts +0 -8
  45. package/types/src/components/form-designer/widget-panel/advancedFieldsEnums.d.ts.map +1 -1
  46. package/types/src/components/form-designer/widget-panel/{advanced/toolbar.d.ts → basicFields/buttonList.d.ts} +2 -2
  47. package/types/src/components/form-designer/widget-panel/basicFields/buttonList.d.ts.map +1 -0
  48. package/types/src/components/form-render/SubmitButtonRender.d.ts +58 -0
  49. package/types/src/components/form-render/SubmitButtonRender.d.ts.map +1 -0
  50. package/types/src/components/form-render/index.d.ts +15 -1
  51. package/types/src/components/form-render/index.d.ts.map +1 -1
  52. package/types/src/constants/index.d.ts +4 -0
  53. package/types/src/constants/index.d.ts.map +1 -1
  54. package/src/components/BtnListConfig/BtnListConfigDialog.vue.js +0 -80
  55. package/src/components/BtnListConfig/BtnListConfigDialog.vue2.js +0 -4
  56. package/src/components/form-designer/form-widget/field-widget/toolbar-widget.vue.js +0 -94
  57. package/src/utils/config.js +0 -4
  58. package/types/src/components/form-designer/widget-panel/advanced/toolbar.d.ts.map +0 -1
@@ -1,13 +1,13 @@
1
1
  if (typeof window !== "undefined") {
2
2
  let loadSvg = function() {
3
3
  var body = document.body;
4
- var svgDom = document.getElementById("__svg__icons__dom__1747363768276__");
4
+ var svgDom = document.getElementById("__svg__icons__dom__1747706782590__");
5
5
  if (!svgDom) {
6
6
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
7
7
  svgDom.style.position = "absolute";
8
8
  svgDom.style.width = "0";
9
9
  svgDom.style.height = "0";
10
- svgDom.id = "__svg__icons__dom__1747363768276__";
10
+ svgDom.id = "__svg__icons__dom__1747706782590__";
11
11
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
12
12
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
13
13
  }
package/designer.js CHANGED
@@ -4,10 +4,9 @@ import SettingPanel from "./src/components/form-designer/setting-panel/index.vue
4
4
  import VFormWidget from "./src/components/form-designer/form-widget/index.vue.js";
5
5
  import { createDesigner } from "./src/components/form-designer/designer.js";
6
6
  import { traverseAllWidgets, getAllContainerWidgets, getAllFieldWidgets, deepClone, addWindowResizeHandler } from "./src/utils/util.js";
7
- import { VARIANT_FORM_VERSION } from "./src/utils/config.js";
8
7
  import i18n, { changeLocale } from "./src/utils/i18n.js";
9
8
  import { isEmpty } from "lodash-es";
10
- import { resolveComponent, createBlock, openBlock, withCtx, createCommentVNode, createVNode, createSlots, renderList, renderSlot, createElementVNode } from "vue";
9
+ import { resolveComponent, createBlock, openBlock, withCtx, createVNode, createSlots, renderList, renderSlot, createElementVNode } from "vue";
11
10
  /* empty css */
12
11
  import _export_sfc from "./_virtual/_plugin-vue_export-helper.js";
13
12
  const _sfc_main = {
@@ -81,7 +80,6 @@ const _sfc_main = {
81
80
  return {
82
81
  leftWidth: 270,
83
82
  rightWidth: 300,
84
- vFormVersion: VARIANT_FORM_VERSION,
85
83
  curLangName: "",
86
84
  curLocale: "",
87
85
  isLoading: false,
@@ -192,8 +190,11 @@ const _sfc_main = {
192
190
  return;
193
191
  }
194
192
  },
193
+ changeLanguage(langName) {
194
+ changeLocale(langName);
195
+ },
195
196
  initLocale() {
196
- this.curLocale = localStorage.getItem("v_form_locale");
197
+ this.curLocale = localStorage.getItem("lowcode_local");
197
198
  if (!!this.vsCodeFlag) {
198
199
  this.curLocale = this.curLocale || "en-US";
199
200
  } else {
@@ -209,13 +210,6 @@ const _sfc_main = {
209
210
  this.fieldList = await this.fieldListApi();
210
211
  console.log("this.fieldList: ", this.fieldList);
211
212
  },
212
- handleLanguageChanged(command) {
213
- this.changeLanguage(command);
214
- this.curLangName = this.i18nt("application." + command);
215
- },
216
- changeLanguage(langName) {
217
- changeLocale(langName);
218
- },
219
213
  setFormJson(formJson) {
220
214
  console.log("formJson: ", formJson);
221
215
  let modifiedFlag = false;
@@ -346,21 +340,18 @@ const _sfc_main = {
346
340
  //TODO: 增加更多方法!!
347
341
  }
348
342
  };
349
- const _hoisted_4 = { class: "container-scroll-bar" };
343
+ const _hoisted_1 = { class: "container-scroll-bar" };
350
344
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
351
- resolveComponent("a-select-option");
352
- resolveComponent("a-select");
353
- const _component_a_layout_header = resolveComponent("a-layout-header");
354
- const _component_widget_panel = resolveComponent("widget-panel");
345
+ const _component_WidgetPanel = resolveComponent("WidgetPanel");
355
346
  const _component_a_layout_sider = resolveComponent("a-layout-sider");
356
347
  const _component_toolbar_panel = resolveComponent("toolbar-panel");
357
- const _component_v_form_widget = resolveComponent("v-form-widget");
348
+ const _component_a_layout_header = resolveComponent("a-layout-header");
349
+ const _component_VFormWidget = resolveComponent("VFormWidget");
358
350
  const _component_a_layout_content = resolveComponent("a-layout-content");
359
351
  const _component_setting_panel = resolveComponent("setting-panel");
360
352
  const _component_a_layout = resolveComponent("a-layout");
361
353
  return openBlock(), createBlock(_component_a_layout, { class: "main-container full-height" }, {
362
354
  default: withCtx(() => [
363
- createCommentVNode("", true),
364
355
  createVNode(_component_a_layout, null, {
365
356
  default: withCtx(() => [
366
357
  createVNode(_component_a_layout_sider, {
@@ -368,7 +359,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
368
359
  class: "side-panel"
369
360
  }, {
370
361
  default: withCtx(() => [
371
- createVNode(_component_widget_panel, { designer: $data.designer }, null, 8, ["designer"])
362
+ createVNode(_component_WidgetPanel, { designer: $data.designer }, null, 8, ["designer"])
372
363
  ]),
373
364
  _: 1
374
365
  }, 8, ["width"]),
@@ -400,8 +391,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
400
391
  }),
401
392
  createVNode(_component_a_layout_content, { class: "form-widget-main" }, {
402
393
  default: withCtx(() => [
403
- createElementVNode("div", _hoisted_4, [
404
- createVNode(_component_v_form_widget, {
394
+ createElementVNode("div", _hoisted_1, [
395
+ createVNode(_component_VFormWidget, {
405
396
  designer: $data.designer,
406
397
  "form-config": $data.designer.formConfig,
407
398
  "global-dsv": $props.globalDsv,
@@ -433,7 +424,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
433
424
  _: 3
434
425
  });
435
426
  }
436
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e87dd64c"]]);
427
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-03be64be"]]);
437
428
  export {
438
429
  index as default
439
430
  };
package/index.js CHANGED
@@ -16,7 +16,9 @@ import { default as default10 } from "./src/components/form-render/container-ite
16
16
  import { default as default11 } from "./src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue.js";
17
17
  import { default as default12 } from "./src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js";
18
18
  import { default as default13 } from "./src/components/form-designer/form-widget/field-widget/fieldMixin.js";
19
- import { default as default14 } from "./src/utils/emitter.js";
19
+ import { default as default14 } from "./src/components/form-render/dynamic-dialog.vue.js";
20
+ import { default as default15 } from "./src/components/form-render/SubmitButtonRender.vue.js";
21
+ import { default as default16 } from "./src/utils/emitter.js";
20
22
  const registerLowcodeCore = (params) => {
21
23
  const { app, http, factoryRender } = params;
22
24
  app.config.globalProperties.$http = http;
@@ -33,9 +35,11 @@ const registerLowcodeCore = (params) => {
33
35
  export {
34
36
  default9 as ContainerItemWrapper,
35
37
  default5 as ContainerWrapper,
38
+ default14 as DynamicDialog,
36
39
  default6 as FieldComponents,
37
40
  default12 as FormItemWrapper,
38
41
  default11 as StaticContentWrapper,
42
+ default15 as SubmitButtonRender,
39
43
  default2 as VFormDesigner,
40
44
  default3 as VFormRender,
41
45
  addAdvancedFieldSchema,
@@ -45,7 +49,7 @@ export {
45
49
  basicFieldsEnums,
46
50
  default10 as containerItemMixin,
47
51
  default4 as containerMixin,
48
- default14 as emitter,
52
+ default16 as emitter,
49
53
  default13 as fieldMixin,
50
54
  default8 as refMixin,
51
55
  default7 as refMixinDesign,
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
- "name": "@kp-ui/lowcode",
3
- "version": "1.0.41",
4
- "publishConfig": {
5
- "access": "public"
6
- },
7
- "main": "index.js",
8
- "module": "index.js",
9
- "types": "main.d.ts",
10
- "dependencies": {
11
- "@element-plus/icons-vue": "^0.2.4",
12
- "@kp-ui/tool": "1.0.24",
13
- "@surely-vue/table": "^5.0.3",
14
- "animate.css": "^4.1.1",
15
- "ant-design-vue": "3.2.20",
16
- "axios": "^1.3.5",
17
- "bpmn-js": "13.2.0",
18
- "clipboard": "^2.0.8",
19
- "core-js": "^3.6.5",
20
- "dayjs": "^1.11.10",
21
- "file-saver": "^2.0.5",
22
- "json-bigint": "^1.0.0",
23
- "lodash-es": "^4.17.21",
24
- "mitt": "^3.0.0",
25
- "query-string": "^9.1.1",
26
- "sortablejs": "1.14.0",
27
- "vue": "3.3.11",
28
- "vue3-quill": "^0.2.6"
29
- }
2
+ "name": "@kp-ui/lowcode",
3
+ "version": "1.0.43",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "main": "index.js",
8
+ "module": "index.js",
9
+ "types": "main.d.ts",
10
+ "dependencies": {
11
+ "@element-plus/icons-vue": "^0.2.4",
12
+ "@kp-ui/tool": "1.0.24",
13
+ "@surely-vue/table": "^5.0.3",
14
+ "animate.css": "^4.1.1",
15
+ "ant-design-vue": "3.2.20",
16
+ "axios": "^1.3.5",
17
+ "bpmn-js": "13.2.0",
18
+ "clipboard": "^2.0.8",
19
+ "core-js": "^3.6.5",
20
+ "dayjs": "^1.11.10",
21
+ "file-saver": "^2.0.5",
22
+ "json-bigint": "^1.0.0",
23
+ "lodash-es": "^4.17.21",
24
+ "mitt": "^3.0.0",
25
+ "query-string": "^9.1.1",
26
+ "sortablejs": "1.14.0",
27
+ "vue": "3.3.11",
28
+ "vue3-quill": "^0.2.6"
29
+ }
30
30
  }
package/render.js CHANGED
@@ -92,6 +92,10 @@ const _sfc_main = {
92
92
  },
93
93
  data() {
94
94
  return {
95
+ isClosing: false,
96
+ //是否正在关闭
97
+ isSubmitting: false,
98
+ //是否正在提交中
95
99
  formJsonObj: this.formJson,
96
100
  formDataModel: {
97
101
  //
@@ -118,6 +122,12 @@ const _sfc_main = {
118
122
  formConfig() {
119
123
  return this.formJsonObj.formConfig;
120
124
  },
125
+ cancelBtnLabel() {
126
+ return this.formConfig.cancelButtonLabel || this.i18nt("designer.hint.cancel");
127
+ },
128
+ okBtnLabel() {
129
+ return this.formConfig.okButtonLabel || this.i18nt("designer.hint.confirm");
130
+ },
121
131
  widgetList() {
122
132
  return this.formJsonObj.widgetList;
123
133
  },
@@ -159,8 +169,44 @@ const _sfc_main = {
159
169
  setLoading(flag) {
160
170
  this.isLoading = flag;
161
171
  },
162
- setGlobalMethod() {
163
- console.log(this);
172
+ handleCancelClick() {
173
+ if (this.isClosing) return;
174
+ if (!this.handleBeforeClose()) return;
175
+ try {
176
+ this.isClosing = true;
177
+ if (!!this.formConfig.onCancelButtonClick) {
178
+ const customFn = new Function(this.formConfig.onCancelButtonClick);
179
+ const clickResult = customFn.call(this);
180
+ if (clickResult === false) {
181
+ return;
182
+ }
183
+ }
184
+ this.dialogVisible = false;
185
+ setTimeout(this.deleteWrapperNode, 150);
186
+ } catch (error) {
187
+ console.log("error: ", error);
188
+ } finally {
189
+ this.isClosing = false;
190
+ }
191
+ },
192
+ async handleOkClick() {
193
+ if (this.isSubmitting) return;
194
+ try {
195
+ this.isSubmitting = true;
196
+ if (!!this.formConfig.onOkButtonClick) {
197
+ const customFn = new Function(this.formConfig.onOkButtonClick);
198
+ const clickResult = await customFn.call(this);
199
+ if (clickResult === false) {
200
+ return;
201
+ }
202
+ }
203
+ this.dialogVisible = false;
204
+ setTimeout(this.deleteWrapperNode, 150);
205
+ } catch (error) {
206
+ console.log("error: ", error);
207
+ } finally {
208
+ this.isClosing = false;
209
+ }
164
210
  },
165
211
  async onFormDetail() {
166
212
  var _a;
@@ -195,7 +241,7 @@ const _sfc_main = {
195
241
  this.addFieldValidateEventHandler();
196
242
  this.registerFormToRefList();
197
243
  this.handleOnCreated();
198
- if (!!this.disabledMode) {
244
+ if (this.disabledMode) {
199
245
  this.$nextTick(() => {
200
246
  this.disableForm();
201
247
  });
@@ -211,7 +257,7 @@ const _sfc_main = {
211
257
  return widget.type + "-widget";
212
258
  },
213
259
  initLocale() {
214
- const curLocale = localStorage.getItem("v_form_locale") || "zh-CN";
260
+ const curLocale = localStorage.getItem("lowcode_local") || "zh-CN";
215
261
  this.changeLanguage(curLocale);
216
262
  },
217
263
  insertCustomStyleAndScriptNode() {
@@ -388,6 +434,12 @@ const _sfc_main = {
388
434
  customFunc.call(this);
389
435
  }
390
436
  },
437
+ handleOnSubmit() {
438
+ if (!!this.formConfig && !!this.formConfig.handleOnSubmit) {
439
+ const customFunc = new Function(this.formConfig.handleOnSubmit);
440
+ customFunc.call(this);
441
+ }
442
+ },
391
443
  handleOnMounted() {
392
444
  if (!!this.formConfig && !!this.formConfig.onFormMounted) {
393
445
  const customFunc = new Function(this.formConfig.onFormMounted);
@@ -501,7 +553,7 @@ const _sfc_main = {
501
553
  changeLocale(langName);
502
554
  },
503
555
  getLanguageName() {
504
- return localStorage.getItem("v_form_locale") || "zh-CN";
556
+ return localStorage.getItem("lowcode_local") || "zh-CN";
505
557
  },
506
558
  getNativeForm() {
507
559
  return this.$refs["renderForm"];
@@ -1004,7 +1056,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1004
1056
  _: 3
1005
1057
  }, 8, ["component-size"]);
1006
1058
  }
1007
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-368508d7"]]);
1059
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-dffc3fa7"]]);
1008
1060
  export {
1009
1061
  index as default
1010
1062
  };
@@ -1,6 +1,5 @@
1
1
  import { deepClone, getDefaultFormConfig, generateId, overwriteObj } from "../../utils/util.js";
2
2
  import { containers, basicFields, advancedFields, customFields } from "./widget-panel/widgetsConfig.js";
3
- import { VARIANT_FORM_VERSION } from "../../utils/config.js";
4
3
  import eventBus from "../../utils/event-bus.js";
5
4
  function createDesigner(vueInstance) {
6
5
  const defaultFormConfig = deepClone(getDefaultFormConfig());
@@ -25,11 +24,6 @@ function createDesigner(vueInstance) {
25
24
  initDesigner(resetFormJson) {
26
25
  this.widgetList = [];
27
26
  this.formConfig = deepClone(defaultFormConfig);
28
- console.info(
29
- `%cVer${VARIANT_FORM_VERSION} %chttps://www.yuque.com/visualdev/vform3`,
30
- "color:#999;font-size: 12px",
31
- "color:#333"
32
- );
33
27
  if (!resetFormJson) {
34
28
  this.initHistoryData();
35
29
  }
@@ -369,7 +363,9 @@ function createDesigner(vueInstance) {
369
363
  }
370
364
  if (!!colArray[mergedColIdx].widgetList && colArray[mergedColIdx].widgetList.length > 0) {
371
365
  if (!colArray[remainedColIdx].widgetList || colArray[remainedColIdx].widgetList.length === 0) {
372
- colArray[remainedColIdx].widgetList = deepClone(colArray[mergedColIdx].widgetList);
366
+ colArray[remainedColIdx].widgetList = deepClone(
367
+ colArray[mergedColIdx].widgetList
368
+ );
373
369
  }
374
370
  }
375
371
  const newColspan = colArray[mergedColIdx].options.colspan * 1 + colArray[remainedColIdx].options.colspan * 1;
@@ -513,7 +509,9 @@ function createDesigner(vueInstance) {
513
509
  }
514
510
  if (unmatchedFlag) {
515
511
  this.vueInstance.$message.info(
516
- this.vueInstance.i18nt("designer.hint.colspanNotConsistentForDeleteEntireColumn")
512
+ this.vueInstance.i18nt(
513
+ "designer.hint.colspanNotConsistentForDeleteEntireColumn"
514
+ )
517
515
  );
518
516
  return;
519
517
  }
@@ -651,7 +649,9 @@ function createDesigner(vueInstance) {
651
649
  moveUpWidget(parentList, indexOfParentList) {
652
650
  if (!!parentList) {
653
651
  if (indexOfParentList === 0) {
654
- this.vueInstance.$message(this.vueInstance.i18nt("designer.hint.moveUpFirstChildHint"));
652
+ this.vueInstance.$message(
653
+ this.vueInstance.i18nt("designer.hint.moveUpFirstChildHint")
654
+ );
655
655
  return;
656
656
  }
657
657
  const tempWidget = parentList[indexOfParentList];
@@ -662,7 +662,9 @@ function createDesigner(vueInstance) {
662
662
  moveDownWidget(parentList, indexOfParentList) {
663
663
  if (!!parentList) {
664
664
  if (indexOfParentList === parentList.length - 1) {
665
- this.vueInstance.$message(this.vueInstance.i18nt("designer.hint.moveDownLastChildHint"));
665
+ this.vueInstance.$message(
666
+ this.vueInstance.i18nt("designer.hint.moveDownLastChildHint")
667
+ );
666
668
  return;
667
669
  }
668
670
  const tempWidget = parentList[indexOfParentList];
@@ -812,7 +814,10 @@ function createDesigner(vueInstance) {
812
814
  };
813
815
  this.saveFormContentToStorage();
814
816
  if (this.historyData.index < this.historyData.steps.length - 1) {
815
- this.historyData.steps = this.historyData.steps.slice(0, this.historyData.index + 1);
817
+ this.historyData.steps = this.historyData.steps.slice(
818
+ 0,
819
+ this.historyData.index + 1
820
+ );
816
821
  }
817
822
  },
818
823
  saveCurrentHistoryStep() {
@@ -49,7 +49,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
49
49
  _: 1
50
50
  }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list", "style"]);
51
51
  }
52
- const dataTableWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2ac4c1d9"]]);
52
+ const dataTableWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3c2ed517"]]);
53
53
  export {
54
54
  dataTableWidget as default
55
55
  };
@@ -11,7 +11,6 @@ const _sfc_main = {
11
11
  mixins: [i18n, containerMixin, refMixinDesign, emitter, useDataTableMixin],
12
12
  inject: ["refList"],
13
13
  components: {
14
- STable,
15
14
  ContainerWrapper,
16
15
  ...comps
17
16
  },
@@ -0,0 +1,149 @@
1
+ import StaticContentWrapper from "./static-content-wrapper.vue.js";
2
+ import emitter from "../../../../utils/emitter.js";
3
+ import i18n from "../../../../utils/i18n.js";
4
+ import fieldMixin from "./fieldMixin.js";
5
+ import SvgIcon from "../../../svg-icon/index.vue.js";
6
+ import { resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeStyle, normalizeClass, createVNode, createElementBlock, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString } from "vue";
7
+ /* empty css */
8
+ import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
9
+ const _sfc_main = {
10
+ name: "button-list-widget",
11
+ componentName: "FieldWidget",
12
+ //必须固定为FieldWidget,用于接收父级组件的broadcast事件
13
+ mixins: [emitter, fieldMixin, i18n],
14
+ props: {
15
+ field: Object,
16
+ parentWidget: Object,
17
+ parentList: Array,
18
+ indexOfParentList: Number,
19
+ designer: Object,
20
+ designState: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ subFormRowIndex: {
25
+ /* 子表单组件行索引,从0开始计数 */
26
+ type: Number,
27
+ default: -1
28
+ },
29
+ subFormColIndex: {
30
+ /* 子表单组件列索引,从0开始计数 */
31
+ type: Number,
32
+ default: -1
33
+ },
34
+ subFormRowId: {
35
+ /* 子表单组件行Id,唯一id且不可变 */
36
+ type: String,
37
+ default: ""
38
+ }
39
+ },
40
+ data() {
41
+ return {};
42
+ },
43
+ components: {
44
+ SvgIcon,
45
+ StaticContentWrapper
46
+ },
47
+ computed: {
48
+ customClass() {
49
+ return this.field.options.customClass || [];
50
+ },
51
+ buttonList() {
52
+ return this.field.options.buttonList.filter((item) => !this.handleHidden(item));
53
+ }
54
+ },
55
+ beforeCreate() {
56
+ },
57
+ created() {
58
+ this.registerToRefList();
59
+ this.initEventHandler();
60
+ this.handleOnCreated();
61
+ },
62
+ mounted() {
63
+ this.handleOnMounted();
64
+ },
65
+ methods: {
66
+ hanldeClick(item) {
67
+ if (this.designState) {
68
+ return;
69
+ }
70
+ if (item.onClick) {
71
+ const customFn = new Function(item.onClick);
72
+ return customFn.call(this);
73
+ }
74
+ },
75
+ handleDisabled(item) {
76
+ const { onDisabled } = item;
77
+ if (onDisabled) {
78
+ const disabledFn = new Function(onDisabled);
79
+ return disabledFn.call(this);
80
+ }
81
+ return false;
82
+ },
83
+ handleHidden(item) {
84
+ const { onHidden } = item;
85
+ if (onHidden) {
86
+ const disabledFn = new Function(onHidden);
87
+ return disabledFn.call(this);
88
+ }
89
+ return false;
90
+ }
91
+ },
92
+ beforeUnmount() {
93
+ this.unregisterFromRefList();
94
+ }
95
+ };
96
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
+ const _component_SvgIcon = resolveComponent("SvgIcon");
98
+ const _component_a_button = resolveComponent("a-button");
99
+ const _component_a_space = resolveComponent("a-space");
100
+ const _component_static_content_wrapper = resolveComponent("static-content-wrapper");
101
+ return openBlock(), createBlock(_component_static_content_wrapper, {
102
+ designer: $props.designer,
103
+ field: $props.field,
104
+ "design-state": $props.designState,
105
+ "parent-widget": $props.parentWidget,
106
+ "parent-list": $props.parentList,
107
+ "index-of-parent-list": $props.indexOfParentList,
108
+ "sub-form-row-index": $props.subFormRowIndex,
109
+ "sub-form-col-index": $props.subFormColIndex,
110
+ "sub-form-row-id": $props.subFormRowId
111
+ }, {
112
+ default: withCtx(() => [
113
+ createElementVNode("div", {
114
+ ref: "fieldEditor",
115
+ class: normalizeClass(["flex", ...$options.customClass]),
116
+ style: normalizeStyle(`--flex: ${$props.field.options.flex}`)
117
+ }, [
118
+ createVNode(_component_a_space, { x: 8 }, {
119
+ default: withCtx(() => [
120
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.buttonList, (item) => {
121
+ return openBlock(), createBlock(_component_a_button, {
122
+ key: item.key,
123
+ type: item.type,
124
+ danger: item.danger,
125
+ disabled: $options.handleDisabled(item),
126
+ onClick: ($event) => $options.hanldeClick(item)
127
+ }, {
128
+ default: withCtx(() => [
129
+ item.icon ? (openBlock(), createBlock(_component_SvgIcon, {
130
+ key: 0,
131
+ "icon-class": item.icon
132
+ }, null, 8, ["icon-class"])) : createCommentVNode("", true),
133
+ createTextVNode(" " + toDisplayString(item.label), 1)
134
+ ]),
135
+ _: 2
136
+ }, 1032, ["type", "danger", "disabled", "onClick"]);
137
+ }), 128))
138
+ ]),
139
+ _: 1
140
+ })
141
+ ], 6)
142
+ ]),
143
+ _: 1
144
+ }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
145
+ }
146
+ const buttonListWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7e133232"]]);
147
+ export {
148
+ buttonListWidget as default
149
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineAsyncComponent } from "vue";
2
2
  import { getFileName } from "../../../../utils/getFileName.js";
3
3
  const comps = {};
4
- const modules = /* @__PURE__ */ Object.assign({ "./attachment-render-widget.vue": () => import("./attachment-render-widget.vue.js"), "./bpmn-editor-widget.vue": () => import("./bpmn-editor-widget.vue.js"), "./button-widget.vue": () => import("./button-widget.vue.js"), "./cascader-widget.vue": () => import("./cascader-widget.vue.js"), "./checkbox-widget.vue": () => import("./checkbox-widget.vue.js"), "./code-editor-widget.vue": () => import("./code-editor-widget.vue.js"), "./color-widget.vue": () => import("./color-widget.vue.js"), "./date-range-widget.vue": () => import("./date-range-widget.vue.js"), "./date-widget.vue": () => import("./date-widget.vue.js"), "./divider-widget.vue": () => import("./divider-widget.vue.js"), "./diy-compontent-widget.vue": () => import("./diy-compontent-widget.vue.js"), "./dropdown-widget.vue": () => import("./dropdown-widget.vue.js"), "./file-upload-widget.vue": () => import("./file-upload-widget.vue.js"), "./form-item-wrapper.vue": () => import("./form-item-wrapper.vue.js"), "./html-text-widget.vue": () => import("./html-text-widget.vue.js"), "./input-widget.vue": () => import("./input-widget.vue.js"), "./number-widget.vue": () => import("./number-widget.vue.js"), "./picture-upload-widget.vue": () => import("./picture-upload-widget.vue.js"), "./radio-widget.vue": () => import("./radio-widget.vue.js"), "./rate-widget.vue": () => import("./rate-widget.vue.js"), "./rich-editor-widget.vue": () => import("./rich-editor-widget.vue.js"), "./select-widget.vue": () => import("./select-widget.vue.js"), "./slider-widget.vue": () => import("./slider-widget.vue.js"), "./slot-widget.vue": () => import("./slot-widget.vue.js"), "./static-content-wrapper.vue": () => import("./static-content-wrapper.vue.js"), "./static-text-widget.vue": () => import("./static-text-widget.vue.js"), "./switch-widget.vue": () => import("./switch-widget.vue.js"), "./textarea-widget.vue": () => import("./textarea-widget.vue.js"), "./time-range-widget.vue": () => import("./time-range-widget.vue.js"), "./time-widget.vue": () => import("./time-widget.vue.js"), "./toolbar-widget.vue": () => import("./toolbar-widget.vue.js"), "./treeSelect-widget.vue": () => import("./treeSelect-widget.vue.js") });
4
+ const modules = /* @__PURE__ */ Object.assign({ "./attachment-render-widget.vue": () => import("./attachment-render-widget.vue.js"), "./bpmn-editor-widget.vue": () => import("./bpmn-editor-widget.vue.js"), "./button-list-widget.vue": () => import("./button-list-widget.vue.js"), "./button-widget.vue": () => import("./button-widget.vue.js"), "./cascader-widget.vue": () => import("./cascader-widget.vue.js"), "./checkbox-widget.vue": () => import("./checkbox-widget.vue.js"), "./code-editor-widget.vue": () => import("./code-editor-widget.vue.js"), "./color-widget.vue": () => import("./color-widget.vue.js"), "./date-range-widget.vue": () => import("./date-range-widget.vue.js"), "./date-widget.vue": () => import("./date-widget.vue.js"), "./divider-widget.vue": () => import("./divider-widget.vue.js"), "./diy-compontent-widget.vue": () => import("./diy-compontent-widget.vue.js"), "./dropdown-widget.vue": () => import("./dropdown-widget.vue.js"), "./file-upload-widget.vue": () => import("./file-upload-widget.vue.js"), "./form-item-wrapper.vue": () => import("./form-item-wrapper.vue.js"), "./html-text-widget.vue": () => import("./html-text-widget.vue.js"), "./input-widget.vue": () => import("./input-widget.vue.js"), "./number-widget.vue": () => import("./number-widget.vue.js"), "./picture-upload-widget.vue": () => import("./picture-upload-widget.vue.js"), "./radio-widget.vue": () => import("./radio-widget.vue.js"), "./rate-widget.vue": () => import("./rate-widget.vue.js"), "./rich-editor-widget.vue": () => import("./rich-editor-widget.vue.js"), "./select-widget.vue": () => import("./select-widget.vue.js"), "./slider-widget.vue": () => import("./slider-widget.vue.js"), "./slot-widget.vue": () => import("./slot-widget.vue.js"), "./static-content-wrapper.vue": () => import("./static-content-wrapper.vue.js"), "./static-text-widget.vue": () => import("./static-text-widget.vue.js"), "./switch-widget.vue": () => import("./switch-widget.vue.js"), "./textarea-widget.vue": () => import("./textarea-widget.vue.js"), "./time-range-widget.vue": () => import("./time-range-widget.vue.js"), "./time-widget.vue": () => import("./time-widget.vue.js"), "./treeSelect-widget.vue": () => import("./treeSelect-widget.vue.js") });
5
5
  for (const path in modules) {
6
6
  const cname = getFileName(path);
7
7
  comps[cname] = defineAsyncComponent(modules[path]);