@lingshugroup/web-plus 1.0.10 → 1.0.12

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 (31) 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/form/Form.vue/index.cjs +1 -1
  6. package/lib/packages/ls-components/components/form/Form.vue/index.js +1 -1
  7. package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
  8. package/lib/packages/ls-components/components/form/Form.vue/index2.js +80 -75
  9. package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
  10. package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
  11. package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
  12. package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
  13. package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
  14. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +1 -1
  15. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
  16. package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
  17. package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
  18. package/lib/packages/ls-components/components/form/types/index.js +10 -2
  19. package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
  20. package/lib/packages/ls-components/components/form/types/index.js.gz +0 -0
  21. package/lib/packages/ls-components/components/tree/Index.vue/index.cjs +1 -1
  22. package/lib/packages/ls-components/components/tree/Index.vue/index.js +2 -2
  23. package/lib/packages/ls-components/components/tree/Index.vue/index2.cjs +1 -1
  24. package/lib/packages/ls-components/components/tree/Index.vue/index2.js +104 -117
  25. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.br +0 -0
  26. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.gz +0 -0
  27. package/lib/packages/ls-components/components/tree/types/index.cjs +1 -1
  28. package/lib/packages/ls-components/components/tree/types/index.js +26 -7
  29. package/lib/packages/ls-components/components/tree/types/index.js.br +0 -0
  30. package/lib/packages/ls-components/components/tree/types/index.js.gz +0 -0
  31. package/package.json +1 -1
@@ -1,162 +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 _, createBlock as E, unref as d, withCtx as C, createElementVNode as v, normalizeClass as S, 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 g = P, r = p, y = Q("tree"), T = y.b(), w = y.b("box"), V = f({
24
- showCheckbox: !0,
25
- defaultExpandAll: !0,
26
- nodeKey: "id"
27
- }), a = f(), s = f(!1), c = f(!1), m = f([]), K = L(() => r.height ? {
28
- maxHeight: r.height
29
- } : {});
30
- O(
31
- () => 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,
32
24
  async (e) => {
33
- 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());
34
26
  },
35
27
  {
36
28
  immediate: !0,
37
29
  deep: !0
38
30
  }
39
31
  );
40
- function B() {
41
- 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), []);
42
34
  }
43
- i(B, "getAllNodeKeys");
44
- function N(e) {
45
- 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), []);
46
38
  }
47
- i(N, "getAllChildKeys");
48
- async function q() {
49
- var t, l;
39
+ a(g, "getAllChildKeys");
40
+ async function _() {
41
+ var t, n;
50
42
  await x();
51
43
  const e = document.getElementsByClassName("hide-child-node");
52
44
  for (let o = 0; o < e.length; o++) {
53
- const n = e[o].parentNode;
54
- 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");
55
47
  }
56
48
  }
57
- i(q, "updateHideStyle");
58
- function R() {
59
- 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 : []);
60
52
  }
61
- i(R, "handleCheckAllChange");
62
- function z(e, t) {
63
- const { permission: l } = t || {};
64
- 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))
65
57
  return !1;
66
58
  if (!e) return !0;
67
- const { label: o } = r.dataProps || {};
59
+ const { label: o } = s.dataProps || {};
68
60
  return o ? t[o].indexOf(e) !== -1 : !0;
69
61
  }
70
- i(z, "filterNode");
71
- function D(e, t) {
72
- a.value.setCheckedNodes(Z(r.data, e, t)), g("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);
73
65
  }
74
- i(D, "handleCheck");
66
+ a(z, "handleCheck");
75
67
  function H(e, t) {
76
- k(), g("handleChekChange", e, t);
68
+ N(), C("handleChekChange", e, t);
77
69
  }
78
- i(H, "handleChekChange");
79
- function k() {
80
- const e = a.value.getCheckedNodes(!1, !0);
70
+ a(H, "handleChekChange");
71
+ function N() {
72
+ const e = i.value.getCheckedNodes(!1, !0);
81
73
  let t = [];
82
- e.forEach((l) => {
83
- const { id: o, parentId: n } = l;
84
- t.push(o || n);
85
- }), 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);
86
78
  }
87
- i(k, "updateAllCheckStatus");
79
+ a(N, "updateAllCheckStatus");
88
80
  function I() {
89
81
  var e, t;
90
- if (r.direction == "h") {
91
- const l = (t = (e = a.value) == null ? void 0 : e.el$) == null ? void 0 : t.getElementsByClassName("el-tree-node");
92
- for (let o = 0; o < l.length; o++) {
93
- const n = l[o];
94
- if (n) {
95
- const u = n.querySelector(".el-tree-node__content .el-icon");
96
- 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");
97
89
  }
98
90
  }
99
91
  }
100
92
  }
101
- return i(I, "updateStyle"), h({
102
- lsTreeRef: a
93
+ return a(I, "updateStyle"), p({
94
+ lsTreeRef: i
103
95
  }), (e, t) => {
104
- const l = le, o = ne, n = oe;
105
- return _(), E(n, {
106
- locale: d(ee),
107
- "value-on-clear": void 0,
108
- "empty-values": [void 0, null]
109
- }, {
110
- default: C(() => [
111
- v("div", {
112
- class: S(d(T))
113
- }, [
114
- e.isCheckAll ? (_(), E(l, {
115
- key: 0,
116
- modelValue: d(s),
117
- "onUpdate:modelValue": t[0] || (t[0] = (u) => U(s) ? s.value = u : null),
118
- indeterminate: d(c),
119
- onChange: R
120
- }, {
121
- default: C(() => [
122
- j(" 全选 ")
123
- ]),
124
- _: 1
125
- }, 8, ["modelValue", "indeterminate"])) : F("", !0),
126
- G(o, J({
127
- ref_key: "lsTreeRef",
128
- ref: a,
129
- class: [d(w), !e.isExpand && "expand-disabled"],
130
- style: d(K)
131
- }, d(te)(d(V), e.$attrs), {
132
- data: e.data,
133
- props: e.dataProps,
134
- "expand-on-click-node": e.isExpand,
135
- "filter-node-method": z,
136
- onCheck: D,
137
- onCheckChange: H
138
- }), {
139
- default: C(({ node: u, data: W }) => {
140
- var b;
141
- return [
142
- v("span", {
143
- class: S(["custom-tree-node", {
144
- "hide-child-node": e.hideNodePrefix && ((b = W.permission) == null ? void 0 : b.startsWith(e.hideNodePrefix))
145
- }])
146
- }, [
147
- v("span", null, M(u.label), 1)
148
- ], 2)
149
- ];
150
- }),
151
- _: 1
152
- }, 16, ["class", "style", "data", "props", "expand-on-click-node"])
153
- ], 2)
154
- ]),
155
- _: 1
156
- }, 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);
157
144
  };
158
145
  }
159
146
  });
160
147
  export {
161
- Ne as default
148
+ fe as default
162
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.10",
3
+ "version": "1.0.12",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",