@opentiny/vue-search-box 0.0.1

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 (74) hide show
  1. package/README.md +111 -0
  2. package/es/composables/use-checkbox.es.js +87 -0
  3. package/es/composables/use-custom.es.js +48 -0
  4. package/es/composables/use-datepicker.es.js +86 -0
  5. package/es/composables/use-dropdown.es.js +207 -0
  6. package/es/composables/use-edit.es.js +106 -0
  7. package/es/composables/use-init.es.js +64 -0
  8. package/es/composables/use-match.es.js +170 -0
  9. package/es/composables/use-num-range.es.js +77 -0
  10. package/es/composables/use-placeholder.es.js +41 -0
  11. package/es/composables/use-tag.es.js +51 -0
  12. package/es/index-DCPOFFNd.css +337 -0
  13. package/es/index.es.js +10 -0
  14. package/es/index.type.es.js +1 -0
  15. package/es/index.vue.es.js +4 -0
  16. package/es/index.vue.es2.js +1287 -0
  17. package/es/smb-theme.es.js +18 -0
  18. package/es/utils/clone.es.js +29 -0
  19. package/es/utils/date.es.js +431 -0
  20. package/es/utils/dropdown.es.js +20 -0
  21. package/es/utils/en_US.es.js +44 -0
  22. package/es/utils/index.es.js +13 -0
  23. package/es/utils/tag.es.js +46 -0
  24. package/es/utils/type.es.js +4 -0
  25. package/es/utils/validate.es.js +179 -0
  26. package/es/utils/zh_CN.es.js +44 -0
  27. package/index.css +337 -0
  28. package/lib/composables/use-checkbox.cjs.js +87 -0
  29. package/lib/composables/use-custom.cjs.js +48 -0
  30. package/lib/composables/use-datepicker.cjs.js +86 -0
  31. package/lib/composables/use-dropdown.cjs.js +207 -0
  32. package/lib/composables/use-edit.cjs.js +106 -0
  33. package/lib/composables/use-init.cjs.js +64 -0
  34. package/lib/composables/use-match.cjs.js +170 -0
  35. package/lib/composables/use-num-range.cjs.js +77 -0
  36. package/lib/composables/use-placeholder.cjs.js +41 -0
  37. package/lib/composables/use-tag.cjs.js +51 -0
  38. package/lib/index-DCPOFFNd.css +337 -0
  39. package/lib/index.cjs.js +10 -0
  40. package/lib/index.type.cjs.js +1 -0
  41. package/lib/index.vue.cjs.js +4 -0
  42. package/lib/index.vue.cjs2.js +1287 -0
  43. package/lib/smb-theme.cjs.js +18 -0
  44. package/lib/utils/clone.cjs.js +29 -0
  45. package/lib/utils/date.cjs.js +431 -0
  46. package/lib/utils/dropdown.cjs.js +20 -0
  47. package/lib/utils/en_US.cjs.js +44 -0
  48. package/lib/utils/index.cjs.js +13 -0
  49. package/lib/utils/tag.cjs.js +46 -0
  50. package/lib/utils/type.cjs.js +4 -0
  51. package/lib/utils/validate.cjs.js +179 -0
  52. package/lib/utils/zh_CN.cjs.js +44 -0
  53. package/package.json +65 -0
  54. package/types/composables/use-checkbox.d.ts +10 -0
  55. package/types/composables/use-custom.d.ts +7 -0
  56. package/types/composables/use-datepicker.d.ts +11 -0
  57. package/types/composables/use-dropdown.d.ts +13 -0
  58. package/types/composables/use-edit.d.ts +13 -0
  59. package/types/composables/use-init.d.ts +10 -0
  60. package/types/composables/use-match.d.ts +8 -0
  61. package/types/composables/use-num-range.d.ts +9 -0
  62. package/types/composables/use-placeholder.d.ts +8 -0
  63. package/types/composables/use-tag.d.ts +9 -0
  64. package/types/index.type.d.ts +189 -0
  65. package/types/smb-theme.d.ts +15 -0
  66. package/types/utils/clone.d.ts +12 -0
  67. package/types/utils/date.d.ts +234 -0
  68. package/types/utils/dropdown.d.ts +12 -0
  69. package/types/utils/en_US.d.ts +41 -0
  70. package/types/utils/index.d.ts +1 -0
  71. package/types/utils/tag.d.ts +46 -0
  72. package/types/utils/type.d.ts +6 -0
  73. package/types/utils/validate.d.ts +31 -0
  74. package/types/utils/zh_CN.d.ts +41 -0
