@opentiny/vue-search-box 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +111 -0
  2. package/es/composables/use-checkbox.es.js +87 -0
  3. package/es/composables/use-custom.es.js +48 -0
  4. package/es/composables/use-datepicker.es.js +86 -0
  5. package/es/composables/use-dropdown.es.js +207 -0
  6. package/es/composables/use-edit.es.js +106 -0
  7. package/es/composables/use-init.es.js +64 -0
  8. package/es/composables/use-match.es.js +170 -0
  9. package/es/composables/use-num-range.es.js +77 -0
  10. package/es/composables/use-placeholder.es.js +41 -0
  11. package/es/composables/use-tag.es.js +51 -0
  12. package/es/index-DCPOFFNd.css +337 -0
  13. package/es/index.es.js +10 -0
  14. package/es/index.type.es.js +1 -0
  15. package/es/index.vue.es.js +4 -0
  16. package/es/index.vue.es2.js +1287 -0
  17. package/es/smb-theme.es.js +18 -0
  18. package/es/utils/clone.es.js +29 -0
  19. package/es/utils/date.es.js +431 -0
  20. package/es/utils/dropdown.es.js +20 -0
  21. package/es/utils/en_US.es.js +44 -0
  22. package/es/utils/index.es.js +13 -0
  23. package/es/utils/tag.es.js +46 -0
  24. package/es/utils/type.es.js +4 -0
  25. package/es/utils/validate.es.js +179 -0
  26. package/es/utils/zh_CN.es.js +44 -0
  27. package/index.css +337 -0
  28. package/lib/composables/use-checkbox.cjs.js +87 -0
  29. package/lib/composables/use-custom.cjs.js +48 -0
  30. package/lib/composables/use-datepicker.cjs.js +86 -0
  31. package/lib/composables/use-dropdown.cjs.js +207 -0
  32. package/lib/composables/use-edit.cjs.js +106 -0
  33. package/lib/composables/use-init.cjs.js +64 -0
  34. package/lib/composables/use-match.cjs.js +170 -0
  35. package/lib/composables/use-num-range.cjs.js +77 -0
  36. package/lib/composables/use-placeholder.cjs.js +41 -0
  37. package/lib/composables/use-tag.cjs.js +51 -0
  38. package/lib/index-DCPOFFNd.css +337 -0
  39. package/lib/index.cjs.js +10 -0
  40. package/lib/index.type.cjs.js +1 -0
  41. package/lib/index.vue.cjs.js +4 -0
  42. package/lib/index.vue.cjs2.js +1287 -0
  43. package/lib/smb-theme.cjs.js +18 -0
  44. package/lib/utils/clone.cjs.js +29 -0
  45. package/lib/utils/date.cjs.js +431 -0
  46. package/lib/utils/dropdown.cjs.js +20 -0
  47. package/lib/utils/en_US.cjs.js +44 -0
  48. package/lib/utils/index.cjs.js +13 -0
  49. package/lib/utils/tag.cjs.js +46 -0
  50. package/lib/utils/type.cjs.js +4 -0
  51. package/lib/utils/validate.cjs.js +179 -0
  52. package/lib/utils/zh_CN.cjs.js +44 -0
  53. package/package.json +65 -0
  54. package/types/composables/use-checkbox.d.ts +10 -0
  55. package/types/composables/use-custom.d.ts +7 -0
  56. package/types/composables/use-datepicker.d.ts +11 -0
  57. package/types/composables/use-dropdown.d.ts +13 -0
  58. package/types/composables/use-edit.d.ts +13 -0
  59. package/types/composables/use-init.d.ts +10 -0
  60. package/types/composables/use-match.d.ts +8 -0
  61. package/types/composables/use-num-range.d.ts +9 -0
  62. package/types/composables/use-placeholder.d.ts +8 -0
  63. package/types/composables/use-tag.d.ts +9 -0
  64. package/types/index.type.d.ts +189 -0
  65. package/types/smb-theme.d.ts +15 -0
  66. package/types/utils/clone.d.ts +12 -0
  67. package/types/utils/date.d.ts +234 -0
  68. package/types/utils/dropdown.d.ts +12 -0
  69. package/types/utils/en_US.d.ts +41 -0
  70. package/types/utils/index.d.ts +1 -0
  71. package/types/utils/tag.d.ts +46 -0
  72. package/types/utils/type.d.ts +6 -0
  73. package/types/utils/validate.d.ts +31 -0
  74. package/types/utils/zh_CN.d.ts +41 -0
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const tag = require("./tag.cjs.js");
4
+ const type = require("./type.cjs.js");
5
+ const clone = require("./clone.cjs.js");
6
+ const getVerifyTag = async (instance, state, props) => {
7
+ const { prevItem, inputEditValue } = state;
8
+ const { operators } = prevItem;
9
+ const rest = clone.omitObj(prevItem);
10
+ let newTag = null;
11
+ let isPass = true;
12
+ await instance.refs.formRef.validateField(["inputEditValue"], (errMsg) => {
13
+ if (errMsg) {
14
+ isPass = false;
15
+ }
16
+ });
17
+ if (isPass) {
18
+ let id = null;
19
+ const operator = state.operatorValue && operators ? { operator: state.operatorValue } : null;
20
+ let value = inputEditValue;
21
+ const otherAttr = {};
22
+ if (Array.isArray(inputEditValue)) {
23
+ otherAttr.options = [];
24
+ value = "";
25
+ inputEditValue.forEach((editValue) => {
26
+ const item = state.currentEditValue.find((item2) => item2.label === editValue);
27
+ const label = (item == null ? void 0 : item.label) || editValue;
28
+ value = !value ? label : `${value} | ${label}`;
29
+ if (item) {
30
+ const itemId = tag.getTagId(props, prevItem, item);
31
+ otherAttr.options.push({ label, ...itemId });
32
+ } else {
33
+ otherAttr.options.push({ label });
34
+ }
35
+ });
36
+ } else if (Array.isArray(state.currentEditValue)) {
37
+ const item = state.currentEditValue.find((item2) => item2.label === value);
38
+ id = tag.getTagId(props, prevItem, item);
39
+ }
40
+ newTag = tag.createNewTag({ ...rest, label: state.selectValue, ...operator, value, ...id, ...otherAttr });
41
+ }
42
+ return newTag;
43
+ };
44
+ const getVerifyNumTag = async (instance, state, props) => {
45
+ const { prevItem } = state;
46
+ const minNum = `min${prevItem.field}`;
47
+ const maxNum = `max${prevItem.field}`;
48
+ const start = state[minNum];
49
+ const end = state[maxNum];
50
+ const verifyProps = [minNum, maxNum];
51
+ let isPass = true;
52
+ let newTag = null;
53
+ await instance.refs.formRef.validateField(verifyProps, (errMsg) => {
54
+ if (errMsg) {
55
+ isPass = false;
56
+ }
57
+ });
58
+ if (isPass) {
59
+ const { field, label: prevLabel, unit, type: type2, operators } = prevItem;
60
+ const label = unit ? `${prevLabel}(${unit})` : prevLabel;
61
+ let value = "";
62
+ if (start && end) {
63
+ value = `${start}-${end}`;
64
+ } else {
65
+ value = start ? `≥${start}` : `≤${end}`;
66
+ }
67
+ const id = tag.getTagId(props, prevItem, prevItem);
68
+ const operator = state.operatorValue && operators ? { operator: state.operatorValue } : null;
69
+ newTag = tag.createNewTag({ type: type2, field, label, value, ...id, start, end, ...operator });
70
+ }
71
+ return newTag;
72
+ };
73
+ const getVerifyDateTag = async (instance, state, props, isDateTimeType) => {
74
+ const { prevItem, startDate, endDate, startDateTime, endDateTime } = state;
75
+ let start = null;
76
+ let end = null;
77
+ let isPass = true;
78
+ let newTag = null;
79
+ let verifyProps = null;
80
+ if (isDateTimeType) {
81
+ start = startDateTime;
82
+ end = endDateTime;
83
+ verifyProps = ["startDateTime", "endDateTime"];
84
+ } else {
85
+ start = startDate;
86
+ end = endDate;
87
+ verifyProps = ["startDate", "endDate"];
88
+ }
89
+ await instance.refs.formRef.validateField(verifyProps, (errMsg) => {
90
+ if (errMsg) {
91
+ isPass = false;
92
+ }
93
+ });
94
+ if (isPass) {
95
+ const { field, label, type: type2, operators } = prevItem;
96
+ let value = "";
97
+ if (start && end) {
98
+ if (start > end) {
99
+ return;
100
+ } else if (start === end) {
101
+ value = start;
102
+ } else {
103
+ value = `${start}-${end}`;
104
+ }
105
+ } else {
106
+ value = start ? `≥${start}` : `≤${end}`;
107
+ }
108
+ const id = tag.getTagId(props, prevItem, prevItem);
109
+ const operator = state.operatorValue && operators ? { operator: state.operatorValue } : null;
110
+ newTag = tag.createNewTag({ type: type2, field, label, value, start, end, ...id, ...operator });
111
+ }
112
+ return newTag;
113
+ };
114
+ const setStateNumRange = (state, item, t) => {
115
+ const { prevItem } = state;
116
+ const { field, start, end, min = prevItem.min, max = prevItem.max } = item;
117
+ const nextMinNum = `min${field}`;
118
+ const nextMaxNum = `max${field}`;
119
+ if (state.curMinNumVar !== nextMinNum || state.curMaxNumVar !== nextMaxNum) {
120
+ delete state[state.curMinNumVar];
121
+ delete state[state.curMaxNumVar];
122
+ delete state.formRules[state.curMinNumVar];
123
+ delete state.formRules[state.curMaxNumVar];
124
+ state.curMinNumVar = nextMinNum;
125
+ state.curMaxNumVar = nextMaxNum;
126
+ }
127
+ state[state.curMinNumVar] = start;
128
+ state[state.curMaxNumVar] = end;
129
+ const { curMinNumVar, curMaxNumVar } = state;
130
+ const minIsNumber = type.isNumber(min);
131
+ const maxIsNumber = type.isNumber(max);
132
+ if (minIsNumber || maxIsNumber) {
133
+ state.formRules[curMinNumVar] = {
134
+ validator: (rule, value, cb) => {
135
+ const valueIsNumber = type.isNumber(value);
136
+ if (!valueIsNumber && type.isNumber(state[curMaxNumVar]) || valueIsNumber && (minIsNumber && !maxIsNumber && value >= min || !minIsNumber && maxIsNumber && value <= max || value >= min && value <= max)) {
137
+ cb();
138
+ } else {
139
+ state.numberShowMessage = Boolean(value || state[curMaxNumVar]);
140
+ cb(new Error(t("tvp.tvpSearchbox.rangeMinErr", [min, max])));
141
+ }
142
+ }
143
+ };
144
+ state.formRules[curMaxNumVar] = {
145
+ validator: (rule, value, cb) => {
146
+ const MinValueIsNumber = type.isNumber(state[curMinNumVar]);
147
+ const curMin = MinValueIsNumber && min < state[curMinNumVar] ? Number(state[curMinNumVar]) : min;
148
+ const curMinIsNumber = type.isNumber(curMin);
149
+ const valueIsNumber = type.isNumber(value);
150
+ if (!valueIsNumber && MinValueIsNumber || valueIsNumber && (curMinIsNumber && !maxIsNumber && value >= curMin || !curMinIsNumber && maxIsNumber && value <= max || value >= curMin && value <= max)) {
151
+ cb();
152
+ } else if (!valueIsNumber && !MinValueIsNumber) {
153
+ cb(new Error(t("tvp.tvpSearchbox.rangeNumberTitle")));
154
+ } else {
155
+ cb(new Error(t("tvp.tvpSearchbox.rangeMaxErr")));
156
+ }
157
+ }
158
+ };
159
+ } else {
160
+ state.formRules[curMaxNumVar] = {
161
+ validator: (rule, value, cb) => {
162
+ const curMin = state[curMinNumVar];
163
+ const valueIsNumber = type.isNumber(value);
164
+ const curMinIsNumber = type.isNumber(curMin);
165
+ if (valueIsNumber && !curMinIsNumber || !valueIsNumber && curMinIsNumber || valueIsNumber && curMinIsNumber && value >= Number(curMin)) {
166
+ cb();
167
+ } else if (!valueIsNumber && !curMinIsNumber) {
168
+ cb(new Error(t("tvp.tvpSearchbox.rangeNumberTitle")));
169
+ } else {
170
+ cb(new Error(t("tvp.tvpSearchbox.rangeMaxErr")));
171
+ }
172
+ }
173
+ };
174
+ }
175
+ };
176
+ exports.getVerifyDateTag = getVerifyDateTag;
177
+ exports.getVerifyNumTag = getVerifyNumTag;
178
+ exports.getVerifyTag = getVerifyTag;
179
+ exports.setStateNumRange = setStateNumRange;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const zhCN = {
4
+ tvp: {
5
+ tvpSearchbox: {
6
+ defaultPlaceholder: "请选择属性筛选,或输入关键字",
7
+ addPlaceholder: "添加筛选条件",
8
+ tagPlaceholder: "请选择标签键/值搜索,或输入“键=值”搜索",
9
+ dynamicPlaceholder: "请选择{newValue}搜索",
10
+ attributeType: "属性类型",
11
+ propertyValue: "{0}的值",
12
+ matched: "潜在匹配项",
13
+ allValues: "所有值",
14
+ allProperty: "全部属性",
15
+ operator: "运算符",
16
+ clearAll: "清空",
17
+ emptyValue: "空 值",
18
+ help: "点击查看帮助",
19
+ switchText: "切换到默认搜索项",
20
+ tagKey: "键",
21
+ tagValue: "值",
22
+ minValueText: "最小值",
23
+ maxValueText: "最大值",
24
+ rangeMinArr: "输入值必须在{0}~{1}之间",
25
+ rangeMaxArr: "最大值必须大于等于最小值,或者为空",
26
+ rangeNumberTitle: "请至少输入一个值",
27
+ rangeDateTitle: "请至少输入一个日期",
28
+ timeLengthTitle: "可选时间跨度为{value}天内",
29
+ rangeBeginLabel: "开始日期",
30
+ rangeEndLabel: "结束日期",
31
+ rulekeyword1: "关键字",
32
+ notBeNull: "值不能为空",
33
+ noData: "暂无匹配数据...",
34
+ selectAll: "全选",
35
+ confirm: "确定",
36
+ cancel: "取消",
37
+ equal: "等于",
38
+ notEqual: "不等于",
39
+ contain: "包含",
40
+ notContain: "不包含"
41
+ }
42
+ }
43
+ };
44
+ exports.zhCN = zhCN;
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@opentiny/vue-search-box",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "homepage": "https://github.com/opentiny/tiny-search-box#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/opentiny/tiny-search-box/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/opentiny/tiny-search-box.git"
12
+ },
13
+ "license": "MIT",
14
+ "author": "",
15
+ "type": "module",
16
+ "main": "lib/index.cjs.js",
17
+ "module": "es/index.es.js",
18
+ "types": "types/index.d.ts",
19
+ "style": "src/index.less",
20
+ "keywords": [
21
+ "search",
22
+ "comprehensive search",
23
+ "opentiny"
24
+ ],
25
+ "scripts": {
26
+ "build": "pnpm build:theme && vite build && node scripts/pre-release.cjs",
27
+ "build:theme": "vite build --config vite.config.theme.ts",
28
+ "prepublish": "pnpm run build"
29
+ },
30
+ "peerDependencies": {
31
+ "vue": "^3.0.0"
32
+ },
33
+ "dependencies": {
34
+ "@opentiny/vue-button": "^3.21.0",
35
+ "@opentiny/vue-checkbox": "^3.21.0",
36
+ "@opentiny/vue-checkbox-group": "^3.21.0",
37
+ "@opentiny/vue-date-picker": "^3.21.0",
38
+ "@opentiny/vue-dropdown": "^3.21.0",
39
+ "@opentiny/vue-dropdown-item": "^3.21.0",
40
+ "@opentiny/vue-dropdown-menu": "^3.21.0",
41
+ "@opentiny/vue-form": "^3.21.0",
42
+ "@opentiny/vue-form-item": "^3.21.0",
43
+ "@opentiny/vue-icon": "^3.21.0",
44
+ "@opentiny/vue-input": "^3.21.0",
45
+ "@opentiny/vue-loading": "^3.21.0",
46
+ "@opentiny/vue-locale": "^3.21.0",
47
+ "@opentiny/vue-option": "^3.21.0",
48
+ "@opentiny/vue-popover": "^3.21.0",
49
+ "@opentiny/vue-select": "^3.21.0",
50
+ "@opentiny/vue-tag": "^3.21.0",
51
+ "@opentiny/vue-tooltip": "^3.21.0",
52
+ "vue": "^3.0.0",
53
+ "vue-i18n": "^11.1.2"
54
+ },
55
+ "devDependencies": {
56
+ "@vitejs/plugin-vue": "^4.0.0",
57
+ "commander": "^6.2.0",
58
+ "glob": "^11.0.0",
59
+ "less": "^4.2.2",
60
+ "shelljs": "^0.8.4",
61
+ "typescript": "^5.8.2",
62
+ "vite": "^6.2.2",
63
+ "vite-plugin-dts": "^4.3.0"
64
+ }
65
+ }
@@ -0,0 +1,10 @@
1
+ export declare function useCheckbox({ props, state, emits }: {
2
+ props: any;
3
+ state: any;
4
+ emits: any;
5
+ }): {
6
+ selectCheckbox: (confirm: boolean) => void;
7
+ isIndeterminate: any;
8
+ checkAll: any;
9
+ isShowClose: any;
10
+ };
@@ -0,0 +1,7 @@
1
+ export declare function useCustom({ state, emits }: {
2
+ state: any;
3
+ emits: any;
4
+ }): {
5
+ handleConfirm: (customTag: any) => void;
6
+ handleEditConfirm: (customTag: any) => void;
7
+ };
@@ -0,0 +1,11 @@
1
+ export declare function useDatePicker({ props, state, emits }: {
2
+ props: any;
3
+ state: any;
4
+ emits: any;
5
+ }): {
6
+ onConfirmDate: (confirm: boolean, isDateTimeType?: boolean) => Promise<void>;
7
+ handleDateShow: () => void;
8
+ pickerOptions: (startDate: any, endName?: string) => {
9
+ disabledDate(time: any): boolean;
10
+ };
11
+ };
@@ -0,0 +1,13 @@
1
+ export declare function useDropdown({ props, emits, state, t, format }: {
2
+ props: any;
3
+ emits: any;
4
+ state: any;
5
+ t: any;
6
+ format: any;
7
+ }): {
8
+ selectPropItem: (item: any) => void;
9
+ selectRadioItem: (item: any, isPotential?: boolean) => void;
10
+ createTag: () => void;
11
+ helpClick: () => void;
12
+ setOperator: (operator: any) => void;
13
+ };
@@ -0,0 +1,13 @@
1
+ export declare function useEdit({ props, state, t, nextTick, format, emits }: {
2
+ props: any;
3
+ state: any;
4
+ t: any;
5
+ nextTick: any;
6
+ format: any;
7
+ emits: any;
8
+ }): {
9
+ editTag: (tag: any, index: any, e: any) => void;
10
+ confirmEditTag: (isConfirm: any) => Promise<void>;
11
+ selectPropChange: (item: any, disabled: any) => void;
12
+ selectItemIsDisable: (item: any) => boolean;
13
+ };
@@ -0,0 +1,10 @@
1
+ export declare function useInit({ props, state }: {
2
+ props: any;
3
+ state: any;
4
+ }): {
5
+ initItems: () => void;
6
+ watchOutsideClick: () => void;
7
+ watchMouseDown: () => void;
8
+ watchMouseMove: () => void;
9
+ handleClick: (e: any) => void;
10
+ };
@@ -0,0 +1,8 @@
1
+ export declare function useMatch({ props, state, emits }: {
2
+ props: any;
3
+ state: any;
4
+ emits: any;
5
+ }): {
6
+ handleInput: (this: any, ...args: any) => void;
7
+ selectFirstMap: (item: any, isFirst: any) => void;
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare function useNumRange({ props, state, t, emits }: {
2
+ props: any;
3
+ state: any;
4
+ t: any;
5
+ emits: any;
6
+ }): {
7
+ initFormRule: () => void;
8
+ sizeChange: (confirm: boolean) => Promise<void>;
9
+ };
@@ -0,0 +1,8 @@
1
+ export declare function usePlaceholder({ props, state, t }: {
2
+ props: any;
3
+ state: any;
4
+ t: any;
5
+ }): {
6
+ placeholder: any;
7
+ setPlaceholder: (placeholderValue: string) => void;
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare function useTag({ props, state, emits }: {
2
+ props: any;
3
+ state: any;
4
+ emits: any;
5
+ }): {
6
+ deleteTag: (tag: any) => void;
7
+ clearTag: () => void;
8
+ backspaceDeleteTag: () => void;
9
+ };
@@ -0,0 +1,189 @@
1
+ /**
2
+ * tag类型, radio-默认单选, noValue-非正常tag,tag值为空, checkbox-多选,map-键值tag, numRange-数字范围tag,
3
+ * dateRange-日期范围tag。tag 的分类是根据键值的结果划分
4
+ */
5
+ export type ISearchBoxTagType = 'radio' | 'noValue' | 'checkbox' | 'map' | 'numRange' | 'dateRange' | 'dateTimeRange';
6
+ /**
7
+ * 候选tag数据配置项
8
+ */
9
+ export interface ISearchBoxItem {
10
+ /**
11
+ * 搜索字段,tag的键,'keyword' 作为组件内部保留字,请勿传入该值
12
+ */
13
+ field: string;
14
+ /**
15
+ * tag 键的显示值,实际结果是field
16
+ */
17
+ label: string;
18
+ /**
19
+ * 配置项可生产的tag类型
20
+ */
21
+ type?: ISearchBoxTagType;
22
+ /**
23
+ * tag 值的选择项数据
24
+ */
25
+ options?: Array<ISearchBoxOption>;
26
+ /**
27
+ * 自动识别匹配正则
28
+ * 10.0.2 新增
29
+ */
30
+ regexp?: RegExp;
31
+ /**
32
+ * radio 单选类型可设置, 设置为false时,单选属性可以多次选择
33
+ */
34
+ replace?: boolean;
35
+ /**
36
+ * 单选或多选值的选中项键值
37
+ * 10.0.2 新增
38
+ */
39
+ optionValueKey?: string;
40
+ /**
41
+ * dateRange 类型日期显示和结果格式,dateRange时必选
42
+ */
43
+ format?: string;
44
+ /**
45
+ * numRange 最小值,类型为number
46
+ * dateRange开始日期,类型为Date
47
+ */
48
+ start?: number | Date;
49
+ /**
50
+ * numRange 最大值,类型为number
51
+ * dateRange起始日期,类型为Date
52
+ */
53
+ end?: number | Date;
54
+ /**
55
+ * numRange 可填最小值,用于校验
56
+ * dateRange可选最小值,用于校验
57
+ */
58
+ min?: number | Date;
59
+ /**
60
+ * numRange 可填最大值,用于校验
61
+ * dateRange可选最大值,用于校验
62
+ */
63
+ max?: number | Date;
64
+ /**
65
+ * 每个item对应的提示文本
66
+ */
67
+ placeholder?: string;
68
+ /**
69
+ * 搜索的字段范围
70
+ */
71
+ searchKeys?: Array<string>;
72
+ /**
73
+ * 标识字段映射,3.13.0新增
74
+ */
75
+ idMapKey?: string;
76
+ /**
77
+ * 标签分隔符[3.14.0新增]
78
+ */
79
+ operator?: string;
80
+ /**
81
+ * type=checkbox时,设置是否合并成一个标签[3.16.0新增]
82
+ */
83
+ mergeTag?: boolean;
84
+ [propName: string]: any;
85
+ }
86
+ export interface ISearchBoxOption {
87
+ /**
88
+ * 选项显示值
89
+ */
90
+ label: string;
91
+ /**
92
+ * 搜索目标字段,只有‘label’才需要
93
+ */
94
+ field?: string;
95
+ /**
96
+ * 控制map类型二级选项是否出现内置所有值,map类型需要
97
+ */
98
+ allValues?: boolean;
99
+ /**
100
+ * 控制map类型二级选项是否出现内置空值,map类型需要
101
+ */
102
+ emptyValue?: boolean;
103
+ /**
104
+ * map类型二级选项数据
105
+ */
106
+ options?: Array<any>;
107
+ [propName: string]: any;
108
+ }
109
+ /**
110
+ * 每个选中tag的类型
111
+ */
112
+ export interface ISearchBoxTag {
113
+ /**
114
+ * 搜索目标搜字段
115
+ */
116
+ field: string;
117
+ /**
118
+ * tag键,field的显示值
119
+ */
120
+ label: string;
121
+ /**
122
+ * tag值
123
+ */
124
+ value: string;
125
+ /**
126
+ * 类型
127
+ */
128
+ type: ISearchBoxTagType;
129
+ /**
130
+ * 数字范围和日期范围tag 开始值
131
+ */
132
+ start?: number | string;
133
+ /**
134
+ * 数字范围和日期范围tag 结束值
135
+ */
136
+ end?: number | string;
137
+ [propName: string]: any;
138
+ }
139
+ /**
140
+ * 潜在匹配项的函数返回值类型
141
+ */
142
+ interface ISearchBoxMatchItem {
143
+ label: string;
144
+ field: string;
145
+ value: string;
146
+ type?: string;
147
+ }
148
+ export interface ISearchBoxMatchOptions {
149
+ getMatchList: (arg1: string) => ISearchBoxMatchItem[];
150
+ }
151
+ export interface ISearchBoxNewTag {
152
+ /**
153
+ * type 新标签所属第一层元素的type类型值
154
+ */
155
+ type: string;
156
+ /**
157
+ * field 新标签所属第一层元素的field值
158
+ */
159
+ field: string;
160
+ /**
161
+ * label 新标签label值,即标签左侧值
162
+ */
163
+ label: string;
164
+ /**
165
+ * value 新标签的value值,即标签右侧值
166
+ */
167
+ value: string;
168
+ /**
169
+ * start 日期标签或大小标签的起始值,可选参数
170
+ */
171
+ start?: string | number;
172
+ /**
173
+ * end 日期标签或大小标签的结束值,可选参数
174
+ */
175
+ end?: string | number;
176
+ /**
177
+ * id 新标签的idMapKey对应的属性值,可用来识别标签,可以是id也可以是idMapKey指定的值,可选参数
178
+ */
179
+ id?: string | number;
180
+ /**
181
+ * operator标签分隔符,可选参数
182
+ */
183
+ operator?: string;
184
+ /**
185
+ * checkbox类型下使用mergeTag为true时,合并的标签信息,
186
+ */
187
+ options?: ISearchBoxTag[];
188
+ }
189
+ export {};
@@ -0,0 +1,15 @@
1
+ export declare const tvpSearchBoxSmbTheme: {
2
+ 'tvp-search-box-right-search-icon-display': string;
3
+ 'tvp-search-box-left-icon-display': string;
4
+ 'tvp-search-box-help-icon-margin-right': string;
5
+ 'tvp-search-box-padding-left': string;
6
+ 'tvp-search-box-close-icon-margin-right': string;
7
+ 'tvp-search-box-separator-icon-margin-right': string;
8
+ 'tvp-search-box-dropdown-btn-group-margin-top': string;
9
+ 'tvp-search-box-dropdown-btn-group-padding-top': string;
10
+ 'tvp-search-box-dropdown-btn-group-padding-bottom': string;
11
+ 'tvp-search-box-dropdown-btn-min-width': string;
12
+ 'tvp-search-box-dropdown-padding-vertical': string;
13
+ 'tvp-search-box-input-padding-left': string;
14
+ 'tvp-search-box-dropdown-header-text-color': string;
15
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 深拷贝方法
3
+ * @param obj 元数据
4
+ * @returns
5
+ */
6
+ export declare const deepClone: (obj: any) => any;
7
+ /**
8
+ * 过滤复制对象的key值
9
+ * @param obj 复制对象
10
+ * @param keysToOmit key值
11
+ */
12
+ export declare const omitObj: (obj: any, keysToOmit?: string[]) => any;