@chaoswise/ui 2.6.9 → 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.
@@ -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 recentlyArray = [];
40
- var relativeArray = [];
41
- var absoluteArray = [];
42
- var unixTimestampArray = [];
43
- var otherArray = [];
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 (EnumTimeType[item.type]) {
47
- eval(EnumTimeType[item.type]).push(item);
41
+ if (Object.keys(EnumTimeTypeData).includes(item.type)) {
42
+ EnumTimeTypeData[item.type].push(item);
48
43
  } else {
49
- eval(EnumTimeType["other"]).push(item);
44
+ EnumTimeTypeData["other"].push(item);
50
45
  }
51
46
  });
52
- Object.entries(EnumTimeType).map(function (item) {
53
- if (eval(item[1]).length) {
54
- var newObj = {};
55
- newObj.type = item[0];
56
- newObj.timeList = eval(item[1]);
57
- regroupDataSource.push(newObj);
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 isAutoRefresh = arguments.length > 5 ? arguments[5] : undefined;
143
- var timeSpanBoundary = arguments.length > 6 ? arguments[6] : undefined;
144
- var values = recordDateValue.value,
145
- title = recordDateValue.title;
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, 3),
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 && !values) return title || "Live Tail";
167
- if (isAutoRefresh) {
168
- var _value3;
169
- if (isRule) {
170
- if (isFoucs) {
171
- return recordUnit;
172
- }
173
- return echoRecentlyTimeTitle(locale, captureUnit);
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
 
@@ -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: @component-background;
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
- }
@@ -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",
@@ -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\x2Dtemplate\3)[\s\S])*?>[\s\S]*?<\/\1>/i;
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+[\s\S]*?>/ig;
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+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i;
25
- var STYLE_IGNORE_REGEX = /<style(\s+|\s+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i;
26
- var SCRIPT_IGNORE_REGEX = /<script(\s+|\s+[\s\S]+\s+)ignore(\s*|\s+[\s\S]*|=[\s\S]*)>/i;
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.6.9",
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": "b2d08aba1d82098b6b14d2086af3d1cc8262dcd8"
152
+ "gitHead": "98a698c55784d5f5c66170f949f6d1b41bca1563"
153
153
  }