@@ -0,0 +1,1287 @@
1
+ import { defineComponent, reactive, getCurrentInstance, computed, nextTick, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, withModifiers, unref, createVNode, createCommentVNode, Fragment, renderList, createBlock, normalizeClass, withCtx, createElementVNode, toDisplayString, withDirectives, vShow, withKeys, normalizeStyle, createTextVNode, isRef, renderSlot, mergeProps } from "vue";
2
+ import TinyTag from "@opentiny/vue-tag";
3
+ import TinyInput from "@opentiny/vue-input";
4
+ import TinyDropdown from "@opentiny/vue-dropdown";
5
+ import TinyDropdownMenu from "@opentiny/vue-dropdown-menu";
6
+ import TinyDropdownItem from "@opentiny/vue-dropdown-item";
7
+ import TinyCheckbox from "@opentiny/vue-checkbox";
8
+ import TinyCheckboxGroup from "@opentiny/vue-checkbox-group";
9
+ import TinyButton from "@opentiny/vue-button";
10
+ import TinyTooltip from "@opentiny/vue-tooltip";
11
+ import TinyDatePicker from "@opentiny/vue-date-picker";
12
+ import TinyForm from "@opentiny/vue-form";
13
+ import TinyFormItem from "@opentiny/vue-form-item";
14
+ import TinyPopover from "@opentiny/vue-popover";
15
+ import TinySelect from "@opentiny/vue-select";
16
+ import TinyOption from "@opentiny/vue-option";
17
+ import { iconSearch, iconClose, iconHelpQuery } from "@opentiny/vue-icon";
18
+ import locale, { t } from "@opentiny/vue-locale";
19
+ import { useTag } from "./composables/use-tag.es.js";
20
+ import { useDropdown } from "./composables/use-dropdown.es.js";
21
+ import { useMatch } from "./composables/use-match.es.js";
22
+ import { useCheckbox } from "./composables/use-checkbox.es.js";
23
+ import { useDatePicker } from "./composables/use-datepicker.es.js";
24
+ import { useNumRange } from "./composables/use-num-range.es.js";
25
+ import { useEdit } from "./composables/use-edit.es.js";
26
+ import { useCustom } from "./composables/use-custom.es.js";
27
+ import { useInit } from "./composables/use-init.es.js";
28
+ import { usePlaceholder } from "./composables/use-placeholder.es.js";
29
+ import { showPopover, showDropdown } from "./utils/dropdown.es.js";
30
+ /* empty css */
31
+ import { deepClone } from "./utils/clone.es.js";
32
+ import { format } from "./utils/date.es.js";
33
+ import { zhCN } from "./utils/zh_CN.es.js";
34
+ import { enUS } from "./utils/en_US.es.js";
35
+ import { createI18n } from "vue-i18n";
36
+ const _hoisted_1 = { class: "tvp-search-box__tag-value" };
37
+ const _hoisted_2 = {
38
+ key: 0,
39
+ class: "tvp-search-box__placeholder"
40
+ };
41
+ const _hoisted_3 = { class: "tvp-search-box__input-wrapper" };
42
+ const _hoisted_4 = { class: "tvp-search-box__prop" };
43
+ const _hoisted_5 = { class: "tvp-search-box__input-separator" };
44
+ const _hoisted_6 = { class: "tvp-search-box__filter-type" };
45
+ const _hoisted_7 = {
46
+ key: 0,
47
+ class: "tvp-search-box__text-highlight"
48
+ };
49
+ const _hoisted_8 = { class: "tvp-search-box__filter-type" };
50
+ const _hoisted_9 = {
51
+ key: 0,
52
+ class: "tvp-search-box__text-highlight"
53
+ };
54
+ const _hoisted_10 = { class: "tvp-search-box__filter-type" };
55
+ const _hoisted_11 = {
56
+ id: "potential-loading",
57
+ class: "tvp-search-box__potential-box"
58
+ };
59
+ const _hoisted_12 = { key: 0 };
60
+ const _hoisted_13 = { class: "tvp-search-box__text-highlight" };
61
+ const _hoisted_14 = { class: "tvp-search-box__first-panel" };
62
+ const _hoisted_15 = {
63
+ key: 0,
64
+ class: "tvp-search-box__filter-type"
65
+ };
66
+ const _hoisted_16 = ["title"];
67
+ const _hoisted_17 = { key: 0 };
68
+ const _hoisted_18 = { class: "tvp-search-box__filter-type" };
69
+ const _hoisted_19 = {
70
+ key: 1,
71
+ class: "tvp-search-box__radio-wrap"
72
+ };
73
+ const _hoisted_20 = ["title"];
74
+ const _hoisted_21 = {
75
+ key: 0,
76
+ class: "tvp-search-box__text-highlight"
77
+ };
78
+ const _hoisted_22 = ["title"];
79
+ const _hoisted_23 = { key: 2 };
80
+ const _hoisted_24 = { class: "tvp-search-box__checkbox-wrap" };
81
+ const _hoisted_25 = { class: "tvp-search-box__checkbox-btn" };
82
+ const _hoisted_26 = {
83
+ key: 3,
84
+ class: "tvp-search-box__panel-box"
85
+ };
86
+ const _hoisted_27 = { class: "tvp-search-box__number" };
87
+ const _hoisted_28 = { class: "tvp-search-box__dropdown-title" };
88
+ const _hoisted_29 = { class: "tvp-search-box__dropdown-start" };
89
+ const _hoisted_30 = { class: "tvp-search-box__dropdown-end" };
90
+ const _hoisted_31 = { class: "tvp-search-box__bottom-btn" };
91
+ const _hoisted_32 = {
92
+ key: 4,
93
+ class: "tvp-search-box__panel-box"
94
+ };
95
+ const _hoisted_33 = { class: "tvp-search-box__date-wrap" };
96
+ const _hoisted_34 = { class: "tvp-search-box__dropdown-title" };
97
+ const _hoisted_35 = { class: "tvp-search-box__dropdown-start" };
98
+ const _hoisted_36 = { class: "tvp-search-box__dropdown-end" };
99
+ const _hoisted_37 = { class: "tvp-search-box__bottom-btn" };
100
+ const _hoisted_38 = {
101
+ key: 5,
102
+ class: "tvp-search-box__panel-box"
103
+ };
104
+ const _hoisted_39 = { class: "tvp-search-box__date-wrap" };
105
+ const _hoisted_40 = { class: "tvp-search-box__dropdown-title" };
106
+ const _hoisted_41 = { class: "tvp-search-box__dropdown-start" };
107
+ const _hoisted_42 = { class: "tvp-search-box__dropdown-end" };
108
+ const _hoisted_43 = { class: "tvp-search-box__bottom-btn" };
109
+ const _hoisted_44 = { key: 6 };
110
+ const _hoisted_45 = {
111
+ key: 0,
112
+ class: "tvp-search-box__filter-type"
113
+ };
114
+ const _hoisted_46 = {
115
+ key: 1,
116
+ class: "tvp-search-box__filter-type"
117
+ };
118
+ const _hoisted_47 = ["title"];
119
+ const _hoisted_48 = { class: "tvp-search-box__date-wrap" };
120
+ const _hoisted_49 = { class: "tvp-search-box__dropdown-start" };
121
+ const _hoisted_50 = {
122
+ key: 0,
123
+ class: "tvp-search-box__dropdown-end"
124
+ };
125
+ const _hoisted_51 = {
126
+ key: 2,
127
+ class: "tvp-search-box__dropdown-end"
128
+ };
129
+ const _hoisted_52 = {
130
+ key: 4,
131
+ class: "tvp-search-box__number"
132
+ };
133
+ const _hoisted_53 = { class: "tvp-search-box__dropdown-start" };
134
+ const _hoisted_54 = { class: "tvp-search-box__dropdown-end" };
135
+ const _hoisted_55 = {
136
+ key: 5,
137
+ class: "tvp-search-box__date-wrap"
138
+ };
139
+ const _hoisted_56 = { class: "tvp-search-box__dropdown-title" };
140
+ const _hoisted_57 = { class: "tvp-search-box__dropdown-start" };
141
+ const _hoisted_58 = { class: "tvp-search-box__dropdown-end" };
142
+ const _hoisted_59 = {
143
+ key: 6,
144
+ class: "tvp-search-box__date-wrap"
145
+ };
146
+ const _hoisted_60 = { class: "tvp-search-box__dropdown-title" };
147
+ const _hoisted_61 = { class: "tvp-search-box__dropdown-start" };
148
+ const _hoisted_62 = { class: "tvp-search-box__dropdown-end" };
149
+ const _hoisted_63 = { class: "tvp-search-box__bottom-btn" };
150
+ const _hoisted_64 = {
151
+ key: 1,
152
+ class: "tvp-search-box__panel-box"
153
+ };
154
+ const _sfc_main = /* @__PURE__ */ defineComponent({
155
+ ...{
156
+ name: "VueSearchBox"
157
+ },
158
+ __name: "index",
159
+ props: {
160
+ modelValue: {
161
+ type: Array,
162
+ default() {
163
+ return [];
164
+ }
165
+ },
166
+ items: {
167
+ type: Array,
168
+ default: () => []
169
+ },
170
+ emptyPlaceholder: {
171
+ type: String,
172
+ default: t("tvp.tvpSearchbox.defaultPlaceholder")
173
+ },
174
+ potentialOptions: {
175
+ type: Object,
176
+ default() {
177
+ return null;
178
+ }
179
+ },
180
+ // 是否显示帮助图标,新规范默认显示
181
+ showHelp: {
182
+ type: Boolean,
183
+ default: true
184
+ },
185
+ // 标签标识键
186
+ idMapKey: {
187
+ type: String,
188
+ default: "id"
189
+ },
190
+ // 自定义默认搜索项
191
+ defaultField: {
192
+ type: String,
193
+ default: ""
194
+ },
195
+ editable: {
196
+ type: Boolean,
197
+ default: false
198
+ },
199
+ maxlength: {
200
+ type: Number
201
+ },
202
+ // 3.18.0新增
203
+ panelMaxHeight: {
204
+ type: String,
205
+ default: "999px"
206
+ },
207
+ // 3.18.0新增
208
+ splitInputValue: {
209
+ type: String,
210
+ default: ","
211
+ },
212
+ // 3.18.0新增
213
+ showNoDataTip: {
214
+ type: Boolean,
215
+ default: true
216
+ }
217
+ },
218
+ emits: [
219
+ "update:modelValue",
220
+ "change",
221
+ "search",
222
+ "exceed",
223
+ "first-level-select"
224
+ ],
225
+ setup(__props, { expose: __expose, emit: __emit }) {
226
+ locale.initI18n({
227
+ i18n: "zhCN",
228
+ createI18n,
229
+ messages: {
230
+ zhCN: { ...zhCN },
231
+ enUS: { ...enUS }
232
+ }
233
+ });
234
+ const props = __props;
235
+ const emits = __emit;
236
+ const state = reactive({
237
+ innerModelValue: [...props.modelValue],
238
+ recordItems: [],
239
+ groupItems: {},
240
+ inputValue: "",
241
+ matchItems: {},
242
+ propItem: {},
243
+ backupList: [],
244
+ filterList: [],
245
+ checkboxGroup: [],
246
+ prevItem: {},
247
+ backupPrevItem: "",
248
+ formRules: null,
249
+ validType: "text",
250
+ numberShowMessage: true,
251
+ startDate: null,
252
+ startDateTime: null,
253
+ endDate: null,
254
+ endDateTime: null,
255
+ isShowTagKey: true,
256
+ potentialOptions: null,
257
+ hiden: true,
258
+ dateRangeFormat: "yyyy/MM/dd",
259
+ datetimeRangeFormat: "yyyy/MM/dd HH:mm:ss",
260
+ indexMap: /* @__PURE__ */ new Map(),
261
+ valueMap: /* @__PURE__ */ new Map(),
262
+ popoverVisible: false,
263
+ selectValue: "",
264
+ allTypeAttri: {
265
+ label: t("tvp.tvpSearchbox.rulekeyword1"),
266
+ field: "tvpKeyword",
267
+ type: "radio"
268
+ },
269
+ operatorValue: ":",
270
+ // 当前操作符值
271
+ inputEditValue: "",
272
+ currentOperators: "",
273
+ currentEditValue: "",
274
+ isShowDropdown: true,
275
+ // 控制有匹配数据展示开关
276
+ isShowPanel: true,
277
+ // 控制面板显隐
278
+ currentModelValueIndex: -1,
279
+ // 当前编辑的标签索引
280
+ curMinNumVar: "",
281
+ // numRange最小值变量
282
+ curMaxNumVar: "",
283
+ // numRange最大值变量
284
+ instance: getCurrentInstance(),
285
+ isMouseDown: false,
286
+ isResetFlag: true,
287
+ // 输入框触发源重置
288
+ currentEditSelectTags: []
289
+ // 当前编辑多选的标签值
290
+ });
291
+ state.isShowPanel = computed(
292
+ () => {
293
+ var _a;
294
+ return state.isResetFlag && (props.showNoDataTip || !props.showNoDataTip && state.isShowDropdown) && (state.prevItem.type || !state.propItem.label || state.backupList.length || ((_a = state.currentOperators) == null ? void 0 : _a.length));
295
+ }
296
+ );
297
+ const TinyIconSearch = iconSearch();
298
+ const TinyIconClose = iconClose();
299
+ const TinyIconHelpQuery = iconHelpQuery();
300
+ const { selectPropItem, selectRadioItem, createTag, helpClick, setOperator } = useDropdown({
301
+ props,
302
+ emits,
303
+ state,
304
+ t,
305
+ format
306
+ });
307
+ const { deleteTag, clearTag, backspaceDeleteTag } = useTag({
308
+ props,
309
+ state,
310
+ emits
311
+ });
312
+ const { editTag, confirmEditTag, selectPropChange, selectItemIsDisable } = useEdit({
313
+ props,
314
+ state,
315
+ t,
316
+ nextTick,
317
+ format,
318
+ emits
319
+ });
320
+ const { handleInput, selectFirstMap } = useMatch({
321
+ props,
322
+ state,
323
+ emits
324
+ });
325
+ const { placeholder, setPlaceholder } = usePlaceholder({ props, state, t });
326
+ const { selectCheckbox, isIndeterminate, checkAll, isShowClose } = useCheckbox({
327
+ props,
328
+ state,
329
+ emits
330
+ });
331
+ const { onConfirmDate, handleDateShow, pickerOptions } = useDatePicker({
332
+ props,
333
+ state,
334
+ emits
335
+ });
336
+ const { sizeChange, initFormRule } = useNumRange({
337
+ props,
338
+ state,
339
+ t,
340
+ emits
341
+ });
342
+ const { handleConfirm, handleEditConfirm } = useCustom({ state, emits });
343
+ const {
344
+ initItems,
345
+ watchOutsideClick,
346
+ watchMouseDown,
347
+ watchMouseMove,
348
+ handleClick
349
+ } = useInit({
350
+ props,
351
+ state
352
+ });
353
+ watch(
354
+ () => props.items,
355
+ (newVal) => {
356
+ state.recordItems = deepClone(newVal);
357
+ initItems();
358
+ initFormRule();
359
+ },
360
+ {
361
+ deep: true,
362
+ immediate: true
363
+ }
364
+ );
365
+ watch(
366
+ () => state.popoverVisible,
367
+ (newVal) => {
368
+ if (!newVal && !state.inputEditValue.length) {
369
+ state.inputEditValue = state.currentEditSelectTags;
370
+ }
371
+ },
372
+ {
373
+ immediate: true
374
+ }
375
+ );
376
+ watch(
377
+ () => props.modelValue,
378
+ (newVal) => {
379
+ if (newVal) {
380
+ state.indexMap.clear();
381
+ state.valueMap.clear();
382
+ newVal.forEach((item, index) => {
383
+ var _a;
384
+ const value = `${item.label}${item.value}`;
385
+ state.indexMap.set(item.label, index);
386
+ state.valueMap.set(value, index);
387
+ if (((_a = item.options) == null ? void 0 : _a.length) > 0) {
388
+ item.options.forEach((option) => {
389
+ const optionValue = `${item.label}${option.label}`;
390
+ state.valueMap.set(optionValue, index);
391
+ });
392
+ }
393
+ });
394
+ showPopover(state, false);
395
+ if (newVal.length === 0) {
396
+ setPlaceholder(props.emptyPlaceholder);
397
+ }
398
+ if (props.editable && !state.inputEditValue.length && newVal[0]) {
399
+ state.inputEditValue = newVal[0].value;
400
+ }
401
+ }
402
+ state.innerModelValue = [...newVal];
403
+ },
404
+ {
405
+ deep: true,
406
+ immediate: true
407
+ }
408
+ );
409
+ onMounted(() => {
410
+ document.addEventListener("click", watchOutsideClick);
411
+ document.addEventListener("mousedown", watchMouseDown);
412
+ document.addEventListener("mousemove", watchMouseMove);
413
+ });
414
+ onBeforeUnmount(() => {
415
+ document.removeEventListener("click", watchOutsideClick);
416
+ document.removeEventListener("mousedown", watchMouseDown);
417
+ document.removeEventListener("mousemove", watchMouseMove);
418
+ });
419
+ __expose({
420
+ state
421
+ });
422
+ return (_ctx, _cache) => {
423
+ return openBlock(), createElementBlock("div", {
424
+ class: "tvp-search-box",
425
+ onClick: _cache[36] || (_cache[36] = withModifiers(($event) => unref(showPopover)(state, false), ["stop"]))
426
+ }, [
427
+ createVNode(unref(TinyIconSearch), { class: "tvp-search-box__prefix" }),
428
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (tag, index) => {
429
+ return openBlock(), createBlock(unref(TinyTag), {
430
+ key: tag.field + index,
431
+ closable: "",
432
+ class: normalizeClass([
433
+ "tvp-search-box__tag",
434
+ __props.editable && tag.type !== "map" ? "tvp-search-box__tag-editor" : ""
435
+ ]),
436
+ title: `${tag.label} ${tag.operator || ":"} ${tag.value}`,
437
+ onClose: ($event) => unref(deleteTag)(tag),
438
+ onClick: withModifiers(($event) => unref(editTag)(tag, index, $event), ["stop"])
439
+ }, {
440
+ default: withCtx(() => [
441
+ createElementVNode("span", _hoisted_1, toDisplayString(tag.label) + " " + toDisplayString(tag.operator || ":") + " " + toDisplayString(tag.value), 1)
442
+ ]),
443
+ _: 2
444
+ }, 1032, ["class", "title", "onClose", "onClick"]);
445
+ }), 128)),
446
+ __props.modelValue.length ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true),
447
+ createVNode(unref(TinyForm), {
448
+ ref: "formRef",
449
+ model: state,
450
+ rules: state.formRules,
451
+ "validate-type": state.validType,
452
+ "label-width": "0px",
453
+ "message-type": "block",
454
+ class: "tvp-search-box__form"
455
+ }, {
456
+ default: withCtx(() => [
457
+ createElementVNode("div", _hoisted_3, [
458
+ createElementVNode("section", _hoisted_4, [
459
+ withDirectives(createElementVNode("span", null, toDisplayString(state.propItem.label) + " " + toDisplayString(`${state.operatorValue ? state.operatorValue : ""} `), 513), [
460
+ [vShow, state.propItem.label]
461
+ ]),
462
+ withDirectives(createElementVNode("span", null, toDisplayString(state.propItem.value), 513), [
463
+ [vShow, state.propItem.value]
464
+ ])
465
+ ]),
466
+ createVNode(unref(TinyDropdown), {
467
+ ref: "dropdownRef",
468
+ trigger: "click",
469
+ class: "tvp-search-box__dropdown",
470
+ "hide-on-click": state.hiden,
471
+ "show-icon": false,
472
+ "lazy-show-popper": ""
473
+ }, {
474
+ dropdown: withCtx(() => [
475
+ createVNode(unref(TinyDropdownMenu), {
476
+ placement: "bottom-start",
477
+ "popper-class": "tvp-search-box__dropdown-menu",
478
+ style: normalizeStyle({ "max-height": __props.panelMaxHeight }),
479
+ onMouseup: withModifiers(() => {
480
+ }, ["stop"])
481
+ }, {
482
+ default: withCtx(() => {
483
+ var _a;
484
+ return [
485
+ withDirectives(createElementVNode("div", null, [
486
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.matchItems, (value, key) => {
487
+ return openBlock(), createElementBlock(Fragment, { key }, [
488
+ value["attr"].length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
489
+ createElementVNode("span", _hoisted_6, toDisplayString(key === "0" ? unref(t)("tvp.tvpSearchbox.attributeType") : key), 1),
490
+ (openBlock(true), createElementBlock(Fragment, null, renderList(value["attr"], (item, index) => {
491
+ return openBlock(), createBlock(unref(TinyDropdownItem), {
492
+ key: item.label + index,
493
+ class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
494
+ onClick: ($event) => unref(selectPropItem)(item)
495
+ }, {
496
+ default: withCtx(() => [
497
+ createElementVNode("span", null, [
498
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.match, (text) => {
499
+ return openBlock(), createElementBlock(Fragment, { key: text }, [
500
+ Array.isArray(text) ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(text[0]), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
501
+ createTextVNode(toDisplayString(text), 1)
502
+ ], 64))
503
+ ], 64);
504
+ }), 128))
505
+ ])
506
+ ]),
507
+ _: 2
508
+ }, 1032, ["onClick"]);
509
+ }), 128))
510
+ ], 64)) : createCommentVNode("", true),
511
+ value["attrValue"].length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
512
+ createElementVNode("span", _hoisted_8, toDisplayString(unref(t)("tvp.tvpSearchbox.propertyValue", [
513
+ key === "0" ? unref(t)("tvp.tvpSearchbox.attributeType") : key
514
+ ])), 1),
515
+ (openBlock(true), createElementBlock(Fragment, null, renderList(value["attrValue"], (item, index) => {
516
+ return openBlock(), createBlock(unref(TinyDropdownItem), {
517
+ key: item.label + index,
518
+ disabled: item.isChecked,
519
+ class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
520
+ onClick: ($event) => unref(selectRadioItem)(item, true)
521
+ }, {
522
+ default: withCtx(() => [
523
+ createElementVNode("span", null, [
524
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.match, (text) => {
525
+ return openBlock(), createElementBlock(Fragment, { key: text }, [
526
+ Array.isArray(text) ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(text[0]), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
527
+ createTextVNode(toDisplayString(text), 1)
528
+ ], 64))
529
+ ], 64);
530
+ }), 128))
531
+ ])
532
+ ]),
533
+ _: 2
534
+ }, 1032, ["disabled", "onClick"]);
535
+ }), 128))
536
+ ], 64)) : createCommentVNode("", true)
537
+ ], 64);
538
+ }), 128)),
539
+ __props.showNoDataTip && !state.isShowDropdown ? (openBlock(), createBlock(unref(TinyDropdownItem), { key: 0 }, {
540
+ default: withCtx(() => [
541
+ createElementVNode("div", null, toDisplayString(unref(t)("tvp.tvpSearchbox.noData")), 1)
542
+ ]),
543
+ _: 1
544
+ })) : createCommentVNode("", true),
545
+ withDirectives(createElementVNode("div", null, [
546
+ createElementVNode("span", _hoisted_10, toDisplayString(unref(t)("tvp.tvpSearchbox.matched")), 1),
547
+ createElementVNode("div", _hoisted_11, [
548
+ state.potentialOptions ? (openBlock(), createElementBlock("div", _hoisted_12, [
549
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.potentialOptions, (item, index) => {
550
+ return openBlock(), createBlock(unref(TinyDropdownItem), {
551
+ key: item.label + index,
552
+ class: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
553
+ onClick: ($event) => unref(selectRadioItem)(item, true)
554
+ }, {
555
+ default: withCtx(() => [
556
+ createTextVNode(toDisplayString(item.label) + ": ", 1),
557
+ createElementVNode("span", _hoisted_13, toDisplayString(item.value), 1)
558
+ ]),
559
+ _: 2
560
+ }, 1032, ["onClick"]);
561
+ }), 128))
562
+ ])) : createCommentVNode("", true)
563
+ ])
564
+ ], 512), [
565
+ [vShow, props.potentialOptions]
566
+ ])
567
+ ], 512), [
568
+ [
569
+ vShow,
570
+ state.isResetFlag && !state.propItem.label && state.inputValue.trim()
571
+ ]
572
+ ]),
573
+ withDirectives(createElementVNode("div", _hoisted_14, [
574
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.groupItems, (group, key) => {
575
+ return openBlock(), createElementBlock(Fragment, { key }, [
576
+ group.length ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(key === "0" ? unref(t)("tvp.tvpSearchbox.attributeType") : key), 1)) : createCommentVNode("", true),
577
+ (openBlock(true), createElementBlock(Fragment, null, renderList(group, (item, index) => {
578
+ return openBlock(), createBlock(unref(TinyDropdownItem), {
579
+ key: (item.field || item.label) + index,
580
+ class: "tvp-search-box__dropdown-item",
581
+ onClick: ($event) => unref(selectPropItem)(item)
582
+ }, {
583
+ default: withCtx(() => [
584
+ createElementVNode("span", {
585
+ title: item.label
586
+ }, toDisplayString(item.label), 9, _hoisted_16)
587
+ ]),
588
+ _: 2
589
+ }, 1032, ["onClick"]);
590
+ }), 128))
591
+ ], 64);
592
+ }), 128))
593
+ ], 512), [
594
+ [
595
+ vShow,
596
+ state.isResetFlag && !state.propItem.label && !state.inputValue.trim()
597
+ ]
598
+ ]),
599
+ withDirectives(createElementVNode("div", null, [
600
+ ((_a = state.currentOperators) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_17, [
601
+ createElementVNode("span", _hoisted_18, toDisplayString(unref(t)("tvp.tvpSearchbox.operator")), 1),
602
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.currentOperators, (item, index) => {
603
+ return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
604
+ key: item + index,
605
+ class: "tvp-search-box__dropdown-item",
606
+ onClick: ($event) => unref(setOperator)(item)
607
+ }, {
608
+ default: withCtx(() => [
609
+ createTextVNode(toDisplayString(item), 1)
610
+ ]),
611
+ _: 2
612
+ }, 1032, ["onClick"])), [
613
+ [vShow, item.includes(state.inputValue)]
614
+ ]);
615
+ }), 128))
616
+ ])) : !state.prevItem.type || state.prevItem.type === "radio" ? (openBlock(), createElementBlock("div", _hoisted_19, [
617
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.backupList, (item, index) => {
618
+ return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
619
+ key: index + (item.field || item.label),
620
+ disabled: item.isChecked,
621
+ class: "tvp-search-box__dropdown-item",
622
+ onClick: ($event) => unref(selectRadioItem)(item)
623
+ }, {
624
+ default: withCtx(() => [
625
+ item.match ? (openBlock(), createElementBlock("span", {
626
+ key: 0,
627
+ title: item.label
628
+ }, [
629
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.match, (text) => {
630
+ return openBlock(), createElementBlock(Fragment, { key: text }, [
631
+ Array.isArray(text) ? (openBlock(), createElementBlock("span", _hoisted_21, toDisplayString(text[0]), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
632
+ createTextVNode(toDisplayString(text), 1)
633
+ ], 64))
634
+ ], 64);
635
+ }), 128))
636
+ ], 8, _hoisted_20)) : (openBlock(), createElementBlock("span", {
637
+ key: 1,
638
+ title: item.label
639
+ }, toDisplayString(item.label), 9, _hoisted_22))
640
+ ]),
641
+ _: 2
642
+ }, 1032, ["disabled", "onClick"])), [
643
+ [vShow, !item.isFilter || !state.inputValue]
644
+ ]);
645
+ }), 128))
646
+ ])) : state.isResetFlag && state.prevItem.type === "checkbox" ? (openBlock(), createElementBlock("div", _hoisted_23, [
647
+ createElementVNode("div", _hoisted_24, [
648
+ createVNode(unref(TinyCheckboxGroup), {
649
+ modelValue: unref(checkAll),
650
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(checkAll) ? checkAll.value = $event : null),
651
+ class: "tvp-search-box__checkbox"
652
+ }, {
653
+ default: withCtx(() => [
654
+ createVNode(unref(TinyDropdownItem), { class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item" }, {
655
+ default: withCtx(() => [
656
+ createVNode(unref(TinyCheckbox), {
657
+ modelValue: unref(checkAll),
658
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checkAll) ? checkAll.value = $event : null),
659
+ indeterminate: unref(isIndeterminate)
660
+ }, {
661
+ default: withCtx(() => [
662
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.selectAll")), 1)
663
+ ]),
664
+ _: 1
665
+ }, 8, ["modelValue", "indeterminate"])
666
+ ]),
667
+ _: 1
668
+ })
669
+ ]),
670
+ _: 1
671
+ }, 8, ["modelValue"]),
672
+ createVNode(unref(TinyCheckboxGroup), {
673
+ modelValue: state.checkboxGroup,
674
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => state.checkboxGroup = $event),
675
+ class: "tvp-search-box__checkbox"
676
+ }, {
677
+ default: withCtx(() => [
678
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.backupList, (item, index) => {
679
+ return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
680
+ key: (item.field || item.label) + index,
681
+ class: "tvp-search-box__dropdown-item tvp-search-box__checkbox-item"
682
+ }, {
683
+ default: withCtx(() => [
684
+ createVNode(unref(TinyCheckbox), {
685
+ label: state.prevItem.label + item.label,
686
+ title: item.label,
687
+ class: "tvp-search-box__checkbox-item-label"
688
+ }, {
689
+ default: withCtx(() => [
690
+ createTextVNode(toDisplayString(item.label), 1)
691
+ ]),
692
+ _: 2
693
+ }, 1032, ["label", "title"])
694
+ ]),
695
+ _: 2
696
+ }, 1024)), [
697
+ [vShow, !item.isFilter]
698
+ ]);
699
+ }), 128))
700
+ ]),
701
+ _: 1
702
+ }, 8, ["modelValue"])
703
+ ]),
704
+ createElementVNode("div", _hoisted_25, [
705
+ createVNode(unref(TinyButton), {
706
+ size: "mini",
707
+ onClick: _cache[5] || (_cache[5] = ($event) => unref(selectCheckbox)(true))
708
+ }, {
709
+ default: withCtx(() => [
710
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
711
+ ]),
712
+ _: 1
713
+ }),
714
+ createVNode(unref(TinyButton), {
715
+ size: "mini",
716
+ onClick: _cache[6] || (_cache[6] = ($event) => unref(selectCheckbox)(false))
717
+ }, {
718
+ default: withCtx(() => [
719
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
720
+ ]),
721
+ _: 1
722
+ })
723
+ ])
724
+ ])) : state.prevItem.type === "numRange" ? (openBlock(), createElementBlock("div", _hoisted_26, [
725
+ createElementVNode("div", _hoisted_27, [
726
+ createElementVNode("div", _hoisted_28, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeNumberTitle")), 1),
727
+ createElementVNode("div", _hoisted_29, toDisplayString(unref(t)("tvp.tvpSearchbox.minValueText")) + "(" + toDisplayString(state.prevItem.unit) + ") ", 1),
728
+ createVNode(unref(TinyFormItem), {
729
+ prop: state.curMinNumVar,
730
+ class: "tvp-search-box__number-item",
731
+ "show-message": state.numberShowMessage
732
+ }, {
733
+ default: withCtx(() => [
734
+ createVNode(unref(TinyInput), {
735
+ modelValue: state[state.curMinNumVar],
736
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => state[state.curMinNumVar] = $event),
737
+ type: "number",
738
+ class: "tvp-search-box__number-input"
739
+ }, null, 8, ["modelValue"])
740
+ ]),
741
+ _: 1
742
+ }, 8, ["prop", "show-message"]),
743
+ createElementVNode("div", _hoisted_30, toDisplayString(unref(t)("tvp.tvpSearchbox.maxValueText")) + "(" + toDisplayString(state.prevItem.unit) + ") ", 1),
744
+ createVNode(unref(TinyFormItem), {
745
+ prop: state.curMaxNumVar,
746
+ class: "tvp-search-box__number-item"
747
+ }, {
748
+ default: withCtx(() => [
749
+ createVNode(unref(TinyInput), {
750
+ modelValue: state[state.curMaxNumVar],
751
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => state[state.curMaxNumVar] = $event),
752
+ type: "number",
753
+ class: "tvp-search-box__number-input"
754
+ }, null, 8, ["modelValue"])
755
+ ]),
756
+ _: 1
757
+ }, 8, ["prop"])
758
+ ]),
759
+ createElementVNode("div", _hoisted_31, [
760
+ createVNode(unref(TinyButton), {
761
+ size: "mini",
762
+ onClick: _cache[9] || (_cache[9] = withModifiers(($event) => unref(sizeChange)(true), ["stop"]))
763
+ }, {
764
+ default: withCtx(() => [
765
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
766
+ ]),
767
+ _: 1
768
+ }),
769
+ createVNode(unref(TinyButton), {
770
+ size: "mini",
771
+ onClick: _cache[10] || (_cache[10] = ($event) => unref(sizeChange)(false))
772
+ }, {
773
+ default: withCtx(() => [
774
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
775
+ ]),
776
+ _: 1
777
+ })
778
+ ])
779
+ ])) : state.prevItem.type === "dateRange" ? (openBlock(), createElementBlock("div", _hoisted_32, [
780
+ createElementVNode("div", _hoisted_33, [
781
+ createElementVNode("div", _hoisted_34, toDisplayString(state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
782
+ value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
783
+ }) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
784
+ createElementVNode("div", _hoisted_35, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
785
+ createVNode(unref(TinyFormItem), {
786
+ prop: "startDate",
787
+ "show-message": Boolean(state.prevItem.maxTimeLength),
788
+ class: "tvp-search-box__date-item"
789
+ }, {
790
+ default: withCtx(() => [
791
+ createVNode(unref(TinyDatePicker), {
792
+ modelValue: state.startDate,
793
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => state.startDate = $event),
794
+ format: state.prevItem.format || state.dateRangeFormat,
795
+ "value-format": state.prevItem.format || state.dateRangeFormat,
796
+ "picker-options": unref(pickerOptions)(state.startDate, "endDate"),
797
+ class: "tvp-search-box__date-picker",
798
+ onChange: unref(handleDateShow),
799
+ onBlur: unref(handleDateShow)
800
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options", "onChange", "onBlur"])
801
+ ]),
802
+ _: 1
803
+ }, 8, ["show-message"]),
804
+ createElementVNode("div", _hoisted_36, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
805
+ createVNode(unref(TinyFormItem), {
806
+ prop: "endDate",
807
+ class: "tvp-search-box__date-item"
808
+ }, {
809
+ default: withCtx(() => [
810
+ createVNode(unref(TinyDatePicker), {
811
+ modelValue: state.endDate,
812
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => state.endDate = $event),
813
+ format: state.prevItem.format || state.dateRangeFormat,
814
+ "value-format": state.prevItem.format || state.dateRangeFormat,
815
+ "picker-options": unref(pickerOptions)(state.startDate),
816
+ class: "tvp-search-box__date-picker",
817
+ onChange: unref(handleDateShow),
818
+ onBlur: unref(handleDateShow)
819
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options", "onChange", "onBlur"])
820
+ ]),
821
+ _: 1
822
+ })
823
+ ]),
824
+ createElementVNode("div", _hoisted_37, [
825
+ createVNode(unref(TinyButton), {
826
+ size: "mini",
827
+ onClick: _cache[13] || (_cache[13] = ($event) => unref(onConfirmDate)(true))
828
+ }, {
829
+ default: withCtx(() => [
830
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
831
+ ]),
832
+ _: 1
833
+ }),
834
+ createVNode(unref(TinyButton), {
835
+ size: "mini",
836
+ onClick: _cache[14] || (_cache[14] = ($event) => unref(onConfirmDate)(false))
837
+ }, {
838
+ default: withCtx(() => [
839
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
840
+ ]),
841
+ _: 1
842
+ })
843
+ ])
844
+ ])) : state.prevItem.type === "datetimeRange" ? (openBlock(), createElementBlock("div", _hoisted_38, [
845
+ createElementVNode("div", _hoisted_39, [
846
+ createElementVNode("div", _hoisted_40, toDisplayString(state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
847
+ value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
848
+ }) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
849
+ createElementVNode("div", _hoisted_41, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
850
+ createVNode(unref(TinyFormItem), {
851
+ prop: "startDateTime",
852
+ "show-message": Boolean(state.prevItem.maxTimeLength),
853
+ class: "tvp-search-box__date-item"
854
+ }, {
855
+ default: withCtx(() => [
856
+ createVNode(unref(TinyDatePicker), {
857
+ modelValue: state.startDateTime,
858
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => state.startDateTime = $event),
859
+ type: "datetime",
860
+ isutc8: true,
861
+ format: state.prevItem.format || state.datetimeRangeFormat,
862
+ "value-format": state.prevItem.format || state.datetimeRangeFormat,
863
+ "picker-options": unref(pickerOptions)(state.startDateTime, "endDateTime"),
864
+ class: "tvp-search-box__date-picker",
865
+ onChange: unref(handleDateShow),
866
+ onBlur: unref(handleDateShow)
867
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options", "onChange", "onBlur"])
868
+ ]),
869
+ _: 1
870
+ }, 8, ["show-message"]),
871
+ createElementVNode("div", _hoisted_42, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
872
+ createVNode(unref(TinyFormItem), {
873
+ prop: "endDateTime",
874
+ class: "tvp-search-box__date-item"
875
+ }, {
876
+ default: withCtx(() => [
877
+ createVNode(unref(TinyDatePicker), {
878
+ modelValue: state.endDateTime,
879
+ "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => state.endDateTime = $event),
880
+ type: "datetime",
881
+ isutc8: true,
882
+ format: state.prevItem.format || state.datetimeRangeFormat,
883
+ "value-format": state.prevItem.format || state.datetimeRangeFormat,
884
+ "picker-options": unref(pickerOptions)(state.startDateTime),
885
+ class: "tvp-search-box__date-picker",
886
+ onChange: unref(handleDateShow),
887
+ onBlur: unref(handleDateShow)
888
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options", "onChange", "onBlur"])
889
+ ]),
890
+ _: 1
891
+ })
892
+ ]),
893
+ createElementVNode("div", _hoisted_43, [
894
+ createVNode(unref(TinyButton), {
895
+ size: "mini",
896
+ onClick: _cache[17] || (_cache[17] = ($event) => unref(onConfirmDate)(true, true))
897
+ }, {
898
+ default: withCtx(() => [
899
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
900
+ ]),
901
+ _: 1
902
+ }),
903
+ createVNode(unref(TinyButton), {
904
+ size: "mini",
905
+ onClick: _cache[18] || (_cache[18] = ($event) => unref(onConfirmDate)(false, true))
906
+ }, {
907
+ default: withCtx(() => [
908
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
909
+ ]),
910
+ _: 1
911
+ })
912
+ ])
913
+ ])) : state.prevItem.type === "map" ? (openBlock(), createElementBlock("div", _hoisted_44, [
914
+ state.isShowTagKey ? (openBlock(), createElementBlock("span", _hoisted_45, toDisplayString(unref(t)("tvp.tvpSearchbox.tagKey")), 1)) : (openBlock(), createElementBlock("span", _hoisted_46, toDisplayString(unref(t)("tvp.tvpSearchbox.tagValue")), 1)),
915
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.backupList, (item, index) => {
916
+ return withDirectives((openBlock(), createBlock(unref(TinyDropdownItem), {
917
+ key: item.label + item.value + index,
918
+ disabled: item.isChecked,
919
+ class: "tvp-search-box__dropdown-item",
920
+ onClick: ($event) => unref(selectFirstMap)(item, state.isShowTagKey)
921
+ }, {
922
+ default: withCtx(() => [
923
+ createElementVNode("span", {
924
+ title: item.label
925
+ }, toDisplayString(item.label), 9, _hoisted_47)
926
+ ]),
927
+ _: 2
928
+ }, 1032, ["disabled", "onClick"])), [
929
+ [vShow, !item.isFilter]
930
+ ]);
931
+ }), 128))
932
+ ])) : state.prevItem.type === "custom" ? (openBlock(), createElementBlock("div", {
933
+ key: 7,
934
+ class: "tvp-search-box__panel-box",
935
+ onClick: _cache[20] || (_cache[20] = ($event) => unref(showDropdown)(state))
936
+ }, [
937
+ renderSlot(_ctx.$slots, state.prevItem.slotName, mergeProps({
938
+ showDropdown: () => unref(showDropdown)(state),
939
+ onConfirm: unref(handleConfirm)
940
+ }, {
941
+ onClick: _cache[19] || (_cache[19] = withModifiers(() => {
942
+ }, ["stop"]))
943
+ }))
944
+ ])) : createCommentVNode("", true),
945
+ __props.showNoDataTip && !state.isShowDropdown ? (openBlock(), createBlock(unref(TinyDropdownItem), { key: 8 }, {
946
+ default: withCtx(() => [
947
+ createElementVNode("div", null, toDisplayString(unref(t)("tvp.tvpSearchbox.noData")), 1)
948
+ ]),
949
+ _: 1
950
+ })) : createCommentVNode("", true)
951
+ ], 512), [
952
+ [vShow, state.isResetFlag && state.propItem.label]
953
+ ])
954
+ ];
955
+ }),
956
+ _: 3
957
+ }, 8, ["style"])
958
+ ]),
959
+ default: withCtx(() => [
960
+ createVNode(unref(TinyInput), {
961
+ ref: "inputRef",
962
+ modelValue: state.inputValue,
963
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.inputValue = $event),
964
+ class: "tvp-search-box__input",
965
+ placeholder: unref(placeholder),
966
+ maxlength: __props.maxlength && __props.maxlength + 1,
967
+ onKeydown: [
968
+ withKeys(withModifiers(unref(backspaceDeleteTag), ["stop"]), ["delete"]),
969
+ withKeys(withModifiers(unref(createTag), ["stop"]), ["enter"])
970
+ ],
971
+ onInput: unref(handleInput),
972
+ onFocus: _cache[1] || (_cache[1] = ($event) => unref(showPopover)(state, false)),
973
+ onClick: unref(handleClick)
974
+ }, {
975
+ suffix: withCtx(() => [
976
+ withDirectives(createVNode(unref(TinyIconClose), {
977
+ class: "tvp-search-box__input-close",
978
+ onClick: withModifiers(unref(clearTag), ["stop"])
979
+ }, null, 8, ["onClick"]), [
980
+ [vShow, unref(isShowClose)]
981
+ ]),
982
+ withDirectives(createElementVNode("span", _hoisted_5, null, 512), [
983
+ [vShow, unref(isShowClose)]
984
+ ]),
985
+ __props.showHelp ? (openBlock(), createBlock(unref(TinyTooltip), {
986
+ key: 0,
987
+ effect: "dark",
988
+ content: unref(t)("tvp.tvpSearchbox.help"),
989
+ placement: "top"
990
+ }, {
991
+ default: withCtx(() => [
992
+ createVNode(unref(TinyIconHelpQuery), {
993
+ class: "tvp-search-box__input-help",
994
+ onClick: withModifiers(unref(helpClick), ["stop"])
995
+ }, null, 8, ["onClick"])
996
+ ]),
997
+ _: 1
998
+ }, 8, ["content"])) : createCommentVNode("", true),
999
+ createVNode(unref(TinyIconSearch), {
1000
+ class: "tvp-search-box__input-search",
1001
+ onClick: withModifiers(unref(createTag), ["stop"])
1002
+ }, null, 8, ["onClick"])
1003
+ ]),
1004
+ _: 1
1005
+ }, 8, ["modelValue", "placeholder", "maxlength", "onKeydown", "onInput", "onClick"])
1006
+ ]),
1007
+ _: 3
1008
+ }, 8, ["hide-on-click"])
1009
+ ]),
1010
+ __props.editable ? (openBlock(), createBlock(unref(TinyPopover), {
1011
+ key: 0,
1012
+ ref: "popoverRef",
1013
+ modelValue: state.popoverVisible,
1014
+ "onUpdate:modelValue": _cache[35] || (_cache[35] = ($event) => state.popoverVisible = $event),
1015
+ placement: "bottom-start",
1016
+ "visible-arrow": false,
1017
+ trigger: "manual",
1018
+ "popper-class": "tvp-search-box__popover",
1019
+ class: "tvp-search-box__form-popover"
1020
+ }, {
1021
+ default: withCtx(() => [
1022
+ state.prevItem.type !== "custom" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1023
+ createElementVNode("div", _hoisted_48, [
1024
+ createElementVNode("div", _hoisted_49, toDisplayString(unref(t)("tvp.tvpSearchbox.attributeType")), 1),
1025
+ createVNode(unref(TinyFormItem), { class: "tvp-search-box__number-item" }, {
1026
+ default: withCtx(() => [
1027
+ createVNode(unref(TinySelect), {
1028
+ modelValue: state.selectValue,
1029
+ "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => state.selectValue = $event),
1030
+ searchable: "",
1031
+ disabled: state.prevItem.editAttrDisabled
1032
+ }, {
1033
+ default: withCtx(() => [
1034
+ (openBlock(), createBlock(unref(TinyOption), {
1035
+ key: state.allTypeAttri.label,
1036
+ label: unref(t)("tvp.tvpSearchbox.allProperty"),
1037
+ value: state.allTypeAttri.label,
1038
+ disabled: unref(selectItemIsDisable)(state.allTypeAttri),
1039
+ onClick: _cache[21] || (_cache[21] = ($event) => unref(selectPropChange)(
1040
+ state.allTypeAttri,
1041
+ unref(selectItemIsDisable)(state.allTypeAttri)
1042
+ ))
1043
+ }, null, 8, ["label", "value", "disabled"])),
1044
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.recordItems, (item) => {
1045
+ return openBlock(), createBlock(unref(TinyOption), {
1046
+ key: item.label,
1047
+ label: item.label,
1048
+ value: item.label,
1049
+ disabled: unref(selectItemIsDisable)(item),
1050
+ onClick: ($event) => unref(selectPropChange)(item, unref(selectItemIsDisable)(item))
1051
+ }, null, 8, ["label", "value", "disabled", "onClick"]);
1052
+ }), 128))
1053
+ ]),
1054
+ _: 1
1055
+ }, 8, ["modelValue", "disabled"])
1056
+ ]),
1057
+ _: 1
1058
+ }),
1059
+ state.prevItem.operators ? (openBlock(), createElementBlock("div", _hoisted_50, toDisplayString(unref(t)("tvp.tvpSearchbox.operator")), 1)) : createCommentVNode("", true),
1060
+ state.prevItem.operators ? (openBlock(), createBlock(unref(TinyFormItem), {
1061
+ key: 1,
1062
+ class: "tvp-search-box__number-item"
1063
+ }, {
1064
+ default: withCtx(() => [
1065
+ createVNode(unref(TinySelect), {
1066
+ modelValue: state.operatorValue,
1067
+ "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => state.operatorValue = $event)
1068
+ }, {
1069
+ default: withCtx(() => [
1070
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.currentOperators, (item) => {
1071
+ return openBlock(), createBlock(unref(TinyOption), {
1072
+ key: item,
1073
+ label: item,
1074
+ value: item
1075
+ }, null, 8, ["label", "value"]);
1076
+ }), 128))
1077
+ ]),
1078
+ _: 1
1079
+ }, 8, ["modelValue"])
1080
+ ]),
1081
+ _: 1
1082
+ })) : createCommentVNode("", true),
1083
+ state.prevItem.type !== "numRange" ? (openBlock(), createElementBlock("div", _hoisted_51, toDisplayString(unref(t)("tvp.tvpSearchbox.tagValue")), 1)) : createCommentVNode("", true),
1084
+ ![
1085
+ "numRange",
1086
+ "dateRange",
1087
+ "datetimeRange",
1088
+ "custom"
1089
+ ].includes(state.prevItem.type) ? (openBlock(), createBlock(unref(TinyFormItem), {
1090
+ key: 3,
1091
+ prop: "inputEditValue",
1092
+ class: "tvp-search-box__number-item"
1093
+ }, {
1094
+ default: withCtx(() => {
1095
+ var _a;
1096
+ return [
1097
+ ((_a = state.currentEditValue) == null ? void 0 : _a.length) > 0 ? (openBlock(), createBlock(unref(TinySelect), {
1098
+ key: 0,
1099
+ modelValue: state.inputEditValue,
1100
+ "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => state.inputEditValue = $event),
1101
+ class: "tvp-search-box-select",
1102
+ multiple: Boolean(state.prevItem.mergeTag),
1103
+ "allow-create": "",
1104
+ filterable: "",
1105
+ "default-first-option": "",
1106
+ clearable: ""
1107
+ }, {
1108
+ default: withCtx(() => [
1109
+ (openBlock(true), createElementBlock(Fragment, null, renderList(state.currentEditValue, (item) => {
1110
+ return openBlock(), createBlock(unref(TinyOption), {
1111
+ key: item.label,
1112
+ label: item.label,
1113
+ value: item.label
1114
+ }, null, 8, ["label", "value"]);
1115
+ }), 128))
1116
+ ]),
1117
+ _: 1
1118
+ }, 8, ["modelValue", "multiple"])) : (openBlock(), createBlock(unref(TinyInput), {
1119
+ key: 1,
1120
+ modelValue: state.inputEditValue,
1121
+ "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => state.inputEditValue = $event),
1122
+ clearable: ""
1123
+ }, null, 8, ["modelValue"]))
1124
+ ];
1125
+ }),
1126
+ _: 1
1127
+ })) : createCommentVNode("", true),
1128
+ state.prevItem.type === "numRange" ? (openBlock(), createElementBlock("div", _hoisted_52, [
1129
+ createElementVNode("div", _hoisted_53, toDisplayString(unref(t)("tvp.tvpSearchbox.minValueText")) + "(" + toDisplayString(state.prevItem.unit) + ") ", 1),
1130
+ createVNode(unref(TinyFormItem), {
1131
+ prop: state.curMinNumVar,
1132
+ class: "tvp-search-box__number-item",
1133
+ "show-message": state.numberShowMessage
1134
+ }, {
1135
+ default: withCtx(() => [
1136
+ createVNode(unref(TinyInput), {
1137
+ modelValue: state[state.curMinNumVar],
1138
+ "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => state[state.curMinNumVar] = $event),
1139
+ type: "number",
1140
+ class: "tvp-search-box__number-input"
1141
+ }, null, 8, ["modelValue"])
1142
+ ]),
1143
+ _: 1
1144
+ }, 8, ["prop", "show-message"]),
1145
+ createElementVNode("div", _hoisted_54, toDisplayString(unref(t)("tvp.tvpSearchbox.maxValueText")) + "(" + toDisplayString(state.prevItem.unit) + ") ", 1),
1146
+ createVNode(unref(TinyFormItem), {
1147
+ prop: state.curMaxNumVar,
1148
+ class: "tvp-search-box__number-item"
1149
+ }, {
1150
+ default: withCtx(() => [
1151
+ createVNode(unref(TinyInput), {
1152
+ modelValue: state[state.curMaxNumVar],
1153
+ "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => state[state.curMaxNumVar] = $event),
1154
+ type: "number",
1155
+ class: "tvp-search-box__number-input"
1156
+ }, null, 8, ["modelValue"])
1157
+ ]),
1158
+ _: 1
1159
+ }, 8, ["prop"])
1160
+ ])) : createCommentVNode("", true),
1161
+ state.prevItem.type === "dateRange" ? (openBlock(), createElementBlock("div", _hoisted_55, [
1162
+ createElementVNode("div", _hoisted_56, toDisplayString(state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
1163
+ value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
1164
+ }) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
1165
+ createElementVNode("div", _hoisted_57, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
1166
+ createVNode(unref(TinyFormItem), {
1167
+ prop: "startDate",
1168
+ "show-message": Boolean(state.prevItem.maxTimeLength),
1169
+ class: "tvp-search-box__date-item"
1170
+ }, {
1171
+ default: withCtx(() => [
1172
+ createVNode(unref(TinyDatePicker), {
1173
+ modelValue: state.startDate,
1174
+ "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => state.startDate = $event),
1175
+ format: state.prevItem.format || state.dateRangeFormat,
1176
+ "value-format": state.prevItem.format || state.dateRangeFormat,
1177
+ "picker-options": unref(pickerOptions)(state.startDate, "endDate"),
1178
+ class: "tvp-search-box__date-picker"
1179
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
1180
+ ]),
1181
+ _: 1
1182
+ }, 8, ["show-message"]),
1183
+ createElementVNode("div", _hoisted_58, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
1184
+ createVNode(unref(TinyFormItem), {
1185
+ prop: "endDate",
1186
+ class: "tvp-search-box__date-item"
1187
+ }, {
1188
+ default: withCtx(() => [
1189
+ createVNode(unref(TinyDatePicker), {
1190
+ modelValue: state.endDate,
1191
+ "onUpdate:modelValue": _cache[29] || (_cache[29] = ($event) => state.endDate = $event),
1192
+ format: state.prevItem.format || state.dateRangeFormat,
1193
+ "value-format": state.prevItem.format || state.dateRangeFormat,
1194
+ "picker-options": unref(pickerOptions)(state.startDate),
1195
+ class: "tvp-search-box__date-picker"
1196
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
1197
+ ]),
1198
+ _: 1
1199
+ })
1200
+ ])) : createCommentVNode("", true),
1201
+ state.prevItem.type === "datetimeRange" ? (openBlock(), createElementBlock("div", _hoisted_59, [
1202
+ createElementVNode("div", _hoisted_60, toDisplayString(state.prevItem.maxTimeLength > 0 ? unref(t)("tvp.tvpSearchbox.timeLengthTitle", {
1203
+ value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
1204
+ }) : unref(t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
1205
+ createElementVNode("div", _hoisted_61, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
1206
+ createVNode(unref(TinyFormItem), {
1207
+ prop: "startDateTime",
1208
+ "show-message": Boolean(state.prevItem.maxTimeLength),
1209
+ class: "tvp-search-box__date-item"
1210
+ }, {
1211
+ default: withCtx(() => [
1212
+ createVNode(unref(TinyDatePicker), {
1213
+ modelValue: state.startDateTime,
1214
+ "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => state.startDateTime = $event),
1215
+ type: "datetime",
1216
+ isutc8: true,
1217
+ format: state.prevItem.format || state.datetimeRangeFormat,
1218
+ "value-format": state.prevItem.format || state.datetimeRangeFormat,
1219
+ "picker-options": unref(pickerOptions)(state.startDateTime, "endDateTime"),
1220
+ class: "tvp-search-box__date-picker"
1221
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
1222
+ ]),
1223
+ _: 1
1224
+ }, 8, ["show-message"]),
1225
+ createElementVNode("div", _hoisted_62, toDisplayString(unref(t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
1226
+ createVNode(unref(TinyFormItem), {
1227
+ prop: "endDateTime",
1228
+ class: "tvp-search-box__date-item"
1229
+ }, {
1230
+ default: withCtx(() => [
1231
+ createVNode(unref(TinyDatePicker), {
1232
+ modelValue: state.endDateTime,
1233
+ "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => state.endDateTime = $event),
1234
+ type: "datetime",
1235
+ isutc8: true,
1236
+ format: state.prevItem.format || state.datetimeRangeFormat,
1237
+ "value-format": state.prevItem.format || state.datetimeRangeFormat,
1238
+ "picker-options": unref(pickerOptions)(state.startDateTime),
1239
+ class: "tvp-search-box__date-picker"
1240
+ }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
1241
+ ]),
1242
+ _: 1
1243
+ })
1244
+ ])) : createCommentVNode("", true)
1245
+ ]),
1246
+ createElementVNode("div", _hoisted_63, [
1247
+ createVNode(unref(TinyButton), {
1248
+ size: "mini",
1249
+ onClick: _cache[32] || (_cache[32] = ($event) => unref(confirmEditTag)(true))
1250
+ }, {
1251
+ default: withCtx(() => [
1252
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.confirm")), 1)
1253
+ ]),
1254
+ _: 1
1255
+ }),
1256
+ createVNode(unref(TinyButton), {
1257
+ size: "mini",
1258
+ onClick: _cache[33] || (_cache[33] = ($event) => unref(confirmEditTag)(false))
1259
+ }, {
1260
+ default: withCtx(() => [
1261
+ createTextVNode(toDisplayString(unref(t)("tvp.tvpSearchbox.cancel")), 1)
1262
+ ]),
1263
+ _: 1
1264
+ })
1265
+ ])
1266
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_64, [
1267
+ renderSlot(_ctx.$slots, `${state.prevItem.slotName}-edit`, mergeProps({
1268
+ showDropdown: () => unref(showPopover)(state),
1269
+ onConfirm: unref(handleEditConfirm)
1270
+ }, {
1271
+ onClick: _cache[34] || (_cache[34] = withModifiers(() => {
1272
+ }, ["stop"]))
1273
+ }))
1274
+ ]))
1275
+ ]),
1276
+ _: 3
1277
+ }, 8, ["modelValue"])) : createCommentVNode("", true)
1278
+ ]),
1279
+ _: 3
1280
+ }, 8, ["model", "rules", "validate-type"])
1281
+ ]);
1282
+ };
1283
+ }
1284
+ });
1285
+ export {
1286
+ _sfc_main as default
1287
+ };