@opentiny/vue-search-box 0.1.6 → 2.27.0
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.
- package/es/index.es.js +2772 -0
- package/es/index.es.js.map +1 -0
- package/lib/index.cjs.js +2 -0
- package/lib/index.cjs.js.map +1 -0
- package/package.json +36 -56
- package/README.md +0 -134
- package/README.zh-CN.md +0 -135
- package/dist/es/components/first-level-panel.vue.es.js +0 -4
- package/dist/es/components/first-level-panel.vue.es2.js +0 -177
- package/dist/es/components/second-level-panel.vue.es.js +0 -4
- package/dist/es/components/second-level-panel.vue.es2.js +0 -466
- package/dist/es/composables/use-checkbox.es.js +0 -74
- package/dist/es/composables/use-custom.es.js +0 -49
- package/dist/es/composables/use-datepicker.es.js +0 -86
- package/dist/es/composables/use-dropdown.es.js +0 -216
- package/dist/es/composables/use-edit.es.js +0 -108
- package/dist/es/composables/use-init.es.js +0 -78
- package/dist/es/composables/use-match.es.js +0 -170
- package/dist/es/composables/use-num-range.es.js +0 -77
- package/dist/es/composables/use-placeholder.es.js +0 -41
- package/dist/es/composables/use-tag.es.js +0 -56
- package/dist/es/index-Tlzvfwv-.css +0 -401
- package/dist/es/index.es.js +0 -45
- package/dist/es/index.type.es.js +0 -1
- package/dist/es/index.vue.es.js +0 -4
- package/dist/es/index.vue.es2.js +0 -780
- package/dist/es/smb-theme.es.js +0 -18
- package/dist/es/utils/clone.es.js +0 -29
- package/dist/es/utils/date.es.js +0 -431
- package/dist/es/utils/dropdown.es.js +0 -24
- package/dist/es/utils/en_US.es.js +0 -45
- package/dist/es/utils/index.es.js +0 -13
- package/dist/es/utils/tag.es.js +0 -44
- package/dist/es/utils/type.es.js +0 -4
- package/dist/es/utils/validate.es.js +0 -179
- package/dist/es/utils/zh_CN.es.js +0 -45
- package/dist/index.css +0 -401
- package/dist/lib/components/first-level-panel.vue.cjs.js +0 -4
- package/dist/lib/components/first-level-panel.vue.cjs2.js +0 -177
- package/dist/lib/components/second-level-panel.vue.cjs.js +0 -4
- package/dist/lib/components/second-level-panel.vue.cjs2.js +0 -466
- package/dist/lib/composables/use-checkbox.cjs.js +0 -74
- package/dist/lib/composables/use-custom.cjs.js +0 -49
- package/dist/lib/composables/use-datepicker.cjs.js +0 -86
- package/dist/lib/composables/use-dropdown.cjs.js +0 -216
- package/dist/lib/composables/use-edit.cjs.js +0 -108
- package/dist/lib/composables/use-init.cjs.js +0 -78
- package/dist/lib/composables/use-match.cjs.js +0 -170
- package/dist/lib/composables/use-num-range.cjs.js +0 -77
- package/dist/lib/composables/use-placeholder.cjs.js +0 -41
- package/dist/lib/composables/use-tag.cjs.js +0 -56
- package/dist/lib/index-Tlzvfwv-.css +0 -401
- package/dist/lib/index.cjs.js +0 -45
- package/dist/lib/index.type.cjs.js +0 -1
- package/dist/lib/index.vue.cjs.js +0 -4
- package/dist/lib/index.vue.cjs2.js +0 -780
- package/dist/lib/smb-theme.cjs.js +0 -18
- package/dist/lib/utils/clone.cjs.js +0 -29
- package/dist/lib/utils/date.cjs.js +0 -431
- package/dist/lib/utils/dropdown.cjs.js +0 -24
- package/dist/lib/utils/en_US.cjs.js +0 -45
- package/dist/lib/utils/index.cjs.js +0 -13
- package/dist/lib/utils/tag.cjs.js +0 -44
- package/dist/lib/utils/type.cjs.js +0 -4
- package/dist/lib/utils/validate.cjs.js +0 -179
- package/dist/lib/utils/zh_CN.cjs.js +0 -45
- package/dist/types/composables/use-checkbox.d.ts +0 -8
- package/dist/types/composables/use-custom.d.ts +0 -7
- package/dist/types/composables/use-datepicker.d.ts +0 -11
- package/dist/types/composables/use-dropdown.d.ts +0 -14
- package/dist/types/composables/use-edit.d.ts +0 -13
- package/dist/types/composables/use-init.d.ts +0 -10
- package/dist/types/composables/use-match.d.ts +0 -8
- package/dist/types/composables/use-num-range.d.ts +0 -9
- package/dist/types/composables/use-placeholder.d.ts +0 -8
- package/dist/types/composables/use-tag.d.ts +0 -9
- package/dist/types/smb-theme.d.ts +0 -15
- package/dist/types/utils/clone.d.ts +0 -12
- package/dist/types/utils/date.d.ts +0 -234
- package/dist/types/utils/dropdown.d.ts +0 -12
- package/dist/types/utils/en_US.d.ts +0 -43
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/tag.d.ts +0 -46
- package/dist/types/utils/type.d.ts +0 -6
- package/dist/types/utils/validate.d.ts +0 -31
- package/dist/types/utils/zh_CN.d.ts +0 -43
- /package/{dist/types → types}/index.type.d.ts +0 -0
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, withDirectives, createCommentVNode, openBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createBlock, withCtx, createTextVNode, vShow, normalizeClass, createVNode, withModifiers } from "vue";
|
|
2
|
-
import TinyFormItem from "@opentiny/vue-form-item";
|
|
3
|
-
import TinyDropdownItem from "@opentiny/vue-dropdown-item";
|
|
4
|
-
import TinyCheckbox from "@opentiny/vue-checkbox";
|
|
5
|
-
import TinyCheckboxGroup from "@opentiny/vue-checkbox-group";
|
|
6
|
-
import TinyDatePicker from "@opentiny/vue-date-picker";
|
|
7
|
-
import TinyInput from "@opentiny/vue-input";
|
|
8
|
-
import TinyButton from "@opentiny/vue-button";
|
|
9
|
-
import Loading from "@opentiny/vue-loading";
|
|
10
|
-
import { t } from "../index.es.js";
|
|
11
|
-
/* empty css */
|
|
12
|
-
const _hoisted_1 = { key: 0 };
|
|
13
|
-
const _hoisted_2 = { class: "tvp-search-box__filter-type" };
|
|
14
|
-
const _hoisted_3 = ["title"];
|
|
15
|
-
const _hoisted_4 = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "tvp-search-box__text-highlight"
|
|
18
|
-
};
|
|
19
|
-
const _hoisted_5 = ["title"];
|
|
20
|
-
const _hoisted_6 = { class: "tvp-search-box__checkbox-wrap" };
|
|
21
|
-
const _hoisted_7 = { class: "tvp-search-box__checkbox-btn" };
|
|
22
|
-
const _hoisted_8 = {
|
|
23
|
-
key: 3,
|
|
24
|
-
class: "tvp-search-box__panel-box"
|
|
25
|
-
};
|
|
26
|
-
const _hoisted_9 = { class: "tvp-search-box__number" };
|
|
27
|
-
const _hoisted_10 = { class: "tvp-search-box__dropdown-title" };
|
|
28
|
-
const _hoisted_11 = { class: "tvp-search-box__dropdown-start" };
|
|
29
|
-
const _hoisted_12 = { class: "tvp-search-box__dropdown-end" };
|
|
30
|
-
const _hoisted_13 = { class: "tvp-search-box__bottom-btn" };
|
|
31
|
-
const _hoisted_14 = {
|
|
32
|
-
key: 4,
|
|
33
|
-
class: "tvp-search-box__panel-box"
|
|
34
|
-
};
|
|
35
|
-
const _hoisted_15 = { class: "tvp-search-box__date-wrap" };
|
|
36
|
-
const _hoisted_16 = { class: "tvp-search-box__dropdown-title" };
|
|
37
|
-
const _hoisted_17 = { class: "tvp-search-box__dropdown-start" };
|
|
38
|
-
const _hoisted_18 = { class: "tvp-search-box__dropdown-end" };
|
|
39
|
-
const _hoisted_19 = { class: "tvp-search-box__bottom-btn" };
|
|
40
|
-
const _hoisted_20 = {
|
|
41
|
-
key: 5,
|
|
42
|
-
class: "tvp-search-box__panel-box"
|
|
43
|
-
};
|
|
44
|
-
const _hoisted_21 = { class: "tvp-search-box__date-wrap" };
|
|
45
|
-
const _hoisted_22 = { class: "tvp-search-box__dropdown-title" };
|
|
46
|
-
const _hoisted_23 = { class: "tvp-search-box__dropdown-start" };
|
|
47
|
-
const _hoisted_24 = { class: "tvp-search-box__dropdown-end" };
|
|
48
|
-
const _hoisted_25 = { class: "tvp-search-box__bottom-btn" };
|
|
49
|
-
const _hoisted_26 = { key: 6 };
|
|
50
|
-
const _hoisted_27 = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "tvp-search-box__filter-type"
|
|
53
|
-
};
|
|
54
|
-
const _hoisted_28 = {
|
|
55
|
-
key: 1,
|
|
56
|
-
class: "tvp-search-box__filter-type"
|
|
57
|
-
};
|
|
58
|
-
const _hoisted_29 = ["title"];
|
|
59
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
|
-
...{
|
|
61
|
-
name: "TinySearchBoxSecondLevelPanel"
|
|
62
|
-
},
|
|
63
|
-
__name: "second-level-panel",
|
|
64
|
-
props: {
|
|
65
|
-
state: {
|
|
66
|
-
type: Object,
|
|
67
|
-
default: () => ({})
|
|
68
|
-
},
|
|
69
|
-
pickerOptions: {
|
|
70
|
-
type: Function,
|
|
71
|
-
default: () => {
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
emits: ["events"],
|
|
76
|
-
setup(__props, { emit: __emit }) {
|
|
77
|
-
const props = __props;
|
|
78
|
-
const isLoading = computed(() => {
|
|
79
|
-
var _a;
|
|
80
|
-
return props.state.hasBackupList && ((_a = props.state.backupList) == null ? void 0 : _a.length) === 0;
|
|
81
|
-
});
|
|
82
|
-
const vLoading = Loading.directive;
|
|
83
|
-
const emits = __emit;
|
|
84
|
-
const showCheckBoxList = computed(() => {
|
|
85
|
-
var _a;
|
|
86
|
-
return (_a = props.state.backupList) == null ? void 0 : _a.find((item) => !item.isFilter);
|
|
87
|
-
});
|
|
88
|
-
const events = (eventName, p1, p2) => {
|
|
89
|
-
emits("events", eventName, p1, p2);
|
|
90
|
-
};
|
|
91
|
-
const setOperator = (e) => {
|
|
92
|
-
events("setOperator", e);
|
|
93
|
-
};
|
|
94
|
-
const selectRadioItem = (e) => {
|
|
95
|
-
events("selectRadioItem", e);
|
|
96
|
-
};
|
|
97
|
-
const selectCheckbox = (e) => {
|
|
98
|
-
events("selectCheckbox", e);
|
|
99
|
-
};
|
|
100
|
-
const sizeChange = (e) => {
|
|
101
|
-
events("sizeChange", e);
|
|
102
|
-
};
|
|
103
|
-
const onConfirmDate = (e, b) => {
|
|
104
|
-
events("onConfirmDate", e, b);
|
|
105
|
-
};
|
|
106
|
-
const selectFirstMap = (e, b) => {
|
|
107
|
-
events("selectFirstMap", e, b);
|
|
108
|
-
};
|
|
109
|
-
const handleDateShow = (e) => {
|
|
110
|
-
events("handleDateShow", e);
|
|
111
|
-
};
|
|
112
|
-
return (_ctx, _cache) => {
|
|
113
|
-
var _a;
|
|
114
|
-
return ((_a = __props.state.currentOperators) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
115
|
-
createElementVNode("span", _hoisted_2, toDisplayString(unref(t)("tvp.tvpSearchbox.operator")), 1),
|
|
116
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.state.currentOperators, (item, index) => {
|
|
117
|
-
return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
|
|
118
|
-
key: item + index,
|
|
119
|
-
class: "tvp-search-box__dropdown-item",
|
|
120
|
-
onClick: ($event) => setOperator(item)
|
|
121
|
-
}, {
|
|
122
|
-
default: withCtx(() => [
|
|
123
|
-
createTextVNode(toDisplayString(item), 1)
|
|
124
|
-
]),
|
|
125
|
-
_: 2
|
|
126
|
-
}, 1032, ["onClick"])), [
|
|
127
|
-
[vShow, item.includes(__props.state.inputValue)]
|
|
128
|
-
]);
|
|
129
|
-
}), 128))
|
|
130
|
-
])) : !__props.state.prevItem.type || __props.state.prevItem.type === "radio" ? withDirectives((openBlock(), createElementBlock("div", {
|
|
131
|
-
key: 1,
|
|
132
|
-
class: normalizeClass(["tvp-search-box__radio-wrap", isLoading.value && "tvp-search-box__loading-box"])
|
|
133
|
-
}, [
|
|
134
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.state.backupList, (item, index) => {
|
|
135
|
-
return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
|
|
136
|
-
key: index + (item.field || item.label),
|
|
137
|
-
disabled: item.isChecked,
|
|
138
|
-
class: "tvp-search-box__dropdown-item",
|
|
139
|
-
onClick: ($event) => selectRadioItem(item)
|
|
140
|
-
}, {
|
|
141
|
-
default: withCtx(() => [
|
|
142
|
-
item.match ? (openBlock(), createElementBlock("span", {
|
|
143
|
-
key: 0,
|
|
144
|
-
title: item.label
|
|
145
|
-
}, [
|
|
146
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(item.match, (text) => {
|
|
147
|
-
return openBlock(), createElementBlock(Fragment, { key: text }, [
|
|
148
|
-
text.toLowerCase() === item.hightlighStr ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
149
|
-
createTextVNode(toDisplayString(text), 1)
|
|
150
|
-
], 64))
|
|
151
|
-
], 64);
|
|
152
|
-
}), 128))
|
|
153
|
-
], 8, _hoisted_3)) : (openBlock(), createElementBlock("span", {
|
|
154
|
-
key: 1,
|
|
155
|
-
title: item.label
|
|
156
|
-
}, toDisplayString(item.label), 9, _hoisted_5))
|
|
157
|
-
]),
|
|
158
|
-
_: 2
|
|
159
|
-
}, 1032, ["disabled", "onClick"])), [
|
|
160
|
-
[vShow, !item.isFilter || !__props.state.inputValue]
|
|
161
|
-
]);
|
|
162
|
-
}), 128))
|
|
163
|
-
], 2)), [
|
|
164
|
-
[unref(vLoading), isLoading.value]
|
|
165
|
-
]) : __props.state.prevItem.type === "checkbox" ? withDirectives((openBlock(), createElementBlock("div", {
|
|
166
|
-
key: 2,
|
|
167
|
-
class: normalizeClass(isLoading.value && "tvp-search-box__loading-box")
|
|
168
|
-
}, [
|
|
169
|
-
showCheckBoxList.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
170
|
-
createElementVNode("div", _hoisted_6, [
|
|
171
|
-
createVNode(unref(TinyCheckboxGroup), {
|
|
172
|
-
modelValue: __props.state.checkAll,
|
|
173
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => __props.state.checkAll = $event),
|
|
174
|
-
class: "tvp-search-box__checkbox"
|
|
175
|
-
}, {
|
|
176
|
-
default: withCtx(() => [
|
|
177
|
-
createVNode(unref(TinyDropdownItem), { class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item" }, {
|
|
178
|
-
default: withCtx(() => [
|
|
179
|
-
createVNode(unref(TinyCheckbox), {
|
|
180
|
-
modelValue: __props.state.checkAll,
|
|
181
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.state.checkAll = $event),
|
|
182
|
-
indeterminate: __props.state.isIndeterminate
|
|
183
|
-
}, {
|
|
184
|
-
default: withCtx(() => [
|
|
185
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.selectAll")), 1)
|
|
186
|
-
]),
|
|
187
|
-
_: 1
|
|
188
|
-
}, 8, ["modelValue", "indeterminate"])
|
|
189
|
-
]),
|
|
190
|
-
_: 1
|
|
191
|
-
})
|
|
192
|
-
]),
|
|
193
|
-
_: 1
|
|
194
|
-
}, 8, ["modelValue"]),
|
|
195
|
-
createVNode(unref(TinyCheckboxGroup), {
|
|
196
|
-
modelValue: __props.state.checkboxGroup,
|
|
197
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => __props.state.checkboxGroup = $event),
|
|
198
|
-
class: "tvp-search-box__checkbox"
|
|
199
|
-
}, {
|
|
200
|
-
default: withCtx(() => [
|
|
201
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.state.backupList, (item, index) => {
|
|
202
|
-
return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
|
|
203
|
-
key: (item.field || item.label) + index,
|
|
204
|
-
class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item"
|
|
205
|
-
}, {
|
|
206
|
-
default: withCtx(() => [
|
|
207
|
-
createVNode(unref(TinyCheckbox), {
|
|
208
|
-
label: __props.state.prevItem.label + item.label,
|
|
209
|
-
title: item.label,
|
|
210
|
-
class: "tvp-search-box__checkbox-item-label"
|
|
211
|
-
}, {
|
|
212
|
-
default: withCtx(() => [
|
|
213
|
-
createTextVNode(toDisplayString(item.label), 1)
|
|
214
|
-
]),
|
|
215
|
-
_: 2
|
|
216
|
-
}, 1032, ["label", "title"])
|
|
217
|
-
]),
|
|
218
|
-
_: 2
|
|
219
|
-
}, 1024)), [
|
|
220
|
-
[vShow, !item.isFilter]
|
|
221
|
-
]);
|
|
222
|
-
}), 128))
|
|
223
|
-
]),
|
|
224
|
-
_: 1
|
|
225
|
-
}, 8, ["modelValue"])
|
|
226
|
-
]),
|
|
227
|
-
createElementVNode("div", _hoisted_7, [
|
|
228
|
-
createVNode(unref(TinyButton), {
|
|
229
|
-
size: "mini",
|
|
230
|
-
onClick: _cache[3] || (_cache[3] = ($event) => selectCheckbox(false))
|
|
231
|
-
}, {
|
|
232
|
-
default: withCtx(() => [
|
|
233
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
|
|
234
|
-
]),
|
|
235
|
-
_: 1
|
|
236
|
-
}),
|
|
237
|
-
createVNode(unref(TinyButton), {
|
|
238
|
-
size: "mini",
|
|
239
|
-
onClick: _cache[4] || (_cache[4] = ($event) => selectCheckbox(true))
|
|
240
|
-
}, {
|
|
241
|
-
default: withCtx(() => [
|
|
242
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
|
|
243
|
-
]),
|
|
244
|
-
_: 1
|
|
245
|
-
})
|
|
246
|
-
])
|
|
247
|
-
], 64)) : createCommentVNode("", true)
|
|
248
|
-
], 2)), [
|
|
249
|
-
[unref(vLoading), isLoading.value]
|
|
250
|
-
]) : __props.state.prevItem.type === "numRange" ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
251
|
-
createElementVNode("div", _hoisted_9, [
|
|
252
|
-
createElementVNode("div", _hoisted_10, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeNumberTitle")), 1),
|
|
253
|
-
createElementVNode("div", _hoisted_11, toDisplayString(unref(t)("tvp.tvpSearchbox.minValueText")) + "(" + toDisplayString(__props.state.prevItem.unit) + ") ", 1),
|
|
254
|
-
createVNode(unref(TinyFormItem), {
|
|
255
|
-
prop: __props.state.curMinNumVar,
|
|
256
|
-
class: "tvp-search-box__number-item",
|
|
257
|
-
"show-message": __props.state.numberShowMessage
|
|
258
|
-
}, {
|
|
259
|
-
default: withCtx(() => [
|
|
260
|
-
createVNode(unref(TinyInput), {
|
|
261
|
-
modelValue: __props.state[__props.state.curMinNumVar],
|
|
262
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => __props.state[__props.state.curMinNumVar] = $event),
|
|
263
|
-
type: "number",
|
|
264
|
-
class: "tvp-search-box__number-input"
|
|
265
|
-
}, null, 8, ["modelValue"])
|
|
266
|
-
]),
|
|
267
|
-
_: 1
|
|
268
|
-
}, 8, ["prop", "show-message"]),
|
|
269
|
-
createElementVNode("div", _hoisted_12, toDisplayString(unref(t)("tvp.tvpSearchbox.maxValueText")) + "(" + toDisplayString(__props.state.prevItem.unit) + ") ", 1),
|
|
270
|
-
createVNode(unref(TinyFormItem), {
|
|
271
|
-
prop: __props.state.curMaxNumVar,
|
|
272
|
-
class: "tvp-search-box__number-item"
|
|
273
|
-
}, {
|
|
274
|
-
default: withCtx(() => [
|
|
275
|
-
createVNode(unref(TinyInput), {
|
|
276
|
-
modelValue: __props.state[__props.state.curMaxNumVar],
|
|
277
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => __props.state[__props.state.curMaxNumVar] = $event),
|
|
278
|
-
type: "number",
|
|
279
|
-
class: "tvp-search-box__number-input"
|
|
280
|
-
}, null, 8, ["modelValue"])
|
|
281
|
-
]),
|
|
282
|
-
_: 1
|
|
283
|
-
}, 8, ["prop"])
|
|
284
|
-
]),
|
|
285
|
-
createElementVNode("div", _hoisted_13, [
|
|
286
|
-
createVNode(unref(TinyButton), {
|
|
287
|
-
size: "mini",
|
|
288
|
-
onClick: _cache[7] || (_cache[7] = ($event) => sizeChange(false))
|
|
289
|
-
}, {
|
|
290
|
-
default: withCtx(() => [
|
|
291
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
|
|
292
|
-
]),
|
|
293
|
-
_: 1
|
|
294
|
-
}),
|
|
295
|
-
createVNode(unref(TinyButton), {
|
|
296
|
-
size: "mini",
|
|
297
|
-
onClick: _cache[8] || (_cache[8] = withModifiers(($event) => sizeChange(true), ["stop"]))
|
|
298
|
-
}, {
|
|
299
|
-
default: withCtx(() => [
|
|
300
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
|
|
301
|
-
]),
|
|
302
|
-
_: 1
|
|
303
|
-
})
|
|
304
|
-
])
|
|
305
|
-
])) : __props.state.prevItem.type === "dateRange" ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
306
|
-
createElementVNode("div", _hoisted_15, [
|
|
307
|
-
createElementVNode("div", _hoisted_16, toDisplayString(__props.state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
|
|
308
|
-
value: (__props.state.prevItem.maxTimeLength / 864e5).toFixed(1)
|
|
309
|
-
}) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
310
|
-
createElementVNode("div", _hoisted_17, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
311
|
-
createVNode(unref(TinyFormItem), {
|
|
312
|
-
prop: "startDate",
|
|
313
|
-
"show-message": Boolean(__props.state.prevItem.maxTimeLength),
|
|
314
|
-
class: "tvp-search-box__date-item"
|
|
315
|
-
}, {
|
|
316
|
-
default: withCtx(() => [
|
|
317
|
-
createVNode(unref(TinyDatePicker), {
|
|
318
|
-
modelValue: __props.state.startDate,
|
|
319
|
-
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => __props.state.startDate = $event),
|
|
320
|
-
format: __props.state.prevItem.format || __props.state.dateRangeFormat,
|
|
321
|
-
"value-format": __props.state.prevItem.format || __props.state.dateRangeFormat,
|
|
322
|
-
"picker-options": __props.pickerOptions(__props.state.startDate, "endDate"),
|
|
323
|
-
class: "tvp-search-box__date-picker",
|
|
324
|
-
onChange: handleDateShow,
|
|
325
|
-
onBlur: handleDateShow
|
|
326
|
-
}, null, 8, ["modelValue", "format", "value-format", "picker-options"])
|
|
327
|
-
]),
|
|
328
|
-
_: 1
|
|
329
|
-
}, 8, ["show-message"]),
|
|
330
|
-
createElementVNode("div", _hoisted_18, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
331
|
-
createVNode(unref(TinyFormItem), {
|
|
332
|
-
prop: "endDate",
|
|
333
|
-
class: "tvp-search-box__date-item"
|
|
334
|
-
}, {
|
|
335
|
-
default: withCtx(() => [
|
|
336
|
-
createVNode(unref(TinyDatePicker), {
|
|
337
|
-
modelValue: __props.state.endDate,
|
|
338
|
-
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => __props.state.endDate = $event),
|
|
339
|
-
format: __props.state.prevItem.format || __props.state.dateRangeFormat,
|
|
340
|
-
"value-format": __props.state.prevItem.format || __props.state.dateRangeFormat,
|
|
341
|
-
"picker-options": __props.pickerOptions(__props.state.startDate),
|
|
342
|
-
class: "tvp-search-box__date-picker",
|
|
343
|
-
onChange: handleDateShow,
|
|
344
|
-
onBlur: handleDateShow
|
|
345
|
-
}, null, 8, ["modelValue", "format", "value-format", "picker-options"])
|
|
346
|
-
]),
|
|
347
|
-
_: 1
|
|
348
|
-
})
|
|
349
|
-
]),
|
|
350
|
-
createElementVNode("div", _hoisted_19, [
|
|
351
|
-
createVNode(unref(TinyButton), {
|
|
352
|
-
size: "mini",
|
|
353
|
-
onClick: _cache[11] || (_cache[11] = ($event) => onConfirmDate(false))
|
|
354
|
-
}, {
|
|
355
|
-
default: withCtx(() => [
|
|
356
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
|
|
357
|
-
]),
|
|
358
|
-
_: 1
|
|
359
|
-
}),
|
|
360
|
-
createVNode(unref(TinyButton), {
|
|
361
|
-
size: "mini",
|
|
362
|
-
onClick: _cache[12] || (_cache[12] = ($event) => onConfirmDate(true))
|
|
363
|
-
}, {
|
|
364
|
-
default: withCtx(() => [
|
|
365
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
|
|
366
|
-
]),
|
|
367
|
-
_: 1
|
|
368
|
-
})
|
|
369
|
-
])
|
|
370
|
-
])) : __props.state.prevItem.type === "datetimeRange" ? (openBlock(), createElementBlock("div", _hoisted_20, [
|
|
371
|
-
createElementVNode("div", _hoisted_21, [
|
|
372
|
-
createElementVNode("div", _hoisted_22, toDisplayString(__props.state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
|
|
373
|
-
value: (__props.state.prevItem.maxTimeLength / 864e5).toFixed(1)
|
|
374
|
-
}) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
|
|
375
|
-
createElementVNode("div", _hoisted_23, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
|
|
376
|
-
createVNode(unref(TinyFormItem), {
|
|
377
|
-
prop: "startDateTime",
|
|
378
|
-
"show-message": Boolean(__props.state.prevItem.maxTimeLength),
|
|
379
|
-
class: "tvp-search-box__date-item"
|
|
380
|
-
}, {
|
|
381
|
-
default: withCtx(() => [
|
|
382
|
-
createVNode(unref(TinyDatePicker), {
|
|
383
|
-
modelValue: __props.state.startDateTime,
|
|
384
|
-
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => __props.state.startDateTime = $event),
|
|
385
|
-
type: "datetime",
|
|
386
|
-
isutc8: true,
|
|
387
|
-
format: __props.state.prevItem.format || __props.state.datetimeRangeFormat,
|
|
388
|
-
"value-format": __props.state.prevItem.format || __props.state.datetimeRangeFormat,
|
|
389
|
-
"picker-options": __props.pickerOptions(__props.state.startDateTime, "endDateTime"),
|
|
390
|
-
class: "tvp-search-box__date-picker",
|
|
391
|
-
onChange: handleDateShow,
|
|
392
|
-
onBlur: handleDateShow
|
|
393
|
-
}, null, 8, ["modelValue", "format", "value-format", "picker-options"])
|
|
394
|
-
]),
|
|
395
|
-
_: 1
|
|
396
|
-
}, 8, ["show-message"]),
|
|
397
|
-
createElementVNode("div", _hoisted_24, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
|
|
398
|
-
createVNode(unref(TinyFormItem), {
|
|
399
|
-
prop: "endDateTime",
|
|
400
|
-
class: "tvp-search-box__date-item"
|
|
401
|
-
}, {
|
|
402
|
-
default: withCtx(() => [
|
|
403
|
-
createVNode(unref(TinyDatePicker), {
|
|
404
|
-
modelValue: __props.state.endDateTime,
|
|
405
|
-
"onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => __props.state.endDateTime = $event),
|
|
406
|
-
type: "datetime",
|
|
407
|
-
isutc8: true,
|
|
408
|
-
format: __props.state.prevItem.format || __props.state.datetimeRangeFormat,
|
|
409
|
-
"value-format": __props.state.prevItem.format || __props.state.datetimeRangeFormat,
|
|
410
|
-
"picker-options": __props.pickerOptions(__props.state.startDateTime),
|
|
411
|
-
class: "tvp-search-box__date-picker",
|
|
412
|
-
onChange: handleDateShow,
|
|
413
|
-
onBlur: handleDateShow
|
|
414
|
-
}, null, 8, ["modelValue", "format", "value-format", "picker-options"])
|
|
415
|
-
]),
|
|
416
|
-
_: 1
|
|
417
|
-
})
|
|
418
|
-
]),
|
|
419
|
-
createElementVNode("div", _hoisted_25, [
|
|
420
|
-
createVNode(unref(TinyButton), {
|
|
421
|
-
size: "mini",
|
|
422
|
-
onClick: _cache[15] || (_cache[15] = ($event) => onConfirmDate(false, true))
|
|
423
|
-
}, {
|
|
424
|
-
default: withCtx(() => [
|
|
425
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
|
|
426
|
-
]),
|
|
427
|
-
_: 1
|
|
428
|
-
}),
|
|
429
|
-
createVNode(unref(TinyButton), {
|
|
430
|
-
size: "mini",
|
|
431
|
-
onClick: _cache[16] || (_cache[16] = ($event) => onConfirmDate(true, true))
|
|
432
|
-
}, {
|
|
433
|
-
default: withCtx(() => [
|
|
434
|
-
createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
|
|
435
|
-
]),
|
|
436
|
-
_: 1
|
|
437
|
-
})
|
|
438
|
-
])
|
|
439
|
-
])) : __props.state.prevItem.type === "map" ? withDirectives((openBlock(), createElementBlock("div", _hoisted_26, [
|
|
440
|
-
__props.state.isShowTagKey ? (openBlock(), createElementBlock("span", _hoisted_27, toDisplayString(unref(t)("tvp.tvpSearchbox.tagKey")), 1)) : (openBlock(), createElementBlock("span", _hoisted_28, toDisplayString(unref(t)("tvp.tvpSearchbox.tagValue")), 1)),
|
|
441
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.state.backupList, (item, index) => {
|
|
442
|
-
return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
|
|
443
|
-
key: item.label + item.value + index,
|
|
444
|
-
disabled: item.isChecked,
|
|
445
|
-
class: "tvp-search-box__dropdown-item",
|
|
446
|
-
onClick: ($event) => selectFirstMap(item, __props.state.isShowTagKey)
|
|
447
|
-
}, {
|
|
448
|
-
default: withCtx(() => [
|
|
449
|
-
createElementVNode("span", {
|
|
450
|
-
title: item.label
|
|
451
|
-
}, toDisplayString(item.label), 9, _hoisted_29)
|
|
452
|
-
]),
|
|
453
|
-
_: 2
|
|
454
|
-
}, 1032, ["disabled", "onClick"])), [
|
|
455
|
-
[vShow, !item.isFilter]
|
|
456
|
-
]);
|
|
457
|
-
}), 128))
|
|
458
|
-
])), [
|
|
459
|
-
[unref(vLoading), isLoading.value]
|
|
460
|
-
]) : createCommentVNode("", true);
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
export {
|
|
465
|
-
_sfc_main as default
|
|
466
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { getTagId, hasTagItem, createNewTag, emitChangeModelEvent } from "../utils/tag.es.js";
|
|
3
|
-
import { omitObj, deepClone } from "../utils/clone.es.js";
|
|
4
|
-
import { showDropdown } from "../utils/dropdown.es.js";
|
|
5
|
-
function useCheckbox({ props, state, emits }) {
|
|
6
|
-
const selectCheckbox = (confirm) => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
showDropdown(state, false);
|
|
9
|
-
const { checkboxGroup, prevItem, propItem } = state;
|
|
10
|
-
const rest = omitObj(prevItem);
|
|
11
|
-
if (confirm) {
|
|
12
|
-
const tagList = [];
|
|
13
|
-
const oldValue = deepClone(state.innerModelValue);
|
|
14
|
-
const { mergeTag, operators, label: prevLabel } = prevItem;
|
|
15
|
-
if (mergeTag) {
|
|
16
|
-
let value = "";
|
|
17
|
-
const options = [];
|
|
18
|
-
const { indexMap } = state;
|
|
19
|
-
const hasTagIndex = indexMap.get(prevLabel);
|
|
20
|
-
hasTagIndex !== void 0 && state.innerModelValue.splice(hasTagIndex, 1);
|
|
21
|
-
(_a = state.backupList) == null ? void 0 : _a.forEach((item) => {
|
|
22
|
-
const { label } = item;
|
|
23
|
-
const checkboxLabel = `${prevLabel}${label}`;
|
|
24
|
-
const hasItem = checkboxGroup.includes(checkboxLabel);
|
|
25
|
-
if (hasItem) {
|
|
26
|
-
delete item.isFilter;
|
|
27
|
-
const id = getTagId(props, prevItem, item);
|
|
28
|
-
const newOptions = { label: item.label, ...id };
|
|
29
|
-
value += !value ? label : ` | ${label}`;
|
|
30
|
-
options.push(newOptions);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
if (options.length > 0) {
|
|
34
|
-
const newTag = { ...rest, value, options };
|
|
35
|
-
tagList.push(newTag);
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
const { valueMap } = state;
|
|
39
|
-
const indexList = [];
|
|
40
|
-
(_b = state.backupList) == null ? void 0 : _b.forEach((item) => {
|
|
41
|
-
const { label } = item;
|
|
42
|
-
const value = `${prevLabel}${label}`;
|
|
43
|
-
const hasItem = checkboxGroup.includes(value);
|
|
44
|
-
if (hasItem && !hasTagItem(state, label)) {
|
|
45
|
-
const id = getTagId(props, prevItem, item);
|
|
46
|
-
const operator = state.operatorValue && operators ? { operator: state.operatorValue } : null;
|
|
47
|
-
const newTag = createNewTag({ ...rest, label: propItem.label, value: label, ...id, ...operator });
|
|
48
|
-
tagList.push(newTag);
|
|
49
|
-
item.isChecked = true;
|
|
50
|
-
} else if (!hasItem && hasTagItem(state, label)) {
|
|
51
|
-
item.isChecked = false;
|
|
52
|
-
const index = valueMap.get(value);
|
|
53
|
-
indexList.push(index);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
if (indexList.length) {
|
|
57
|
-
state.innerModelValue = state.innerModelValue.filter((item, index) => item && !indexList.includes(index));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
emitChangeModelEvent({ emits, state, tagList, oldValue });
|
|
61
|
-
} else {
|
|
62
|
-
propItem.label = "";
|
|
63
|
-
state.inputValue = "";
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const isShowClose = computed(() => props.modelValue.length || state.propItem.label || state.inputValue);
|
|
67
|
-
return {
|
|
68
|
-
selectCheckbox,
|
|
69
|
-
isShowClose
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
useCheckbox
|
|
74
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { emitChangeModelEvent, hasTagItem, resetInput } from "../utils/tag.es.js";
|
|
2
|
-
import { showDropdown, showPopover } from "../utils/dropdown.es.js";
|
|
3
|
-
function useCustom({ state, emits }) {
|
|
4
|
-
const updateCustomValue = (customTag) => {
|
|
5
|
-
showDropdown(state, false);
|
|
6
|
-
const { prevItem, indexMap } = state;
|
|
7
|
-
const { replace, label } = prevItem;
|
|
8
|
-
const tagList = [];
|
|
9
|
-
if (replace && indexMap.has(label)) {
|
|
10
|
-
const index = indexMap.get(label);
|
|
11
|
-
const newTag = { ...prevItem, ...customTag };
|
|
12
|
-
emitChangeModelEvent({ emits, state, newTag, index });
|
|
13
|
-
return;
|
|
14
|
-
} else if (!replace && Array.isArray(customTag)) {
|
|
15
|
-
customTag.forEach((tag) => {
|
|
16
|
-
if (!hasTagItem(state, tag.value)) {
|
|
17
|
-
tagList.push({ ...prevItem, ...tag });
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
if (!hasTagItem(state, customTag.value)) {
|
|
22
|
-
tagList.push({ ...prevItem, ...customTag });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
emitChangeModelEvent({ emits, state, tagList });
|
|
26
|
-
};
|
|
27
|
-
const handleConfirm = (customTag) => {
|
|
28
|
-
if (!customTag) {
|
|
29
|
-
resetInput(state);
|
|
30
|
-
showDropdown(state, false);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
updateCustomValue(customTag);
|
|
34
|
-
};
|
|
35
|
-
const handleEditConfirm = (customTag) => {
|
|
36
|
-
if (!customTag) {
|
|
37
|
-
showPopover(state, false);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
updateCustomValue(customTag);
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
handleConfirm,
|
|
44
|
-
handleEditConfirm
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export {
|
|
48
|
-
useCustom
|
|
49
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { showDropdown } from "../utils/dropdown.es.js";
|
|
2
|
-
import { getVerifyDateTag } from "../utils/validate.es.js";
|
|
3
|
-
import { emitChangeModelEvent } from "../utils/tag.es.js";
|
|
4
|
-
function useDatePicker({ props, state, emits }) {
|
|
5
|
-
const { instance } = state;
|
|
6
|
-
const onConfirmDate = async (confirm, isDateTimeType = false) => {
|
|
7
|
-
if (!confirm) {
|
|
8
|
-
state.propItem.label = "";
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const newTag = await getVerifyDateTag(instance, state, props, isDateTimeType);
|
|
12
|
-
if (newTag) {
|
|
13
|
-
showDropdown(state, false);
|
|
14
|
-
const newValue = props.modelValue.filter((prev) => prev.type !== newTag.type || prev.field !== newTag.field);
|
|
15
|
-
newValue.push(newTag);
|
|
16
|
-
emitChangeModelEvent({ emits, state, newValue });
|
|
17
|
-
} else {
|
|
18
|
-
showDropdown(state);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const handleDateShow = () => showDropdown(state);
|
|
22
|
-
const pickerOptions = (startDate, endName = "") => ({
|
|
23
|
-
disabledDate(time) {
|
|
24
|
-
const { maxTimeLength = 0, min, max } = state.prevItem;
|
|
25
|
-
const endDate = state[endName];
|
|
26
|
-
const curTime = time.getTime();
|
|
27
|
-
if (maxTimeLength > 0) {
|
|
28
|
-
if (min || max) {
|
|
29
|
-
if (endName && endDate) {
|
|
30
|
-
const end = new Date(endDate).getTime();
|
|
31
|
-
const start = !min && max ? end - maxTimeLength : Math.max(min.getTime(), end - maxTimeLength);
|
|
32
|
-
return curTime < start || curTime > end;
|
|
33
|
-
} else if (!endName && startDate) {
|
|
34
|
-
const start = new Date(startDate).getTime();
|
|
35
|
-
const end = min && !max ? start + maxTimeLength : Math.min(max.getTime(), start + maxTimeLength);
|
|
36
|
-
return curTime < start || curTime > end;
|
|
37
|
-
} else {
|
|
38
|
-
return min && curTime < min.getTime() || max && curTime > max.getTime();
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
if (endName && endDate) {
|
|
42
|
-
const end = new Date(endDate).getTime();
|
|
43
|
-
const start = end - maxTimeLength;
|
|
44
|
-
return curTime < start || curTime > end;
|
|
45
|
-
} else if (!endName && startDate) {
|
|
46
|
-
const start = new Date(startDate).getTime();
|
|
47
|
-
const end = start + maxTimeLength;
|
|
48
|
-
return curTime < start || curTime > end;
|
|
49
|
-
} else {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
if (min || max) {
|
|
55
|
-
if (endName && endDate) {
|
|
56
|
-
const end = new Date(endDate).getTime();
|
|
57
|
-
return min && curTime < min.getTime() || curTime > end;
|
|
58
|
-
} else if (!endName && startDate) {
|
|
59
|
-
const start = new Date(startDate).getTime();
|
|
60
|
-
return curTime < start || max && curTime > max.getTime();
|
|
61
|
-
} else {
|
|
62
|
-
return curTime < min || curTime > max;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
if (endName && endDate) {
|
|
66
|
-
const end = new Date(endDate).getTime();
|
|
67
|
-
return curTime > end;
|
|
68
|
-
} else if (!endName && startDate) {
|
|
69
|
-
const start = new Date(startDate).getTime();
|
|
70
|
-
return curTime < start;
|
|
71
|
-
} else {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
onConfirmDate,
|
|
80
|
-
handleDateShow,
|
|
81
|
-
pickerOptions
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
export {
|
|
85
|
-
useDatePicker
|
|
86
|
-
};
|