@tmagic/editor 1.8.0-beta.27 → 1.8.0-beta.29

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.
@@ -48,9 +48,10 @@ var ScrollBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
48
48
  return props.scrollSize * ratio;
49
49
  };
50
50
  const scrollBy = (delta) => {
51
- if (delta < 0) if (props.pos <= 0) emit("scroll", 0);
52
- else emit("scroll", -Math.min(-delta, props.pos));
53
- else {
51
+ if (delta < 0) {
52
+ if (props.pos <= 0) emit("scroll", 0);
53
+ else emit("scroll", -Math.min(-delta, props.pos));
54
+ } else {
54
55
  const leftPos = props.size - (thumbSize.value + thumbPos.value);
55
56
  if (leftPos <= 0) emit("scroll", 0);
56
57
  else emit("scroll", Math.min(delta, leftPos));
@@ -20,7 +20,7 @@ var FieldSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
20
20
  notEditable: { type: [Boolean, Function] },
21
21
  dataSourceId: {}
22
22
  }, {
23
- "modelValue": { default: [] },
23
+ "modelValue": { default: () => [] },
24
24
  "modelModifiers": {}
25
25
  }),
26
26
  emits: /*@__PURE__*/ mergeModels(["change"], ["update:modelValue"]),
@@ -42,8 +42,10 @@ var DataSourceMethods_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
42
42
  let editIndex = -1;
43
43
  const editMethod = (method, index) => {
44
44
  let codeContent = "({ params, dataSource, app }) => {\n // place your code here\n}";
45
- if (method.content) if (typeof method.content !== "string") codeContent = method.content.toString();
46
- else codeContent = method.content;
45
+ if (method.content) {
46
+ if (typeof method.content !== "string") codeContent = method.content.toString();
47
+ else codeContent = method.content;
48
+ }
47
49
  codeConfig.value = {
48
50
  ...cloneDeep(method),
49
51
  content: codeContent
@@ -1,11 +1,12 @@
1
1
  //#region packages/editor/src/fields/configs/stickyAddButton.ts
2
2
  /**
3
- * 属性面板列表字段共用的吸底全宽「添加」按钮,展开到 group-list 配置上。
3
+ * 属性面板列表字段共用的吸底全宽「添加」按钮与吸顶标题,展开到 group-list 配置上。
4
4
  *
5
- * 吸底按钮会盖住列表底部,新增的项必须同时滚进视口才看得见,两者一起给出避免漏配。
5
+ * 吸底按钮会盖住列表底部,吸顶标题会盖住列表顶部,新增的项必须同时滚进视口才看得见。
6
6
  */
7
7
  var stickyAddButton = (text) => ({
8
8
  scrollLastItemIntoView: true,
9
+ header: { sticky: true },
9
10
  addButtonConfig: {
10
11
  sticky: true,
11
12
  text,
@@ -23,8 +23,10 @@ var useCodeBlockEdit = (codeBlockService) => {
23
23
  return;
24
24
  }
25
25
  let codeContent = "";
26
- if (codeBlock.content) if (typeof codeBlock.content !== "string") codeContent = codeBlock.content.toString();
27
- else codeContent = codeBlock.content;
26
+ if (codeBlock.content) {
27
+ if (typeof codeBlock.content !== "string") codeContent = codeBlock.content.toString();
28
+ else codeContent = codeBlock.content;
29
+ }
28
30
  codeConfig.value = {
29
31
  ...cloneDeep(codeBlock),
30
32
  content: codeContent
@@ -168,10 +168,20 @@ var initServiceEvents = (props, emit, { editorService, codeBlockService, dataSou
168
168
  });
169
169
  });
170
170
  };
171
+ /**
172
+ * root 是否已经不是编辑器当前的 root。
173
+ *
174
+ * `editorService.set('root', v)` 是同步赋值后再派发 `root-change`,因此派发那一刻 `v` 一定
175
+ * 就是当前 root;但处理 `root-change` 要等 stage / runtime / 依赖收集等异步过程,期间 root
176
+ * 可能被新的一次整体替换(外部重设 DSL、更新 root 节点、源码保存等)顶掉,此时手上的 `v`
177
+ * 已是过期快照,继续用它刷画布或回写给外部都会与新 root 互相覆盖。
178
+ */
179
+ const isStaleRoot = (value) => toRaw(editorService.get("root")) !== toRaw(value);
171
180
  const updateStageDsl = async (value) => {
172
181
  const stage = await getStage();
173
182
  const runtime = await stage.renderer?.getRuntime();
174
183
  const app = await getTMagicApp();
184
+ if (isStaleRoot(value)) return;
175
185
  if (!app?.dataSourceManager) runtime?.updateRootConfig?.(cloneDeep$1(toRaw(value)));
176
186
  const page = editorService.get("page");
177
187
  const node = editorService.get("node");
@@ -182,6 +192,7 @@ var initServiceEvents = (props, emit, { editorService, codeBlockService, dataSou
182
192
  if (value) {
183
193
  depService.clearIdleTasks();
184
194
  await (typeof Worker === "undefined" ? collectIdle(value.items, true) : depService.collectByWorker(value));
195
+ if (isStaleRoot(value)) return;
185
196
  const dsl = cloneDeep$1(toRaw(value));
186
197
  if (dsl.dataSources && dsl.dataSourceDeps && app?.dataSourceManager) for (const node of getNodes(getDepNodeIds(dsl.dataSourceDeps), dsl.items)) updateNode(app.dataSourceManager.compiledNode(node), dsl);
187
198
  runtime?.updateRootConfig?.(dsl);
@@ -192,7 +203,7 @@ var initServiceEvents = (props, emit, { editorService, codeBlockService, dataSou
192
203
  depService.addTarget(createDataSourceMethodTarget(ds, reactive({})));
193
204
  depService.addTarget(createDataSourceCondTarget(ds, reactive({})));
194
205
  };
195
- const rootChangeHandler = (value, preValue) => {
206
+ const rootChangeHandler = (value) => {
196
207
  if (!value) return;
197
208
  value.codeBlocks = value.codeBlocks || {};
198
209
  value.dataSources = value.dataSources || [];
@@ -218,7 +229,8 @@ var initServiceEvents = (props, emit, { editorService, codeBlockService, dataSou
218
229
  editorService.set("parent", null);
219
230
  editorService.set("page", null);
220
231
  }
221
- if (toRaw(value) !== toRaw(preValue)) emit("update:modelValue", value);
232
+ if (isStaleRoot(value)) return;
233
+ if (toRaw(props.modelValue) !== toRaw(value)) emit("update:modelValue", value);
222
234
  })();
223
235
  };
224
236
  const nodeAddHandler = (nodes) => {
@@ -93,9 +93,10 @@ var CodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
93
93
  };
94
94
  const toString = (v, language) => {
95
95
  let value;
96
- if (typeof v !== "string") if (language === "json") value = JSON.stringify(v, null, 2);
97
- else value = serializeConfig(v);
98
- else value = v;
96
+ if (typeof v !== "string") {
97
+ if (language === "json") value = JSON.stringify(v, null, 2);
98
+ else value = serializeConfig(v);
99
+ } else value = v;
99
100
  if (language === "javascript" && value.startsWith("{") && value.endsWith("}")) value = `(${value})`;
100
101
  return value;
101
102
  };
@@ -135,7 +135,7 @@ var useHistoryRevert = (options = {}, services) => {
135
135
  * 不弹差异弹窗,改用一个普通确认框替代「确定回滚」按钮,避免点击后无任何提示直接执行。
136
136
  * 用户取消时返回 false,调用方据此中止回滚。
137
137
  */
138
- const confirmRevert = () => confirmHistoryAction("确定回滚该步骤吗?回滚会将该操作作为一条新记录反向应用(新增将被删除、删除将被还原),不影响后续历史记录。");
138
+ const confirmRevert = () => confirmHistoryAction("确定回滚该步骤吗?");
139
139
  /**
140
140
  * 「回滚」统一确认入口:可差异对比的步骤动态挂载 HistoryDiffDialog 走差异确认弹窗,
141
141
  * 无法对比的步骤(add / remove / 多节点更新)回退到普通二次确认框。
@@ -68,13 +68,14 @@ var PropsPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
68
68
  const historySource = eventData ? "props" : "code";
69
69
  const replace = historySource === "code";
70
70
  let newValue;
71
- if (replace) if (source === "style") newValue = {
72
- ...values.value,
73
- id: v.id || values.value.id,
74
- style: { ...v.style || {} }
75
- };
76
- else newValue = { ...v };
77
- else {
71
+ if (replace) {
72
+ if (source === "style") newValue = {
73
+ ...values.value,
74
+ id: v.id || values.value.id,
75
+ style: { ...v.style || {} }
76
+ };
77
+ else newValue = { ...v };
78
+ } else {
78
79
  newValue = {
79
80
  ...v,
80
81
  style: {}
@@ -109,16 +109,17 @@ var useDrag = ({ editorService }, options = {}) => {
109
109
  let targetParent = targetInfo.parent;
110
110
  if (!targetParent || !targetNode) return;
111
111
  let targetIndex = -1;
112
- if (Array.isArray(targetNode.items) && dragState.dropType === "inner") if (dragState.redirectedTargetId !== void 0) {
113
- const redirectedNode = editorService.getNodeInfo(dragState.redirectedTargetId, false).node;
114
- if (!redirectedNode || !Array.isArray(redirectedNode.items)) return;
115
- targetParent = redirectedNode;
116
- targetIndex = redirectedNode.items.length;
117
- } else {
118
- targetIndex = targetNode.items.length;
119
- targetParent = targetNode;
120
- }
121
- else targetIndex = getNodeIndex(dragState.dragOverNodeId, targetParent);
112
+ if (Array.isArray(targetNode.items) && dragState.dropType === "inner") {
113
+ if (dragState.redirectedTargetId !== void 0) {
114
+ const redirectedNode = editorService.getNodeInfo(dragState.redirectedTargetId, false).node;
115
+ if (!redirectedNode || !Array.isArray(redirectedNode.items)) return;
116
+ targetParent = redirectedNode;
117
+ targetIndex = redirectedNode.items.length;
118
+ } else {
119
+ targetIndex = targetNode.items.length;
120
+ targetParent = targetNode;
121
+ }
122
+ } else targetIndex = getNodeIndex(dragState.dragOverNodeId, targetParent);
122
123
  if (dragState.dropType === "after") targetIndex += 1;
123
124
  const selectedNodes = editorService.get("nodes");
124
125
  if (selectedNodes.find((n) => `${n.id}` === `${node.id}`)) editorService.dragTo(selectedNodes, targetParent, targetIndex);
@@ -151,11 +151,44 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
151
151
  height: contentRect.height
152
152
  });
153
153
  });
154
+ const parseDSL = getEditorConfig("parseDSL");
155
+ /**
156
+ * 本次拖拽是否由编辑器文档内部发起
157
+ *
158
+ * drop 的 text/json 里可能带函数(组件配置的事件、钩子等),还原只能交给 parseDSL,
159
+ * 而 parseDSL 的默认实现是 eval;HTML 拖放又允许其他源的页面在 DataTransfer 中投递
160
+ * 自定义 MIME 数据,跨源页面只要诱导用户拖拽一次,就能让 eval 执行任意脚本。
161
+ *
162
+ * 跨源页面既不会在本文档触发 dragstart,也无法往本文档创建的 DataTransfer 中写数据,
163
+ * 因此只有起源于本文档的拖拽才交给 parseDSL 还原。
164
+ * 同源拖拽源写入的 text/json 由业务保证可信。
165
+ */
166
+ let isInternalDrag = false;
167
+ let internalDragSession = 0;
168
+ let clearInternalDragTimer;
169
+ const documentDragStartHandler = () => {
170
+ internalDragSession += 1;
171
+ isInternalDrag = true;
172
+ if (clearInternalDragTimer !== void 0) {
173
+ globalThis.clearTimeout(clearInternalDragTimer);
174
+ clearInternalDragTimer = void 0;
175
+ }
176
+ };
177
+ const documentDragEndHandler = () => {
178
+ const session = internalDragSession;
179
+ if (clearInternalDragTimer !== void 0) globalThis.clearTimeout(clearInternalDragTimer);
180
+ clearInternalDragTimer = globalThis.setTimeout(() => {
181
+ clearInternalDragTimer = void 0;
182
+ if (session === internalDragSession) isInternalDrag = false;
183
+ }, 0);
184
+ };
154
185
  onMounted(() => {
155
186
  if (stageWrapRef.value?.container) {
156
187
  resizeObserver.observe(stageWrapRef.value.container);
157
188
  keybindingService.registerEl(KeyBindingContainerKey.STAGE, stageWrapRef.value.container);
158
189
  }
190
+ globalThis.document.addEventListener("dragstart", documentDragStartHandler, true);
191
+ globalThis.document.addEventListener("dragend", documentDragEndHandler, true);
159
192
  });
160
193
  onBeforeUnmount(() => {
161
194
  stage?.destroy();
@@ -163,8 +196,13 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
163
196
  resizeObserver.disconnect();
164
197
  editorService.set("stage", null);
165
198
  keybindingService.unregisterEl("stage");
199
+ if (clearInternalDragTimer !== void 0) {
200
+ globalThis.clearTimeout(clearInternalDragTimer);
201
+ clearInternalDragTimer = void 0;
202
+ }
203
+ globalThis.document.removeEventListener("dragstart", documentDragStartHandler, true);
204
+ globalThis.document.removeEventListener("dragend", documentDragEndHandler, true);
166
205
  });
167
- const parseDSL = getEditorConfig("parseDSL");
168
206
  const contextmenuHandler = (e) => {
169
207
  e.preventDefault();
170
208
  menuRef.value?.show(e);
@@ -175,11 +213,19 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
175
213
  e.dataTransfer.dropEffect = "move";
176
214
  };
177
215
  const dropHandler = async (e) => {
216
+ const allowed = isInternalDrag;
217
+ isInternalDrag = false;
178
218
  if (!e.dataTransfer) return;
179
219
  const data = e.dataTransfer.getData("text/json");
180
- if (!data) return;
181
- const config = parseDSL(`(${data})`);
182
- if (!config || config.dragType !== DragType.COMPONENT_LIST) return;
220
+ if (!data || !allowed) return;
221
+ let config;
222
+ try {
223
+ config = parseDSL(`(${data})`);
224
+ } catch {
225
+ return;
226
+ }
227
+ if (!config || config.dragType !== DragType.COMPONENT_LIST || !config.data) return;
228
+ const dragData = config.data;
183
229
  e.preventDefault();
184
230
  const doc = stage?.renderer?.contentWindow?.document;
185
231
  const parentEl = doc?.querySelector(`.${props.stageOptions?.containerHighlightClassName}`);
@@ -201,7 +247,7 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
201
247
  const layout = await editorService.getLayout(parent);
202
248
  const containerRect = stageContainerEl.value.getBoundingClientRect();
203
249
  const { scrollTop, scrollLeft } = stage.mask;
204
- const { style = {} } = config.data;
250
+ const { style = {} } = dragData;
205
251
  let top = 0;
206
252
  let left = 0;
207
253
  let position = "relative";
@@ -219,14 +265,14 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
219
265
  top = top - parentTop * zoom.value;
220
266
  }
221
267
  }
222
- config.data.style = {
268
+ dragData.style = {
223
269
  ...style,
224
270
  position,
225
271
  top: calcValueByFontsize(doc, top / zoom.value),
226
272
  left: calcValueByFontsize(doc, left / zoom.value)
227
273
  };
228
- config.data.inputEvent = e;
229
- editorService.add(config.data, parent, { historySource: "component-panel" });
274
+ dragData.inputEvent = e;
275
+ editorService.add(dragData, parent, { historySource: "component-panel" });
230
276
  }
231
277
  };
232
278
  return (_ctx, _cache) => {
@@ -455,13 +455,15 @@ var Editor = class extends BaseService {
455
455
  }
456
456
  await Promise.all(nodes.map((node) => this.doRemove(node, options)));
457
457
  this.removeInvalidNodesBySubtree(nodes);
458
- if (removedItems.length > 0 && pageForOp) if (!doNotPushHistory) this.pushOpHistory("remove", {
459
- diff: removedItems,
460
- pageData: pageForOp,
461
- historyDescription,
462
- source: historySource
463
- });
464
- else this.selectionBeforeOp = null;
458
+ if (removedItems.length > 0 && pageForOp) {
459
+ if (!doNotPushHistory) this.pushOpHistory("remove", {
460
+ diff: removedItems,
461
+ pageData: pageForOp,
462
+ historyDescription,
463
+ source: historySource
464
+ });
465
+ else this.selectionBeforeOp = null;
466
+ }
465
467
  this.emit("remove", nodes);
466
468
  this.emit("change", {
467
469
  type: "remove",
@@ -541,22 +543,24 @@ var Editor = class extends BaseService {
541
543
  }));
542
544
  this.applyInvalidInfo(config, invalidInfo);
543
545
  if (updateData[0].oldNode?.type !== NodeType.ROOT) {
544
- if (this.get("nodes").length) if (!doNotPushHistory) {
545
- const pageForOp = this.getNodeInfo(nodes[0].id, false).page;
546
- this.pushOpHistory("update", {
547
- diff: buildUpdateDiff(updateData.map((d) => ({
548
- oldNode: cloneDeep$1(d.oldNode),
549
- newNode: cloneDeep$1(d.newNode),
550
- changeRecords: d.changeRecords?.length ? cloneDeep$1(d.changeRecords) : void 0
551
- }))),
552
- pageData: {
553
- name: pageForOp?.name || "",
554
- id: pageForOp.id
555
- },
556
- historyDescription,
557
- source: historySource
558
- });
559
- } else this.selectionBeforeOp = null;
546
+ if (this.get("nodes").length) {
547
+ if (!doNotPushHistory) {
548
+ const pageForOp = this.getNodeInfo(nodes[0].id, false).page;
549
+ this.pushOpHistory("update", {
550
+ diff: buildUpdateDiff(updateData.map((d) => ({
551
+ oldNode: cloneDeep$1(d.oldNode),
552
+ newNode: cloneDeep$1(d.newNode),
553
+ changeRecords: d.changeRecords?.length ? cloneDeep$1(d.changeRecords) : void 0
554
+ }))),
555
+ pageData: {
556
+ name: pageForOp?.name || "",
557
+ id: pageForOp.id
558
+ },
559
+ historyDescription,
560
+ source: historySource
561
+ });
562
+ } else this.selectionBeforeOp = null;
563
+ }
560
564
  }
561
565
  this.emit("update", updateData);
562
566
  this.emit("change", {
@@ -684,8 +688,10 @@ var Editor = class extends BaseService {
684
688
  historyDescription,
685
689
  historySource
686
690
  });
687
- if (!doNotSelect) if (newNodes.length > 1) await stage?.multiSelect(newNodes.map((node) => node.id));
688
- else await stage?.select(newNodes[0].id);
691
+ if (!doNotSelect) {
692
+ if (newNodes.length > 1) await stage?.multiSelect(newNodes.map((node) => node.id));
693
+ else await stage?.select(newNodes[0].id);
694
+ }
689
695
  return newNode;
690
696
  }
691
697
  /**
package/dist/es/style.css CHANGED
@@ -478,18 +478,48 @@ fieldset.m-fieldset .m-form-tip {
478
478
  flex-shrink: 0;
479
479
  gap: 8px;
480
480
  }
481
- .m-fields-group-list .m-fields-group-list-item > .el-card__header,
482
- .m-fields-group-list .m-fields-group-list-item > .t-card__header {
481
+ .m-fields-group-list > .m-fields-group-list-item {
482
+ --m-group-list-item-footer-bottom: var(
483
+ --m-group-list-nested-footer-bottom,
484
+ 0px
485
+ );
486
+ }
487
+ .m-fields-group-list.is-footer-sticky > .m-fields-group-list-item {
488
+ --m-group-list-item-footer-bottom: calc(
489
+ var(--m-group-list-nested-footer-bottom, 0px) +
490
+ var(--m-group-list-footer-height)
491
+ );
492
+ }
493
+ .m-fields-group-list .m-fields-group-list-item .m-fields-group-list {
494
+ --m-group-list-nested-footer-bottom: var(
495
+ --m-group-list-item-footer-bottom,
496
+ 0px
497
+ );
498
+ }
499
+ .m-fields-group-list.is-header-sticky {
500
+ --m-group-list-nested-sticky-top: var(--m-group-list-child-list-sticky-top);
501
+ --m-group-list-nested-header-z: var(--m-group-list-child-list-header-z);
502
+ }
503
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item {
504
+ --m-group-list-item-sticky-top: var(
505
+ --m-group-list-nested-sticky-top,
506
+ var(--m-group-list-header-sticky-top, 0px)
507
+ );
508
+ --m-group-list-item-header-z: var(--m-group-list-nested-header-z, 7);
509
+ --m-group-list-child-list-sticky-top: calc(
510
+ var(--m-group-list-item-sticky-top) + var(--m-group-list-header-height)
511
+ );
512
+ --m-group-list-child-list-header-z: calc(
513
+ var(--m-group-list-item-header-z) - 1
514
+ );
515
+ }
516
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .el-card__header,
517
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .t-card__header {
483
518
  position: sticky;
484
- top: var(--m-group-list-header-sticky-top, 0px);
485
- z-index: 7;
519
+ top: var(--m-group-list-item-sticky-top);
520
+ z-index: var(--m-group-list-item-header-z);
486
521
  background-color: var(--m-group-list-header-bg, #fff);
487
522
  }
488
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .el-card__header,
489
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .t-card__header {
490
- top: calc(var(--m-group-list-header-sticky-top, 0px) + var(--m-group-list-header-height));
491
- z-index: 6;
492
- }
493
523
  .m-fields-group-list .el-table__empty-block {
494
524
  width: 100%;
495
525
  min-height: 0;
@@ -507,7 +537,7 @@ fieldset.m-fieldset .m-form-tip {
507
537
  }
508
538
  .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
509
539
  position: sticky;
510
- bottom: 0;
540
+ bottom: var(--m-group-list-nested-footer-bottom, 0px);
511
541
  z-index: 7;
512
542
  margin-bottom: 0;
513
543
  padding: var(--m-group-list-footer-padding-top) 0 var(--m-group-list-footer-padding-bottom);
@@ -521,10 +551,6 @@ fieldset.m-fieldset .m-form-tip {
521
551
  width: 100%;
522
552
  height: var(--m-group-list-footer-button-height);
523
553
  }
524
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
525
- bottom: var(--m-group-list-footer-height);
526
- z-index: 7;
527
- }
528
554
 
529
555
  /** 最外层的groupList需要每个item需要增加空白区域界限时,增加outer-gorup_list可以实现 */
530
556
  .m-container-group-list.outer-gorup_list > .m-fields-group-list > .m-fields-group-list-item {
@@ -1369,7 +1395,7 @@ fieldset.m-fieldset .m-form-tip {
1369
1395
  left: 40px;
1370
1396
  width: calc(100% - 40px);
1371
1397
  text-align: center;
1372
- background-color: rgba(252.5, 245.7, 235.5, 0.9);
1398
+ background-color: rgba(99.0196078431%, 96.3529411765%, 92.3529411765%, 0.9);
1373
1399
  color: #e6a23c;
1374
1400
  padding: 5px 0;
1375
1401
  font-size: 12px;
@@ -83,8 +83,10 @@ var removeConflictPosition = (style, primary, secondary) => {
83
83
  const secondaryInvalid = isInvalid(secondaryValue);
84
84
  if (primaryInvalid && !secondaryInvalid) delete style[primary];
85
85
  else if (secondaryInvalid && !primaryInvalid) delete style[secondary];
86
- else if (primaryInvalid && secondaryInvalid) if (secondaryValue === 0 && primaryValue !== 0) delete style[primary];
87
- else delete style[secondary];
86
+ else if (primaryInvalid && secondaryInvalid) {
87
+ if (secondaryValue === 0 && primaryValue !== 0) delete style[primary];
88
+ else delete style[secondary];
89
+ }
88
90
  };
89
91
  var getInitPositionStyle = (style = {}, layout) => {
90
92
  if (layout === Layout.ABSOLUTE) {
package/dist/style.css CHANGED
@@ -478,18 +478,48 @@ fieldset.m-fieldset .m-form-tip {
478
478
  flex-shrink: 0;
479
479
  gap: 8px;
480
480
  }
481
- .m-fields-group-list .m-fields-group-list-item > .el-card__header,
482
- .m-fields-group-list .m-fields-group-list-item > .t-card__header {
481
+ .m-fields-group-list > .m-fields-group-list-item {
482
+ --m-group-list-item-footer-bottom: var(
483
+ --m-group-list-nested-footer-bottom,
484
+ 0px
485
+ );
486
+ }
487
+ .m-fields-group-list.is-footer-sticky > .m-fields-group-list-item {
488
+ --m-group-list-item-footer-bottom: calc(
489
+ var(--m-group-list-nested-footer-bottom, 0px) +
490
+ var(--m-group-list-footer-height)
491
+ );
492
+ }
493
+ .m-fields-group-list .m-fields-group-list-item .m-fields-group-list {
494
+ --m-group-list-nested-footer-bottom: var(
495
+ --m-group-list-item-footer-bottom,
496
+ 0px
497
+ );
498
+ }
499
+ .m-fields-group-list.is-header-sticky {
500
+ --m-group-list-nested-sticky-top: var(--m-group-list-child-list-sticky-top);
501
+ --m-group-list-nested-header-z: var(--m-group-list-child-list-header-z);
502
+ }
503
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item {
504
+ --m-group-list-item-sticky-top: var(
505
+ --m-group-list-nested-sticky-top,
506
+ var(--m-group-list-header-sticky-top, 0px)
507
+ );
508
+ --m-group-list-item-header-z: var(--m-group-list-nested-header-z, 7);
509
+ --m-group-list-child-list-sticky-top: calc(
510
+ var(--m-group-list-item-sticky-top) + var(--m-group-list-header-height)
511
+ );
512
+ --m-group-list-child-list-header-z: calc(
513
+ var(--m-group-list-item-header-z) - 1
514
+ );
515
+ }
516
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .el-card__header,
517
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .t-card__header {
483
518
  position: sticky;
484
- top: var(--m-group-list-header-sticky-top, 0px);
485
- z-index: 7;
519
+ top: var(--m-group-list-item-sticky-top);
520
+ z-index: var(--m-group-list-item-header-z);
486
521
  background-color: var(--m-group-list-header-bg, #fff);
487
522
  }
488
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .el-card__header,
489
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .t-card__header {
490
- top: calc(var(--m-group-list-header-sticky-top, 0px) + var(--m-group-list-header-height));
491
- z-index: 6;
492
- }
493
523
  .m-fields-group-list .el-table__empty-block {
494
524
  width: 100%;
495
525
  min-height: 0;
@@ -507,7 +537,7 @@ fieldset.m-fieldset .m-form-tip {
507
537
  }
508
538
  .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
509
539
  position: sticky;
510
- bottom: 0;
540
+ bottom: var(--m-group-list-nested-footer-bottom, 0px);
511
541
  z-index: 7;
512
542
  margin-bottom: 0;
513
543
  padding: var(--m-group-list-footer-padding-top) 0 var(--m-group-list-footer-padding-bottom);
@@ -521,10 +551,6 @@ fieldset.m-fieldset .m-form-tip {
521
551
  width: 100%;
522
552
  height: var(--m-group-list-footer-button-height);
523
553
  }
524
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
525
- bottom: var(--m-group-list-footer-height);
526
- z-index: 7;
527
- }
528
554
 
529
555
  /** 最外层的groupList需要每个item需要增加空白区域界限时,增加outer-gorup_list可以实现 */
530
556
  .m-container-group-list.outer-gorup_list > .m-fields-group-list > .m-fields-group-list-item {
@@ -1369,7 +1395,7 @@ fieldset.m-fieldset .m-form-tip {
1369
1395
  left: 40px;
1370
1396
  width: calc(100% - 40px);
1371
1397
  text-align: center;
1372
- background-color: rgba(252.5, 245.7, 235.5, 0.9);
1398
+ background-color: rgba(99.0196078431%, 96.3529411765%, 92.3529411765%, 0.9);
1373
1399
  color: #e6a23c;
1374
1400
  padding: 5px 0;
1375
1401
  font-size: 12px;
@@ -509,18 +509,48 @@ fieldset.m-fieldset .m-form-tip {
509
509
  flex-shrink: 0;
510
510
  gap: 8px;
511
511
  }
512
- .m-fields-group-list .m-fields-group-list-item > .el-card__header,
513
- .m-fields-group-list .m-fields-group-list-item > .t-card__header {
512
+ .m-fields-group-list > .m-fields-group-list-item {
513
+ --m-group-list-item-footer-bottom: var(
514
+ --m-group-list-nested-footer-bottom,
515
+ 0px
516
+ );
517
+ }
518
+ .m-fields-group-list.is-footer-sticky > .m-fields-group-list-item {
519
+ --m-group-list-item-footer-bottom: calc(
520
+ var(--m-group-list-nested-footer-bottom, 0px) +
521
+ var(--m-group-list-footer-height)
522
+ );
523
+ }
524
+ .m-fields-group-list .m-fields-group-list-item .m-fields-group-list {
525
+ --m-group-list-nested-footer-bottom: var(
526
+ --m-group-list-item-footer-bottom,
527
+ 0px
528
+ );
529
+ }
530
+ .m-fields-group-list.is-header-sticky {
531
+ --m-group-list-nested-sticky-top: var(--m-group-list-child-list-sticky-top);
532
+ --m-group-list-nested-header-z: var(--m-group-list-child-list-header-z);
533
+ }
534
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item {
535
+ --m-group-list-item-sticky-top: var(
536
+ --m-group-list-nested-sticky-top,
537
+ var(--m-group-list-header-sticky-top, 0px)
538
+ );
539
+ --m-group-list-item-header-z: var(--m-group-list-nested-header-z, 7);
540
+ --m-group-list-child-list-sticky-top: calc(
541
+ var(--m-group-list-item-sticky-top) + var(--m-group-list-header-height)
542
+ );
543
+ --m-group-list-child-list-header-z: calc(
544
+ var(--m-group-list-item-header-z) - 1
545
+ );
546
+ }
547
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .el-card__header,
548
+ .m-fields-group-list.is-header-sticky > .m-fields-group-list-item > .t-card__header {
514
549
  position: sticky;
515
- top: var(--m-group-list-header-sticky-top, 0px);
516
- z-index: 7;
550
+ top: var(--m-group-list-item-sticky-top);
551
+ z-index: var(--m-group-list-item-header-z);
517
552
  background-color: var(--m-group-list-header-bg, #fff);
518
553
  }
519
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .el-card__header,
520
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list-item > .t-card__header {
521
- top: calc(var(--m-group-list-header-sticky-top, 0px) + var(--m-group-list-header-height));
522
- z-index: 6;
523
- }
524
554
  .m-fields-group-list .el-table__empty-block {
525
555
  width: 100%;
526
556
  min-height: 0;
@@ -538,7 +568,7 @@ fieldset.m-fieldset .m-form-tip {
538
568
  }
539
569
  .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
540
570
  position: sticky;
541
- bottom: 0;
571
+ bottom: var(--m-group-list-nested-footer-bottom, 0px);
542
572
  z-index: 7;
543
573
  margin-bottom: 0;
544
574
  padding: var(--m-group-list-footer-padding-top) 0 var(--m-group-list-footer-padding-bottom);
@@ -552,10 +582,6 @@ fieldset.m-fieldset .m-form-tip {
552
582
  width: 100%;
553
583
  height: var(--m-group-list-footer-button-height);
554
584
  }
555
- .m-fields-group-list .m-fields-group-list-item .m-fields-group-list > .m-fields-group-list-footer.is-sticky-full {
556
- bottom: var(--m-group-list-footer-height);
557
- z-index: 7;
558
- }
559
585
 
560
586
  /** 最外层的groupList需要每个item需要增加空白区域界限时,增加outer-gorup_list可以实现 */
561
587
  .m-container-group-list.outer-gorup_list > .m-fields-group-list > .m-fields-group-list-item {
@@ -1455,7 +1481,7 @@ fieldset.m-fieldset .m-form-tip {
1455
1481
  left: 40px;
1456
1482
  width: calc(100% - 40px);
1457
1483
  text-align: center;
1458
- background-color: rgba(252.5, 245.7, 235.5, 0.9);
1484
+ background-color: rgba(99.0196078431%, 96.3529411765%, 92.3529411765%, 0.9);
1459
1485
  color: #e6a23c;
1460
1486
  padding: 5px 0;
1461
1487
  font-size: 12px;