@jetlinks-web/components 3.1.1 → 3.1.3
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/es/EditTable/group.js +2 -2
- package/es/Ellipsis/Ellipsis.js +2 -2
- package/es/Search/Advanced/History.js +2 -2
- package/es/Search/Advanced/SaveHistory.js +3 -3
- package/es/Search/Item.js +28 -3
- package/es/Search/hooks/index.js +1 -0
- package/es/Search/hooks/useRouteQuery.js +17 -0
- package/es/Search/hooks/useTermOptions.js +31 -0
- package/es/Search/setting.js +7 -6
- package/es/Skeleton/style/index.js +1 -1
- package/lib/EditTable/group.js +2 -2
- package/lib/Ellipsis/Ellipsis.js +2 -2
- package/lib/Search/Advanced/History.js +2 -2
- package/lib/Search/Advanced/SaveHistory.js +3 -3
- package/lib/Search/Item.js +28 -3
- package/lib/Search/hooks/index.js +12 -0
- package/lib/Search/hooks/useRouteQuery.js +17 -0
- package/lib/Search/hooks/useTermOptions.js +38 -0
- package/lib/Search/setting.js +7 -6
- package/lib/Skeleton/style/index.js +1 -1
- package/lib/style/components.less +0 -8
- package/package.json +3 -3
package/es/EditTable/group.js
CHANGED
|
@@ -311,7 +311,7 @@ const __sfc_main__ = Object.assign({
|
|
|
311
311
|
_: 1 /* STABLE */
|
|
312
312
|
}, 8 /* PROPS */, ["activeKey", "hideAdd"]),
|
|
313
313
|
_createVNode(_component_a_modal, {
|
|
314
|
-
|
|
314
|
+
open: visible.value,
|
|
315
315
|
title: _unref(contextLocale).Group.editGroup,
|
|
316
316
|
maskClosable: false,
|
|
317
317
|
getContainer: modalContainer,
|
|
@@ -352,7 +352,7 @@ const __sfc_main__ = Object.assign({
|
|
|
352
352
|
}, 8 /* PROPS */, ["model"])
|
|
353
353
|
]),
|
|
354
354
|
_: 1 /* STABLE */
|
|
355
|
-
}, 8 /* PROPS */, ["
|
|
355
|
+
}, 8 /* PROPS */, ["open", "title"])
|
|
356
356
|
], 2 /* CLASS */));
|
|
357
357
|
};
|
|
358
358
|
}
|
package/es/Ellipsis/Ellipsis.js
CHANGED
|
@@ -163,7 +163,7 @@ const __sfc_main__ = Object.assign({
|
|
|
163
163
|
ref: tooltipRef,
|
|
164
164
|
placement: "top"
|
|
165
165
|
}, __props.tooltip, {
|
|
166
|
-
|
|
166
|
+
open: visible.value && __props.tooltip !== false
|
|
167
167
|
}), _createSlots({
|
|
168
168
|
default: _withCtx(() => [
|
|
169
169
|
_createElementVNode("span", _mergeProps({
|
|
@@ -195,7 +195,7 @@ const __sfc_main__ = Object.assign({
|
|
|
195
195
|
key: "0"
|
|
196
196
|
}
|
|
197
197
|
: undefined
|
|
198
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["
|
|
198
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["open"]));
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
});
|
|
@@ -133,7 +133,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
133
133
|
placement: "bottom",
|
|
134
134
|
trigger: "click",
|
|
135
135
|
"overlay-class-name": "search-history-list-pop",
|
|
136
|
-
|
|
136
|
+
open: historyVisible.value,
|
|
137
137
|
onVisibleChange: visibleChange
|
|
138
138
|
}, {
|
|
139
139
|
content: _withCtx(() => [
|
|
@@ -186,7 +186,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
186
186
|
])
|
|
187
187
|
]),
|
|
188
188
|
_: 1 /* STABLE */
|
|
189
|
-
}, 8 /* PROPS */, ["
|
|
189
|
+
}, 8 /* PROPS */, ["open"])
|
|
190
190
|
], 2 /* CLASS */));
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -86,8 +86,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
86
86
|
};
|
|
87
87
|
return (_ctx, _cache) => {
|
|
88
88
|
return (_openBlock(), _createBlock(_unref(Popover), {
|
|
89
|
-
|
|
90
|
-
"onUpdate:
|
|
89
|
+
open: visible.value,
|
|
90
|
+
"onUpdate:open": _cache[1] || (_cache[1] = ($event) => ((visible).value = $event)),
|
|
91
91
|
title: _unref(contextLocale).advanced.saveHistory.searchName,
|
|
92
92
|
trigger: "click",
|
|
93
93
|
placement: "bottom",
|
|
@@ -149,7 +149,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
149
149
|
})
|
|
150
150
|
]),
|
|
151
151
|
_: 1 /* STABLE */
|
|
152
|
-
}, 8 /* PROPS */, ["
|
|
152
|
+
}, 8 /* PROPS */, ["open", "title"]));
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
});
|
package/es/Search/Item.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
1
17
|
/* Analyzed bindings: {
|
|
2
18
|
"column": "props",
|
|
3
19
|
"value": "props",
|
|
@@ -118,7 +134,16 @@ const __sfc_main__ = _defineComponent({
|
|
|
118
134
|
const prefixCls = computed(() => 'JSearch');
|
|
119
135
|
const [wrapSSR, hashId] = useSearchStyle(prefixCls);
|
|
120
136
|
const termTypeOptions = computed(() => {
|
|
121
|
-
|
|
137
|
+
const columnTarget = findItemByColumn();
|
|
138
|
+
const columnSearch = _optionalChain([columnTarget, 'optionalAccess', _ => _.search]);
|
|
139
|
+
let _termsOptions = getTermOptions(targetComponents.value.type, contextLocale.value);
|
|
140
|
+
if (_optionalChain([columnSearch, 'optionalAccess', _2 => _2.termOptions])) {
|
|
141
|
+
_termsOptions = columnSearch.termOptions;
|
|
142
|
+
}
|
|
143
|
+
else if (_optionalChain([columnSearch, 'optionalAccess', _3 => _3.termFilter, 'optionalAccess', _4 => _4.length])) {
|
|
144
|
+
_termsOptions = _termsOptions.filter((item) => !_optionalChain([columnSearch, 'access', _5 => _5.termFilter, 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(item.value)]));
|
|
145
|
+
}
|
|
146
|
+
return _termsOptions;
|
|
122
147
|
});
|
|
123
148
|
const columnOptions = computed(() => {
|
|
124
149
|
return Object.values(columnsMap.value).sort((a, b) => a._sort_index - b._sort_index).map(item => ({ label: item.title, value: item.dataIndex }));
|
|
@@ -169,14 +194,14 @@ const __sfc_main__ = _defineComponent({
|
|
|
169
194
|
const isBtw = ['in', 'nin'].includes(termsModel.termType);
|
|
170
195
|
if (targetComponents.value.type === componentType.treeSelect) {
|
|
171
196
|
targetComponents.value.props = {
|
|
197
|
+
multiple: isBtw,
|
|
172
198
|
...targetComponents.value.props,
|
|
173
|
-
multiple: isBtw
|
|
174
199
|
};
|
|
175
200
|
}
|
|
176
201
|
else if (targetComponents.value.type === componentType.select) {
|
|
177
202
|
targetComponents.value.props = {
|
|
203
|
+
mode: isBtw ? 'multiple' : 'combobox',
|
|
178
204
|
...targetComponents.value.props,
|
|
179
|
-
mode: isBtw ? 'multiple' : 'combobox'
|
|
180
205
|
};
|
|
181
206
|
}
|
|
182
207
|
}, { immediate: true });
|
package/es/Search/hooks/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { provide, inject, watchEffect, ref } from 'vue';
|
|
|
5
5
|
import { getItemDefaultValue } from "../util";
|
|
6
6
|
export * from './useSearchItems';
|
|
7
7
|
export * from './useRouteQuery';
|
|
8
|
+
export * from './useTermOptions';
|
|
8
9
|
var optionMapKey = Symbol('optionMapKey');
|
|
9
10
|
var columnsMapKey = Symbol('columnMapKey');
|
|
10
11
|
var columnsValues = Symbol('columnsValues');
|
|
@@ -11,6 +11,23 @@ export var useRouteQuery = function useRouteQuery(name) {
|
|
|
11
11
|
var transformSet = function transformSet(value) {
|
|
12
12
|
return value;
|
|
13
13
|
};
|
|
14
|
+
// 在storybook环境中,router可能为undefined或null,需要进行类型检查
|
|
15
|
+
if (!router || !route) {
|
|
16
|
+
// 返回一个模拟的ref,避免在storybook中报错
|
|
17
|
+
return customRef(function (track, trigger) {
|
|
18
|
+
var value = undefined;
|
|
19
|
+
return {
|
|
20
|
+
get: function get() {
|
|
21
|
+
track();
|
|
22
|
+
return transformGet(value);
|
|
23
|
+
},
|
|
24
|
+
set: function set(v) {
|
|
25
|
+
value = transformSet(v);
|
|
26
|
+
trigger();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
}
|
|
14
31
|
if (!_queue.has(router)) _queue.set(router, new Map());
|
|
15
32
|
var _queriesQueue = _queue.get(router);
|
|
16
33
|
var query = route.query[name];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { TermTypeMap } from "../setting";
|
|
4
|
+
import { useLocaleReceiver } from "../../LocaleReciver";
|
|
5
|
+
export var useTermOptions = function useTermOptions(options) {
|
|
6
|
+
var _useLocaleReceiver = useLocaleReceiver('Search'),
|
|
7
|
+
_useLocaleReceiver2 = _slicedToArray(_useLocaleReceiver, 1),
|
|
8
|
+
contextLocale = _useLocaleReceiver2[0];
|
|
9
|
+
var termTypeMap = TermTypeMap(contextLocale.value);
|
|
10
|
+
var termsOptionsCache = Object.values(termTypeMap);
|
|
11
|
+
var termOptions = ref();
|
|
12
|
+
var termsKey = Object.keys(termTypeMap).reduce(function (previousValue, currentValue) {
|
|
13
|
+
previousValue[currentValue] = termTypeMap[currentValue].value;
|
|
14
|
+
return previousValue;
|
|
15
|
+
}, {});
|
|
16
|
+
if (options !== null && options !== void 0 && options.omit) {
|
|
17
|
+
termOptions.value = termsOptionsCache.filter(function (item) {
|
|
18
|
+
return !options.omit.includes(item.value);
|
|
19
|
+
});
|
|
20
|
+
} else if (options !== null && options !== void 0 && options.pick) {
|
|
21
|
+
termOptions.value = termsOptionsCache.filter(function (item) {
|
|
22
|
+
return options.pick.includes(item.value);
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
termOptions.value = [].concat(termsOptionsCache);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
termOptions: termOptions,
|
|
29
|
+
termsKey: termsKey
|
|
30
|
+
};
|
|
31
|
+
};
|
package/es/Search/setting.js
CHANGED
|
@@ -49,6 +49,7 @@ export var typeOptions = function typeOptions(locale) {
|
|
|
49
49
|
}];
|
|
50
50
|
};
|
|
51
51
|
export var TermTypeMap = function TermTypeMap(locale) {
|
|
52
|
+
var _locale$setting, _locale$setting2, _locale$setting3, _locale$setting4, _locale$setting5, _locale$setting6;
|
|
52
53
|
return {
|
|
53
54
|
EQ: {
|
|
54
55
|
label: '=',
|
|
@@ -59,11 +60,11 @@ export var TermTypeMap = function TermTypeMap(locale) {
|
|
|
59
60
|
value: 'not'
|
|
60
61
|
},
|
|
61
62
|
LIKE: {
|
|
62
|
-
label: locale.setting.include,
|
|
63
|
+
label: (_locale$setting = locale.setting) === null || _locale$setting === void 0 ? void 0 : _locale$setting.include,
|
|
63
64
|
value: 'like'
|
|
64
65
|
},
|
|
65
66
|
NLIKE: {
|
|
66
|
-
label: locale.setting.exclude,
|
|
67
|
+
label: (_locale$setting2 = locale.setting) === null || _locale$setting2 === void 0 ? void 0 : _locale$setting2.exclude,
|
|
67
68
|
value: 'nlike'
|
|
68
69
|
},
|
|
69
70
|
GT: {
|
|
@@ -83,19 +84,19 @@ export var TermTypeMap = function TermTypeMap(locale) {
|
|
|
83
84
|
value: 'lte'
|
|
84
85
|
},
|
|
85
86
|
IN: {
|
|
86
|
-
label: locale.setting.in,
|
|
87
|
+
label: (_locale$setting3 = locale.setting) === null || _locale$setting3 === void 0 ? void 0 : _locale$setting3.in,
|
|
87
88
|
value: 'in'
|
|
88
89
|
},
|
|
89
90
|
NIN: {
|
|
90
|
-
label: locale.setting.notIn,
|
|
91
|
+
label: (_locale$setting4 = locale.setting) === null || _locale$setting4 === void 0 ? void 0 : _locale$setting4.notIn,
|
|
91
92
|
value: 'nin'
|
|
92
93
|
},
|
|
93
94
|
BTW: {
|
|
94
|
-
label: locale.setting.between,
|
|
95
|
+
label: (_locale$setting5 = locale.setting) === null || _locale$setting5 === void 0 ? void 0 : _locale$setting5.between,
|
|
95
96
|
value: 'btw'
|
|
96
97
|
},
|
|
97
98
|
NBTW: {
|
|
98
|
-
label: locale.setting.notBetween,
|
|
99
|
+
label: (_locale$setting6 = locale.setting) === null || _locale$setting6 === void 0 ? void 0 : _locale$setting6.notBetween,
|
|
99
100
|
value: 'nbtw'
|
|
100
101
|
}
|
|
101
102
|
};
|
|
@@ -36,7 +36,7 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
36
36
|
})), "".concat(componentCls), (_$concat6 = {
|
|
37
37
|
height: '100%'
|
|
38
38
|
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_$concat6, "".concat(componentCls, "-item"), {
|
|
39
|
-
background:
|
|
39
|
+
background: "linear-gradient(90deg, ".concat(JSkeletonBg, " 25%, ").concat(JSkeletonBg1, " 50%, ").concat(JSkeletonBg, " 75%)"),
|
|
40
40
|
backgroundSize: '400% 100%',
|
|
41
41
|
borderRadius: JSkeletonBorderRadius,
|
|
42
42
|
height: JSkeletonSize
|
package/lib/EditTable/group.js
CHANGED
|
@@ -311,7 +311,7 @@ const __sfc_main__ = Object.assign({
|
|
|
311
311
|
_: 1 /* STABLE */
|
|
312
312
|
}, 8 /* PROPS */, ["activeKey", "hideAdd"]),
|
|
313
313
|
_createVNode(_component_a_modal, {
|
|
314
|
-
|
|
314
|
+
open: visible.value,
|
|
315
315
|
title: _unref(contextLocale).Group.editGroup,
|
|
316
316
|
maskClosable: false,
|
|
317
317
|
getContainer: modalContainer,
|
|
@@ -352,7 +352,7 @@ const __sfc_main__ = Object.assign({
|
|
|
352
352
|
}, 8 /* PROPS */, ["model"])
|
|
353
353
|
]),
|
|
354
354
|
_: 1 /* STABLE */
|
|
355
|
-
}, 8 /* PROPS */, ["
|
|
355
|
+
}, 8 /* PROPS */, ["open", "title"])
|
|
356
356
|
], 2 /* CLASS */));
|
|
357
357
|
};
|
|
358
358
|
}
|
package/lib/Ellipsis/Ellipsis.js
CHANGED
|
@@ -163,7 +163,7 @@ const __sfc_main__ = Object.assign({
|
|
|
163
163
|
ref: tooltipRef,
|
|
164
164
|
placement: "top"
|
|
165
165
|
}, __props.tooltip, {
|
|
166
|
-
|
|
166
|
+
open: visible.value && __props.tooltip !== false
|
|
167
167
|
}), _createSlots({
|
|
168
168
|
default: _withCtx(() => [
|
|
169
169
|
_createElementVNode("span", _mergeProps({
|
|
@@ -195,7 +195,7 @@ const __sfc_main__ = Object.assign({
|
|
|
195
195
|
key: "0"
|
|
196
196
|
}
|
|
197
197
|
: undefined
|
|
198
|
-
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["
|
|
198
|
+
]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["open"]));
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
});
|
|
@@ -133,7 +133,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
133
133
|
placement: "bottom",
|
|
134
134
|
trigger: "click",
|
|
135
135
|
"overlay-class-name": "search-history-list-pop",
|
|
136
|
-
|
|
136
|
+
open: historyVisible.value,
|
|
137
137
|
onVisibleChange: visibleChange
|
|
138
138
|
}, {
|
|
139
139
|
content: _withCtx(() => [
|
|
@@ -186,7 +186,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
186
186
|
])
|
|
187
187
|
]),
|
|
188
188
|
_: 1 /* STABLE */
|
|
189
|
-
}, 8 /* PROPS */, ["
|
|
189
|
+
}, 8 /* PROPS */, ["open"])
|
|
190
190
|
], 2 /* CLASS */));
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -86,8 +86,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
86
86
|
};
|
|
87
87
|
return (_ctx, _cache) => {
|
|
88
88
|
return (_openBlock(), _createBlock(_unref(Popover), {
|
|
89
|
-
|
|
90
|
-
"onUpdate:
|
|
89
|
+
open: visible.value,
|
|
90
|
+
"onUpdate:open": _cache[1] || (_cache[1] = ($event) => ((visible).value = $event)),
|
|
91
91
|
title: _unref(contextLocale).advanced.saveHistory.searchName,
|
|
92
92
|
trigger: "click",
|
|
93
93
|
placement: "bottom",
|
|
@@ -149,7 +149,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
149
149
|
})
|
|
150
150
|
]),
|
|
151
151
|
_: 1 /* STABLE */
|
|
152
|
-
}, 8 /* PROPS */, ["
|
|
152
|
+
}, 8 /* PROPS */, ["open", "title"]));
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
});
|
package/lib/Search/Item.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
1
17
|
/* Analyzed bindings: {
|
|
2
18
|
"column": "props",
|
|
3
19
|
"value": "props",
|
|
@@ -118,7 +134,16 @@ const __sfc_main__ = _defineComponent({
|
|
|
118
134
|
const prefixCls = computed(() => 'JSearch');
|
|
119
135
|
const [wrapSSR, hashId] = useSearchStyle(prefixCls);
|
|
120
136
|
const termTypeOptions = computed(() => {
|
|
121
|
-
|
|
137
|
+
const columnTarget = findItemByColumn();
|
|
138
|
+
const columnSearch = _optionalChain([columnTarget, 'optionalAccess', _ => _.search]);
|
|
139
|
+
let _termsOptions = getTermOptions(targetComponents.value.type, contextLocale.value);
|
|
140
|
+
if (_optionalChain([columnSearch, 'optionalAccess', _2 => _2.termOptions])) {
|
|
141
|
+
_termsOptions = columnSearch.termOptions;
|
|
142
|
+
}
|
|
143
|
+
else if (_optionalChain([columnSearch, 'optionalAccess', _3 => _3.termFilter, 'optionalAccess', _4 => _4.length])) {
|
|
144
|
+
_termsOptions = _termsOptions.filter((item) => !_optionalChain([columnSearch, 'access', _5 => _5.termFilter, 'optionalAccess', _6 => _6.includes, 'call', _7 => _7(item.value)]));
|
|
145
|
+
}
|
|
146
|
+
return _termsOptions;
|
|
122
147
|
});
|
|
123
148
|
const columnOptions = computed(() => {
|
|
124
149
|
return Object.values(columnsMap.value).sort((a, b) => a._sort_index - b._sort_index).map(item => ({ label: item.title, value: item.dataIndex }));
|
|
@@ -169,14 +194,14 @@ const __sfc_main__ = _defineComponent({
|
|
|
169
194
|
const isBtw = ['in', 'nin'].includes(termsModel.termType);
|
|
170
195
|
if (targetComponents.value.type === componentType.treeSelect) {
|
|
171
196
|
targetComponents.value.props = {
|
|
197
|
+
multiple: isBtw,
|
|
172
198
|
...targetComponents.value.props,
|
|
173
|
-
multiple: isBtw
|
|
174
199
|
};
|
|
175
200
|
}
|
|
176
201
|
else if (targetComponents.value.type === componentType.select) {
|
|
177
202
|
targetComponents.value.props = {
|
|
203
|
+
mode: isBtw ? 'multiple' : 'combobox',
|
|
178
204
|
...targetComponents.value.props,
|
|
179
|
-
mode: isBtw ? 'multiple' : 'combobox'
|
|
180
205
|
};
|
|
181
206
|
}
|
|
182
207
|
}, { immediate: true });
|
|
@@ -42,6 +42,18 @@ Object.keys(_useRouteQuery).forEach(function (key) {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
+
var _useTermOptions = require("./useTermOptions");
|
|
46
|
+
Object.keys(_useTermOptions).forEach(function (key) {
|
|
47
|
+
if (key === "default" || key === "__esModule") return;
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
49
|
+
if (key in exports && exports[key] === _useTermOptions[key]) return;
|
|
50
|
+
Object.defineProperty(exports, key, {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _useTermOptions[key];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
45
57
|
var optionMapKey = Symbol('optionMapKey');
|
|
46
58
|
var columnsMapKey = Symbol('columnMapKey');
|
|
47
59
|
var columnsValues = Symbol('columnsValues');
|
|
@@ -18,6 +18,23 @@ var useRouteQuery = exports.useRouteQuery = function useRouteQuery(name) {
|
|
|
18
18
|
var transformSet = function transformSet(value) {
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
|
+
// 在storybook环境中,router可能为undefined或null,需要进行类型检查
|
|
22
|
+
if (!router || !route) {
|
|
23
|
+
// 返回一个模拟的ref,避免在storybook中报错
|
|
24
|
+
return (0, _vue.customRef)(function (track, trigger) {
|
|
25
|
+
var value = undefined;
|
|
26
|
+
return {
|
|
27
|
+
get: function get() {
|
|
28
|
+
track();
|
|
29
|
+
return transformGet(value);
|
|
30
|
+
},
|
|
31
|
+
set: function set(v) {
|
|
32
|
+
value = transformSet(v);
|
|
33
|
+
trigger();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
21
38
|
if (!_queue.has(router)) _queue.set(router, new Map());
|
|
22
39
|
var _queriesQueue = _queue.get(router);
|
|
23
40
|
var query = route.query[name];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useTermOptions = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _vue = require("vue");
|
|
10
|
+
var _setting = require("../setting");
|
|
11
|
+
var _LocaleReciver = require("../../LocaleReciver");
|
|
12
|
+
var useTermOptions = exports.useTermOptions = function useTermOptions(options) {
|
|
13
|
+
var _useLocaleReceiver = (0, _LocaleReciver.useLocaleReceiver)('Search'),
|
|
14
|
+
_useLocaleReceiver2 = (0, _slicedToArray2.default)(_useLocaleReceiver, 1),
|
|
15
|
+
contextLocale = _useLocaleReceiver2[0];
|
|
16
|
+
var termTypeMap = (0, _setting.TermTypeMap)(contextLocale.value);
|
|
17
|
+
var termsOptionsCache = Object.values(termTypeMap);
|
|
18
|
+
var termOptions = (0, _vue.ref)();
|
|
19
|
+
var termsKey = Object.keys(termTypeMap).reduce(function (previousValue, currentValue) {
|
|
20
|
+
previousValue[currentValue] = termTypeMap[currentValue].value;
|
|
21
|
+
return previousValue;
|
|
22
|
+
}, {});
|
|
23
|
+
if (options !== null && options !== void 0 && options.omit) {
|
|
24
|
+
termOptions.value = termsOptionsCache.filter(function (item) {
|
|
25
|
+
return !options.omit.includes(item.value);
|
|
26
|
+
});
|
|
27
|
+
} else if (options !== null && options !== void 0 && options.pick) {
|
|
28
|
+
termOptions.value = termsOptionsCache.filter(function (item) {
|
|
29
|
+
return options.pick.includes(item.value);
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
termOptions.value = [].concat(termsOptionsCache);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
termOptions: termOptions,
|
|
36
|
+
termsKey: termsKey
|
|
37
|
+
};
|
|
38
|
+
};
|
package/lib/Search/setting.js
CHANGED
|
@@ -55,6 +55,7 @@ var typeOptions = exports.typeOptions = function typeOptions(locale) {
|
|
|
55
55
|
}];
|
|
56
56
|
};
|
|
57
57
|
var TermTypeMap = exports.TermTypeMap = function TermTypeMap(locale) {
|
|
58
|
+
var _locale$setting, _locale$setting2, _locale$setting3, _locale$setting4, _locale$setting5, _locale$setting6;
|
|
58
59
|
return {
|
|
59
60
|
EQ: {
|
|
60
61
|
label: '=',
|
|
@@ -65,11 +66,11 @@ var TermTypeMap = exports.TermTypeMap = function TermTypeMap(locale) {
|
|
|
65
66
|
value: 'not'
|
|
66
67
|
},
|
|
67
68
|
LIKE: {
|
|
68
|
-
label: locale.setting.include,
|
|
69
|
+
label: (_locale$setting = locale.setting) === null || _locale$setting === void 0 ? void 0 : _locale$setting.include,
|
|
69
70
|
value: 'like'
|
|
70
71
|
},
|
|
71
72
|
NLIKE: {
|
|
72
|
-
label: locale.setting.exclude,
|
|
73
|
+
label: (_locale$setting2 = locale.setting) === null || _locale$setting2 === void 0 ? void 0 : _locale$setting2.exclude,
|
|
73
74
|
value: 'nlike'
|
|
74
75
|
},
|
|
75
76
|
GT: {
|
|
@@ -89,19 +90,19 @@ var TermTypeMap = exports.TermTypeMap = function TermTypeMap(locale) {
|
|
|
89
90
|
value: 'lte'
|
|
90
91
|
},
|
|
91
92
|
IN: {
|
|
92
|
-
label: locale.setting.in,
|
|
93
|
+
label: (_locale$setting3 = locale.setting) === null || _locale$setting3 === void 0 ? void 0 : _locale$setting3.in,
|
|
93
94
|
value: 'in'
|
|
94
95
|
},
|
|
95
96
|
NIN: {
|
|
96
|
-
label: locale.setting.notIn,
|
|
97
|
+
label: (_locale$setting4 = locale.setting) === null || _locale$setting4 === void 0 ? void 0 : _locale$setting4.notIn,
|
|
97
98
|
value: 'nin'
|
|
98
99
|
},
|
|
99
100
|
BTW: {
|
|
100
|
-
label: locale.setting.between,
|
|
101
|
+
label: (_locale$setting5 = locale.setting) === null || _locale$setting5 === void 0 ? void 0 : _locale$setting5.between,
|
|
101
102
|
value: 'btw'
|
|
102
103
|
},
|
|
103
104
|
NBTW: {
|
|
104
|
-
label: locale.setting.notBetween,
|
|
105
|
+
label: (_locale$setting6 = locale.setting) === null || _locale$setting6 === void 0 ? void 0 : _locale$setting6.notBetween,
|
|
105
106
|
value: 'nbtw'
|
|
106
107
|
}
|
|
107
108
|
};
|
|
@@ -43,7 +43,7 @@ var genSkeletonStyle = function genSkeletonStyle(config) {
|
|
|
43
43
|
})), "".concat(componentCls), (_$concat6 = {
|
|
44
44
|
height: '100%'
|
|
45
45
|
}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_$concat6, "".concat(componentCls, "-item"), {
|
|
46
|
-
background:
|
|
46
|
+
background: "linear-gradient(90deg, ".concat(JSkeletonBg, " 25%, ").concat(JSkeletonBg1, " 50%, ").concat(JSkeletonBg, " 75%)"),
|
|
47
47
|
backgroundSize: '400% 100%',
|
|
48
48
|
borderRadius: JSkeletonBorderRadius,
|
|
49
49
|
height: JSkeletonSize
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
@import "../CardSelect/style/index-pure.less";
|
|
2
|
-
@import "../CheckButton/style/index-pure.less";
|
|
3
|
-
@import "../DragModal/style/index-pure.less";
|
|
4
|
-
@import "../EditTable/style/index-pure.less";
|
|
5
|
-
@import "../Ellipsis/style/index-pure.less";
|
|
6
|
-
@import "../RadioButton/style/index-pure.less";
|
|
7
|
-
@import "../Scrollbar/style/index-pure.less";
|
|
8
|
-
@import "../Title/style/index-pure.less";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
"webpack-dev-server": "^4.0.0",
|
|
155
155
|
"webpack-merge": "^5.0.0",
|
|
156
156
|
"webpackbar": "^5.0.2",
|
|
157
|
+
"@jetlinks-web/utils": "^1.2.12",
|
|
157
158
|
"@jetlinks-web/constants": "^1.0.9",
|
|
158
|
-
"@jetlinks-web/hooks": "^1.1.1"
|
|
159
|
-
"@jetlinks-web/utils": "^1.2.12"
|
|
159
|
+
"@jetlinks-web/hooks": "^1.1.1"
|
|
160
160
|
},
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"registry": "https://registry.npmjs.org/",
|