yahee-components 0.0.89 → 0.0.90

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.
@@ -1,7 +1,7 @@
1
- import { defineComponent as R, toRefs as _, ref as l, watch as k } from "vue";
1
+ import { defineComponent as R, toRefs as _, ref as n, watch as k } from "vue";
2
2
  import v from "../_virtual/lodash.js";
3
- import { defaultComplexSearchProps as o } from "./props.js";
4
- import { ElLink as L, ElOption as P, ElButton as G, ElRow as K, ElFormItem as V, ElForm as j, ElIcon as q, ElDialog as Y, ElSelect as $, ElCheckbox as z, ElInput as J } from "element-plus";
3
+ import { defaultComplexSearchProps as l } from "./props.js";
4
+ import { ElLink as G, ElOption as P, ElButton as K, ElRow as V, ElFormItem as j, ElForm as q, ElIcon as Y, ElDialog as $, ElSelect as z, ElCheckbox as J, ElInput as M } from "element-plus";
5
5
  import "element-plus/theme-chalk/src/base.scss";
6
6
  import "element-plus/theme-chalk/src/input.scss";
7
7
  import "element-plus/theme-chalk/src/checkbox.scss";
@@ -18,167 +18,177 @@ import "element-plus/theme-chalk/src/form-item.scss";
18
18
  import "element-plus/theme-chalk/src/row.scss";
19
19
  import "element-plus/theme-chalk/src/button.scss";
20
20
  import "element-plus/theme-chalk/src/link.scss";
