@chaoswise/ui 2.6.8 → 2.7.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/lib/Antd3/es/card/index.js +1 -1
- package/lib/Antd3/es/checkbox/Checkbox.js +1 -1
- package/lib/Antd3/es/list/Item.js +1 -1
- package/lib/Antd3/es/radio/radio.js +1 -1
- package/lib/Antd3/es/skeleton/Paragraph.js +1 -1
- package/lib/Antd4/card/index.js +1 -1
- package/lib/Antd4/checkbox/Checkbox.js +1 -1
- package/lib/Antd4/collapse/Collapse.js +1 -1
- package/lib/Antd4/list/Item.js +1 -1
- package/lib/Antd4/radio/radio.js +1 -1
- package/lib/Antd4/skeleton/Paragraph.js +1 -1
- package/lib/CWMessage/index.js +45 -3
- package/lib/CWMessage/locale/en_US.js +3 -1
- package/lib/CWMessage/locale/zh_CN.js +3 -1
- package/lib/CWMessage/locale/zh_TW.js +3 -1
- package/lib/CWRangePicker/Refresh/index.js +45 -33
- package/lib/CWRangePicker/TimeSpan/index.js +10 -3
- package/lib/CWRangePicker/index.js +160 -126
- package/lib/CWRangePicker/index.less +65 -55
- package/lib/CWRangePicker/utils/index.js +32 -63
- package/lib/CWSelect/index.less +94 -92
- package/lib/QuickTransfer/index.js +45 -59
- package/lib/SearchBar/OutSearch.js +5 -1
- package/lib/SearchBar/index.js +5 -1
- package/lib/SingleSpa/import-html/process-tpl.js +5 -5
- package/package.json +2 -2
|
@@ -22,13 +22,6 @@ var ENUM_TimeUnit = {
|
|
|
22
22
|
mo: ["Month", "Months", "月", "mo"],
|
|
23
23
|
y: ["Year", "Years", "年", "years"]
|
|
24
24
|
};
|
|
25
|
-
var EnumTimeType = {
|
|
26
|
-
recently: "recentlyArray",
|
|
27
|
-
relative: "relativeArray",
|
|
28
|
-
absolute: "absoluteArray",
|
|
29
|
-
unixTimestamp: "unixTimestampArray",
|
|
30
|
-
other: "otherArray"
|
|
31
|
-
};
|
|
32
25
|
|
|
33
26
|
/**
|
|
34
27
|
* 变换数据源格式
|
|
@@ -36,25 +29,27 @@ var EnumTimeType = {
|
|
|
36
29
|
* @returns 重新编排组合的数据源
|
|
37
30
|
*/
|
|
38
31
|
export var regroupDataSourceFn = function regroupDataSourceFn(dataSource) {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
var EnumTimeTypeData = {
|
|
33
|
+
recently: [],
|
|
34
|
+
relative: [],
|
|
35
|
+
absolute: [],
|
|
36
|
+
unixTimestamp: [],
|
|
37
|
+
other: []
|
|
38
|
+
};
|
|
44
39
|
var regroupDataSource = [];
|
|
45
40
|
dataSource.forEach(function (item) {
|
|
46
|
-
if (
|
|
47
|
-
|
|
41
|
+
if (Object.keys(EnumTimeTypeData).includes(item.type)) {
|
|
42
|
+
EnumTimeTypeData[item.type].push(item);
|
|
48
43
|
} else {
|
|
49
|
-
|
|
44
|
+
EnumTimeTypeData["other"].push(item);
|
|
50
45
|
}
|
|
51
46
|
});
|
|
52
|
-
Object.entries(
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
Object.entries(EnumTimeTypeData).forEach(function (item) {
|
|
48
|
+
if (item[1].length) {
|
|
49
|
+
regroupDataSource.push({
|
|
50
|
+
type: item[0],
|
|
51
|
+
timeList: item[1]
|
|
52
|
+
});
|
|
58
53
|
}
|
|
59
54
|
});
|
|
60
55
|
return regroupDataSource;
|
|
@@ -139,53 +134,27 @@ export var echoInputValue = function echoInputValue() {
|
|
|
139
134
|
var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "zh_CN";
|
|
140
135
|
var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "YYYY/MM/DD HH:mm:ss";
|
|
141
136
|
var forceRenderTitle = arguments.length > 4 ? arguments[4] : undefined;
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
|
|
137
|
+
var timeSpanBoundary = arguments.length > 5 ? arguments[5] : undefined;
|
|
138
|
+
var isSpecialRelativeTime = arguments.length > 6 ? arguments[6] : undefined;
|
|
139
|
+
var _defaultValue = arguments.length > 7 ? arguments[7] : undefined;
|
|
140
|
+
var title = recordDateValue.title,
|
|
141
|
+
type = recordDateValue.type;
|
|
146
142
|
var _judgeType = judgeType(recordDateValue),
|
|
147
|
-
_judgeType2 = _slicedToArray(_judgeType,
|
|
143
|
+
_judgeType2 = _slicedToArray(_judgeType, 2),
|
|
148
144
|
isRule = _judgeType2[0],
|
|
149
|
-
captureUnit = _judgeType2[1]
|
|
150
|
-
recordUnit = _judgeType2[2];
|
|
151
|
-
var value = [];
|
|
152
|
-
if (values) {
|
|
153
|
-
value = funcValueChangeArrayValue(values);
|
|
154
|
-
}
|
|
145
|
+
captureUnit = _judgeType2[1];
|
|
155
146
|
if (forceRenderTitle) {
|
|
156
|
-
var _value2;
|
|
157
147
|
if (title) return title;
|
|
158
|
-
if (isRule) {
|
|
159
|
-
return echoRecentlyTimeTitle(locale, captureUnit);
|
|
160
|
-
}
|
|
161
|
-
if (Array.isArray(value) && (_value2 = value) !== null && _value2 !== void 0 && _value2.length) {
|
|
162
|
-
return echoAbsoluteTimeTitle(value, format, true, timeSpanBoundary);
|
|
163
|
-
}
|
|
164
|
-
return "";
|
|
165
148
|
}
|
|
166
|
-
if (!isRule && !
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (Array.isArray(value) && (_value3 = value) !== null && _value3 !== void 0 && _value3.length) {
|
|
176
|
-
return echoAbsoluteTimeTitle(value, format, true, timeSpanBoundary);
|
|
177
|
-
}
|
|
178
|
-
} else {
|
|
179
|
-
var _value4;
|
|
180
|
-
if (isRule) {
|
|
181
|
-
if (isFoucs) {
|
|
182
|
-
return recordUnit;
|
|
183
|
-
}
|
|
184
|
-
return echoRecentlyTimeTitle(locale, captureUnit);
|
|
185
|
-
}
|
|
186
|
-
if (Array.isArray(value) && (_value4 = value) !== null && _value4 !== void 0 && _value4.length) {
|
|
187
|
-
return echoAbsoluteTimeTitle(value, format, true, timeSpanBoundary);
|
|
188
|
-
}
|
|
149
|
+
if (!isRule && !_defaultValue) return title || "Live Tail";
|
|
150
|
+
if (type === "relative" && isSpecialRelativeTime && !isFoucs) {
|
|
151
|
+
return title;
|
|
152
|
+
}
|
|
153
|
+
if (isRule && !isFoucs) {
|
|
154
|
+
return echoRecentlyTimeTitle(locale, captureUnit);
|
|
155
|
+
}
|
|
156
|
+
if (Array.isArray(_defaultValue) && _defaultValue !== null && _defaultValue !== void 0 && _defaultValue.length) {
|
|
157
|
+
return echoAbsoluteTimeTitle(_defaultValue, format, true, timeSpanBoundary);
|
|
189
158
|
}
|
|
190
159
|
};
|
|
191
160
|
|
package/lib/CWSelect/index.less
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import '../Antd4/select/style/index.less';
|
|
4
4
|
@select-prefix-cls: ~'@{ant-prefix}-select';
|
|
5
5
|
@tree-select-prefix-cls: ~'@{ant-prefix}-tree-select';
|
|
6
|
-
@selection-item-padding: 20px;
|
|
6
|
+
// @selection-item-padding: 20px;
|
|
7
7
|
.cw-select-tag-dropdown{
|
|
8
8
|
max-width: 200px;
|
|
9
9
|
// 这两个一起会导致气泡下面有黑色padding
|
|
@@ -590,6 +590,98 @@
|
|
|
590
590
|
border-right-width: @border-width-base !important;
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
+
|
|
594
|
+
// UI规范
|
|
595
|
+
.@{select-prefix-cls}.@{select-prefix-cls}-sm {
|
|
596
|
+
&.@{select-prefix-cls}-single {
|
|
597
|
+
.@{select-prefix-cls}-selector{
|
|
598
|
+
height: @input-height-sm;
|
|
599
|
+
.@{select-prefix-cls}-selection-search-input{
|
|
600
|
+
height: @input-height-sm - 2px;
|
|
601
|
+
line-height: @input-height-sm - 2px;
|
|
602
|
+
}
|
|
603
|
+
.@{select-prefix-cls}-selection-placeholder,.@{select-prefix-cls}-selection-item{
|
|
604
|
+
height: @input-height-sm - 2px;
|
|
605
|
+
line-height: @input-height-sm - 2px;
|
|
606
|
+
}
|
|
607
|
+
.@{select-prefix-cls}-selection-search{
|
|
608
|
+
left: 7px;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&.@{select-prefix-cls}-multiple {
|
|
614
|
+
.@{select-prefix-cls}-selector{
|
|
615
|
+
min-height: @input-height-sm;
|
|
616
|
+
// padding: 0 9px;
|
|
617
|
+
line-height: 22px;
|
|
618
|
+
.@{select-prefix-cls}-selection-search{
|
|
619
|
+
margin: 0;
|
|
620
|
+
}
|
|
621
|
+
.@{select-prefix-cls}-selection-search-input, .@{select-prefix-cls}-selection-search-mirror, .cw-select-selection-item{
|
|
622
|
+
height: @input-height-sm - 8px;
|
|
623
|
+
line-height: @input-height-sm - 10px;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
.@{select-prefix-cls}-clear,
|
|
628
|
+
.@{select-prefix-cls}-arrow {
|
|
629
|
+
right: @control-padding-horizontal-sm;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// UI规范
|
|
634
|
+
.@{select-prefix-cls}.@{select-prefix-cls}-lg {
|
|
635
|
+
font-size: 14px; // 大号字体大小
|
|
636
|
+
&.@{select-prefix-cls}-single {
|
|
637
|
+
.@{select-prefix-cls}-selector{
|
|
638
|
+
height: @input-height-lg;
|
|
639
|
+
.@{select-prefix-cls}-selection-search-input{
|
|
640
|
+
height: @input-height-lg - 2px;
|
|
641
|
+
line-height: @input-height-lg - 2px;
|
|
642
|
+
}
|
|
643
|
+
.@{select-prefix-cls}-selection-placeholder,.@{select-prefix-cls}-selection-item{
|
|
644
|
+
height: @input-height-lg - 2px;
|
|
645
|
+
line-height: @input-height-lg - 2px;
|
|
646
|
+
}
|
|
647
|
+
.@{select-prefix-cls}-selection-search{
|
|
648
|
+
left: 11px;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
&.@{select-prefix-cls}-multiple {
|
|
653
|
+
.@{select-prefix-cls}-selector{
|
|
654
|
+
min-height: @input-height-lg;
|
|
655
|
+
line-height: @input-height-lg - 2px;
|
|
656
|
+
.@{select-prefix-cls}-selection-search{
|
|
657
|
+
margin: 0;
|
|
658
|
+
}
|
|
659
|
+
.@{select-prefix-cls}-selection-search-input, .@{select-prefix-cls}-selection-search-mirror, .cw-select-selection-item{
|
|
660
|
+
height: @input-height-lg - 8px;
|
|
661
|
+
line-height: @input-height-lg - 8px;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
.cw-select-item-tooltip{
|
|
667
|
+
.@{ant-prefix}-tooltip-content{
|
|
668
|
+
.@{ant-prefix}-tooltip-inner{
|
|
669
|
+
.@{ant-prefix}-checkbox-wrapper{
|
|
670
|
+
display: none;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
.cw-select-show-checkbox-empty{
|
|
676
|
+
display: flex;
|
|
677
|
+
justify-content: center;
|
|
678
|
+
padding: 9px 0;
|
|
679
|
+
align-items: center;
|
|
680
|
+
line-height: 20px;
|
|
681
|
+
color: @text-color-secondary;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
|
|
593
685
|
.@{select-prefix-cls}-dropdown{
|
|
594
686
|
margin: 0;
|
|
595
687
|
color: @text-color;
|
|
@@ -654,7 +746,7 @@
|
|
|
654
746
|
padding-left: @control-padding-horizontal;
|
|
655
747
|
}
|
|
656
748
|
.@{select-prefix-cls}-item-option-active:not(.@{select-prefix-cls}-item-option-disabled){
|
|
657
|
-
background-color: @
|
|
749
|
+
background-color: @select-item-active-bg;
|
|
658
750
|
}
|
|
659
751
|
.@{select-prefix-cls}-item-option.@{select-prefix-cls}-item-option-selected:not(.@{select-prefix-cls}-item-option-disabled){
|
|
660
752
|
color: @select-selected-enable-color; // UI规范
|
|
@@ -723,93 +815,3 @@
|
|
|
723
815
|
}
|
|
724
816
|
}
|
|
725
817
|
}
|
|
726
|
-
|
|
727
|
-
// UI规范
|
|
728
|
-
.@{select-prefix-cls}.@{select-prefix-cls}-sm {
|
|
729
|
-
&.@{select-prefix-cls}-single {
|
|
730
|
-
.@{select-prefix-cls}-selector{
|
|
731
|
-
height: @input-height-sm;
|
|
732
|
-
.@{select-prefix-cls}-selection-search-input{
|
|
733
|
-
height: @input-height-sm - 2px;
|
|
734
|
-
line-height: @input-height-sm - 2px;
|
|
735
|
-
}
|
|
736
|
-
.@{select-prefix-cls}-selection-placeholder,.@{select-prefix-cls}-selection-item{
|
|
737
|
-
height: @input-height-sm - 2px;
|
|
738
|
-
line-height: @input-height-sm - 2px;
|
|
739
|
-
}
|
|
740
|
-
.@{select-prefix-cls}-selection-search{
|
|
741
|
-
left: 7px;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
&.@{select-prefix-cls}-multiple {
|
|
747
|
-
.@{select-prefix-cls}-selector{
|
|
748
|
-
min-height: @input-height-sm;
|
|
749
|
-
// padding: 0 9px;
|
|
750
|
-
line-height: 22px;
|
|
751
|
-
.@{select-prefix-cls}-selection-search{
|
|
752
|
-
margin: 0;
|
|
753
|
-
}
|
|
754
|
-
.@{select-prefix-cls}-selection-search-input, .@{select-prefix-cls}-selection-search-mirror, .cw-select-selection-item{
|
|
755
|
-
height: @input-height-sm - 8px;
|
|
756
|
-
line-height: @input-height-sm - 10px;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
.@{select-prefix-cls}-clear,
|
|
761
|
-
.@{select-prefix-cls}-arrow {
|
|
762
|
-
right: @control-padding-horizontal-sm;
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
// UI规范
|
|
767
|
-
.@{select-prefix-cls}.@{select-prefix-cls}-lg {
|
|
768
|
-
font-size: 14px; // 大号字体大小
|
|
769
|
-
&.@{select-prefix-cls}-single {
|
|
770
|
-
.@{select-prefix-cls}-selector{
|
|
771
|
-
height: @input-height-lg;
|
|
772
|
-
.@{select-prefix-cls}-selection-search-input{
|
|
773
|
-
height: @input-height-lg - 2px;
|
|
774
|
-
line-height: @input-height-lg - 2px;
|
|
775
|
-
}
|
|
776
|
-
.@{select-prefix-cls}-selection-placeholder,.@{select-prefix-cls}-selection-item{
|
|
777
|
-
height: @input-height-lg - 2px;
|
|
778
|
-
line-height: @input-height-lg - 2px;
|
|
779
|
-
}
|
|
780
|
-
.@{select-prefix-cls}-selection-search{
|
|
781
|
-
left: 11px;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
&.@{select-prefix-cls}-multiple {
|
|
786
|
-
.@{select-prefix-cls}-selector{
|
|
787
|
-
min-height: @input-height-lg;
|
|
788
|
-
line-height: @input-height-lg - 2px;
|
|
789
|
-
.@{select-prefix-cls}-selection-search{
|
|
790
|
-
margin: 0;
|
|
791
|
-
}
|
|
792
|
-
.@{select-prefix-cls}-selection-search-input, .@{select-prefix-cls}-selection-search-mirror, .cw-select-selection-item{
|
|
793
|
-
height: @input-height-lg - 8px;
|
|
794
|
-
line-height: @input-height-lg - 8px;
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
.cw-select-item-tooltip{
|
|
800
|
-
.@{ant-prefix}-tooltip-content{
|
|
801
|
-
.@{ant-prefix}-tooltip-inner{
|
|
802
|
-
.@{ant-prefix}-checkbox-wrapper{
|
|
803
|
-
display: none;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
.cw-select-show-checkbox-empty{
|
|
809
|
-
display: flex;
|
|
810
|
-
justify-content: center;
|
|
811
|
-
padding: 9px 0;
|
|
812
|
-
align-items: center;
|
|
813
|
-
line-height: 20px;
|
|
814
|
-
color: @text-color-secondary;
|
|
815
|
-
}
|
|
@@ -36,7 +36,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
36
36
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
37
37
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
38
38
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
39
|
-
import React, { useState, useEffect, Fragment, forwardRef, useMemo } from "react";
|
|
39
|
+
import React, { useState, useEffect, Fragment, forwardRef, useMemo, useCallback } from "react";
|
|
40
40
|
import { filterTreeByName, filterTree, filterTreeByNameTable, filterObj, getNotSelectKeys, getKeysAndTitle, getBottomKey, renderLeafNodetree, renderRelationNode, createTitle } from "./utils";
|
|
41
41
|
import classnames from "classnames";
|
|
42
42
|
import Drag from "./Drag";
|
|
@@ -257,21 +257,6 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
257
257
|
return !i.disabled;
|
|
258
258
|
}));
|
|
259
259
|
setCheckValue(finalCheckValue);
|
|
260
|
-
var newData = [];
|
|
261
|
-
var listCheckedKeys_ = [];
|
|
262
|
-
dataSource.forEach(function (item, index) {
|
|
263
|
-
if (isMath(item.title, saveSearchValueLeft)) {
|
|
264
|
-
newData.push(dataSource[index]);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
listCheckedKeys_ = newData.filter(function (item) {
|
|
268
|
-
return finalCheckValue.find(function (i) {
|
|
269
|
-
return i.key == item.key;
|
|
270
|
-
});
|
|
271
|
-
}).map(function (item) {
|
|
272
|
-
return item.key;
|
|
273
|
-
});
|
|
274
|
-
setListCheckedStyle(listCheckedKeys_, newData);
|
|
275
260
|
}
|
|
276
261
|
//回显table
|
|
277
262
|
if (type === "table") {
|
|
@@ -287,19 +272,51 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
287
272
|
}
|
|
288
273
|
}
|
|
289
274
|
}
|
|
290
|
-
}, [targetKeys, dataSource
|
|
291
|
-
//触发前端自定义搜索
|
|
275
|
+
}, [targetKeys, dataSource]);
|
|
292
276
|
useEffect(function () {
|
|
293
|
-
|
|
294
|
-
|
|
277
|
+
// 左侧受控值绑定
|
|
278
|
+
if (searchValueLeft !== undefined && searchValueLeft !== saveSearchValueLeft) {
|
|
295
279
|
// 初始化搜索结果
|
|
296
280
|
setSaveSearchValueLeft(searchValueLeft);
|
|
297
281
|
}
|
|
298
|
-
|
|
282
|
+
}, [searchValueLeft, saveSearchValueLeft]);
|
|
283
|
+
useEffect(function () {
|
|
284
|
+
// 右侧受控值绑定
|
|
285
|
+
if (searchValueRight !== undefined && searchValueRight !== saveSearchValueRight) {
|
|
299
286
|
// 初始化搜索结果
|
|
300
287
|
setSaveSearchValueRight(searchValueRight);
|
|
301
288
|
}
|
|
302
|
-
}, [
|
|
289
|
+
}, [searchValueRight, saveSearchValueRight]);
|
|
290
|
+
|
|
291
|
+
// 左侧搜索框输入触发
|
|
292
|
+
var handleSearch = useCallback(function (searchValue) {
|
|
293
|
+
var newData = [];
|
|
294
|
+
var listCheckedKeys_ = [];
|
|
295
|
+
if (type === "list") {
|
|
296
|
+
dataSource.forEach(function (item, index) {
|
|
297
|
+
if (isMath(item.title, searchValue)) {
|
|
298
|
+
newData.push(dataSource[index]);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
listCheckedKeys_ = newData.filter(function (item) {
|
|
302
|
+
return checkValue.find(function (i) {
|
|
303
|
+
return i.key == item.key;
|
|
304
|
+
});
|
|
305
|
+
}).map(function (item) {
|
|
306
|
+
return item.key;
|
|
307
|
+
});
|
|
308
|
+
setData(newData);
|
|
309
|
+
setListCheckedStyle(listCheckedKeys_, newData);
|
|
310
|
+
}
|
|
311
|
+
if (type === "table") {
|
|
312
|
+
newData = filterTreeByNameTable(dataSource, searchValue, searchColumns ? searchColumns : newSearchColumns);
|
|
313
|
+
setData(newData);
|
|
314
|
+
}
|
|
315
|
+
}, [dataSource, checkValue]);
|
|
316
|
+
useEffect(function () {
|
|
317
|
+
handleSearch(saveSearchValueLeft);
|
|
318
|
+
}, [handleSearch, saveSearchValueLeft]);
|
|
319
|
+
|
|
303
320
|
//获取左侧列表选中的key
|
|
304
321
|
useEffect(function () {
|
|
305
322
|
if (getTargetKeys) {
|
|
@@ -347,35 +364,6 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
347
364
|
setIndeterminate(!!listCheckedKeys.length && listCheckedKeys.length < dataSource.length);
|
|
348
365
|
setCheckAll(listCheckedKeys.length === dataSource.length);
|
|
349
366
|
};
|
|
350
|
-
// 左侧搜索框输入触发
|
|
351
|
-
var handleSearch = function handleSearch(searchValue) {
|
|
352
|
-
var newData = [];
|
|
353
|
-
var listCheckedKeys_ = [];
|
|
354
|
-
if (type === "list") {
|
|
355
|
-
dataSource.forEach(function (item, index) {
|
|
356
|
-
if (isMath(item.title, searchValue)) {
|
|
357
|
-
newData.push(dataSource[index]);
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
listCheckedKeys_ = newData.filter(function (item) {
|
|
361
|
-
return checkValue.find(function (i) {
|
|
362
|
-
return i.key == item.key;
|
|
363
|
-
});
|
|
364
|
-
}).map(function (item) {
|
|
365
|
-
return item.key;
|
|
366
|
-
});
|
|
367
|
-
setData(newData);
|
|
368
|
-
setListCheckedStyle(listCheckedKeys_, newData);
|
|
369
|
-
}
|
|
370
|
-
// if (type === "tree") {
|
|
371
|
-
// newData = filterTree(dataSource, searchValue);
|
|
372
|
-
// setData(newData);
|
|
373
|
-
// }
|
|
374
|
-
if (type === "table") {
|
|
375
|
-
newData = filterTreeByNameTable(dataSource, searchValue, searchColumns ? searchColumns : newSearchColumns);
|
|
376
|
-
setData(newData);
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
367
|
|
|
380
368
|
//type为list 左侧列表选中触发的事件
|
|
381
369
|
var onChangeChecked = function onChangeChecked(e, value) {
|
|
@@ -595,17 +583,15 @@ var QuickTransfer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
595
583
|
var showSearchChange = function showSearchChange(e) {
|
|
596
584
|
onSearchChange && onSearchChange(e);
|
|
597
585
|
onLeftSearchChange && onLeftSearchChange(e);
|
|
598
|
-
//
|
|
599
|
-
if (searchValueLeft === undefined) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
586
|
+
// 保存搜索结果,实时保存不然受控模式中文会有问题
|
|
587
|
+
// if (searchValueLeft === undefined) {
|
|
588
|
+
setSaveSearchValueLeft(e.target.value);
|
|
589
|
+
// handleSearch(e.target.value);
|
|
590
|
+
// }
|
|
603
591
|
};
|
|
604
592
|
var showSearchChangeRight = function showSearchChangeRight(e) {
|
|
605
593
|
onRightSearchChange(e);
|
|
606
|
-
|
|
607
|
-
setSaveSearchValueRight(e.target.value);
|
|
608
|
-
}
|
|
594
|
+
setSaveSearchValueRight(e.target.value);
|
|
609
595
|
};
|
|
610
596
|
// 全选状态改变触发
|
|
611
597
|
var onCheckAllChange = function onCheckAllChange(e) {
|
|
@@ -67,7 +67,11 @@ function OutSearch(_ref) {
|
|
|
67
67
|
}, isFunc ? getFieldDecorator(child.components(form).props.id, child.formAttribute && child.formAttribute)(child.components(form)) : getFieldDecorator(child.components.props.id, child.formAttribute && child.formAttribute)(child.components));
|
|
68
68
|
};
|
|
69
69
|
return /*#__PURE__*/React.createElement(_Form, {
|
|
70
|
-
className: "cw-searchbar-outform"
|
|
70
|
+
className: "cw-searchbar-outform",
|
|
71
|
+
onSubmit: function onSubmit(e) {
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
}
|
|
71
75
|
}, /*#__PURE__*/React.createElement(_Row, {
|
|
72
76
|
type: "flex",
|
|
73
77
|
className: "cw-search-main",
|
package/lib/SearchBar/index.js
CHANGED
|
@@ -452,7 +452,11 @@ var SearchBar = function SearchBar(props) {
|
|
|
452
452
|
marginLeft: "8px"
|
|
453
453
|
}
|
|
454
454
|
})) : null)), /*#__PURE__*/React.createElement(_Form, {
|
|
455
|
-
layout: "vertical"
|
|
455
|
+
layout: "vertical",
|
|
456
|
+
onSubmit: function onSubmit(e) {
|
|
457
|
+
e.stopPropagation();
|
|
458
|
+
e.preventDefault();
|
|
459
|
+
}
|
|
456
460
|
}, /*#__PURE__*/React.createElement(_Row, {
|
|
457
461
|
className: "cw-search-expand",
|
|
458
462
|
style: {
|
|
@@ -6,14 +6,14 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
7
|
import { getInlineCode, isModuleScriptSupported } from './utils';
|
|
8
8
|
var ALL_SCRIPT_REGEX = /(<script[\s\S]*?>)[\s\S]*?<\/script>/gi;
|
|
9
|
-
var SCRIPT_TAG_REGEX = /<(script)\s+((?!type=('|")text\/ng\
|
|
9
|
+
var SCRIPT_TAG_REGEX = /<(script)\s+((?!type=('|")text\/ng-template\3)[^])*?>[^]*?<\/\1>/i;
|
|
10
10
|
var SCRIPT_SRC_REGEX = /.*\ssrc=('|")?([^>'"\s]+)/;
|
|
11
11
|
var SCRIPT_TYPE_REGEX = /.*\stype=('|")?([^>'"\s]+)/;
|
|
12
12
|
var SCRIPT_ENTRY_REGEX = /.*\sentry\s*.*/;
|
|
13
13
|
var SCRIPT_ASYNC_REGEX = /.*\sasync\s*.*/;
|
|
14
14
|
var SCRIPT_NO_MODULE_REGEX = /.*\snomodule\s*.*/;
|
|
15
15
|
var SCRIPT_MODULE_REGEX = /.*\stype=('|")?module('|")?\s*.*/;
|
|
16
|
-
var LINK_TAG_REGEX = /<(link)\s+[
|
|
16
|
+
var LINK_TAG_REGEX = /<(link)\s+[^]*?>/ig;
|
|
17
17
|
var LINK_PRELOAD_OR_PREFETCH_REGEX = /\srel=('|")?(preload|prefetch)\1/;
|
|
18
18
|
var LINK_HREF_REGEX = /.*\shref=('|")?([^>'"\s]+)/;
|
|
19
19
|
var LINK_AS_FONT = /.*\sas=('|")?font\1.*/;
|
|
@@ -21,9 +21,9 @@ var STYLE_TAG_REGEX = /<style[^>]*>[\s\S]*?<\/style>/gi;
|
|
|
21
21
|
var STYLE_TYPE_REGEX = /\s+rel=('|")?stylesheet\1.*/;
|
|
22
22
|
var STYLE_HREF_REGEX = /.*\shref=('|")?([^>'"\s]+)/;
|
|
23
23
|
var HTML_COMMENT_REGEX = /<!--([\s\S]*?)-->/g;
|
|
24
|
-
var LINK_IGNORE_REGEX = /<link(\s+|\s+[
|
|
25
|
-
var STYLE_IGNORE_REGEX = /<style(\s+|\s+[
|
|
26
|
-
var SCRIPT_IGNORE_REGEX = /<script(\s+|\s+[
|
|
24
|
+
var LINK_IGNORE_REGEX = /<link(\s+|\s+[^]+\s+)ignore(\s*|\s+[^]*|=[^]*)>/i;
|
|
25
|
+
var STYLE_IGNORE_REGEX = /<style(\s+|\s+[^]+\s+)ignore(\s*|\s+[^]*|=[^]*)>/i;
|
|
26
|
+
var SCRIPT_IGNORE_REGEX = /<script(\s+|\s+[^]+\s+)ignore(\s*|\s+[^]*|=[^]*)>/i;
|
|
27
27
|
function hasProtocol(url) {
|
|
28
28
|
return url.startsWith('//') || url.startsWith('http://') || url.startsWith('https://');
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "公共UI库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"access": "public"
|
|
150
150
|
},
|
|
151
151
|
"license": "MIT",
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "98a698c55784d5f5c66170f949f6d1b41bca1563"
|
|
153
153
|
}
|