@jetlinks-web/components 3.1.6 → 3.1.7
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/AutoComplete/AutoComplete.js +59 -24
- package/es/CardSelect/CardSelect.js +5 -0
- package/es/CheckButton/CheckButton.js +5 -0
- package/es/Search/Advanced/index.js +1 -4
- package/es/Search/hooks/index.js +1 -1
- package/es/VirtualTable/data.js +4 -0
- package/lib/AutoComplete/AutoComplete.js +59 -24
- package/lib/CardSelect/CardSelect.js +5 -0
- package/lib/CheckButton/CheckButton.js +5 -0
- package/lib/Search/Advanced/index.js +1 -4
- package/lib/Search/hooks/index.js +1 -1
- package/lib/VirtualTable/data.js +4 -0
- package/package.json +3 -3
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
|
|
2
|
+
return lhs;
|
|
3
|
+
}
|
|
4
|
+
else {
|
|
5
|
+
return rhsFn();
|
|
6
|
+
} }
|
|
1
7
|
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
8
|
const op = ops[i];
|
|
3
9
|
const fn = ops[i + 1];
|
|
@@ -20,17 +26,24 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
20
26
|
"autoCompleteProps": "setup-maybe-ref",
|
|
21
27
|
"ref": "setup-const",
|
|
22
28
|
"watch": "setup-const",
|
|
29
|
+
"computed": "setup-const",
|
|
30
|
+
"omit": "setup-maybe-ref",
|
|
23
31
|
"props": "setup-reactive-const",
|
|
24
32
|
"emit": "setup-const",
|
|
25
|
-
"
|
|
33
|
+
"displayText": "setup-ref",
|
|
34
|
+
"selectedValue": "setup-ref",
|
|
35
|
+
"keyword": "setup-ref",
|
|
36
|
+
"filteredOptions": "setup-ref",
|
|
26
37
|
"onSearch": "setup-const",
|
|
27
|
-
"
|
|
38
|
+
"onSelect": "setup-const",
|
|
39
|
+
"onChange": "setup-const"
|
|
28
40
|
} */
|
|
29
41
|
import { defineComponent as _defineComponent } from 'vue';
|
|
30
|
-
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode,
|
|
42
|
+
import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
31
43
|
import { AutoComplete } from 'ant-design-vue';
|
|
32
44
|
import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
|
|
33
|
-
import { ref, watch } from 'vue';
|
|
45
|
+
import { ref, watch, computed } from 'vue';
|
|
46
|
+
import { omit } from "lodash-es";
|
|
34
47
|
const __sfc_main__ = _defineComponent({
|
|
35
48
|
...{
|
|
36
49
|
name: 'JAutoComplete'
|
|
@@ -42,38 +55,60 @@ const __sfc_main__ = _defineComponent({
|
|
|
42
55
|
default: 'label',
|
|
43
56
|
},
|
|
44
57
|
},
|
|
45
|
-
emits: ["select"],
|
|
58
|
+
emits: ["select", "change", "update:value"],
|
|
46
59
|
setup(__props, { emit: __emit }) {
|
|
47
60
|
const props = __props;
|
|
48
61
|
const emit = __emit;
|
|
49
|
-
const
|
|
62
|
+
const displayText = ref();
|
|
63
|
+
const selectedValue = ref();
|
|
64
|
+
const keyword = ref('');
|
|
65
|
+
const filteredOptions = computed(() => {
|
|
66
|
+
if (!keyword.value)
|
|
67
|
+
return props.options;
|
|
68
|
+
return props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
|
|
69
|
+
.includes(keyword.value));
|
|
70
|
+
});
|
|
50
71
|
/**
|
|
51
72
|
* 根据关键词提示
|
|
52
73
|
* @param searchText 关键词
|
|
53
74
|
*/
|
|
54
75
|
const onSearch = (searchText) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
keyword.value = searchText;
|
|
77
|
+
// _options.value = props.options?.filter(
|
|
78
|
+
// (item) => !!item[props.searchKey]?.includes(searchText),
|
|
79
|
+
// ) || [];
|
|
80
|
+
// if (!_options.value.length) {
|
|
81
|
+
// _options.value.unshift({ label: searchText, value: searchText });
|
|
82
|
+
// }
|
|
59
83
|
};
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
const onSelect = (val, option) => {
|
|
85
|
+
displayText.value = option.label;
|
|
86
|
+
emit('update:value', val);
|
|
87
|
+
emit('select', val, option);
|
|
88
|
+
};
|
|
89
|
+
const onChange = (val) => {
|
|
90
|
+
displayText.value = val;
|
|
91
|
+
keyword.value = val;
|
|
92
|
+
emit('update:value', '');
|
|
67
93
|
};
|
|
68
|
-
watch(() =>
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
watch(() => props.value, (val) => {
|
|
95
|
+
if (!val) {
|
|
96
|
+
displayText.value = '';
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
|
|
100
|
+
displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
|
|
101
|
+
}
|
|
71
102
|
}, { immediate: true });
|
|
72
103
|
return (_ctx, _cache) => {
|
|
73
|
-
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({
|
|
74
|
-
|
|
104
|
+
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
|
|
105
|
+
style: { "width": "100%" },
|
|
106
|
+
value: displayText.value,
|
|
107
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
|
|
108
|
+
options: filteredOptions.value,
|
|
75
109
|
onSearch: onSearch,
|
|
76
|
-
|
|
110
|
+
onChange: onChange,
|
|
111
|
+
onSelect: onSelect
|
|
77
112
|
}), {
|
|
78
113
|
option: _withCtx(({ value, label }) => [
|
|
79
114
|
_renderSlot(_ctx.$slots, "option", { value: value }, () => [
|
|
@@ -84,7 +119,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
84
119
|
_renderSlot(_ctx.$slots, "default")
|
|
85
120
|
]),
|
|
86
121
|
_: 3 /* FORWARDED */
|
|
87
|
-
}, 16 /* FULL_PROPS */, ["options"]));
|
|
122
|
+
}, 16 /* FULL_PROPS */, ["value", "options"]));
|
|
88
123
|
};
|
|
89
124
|
}
|
|
90
125
|
});
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
"ref": "setup-const",
|
|
12
12
|
"watch": "setup-const",
|
|
13
13
|
"genCompoentStyle": "setup-maybe-ref",
|
|
14
|
+
"Form": "setup-maybe-ref",
|
|
14
15
|
"props": "setup-reactive-const",
|
|
15
16
|
"emit": "setup-const",
|
|
16
17
|
"selectKeys": "setup-ref",
|
|
17
18
|
"prefixCls": "setup-ref",
|
|
18
19
|
"wrapSSR": "setup-maybe-ref",
|
|
19
20
|
"hashId": "setup-maybe-ref",
|
|
21
|
+
"formItemContext": "setup-maybe-ref",
|
|
20
22
|
"CardSelectStyle": "setup-ref",
|
|
21
23
|
"isMultiple": "setup-ref",
|
|
22
24
|
"handleSelect": "setup-const"
|
|
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
|
|
|
26
28
|
import { has } from 'lodash-es';
|
|
27
29
|
import { computed, ref, watch } from 'vue';
|
|
28
30
|
import genCompoentStyle from './style';
|
|
31
|
+
import { Form } from 'ant-design-vue';
|
|
29
32
|
const __sfc_main__ = Object.assign({
|
|
30
33
|
name: 'JCardSelect'
|
|
31
34
|
}, {
|
|
@@ -66,6 +69,7 @@ const __sfc_main__ = Object.assign({
|
|
|
66
69
|
const selectKeys = ref([]);
|
|
67
70
|
const prefixCls = computed(() => 'j-card-select');
|
|
68
71
|
const [wrapSSR, hashId] = genCompoentStyle(prefixCls);
|
|
72
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
69
73
|
const CardSelectStyle = computed(() => {
|
|
70
74
|
const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
|
|
71
75
|
return {
|
|
@@ -100,6 +104,7 @@ const __sfc_main__ = Object.assign({
|
|
|
100
104
|
emit('change', key, node);
|
|
101
105
|
emit('update:value', key);
|
|
102
106
|
}
|
|
107
|
+
formItemContext.onFieldChange();
|
|
103
108
|
};
|
|
104
109
|
watch(() => props.value, () => {
|
|
105
110
|
selectKeys.value = isMultiple.value ? (props.value || []) : [props.value];
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"watch": "setup-const",
|
|
11
11
|
"isArray": "setup-maybe-ref",
|
|
12
12
|
"useCheckButtonStyle": "setup-maybe-ref",
|
|
13
|
+
"Form": "setup-maybe-ref",
|
|
13
14
|
"props": "setup-reactive-const",
|
|
14
15
|
"emit": "setup-const",
|
|
15
16
|
"prefixCls": "setup-ref",
|
|
16
17
|
"wrapSSR": "setup-maybe-ref",
|
|
17
18
|
"hashId": "setup-maybe-ref",
|
|
19
|
+
"formItemContext": "setup-maybe-ref",
|
|
18
20
|
"myValue": "setup-ref",
|
|
19
21
|
"optionsMap": "setup-ref",
|
|
20
22
|
"_options": "setup-ref",
|
|
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
|
|
|
26
28
|
import { computed, ref, watch } from 'vue';
|
|
27
29
|
import { isArray } from '@jetlinks-web/utils';
|
|
28
30
|
import useCheckButtonStyle from './style';
|
|
31
|
+
import { Form } from "ant-design-vue";
|
|
29
32
|
const __sfc_main__ = _defineComponent({
|
|
30
33
|
...{
|
|
31
34
|
name: 'JCheckButton'
|
|
@@ -63,6 +66,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
63
66
|
// 使用样式
|
|
64
67
|
const prefixCls = computed(() => 'j-check-button');
|
|
65
68
|
const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls);
|
|
69
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
66
70
|
const myValue = ref();
|
|
67
71
|
const optionsMap = ref(new Map());
|
|
68
72
|
const _options = computed(() => {
|
|
@@ -103,6 +107,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
103
107
|
emit('update:value', _value);
|
|
104
108
|
emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
105
109
|
emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
110
|
+
formItemContext.onFieldChange();
|
|
106
111
|
};
|
|
107
112
|
return (_ctx, _cache) => {
|
|
108
113
|
return (_openBlock(), _createElementBlock("div", {
|
|
@@ -369,10 +369,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
369
369
|
expandChange: expandChange
|
|
370
370
|
}, () => [
|
|
371
371
|
_createElementVNode("div", _hoisted_6, [
|
|
372
|
-
_createVNode(_unref(Button), {
|
|
373
|
-
type: "stroke",
|
|
374
|
-
onClick: reset
|
|
375
|
-
}, {
|
|
372
|
+
_createVNode(_unref(Button), { onClick: reset }, {
|
|
376
373
|
default: _withCtx(() => [
|
|
377
374
|
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
|
|
378
375
|
]),
|
package/es/Search/hooks/index.js
CHANGED
|
@@ -73,7 +73,7 @@ export var useHandleColumns = function useHandleColumns(props, terms, options) {
|
|
|
73
73
|
var initValues = function initValues() {
|
|
74
74
|
var arr = Object.values(columnsMap.value);
|
|
75
75
|
if (!arr.length) return;
|
|
76
|
-
if (options.mode === 'advanced') {
|
|
76
|
+
if ((options === null || options === void 0 ? void 0 : options.mode) === 'advanced') {
|
|
77
77
|
// 设置第一位
|
|
78
78
|
terms.terms = [getItemDefaultValue(arr[0], defaultCacheValues.value)];
|
|
79
79
|
} else {
|
package/es/VirtualTable/data.js
CHANGED
|
@@ -7,7 +7,11 @@ var _flattenTree = function flattenTree(tree) {
|
|
|
7
7
|
var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
8
8
|
return tree.flatMap(function (item) {
|
|
9
9
|
var _item$children;
|
|
10
|
+
var _children = (item.children || []).map(function (i) {
|
|
11
|
+
return _objectSpread({}, omit(i, 'children'));
|
|
12
|
+
});
|
|
10
13
|
var flatNode = _objectSpread(_objectSpread({}, omit(item, 'children')), {}, {
|
|
14
|
+
children: _children,
|
|
11
15
|
level: level,
|
|
12
16
|
parentId: parentId,
|
|
13
17
|
expanded: false,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
|
|
2
|
+
return lhs;
|
|
3
|
+
}
|
|
4
|
+
else {
|
|
5
|
+
return rhsFn();
|
|
6
|
+
} }
|
|
1
7
|
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
8
|
const op = ops[i];
|
|
3
9
|
const fn = ops[i + 1];
|
|
@@ -20,17 +26,24 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
20
26
|
"autoCompleteProps": "setup-maybe-ref",
|
|
21
27
|
"ref": "setup-const",
|
|
22
28
|
"watch": "setup-const",
|
|
29
|
+
"computed": "setup-const",
|
|
30
|
+
"omit": "setup-maybe-ref",
|
|
23
31
|
"props": "setup-reactive-const",
|
|
24
32
|
"emit": "setup-const",
|
|
25
|
-
"
|
|
33
|
+
"displayText": "setup-ref",
|
|
34
|
+
"selectedValue": "setup-ref",
|
|
35
|
+
"keyword": "setup-ref",
|
|
36
|
+
"filteredOptions": "setup-ref",
|
|
26
37
|
"onSearch": "setup-const",
|
|
27
|
-
"
|
|
38
|
+
"onSelect": "setup-const",
|
|
39
|
+
"onChange": "setup-const"
|
|
28
40
|
} */
|
|
29
41
|
import { defineComponent as _defineComponent } from 'vue';
|
|
30
|
-
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode,
|
|
42
|
+
import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
31
43
|
import { AutoComplete } from 'ant-design-vue';
|
|
32
44
|
import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
|
|
33
|
-
import { ref, watch } from 'vue';
|
|
45
|
+
import { ref, watch, computed } from 'vue';
|
|
46
|
+
import { omit } from "lodash-es";
|
|
34
47
|
const __sfc_main__ = _defineComponent({
|
|
35
48
|
...{
|
|
36
49
|
name: 'JAutoComplete'
|
|
@@ -42,38 +55,60 @@ const __sfc_main__ = _defineComponent({
|
|
|
42
55
|
default: 'label',
|
|
43
56
|
},
|
|
44
57
|
},
|
|
45
|
-
emits: ["select"],
|
|
58
|
+
emits: ["select", "change", "update:value"],
|
|
46
59
|
setup(__props, { emit: __emit }) {
|
|
47
60
|
const props = __props;
|
|
48
61
|
const emit = __emit;
|
|
49
|
-
const
|
|
62
|
+
const displayText = ref();
|
|
63
|
+
const selectedValue = ref();
|
|
64
|
+
const keyword = ref('');
|
|
65
|
+
const filteredOptions = computed(() => {
|
|
66
|
+
if (!keyword.value)
|
|
67
|
+
return props.options;
|
|
68
|
+
return props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
|
|
69
|
+
.includes(keyword.value));
|
|
70
|
+
});
|
|
50
71
|
/**
|
|
51
72
|
* 根据关键词提示
|
|
52
73
|
* @param searchText 关键词
|
|
53
74
|
*/
|
|
54
75
|
const onSearch = (searchText) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
keyword.value = searchText;
|
|
77
|
+
// _options.value = props.options?.filter(
|
|
78
|
+
// (item) => !!item[props.searchKey]?.includes(searchText),
|
|
79
|
+
// ) || [];
|
|
80
|
+
// if (!_options.value.length) {
|
|
81
|
+
// _options.value.unshift({ label: searchText, value: searchText });
|
|
82
|
+
// }
|
|
59
83
|
};
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
const onSelect = (val, option) => {
|
|
85
|
+
displayText.value = option.label;
|
|
86
|
+
emit('update:value', val);
|
|
87
|
+
emit('select', val, option);
|
|
88
|
+
};
|
|
89
|
+
const onChange = (val) => {
|
|
90
|
+
displayText.value = val;
|
|
91
|
+
keyword.value = val;
|
|
92
|
+
emit('update:value', '');
|
|
67
93
|
};
|
|
68
|
-
watch(() =>
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
watch(() => props.value, (val) => {
|
|
95
|
+
if (!val) {
|
|
96
|
+
displayText.value = '';
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
|
|
100
|
+
displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
|
|
101
|
+
}
|
|
71
102
|
}, { immediate: true });
|
|
72
103
|
return (_ctx, _cache) => {
|
|
73
|
-
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({
|
|
74
|
-
|
|
104
|
+
return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
|
|
105
|
+
style: { "width": "100%" },
|
|
106
|
+
value: displayText.value,
|
|
107
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
|
|
108
|
+
options: filteredOptions.value,
|
|
75
109
|
onSearch: onSearch,
|
|
76
|
-
|
|
110
|
+
onChange: onChange,
|
|
111
|
+
onSelect: onSelect
|
|
77
112
|
}), {
|
|
78
113
|
option: _withCtx(({ value, label }) => [
|
|
79
114
|
_renderSlot(_ctx.$slots, "option", { value: value }, () => [
|
|
@@ -84,7 +119,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
84
119
|
_renderSlot(_ctx.$slots, "default")
|
|
85
120
|
]),
|
|
86
121
|
_: 3 /* FORWARDED */
|
|
87
|
-
}, 16 /* FULL_PROPS */, ["options"]));
|
|
122
|
+
}, 16 /* FULL_PROPS */, ["value", "options"]));
|
|
88
123
|
};
|
|
89
124
|
}
|
|
90
125
|
});
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
"ref": "setup-const",
|
|
12
12
|
"watch": "setup-const",
|
|
13
13
|
"genCompoentStyle": "setup-maybe-ref",
|
|
14
|
+
"Form": "setup-maybe-ref",
|
|
14
15
|
"props": "setup-reactive-const",
|
|
15
16
|
"emit": "setup-const",
|
|
16
17
|
"selectKeys": "setup-ref",
|
|
17
18
|
"prefixCls": "setup-ref",
|
|
18
19
|
"wrapSSR": "setup-maybe-ref",
|
|
19
20
|
"hashId": "setup-maybe-ref",
|
|
21
|
+
"formItemContext": "setup-maybe-ref",
|
|
20
22
|
"CardSelectStyle": "setup-ref",
|
|
21
23
|
"isMultiple": "setup-ref",
|
|
22
24
|
"handleSelect": "setup-const"
|
|
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
|
|
|
26
28
|
import { has } from 'lodash-es';
|
|
27
29
|
import { computed, ref, watch } from 'vue';
|
|
28
30
|
import genCompoentStyle from './style';
|
|
31
|
+
import { Form } from 'ant-design-vue';
|
|
29
32
|
const __sfc_main__ = Object.assign({
|
|
30
33
|
name: 'JCardSelect'
|
|
31
34
|
}, {
|
|
@@ -66,6 +69,7 @@ const __sfc_main__ = Object.assign({
|
|
|
66
69
|
const selectKeys = ref([]);
|
|
67
70
|
const prefixCls = computed(() => 'j-card-select');
|
|
68
71
|
const [wrapSSR, hashId] = genCompoentStyle(prefixCls);
|
|
72
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
69
73
|
const CardSelectStyle = computed(() => {
|
|
70
74
|
const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
|
|
71
75
|
return {
|
|
@@ -100,6 +104,7 @@ const __sfc_main__ = Object.assign({
|
|
|
100
104
|
emit('change', key, node);
|
|
101
105
|
emit('update:value', key);
|
|
102
106
|
}
|
|
107
|
+
formItemContext.onFieldChange();
|
|
103
108
|
};
|
|
104
109
|
watch(() => props.value, () => {
|
|
105
110
|
selectKeys.value = isMultiple.value ? (props.value || []) : [props.value];
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"watch": "setup-const",
|
|
11
11
|
"isArray": "setup-maybe-ref",
|
|
12
12
|
"useCheckButtonStyle": "setup-maybe-ref",
|
|
13
|
+
"Form": "setup-maybe-ref",
|
|
13
14
|
"props": "setup-reactive-const",
|
|
14
15
|
"emit": "setup-const",
|
|
15
16
|
"prefixCls": "setup-ref",
|
|
16
17
|
"wrapSSR": "setup-maybe-ref",
|
|
17
18
|
"hashId": "setup-maybe-ref",
|
|
19
|
+
"formItemContext": "setup-maybe-ref",
|
|
18
20
|
"myValue": "setup-ref",
|
|
19
21
|
"optionsMap": "setup-ref",
|
|
20
22
|
"_options": "setup-ref",
|
|
@@ -26,6 +28,7 @@ const _hoisted_1 = ["onClick"];
|
|
|
26
28
|
import { computed, ref, watch } from 'vue';
|
|
27
29
|
import { isArray } from '@jetlinks-web/utils';
|
|
28
30
|
import useCheckButtonStyle from './style';
|
|
31
|
+
import { Form } from "ant-design-vue";
|
|
29
32
|
const __sfc_main__ = _defineComponent({
|
|
30
33
|
...{
|
|
31
34
|
name: 'JCheckButton'
|
|
@@ -63,6 +66,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
63
66
|
// 使用样式
|
|
64
67
|
const prefixCls = computed(() => 'j-check-button');
|
|
65
68
|
const [wrapSSR, hashId] = useCheckButtonStyle(prefixCls);
|
|
69
|
+
const formItemContext = Form.useInjectFormItemContext();
|
|
66
70
|
const myValue = ref();
|
|
67
71
|
const optionsMap = ref(new Map());
|
|
68
72
|
const _options = computed(() => {
|
|
@@ -103,6 +107,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
103
107
|
emit('update:value', _value);
|
|
104
108
|
emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
105
109
|
emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
110
|
+
formItemContext.onFieldChange();
|
|
106
111
|
};
|
|
107
112
|
return (_ctx, _cache) => {
|
|
108
113
|
return (_openBlock(), _createElementBlock("div", {
|
|
@@ -369,10 +369,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
369
369
|
expandChange: expandChange
|
|
370
370
|
}, () => [
|
|
371
371
|
_createElementVNode("div", _hoisted_6, [
|
|
372
|
-
_createVNode(_unref(Button), {
|
|
373
|
-
type: "stroke",
|
|
374
|
-
onClick: reset
|
|
375
|
-
}, {
|
|
372
|
+
_createVNode(_unref(Button), { onClick: reset }, {
|
|
376
373
|
default: _withCtx(() => [
|
|
377
374
|
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
|
|
378
375
|
]),
|
|
@@ -121,7 +121,7 @@ var useHandleColumns = exports.useHandleColumns = function useHandleColumns(prop
|
|
|
121
121
|
var initValues = function initValues() {
|
|
122
122
|
var arr = Object.values(columnsMap.value);
|
|
123
123
|
if (!arr.length) return;
|
|
124
|
-
if (options.mode === 'advanced') {
|
|
124
|
+
if ((options === null || options === void 0 ? void 0 : options.mode) === 'advanced') {
|
|
125
125
|
// 设置第一位
|
|
126
126
|
terms.terms = [(0, _util.getItemDefaultValue)(arr[0], defaultCacheValues.value)];
|
|
127
127
|
} else {
|
package/lib/VirtualTable/data.js
CHANGED
|
@@ -15,7 +15,11 @@ var _flattenTree = exports.flattenTree = function flattenTree(tree) {
|
|
|
15
15
|
var parentId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
16
16
|
return tree.flatMap(function (item) {
|
|
17
17
|
var _item$children;
|
|
18
|
+
var _children = (item.children || []).map(function (i) {
|
|
19
|
+
return (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(i, 'children'));
|
|
20
|
+
});
|
|
18
21
|
var flatNode = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodashEs.omit)(item, 'children')), {}, {
|
|
22
|
+
children: _children,
|
|
19
23
|
level: level,
|
|
20
24
|
parentId: parentId,
|
|
21
25
|
expanded: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -155,8 +155,8 @@
|
|
|
155
155
|
"webpack-merge": "^5.0.0",
|
|
156
156
|
"webpackbar": "^5.0.2",
|
|
157
157
|
"@jetlinks-web/constants": "^1.0.9",
|
|
158
|
-
"@jetlinks-web/
|
|
159
|
-
"@jetlinks-web/
|
|
158
|
+
"@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/",
|