yahee-components 0.0.84 → 0.0.85

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 (41) hide show
  1. package/es/common-import/common-import.vue.js +313 -311
  2. package/es/filter-container/filter-container.vue.js +67 -0
  3. package/es/filter-container/filter-container.vue2.js +4 -0
  4. package/es/filter-container/index.js +7 -0
  5. package/es/filter-container/style/index.css +17 -0
  6. package/es/filter-wrapper/filter-wrapper.vue.js +7 -0
  7. package/es/filter-wrapper/filter-wrapper.vue2.js +59 -0
  8. package/es/filter-wrapper/index.js +7 -0
  9. package/es/filter-wrapper/style/index.css +3 -0
  10. package/es/installs.js +12 -8
  11. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -0
  12. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +10 -0
  13. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +8 -0
  14. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -0
  15. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +15 -0
  16. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +7 -0
  17. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +5 -0
  18. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  19. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +54 -0
  20. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +7 -0
  21. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +6 -0
  22. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +9 -0
  23. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +7 -0
  24. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +22 -0
  25. package/es/style.css +22 -0
  26. package/es/utils/translate.js +27 -47
  27. package/es/yahee-components.css +1 -1
  28. package/lib/filter-container/style/index.css +17 -0
  29. package/lib/filter-wrapper/style/index.css +3 -0
  30. package/lib/style.css +22 -0
  31. package/package.json +1 -1
  32. package/types/src/filter-container/filter-container.d.ts +5 -0
  33. package/types/src/filter-container/filter-container.vue.d.ts +49 -0
  34. package/types/src/filter-container/props.d.ts +45 -0
  35. package/types/src/filter-wrapper/filter-wrapper.d.ts +5 -0
  36. package/types/src/filter-wrapper/filter-wrapper.vue.d.ts +49 -0
  37. package/types/src/filter-wrapper/props.d.ts +45 -0
  38. package/types/src/utils/translate.d.ts +0 -3
  39. package/es/api/server.js +0 -35
  40. package/es/api/tool.js +0 -71
  41. package/types/src/installs.d.ts +0 -2649
