yahee-components 0.0.10 → 0.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 (46) hide show
  1. package/es/api/server.js +26 -10
  2. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +218 -0
  3. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +4 -0
  4. package/es/country-platform-shop-condition/index.js +7 -0
  5. package/es/country-platform-shop-condition/style/index.css +48 -0
  6. package/es/drop-down-condition/drop-down-condition.vue.js +215 -0
  7. package/es/drop-down-condition/drop-down-condition.vue2.js +4 -0
  8. package/es/drop-down-condition/index.js +7 -0
  9. package/es/drop-down-condition/style/index.css +45 -0
  10. package/es/index.js +23 -15
  11. package/es/installs.js +18 -10
  12. package/es/left-condition/index.js +7 -0
  13. package/es/left-condition/left-condition-sub.vue.js +95 -0
  14. package/es/left-condition/left-condition-sub.vue2.js +4 -0
  15. package/es/left-condition/left-condition.vue.js +214 -0
  16. package/es/left-condition/left-condition.vue2.js +4 -0
  17. package/es/left-condition/style/index.css +11 -0
  18. package/es/left-condition-enum/index.js +7 -0
  19. package/es/left-condition-enum/left-condition-enum.vue.js +76 -0
  20. package/es/left-condition-enum/left-condition-enum.vue2.js +4 -0
  21. package/es/left-condition-enum/style/index.css +0 -0
  22. package/es/static/CommonObject.js +4 -0
  23. package/es/style.css +81 -196
  24. package/es/utils/style.js +28 -0
  25. package/es/utils/translate.js +39 -22
  26. package/lib/country-platform-shop-condition/style/index.css +48 -0
  27. package/lib/drop-down-condition/style/index.css +45 -0
  28. package/lib/left-condition/style/index.css +11 -0
  29. package/lib/left-condition-enum/style/index.css +0 -0
  30. package/lib/style.css +81 -196
  31. package/package.json +1 -1
  32. package/types/src/components.d.ts +4 -0
  33. package/types/src/country-platform-shop-condition/country-platform-shop-condition.d.ts +17 -0
  34. package/types/src/country-platform-shop-condition/country-platform-shop-condition.vue.d.ts +14 -0
  35. package/types/src/country-platform-shop-condition/index.d.ts +16 -0
  36. package/types/src/drop-down-condition/drop-down-condition.d.ts +6 -0
  37. package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +38 -0
  38. package/types/src/drop-down-condition/index.d.ts +40 -0
  39. package/types/src/installs.d.ts +259 -2
  40. package/types/src/left-condition/index.d.ts +69 -0
  41. package/types/src/left-condition/left-condition-sub.vue.d.ts +47 -0
  42. package/types/src/left-condition/left-condition.d.ts +5 -0
  43. package/types/src/left-condition/left-condition.vue.d.ts +68 -0
  44. package/types/src/left-condition-enum/index.d.ts +153 -0
  45. package/types/src/left-condition-enum/left-condition-enum.d.ts +5 -0
  46. package/types/src/left-condition-enum/left-condition-enum.vue.d.ts +151 -0
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../utils/install.js";
2
+ import o from "./left-condition.vue.js";
3
+ const e = t(o);
4
+ export {
5
+ e as YaheeLeftCondition,
6
+ e as default
7
+ };
@@ -0,0 +1,95 @@
1
+ import { defineComponent as A, toRefs as E, ref as p, watch as F, openBlock as s, createElementBlock as u, Fragment as w, createElementVNode as h, normalizeStyle as P, unref as t, withModifiers as U, createCommentVNode as r, createTextVNode as T, toDisplayString as k, nextTick as v } from "vue";
2
+ import N from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
3
+ import { stylesUtils as z } from "../utils/style.js";
4
+ import { translateEmployeeName as D, M2 as j } from "../utils/translate.js";
5
+ const q = ["checked"], G = { key: 1 }, H = {
6
+ key: 0,
7
+ class: "num"
8
+ }, W = /* @__PURE__ */ A({
9
+ __name: "left-condition-sub",
10
+ props: {
11
+ multiSelectList: { default: () => [] },
12
+ countList: {},
13
+ item: { default: () => ({ label: "", value: "" }) },
14
+ hasNum: { type: Boolean, default: !1 },
15
+ allIsCheckbox: { type: Boolean, default: !1 },
16
+ translateUserId: { type: Boolean, default: !1 }
17
+ },
18
+ emits: [
19
+ "resetAllCheckedValue",
20
+ "setSelectedStatusMap",
21
+ "resetRange",
22
+ "resetIsSelectAll",
23
+ "notifyParent",
24
+ "setNoNeedRefreshNumFilterName"
25
+ ],
26
+ setup(y, { expose: b, emit: C }) {
27
+ const g = y, { item: l, hasNum: S, multiSelectList: V } = E(g), n = C, a = p(!1), c = p(!1);
28
+ function x(e) {
29
+ n("setNoNeedRefreshNumFilterName"), n("resetRange"), a.value = e.target.checked, f(a.value), i();
30
+ }
31
+ function i() {
32
+ v(() => {
33
+ n("notifyParent");
34
+ });
35
+ }
36
+ function f(e) {
37
+ c.value = e;
38
+ }
39
+ function m(e) {
40
+ a.value = e;
41
+ }
42
+ function R() {
43
+ a.value = !1, c.value = !1;
44
+ }
45
+ function _() {
46
+ return l.value;
47
+ }
48
+ function B() {
49
+ n("resetAllCheckedValue");
50
+ }
51
+ function I() {
52
+ n("setNoNeedRefreshNumFilterName"), n("resetRange"), B(), v(() => {
53
+ m(!0);
54
+ }), i();
55
+ }
56
+ function L(e) {
57
+ return N.includes(V.value, e.value);
58
+ }
59
+ return F(a, (e) => {
60
+ console.log("left condition subview watch value", e), n("setSelectedStatusMap", { ...l.value, selected: e });
61
+ }), b({
62
+ resetValue: R,
63
+ getValue: _,
64
+ setCurrentValue: m,
65
+ setCheckboxValue: f
66
+ }), (e, o) => {
67
+ var d;
68
+ return s(), u(w, null, [
69
+ h("span", {
70
+ class: "el-button custom-button el-button--small",
71
+ style: P(t(z).getBackgroundColor(a.value)),
72
+ onClick: I
73
+ }, [
74
+ e.allIsCheckbox || L(t(l)) ? (s(), u("input", {
75
+ key: 0,
76
+ checked: c.value,
77
+ class: "el-checkbox__input",
78
+ type: "checkbox",
79
+ onChange: x,
80
+ onClick: o[0] || (o[0] = U(() => {
81
+ }, ["stop"]))
82
+ }, null, 40, q)) : r("", !0),
83
+ T(" " + k(e.translateUserId ? t(D)(t(l).value, t(l).label) : t(j)(t(l).label)) + " ", 1),
84
+ t(N).isEmpty(e.countList) ? r("", !0) : (s(), u("span", G, " (" + k((d = e.countList.filter((M) => M.value == t(l).value)[0]) == null ? void 0 : d.count) + ") ", 1))
85
+ ], 4),
86
+ t(S) ? (s(), u("span", H, o[1] || (o[1] = [
87
+ h("em", null, null, -1)
88
+ ]))) : r("", !0)
89
+ ], 64);
90
+ };
91
+ }
92
+ });
93
+ export {
94
+ W as default
95
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./left-condition-sub.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,214 @@
1
+ import { defineComponent as se, toRefs as oe, ref as m, computed as re, watch as ie, onMounted as ce, resolveComponent as B, openBlock as y, createBlock as D, withCtx as T, createVNode as I, unref as o, createElementVNode as fe, normalizeStyle as de, toDisplayString as L, createElementBlock as q, Fragment as me, renderList as ve, createTextVNode as K, createCommentVNode as pe, nextTick as z } from "vue";
2
+ import l from "../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";
3
+ import ge from "./left-condition-sub.vue.js";
4
+ import { stylesUtils as ye } from "../utils/style.js";
5
+ import { M2 as J } from "../utils/translate.js";
6
+ const he = {
7
+ key: 0,
8
+ class: "el-button custom-button el-button--small",
9
+ style: { "margin-left": "5px", display: "inline-flex" }
10
+ }, Ce = /* @__PURE__ */ se({
11
+ name: "YaheeLeftCondition",
12
+ __name: "left-condition",
13
+ props: {
14
+ multiSelectList: { default: () => [] },
15
+ selectList: { default: () => [] },
16
+ countList: { default: () => [] },
17
+ totalCount: { default: 0 },
18
+ hasNum: { type: Boolean, default: !1 },
19
+ displayRangeInput: { type: Boolean, default: !1 },
20
+ rangeLabel: { default: "区间" },
21
+ rangeStartKey: { default: "rangeStart" },
22
+ rangeEndKey: { default: "rangeEnd" },
23
+ rangeDelimiter: { default: "——" },
24
+ allIsCheckbox: { type: Boolean },
25
+ allIsEmpty: { type: Boolean, default: !1 },
26
+ translateUserId: { type: Boolean },
27
+ staticSearch: { type: Boolean, default: !1 },
28
+ label: { default: "" },
29
+ noNeedRefreshNumFilterName: { default: "" },
30
+ filterKey: { default: "" },
31
+ defaultValues: { default: () => [] }
32
+ },
33
+ emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
34
+ setup(O, { expose: Y, emit: j }) {
35
+ const G = O, {
36
+ multiSelectList: A,
37
+ displayRangeInput: h,
38
+ selectList: N,
39
+ hasNum: H,
40
+ allIsEmpty: Q,
41
+ translateUserId: W,
42
+ label: X,
43
+ filterKey: v,
44
+ rangeStartKey: r,
45
+ rangeEndKey: i,
46
+ noNeedRefreshNumFilterName: F,
47
+ defaultValues: M,
48
+ totalCount: k,
49
+ countList: S
50
+ } = oe(G), V = j, b = m(k.value), c = m(), f = m(), $ = m(S.value), n = /* @__PURE__ */ new Map(), d = m(!1), C = m([]), p = () => {
51
+ console.log("left condition notifyParent start"), z(() => {
52
+ var s, g;
53
+ const e = _(), t = le();
54
+ if (l.isEmpty(e) && l.isEmpty(t)) {
55
+ E();
56
+ return;
57
+ }
58
+ const a = [
59
+ {
60
+ filterKey: v.value,
61
+ checkedValues: l.map(e, (u) => u.value)
62
+ }
63
+ ];
64
+ h.value && (a.push({
65
+ filterKey: r.value,
66
+ checkedValues: [(s = n.get(r.value)) == null ? void 0 : s.value]
67
+ }), a.push({
68
+ filterKey: i.value,
69
+ checkedValues: [(g = n.get(i.value)) == null ? void 0 : g.value]
70
+ })), V("filterChange", a), console.log(
71
+ `left condition notifyParent nextTick after emit, filterKey: ${v.value}, checkedValues: ${JSON.stringify(l.map(e, (u) => u.value))}`
72
+ );
73
+ });
74
+ }, Z = () => {
75
+ V("setNoNeedRefreshNumFilterName");
76
+ }, w = () => {
77
+ R(), x({ label: r.value, selected: !0, value: c.value }), x({ label: i.value, selected: !0, value: f.value });
78
+ }, ee = () => {
79
+ const e = n.get(r.value);
80
+ l.isEmpty(e) && !c.value || l.get(e, "value") === c.value || (w(), p());
81
+ }, te = () => {
82
+ const e = n.get(i.value);
83
+ l.isEmpty(e) && !f.value || l.get(e, "value") === f.value || (w(), p());
84
+ };
85
+ function x(e) {
86
+ console.log(`left condition setSelectedStatusMap start, item: ${JSON.stringify(e)}`), n.set(e.label, {
87
+ selected: e.selected,
88
+ value: e.value
89
+ }), d.value = l.eq(_().length, N.value.length);
90
+ }
91
+ function U(e) {
92
+ return l.includes(A.value, e.value);
93
+ }
94
+ function R() {
95
+ const e = l.map(_(), (t) => t.value);
96
+ n.clear(), l.forEach(C.value, (t) => {
97
+ l.includes(e, t.getValue().value) && t.resetValue();
98
+ }), d.value = !1;
99
+ }
100
+ const _ = () => {
101
+ const e = l.filter(
102
+ Array.from(n.values()),
103
+ (t) => t.selected
104
+ );
105
+ return l.filter(e, (t) => {
106
+ const a = Array.from(n.keys()).find((s) => n.get(s) === t);
107
+ return ![r.value, i.value].includes(a);
108
+ });
109
+ }, le = () => l.filter(Array.from(n.values()), (e) => {
110
+ const t = Array.from(n.keys()).find((a) => n.get(a) === e);
111
+ return [r.value, i.value].includes(t);
112
+ }), ae = () => {
113
+ d.value = !1;
114
+ }, ne = re(() => l.sortBy(N.value, (e) => U(e))), P = () => {
115
+ c.value = void 0, f.value = void 0, n.delete(r.value), n.delete(i.value);
116
+ };
117
+ function E() {
118
+ R(), z(() => {
119
+ d.value = !0;
120
+ const e = N.value.filter((a) => !U(a)), t = l.map(e, (a) => a.value);
121
+ V("filterChange", [
122
+ {
123
+ filterKey: v.value,
124
+ checkedValues: Q.value ? [] : t
125
+ }
126
+ ]);
127
+ }), h.value && P();
128
+ }
129
+ return ie(
130
+ [() => k.value, () => S.value],
131
+ ([e, t], [a, s]) => {
132
+ console.log(e, t), console.log(a, s), (!F.value || !l.eq(F.value, v.value)) && (b.value = k.value, $.value = S.value);
133
+ }
134
+ ), Y({
135
+ clickAllSelected: E
136
+ }), ce(() => {
137
+ if (l.isEmpty(M.value)) {
138
+ d.value = !0;
139
+ return;
140
+ }
141
+ l.filter(
142
+ C.value,
143
+ (e) => l.includes(M.value, e.getValue().value)
144
+ ).forEach((e) => {
145
+ e.setCurrentValue(!0), e.setCheckboxValue(!0);
146
+ }), p();
147
+ }), (e, t) => {
148
+ const a = B("el-input-number"), s = B("el-form-item"), g = B("el-form");
149
+ return y(), D(g, null, {
150
+ default: T(() => [
151
+ I(s, { label: o(X) }, {
152
+ default: T(() => [
153
+ fe("span", {
154
+ onClick: E,
155
+ class: "el-button custom-button el-button--small",
156
+ style: de(o(ye).getBackgroundColor(d.value))
157
+ }, L(b.value ? `${o(J)("全部")}(${b.value})` : o(J)("全部")), 5),
158
+ (y(!0), q(me, null, ve(ne.value, (u, ue) => (y(), D(ge, {
159
+ key: ue,
160
+ ref_for: !0,
161
+ ref_key: "itemRefs",
162
+ ref: C,
163
+ "all-is-checkbox": e.allIsCheckbox,
164
+ "multi-select-list": o(A),
165
+ "translate-user-id": o(W),
166
+ "count-list": $.value,
167
+ item: u,
168
+ "has-num": o(H),
169
+ onResetAllCheckedValue: R,
170
+ onSetSelectedStatusMap: x,
171
+ onResetRange: P,
172
+ onSetNoNeedRefreshNumFilterName: Z,
173
+ onNotifyParent: p,
174
+ onResetIsSelectAll: ae
175
+ }, null, 8, ["all-is-checkbox", "multi-select-list", "translate-user-id", "count-list", "item", "has-num"]))), 128)),
176
+ o(h) ? (y(), q("div", he, [
177
+ K(L(e.rangeLabel) + "  ", 1),
178
+ I(a, {
179
+ modelValue: c.value,
180
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => c.value = u),
181
+ style: { "margin-left": "2px", width: "60px", height: "22px" },
182
+ precision: 2,
183
+ step: 0.01,
184
+ min: 1,
185
+ max: 100,
186
+ controls: !1,
187
+ onBlur: ee
188
+ }, null, 8, ["modelValue"]),
189
+ K("   %   " + L(e.rangeDelimiter) + "   ", 1),
190
+ I(a, {
191
+ modelValue: f.value,
192
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => f.value = u),
193
+ style: { width: "60px", height: "22px" },
194
+ precision: 2,
195
+ step: 0.01,
196
+ size: "small",
197
+ max: 100,
198
+ controls: !1,
199
+ onChange: te
200
+ }, null, 8, ["modelValue"]),
201
+ t[2] || (t[2] = K(" %   "))
202
+ ])) : pe("", !0)
203
+ ]),
204
+ _: 1
205
+ }, 8, ["label"])
206
+ ]),
207
+ _: 1
208
+ });
209
+ };
210
+ }
211
+ });
212
+ export {
213
+ Ce as default
214
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./left-condition.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,11 @@
1
+ :deep(.custom-button + .custom-button) {
2
+ margin-left: 5px;
3
+ margin-bottom: 5px;
4
+ position: relative;
5
+ top: 2px;
6
+ }
7
+
8
+ :deep(.custom-button) {
9
+ padding: 1px 4px;
10
+ height: 22px;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../utils/install.js";
2
+ import o from "./left-condition-enum.vue.js";
3
+ const n = t(o);
4
+ export {
5
+ n as YaheeLeftConditionEnum,
6
+ n as default
7
+ };
@@ -0,0 +1,76 @@
1
+ import { defineComponent as f, ref as c, onMounted as d, openBlock as y, createBlock as N } from "vue";
2
+ import h from "../left-condition/left-condition.vue.js";
3
+ import { Get as p } from "../api/server.js";
4
+ import { storage as o } from "../utils/storage.js";
5
+ const E = /* @__PURE__ */ f({
6
+ name: "YaheeLeftConditionEnum",
7
+ __name: "left-condition-enum",
8
+ props: {
9
+ selectList: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ countList: {
14
+ type: Array,
15
+ required: !1
16
+ },
17
+ enumEntity: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ filterKey: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ totalCount: {
26
+ type: Number,
27
+ required: !1
28
+ },
29
+ noNeedRefreshNumFilterName: {
30
+ type: String,
31
+ required: !1
32
+ },
33
+ allIsCheckbox: {
34
+ type: Boolean,
35
+ required: !1
36
+ },
37
+ allIsEmpty: {
38
+ type: Boolean,
39
+ required: !1
40
+ },
41
+ translateUserId: {
42
+ type: Boolean,
43
+ required: !1
44
+ }
45
+ },
46
+ emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
47
+ setup(e, { emit: s }) {
48
+ const l = e, a = s, n = c(l.selectList), m = (t) => {
49
+ a("filterChange", t);
50
+ }, u = () => {
51
+ a("setNoNeedRefreshNumFilterName", l.filterKey);
52
+ };
53
+ return d(() => {
54
+ const t = `filter-key-${l.enumEntity}`, r = o.getWithExpireTime(t);
55
+ r ? n.value = r : p(`/${l.enumEntity}`).then((i) => {
56
+ n.value = i.data, o.setWithExpireTime(t, n.value, 1200 * 1e3);
57
+ }).catch((i) => {
58
+ console.log(i);
59
+ });
60
+ }), (t, r) => (y(), N(h, {
61
+ "select-list": n.value,
62
+ "count-list": e.countList,
63
+ "total-count": e.totalCount,
64
+ "filter-key": e.filterKey,
65
+ "no-need-refresh-num-filter-name": e.noNeedRefreshNumFilterName,
66
+ "all-is-checkbox": e.allIsCheckbox,
67
+ "translate-user-id": e.translateUserId,
68
+ "all-is-empty": e.allIsEmpty,
69
+ onFilterChange: m,
70
+ onSetNoNeedRefreshNumFilterName: u
71
+ }, null, 8, ["select-list", "count-list", "total-count", "filter-key", "no-need-refresh-num-filter-name", "all-is-checkbox", "translate-user-id", "all-is-empty"]));
72
+ }
73
+ });
74
+ export {
75
+ E as default
76
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./left-condition-enum.vue.js";
2
+ export {
3
+ f as default
4
+ };
File without changes
@@ -0,0 +1,4 @@
1
+ var N = /* @__PURE__ */ ((r) => (r.EN = "en", r.CN = "zh-CN", r))(N || {});
2
+ export {
3
+ N as i18nType
4
+ };