@unizhen/ui 0.1.69 → 0.1.70

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.
@@ -16,7 +16,4 @@ export declare const fnThrottle: (fn: Fn, wait?: number) => Fn;
16
16
  export declare function fnFullScreen(element: any, callback?: Fn): void;
17
17
  export declare function fnFormatUnits(number: number, precision?: number): string;
18
18
  export declare function fnFilterByPinyinInitials(item: string, keyword: string): boolean;
19
- export declare function mergeColumns(firstList: ObjectKey[], secondList: ObjectKey[]): {
20
- [x: string]: any;
21
- [x: number]: any;
22
- }[];
19
+ export declare function mergeColumns(firstList: ObjectKey[], secondList: ObjectKey[]): ObjectKey[];
@@ -8084,9 +8084,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
8084
8084
  };
8085
8085
  }>> & Readonly<{}>, {
8086
8086
  disabled: boolean;
8087
+ item: IUzFormItem;
8087
8088
  clearable: boolean;
8088
8089
  status: number;
8089
- item: IUzFormItem;
8090
8090
  formValue: ObjectKey;
8091
8091
  itemIndex: number;
8092
8092
  }, {}, {
@@ -8084,9 +8084,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
8084
8084
  };
8085
8085
  }>> & Readonly<{}>, {
8086
8086
  disabled: boolean;
8087
+ item: IUzFormItem;
8087
8088
  clearable: boolean;
8088
8089
  status: number;
8089
- item: IUzFormItem;
8090
8090
  formValue: ObjectKey;
8091
8091
  itemIndex: number;
8092
8092
  }, {}, {
@@ -105,9 +105,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
105
105
  };
