@ibiz-template/vue3-components 0.7.41-alpha.1 → 0.7.41-alpha.3

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 (32) hide show
  1. package/dist/index-wTJRDY6L.js +4 -0
  2. package/dist/index.min.css +1 -1
  3. package/dist/index.system.min.js +1 -1
  4. package/dist/{wang-editor-6EirGFoh.js → wang-editor-F-NQHCVT.js} +1 -1
  5. package/dist/{xlsx-util-J1RHk00u.js → xlsx-util-0wARAx2L.js} +1 -1
  6. package/es/common/split/split.css +1 -1
  7. package/es/control/drtab/drtab-control.util.mjs +1 -1
  8. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
  9. package/es/control/form/form-detail/form-item/form-item-container/form-item-container.mjs +25 -4
  10. package/es/control/grid/grid/grid-control.util.d.ts +1 -1
  11. package/es/control/grid/grid/grid-control.util.mjs +31 -4
  12. package/es/control/grid/grid/grid.mjs +7 -5
  13. package/es/control/tree/el-tree-util.d.ts +23 -1
  14. package/es/control/tree/el-tree-util.mjs +30 -1
  15. package/es/control/tree/tree.d.ts +5 -1
  16. package/es/control/tree/tree.mjs +90 -10
  17. package/es/control/tree-grid/tree-grid.mjs +1 -1
  18. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  19. package/lib/common/split/split.css +1 -1
  20. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  21. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.cjs +25 -4
  22. package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
  23. package/lib/control/grid/grid/grid-control.util.cjs +30 -3
  24. package/lib/control/grid/grid/grid.cjs +7 -5
  25. package/lib/control/tree/el-tree-util.cjs +31 -0
  26. package/lib/control/tree/tree.cjs +88 -8
  27. package/lib/control/tree-grid/tree-grid.cjs +1 -1
  28. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  29. package/package.json +7 -7
  30. package/dist/index-eIKUlAq_.js +0 -4
  31. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.2_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  32. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.2_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -73,6 +73,14 @@ function useITableEvent(c) {
73
73
  }
74
74
  }, 300);
75
75
  }