@@ -0,0 +1,67 @@
1
+ import { defineComponent as K, ref as v, computed as p, useSlots as S, provide as M, onMounted as V, onUnmounted as j, createElementBlock as i, openBlock as u, createCommentVNode as g, renderSlot as y } from "vue";
2
+ import I from "../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js";
3
+ const x = { class: "yahee-filter-container" }, N = {
4
+ key: 0,
5
+ class: "filter-section"
6
+ }, O = {
7
+ key: 1,
8
+ class: "search-section"
9
+ }, G = /* @__PURE__ */ K({
10
+ __name: "filter-container",
11
+ props: {
12
+ debounceInterval: { default: 300 },
13
+ immediate: { type: Boolean, default: !1 },
14
+ initialSearchItem: { default: () => ({}) },
15
+ showSearchSection: { type: Boolean, default: !1 }
16
+ },
17
+ emits: ["change", "search"],
18
+ setup(C, { expose: _, emit: b }) {
19
+ const A = Symbol("filterContainer"), r = C, c = b, t = v({ ...r.initialSearchItem }), s = v(/* @__PURE__ */ new Map()), k = p(() => s.value.size > 0 || !!S().filters), w = p(() => r.showSearchSection || Array.from(s.value.values()).some((e) => e.type === "search") || !!S().search), h = I((e) => {
20
+ c("change", e);
21
+ }, r.debounceInterval), m = I((e) => {
22
+ c("search", e);
23
+ }, r.debounceInterval), E = (e, o, n = "filter") => {
24
+ console.log(`注册组件: ${e}, 类型: ${n}`), s.value.set(e, { methods: o, type: n });
25
+ }, $ = (e) => {
26
+ console.log(`注销组件: ${e}`), s.value.delete(e);
27
+ }, d = (e) => {
28
+ const o = Array.isArray(e) ? e : [e], n = { ...t.value };
29
+ o.forEach((z) => {
30
+ const { filterKey: l, checkedValues: a } = z;
31
+ a.length === 0 || a[0] === "" || a[0] === null || a[0] === void 0 ? delete n[l] : a.length === 1 ? n[l] = a[0] : n[l] = a;
32
+ }), t.value = n, h({ ...n });
33
+ }, B = (e) => {
34
+ const o = { ...t.value, ...e };
35
+ t.value = o, m({ ...o });
36
+ }, F = () => {
37
+ t.value = { ...r.initialSearchItem }, s.value.forEach((e) => {
38
+ e.methods.reset && e.methods.reset();
39
+ }), c("change", { ...t.value });
40
+ }, f = () => ({ ...t.value });
41
+ return M(A, {
42
+ registerComponent: E,
43
+ unregisterComponent: $,
44
+ updateSearchItem: d,
45
+ handleSearch: B,
46
+ getCurrentSearchItem: f
47
+ }), _({
48
+ resetAllFilters: F,
49
+ getCurrentSearchItem: f,
50
+ updateSearchItem: d
51
+ }), V(() => {
52
+ console.log("FilterContainer 已挂载,注册组件数量:", s.value.size), r.immediate && Object.keys(t.value).length > 0 && c("change", { ...t.value });
53
+ }), j(() => {
54
+ h.cancel(), m.cancel();
55
+ }), (e, o) => (u(), i("div", x, [
56
+ k.value ? (u(), i("div", N, [
57
+ y(e.$slots, "filters")
58
+ ])) : g("", !0),
59
+ w.value ? (u(), i("div", O, [
60
+ y(e.$slots, "search")
61
+ ])) : g("", !0)
62
+ ]));
63
+ }
64
+ });
65
+ export {
66
+ G as default
67
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./filter-container.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../utils/install.js";
2
+ import o from "./filter-container.vue.js";
3
+ const e = t(o);
4
+ export {
5
+ e as YaheeFilterContainer,
6
+ e as default
7
+ };
@@ -0,0 +1,17 @@
1
+ .yahee-filter-container {
2
+ display: flex;
3
+ width: 100%;
4
+ }
5
+ .yahee-filter-container .filter-section {
6
+ min-width: 200px;
7
+ }
8
+ .yahee-filter-container .search-section {
9
+ min-height: 60px;
10
+ position: fixed;
11
+ right: -50px;
12
+ }
13
+ .yahee-filter-container .content-section {
14
+ flex: 1;
15
+ padding: 16px;
16
+ overflow: auto;
17
+ }
@@ -0,0 +1,7 @@
1
+ import r from "./filter-wrapper.vue2.js";
2
+ /* empty css */
3
+ import o from "../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-841c990f"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,59 @@
1
+ import { defineComponent as f, inject as m, onMounted as d, onUnmounted as h, createElementBlock as y, openBlock as S, renderSlot as g } from "vue";
2
+ const I = { class: "filter-wrapper yahee-filter-wrapper" }, K = /* @__PURE__ */ f({
3
+ name: "YaheeFilterWrapper",
4
+ __name: "filter-wrapper",
5
+ props: {
6
+ id: {},
7
+ filterKey: {},
8
+ type: { default: "filter" },
9
+ reset: {},
10
+ immediate: { type: Boolean, default: !1 }
11
+ },
12
+ setup(p, { expose: l }) {
13
+ const u = Symbol("filterContainer"), r = p, e = m(u), n = (t = {}) => {
14
+ e && e.registerComponent(
15
+ r.id,
16
+ {
17
+ reset: r.reset || t.reset,
18
+ ...t
19
+ },
20
+ r.type
21
+ );
22
+ }, a = (t) => {
23
+ if (!e) return;
24
+ const c = Array.isArray(t) ? t : [t];
25
+ e.updateSearchItem({
26
+ filterKey: r.filterKey,
27
+ checkedValues: c
28
+ });
29
+ }, s = () => e != null && e.getCurrentSearchItem ? e.getCurrentSearchItem() : {}, o = (t) => {
30
+ e != null && e.handleSearch && e.handleSearch(t);
31
+ }, i = () => {
32
+ r.reset && r.reset();
33
+ };
34
+ return l({
35
+ register: n,
36
+ updateFilter: a,
37
+ getCurrentSearchItem: s,
38
+ handleSearch: o,
39
+ reset: i
40
+ }), d(() => {
41
+ if (n({ reset: i }), r.immediate && (e != null && e.getCurrentSearchItem)) {
42
+ const t = e.getCurrentSearchItem();
43
+ t[r.filterKey] && a(t[r.filterKey]);
44
+ }
45
+ }), h(() => {
46
+ e && e.unregisterComponent(r.id);
47
+ }), (t, c) => (S(), y("div", I, [
48
+ g(t.$slots, "default", {
49
+ register: n,
50
+ update: a,
51
+ getCurrentSearchItem: s,
52
+ handleSearch: o
53
+ }, void 0, !0)
54
+ ]));
55
+ }
56
+ });
57
+ export {
58
+ K as default
59
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as r } from "../utils/install.js";
2
+ import t from "./filter-wrapper.vue.js";
3
+ const a = r(t);
4
+ export {
5
+ a as YaheeFilterWrapper,
6
+ a as default
7
+ };
@@ -0,0 +1,3 @@
1
+ .yahee-filter-wrapper {
2
+ font-size: 20px;
3
+ }
package/es/installs.js CHANGED
@@ -4,30 +4,34 @@ import { YaheeCopy as r } from "./copy/index.js";
4
4
  import { YaheeImageUpload as m } from "./image-upload/index.js";
5
5
  import { YaheeOperationLog as t } from "./operation-log/index.js";
6
6
  import { YaheeAnnexUpload as a } from "./annex-upload/index.js";
7
- import { YaheeLeftCondition as p } from "./left-condition/index.js";
8
- import { YaheeLeftConditionEnum as i } from "./left-condition-enum/index.js";
7
+ import { YaheeLeftCondition as i } from "./left-condition/index.js";
8
+ import { YaheeLeftConditionEnum as p } from "./left-condition-enum/index.js";
9
9
  import { YaheeDropDownCondition as n } from "./drop-down-condition/index.js";
10
10
  import { YaheeCountryPlatformShopCondition as f } from "./country-platform-shop-condition/index.js";
11
11
  import { YaheeCommonImport as h } from "./common-import/index.js";
12
12
  import { YaheeBorderWrap as Y } from "./border-wrap/index.js";
13
- import { YaheeEchartGauge as d } from "./echart-gauge/index.js";
14
- import { YaheeScaleScreen as l } from "./scale-screen/index.js";
15
- const A = [
13
+ import { YaheeEchartGauge as l } from "./echart-gauge/index.js";
14
+ import { YaheeScaleScreen as C } from "./scale-screen/index.js";
15
+ import { YaheeFilterContainer as d } from "./filter-container/index.js";
16
+ import { YaheeFilterWrapper as c } from "./filter-wrapper/index.js";
17
+ const G = [
16
18
  o,
17
19
  e,
18
20
  r,
19
21
  m,
20
22
  t,
21
23
  a,
22
- p,
23
24
  i,
25
+ p,
24
26
  n,
25
27
  f,
26
28
  h,
27
29
  Y,
30
+ l,
31
+ C,
28
32
  d,
29
- l
33
+ c
30
34
  ];
31
35
  export {
32
- A as default
36
+ G as default
33
37
  };
@@ -0,0 +1,5 @@
1
+ import o from "./_root.js";
2
+ var m = o.Symbol;
3
+ export {
4
+ m as default
5
+ };
@@ -0,0 +1,10 @@
1
+ import t from "./_Symbol.js";
2
+ import e from "./_getRawTag.js";
3
+ import o from "./_objectToString.js";
4
+ var i = "[object Null]", f = "[object Undefined]", r = t ? t.toStringTag : void 0;
5
+ function m(n) {
6
+ return n == null ? n === void 0 ? f : i : r && r in Object(n) ? e(n) : o(n);
7
+ }
8
+ export {
9
+ m as default
10
+ };
@@ -0,0 +1,8 @@
1
+ import r from "./_trimmedEndIndex.js";
2
+ var a = /^\s+/;
3
+ function t(e) {
4
+ return e && e.slice(0, r(e) + 1).replace(a, "");
5
+ }
6
+ export {
7
+ t as default
8
+ };
@@ -0,0 +1,4 @@
1
+ var l = typeof global == "object" && global && global.Object === Object && global;
2
+ export {
3
+ l as default
4
+ };
@@ -0,0 +1,15 @@
1
+ import e from "./_Symbol.js";
2
+ var o = Object.prototype, c = o.hasOwnProperty, f = o.toString, r = e ? e.toStringTag : void 0;
3
+ function p(t) {
4
+ var a = c.call(t, r), n = t[r];
5
+ try {
6
+ t[r] = void 0;
7
+ var i = !0;
8
+ } catch {
9
+ }
10
+ var g = f.call(t);
11
+ return i && (a ? t[r] = n : delete t[r]), g;
12
+ }
13
+ export {
14
+ p as default
15
+ };
@@ -0,0 +1,7 @@
1
+ var o = Object.prototype, r = o.toString;
2
+ function e(t) {
3
+ return r.call(t);
4
+ }
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,5 @@
1
+ import e from "./_freeGlobal.js";
2
+ var t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
3
+ export {
4
+ r as default
5
+ };
@@ -0,0 +1,9 @@
1
+ var r = /\s/;
2
+ function a(t) {
3
+ for (var e = t.length; e-- && r.test(t.charAt(e)); )
4
+ ;
5
+ return e;
6
+ }
7
+ export {
8
+ a as default
9
+ };
@@ -0,0 +1,54 @@
1
+ import S from "./isObject.js";
2
+ import h from "./now.js";
3
+ import W from "./toNumber.js";
4
+ var y = "Expected a function", R = Math.max, A = Math.min;
5
+ function _(x, i, u) {
6
+ var a, d, c, f, n, r, l = 0, E = !1, m = !1, g = !0;
7
+ if (typeof x != "function")
8
+ throw new TypeError(y);
9
+ i = W(i) || 0, S(u) && (E = !!u.leading, m = "maxWait" in u, c = m ? R(W(u.maxWait) || 0, i) : c, g = "trailing" in u ? !!u.trailing : g);
10
+ function v(e) {
11
+ var t = a, o = d;
12
+ return a = d = void 0, l = e, f = x.apply(o, t), f;
13
+ }
14
+ function b(e) {
15
+ return l = e, n = setTimeout(s, i), E ? v(e) : f;
16
+ }
17
+ function C(e) {
18
+ var t = e - r, o = e - l, p = i - t;
19
+ return m ? A(p, c - o) : p;
20
+ }
21
+ function k(e) {
22
+ var t = e - r, o = e - l;
23
+ return r === void 0 || t >= i || t < 0 || m && o >= c;
24
+ }
25
+ function s() {
26
+ var e = h();
27
+ if (k(e))
28
+ return I(e);
29
+ n = setTimeout(s, C(e));
30
+ }
31
+ function I(e) {
32
+ return n = void 0, g && a ? v(e) : (a = d = void 0, f);
33
+ }
34
+ function L() {
35
+ n !== void 0 && clearTimeout(n), l = 0, a = r = d = n = void 0;
36
+ }
37
+ function M() {
38
+ return n === void 0 ? f : I(h());
39
+ }
40
+ function T() {
41
+ var e = h(), t = k(e);
42
+ if (a = arguments, d = this, r = e, t) {
43
+ if (n === void 0)
44
+ return b(r);
45
+ if (m)
46
+ return clearTimeout(n), n = setTimeout(s, i), v(r);
47
+ }
48
+ return n === void 0 && (n = setTimeout(s, i)), f;
49
+ }
50
+ return T.cancel = L, T.flush = M, T;
51
+ }
52
+ export {
53
+ _ as default
54
+ };
@@ -0,0 +1,7 @@
1
+ function n(t) {
2
+ var e = typeof t;
3
+ return t != null && (e == "object" || e == "function");
4
+ }
5
+ export {
6
+ n as default
7
+ };
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t != null && typeof t == "object";
3
+ }
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1,9 @@
1
+ import t from "./_baseGetTag.js";
2
+ import m from "./isObjectLike.js";
3
+ var r = "[object Symbol]";
4
+ function i(o) {
5
+ return typeof o == "symbol" || m(o) && t(o) == r;
6
+ }
7
+ export {
8
+ i as default
9
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./_root.js";
2
+ var t = function() {
3
+ return o.Date.now();
4
+ };
5
+ export {
6
+ t as default
7
+ };
@@ -0,0 +1,22 @@
1
+ import n from "./_baseTrim.js";
2
+ import f from "./isObject.js";
3
+ import o from "./isSymbol.js";
4
+ var s = NaN, m = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, e = /^0o[0-7]+$/i, b = parseInt;
5
+ function O(r) {
6
+ if (typeof r == "number")
7
+ return r;
8
+ if (o(r))
9
+ return s;
10
+ if (f(r)) {
11
+ var t = typeof r.valueOf == "function" ? r.valueOf() : r;
12
+ r = f(t) ? t + "" : t;
13
+ }
14
+ if (typeof r != "string")
15
+ return r === 0 ? r : +r;
16
+ r = n(r);
17
+ var i = p.test(r);
18
+ return i || e.test(r) ? b(r.slice(2), i ? 2 : 8) : m.test(r) ? s : +r;
19
+ }
20
+ export {
21
+ O as default
22
+ };
package/es/style.css CHANGED
@@ -526,6 +526,28 @@
526
526
  height: 100%;
527
527
  }
528
528
 
529
+ .yahee-filter-container {
530
+ display: flex;
531
+ width: 100%;
532
+ }
533
+ .yahee-filter-container .filter-section {
534
+ min-width: 200px;
535
+ }
536
+ .yahee-filter-container .search-section {
537
+ min-height: 60px;
538
+ position: fixed;
539
+ right: -50px;
540
+ }
541
+ .yahee-filter-container .content-section {
542
+ flex: 1;
543
+ padding: 16px;
544
+ overflow: auto;
545
+ }
546
+
547
+ .yahee-filter-wrapper {
548
+ font-size: 20px;
549
+ }
550
+
529
551
  :root {
530
552
  --el-color-primary: #3366cc;
531
553
  --el-text-color-regular: #000;
@@ -1,58 +1,38 @@
1
- import { sessionStorageProxy as u, storage as s } from "./storage.js";
2
- import g from "../_virtual/lodash.js";
3
- import "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js";
4
- import { i18nType as c } from "../static/CommonObject.js";
5
- import { Get as h } from "../api/server.js";
6
- import y from "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/axios.js";
7
- const j = (e) => {
8
- var a;
9
- const t = u.get("employee") || {}, o = E(e);
10
- if (o === 0) return e;
11
- const r = u.get(`translate${t.Language}`) || {};
12
- if (g.isEmpty(r) || t.Language === "zh-CN" || !/[\u4e00-\u9fa5]/.test(e)) return e;
13
- const l = r[o];
14
- if (l)
15
- return l;
1
+ import { sessionStorageProxy as s, storage as a } from "./storage.js";
2
+ import c from "../_virtual/lodash.js";
3
+ import { i18nType as l } from "../static/CommonObject.js";
4
+ const h = (e) => {
5
+ var u;
6
+ const t = s.get("employee") || {}, n = f(e);
7
+ if (n === 0) return e;
8
+ const r = s.get(`translate${t.Language}`) || {};
9
+ if (c.isEmpty(r) || t.Language === "zh-CN" || !/[\u4e00-\u9fa5]/.test(e)) return e;
10
+ const g = r[n];
11
+ if (g)
12
+ return g;
16
13
  {
17
- const n = ((a = s.get("localStorageListId")) == null ? void 0 : a.split(",")) || [];
18
- if (n.includes(o.toString()))
19
- return e;
20
- n.push(o.toString()), s.set("localStorageListId", n.join(","));
21
- const m = {
22
- projectId: "place-order",
23
- id: o,
24
- cn: e
25
- }, p = "https://erptools.yaheecloud.com/api/translation/addTranslate";
26
- return console.log(p, "url"), y.post(p, m, { withCredentials: !0 }).then((f) => {
27
- f.data.code;
28
- }), e;
14
+ const i = ((u = a.get("localStorageListId")) == null ? void 0 : u.split(",")) || [];
15
+ return i.includes(n.toString()) || (i.push(n.toString()), a.set("localStorageListId", i.join(","))), e;
29
16
  }
30
17
  };
31
- function E(e) {
18
+ function f(e) {
32
19
  let t = 0;
33
20
  if (!e || e.length === 0) return t;
34
- for (let o = 0, r = e.length; o < r; o++) {
35
- const i = e.charCodeAt(o);
36
- t = (t << 5) - t + i, t |= 0;
21
+ for (let n = 0, r = e.length; n < r; n++) {
22
+ const o = e.charCodeAt(n);
23
+ t = (t << 5) - t + o, t |= 0;
37
24
  }
38
25
  return t;
39
26
  }
40
- function S(e, t = "") {
41
- const o = s.getWithExpireTime("totalEmployees");
42
- if (!e || g.isEmpty(o)) return t;
43
- const r = u.get("employee");
44
- if (r.Language === c.CN && t) return t;
45
- const i = o[e];
46
- return i ? r.Language === c.CN ? i.name || t : i.enName || "" : (d(e).then((l) => {
47
- const a = s.getWithExpireTime("totalEmployees") || {}, n = l.data[0];
48
- return n ? (a[e] = n, s.setWithExpireTime("totalEmployees", a, 3600 * 1e3), r.Language === c.CN ? n.name || "" : n.enName || "") : t;
49
- }), t);
50
- }
51
- function d(e) {
52
- const t = "/employee/all";
53
- return h(e ? `${t}?idsStr=${e}` : t);
27
+ function L(e, t = "") {
28
+ const n = a.getWithExpireTime("totalEmployees");
29
+ if (!e || c.isEmpty(n)) return t;
30
+ const r = s.get("employee");
31
+ if (r.Language === l.CN && t) return t;
32
+ const o = n[e];
33
+ return o ? r.Language === l.CN ? o.name || t : o.enName || "" : t;
54
34
  }
55
35
  export {
56
- j as M2,
57
- S as translateEmployeeName
36
+ h as M2,
37
+ L as translateEmployeeName
58
38
  };
@@ -1 +1 @@
1
- .container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.v3-infinite-loading[data-v-4bdee133]{width:100%;height:44px}.state-error[data-v-4bdee133]{display:flex;flex-direction:column;align-items:center}.retry[data-v-4bdee133]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-4bdee133]:hover{opacity:.8}
1
+ .container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.v3-infinite-loading[data-v-4bdee133]{width:100%;height:44px}.state-error[data-v-4bdee133]{display:flex;flex-direction:column;align-items:center}.retry[data-v-4bdee133]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-4bdee133]:hover{opacity:.8}.filter-wrapper[data-v-841c990f]{display:inline-block;margin-right:16px;margin-bottom:16px;vertical-align:top}
@@ -0,0 +1,17 @@
1
+ .yahee-filter-container {
2
+ display: flex;
3
+ width: 100%;
4
+ }
5
+ .yahee-filter-container .filter-section {
6
+ min-width: 200px;
7
+ }
8
+ .yahee-filter-container .search-section {
9
+ min-height: 60px;
10
+ position: fixed;
11
+ right: -50px;
12
+ }
13
+ .yahee-filter-container .content-section {
14
+ flex: 1;
15
+ padding: 16px;
16
+ overflow: auto;
17
+ }
@@ -0,0 +1,3 @@
1
+ .yahee-filter-wrapper {
2
+ font-size: 20px;
3
+ }
package/lib/style.css CHANGED
@@ -526,6 +526,28 @@
526
526
  height: 100%;
527
527
  }
528
528
 
529
+ .yahee-filter-container {
530
+ display: flex;
531
+ width: 100%;
532
+ }
533
+ .yahee-filter-container .filter-section {
534
+ min-width: 200px;
535
+ }
536
+ .yahee-filter-container .search-section {
537
+ min-height: 60px;
538
+ position: fixed;
539
+ right: -50px;
540
+ }
541
+ .yahee-filter-container .content-section {
542
+ flex: 1;
543
+ padding: 16px;
544
+ overflow: auto;
545
+ }
546
+
547
+ .yahee-filter-wrapper {
548
+ font-size: 20px;
549
+ }
550
+
529
551
  :root {
530
552
  --el-color-primary: #3366cc;
531
553
  --el-text-color-regular: #000;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.84",
4
+ "version": "0.0.85",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -0,0 +1,5 @@
1
+ import { default as FilterContainer } from './filter-container.vue';
2
+ /**
3
+ * 定义instance类型
4
+ */
5
+ export type FilterContainerInstance = InstanceType<typeof FilterContainer>;
@@ -0,0 +1,49 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type Primitive = string | number | boolean | null | undefined;
3
+ type FilterValue = Primitive | Primitive[];
4
+ interface FilterChangeEvent {
5
+ filterKey: string;
6
+ checkedValues: FilterValue[];
7
+ }
8
+ interface SearchItem {
9
+ [key: string]: FilterValue;
10
+ }
11
+ interface FilterContainerProps {
12
+ debounceInterval?: number;
13
+ immediate?: boolean;
14
+ initialSearchItem?: SearchItem;
15
+ showSearchSection?: boolean;
16
+ }
17
+ declare function __VLS_template(): {
18
+ attrs: Partial<{}>;
19
+ slots: {
20
+ filters?(_: {}): any;
21
+ search?(_: {}): any;
22
+ };
23
+ refs: {};
24
+ rootEl: HTMLDivElement;
25
+ };
26
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
27
+ declare const __VLS_component: DefineComponent<FilterContainerProps, {
28
+ resetAllFilters: () => void;
29
+ getCurrentSearchItem: () => SearchItem;
30
+ updateSearchItem: (changes: FilterChangeEvent | FilterChangeEvent[]) => void;
31
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
32
+ change: (searchItem: SearchItem) => any;
33
+ search: (searchItem: SearchItem) => any;
34
+ }, string, PublicProps, Readonly<FilterContainerProps> & Readonly<{
35
+ onChange?: (searchItem: SearchItem) => any;
36
+ onSearch?: (searchItem: SearchItem) => any;
37
+ }>, {
38
+ debounceInterval: number;
39
+ immediate: boolean;
40
+ initialSearchItem: SearchItem;
41
+ showSearchSection: boolean;
42
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
43
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
44
+ export default _default;
45
+ type __VLS_WithTemplateSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };