geekplus-digital-ui 0.2.8 → 0.2.9

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.
@@ -4,62 +4,62 @@ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
4
  import n from "../../icon/index.js";
5
5
  import r from "../../icons/filter-list-light.vue.js";
6
6
  import i from "../../icons/grip-dots-vertical-solid.vue.js";
7
- import './table-filter.vue_vue_type_style_index_0_scoped_023a2c22_lang.css';/* empty css */
7
+ import './table-filter.vue_vue_type_style_index_0_scoped_106f6a04_lang.css';/* empty css */
8
8
  import "../../index.js";
9
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, inject as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
10
- import { ElButton as b, ElCheckbox as x, ElPopover as S } from "element-plus";
11
- import { useSortable as C } from "@vueuse/integrations/useSortable";
9
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, inject as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
10
+ import { ElButton as x, ElCheckbox as S, ElPopover as C } from "element-plus";
11
+ import { useSortable as w } from "@vueuse/integrations/useSortable";
12
12
  //#region packages/components/table/src/table-filter.vue
13
- var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body" }, E = {
13
+ var T = { class: "d-table-filter__header" }, E = { class: "d-table-filter__body" }, D = {
14
14
  key: 0,
15
15
  class: "d-table-filter__group-label"
16
- }, D = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DTableFilter" }, {
16
+ }, O = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DTableFilter" }, {
17
17
  __name: "table-filter",
18
18
  setup(t) {
19
- let { t: D } = e(), { columnList: O, checkedKeys: k, columnOrder: A, columnFixed: j, saveConfig: M } = p("dTableContext"), N = h(!1), P = h([]), F = h([]), I = h({}), L = (e) => Object.prototype.hasOwnProperty.call(I.value, e) ? I.value[e] : O.value.find((t) => t.prop === e)?.fixed ?? !1, R = (e) => {
20
- let t = F.value.map((t) => {
21
- let n = O.value.find((e) => e.prop === t);
22
- return !n || L(t) !== e ? null : n;
23
- }).filter(Boolean), n = O.value.filter((t) => L(t.prop) === e && !F.value.includes(t.prop));
19
+ let { t: O } = e(), { columnList: k, checkedKeys: A, columnOrder: j, columnFixed: M, saveConfig: N } = p("dTableContext"), P = h(!1), F = h([]), I = h([]), L = h({}), R = (e) => Object.prototype.hasOwnProperty.call(L.value, e) ? L.value[e] : k.value.find((t) => t.prop === e)?.fixed ?? !1, z = (e) => {
20
+ let t = I.value.map((t) => {
21
+ let n = k.value.find((e) => e.prop === t);
22
+ return !n || R(t) !== e ? null : n;
23
+ }).filter(Boolean), n = k.value.filter((t) => R(t.prop) === e && !I.value.includes(t.prop));
24
24
  return [...t, ...n];
25
- }, z = o(() => ({
26
- left: R("left"),
27
- middle: R(!1),
28
- right: R("right")
29
- })), B = o(() => [
25
+ }, B = o(() => ({
26
+ left: z("left"),
27
+ middle: z(!1),
28
+ right: z("right")
29
+ })), V = o(() => [
30
30
  {
31
31
  key: "left",
32
32
  labelKey: "d.table.fixedLeft",
33
- items: z.value.left,
33
+ items: B.value.left,
34
34
  showLabel: !0
35
35
  },
36
36
  {
37
37
  key: "middle",
38
38
  labelKey: "d.table.columns",
39
- items: z.value.middle,
39
+ items: B.value.middle,
40
40
  showLabel: !0
41
41
  },
42
42
  {
43
43
  key: "right",
44
44
  labelKey: "d.table.fixedRight",
45
- items: z.value.right,
45
+ items: B.value.right,
46
46
  showLabel: !0
47
47
  }
48
- ]), V = {
48
+ ]), H = {
49
49
  left: h(null),
50
50
  middle: h(null),
51
51
  right: h(null)
52
- }, H = (e, t) => {
53
- V[t].value = e;
54
- }, U = (e) => Object.keys(V).find((t) => V[t].value === e), W = {
52
+ }, U = (e, t) => {
53
+ H[t].value = e;
54
+ }, W = (e) => Object.keys(H).find((t) => H[t].value === e), G = {
55
55
  left: "left",
56
56
  middle: !1,
57
57
  right: "right"
58
- }, G = (e) => (t) => {
59
- let { from: n, to: r, oldIndex: i, newIndex: a } = t, o = U(r) ?? e, s = {
60
- left: [...z.value.left.map((e) => e.prop)],
61
- middle: [...z.value.middle.map((e) => e.prop)],
62
- right: [...z.value.right.map((e) => e.prop)]
58
+ }, K = (e) => (t) => {
59
+ let { from: n, to: r, oldIndex: i, newIndex: a } = t, o = W(r) ?? e, s = {
60
+ left: [...B.value.left.map((e) => e.prop)],
61
+ middle: [...B.value.middle.map((e) => e.prop)],
62
+ right: [...B.value.right.map((e) => e.prop)]
63
63
  };
64
64
  if (n === r) {
65
65
  if (i === a) return;
@@ -68,17 +68,17 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
68
68
  } else {
69
69
  let t = s[e][i];
70
70
  if (!t) return;
71
- s[e].splice(i, 1), s[o].splice(a, 0, t), I.value = {
72
- ...I.value,
73
- [t]: W[o]
71
+ s[e].splice(i, 1), s[o].splice(a, 0, t), L.value = {
72
+ ...L.value,
73
+ [t]: G[o]
74
74
  };
75
75
  }
76
- F.value = [
76
+ I.value = [
77
77
  ...s.left,
78
78
  ...s.middle,
79
79
  ...s.right
80
80
  ];
81
- }, K = (e) => ({
81
+ }, q = (e) => ({
82
82
  handle: ".d-table-filter__handle",
83
83
  animation: 150,
84
84
  group: {
@@ -89,89 +89,91 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
89
89
  onUpdate: () => {},
90
90
  onAdd: () => {},
91
91
  onRemove: () => {},
92
- onEnd: G(e)
93
- }), q = {
94
- left: C(V.left, o(() => z.value.left), K("left")),
95
- middle: C(V.middle, o(() => z.value.middle), K("middle")),
96
- right: C(V.right, o(() => z.value.right), K("right"))
97
- }, J = () => {
98
- Object.values(q).forEach((e) => {
92
+ onEnd: K(e)
93
+ }), J = {
94
+ left: w(H.left, o(() => B.value.left), q("left")),
95
+ middle: w(H.middle, o(() => B.value.middle), q("middle")),
96
+ right: w(H.right, o(() => B.value.right), q("right"))
97
+ }, Y = () => {
98
+ Object.values(J).forEach((e) => {
99
99
  e.stop(), e.start();
100
100
  });
101
- }, Y = () => {
102
- P.value = [...k.value], F.value = [...A.value], I.value = { ...j.value }, J();
103
- }, X = (e, t) => {
104
- if (t) P.value.includes(e) || (P.value = [...P.value, e]);
101
+ };
102
+ y(P, (e) => {
103
+ e && (F.value = [...A.value], I.value = [...j.value], L.value = { ...M.value });
104
+ }, { flush: "sync" });
105
+ let X = (e, t) => {
106
+ if (t) F.value.includes(e) || (F.value = [...F.value, e]);
105
107
  else {
106
- if (P.value.length <= 1) return;
107
- P.value = P.value.filter((t) => t !== e);
108
+ if (F.value.length <= 1) return;
109
+ F.value = F.value.filter((t) => t !== e);
108
110
  }
109
111
  }, Z = () => {
110
- let e = O.value.map((e) => e.prop);
111
- P.value = e, F.value = e, I.value = {};
112
+ let e = k.value.map((e) => e.prop);
113
+ F.value = e, I.value = e, L.value = {};
112
114
  }, Q = () => {
113
- k.value = [...P.value], A.value = [...F.value], j.value = { ...I.value }, M(), N.value = !1;
115
+ A.value = [...F.value], j.value = [...I.value], M.value = { ...L.value }, N(), P.value = !1;
114
116
  }, $ = () => {
115
- N.value = !1;
117
+ P.value = !1;
116
118
  };
117
- return (e, t) => (m(), s(v(S), {
118
- visible: N.value,
119
- "onUpdate:visible": t[0] ||= (e) => N.value = e,
119
+ return (e, t) => (m(), s(v(C), {
120
+ visible: P.value,
121
+ "onUpdate:visible": t[0] ||= (e) => P.value = e,
120
122
  placement: "bottom-end",
121
123
  width: "auto",
122
124
  trigger: "click",
123
125
  onShow: Y
124
126
  }, {
125
- reference: y(() => [f(v(b), {
127
+ reference: b(() => [f(v(x), {
126
128
  link: "",
127
129
  style: { "font-size": "16px" }
128
130
  }, {
129
- default: y(() => [f(v(n), null, {
130
- default: y(() => [f(r)]),
131
+ default: b(() => [f(v(n), null, {
132
+ default: b(() => [f(r)]),
131
133
  _: 1
132
134
  })]),
133
135
  _: 1
134
136
  })]),
135
- default: y(() => [u("div", w, [
136
- f(v(b), {
137
+ default: b(() => [u("div", T, [
138
+ f(v(x), {
137
139
  link: "",
138
140
  onClick: $
139
141
  }, {
140
- default: y(() => [d(_(v(D)("d.table.cancel")), 1)]),
142
+ default: b(() => [d(_(v(O)("d.table.cancel")), 1)]),
141
143
  _: 1
142
144
  }),
143
- f(v(b), {
145
+ f(v(x), {
144
146
  link: "",
145
147
  type: "primary",
146
148
  onClick: Z
147
149
  }, {
148
- default: y(() => [d(_(v(D)("d.table.reset")), 1)]),
150
+ default: b(() => [d(_(v(O)("d.table.reset")), 1)]),
149
151
  _: 1
150
152
  }),
151
- f(v(b), {
153
+ f(v(x), {
152
154
  link: "",
153
155
  type: "primary",
154
156
  onClick: Q
155
157
  }, {
156
- default: y(() => [d(_(v(D)("d.table.confirm")), 1)]),
158
+ default: b(() => [d(_(v(O)("d.table.confirm")), 1)]),
157
159
  _: 1
158
160
  })
159
- ]), u("div", T, [(m(!0), l(a, null, g(B.value, (e) => (m(), l(a, { key: e.key }, [e.showLabel ? (m(), l("div", E, _(v(D)(e.labelKey)), 1)) : c("", !0), u("ul", {
161
+ ]), u("div", E, [(m(!0), l(a, null, g(V.value, (e) => (m(), l(a, { key: e.key }, [e.showLabel ? (m(), l("div", D, _(v(O)(e.labelKey)), 1)) : c("", !0), u("ul", {
160
162
  ref_for: !0,
161
- ref: (t) => H(t, e.key),
163
+ ref: (t) => U(t, e.key),
162
164
  class: "d-table-filter__list"
163
165
  }, [(m(!0), l(a, null, g(e.items, (e) => (m(), l("li", {
164
166
  key: e.prop,
165
167
  class: "d-table-filter__item"
166
168
  }, [f(v(n), { class: "d-table-filter__handle" }, {
167
- default: y(() => [f(i)]),
169
+ default: b(() => [f(i)]),
168
170
  _: 1
169
- }), f(v(x), {
170
- "model-value": P.value.includes(e.prop),
171
- disabled: P.value.length <= 1 && P.value.includes(e.prop),
171
+ }), f(v(S), {
172
+ "model-value": F.value.includes(e.prop),
173
+ disabled: F.value.length <= 1 && F.value.includes(e.prop),
172
174
  onChange: (t) => X(e.prop, t)
173
175
  }, {
174
- default: y(() => [d(_(e.label), 1)]),
176
+ default: b(() => [d(_(e.label), 1)]),
175
177
  _: 2
176
178
  }, 1032, [
177
179
  "model-value",
@@ -181,6 +183,6 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
181
183
  _: 1
182
184
  }, 8, ["visible"]));
183
185
  }
184
- }), [["__scopeId", "data-v-023a2c22"]]);
186
+ }), [["__scopeId", "data-v-106f6a04"]]);
185
187
  //#endregion
186
- export { D as default };
188
+ export { O as default };
@@ -0,0 +1 @@
1
+ .d-table-filter__body[data-v-106f6a04]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-106f6a04]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-106f6a04]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-106f6a04] .el-checkbox{height:24px}.d-table-filter__header[data-v-106f6a04]{justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;display:flex}.d-table-filter__header[data-v-106f6a04] .el-button{margin:0}.d-table-filter__group-label[data-v-106f6a04]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-106f6a04]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-106f6a04]:active{cursor:grabbing}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekplus-digital-ui",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "homepage": "https://ui.geekplus.cc/static/ui/",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1 +0,0 @@
1
- .d-table-filter__body[data-v-023a2c22]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-023a2c22]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-023a2c22]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-023a2c22] .el-checkbox{height:24px}.d-table-filter__header[data-v-023a2c22]{justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;display:flex}.d-table-filter__header[data-v-023a2c22] .el-button{margin:0}.d-table-filter__group-label[data-v-023a2c22]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-023a2c22]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-023a2c22]:active{cursor:grabbing}