106
106
  }>> & Readonly<{}>, {
107
107
  disabled: boolean;
108
+ item: IUzFormItem;
108
109
  clearable: boolean;
109
110
  status: number;
110
- item: IUzFormItem;
111
111
  formValue: ObjectKey;
112
112
  itemIndex: number;
113
113
  }, {}, {
@@ -58,9 +58,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
58
58
  }>> & Readonly<{
59
59
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
60
60
  }>, {
61
+ item: IUzFormItemUpload;
61
62
  value: string | ObjectKey | null;
62
63
  status: number;
63
- item: IUzFormItemUpload;
64
64
  }, {}, {
65
65
  NUpload: DefineComponent<ExtractPropTypes<{
66
66
  readonly name: {
@@ -3829,9 +3829,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
3829
3829
  };
3830
3830
  }>> & Readonly<{}>, {
3831
3831
  disabled: boolean;
3832
+ item: IUzFormItem;
3832
3833
  clearable: boolean;
3833
3834
  status: number;
3834
- item: IUzFormItem;
3835
3835
  formValue: ObjectKey;
3836
3836
  itemIndex: number;
3837
3837
  }, {}, {
@@ -3995,9 +3995,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
3995
3995
  };
3996
3996
  }>> & Readonly<{}>, {
3997
3997
  disabled: boolean;
3998
+ item: IUzFormItem;
3998
3999
  clearable: boolean;
3999
4000
  status: number;
4000
- item: IUzFormItem;
4001
4001
  formValue: ObjectKey;
4002
4002
  itemIndex: number;
4003
4003
  }, {}, {
@@ -60,9 +60,9 @@ declare const __VLS_export: DefineComponent<ExtractPropTypes<{
60
60
  }>> & Readonly<{
61
61
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
62
62
  }>, {
63
+ item: IUzFormItemSubTable;
63
64
  value: any[];
64
65
  status: number;
65
- item: IUzFormItemSubTable;
66
66
  }, {}, {
67
67
  NSpin: DefineComponent<ExtractPropTypes<{
68
68
  strokeWidth: {
package/lib/ui.js CHANGED
@@ -2349,15 +2349,15 @@ function vd(e, t) {
2349
2349
  return n === "" || e.toLowerCase().includes(n) || _d(e).includes(n);
2350
2350
  }
2351
2351
  function yd(e, t) {
2352
- let n = new Map(e.map((e) => [e.key, e])), r = new Map(t.map((e) => [e.key, e])), i = r.get("action") || n.get("action"), a = t.filter((e) => e.key !== "action").map((e) => ({
2353
- ...n.get(e.key) || {},
2354
- ...e
2355
- })), o = e.filter((e) => !r.has(e.key) && e.key !== "action");
2356
- return [
2357
- ...a,
2358
- ...o.map((e) => ({ ...e })),
2359
- ...i ? [{ ...i }] : []
2360
- ];
2352
+ e.forEach((e) => {
2353
+ let n = t.find((t) => t.key === e.key);
2354
+ n && (e.hide = n.hide, e.show = n.show, e.width = n.width);
2355
+ });
2356
+ let n = new Map(t.map((e, t) => [e.key, t])), r = (e) => e.type === "expand" ? -2 : e.key === "index" ? -1 : e.key === "action" ? 2 ** 53 - 1 : n.has(e.key) ? n.get(e.key) : 2 ** 53 - 1 - 1;
2357
+ return e.map((e, t) => ({
2358
+ item: e,
2359
+ index: t
2360
+ })).sort((e, t) => r(e.item) - r(t.item) || e.index - t.index).map(({ item: e }) => e);
2361
2361
  }
2362
2362
  //#endregion
2363
2363
  //#region components/fetch.ts
@@ -6114,8 +6114,8 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6114
6114
  }
6115
6115
  }, Se = async () => {
6116
6116
  I.value = !1, Np();
6117
- let { tableColumns: t, search: n, subTableIds: r, subTableExpand: i } = await Up(A.value, e.child, 0, () => ({}), ie), s = 0;
6118
- !c.value && F.value.index && (t.unshift({
6117
+ let { tableColumns: t, search: n, subTableIds: r, subTableExpand: i } = await Up(A.value, e.child, 0, () => ({}), ie);
6118
+ !c.value && F.value.index && t.unshift({
6119
6119
  title: "#",
6120
6120
  key: "index",
6121
6121
  align: "center",
@@ -6130,7 +6130,7 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6130
6130
  return (e - 1) * n + (t + 1);
6131
6131
  } });
6132
6132
  }
6133
- }), s += 60), !c.value && (e.selection || F.value.selection !== 0) && (t.unshift({
6133
+ }), !c.value && (e.selection || F.value.selection !== 0) && t.unshift({
6134
6134
  type: "selection",
6135
6135
  fixed: "left",
6136
6136
  width: 60,
@@ -6138,8 +6138,8 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6138
6138
  show: !0,
6139
6139
  multiple: e.selection === 2 || F.value.selection === 2,
6140
6140
  options: ["all", "none"]
6141
- }), s += 60);
6142
- let l = e.id || a.params.id;
6141
+ });
6142
+ let s = e.id || a.params.id;
6143
6143
  if (!c.value && F.value.commonTime && t.push(..._e()), e.enableAction === !0 && M.value && M.value.length > 0) {
6144
6144
  let e = H(M.value);
6145
6145
  for (let t of e) t.type === "group" ? t.children.forEach((e) => {
@@ -6150,42 +6150,45 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6150
6150
  key: "action",
6151
6151
  align: "center",
6152
6152
  fixed: "right",
6153
- width: F.value.actionWidth,
6154
6153
  resizable: !1,
6155
6154
  checked: !0,
6156
6155
  show: !0,
6157
6156
  hide: !0,
6157
+ width: Number(typeof F.value.actionWidth == "string" ? F.value.actionWidth.replace("px", "") : F.value.actionWidth),
6158
6158
  render(t) {
6159
6159
  return Wd({
6160
6160
  buttons: e,
6161
6161
  rowData: t,
6162
6162
  callback: R,
6163
- tableId: l
6163
+ tableId: s
6164
6164
  });
6165
6165
  }
6166
6166
  };
6167
- s += Number(typeof F.value.actionWidth == "string" ? F.value.actionWidth.replace("px", "") : F.value.actionWidth), t.push(n);
6167
+ t.push(n);
6168
6168
  }
6169
- let u = t;
6170
- if (l) {
6171
- let e = Y(`tables_filter_${l}`, !1);
6169
+ let l = t;
6170
+ if (s) {
6171
+ let e = Y(`tables_filter_${s}`, !1);
6172
6172
  if (e) try {
6173
- let n = await Id(l);
6174
- n && (e = JSON.parse(n), u = yd(t, e));
6173
+ let n = await Id(s);
6174
+ n && (e = JSON.parse(n), l = yd(t, e));
6175
6175
  } catch {}
6176
6176
  }
6177
- i.link && (u.unshift({
6177
+ i.link && l.unshift({
6178
6178
  type: "expand",
6179
6179
  show: !0,
6180
6180
  hide: !0,
6181
+ width: 40,
6181
6182
  fixed: "left",
6182
6183
  renderExpand: (e) => f(Yp, {
6183
6184
  data: i,
6184
6185
  value: e
6185
6186
  })
6186
- }), s += 40), u.forEach((e) => {
6187
- s += Number(e.width);
6188
- }), C.value = u, ee.value = n, E.value = s;
6187
+ });
6188
+ let u = 0;
6189
+ l.forEach((e) => {
6190
+ e.show && (u += Number(e.width || 140));
6191
+ }), C.value = l, ee.value = n, E.value = u;
6189
6192
  }, Ce = (e) => typeof e == "number" ? `${e}px` : e, we = () => {
6190
6193
  if (e.height) {
6191
6194
  let t = Ce(e.height);
@@ -6194,14 +6197,19 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6194
6197
  }
6195
6198
  }, Te = (t) => {
6196
6199
  let n = e.id || a.params.id;
6197
- n && (J(`tables_filter_${n}`, t), Ld({
6198
- table_id: n,
6199
- data: JSON.stringify(t)
6200
- }).catch(() => null));
6200
+ if (n) {
6201
+ let e = 0;
6202
+ C.value.forEach((t) => {
6203
+ t.show && (e += Number(t.width || 140));
6204
+ }), E.value = e, J(`tables_filter_${n}`, t.filter((e) => e.key)), Ld({
6205
+ table_id: n,
6206
+ data: JSON.stringify(t)
6207
+ }).catch(() => null);
6208
+ }
6201
6209
  }, { run: Ee } = Tp(Te), { run: De } = Tp((e, t) => {
6202
6210
  let n = [];
6203
6211
  C.value.forEach((r) => {
6204
- (r.key !== "action" || r.type !== "expand") && n.push({
6212
+ r.key !== "action" && r.key !== "index" && r.type !== "expand" && n.push({
6205
6213
  key: r.key,
6206
6214
  show: r.show,
6207
6215
  hide: r.hide,
@@ -6212,7 +6220,7 @@ var Yp = /*#__PURE__*/ U(qp, [["render", Jp]]), Xp = d({
6212
6220
  }), B = () => {
6213
6221
  let e = [];
6214
6222
  C.value.forEach((t) => {
6215
- (t.key !== "action" || t.type !== "expand") && e.push({
6223
+ t.key !== "action" && t.key !== "index" && t.type !== "expand" && e.push({
6216
6224
  key: t.key,
6217
6225
  show: t.show,
6218
6226
  hide: t.hide,
@@ -8521,7 +8529,7 @@ function qh(e, t, n) {
8521
8529
  }
8522
8530
  //#endregion
8523
8531
  //#region package.json
8524
- var Jh = "0.1.69", Yh;
8532
+ var Jh = "0.1.70", Yh;
8525
8533
  async function Xh() {
8526
8534
  let e = await fetch(`${window.location.protocol}//${window.location.host}`, {
8527
8535
  method: "HEAD",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizhen/ui",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "author": {
5
5
  "name": "Donovan"
6
6
  },