@opentiny/vue-search-box 0.1.1 → 0.1.2

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