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