@opentiny/vue-search-box 0.1.6 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/es/index.es.js +2772 -0
  2. package/es/index.es.js.map +1 -0
  3. package/lib/index.cjs.js +2 -0
  4. package/lib/index.cjs.js.map +1 -0
  5. package/package.json +36 -56
  6. package/README.md +0 -134
  7. package/README.zh-CN.md +0 -135
  8. package/dist/es/components/first-level-panel.vue.es.js +0 -4
  9. package/dist/es/components/first-level-panel.vue.es2.js +0 -177
  10. package/dist/es/components/second-level-panel.vue.es.js +0 -4
  11. package/dist/es/components/second-level-panel.vue.es2.js +0 -466
  12. package/dist/es/composables/use-checkbox.es.js +0 -74
  13. package/dist/es/composables/use-custom.es.js +0 -49
  14. package/dist/es/composables/use-datepicker.es.js +0 -86
  15. package/dist/es/composables/use-dropdown.es.js +0 -216
  16. package/dist/es/composables/use-edit.es.js +0 -108
  17. package/dist/es/composables/use-init.es.js +0 -78
  18. package/dist/es/composables/use-match.es.js +0 -170
  19. package/dist/es/composables/use-num-range.es.js +0 -77
  20. package/dist/es/composables/use-placeholder.es.js +0 -41
  21. package/dist/es/composables/use-tag.es.js +0 -56
  22. package/dist/es/index-Tlzvfwv-.css +0 -401
  23. package/dist/es/index.es.js +0 -45
  24. package/dist/es/index.type.es.js +0 -1
  25. package/dist/es/index.vue.es.js +0 -4
  26. package/dist/es/index.vue.es2.js +0 -780
  27. package/dist/es/smb-theme.es.js +0 -18
  28. package/dist/es/utils/clone.es.js +0 -29
  29. package/dist/es/utils/date.es.js +0 -431
  30. package/dist/es/utils/dropdown.es.js +0 -24
  31. package/dist/es/utils/en_US.es.js +0 -45
  32. package/dist/es/utils/index.es.js +0 -13
  33. package/dist/es/utils/tag.es.js +0 -44
  34. package/dist/es/utils/type.es.js +0 -4
  35. package/dist/es/utils/validate.es.js +0 -179
  36. package/dist/es/utils/zh_CN.es.js +0 -45
  37. package/dist/index.css +0 -401
  38. package/dist/lib/components/first-level-panel.vue.cjs.js +0 -4
  39. package/dist/lib/components/first-level-panel.vue.cjs2.js +0 -177
  40. package/dist/lib/components/second-level-panel.vue.cjs.js +0 -4
  41. package/dist/lib/components/second-level-panel.vue.cjs2.js +0 -466
  42. package/dist/lib/composables/use-checkbox.cjs.js +0 -74
  43. package/dist/lib/composables/use-custom.cjs.js +0 -49
  44. package/dist/lib/composables/use-datepicker.cjs.js +0 -86
  45. package/dist/lib/composables/use-dropdown.cjs.js +0 -216
  46. package/dist/lib/composables/use-edit.cjs.js +0 -108
  47. package/dist/lib/composables/use-init.cjs.js +0 -78
  48. package/dist/lib/composables/use-match.cjs.js +0 -170
  49. package/dist/lib/composables/use-num-range.cjs.js +0 -77
  50. package/dist/lib/composables/use-placeholder.cjs.js +0 -41
  51. package/dist/lib/composables/use-tag.cjs.js +0 -56
  52. package/dist/lib/index-Tlzvfwv-.css +0 -401
  53. package/dist/lib/index.cjs.js +0 -45
  54. package/dist/lib/index.type.cjs.js +0 -1
  55. package/dist/lib/index.vue.cjs.js +0 -4
  56. package/dist/lib/index.vue.cjs2.js +0 -780
  57. package/dist/lib/smb-theme.cjs.js +0 -18
  58. package/dist/lib/utils/clone.cjs.js +0 -29
  59. package/dist/lib/utils/date.cjs.js +0 -431
  60. package/dist/lib/utils/dropdown.cjs.js +0 -24
  61. package/dist/lib/utils/en_US.cjs.js +0 -45
  62. package/dist/lib/utils/index.cjs.js +0 -13
  63. package/dist/lib/utils/tag.cjs.js +0 -44
  64. package/dist/lib/utils/type.cjs.js +0 -4
  65. package/dist/lib/utils/validate.cjs.js +0 -179
  66. package/dist/lib/utils/zh_CN.cjs.js +0 -45
  67. package/dist/types/composables/use-checkbox.d.ts +0 -8
  68. package/dist/types/composables/use-custom.d.ts +0 -7
  69. package/dist/types/composables/use-datepicker.d.ts +0 -11
  70. package/dist/types/composables/use-dropdown.d.ts +0 -14
  71. package/dist/types/composables/use-edit.d.ts +0 -13
  72. package/dist/types/composables/use-init.d.ts +0 -10
  73. package/dist/types/composables/use-match.d.ts +0 -8
  74. package/dist/types/composables/use-num-range.d.ts +0 -9
  75. package/dist/types/composables/use-placeholder.d.ts +0 -8
  76. package/dist/types/composables/use-tag.d.ts +0 -9
  77. package/dist/types/smb-theme.d.ts +0 -15
  78. package/dist/types/utils/clone.d.ts +0 -12
  79. package/dist/types/utils/date.d.ts +0 -234
  80. package/dist/types/utils/dropdown.d.ts +0 -12
  81. package/dist/types/utils/en_US.d.ts +0 -43
  82. package/dist/types/utils/index.d.ts +0 -1
  83. package/dist/types/utils/tag.d.ts +0 -46
  84. package/dist/types/utils/type.d.ts +0 -6
  85. package/dist/types/utils/validate.d.ts +0 -31
  86. package/dist/types/utils/zh_CN.d.ts +0 -43
  87. /package/{dist/types → types}/index.type.d.ts +0 -0