76
+ const allGridColumns = [];
77
+ core.recursiveIterate(
78
+ c.model,
79
+ (column) => {
80
+ allGridColumns.push(column);
81
+ },
82
+ { childrenFields: ["degridColumns"] }
83
+ );
76
84
  c.evt.on("onToggleRowExpansion", (event) => {
77
85
  const { row, expand } = event;
78
86
  if (tableRef.value) {
@@ -359,8 +367,7 @@ function useITableEvent(c) {
359
367
  _rowIndex,
360
368
  _columnIndex
361
369
  }) {
362
- var _a;
363
- const columnModel = (_a = c.model.degridColumns) == null ? void 0 : _a.find((gridColumn) => {
370
+ const columnModel = allGridColumns.find((gridColumn) => {
364
371
  return gridColumn.codeName === column.property;
365
372
  });
366
373
  if (columnModel && columnModel.headerSysCss && columnModel.headerSysCss.cssName) {
@@ -435,7 +442,7 @@ function useAppGridPagination(c) {
435
442
  }
436
443
  return { onPageChange, onPageSizeChange, onPageRefresh };
437
444
  }
438
- function useAppGridBase(c, props) {
445
+ function useAppGridBase(c, props, tableRef) {
439
446
  const initSimpleData = () => {
440
447
  if (!props.data) {
441
448
  return;
@@ -590,6 +597,26 @@ function useAppGridBase(c, props) {
590
597
  rowIndex,
591
598
  columnIndex
592
599
  }) => {
600
+ var _a;
601
+ const spanMethodAttribute = (_a = c.model.controlAttributes) == null ? void 0 : _a.find((item) => {
602
+ return item.attrName === "span-method" && item.attrValue;
603
+ });
604
+ if (spanMethodAttribute) {
605
+ return runtime.ScriptFactory.execScriptFn(
606
+ {
607
+ ...c.getEventArgs(),
608
+ metadata: {
609
+ row,
610
+ column,
611
+ rowIndex,
612
+ columnIndex,
613
+ items: tableRef.value.store.states.data.value
614
+ }
615
+ },
616
+ spanMethodAttribute.attrValue,
617
+ { isAsync: false }
618
+ );
619
+ }
593
620
  const { property } = column;
594
621
  const { rowspankeys = [], colspankeys = [] } = c.controlParams;
595
622
  if (rowspankeys.length > 0 && rowspankeys.includes(property)) {
@@ -20,10 +20,12 @@ function renderAttrs(model, params) {
20
20
  var _a;
21
21
  const attrs = {};
22
22
  (_a = model.controlAttributes) == null ? void 0 : _a.forEach((item) => {
23
- if (item.attrName && item.attrValue) {
24
- attrs[item.attrName] = runtime.ScriptFactory.execSingleLine(item.attrValue, {
25
- ...params
26
- });
23
+ if (item.attrName !== "span-method") {
24
+ if (item.attrName && item.attrValue) {
25
+ attrs[item.attrName] = runtime.ScriptFactory.execSingleLine(item.attrValue, {
26
+ ...params
27
+ });
28
+ }
27
29
  }
28
30
  });
29
31
  return attrs;
@@ -392,7 +394,7 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
392
394
  summaryMethod,
393
395
  spanMethod,
394
396
  headerDragend
395
- } = gridControl_util.useAppGridBase(c, props);
397
+ } = gridControl_util.useAppGridBase(c, props, tableRef);
396
398
  const {
397
399
  renderPopover
398
400
  } = useRowEditPopover.useRowEditPopover(tableRef, c);
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@ibiz-template/core');
4
+ var runtime = require('@ibiz-template/runtime');
4
5
  var qxUtil = require('qx-util');
5
6
  var lodashEs = require('lodash-es');
6
7
  var vue = require('vue');
@@ -143,9 +144,39 @@ function findChildItems(c, modelData, curItem) {
143
144
  });
144
145
  return children;
145
146
  }
147
+ function getNodeControlPanel(control) {
148
+ if (control.controlRenders) {
149
+ const controlRenders = control.controlRenders.filter(
150
+ (item) => (item.id || "").split("_")[0] !== "newnoderender"
151
+ );
152
+ return runtime.getControlPanel({ controlRenders });
153
+ }
154
+ }
155
+ function getNewNodeControlPanel(control) {
156
+ if (control.controlRenders) {
157
+ const controlRender = control.controlRenders.find(
158
+ (item) => (item.id || "").split("_")[0] === "newnoderender"
159
+ );
160
+ if (!controlRender)
161
+ return;
162
+ if (controlRender.renderType === "LAYOUTPANEL_MODEL" && controlRender.layoutPanelModel) {
163
+ const layoutPanelModel = runtime.ScriptFactory.execScriptFn(
164
+ {},
165
+ controlRender.layoutPanelModel,
166
+ { isAsync: false }
167
+ );
168
+ return layoutPanelModel;
169
+ }
170
+ if (controlRender.renderType === "LAYOUTPANEL" && controlRender.layoutPanel) {
171
+ return controlRender.layoutPanel;
172
+ }
173
+ }
174
+ }
146
175
 
147
176
  exports.findChildItems = findChildItems;
148
177
  exports.findNodeData = findNodeData;
149
178
  exports.formatNodeDropType = formatNodeDropType;
179
+ exports.getNewNodeControlPanel = getNewNodeControlPanel;
180
+ exports.getNodeControlPanel = getNodeControlPanel;
150
181
  exports.useAppTreeBase = useAppTreeBase;
151
182
  exports.useElTreeUtil = useElTreeUtil;
@@ -135,21 +135,38 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
135
135
  const treeNodeTextInputRef = vue.ref(null);
136
136
  const editingNodeKey = vue.ref(null);
137
137
  const editingNodeText = vue.ref(null);
138
+ const newNodePanelRef = vue.ref();
138
139
  const newTreeNodeText = vue.ref(null);
139
140
  const newNodeModel = vue.ref(null);
140
141
  const newDefaultValue = vue.ref(null);
141
142
  const newNodeKey = vue.ref("".concat(qxUtil.createUUID(), "-").concat(qxUtil.createUUID()));
142
143
  const newNodeData = vue.ref(null);
143
- c.evt.on("onNewTreeNode", (args) => {
144
+ const newNodeDeData = vue.ref(null);
145
+ const newNodeControlPanel = vue.ref(null);
146
+ c.evt.on("onNewTreeNode", async (args) => {
147
+ var _a;
144
148
  const {
145
149
  nodeModel,
146
150
  defaultValue,
147
151
  parentNodeData
148
152
  } = args;
149
- newNodeModel.value = nodeModel;
153
+ const {
154
+ appId,
155
+ appDataEntityId
156
+ } = nodeModel;
157
+ const entityModel = await ibiz.hub.getAppDataEntity(appDataEntityId, appId);
158
+ const layoutPanel = elTreeUtil.getNewNodeControlPanel(nodeModel);
159
+ if (layoutPanel) {
160
+ newNodeDeData.value = new runtime.AppDataEntity(entityModel, {});
161
+ newNodeControlPanel.value = layoutPanel || null;
162
+ }
150
163
  newDefaultValue.value = defaultValue;
151
164
  editingNodeKey.value = null;
152
165
  editingNodeText.value = null;
166
+ if (newNodeData.value) {
167
+ (_a = treeRef.value) == null ? void 0 : _a.remove(newNodeData.value);
168
+ newNodeData.value = null;
169
+ }
153
170
  if (parentNodeData && treeRef.value) {
154
171
  const _newNodeData = {};
155
172
  Object.assign(_newNodeData, {
@@ -160,6 +177,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
160
177
  treeRef.value.append(_newNodeData, parentNodeData);
161
178
  newNodeData.value = _newNodeData;
162
179
  }
180
+ newNodeModel.value = nodeModel;
163
181
  });
164
182
  vue.watch(() => treeNodeTextInputRef.value, (newVal) => {
165
183
  if (newVal) {
@@ -191,7 +209,28 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
191
209
  }
192
210
  }
193
211
  if (newNodeModel.value) {
194
- if (newTreeNodeText.value) {
212
+ const hasNonNullValue = newNodeDeData.value && Object.values(newNodeDeData.value).some((_val) => !!_val);
213
+ if (newNodeControlPanel.value && hasNonNullValue) {
214
+ const {
215
+ textAppDEFieldId,
216
+ id
217
+ } = newNodeModel.value;
218
+ const nodeData = {
219
+ _nodeId: id,
220
+ _text: [newNodeDeData.value[textAppDEFieldId]],
221
+ _deData: {}
222
+ };
223
+ Object.assign(nodeData._deData, newNodeDeData.value);
224
+ if (newDefaultValue.value) {
225
+ Object.keys(newDefaultValue.value).forEach((_key) => {
226
+ if (!nodeData._deData[_key])
227
+ Object.assign(nodeData._deData, {
228
+ [_key]: newDefaultValue.value[_key]
229
+ });
230
+ });
231
+ }
232
+ await c.createDeNodeData([nodeData]);
233
+ } else if (newTreeNodeText.value) {
195
234
  const {
196
235
  textAppDEFieldId,
197
236
  id
@@ -215,6 +254,9 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
215
254
  newNodeModel.value = null;
216
255
  newTreeNodeText.value = null;
217
256
  newDefaultValue.value = null;
257
+ newNodeDeData.value = null;
258
+ newNodeControlPanel.value = null;
259
+ newNodePanelRef.value = null;
218
260
  if (newNodeData.value)
219
261
  (_a = treeRef.value) == null ? void 0 : _a.remove(newNodeData.value);
220
262
  newNodeData.value = null;
@@ -230,6 +272,9 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
230
272
  newNodeModel.value = null;
231
273
  newTreeNodeText.value = null;
232
274
  newDefaultValue.value = null;
275
+ newNodeDeData.value = null;
276
+ newNodeControlPanel.value = null;
277
+ newNodePanelRef.value = null;
233
278
  if (newNodeData.value)
234
279
  (_a = treeRef.value) == null ? void 0 : _a.remove(newNodeData.value);
235
280
  newNodeData.value = null;
@@ -244,6 +289,20 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
244
289
  onNodeTextEditEsc();
245
290
  }
246
291
  };
292
+ const onPanelItemEvent = (_args) => {
293
+ if (!_args)
294
+ return;
295
+ const {
296
+ panelItemEventName
297
+ } = _args;
298
+ if (panelItemEventName === runtime.PanelItemEventName.ENTER) {
299
+ onNodeTextEditBlur();
300
+ }
301
+ };
302
+ const onPanelItemKeydown = (e) => {
303
+ if (e.code === "Escape" || e.keyCode === 27)
304
+ onNodeTextEditEsc();
305
+ };
247
306
  const {
248
307
  updateUI,
249
308
  triggerNodeExpand
@@ -596,12 +655,20 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
596
655
  editCurrentNodeText();
597
656
  }
598
657
  };
658
+ const handleMouseup = () => {
659
+ var _a;
660
+ const isFoucs = (_a = newNodePanelRef.value) == null ? void 0 : _a.$el.querySelector(".is-focus");
661
+ if (newNodeControlPanel.value && !isFoucs)
662
+ onNodeTextEditBlur();
663
+ };
599
664
  vue.onMounted(() => {
600
665
  var _a;
666
+ document.addEventListener("mouseup", handleMouseup.bind(this));
601
667
  (_a = treeviewRef.value) == null ? void 0 : _a.$el.addEventListener("keydown", keydownHandle);
602
668
  });
603
669
  vue.onUnmounted(() => {
604
670
  var _a;
671
+ document.removeEventListener("mouseup", handleMouseup.bind(this));
605
672
  (_a = treeviewRef.value) == null ? void 0 : _a.$el.removeEventListener("keydown", keydownHandle);
606
673
  });
607
674
  const renderCounter = (nodeModel) => {
@@ -620,19 +687,32 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
620
687
  }
621
688
  };
622
689
  const renderNewNode = () => {
623
- var _a, _b, _c;
690
+ var _a, _b, _c, _d;
624
691
  if (!newNodeModel.value) {
625
692
  return null;
626
693
  }
694
+ if (newNodeControlPanel.value) {
695
+ return vue.createVNode(vue.resolveComponent("iBizControlShell"), {
696
+ "class": [ns.b("new-node"), (_a = newNodeModel.value.sysCss) == null ? void 0 : _a.cssName],
697
+ "ref": newNodePanelRef,
698
+ "data": newNodeDeData.value,
699
+ "modelData": newNodeControlPanel.value,
700
+ "context": c.context,
701
+ "params": c.params,
702
+ "onMouseup": (_e) => _e.stopPropagation(),
703
+ "onPanelItemEvent": onPanelItemEvent,
704
+ "onKeydown": onPanelItemKeydown
705
+ }, null);
706
+ }
627
707
  return vue.createVNode("div", {
628
- "class": [ns.b("new-node"), (_a = newNodeModel.value.sysCss) == null ? void 0 : _a.cssName],
708
+ "class": [ns.b("new-node"), (_b = newNodeModel.value.sysCss) == null ? void 0 : _b.cssName],
629
709
  "onClick": (_e) => {
630
710
  _e.preventDefault();
631
711
  _e.stopPropagation();
632
712
  }
633
- }, [((_b = newNodeModel.value) == null ? void 0 : _b.sysImage) ? vue.createVNode(iBizIcon, {
713
+ }, [((_c = newNodeModel.value) == null ? void 0 : _c.sysImage) ? vue.createVNode(iBizIcon, {
634
714
  "class": ns.be("node", "icon"),
635
- "icon": (_c = newNodeModel.value) == null ? void 0 : _c.sysImage
715
+ "icon": (_d = newNodeModel.value) == null ? void 0 : _d.sysImage
636
716
  }, null) : null, vue.createVNode(vue.resolveComponent("el-input"), {
637
717
  "modelValue": newTreeNodeText.value,
638
718
  "onUpdate:modelValue": ($event) => newTreeNodeText.value = $event,
@@ -759,7 +839,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
759
839
  }
760
840
  }, null)]);
761
841
  }
762
- const layoutPanel = runtime.getControlPanel(nodeModel);
842
+ const layoutPanel = elTreeUtil.getNodeControlPanel(nodeModel);
763
843
  let content;
764
844
  if (layoutPanel) {
765
845
  content = vue.createVNode(vue.resolveComponent("iBizControlShell"), {
@@ -112,7 +112,7 @@ const TreeGridControl = /* @__PURE__ */ vue.defineComponent({
112
112
  defaultSort,
113
113
  summaryMethod,
114
114
  headerDragend
115
- } = gridControl_util.useAppGridBase(c, props);
115
+ } = gridControl_util.useAppGridBase(c, props, tableRef);
116
116
  const {
117
117
  renderPopover
118
118
  } = useRowEditPopover.useRowEditPopover(tableRef, c);
@@ -2,7 +2,7 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  var ElementPlus = require('element-plus');
5
- var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
5
+ var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.2_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
6
6
  var fullscreenToolbar = require('../../common/fullscreen-toolbar/fullscreen-toolbar.cjs');
7
7
 
8
8
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.1",
3
+ "version": "0.7.41-alpha.3",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -34,14 +34,14 @@
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.198",
35
35
  "@ibiz-template-plugin/bi-report": "0.0.26",
36
36
  "@ibiz-template-plugin/data-view": "0.0.4",
37
- "@ibiz-template/core": "0.7.41-alpha.1",
37
+ "@ibiz-template/core": "0.7.41-alpha.2",
38
38
  "@ibiz-template/devtool": "0.0.11",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.1",
40
- "@ibiz-template/runtime": "0.7.41-alpha.1",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.3",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.3",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.1",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.3",
43
43
  "@ibiz-template/web-theme": "3.4.0",
44
- "@ibiz/model-core": "^0.1.75",
44
+ "@ibiz/model-core": "^0.1.76",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",
46
46
  "@monaco-editor/loader": "^1.4.0",
47
47
  "@wangeditor/editor": "^5.1.23",
@@ -106,7 +106,7 @@
106
106
  "@ibiz-template/runtime": "^0.7.0",
107
107
  "@ibiz-template/theme": "^0.7.0",
108
108
  "@ibiz-template/vue3-util": "^0.7.0",
109
- "@ibiz/model-core": "^0.1.75",
109
+ "@ibiz/model-core": "^0.1.76",
110
110
  "@imengyu/vue3-context-menu": "^1.3.3",
111
111
  "@monaco-editor/loader": "^1.3.3",
112
112
  "@wangeditor/editor": "^5.1.23",