21
- import { Search as M } from "@element-plus/icons-vue";
22
- const ye = R({
21
+ import { Search as N } from "@element-plus/icons-vue";
22
+ const Ce = R({
23
23
  name: "YaheeComplexSearch",
24
24
  components: {
25
- ElInput: J,
26
- ElCheckbox: z,
27
- ElSelect: $,
28
- ElDialog: Y,
29
- ElIcon: q,
30
- ElForm: j,
31
- ElFormItem: V,
32
- ElRow: K,
33
- ElButton: G,
25
+ ElInput: M,
26
+ ElCheckbox: J,
27
+ ElSelect: z,
28
+ ElDialog: $,
29
+ ElIcon: Y,
30
+ ElForm: q,
31
+ ElFormItem: j,
32
+ ElRow: V,
33
+ ElButton: K,
34
34
  ElOption: P,
35
- ElLink: L,
36
- Search: M
35
+ ElLink: G,
36
+ Search: N
37
37
  },
38
38
  props: {
39
39
  defaultSearch: {
40
40
  type: String,
41
- default: o().defaultSearch
41
+ default: l().defaultSearch
42
42
  },
43
43
  options: {
44
44
  type: Array,
45
- default: o().options
45
+ default: l().options
46
46
  },
47
47
  placeholderText: {
48
48
  type: String,
49
- default: o().placeholderText
49
+ default: l().placeholderText
50
50
  },
51
51
  showPatchSearch: {
52
52
  type: Boolean,
53
- default: o().showPatchSearch
53
+ default: l().showPatchSearch
54
54
  },
55
55
  showWithinFilterCheckbox: {
56
56
  type: Boolean,
57
- default: o().showWithinFilterCheckbox
57
+ default: l().showWithinFilterCheckbox
58
58
  },
59
59
  specialOptions: {
60
60
  type: Array,
61
- default: o().specialOptions
61
+ default: l().specialOptions
62
62
  },
63
63
  normalOptions: {
64
64
  type: Array,
65
- default: o().normalOptions
65
+ default: l().normalOptions
66
66
  },
67
67
  showSelect: {
68
68
  type: Boolean,
69
- default: o().showSelect
69
+ default: l().showSelect
70
70
  },
71
71
  searchItem: {
72
72
  type: Object,
73
- default: o().searchItem
73
+ default: l().searchItem
74
74
  },
75
75
  isBatchSelectOptionsSameWithInput: {
76
76
  type: Boolean,
77
- default: o().isBatchSelectOptionsSameWithInput
77
+ default: l().isBatchSelectOptionsSameWithInput
78
78
  },
79
79
  batchOptions: {
80
80
  type: Array,
81
- default: o().batchOptions
81
+ default: l().batchOptions
82
82
  }
83
83
  },
84
84
  emits: ["filterChangeGrandson", "update:searchItem"],
85
- setup(y, { emit: f }) {
86
- const { specialOptions: C, normalOptions: g, searchItem: E } = _(y), i = l(y.defaultSearch || "WHOLE_SEARCH"), h = l(""), p = l(!1), d = l(!1), u = l(!1), S = l(null), r = l({ searchType: "WHOLE_SEARCH", searchContent: "" }), I = [{ value: "WHOLE_SEARCH", label: "综合搜索" }], T = {
85
+ setup(y, { emit: p }) {
86
+ const { specialOptions: C, normalOptions: I, searchItem: E } = _(y), s = n(y.defaultSearch || "WHOLE_SEARCH"), o = n(""), i = n(!1), S = n(!1), u = n(!1), d = n(null), r = n({ searchType: "WHOLE_SEARCH", searchContent: "" }), T = [{ value: "WHOLE_SEARCH", label: "综合搜索" }], F = {
87
87
  searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
88
- }, n = l({ ...E.value });
88
+ }, c = n({ ...E.value });
89
89
  k(
90
90
  () => E.value,
91
- (t) => {
92
- n.value = { ...t }, s();
91
+ (e) => {
92
+ c.value = { ...e }, g();
93
93
  },
94
94
  { deep: !0 }
95
95
  );
96
- const b = () => {
97
- s();
96
+ const g = () => {
97
+ let e = {};
98
+ i.value ? e = {
99
+ ...c.value,
100
+ ...o.value ? { putSearch: o.value } : {},
101
+ searchType: s.value
102
+ } : e = {
103
+ ...c.value,
104
+ searchType: s.value
105
+ }, e.putSearch === "" && delete e.putSearch, console.log("左侧筛选条件变化,触发搜索:", e), p("filterChangeGrandson", e, s.value);
106
+ }, m = () => {
107
+ let e = {};
108
+ i.value ? e = {
109
+ ...c.value,
110
+ putSearch: o.value || "",
111
+ searchType: s.value
112
+ } : e = {
113
+ putSearch: o.value || "",
114
+ searchType: s.value
115
+ }, e.putSearch === "" && delete e.putSearch, console.log("搜索框变化,触发搜索:", e), p("filterChangeGrandson", e, s.value);
116
+ }, b = () => {
117
+ m();
98
118
  }, w = () => {
99
- h.value = "", s();
100
- }, s = () => {
101
- let t = {};
102
- p.value ? t = {
103
- ...n.value,
104
- putSearch: h.value || "",
105
- searchType: i.value
106
- } : t = {
107
- putSearch: h.value || "",
108
- searchType: i.value
109
- }, f("filterChangeGrandson", t, i.value);
119
+ o.value = "", m();
110
120
  }, W = () => {
111
- s();
121
+ o.value ? m() : g();
112
122
  }, x = () => {
113
123
  u.value = !0;
114
124
  }, B = () => {
115
125
  u.value = !1, r.value = { searchType: "WHOLE_SEARCH", searchContent: "" };
116
- }, F = (t, e) => {
117
- const a = { ...t };
118
- return v.map(C.value, (c) => c.key).includes(e.filterKey) ? C.value.forEach((c) => delete a[c.key]) : delete a[e.filterKey], a;
119
- }, H = (t) => {
120
- let e = { ...n.value };
121
- v.forEach(t, (a) => {
122
- e = F(e, a);
123
- const { checkedValues: c, filterKey: m } = a;
124
- v.isEmpty(c) ? delete e[m] : g.value.includes(m) ? e[m] = c[0] : e[m] = c;
125
- }), n.value = e, f("update:searchItem", e), p.value && s();
126
- }, A = (t) => {
127
- const e = O(t);
128
- e !== null && (h.value = e, setTimeout(() => {
129
- s();
126
+ }, H = (e, t) => {
127
+ const a = { ...e };
128
+ return v.map(C.value, (h) => h.key).includes(t.filterKey) ? C.value.forEach((h) => delete a[h.key]) : delete a[t.filterKey], a;
129
+ }, A = (e) => {
130
+ let t = { ...c.value };
131
+ v.forEach(e, (a) => {
132
+ t = H(t, a);
133
+ const { checkedValues: h, filterKey: f } = a;
134
+ v.isEmpty(h) ? delete t[f] : I.value.includes(f) ? t[f] = h[0] : t[f] = h;
135
+ }), c.value = t, p("update:searchItem", t);
136
+ }, D = (e) => {
137
+ const t = O(e);
138
+ t !== null && (o.value = t, setTimeout(() => {
139
+ m();
130
140
  }, 50));
131
- }, D = (t) => {
132
- const e = O(t);
133
- if (e) {
141
+ }, L = (e) => {
142
+ const t = O(e);
143
+ if (t) {
134
144
  const a = r.value.searchContent || "";
135
- r.value.searchContent = a ? `${a},${e}` : e;
145
+ r.value.searchContent = a ? `${a},${t}` : t;
136
146
  }
137
- }, O = (t) => {
147
+ }, O = (e) => {
138
148
  var a;
139
- t.preventDefault();
140
- const e = (a = t.clipboardData) == null ? void 0 : a.getData("text/plain");
141
- return e == null ? void 0 : e.replace(/[\n\r\t]+/g, ",");
149
+ e.preventDefault();
150
+ const t = (a = e.clipboardData) == null ? void 0 : a.getData("text/plain");
151
+ return t == null ? void 0 : t.replace(/[\n\r\t]+/g, ",");
142
152
  };
143
153
  return {
144
- selectedSearchType: i,
145
- putSearch: h,
146
- isWithinFilterOptions: p,
147
- confirmLoading: d,
154
+ selectedSearchType: s,
155
+ putSearch: o,
156
+ isWithinFilterOptions: i,
157
+ confirmLoading: S,
148
158
  showBatchSearch: u,
149
- batchSearchFormRef: S,
159
+ batchSearchFormRef: d,
150
160
  batchSearchForm: r,
151
- defalutOptions: I,
152
- rules: T,
161
+ defalutOptions: T,
162
+ rules: F,
153
163
  showBatchSearchDialog: x,
154
164
  handleBatchSearchClose: B,
155
165
  searchWithinFilterOptions: W,
156
166
  handleSearch: b,
157
167
  handleClear: w,
158
- pasteFormatInput: A,
168
+ pasteFormatInput: D,
159
169
  confirmSearch: () => {
160
- S.value && S.value.validate((t) => {
161
- var e;
162
- if (t && ((e = r.value.searchContent) != null && e.trim())) {
163
- d.value = !0;
170
+ d.value && d.value.validate((e) => {
171
+ var t;
172
+ if (e && ((t = r.value.searchContent) != null && t.trim())) {
173
+ S.value = !0;
164
174
  let a = {};
165
- p.value ? a = {
166
- ...n.value,
175
+ i.value ? a = {
176
+ ...c.value,
167
177
  putSearch: r.value.searchContent.trim(),
168
178
  searchType: r.value.searchType
169
179
  } : a = {
170
180
  putSearch: r.value.searchContent.trim(),
171
181
  searchType: r.value.searchType
172
- }, f("filterChangeGrandson", a, r.value.searchType), r.value = { searchType: "WHOLE_SEARCH", searchContent: "" }, u.value = !1, d.value = !1;
182
+ }, p("filterChangeGrandson", a, r.value.searchType), r.value = { searchType: "WHOLE_SEARCH", searchContent: "" }, u.value = !1, S.value = !1;
173
183
  }
174
184
  });
175
185
  },
176
- pasteFormat: D,
177
- filterChange: H,
178
- getSearchItem: () => n.value
186
+ pasteFormat: L,
187
+ filterChange: A,
188
+ getSearchItem: () => c.value
179
189
  };
180
190
  }
181
191
  });
182
192
  export {
183
- ye as default
193
+ Ce as default
184
194
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.89",
4
+ "version": "0.0.90",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -1,3 +0,0 @@
1
- import { DefineComponent } from 'vue';
2
- declare const _default: DefineComponent;
3
- export default _default;
@@ -1,7 +0,0 @@
1
- import { SFCWithInstall } from '../utils/typescript';
2
- import { DefineComponent } from 'vue';
3
- export declare const YaheeComplexSearch: SFCWithInstall<DefineComponent> & Record<string, any>;
4
- export default YaheeComplexSearch;
5
- export * from './complex-search.vue';
6
- export * from './complex-search';
7
- export * from './props';