@lingshugroup/web-plus 1.0.9 → 1.0.11

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 (47) hide show
  1. package/README.md +1 -5
  2. package/lib/index.css +1 -1
  3. package/lib/index.css.br +0 -0
  4. package/lib/index.css.gz +0 -0
  5. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.cjs +1 -1
  6. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js +31 -26
  7. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.br +0 -0
  8. package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.gz +0 -0
  9. package/lib/packages/ls-components/components/form/Form.vue/index.cjs +1 -1
  10. package/lib/packages/ls-components/components/form/Form.vue/index.js +1 -1
  11. package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
  12. package/lib/packages/ls-components/components/form/Form.vue/index2.js +82 -76
  13. package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
  14. package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
  15. package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
  16. package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
  17. package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
  18. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +218 -180
  19. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
  20. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
  21. package/lib/packages/ls-components/components/list/List.vue/index.cjs +1 -1
  22. package/lib/packages/ls-components/components/list/List.vue/index.js +1 -1
  23. package/lib/packages/ls-components/components/list/List.vue/index2.cjs +1 -1
  24. package/lib/packages/ls-components/components/list/List.vue/index2.js +184 -178
  25. package/lib/packages/ls-components/components/list/List.vue/index2.js.br +0 -0
  26. package/lib/packages/ls-components/components/list/List.vue/index2.js.gz +0 -0
  27. package/lib/packages/ls-components/components/list/types/index.cjs +1 -1
  28. package/lib/packages/ls-components/components/list/types/index.js +5 -0
  29. package/lib/packages/ls-components/components/list/types/index.js.br +0 -0
  30. package/lib/packages/ls-components/components/list/types/index.js.gz +0 -0
  31. package/lib/packages/ls-components/components/table/Table.vue/index.cjs +1 -1
  32. package/lib/packages/ls-components/components/table/Table.vue/index.js +1 -1
  33. package/lib/packages/ls-components/components/table/Table.vue/index2.cjs +1 -1
  34. package/lib/packages/ls-components/components/table/Table.vue/index2.js +135 -128
  35. package/lib/packages/ls-components/components/table/Table.vue/index2.js.br +0 -0
  36. package/lib/packages/ls-components/components/table/Table.vue/index2.js.gz +0 -0
  37. package/lib/packages/ls-components/components/tree/Index.vue/index.cjs +1 -1
  38. package/lib/packages/ls-components/components/tree/Index.vue/index.js +2 -2
  39. package/lib/packages/ls-components/components/tree/Index.vue/index2.cjs +1 -1
  40. package/lib/packages/ls-components/components/tree/Index.vue/index2.js +104 -119
  41. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.br +0 -0
  42. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.gz +0 -0
  43. package/lib/packages/ls-components/components/tree/types/index.cjs +1 -1
  44. package/lib/packages/ls-components/components/tree/types/index.js +26 -7
  45. package/lib/packages/ls-components/components/tree/types/index.js.br +0 -0
  46. package/lib/packages/ls-components/components/tree/types/index.js.gz +0 -0
  47. package/package.json +1 -1
@@ -1,164 +1,149 @@
1
- var $ = Object.defineProperty;
2
- var i = (p, h) => $(p, "name", { value: h, configurable: !0 });
1
+ var W = Object.defineProperty;
2
+ var a = (f, p) => W(f, "name", { value: p, configurable: !0 });
3
3
  /* empty css */
4
- /* empty css */
5
4
  /* empty css */
6
5
  /* empty css */
7
- import { defineComponent as A, ref as f, computed as L, watch as O, nextTick as x, openBlock as S, createBlock as _, unref as d, withCtx as C, createElementVNode as y, normalizeClass as E, isRef as U, createTextVNode as j, createCommentVNode as F, createVNode as G, mergeProps as J, toDisplayString as M } from "vue";
6
+ import { defineComponent as T, ref as h, computed as S, watch as L, nextTick as x, openBlock as E, createElementBlock as O, normalizeClass as k, unref as c, createBlock as U, isRef as $, withCtx as A, createTextVNode as j, createCommentVNode as F, createVNode as G, normalizeStyle as J, createElementVNode as w, toDisplayString as M } from "vue";
8
7
  import { useNamespace as Q } from "../../_hooks/useNamespace/index.js";
9
8
  import { lsTreeProps as X, emitNames as Y } from "../types/index.js";
10
9
  import { excutePowerTree as Z } from "../../_utils/power/index.js";
11
- import ee from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/dist/locale/zh-cn/index.js";
12
- import te from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
13
- import { ElCheckbox as le } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/checkbox/index/index.js";
14
- import { ElTree as ne } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/tree/index/index.js";
15
- import { ElConfigProvider as oe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/config-provider/index/index.js";
16
- const ie = A({
10
+ import { ElCheckbox as ee } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/checkbox/index/index.js";
11
+ import { ElTree as te } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/tree/index/index.js";
12
+ const le = T({
17
13
  name: "LSTree"
18
- }), Ne = /* @__PURE__ */ A({
19
- ...ie,
14
+ }), fe = /* @__PURE__ */ T({
15
+ ...le,
20
16
  props: X,
21
17
  emits: Y,
22
- setup(p, { expose: h, emit: P }) {
23
- const v = P, r = p, g = Q("tree"), T = g.b(), w = g.b("box"), K = f({
24
- showCheckbox: !0,
25
- defaultExpandAll: !0,
26
- nodeKey: "id",
27
- checkStrictly: !1,
28
- defaultCheckedKeys: []
29
- }), a = f(), s = f(!1), c = f(!1), m = f([]), V = L(() => r.height ? {
30
- maxHeight: r.height
31
- } : {});
32
- O(
33
- () => r.data,
18
+ setup(f, { expose: p, emit: P }) {
19
+ const C = P, s = f, v = Q("tree"), K = v.b(), V = v.b("box"), i = h(), r = h(!1), d = h(!1), m = h([]), B = S(() => s.height ? {
20
+ maxHeight: s.height
21
+ } : {}), y = S(() => s.treeData);
22
+ L(
23
+ () => y.value,
34
24
  async (e) => {
35
- e && e.length > 0 && (s.value = !1, c.value = !1, m.value = B(), q(), await x(), a.value.filter(), k(), I());
25
+ e && e.length > 0 && (r.value = !1, d.value = !1, m.value = D(), _(), await x(), i.value.filter(), N(), I());
36
26
  },
37
27
  {
38
28
  immediate: !0,
39
29
  deep: !0
40
30
  }
41
31
  );
42
- function B() {
43
- return r.data.reduce((e, t) => (e.push(t.id), t.children && e.push(...N(t.children)), e), []);
32
+ function D() {
33
+ return y.value.reduce((e, t) => (e.push(t.id), t.children && e.push(...g(t.children)), e), []);
44
34
  }
45
- i(B, "getAllNodeKeys");
46
- function N(e) {
47
- return e.reduce((t, l) => (t.push(l.id), l.children && t.push(...N(l.children)), t), []);
35
+ a(D, "getAllNodeKeys");
36
+ function g(e) {
37
+ return e.reduce((t, n) => (t.push(n.id), n.children && t.push(...g(n.children)), t), []);
48
38
  }
49
- i(N, "getAllChildKeys");
50
- async function q() {
51
- var t, l;
39
+ a(g, "getAllChildKeys");
40
+ async function _() {
41
+ var t, n;
52
42
  await x();
53
43
  const e = document.getElementsByClassName("hide-child-node");
54
44
  for (let o = 0; o < e.length; o++) {
55
- const n = e[o].parentNode;
56
- n.style.opacity = 0, n.style.width = 0, n.style.height = 0, (l = (t = n == null ? void 0 : n.parentNode) == null ? void 0 : t.parentNode) != null && l.previousElementSibling && (n.parentNode.parentNode.previousElementSibling.querySelector(".el-icon").style.opacity = 0, n.parentNode.parentNode.previousElementSibling.querySelector(".el-icon").style.visibility = "hidden");
45
+ const l = e[o].parentNode;
46
+ l.style.opacity = 0, l.style.width = 0, l.style.height = 0, (n = (t = l == null ? void 0 : l.parentNode) == null ? void 0 : t.parentNode) != null && n.previousElementSibling && (l.parentNode.parentNode.previousElementSibling.querySelector(".el-icon").style.opacity = 0, l.parentNode.parentNode.previousElementSibling.querySelector(".el-icon").style.visibility = "hidden");
57
47
  }
58
48
  }
59
- i(q, "updateHideStyle");
60
- function R() {
61
- c.value = !1, a.value && a.value.setCheckedKeys(s.value ? m.value : []);
49
+ a(_, "updateHideStyle");
50
+ function q() {
51
+ d.value = !1, i.value && i.value.setCheckedKeys(r.value ? m.value : []);
62
52
  }
63
- i(R, "handleCheckAllChange");
64
- function z(e, t) {
65
- const { permission: l } = t || {};
66
- if (l != null && l.startsWith(r.hideNodePrefix))
53
+ a(q, "handleCheckAllChange");
54
+ function R(e, t) {
55
+ const { permission: n } = t || {};
56
+ if (n != null && n.startsWith(s.hideNodePrefix))
67
57
  return !1;
68
58
  if (!e) return !0;
69
- const { label: o } = r.dataProps || {};
59
+ const { label: o } = s.dataProps || {};
70
60
  return o ? t[o].indexOf(e) !== -1 : !0;
71
61
  }
72
- i(z, "filterNode");
73
- function D(e, t) {
74
- a.value.setCheckedNodes(Z(r.data, e, t)), v("handleCheck", e, t);
62
+ a(R, "filterNode");
63
+ function z(e, t) {
64
+ i.value.setCheckedNodes(Z(y.value, e, t)), C("handleCheck", e, t);
75
65
  }
76
- i(D, "handleCheck");
66
+ a(z, "handleCheck");
77
67
  function H(e, t) {
78
- k(), v("handleChekChange", e, t);
68
+ N(), C("handleChekChange", e, t);
79
69
  }
80
- i(H, "handleChekChange");
81
- function k() {
82
- const e = a.value.getCheckedNodes(!1, !0);
70
+ a(H, "handleChekChange");
71
+ function N() {
72
+ const e = i.value.getCheckedNodes(!1, !0);
83
73
  let t = [];
84
- e.forEach((l) => {
85
- const { id: o, parentId: n } = l;
86
- t.push(o || n);
87
- }), t.length > 0 ? t.length === m.value.length ? (s.value = !0, c.value = !1) : (s.value = !1, c.value = !0) : (s.value = !1, c.value = !1);
74
+ e.forEach((n) => {
75
+ const { id: o, parentId: l } = n;
76
+ t.push(o || l);
77
+ }), t.length > 0 ? t.length === m.value.length ? (r.value = !0, d.value = !1) : (r.value = !1, d.value = !0) : (r.value = !1, d.value = !1);
88
78
  }
89
- i(k, "updateAllCheckStatus");
79
+ a(N, "updateAllCheckStatus");
90
80
  function I() {
91
81
  var e, t;
92
- if (r.direction == "h") {
93
- const l = (t = (e = a.value) == null ? void 0 : e.el$) == null ? void 0 : t.getElementsByClassName("el-tree-node");
94
- for (let o = 0; o < l.length; o++) {
95
- const n = l[o];
96
- if (n) {
97
- const u = n.querySelector(".el-tree-node__content .el-icon");
98
- u && getComputedStyle(u).visibility === "hidden" && (n.style.display = "inline-block", n.style.verticalAlign = "middle");
82
+ if (s.direction == "h") {
83
+ const n = (t = (e = i.value) == null ? void 0 : e.el$) == null ? void 0 : t.getElementsByClassName("el-tree-node");
84
+ for (let o = 0; o < n.length; o++) {
85
+ const l = n[o];
86
+ if (l) {
87
+ const u = l.querySelector(".el-tree-node__content .el-icon");
88
+ u && getComputedStyle(u).visibility === "hidden" && (l.style.display = "inline-block", l.style.verticalAlign = "middle");
99
89
  }
100
90
  }
101
91
  }
102
92
  }
103
- return i(I, "updateStyle"), h({
104
- lsTreeRef: a
93
+ return a(I, "updateStyle"), p({
94
+ lsTreeRef: i
105
95
  }), (e, t) => {
106
- const l = le, o = ne, n = oe;
107
- return S(), _(n, {
108
- locale: d(ee),
109
- "value-on-clear": void 0,
110
- "empty-values": [void 0, null]
111
- }, {
112
- default: C(() => [
113
- y("div", {
114
- class: E(d(T))
115
- }, [
116
- e.isCheckAll ? (S(), _(l, {
117
- key: 0,
118
- modelValue: d(s),
119
- "onUpdate:modelValue": t[0] || (t[0] = (u) => U(s) ? s.value = u : null),
120
- indeterminate: d(c),
121
- onChange: R
122
- }, {
123
- default: C(() => [
124
- j(" 全选 ")
125
- ]),
126
- _: 1
127
- }, 8, ["modelValue", "indeterminate"])) : F("", !0),
128
- G(o, J({
129
- ref_key: "lsTreeRef",
130
- ref: a,
131
- class: [d(w), !e.isExpand && "expand-disabled"],
132
- style: d(V)
133
- }, d(te)(d(K), e.$attrs), {
134
- data: e.data,
135
- props: e.dataProps,
136
- "expand-on-click-node": e.isExpand,
137
- "filter-node-method": z,
138
- onCheck: D,
139
- onCheckChange: H
140
- }), {
141
- default: C(({ node: u, data: W }) => {
142
- var b;
143
- return [
144
- y("span", {
145
- class: E(["custom-tree-node", {
146
- "hide-child-node": e.hideNodePrefix && ((b = W.permission) == null ? void 0 : b.startsWith(e.hideNodePrefix))
147
- }])
148
- }, [
149
- y("span", null, M(u.label), 1)
150
- ], 2)
151
- ];
152
- }),
153
- _: 1
154
- }, 16, ["class", "style", "data", "props", "expand-on-click-node"])
155
- ], 2)
156
- ]),
157
- _: 1
158
- }, 8, ["locale"]);
96
+ const n = ee, o = te;
97
+ return E(), O("div", {
98
+ class: k(c(K))
99
+ }, [
100
+ e.isCheckAll ? (E(), U(n, {
101
+ key: 0,
102
+ modelValue: c(r),
103
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => $(r) ? r.value = l : null),
104
+ indeterminate: c(d),
105
+ onChange: q
106
+ }, {
107
+ default: A(() => [
108
+ j(" 全选 ")
109
+ ]),
110
+ _: 1
111
+ }, 8, ["modelValue", "indeterminate"])) : F("", !0),
112
+ G(o, {
113
+ ref_key: "lsTreeRef",
114
+ ref: i,
115
+ "show-checkbox": e.showCheckbox,
116
+ "default-expand-all": e.defaultExpandAll,
117
+ "node-key": e.nodeKey,
118
+ "check-strictly": e.isCheckStrictly,
119
+ style: J(c(B)),
120
+ class: k([c(V), !e.isExpand && "expand-disabled"]),
121
+ data: e.treeData,
122
+ props: e.dataProps,
123
+ "default-checked-keys": e.defaultCheckedKeys,
124
+ "expand-on-click-node": e.isExpand,
125
+ "filter-node-method": R,
126
+ onCheck: z,
127
+ onCheckChange: H
128
+ }, {
129
+ default: A(({ node: l, data: u }) => {
130
+ var b;
131
+ return [
132
+ w("span", {
133
+ class: k(["custom-tree-node", {
134
+ "hide-child-node": e.hideNodePrefix && ((b = u.permission) == null ? void 0 : b.startsWith(e.hideNodePrefix))
135
+ }])
136
+ }, [
137
+ w("span", null, M(l.label), 1)
138
+ ], 2)
139
+ ];
140
+ }),
141
+ _: 1
142
+ }, 8, ["show-checkbox", "default-expand-all", "node-key", "check-strictly", "style", "class", "data", "props", "default-checked-keys", "expand-on-click-node"])
143
+ ], 2);
159
144
  };
160
145
  }
161
146
  });
162
147
  export {
163
- Ne as default
148
+ fe as default
164
149
  };
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var e=(t,a)=>l(t,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../_utils/runtime/index.cjs"),d=r.buildProps({isExpand:{type:Boolean,default:!0},height:{type:String,default:""},data:{type:Array,default:e(()=>[],"default")},dataProps:{type:Object,default:e(()=>({children:"children",label:"name",class:""}),"default")},hideNodePrefix:{type:String,default:"I"},isCheckAll:{type:Boolean,default:!1},direction:{type:String,default:"v"}}),i=["handleCheck","handleChekChange"];exports.emitNames=i;exports.lsTreeProps=d;
1
+ "use strict";var l=Object.defineProperty;var e=(t,a)=>l(t,"name",{value:a,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../_utils/runtime/index.cjs"),r=d.buildProps({isExpand:{type:Boolean,default:!0},height:{type:String,default:""},dataProps:{type:Object,default:e(()=>({children:"children",label:"name",class:""}),"default")},hideNodePrefix:{type:String,default:"I"},isCheckAll:{type:Boolean,default:!1},direction:{type:String,default:"v"},showCheckbox:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},nodeKey:{type:String,default:"id"},isCheckStrictly:{type:Boolean,default:!1},treeData:{type:Array,default:e(()=>[],"default")},defaultCheckedKeys:{type:Array,default:e(()=>[],"default")}}),o=["handleCheck","handleChekChange"];exports.emitNames=o;exports.lsTreeProps=r;
@@ -12,11 +12,6 @@ const n = d({
12
12
  type: String,
13
13
  default: ""
14
14
  },
15
- // 数据源
16
- data: {
17
- type: Array,
18
- default: /* @__PURE__ */ e(() => [], "default")
19
- },
20
15
  // 默认属性结构
21
16
  dataProps: {
22
17
  type: Object,
@@ -40,9 +35,33 @@ const n = d({
40
35
  direction: {
41
36
  type: String,
42
37
  default: "v"
38
+ },
39
+ showCheckbox: {
40
+ type: Boolean,
41
+ default: !0
42
+ },
43
+ defaultExpandAll: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ nodeKey: {
48
+ type: String,
49
+ default: "id"
50
+ },
51
+ isCheckStrictly: {
52
+ type: Boolean,
53
+ default: !1
54
+ },
55
+ treeData: {
56
+ type: Array,
57
+ default: /* @__PURE__ */ e(() => [], "default")
58
+ },
59
+ defaultCheckedKeys: {
60
+ type: Array,
61
+ default: /* @__PURE__ */ e(() => [], "default")
43
62
  }
44
- }), o = ["handleCheck", "handleChekChange"];
63
+ }), i = ["handleCheck", "handleChekChange"];
45
64
  export {
46
- o as emitNames,
65
+ i as emitNames,
47
66
  n as lsTreeProps
48
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",