@weitutech/by-components-v3 1.1.18 → 1.1.20

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.
@@ -120294,17 +120294,43 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
120294
120294
  const setDraggableMenu = (arr) => {
120295
120295
  const left = { title: "左固定", field: "left", children: [] };
120296
120296
  const right = { title: "右固定", field: "right", children: [] };
120297
- const filteredArr = arr.filter((item) => {
120298
- if (!item.children && item.fixed === "left") {
120299
- left.children.push(item);
120300
- return false;
120297
+ const filteredArr = arr.reduce((result, item) => {
120298
+ if (!item.children || item.children.length === 0) {
120299
+ if (item.fixed === "left") {
120300
+ left.children.push(item);
120301
+ return result;
120302
+ }
120303
+ if (item.fixed === "right") {
120304
+ right.children.push(item);
120305
+ return result;
120306
+ }
120307
+ result.push(item);
120308
+ return result;
120301
120309
  }
120302
- if (!item.children && item.fixed === "right") {
120303
- right.children.push(item);
120304
- return false;
120310
+ const defaultDirection = item.fixed === "left" || item.fixed === "right" ? item.fixed : "";
120311
+ const remainedChildren = [];
120312
+ item.children.forEach((child) => {
120313
+ const direction2 = child.fixed === "left" || child.fixed === "right" ? child.fixed : defaultDirection;
120314
+ if (direction2 === "left" || direction2 === "right") {
120315
+ const fixedGroup = direction2 === "left" ? left : right;
120316
+ fixedGroup.children.push({
120317
+ ...child,
120318
+ fixed: direction2,
120319
+ parentColTitle: child.parentColTitle || item.title
120320
+ });
120321
+ return;
120322
+ }
120323
+ remainedChildren.push(child);
120324
+ });
120325
+ if (remainedChildren.length > 0) {
120326
+ result.push({
120327
+ ...item,
120328
+ fixed: void 0,
120329
+ children: remainedChildren
120330
+ });
120305
120331
  }
120306
- return true;
120307
- });
120332
+ return result;
120333
+ }, []);
120308
120334
  return [left, right, ...filteredArr];
120309
120335
  };
120310
120336
  if (bePreservedColumn && bePreservedColumn.length > 0) {
@@ -120777,7 +120803,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
120777
120803
  };
120778
120804
  }
120779
120805
  });
120780
- const CustomColumn = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__scopeId", "data-v-9bcdfbf0"]]);
120806
+ const CustomColumn = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__scopeId", "data-v-c41a9a02"]]);
120781
120807
  const isCachedTableColumns = (name) => {
120782
120808
  if (!name) return false;
120783
120809
  return !!localStorage.getItem(name);
@@ -122113,28 +122139,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
122113
122139
  ])
122114
122140
  ]),
122115
122141
  _ctx.showFooter ? (openBlock(), createElementBlock("div", _hoisted_3, [
122116
- renderSlot(_ctx.$slots, "footer", {}, () => [
122117
- createElementVNode("div", _hoisted_4, [
122118
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttons, (button, index) => {
122119
- return openBlock(), createBlock(_component_el_button, {
122120
- key: index,
122121
- type: button.type || "default",
122122
- size: button.size || "medium",
122123
- loading: button.loading,
122124
- disabled: button.disabled,
122125
- class: normalizeClass(button.class),
122126
- style: normalizeStyle(button.style),
122127
- icon: button.icon,
122128
- onClick: ($event) => handleButtonClick(button, index)
122129
- }, {
122130
- default: withCtx(() => [
122131
- createTextVNode(toDisplayString(button.text), 1)
122132
- ]),
122133
- _: 2
122134
- }, 1032, ["type", "size", "loading", "disabled", "class", "style", "icon", "onClick"]);
122135
- }), 128))
122136
- ])
122137
- ])
122142
+ createElementVNode("div", _hoisted_4, [
122143
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttons, (button, index) => {
122144
+ return openBlock(), createBlock(_component_el_button, {
122145
+ key: index,
122146
+ type: button.type || "default",
122147
+ size: button.size || "medium",
122148
+ loading: button.loading,
122149
+ disabled: button.disabled,
122150
+ class: normalizeClass(button.class),
122151
+ style: normalizeStyle(button.style),
122152
+ icon: button.icon,
122153
+ onClick: ($event) => handleButtonClick(button, index)
122154
+ }, {
122155
+ default: withCtx(() => [
122156
+ createTextVNode(toDisplayString(button.text), 1)
122157
+ ]),
122158
+ _: 2
122159
+ }, 1032, ["type", "size", "loading", "disabled", "class", "style", "icon", "onClick"]);
122160
+ }), 128))
122161
+ ]),
122162
+ renderSlot(_ctx.$slots, "footer")
122138
122163
  ])) : createCommentVNode("", true)
122139
122164
  ]),
122140
122165
  _: 3