@@ -1,780 +0,0 @@
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 TinyButton = require("@opentiny/vue-button");
9
- const TinyTooltip = require("@opentiny/vue-tooltip");
10
- const TinyDatePicker = require("@opentiny/vue-date-picker");
11
- const TinyForm = require("@opentiny/vue-form");
12
- const TinyFormItem = require("@opentiny/vue-form-item");
13
- const TinyPopover = require("@opentiny/vue-popover");
14
- const TinySelect = require("@opentiny/vue-select");
15
- const TinyOption = require("@opentiny/vue-option");
16
- const vueIcon = require("@opentiny/vue-icon");
17
- const date = require("./utils/date.cjs.js");
18
- const index = require("./index.cjs.js");
19
- const useTag = require("./composables/use-tag.cjs.js");
20
- const useDropdown = require("./composables/use-dropdown.cjs.js");
21
- const useMatch = require("./composables/use-match.cjs.js");
22
- const useCheckbox = require("./composables/use-checkbox.cjs.js");
23
- const useDatepicker = require("./composables/use-datepicker.cjs.js");
24
- const useNumRange = require("./composables/use-num-range.cjs.js");
25
- const useEdit = require("./composables/use-edit.cjs.js");
26
- const useCustom = require("./composables/use-custom.cjs.js");
27
- const useInit = require("./composables/use-init.cjs.js");
28
- const usePlaceholder = require("./composables/use-placeholder.cjs.js");
29
- const dropdown = require("./utils/dropdown.cjs.js");
30
- require("./components/first-level-panel.vue.cjs.js");
31
- require("./components/second-level-panel.vue.cjs.js");
32
- ;/* empty css */
33
- const clone = require("./utils/clone.cjs.js");
34
- const tag = require("./utils/tag.cjs.js");
35
- const firstLevelPanel_vue_vue_type_script_setup_true_lang = require("./components/first-level-panel.vue.cjs2.js");
36
- const secondLevelPanel_vue_vue_type_script_setup_true_lang = require("./components/second-level-panel.vue.cjs2.js");
37
- const _hoisted_1 = { class: "tvp-search-box__tag-value" };
38
- const _hoisted_2 = {
39
- key: 0,
40
- class: "tvp-search-box__placeholder"
41
- };
42
- const _hoisted_3 = { class: "tvp-search-box__input-wrapper" };
43
- const _hoisted_4 = { class: "tvp-search-box__prop" };
44
- const _hoisted_5 = { class: "tvp-search-box__input-separator" };
45
- const _hoisted_6 = { class: "tvp-search-box__date-wrap" };
46
- const _hoisted_7 = { class: "tvp-search-box__dropdown-start" };
47
- const _hoisted_8 = {
48
- key: 0,
49
- class: "tvp-search-box__dropdown-end"
50
- };
51
- const _hoisted_9 = {
52
- key: 2,
53
- class: "tvp-search-box__dropdown-end"
54
- };
55
- const _hoisted_10 = {
56
- key: 4,
57
- class: "tvp-search-box__number"
58
- };
59
- const _hoisted_11 = { class: "tvp-search-box__dropdown-start" };
60
- const _hoisted_12 = { class: "tvp-search-box__dropdown-end" };
61
- const _hoisted_13 = {
62
- key: 5,
63
- class: "tvp-search-box__date-wrap"
64
- };
65
- const _hoisted_14 = { class: "tvp-search-box__dropdown-title" };
66
- const _hoisted_15 = { class: "tvp-search-box__dropdown-start" };
67
- const _hoisted_16 = { class: "tvp-search-box__dropdown-end" };
68
- const _hoisted_17 = {
69
- key: 6,
70
- class: "tvp-search-box__date-wrap"
71
- };
72
- const _hoisted_18 = { class: "tvp-search-box__dropdown-title" };
73
- const _hoisted_19 = { class: "tvp-search-box__dropdown-start" };
74
- const _hoisted_20 = { class: "tvp-search-box__dropdown-end" };
75
- const _hoisted_21 = { class: "tvp-search-box__bottom-btn" };
76
- const _hoisted_22 = {
77
- key: 1,
78
- class: "tvp-search-box__panel-box"
79
- };
80
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
81
- ...{
82
- name: "TinySearchBox"
83
- },
84
- __name: "index",
85
- props: {
86
- modelValue: {
87
- type: Array,
88
- default() {
89
- return [];
90
- }
91
- },
92
- items: {
93
- type: Array,
94
- default: () => []
95
- },
96
- emptyPlaceholder: {
97
- type: String,
98
- default: ""
99
- },
100
- potentialOptions: {
101
- type: Object,
102
- default() {
103
- return null;
104
- }
105
- },
106
- // 是否显示帮助图标,新规范默认显示
107
- showHelp: {
108
- type: Boolean,
109
- default: true
110
- },
111
- // 标签标识键
112
- idMapKey: {
113
- type: String,
114
- default: "id"
115
- },
116
- // 自定义默认搜索项
117
- defaultField: {
118
- type: String,
119
- default: ""
120
- },
121
- editable: {
122
- type: Boolean,
123
- default: false
124
- },
125
- maxlength: {
126
- type: Number
127
- },
128
- // 3.18.0新增
129
- panelMaxHeight: {
130
- type: String,
131
- default: "999px"
132
- },
133
- // 3.18.0新增
134
- splitInputValue: {
135
- type: String,
136
- default: ","
137
- },
138
- // 尺寸
139
- size: {
140
- type: String,
141
- default: ""
142
- }
143
- },
144
- emits: ["update:modelValue", "change", "search", "exceed", "first-level-select", "clear"],
145
- setup(__props, { expose: __expose, emit: __emit }) {
146
- const props = __props;
147
- const emits = __emit;
148
- const state = vue.reactive({
149
- innerModelValue: [...props.modelValue],
150
- recordItems: [],
151
- groupItems: {},
152
- inputValue: "",
153
- matchItems: {},
154
- propItem: {},
155
- backupList: [],
156
- filterList: [],
157
- checkboxGroup: [],
158
- prevItem: {},
159
- backupPrevItem: "",
160
- formRules: null,
161
- validType: "text",
162
- numberShowMessage: true,
163
- startDate: null,
164
- startDateTime: null,
165
- endDate: null,
166
- endDateTime: null,
167
- isShowTagKey: true,
168
- potentialOptions: null,
169
- dateRangeFormat: "yyyy/MM/dd",
170
- datetimeRangeFormat: "yyyy/MM/dd HH:mm:ss",
171
- indexMap: /* @__PURE__ */ new Map(),
172
- valueMap: /* @__PURE__ */ new Map(),
173
- popoverVisible: false,
174
- selectValue: "",
175
- allTypeAttri: { label: index.t("tvp.tvpSearchbox.rulekeyword1"), field: "tvpKeyword", type: "radio" },
176
- operatorValue: ":",
177
- // 当前操作符值
178
- inputEditValue: "",
179
- currentOperators: "",
180
- currentEditValue: "",
181
- currentModelValueIndex: -1,
182
- // 当前编辑的标签索引
183
- curMinNumVar: "",
184
- // numRange最小值变量
185
- curMaxNumVar: "",
186
- // numRange最大值变量
187
- instance: vue.getCurrentInstance(),
188
- isMouseDown: false,
189
- currentEditSelectTags: [],
190
- // 当前编辑多选的标签值
191
- visible: false,
192
- visibleTimer: null,
193
- hasBackupList: vue.computed(
194
- () => state.propItem.label && [void 0, "radio", "checkbox", "map"].includes(state.prevItem.type)
195
- ),
196
- isIndeterminate: vue.computed(
197
- () => state.checkboxGroup.length > 0 && state.checkboxGroup.length !== state.filterList.length
198
- ),
199
- checkAll: vue.computed({
200
- get: () => state.checkboxGroup.length && state.checkboxGroup.length === state.filterList.length,
201
- set: (val) => {
202
- if (val) {
203
- state.checkboxGroup = state.filterList.flatMap((item) => `${state.prevItem.label}${item.label}`);
204
- } else {
205
- state.checkboxGroup = [];
206
- }
207
- }
208
- })
209
- });
210
- const TinyIconSearch = vueIcon.iconSearch();
211
- const TinyIconClose = vueIcon.iconClose();
212
- const TinyIconHelpQuery = vueIcon.iconHelpQuery();
213
- const { selectPropItem, selectRadioItem, selectInputValue, createTag, helpClick, setOperator } = useDropdown.useDropdown({
214
- props,
215
- emits,
216
- state,
217
- t: index.t,
218
- format: date.format
219
- });
220
- const { deleteTag, clearTag, backspaceDeleteTag } = useTag.useTag({
221
- props,
222
- state,
223
- emits
224
- });
225
- const { editTag, confirmEditTag, selectPropChange, selectItemIsDisable } = useEdit.useEdit({
226
- props,
227
- state,
228
- t: index.t,
229
- nextTick: vue.nextTick,
230
- format: date.format,
231
- emits
232
- });
233
- const { handleInput, selectFirstMap } = useMatch.useMatch({
234
- props,
235
- state,
236
- emits
237
- });
238
- const { placeholder, setPlaceholder } = usePlaceholder.usePlaceholder({ props, state, t: index.t });
239
- const { selectCheckbox, isShowClose } = useCheckbox.useCheckbox({
240
- props,
241
- state,
242
- emits
243
- });
244
- const { onConfirmDate, handleDateShow, pickerOptions } = useDatepicker.useDatePicker({
245
- props,
246
- state,
247
- emits
248
- });
249
- const { sizeChange, initFormRule } = useNumRange.useNumRange({
250
- props,
251
- state,
252
- t: index.t,
253
- emits
254
- });
255
- const { handleConfirm, handleEditConfirm } = useCustom.useCustom({ state, emits });
256
- const { initItems, watchOutsideClick, watchMouseDown, watchMouseMove, handleClick } = useInit.useInit({
257
- props,
258
- state
259
- });
260
- vue.watch(
261
- () => props.items,
262
- (newVal) => {
263
- state.recordItems = clone.deepClone(newVal);
264
- initItems();
265
- initFormRule();
266
- },
267
- {
268
- deep: true,
269
- immediate: true
270
- }
271
- );
272
- vue.watch(
273
- () => state.popoverVisible,
274
- (newVal) => {
275
- if (!newVal && !state.inputEditValue.length) {
276
- state.inputEditValue = state.currentEditSelectTags;
277
- }
278
- },
279
- {
280
- immediate: true
281
- }
282
- );
283
- vue.watch(
284
- () => props.modelValue,
285
- (newVal) => {
286
- if (newVal) {
287
- state.indexMap.clear();
288
- state.valueMap.clear();
289
- newVal.forEach((item, index2) => {
290
- var _a;
291
- const value = `${item.label}${item.value}`;
292
- state.indexMap.set(item.label, index2);
293
- state.valueMap.set(value, index2);
294
- if (((_a = item.options) == null ? void 0 : _a.length) > 0) {
295
- item.options.forEach((option) => {
296
- const optionValue = `${item.label}${option.label}`;
297
- state.valueMap.set(optionValue, index2);
298
- });
299
- }
300
- });
301
- dropdown.showPopover(state, false);
302
- if (newVal.length === 0) {
303
- setPlaceholder(props.emptyPlaceholder);
304
- }
305
- if (props.editable && !state.inputEditValue.length && newVal[0]) {
306
- state.inputEditValue = newVal[0].value;
307
- }
308
- }
309
- state.innerModelValue = [...newVal];
310
- },
311
- {
312
- deep: true,
313
- immediate: true
314
- }
315
- );
316
- vue.onMounted(() => {
317
- if (typeof document !== "undefined") {
318
- document.addEventListener("click", watchOutsideClick);
319
- document.addEventListener("mousedown", watchMouseDown);
320
- document.addEventListener("mousemove", watchMouseMove);
321
- }
322
- });
323
- vue.onBeforeUnmount(() => {
324
- if (typeof document !== "undefined") {
325
- document.removeEventListener("click", watchOutsideClick);
326
- document.removeEventListener("mousedown", watchMouseDown);
327
- document.removeEventListener("mousemove", watchMouseMove);
328
- }
329
- });
330
- const eventsMap = {
331
- selectInputValue,
332
- selectPropItem,
333
- selectRadioItem,
334
- setOperator,
335
- selectCheckbox,
336
- sizeChange,
337
- onConfirmDate,
338
- selectFirstMap,
339
- handleDateShow
340
- };
341
- const handleEvents = (eventName, p1, p2) => {
342
- eventsMap[eventName](p1, p2);
343
- };
344
- __expose({
345
- state,
346
- handleEvents
347
- });
348
- return (_ctx, _cache) => {
349
- return vue.openBlock(), vue.createElementBlock("div", {
350
- class: vue.normalizeClass(["tvp-search-box", __props.size === "small" ? "tvp-search-box--small" : ""]),
351
- onClick: _cache[21] || (_cache[21] = vue.withModifiers(($event) => vue.unref(dropdown.showPopover)(state, false), ["stop"]))
352
- }, [
353
- vue.createVNode(vue.unref(TinyIconSearch), { class: "tvp-search-box__prefix" }),
354
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.modelValue, (tag2, index2) => {
355
- return vue.openBlock(), vue.createBlock(vue.unref(TinyTag), {
356
- key: tag2.field + index2,
357
- closable: "",
358
- size: __props.size === "small" ? "small" : "",
359
- class: vue.normalizeClass(["tvp-search-box__tag", __props.editable && tag2.type !== "map" ? "tvp-search-box__tag-editor" : ""]),
360
- title: `${tag2.label} ${tag2.operator || ":"} ${tag2.value}`,
361
- onClose: ($event) => vue.unref(deleteTag)(tag2),
362
- onClick: vue.withModifiers(($event) => vue.unref(editTag)(tag2, index2, $event), ["stop"])
363
- }, {
364
- default: vue.withCtx(() => [
365
- vue.createElementVNode("span", _hoisted_1, vue.toDisplayString(tag2.label) + " " + vue.toDisplayString(tag2.operator || ":") + " " + vue.toDisplayString(tag2.value), 1)
366
- ]),
367
- _: 2
368
- }, 1032, ["size", "class", "title", "onClose", "onClick"]);
369
- }), 128)),
370
- __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2)) : vue.createCommentVNode("", true),
371
- vue.createVNode(vue.unref(TinyForm), {
372
- ref: "formRef",
373
- model: state,
374
- rules: state.formRules,
375
- "validate-type": state.validType,
376
- size: __props.size === "small" ? "small" : "",
377
- "label-width": "0px",
378
- "message-type": "block",
379
- class: "tvp-search-box__form"
380
- }, {
381
- default: vue.withCtx(() => [
382
- vue.createElementVNode("div", _hoisted_3, [
383
- vue.createElementVNode("section", _hoisted_4, [
384
- vue.withDirectives(vue.createElementVNode("span", null, vue.toDisplayString(state.propItem.label) + " " + vue.toDisplayString(`${state.operatorValue ? state.operatorValue : ""} `), 513), [
385
- [vue.vShow, state.propItem.label]
386
- ]),
387
- vue.withDirectives(vue.createElementVNode("span", null, vue.toDisplayString(state.propItem.value), 513), [
388
- [vue.vShow, state.propItem.value]
389
- ])
390
- ]),
391
- vue.createVNode(vue.unref(TinyDropdown), {
392
- ref: "dropdownRef",
393
- visible: state.visible,
394
- "onUpdate:visible": _cache[5] || (_cache[5] = ($event) => state.visible = $event),
395
- trigger: "click",
396
- class: "tvp-search-box__dropdown",
397
- "show-icon": false,
398
- size: __props.size === "small" ? "small" : "",
399
- "lazy-show-popper": "",
400
- "close-on-click-outside": true
401
- }, {
402
- dropdown: vue.withCtx(() => [
403
- vue.createVNode(vue.unref(TinyDropdownMenu), {
404
- placement: "bottom-start",
405
- "popper-class": "tvp-search-box__dropdown-menu",
406
- style: vue.normalizeStyle({ "max-height": __props.panelMaxHeight }),
407
- onMouseup: vue.withModifiers(() => {
408
- }, ["stop"])
409
- }, {
410
- default: vue.withCtx(() => {
411
- var _a, _b;
412
- return [
413
- vue.withDirectives(vue.createElementVNode("div", null, [
414
- ((_a = state.instance) == null ? void 0 : _a.slots["first-panel"]) ? vue.renderSlot(_ctx.$slots, "first-panel", vue.mergeProps({ key: 0 }, {
415
- state,
416
- handleEvents
417
- }, {
418
- onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
419
- }, ["stop"]))
420
- })) : (vue.openBlock(), vue.createBlock(firstLevelPanel_vue_vue_type_script_setup_true_lang.default, {
421
- key: 1,
422
- state,
423
- onEvents: handleEvents
424
- }, null, 8, ["state"]))
425
- ], 512), [
426
- [vue.vShow, !state.propItem.label || state.inputValue.trim()]
427
- ]),
428
- vue.withDirectives(vue.createElementVNode("div", null, [
429
- ((_b = state.instance) == null ? void 0 : _b.slots["second-panel"]) ? vue.renderSlot(_ctx.$slots, "second-panel", vue.mergeProps({ key: 0 }, {
430
- state,
431
- pickerOptions: vue.unref(pickerOptions),
432
- handleEvents,
433
- back: () => vue.unref(tag.resetInput)(state)
434
- }, {
435
- onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => {
436
- }, ["stop"]))
437
- })) : state.prevItem.type !== "custom" ? (vue.openBlock(), vue.createBlock(secondLevelPanel_vue_vue_type_script_setup_true_lang.default, {
438
- key: 1,
439
- state,
440
- "picker-options": vue.unref(pickerOptions),
441
- onEvents: handleEvents
442
- }, null, 8, ["state", "picker-options"])) : (vue.openBlock(), vue.createElementBlock("div", {
443
- key: 2,
444
- class: "tvp-search-box__panel-box",
445
- onClick: _cache[4] || (_cache[4] = ($event) => vue.unref(dropdown.showDropdown)(state))
446
- }, [
447
- vue.renderSlot(_ctx.$slots, state.prevItem.slotName, vue.mergeProps({
448
- showDropdown: () => vue.unref(dropdown.showDropdown)(state),
449
- onConfirm: vue.unref(handleConfirm)
450
- }, {
451
- onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
452
- }, ["stop"]))
453
- }))
454
- ]))
455
- ], 512), [
456
- [vue.vShow, state.propItem.label]
457
- ])
458
- ];
459
- }),
460
- _: 3
461
- }, 8, ["style"])
462
- ]),
463
- default: vue.withCtx(() => [
464
- vue.createVNode(vue.unref(TinyInput), {
465
- ref: "inputRef",
466
- modelValue: state.inputValue,
467
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.inputValue = $event),
468
- class: "tvp-search-box__input",
469
- placeholder: vue.unref(placeholder),
470
- maxlength: __props.maxlength && __props.maxlength + 1,
471
- onKeydown: [
472
- vue.withKeys(vue.withModifiers(vue.unref(backspaceDeleteTag), ["stop"]), ["delete"]),
473
- vue.withKeys(vue.withModifiers(vue.unref(createTag), ["stop"]), ["enter"])
474
- ],
475
- onInput: vue.unref(handleInput),
476
- onClick: vue.unref(handleClick)
477
- }, {
478
- suffix: vue.withCtx(() => [
479
- vue.withDirectives(vue.createVNode(vue.unref(TinyIconClose), {
480
- class: "tvp-search-box__input-close",
481
- onClick: vue.withModifiers(vue.unref(clearTag), ["stop"])
482
- }, null, 8, ["onClick"]), [
483
- [vue.vShow, vue.unref(isShowClose)]
484
- ]),
485
- vue.withDirectives(vue.createElementVNode("span", _hoisted_5, null, 512), [
486
- [vue.vShow, vue.unref(isShowClose)]
487
- ]),
488
- __props.showHelp ? (vue.openBlock(), vue.createBlock(vue.unref(TinyTooltip), {
489
- key: 0,
490
- effect: "light",
491
- content: vue.unref(index.t)("tvp.tvpSearchbox.help"),
492
- placement: "top"
493
- }, {
494
- default: vue.withCtx(() => [
495
- vue.createVNode(vue.unref(TinyIconHelpQuery), {
496
- class: "tvp-search-box__input-help",
497
- onClick: vue.withModifiers(vue.unref(helpClick), ["stop"])
498
- }, null, 8, ["onClick"])
499
- ]),
500
- _: 1
501
- }, 8, ["content"])) : vue.createCommentVNode("", true),
502
- vue.createVNode(vue.unref(TinyIconSearch), {
503
- class: "tvp-search-box__input-search",
504
- onClick: vue.withModifiers(vue.unref(createTag), ["stop"])
505
- }, null, 8, ["onClick"])
506
- ]),
507
- _: 1
508
- }, 8, ["modelValue", "placeholder", "maxlength", "onKeydown", "onInput", "onClick"])
509
- ]),
510
- _: 3
511
- }, 8, ["visible", "size"])
512
- ]),
513
- __props.editable ? (vue.openBlock(), vue.createBlock(vue.unref(TinyPopover), {
514
- key: 0,
515
- ref: "popoverRef",
516
- modelValue: state.popoverVisible,
517
- "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => state.popoverVisible = $event),
518
- placement: "bottom-start",
519
- "visible-arrow": false,
520
- trigger: "manual",
521
- "popper-class": "tvp-search-box__popover",
522
- class: "tvp-search-box__form-popover"
523
- }, {
524
- default: vue.withCtx(() => [
525
- state.prevItem.type !== "custom" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
526
- vue.createElementVNode("div", _hoisted_6, [
527
- vue.createElementVNode("div", _hoisted_7, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.attributeType")), 1),
528
- vue.createVNode(vue.unref(TinyFormItem), { class: "tvp-search-box__number-item" }, {
529
- default: vue.withCtx(() => [
530
- vue.createVNode(vue.unref(TinySelect), {
531
- modelValue: state.selectValue,
532
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => state.selectValue = $event),
533
- searchable: "",
534
- disabled: state.prevItem.editAttrDisabled
535
- }, {
536
- default: vue.withCtx(() => [
537
- (vue.openBlock(), vue.createBlock(vue.unref(TinyOption), {
538
- key: state.allTypeAttri.label,
539
- label: vue.unref(index.t)("tvp.tvpSearchbox.allProperty"),
540
- value: state.allTypeAttri.label,
541
- disabled: vue.unref(selectItemIsDisable)(state.allTypeAttri),
542
- onClick: _cache[6] || (_cache[6] = ($event) => vue.unref(selectPropChange)(state.allTypeAttri, vue.unref(selectItemIsDisable)(state.allTypeAttri)))
543
- }, null, 8, ["label", "value", "disabled"])),
544
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(state.recordItems, (item) => {
545
- return vue.openBlock(), vue.createBlock(vue.unref(TinyOption), {
546
- key: item.label,
547
- label: item.label,
548
- value: item.label,
549
- disabled: vue.unref(selectItemIsDisable)(item),
550
- onClick: ($event) => vue.unref(selectPropChange)(item, vue.unref(selectItemIsDisable)(item))
551
- }, null, 8, ["label", "value", "disabled", "onClick"]);
552
- }), 128))
553
- ]),
554
- _: 1
555
- }, 8, ["modelValue", "disabled"])
556
- ]),
557
- _: 1
558
- }),
559
- state.prevItem.operators ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.operator")), 1)) : vue.createCommentVNode("", true),
560
- state.prevItem.operators ? (vue.openBlock(), vue.createBlock(vue.unref(TinyFormItem), {
561
- key: 1,
562
- class: "tvp-search-box__number-item"
563
- }, {
564
- default: vue.withCtx(() => [
565
- vue.createVNode(vue.unref(TinySelect), {
566
- modelValue: state.operatorValue,
567
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => state.operatorValue = $event)
568
- }, {
569
- default: vue.withCtx(() => [
570
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(state.currentOperators, (item) => {
571
- return vue.openBlock(), vue.createBlock(vue.unref(TinyOption), {
572
- key: item,
573
- label: item,
574
- value: item
575
- }, null, 8, ["label", "value"]);
576
- }), 128))
577
- ]),
578
- _: 1
579
- }, 8, ["modelValue"])
580
- ]),
581
- _: 1
582
- })) : vue.createCommentVNode("", true),
583
- state.prevItem.type !== "numRange" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.tagValue")), 1)) : vue.createCommentVNode("", true),
584
- !["numRange", "dateRange", "datetimeRange", "custom"].includes(state.prevItem.type) ? (vue.openBlock(), vue.createBlock(vue.unref(TinyFormItem), {
585
- key: 3,
586
- prop: "inputEditValue",
587
- class: "tvp-search-box__number-item"
588
- }, {
589
- default: vue.withCtx(() => {
590
- var _a, _b;
591
- return [
592
- ((_a = state.currentEditValue) == null ? void 0 : _a.length) > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(TinySelect), {
593
- key: 0,
594
- modelValue: state.inputEditValue,
595
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => state.inputEditValue = $event),
596
- class: "tvp-search-box-select",
597
- multiple: Boolean(state.prevItem.mergeTag),
598
- "allow-create": (_b = state.prevItem) == null ? void 0 : _b.allowCreate,
599
- filterable: "",
600
- "default-first-option": "",
601
- clearable: ""
602
- }, {
603
- default: vue.withCtx(() => [
604
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(state.currentEditValue, (item) => {
605
- return vue.openBlock(), vue.createBlock(vue.unref(TinyOption), {
606
- key: item.label,
607
- label: item.label,
608
- value: item.label
609
- }, null, 8, ["label", "value"]);
610
- }), 128))
611
- ]),
612
- _: 1
613
- }, 8, ["modelValue", "multiple", "allow-create"])) : (vue.openBlock(), vue.createBlock(vue.unref(TinyInput), {
614
- key: 1,
615
- modelValue: state.inputEditValue,
616
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => state.inputEditValue = $event),
617
- clearable: ""
618
- }, null, 8, ["modelValue"]))
619
- ];
620
- }),
621
- _: 1
622
- })) : vue.createCommentVNode("", true),
623
- state.prevItem.type === "numRange" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
624
- vue.createElementVNode("div", _hoisted_11, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.minValueText")) + "(" + vue.toDisplayString(state.prevItem.unit) + ") ", 1),
625
- vue.createVNode(vue.unref(TinyFormItem), {
626
- prop: state.curMinNumVar,
627
- class: "tvp-search-box__number-item",
628
- "show-message": state.numberShowMessage
629
- }, {
630
- default: vue.withCtx(() => [
631
- vue.createVNode(vue.unref(TinyInput), {
632
- modelValue: state[state.curMinNumVar],
633
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => state[state.curMinNumVar] = $event),
634
- type: "number",
635
- class: "tvp-search-box__number-input"
636
- }, null, 8, ["modelValue"])
637
- ]),
638
- _: 1
639
- }, 8, ["prop", "show-message"]),
640
- vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.maxValueText")) + "(" + vue.toDisplayString(state.prevItem.unit) + ") ", 1),
641
- vue.createVNode(vue.unref(TinyFormItem), {
642
- prop: state.curMaxNumVar,
643
- class: "tvp-search-box__number-item"
644
- }, {
645
- default: vue.withCtx(() => [
646
- vue.createVNode(vue.unref(TinyInput), {
647
- modelValue: state[state.curMaxNumVar],
648
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => state[state.curMaxNumVar] = $event),
649
- type: "number",
650
- class: "tvp-search-box__number-input"
651
- }, null, 8, ["modelValue"])
652
- ]),
653
- _: 1
654
- }, 8, ["prop"])
655
- ])) : vue.createCommentVNode("", true),
656
- state.prevItem.type === "dateRange" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
657
- vue.createElementVNode("div", _hoisted_14, vue.toDisplayString(state.prevItem.maxTimeLength > 0 ? vue.unref(index.t)("tvp.tvpSearchbox.timeLengthTitle", {
658
- value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
659
- }) : vue.unref(index.t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
660
- vue.createElementVNode("div", _hoisted_15, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
661
- vue.createVNode(vue.unref(TinyFormItem), {
662
- prop: "startDate",
663
- "show-message": Boolean(state.prevItem.maxTimeLength),
664
- class: "tvp-search-box__date-item"
665
- }, {
666
- default: vue.withCtx(() => [
667
- vue.createVNode(vue.unref(TinyDatePicker), {
668
- modelValue: state.startDate,
669
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => state.startDate = $event),
670
- format: state.prevItem.format || state.dateRangeFormat,
671
- "value-format": state.prevItem.format || state.dateRangeFormat,
672
- "picker-options": vue.unref(pickerOptions)(state.startDate, "endDate"),
673
- class: "tvp-search-box__date-picker"
674
- }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
675
- ]),
676
- _: 1
677
- }, 8, ["show-message"]),
678
- vue.createElementVNode("div", _hoisted_16, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
679
- vue.createVNode(vue.unref(TinyFormItem), {
680
- prop: "endDate",
681
- class: "tvp-search-box__date-item"
682
- }, {
683
- default: vue.withCtx(() => [
684
- vue.createVNode(vue.unref(TinyDatePicker), {
685
- modelValue: state.endDate,
686
- "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => state.endDate = $event),
687
- format: state.prevItem.format || state.dateRangeFormat,
688
- "value-format": state.prevItem.format || state.dateRangeFormat,
689
- "picker-options": vue.unref(pickerOptions)(state.startDate),
690
- class: "tvp-search-box__date-picker"
691
- }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
692
- ]),
693
- _: 1
694
- })
695
- ])) : vue.createCommentVNode("", true),
696
- state.prevItem.type === "datetimeRange" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
697
- vue.createElementVNode("div", _hoisted_18, vue.toDisplayString(state.prevItem.maxTimeLength > 0 ? vue.unref(index.t)("tvp.tvpSearchbox.timeLengthTitle", {
698
- value: (state.prevItem.maxTimeLength / 864e5).toFixed(1)
699
- }) : vue.unref(index.t)("tvp.tvpSearchbox.rangeDateTitle")), 1),
700
- vue.createElementVNode("div", _hoisted_19, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.rangeBeginLabel")), 1),
701
- vue.createVNode(vue.unref(TinyFormItem), {
702
- prop: "startDateTime",
703
- "show-message": Boolean(state.prevItem.maxTimeLength),
704
- class: "tvp-search-box__date-item"
705
- }, {
706
- default: vue.withCtx(() => [
707
- vue.createVNode(vue.unref(TinyDatePicker), {
708
- modelValue: state.startDateTime,
709
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => state.startDateTime = $event),
710
- type: "datetime",
711
- isutc8: true,
712
- format: state.prevItem.format || state.datetimeRangeFormat,
713
- "value-format": state.prevItem.format || state.datetimeRangeFormat,
714
- "picker-options": vue.unref(pickerOptions)(state.startDateTime, "endDateTime"),
715
- class: "tvp-search-box__date-picker"
716
- }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
717
- ]),
718
- _: 1
719
- }, 8, ["show-message"]),
720
- vue.createElementVNode("div", _hoisted_20, vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.rangeEndLabel")), 1),
721
- vue.createVNode(vue.unref(TinyFormItem), {
722
- prop: "endDateTime",
723
- class: "tvp-search-box__date-item"
724
- }, {
725
- default: vue.withCtx(() => [
726
- vue.createVNode(vue.unref(TinyDatePicker), {
727
- modelValue: state.endDateTime,
728
- "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => state.endDateTime = $event),
729
- type: "datetime",
730
- isutc8: true,
731
- format: state.prevItem.format || state.datetimeRangeFormat,
732
- "value-format": state.prevItem.format || state.datetimeRangeFormat,
733
- "picker-options": vue.unref(pickerOptions)(state.startDateTime),
734
- class: "tvp-search-box__date-picker"
735
- }, null, 8, ["modelValue", "format", "value-format", "picker-options"])
736
- ]),
737
- _: 1
738
- })
739
- ])) : vue.createCommentVNode("", true)
740
- ]),
741
- vue.createElementVNode("div", _hoisted_21, [
742
- vue.createVNode(vue.unref(TinyButton), {
743
- size: "mini",
744
- onClick: _cache[17] || (_cache[17] = ($event) => vue.unref(confirmEditTag)(false))
745
- }, {
746
- default: vue.withCtx(() => [
747
- vue.createTextVNode(vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.cancel")), 1)
748
- ]),
749
- _: 1
750
- }),
751
- vue.createVNode(vue.unref(TinyButton), {
752
- size: "mini",
753
- onClick: _cache[18] || (_cache[18] = ($event) => vue.unref(confirmEditTag)(true))
754
- }, {
755
- default: vue.withCtx(() => [
756
- vue.createTextVNode(vue.toDisplayString(vue.unref(index.t)("tvp.tvpSearchbox.confirm")), 1)
757
- ]),
758
- _: 1
759
- })
760
- ])
761
- ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, [
762
- vue.renderSlot(_ctx.$slots, `${state.prevItem.slotName}-edit`, vue.mergeProps({
763
- showDropdown: () => vue.unref(dropdown.showPopover)(state),
764
- onConfirm: vue.unref(handleEditConfirm)
765
- }, {
766
- onClick: _cache[19] || (_cache[19] = vue.withModifiers(() => {
767
- }, ["stop"]))
768
- }))
769
- ]))
770
- ]),
771
- _: 3
772
- }, 8, ["modelValue"])) : vue.createCommentVNode("", true)
773
- ]),
774
- _: 3
775
- }, 8, ["model", "rules", "validate-type", "size"])
776
- ], 2);
777
- };
778
- }
779
- });
780
- exports.default = _sfc_main;