@opentiny/vue-search-box 2.29.0 → 2.30.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-search-box",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * tag类型, radio-默认单选, noValue-非正常tag,tag值为空, checkbox-多选,map-键值tag, numRange-数字范围tag,
3
- * dateRange-日期范围tag。tag 的分类是根据键值的结果划分
2
+ * tag类型, radio-默认单选, input-输入型, checkbox-多选,map-键值tag, numRange-数字范围tag,
3
+ * dateRange-日期范围tag, datetimeRange-日期时间范围tag, custom-自定义面板tag。tag 的分类是根据键值的结果划分
4
4
  */
5
- export type ISearchBoxTagType = 'radio' | 'noValue' | 'checkbox' | 'map' | 'numRange' | 'dateRange' | 'datetimeRange';
5
+ export type ISearchBoxTagType = 'radio' | 'input' | 'checkbox' | 'map' | 'numRange' | 'dateRange' | 'datetimeRange' | 'custom';
6
6
  /**
7
7
  * 候选tag数据配置项
8
8
  */
@@ -74,13 +74,55 @@ export interface ISearchBoxItem {
74
74
  */
75
75
  idMapKey?: string;
76
76
  /**
77
- * 标签分隔符[3.14.0新增]
77
+ * 标签分隔符数组[3.14.0新增]
78
78
  */
79
- operator?: string;
79
+ operators?: Array<string>;
80
80
  /**
81
81
  * type=checkbox时,设置是否合并成一个标签[3.16.0新增]
82
82
  */
83
83
  mergeTag?: boolean;
84
+ /**
85
+ * 编辑状态此属性禁用状态,常用以设置不可变更
86
+ */
87
+ editAttrDisabled?: boolean;
88
+ /**
89
+ * type=dateRange/datetimeRange时生效,设置用户只能选择某个时间跨度,只接受毫秒数
90
+ */
91
+ maxTimeLength?: number;
92
+ /**
93
+ * type=dateRange/datetimeRange时生效,透传给内部 tiny-date-picker 的 picker-options 配置
94
+ * 支持 firstDayOfWeek / disabledDate / shortcuts 等属性,
95
+ * 其中 disabledDate 会与组件内部基于 maxTimeLength / min / max 的禁用逻辑合并(任一返回 true 即禁用)
96
+ * 注:search-box 内部使用两个独立的单日期选择器(开始/结束),并非一个 daterange 范围选择器,
97
+ * 故仅针对 daterange 范围选择器生效的 onPick 回调在此不适用,配置后不会触发
98
+ */
99
+ pickerOptions?: {
100
+ firstDayOfWeek?: number;
101
+ disabledDate?: (time: Date) => boolean;
102
+ shortcuts?: Array<{
103
+ text: string;
104
+ onClick?: (picker: {
105
+ $emit: (type: string, date: Date | Date[]) => void;
106
+ }) => void;
107
+ type?: 'startFrom' | 'endAt';
108
+ startDate?: Date;
109
+ endDate?: Date;
110
+ }>;
111
+ [propName: string]: any;
112
+ };
113
+ /**
114
+ * type=custom时生效,用于指定二级面板的插槽名,对应的编辑态自定义面板插槽名为item.slotName + '-edit'
115
+ */
116
+ slotName?: string;
117
+ /**
118
+ * 自定义分组名,默认为:'0'
119
+ */
120
+ groupKey?: string;
121
+ /**
122
+ * 是否异步加载 options,设置为 true 时 options 为空数组会显示 loading 等待数据填充;
123
+ * 不设置或为 false 时 options 为空数组不显示 loading
124
+ */
125
+ asyncLoading?: boolean;
84
126
  [propName: string]: any;
85
127
  }
86
128
  export interface ISearchBoxOption {
@@ -146,7 +188,7 @@ interface ISearchBoxMatchItem {
146
188
  type?: string;
147
189
  }
148
190
  export interface ISearchBoxMatchOptions {
149
- getMatchList: (arg1: string) => ISearchBoxMatchItem[];
191
+ getMatchList: (arg1: string) => ISearchBoxMatchItem[] | Promise<ISearchBoxMatchItem[]>;
150
192
  }
151
193
  export interface ISearchBoxNewTag {
152
194
  /**