@vtx/components 3.1.85 → 3.1.88
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/_util/filterSpecialCharacters.js +55 -44
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +1 -4
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getToken.js +7 -15
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +1 -8
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +0 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +0 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useColSize.js +2 -12
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js +0 -3
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +23 -39
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js +1 -2
- package/lib/config.js.map +1 -1
- package/lib/index.js +0 -29
- package/lib/index.js.map +1 -1
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/vtx-color-picker/index.js +9 -26
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +0 -2
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +0 -2
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +46 -86
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +30 -56
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +0 -7
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +0 -7
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/Alert.js +5 -14
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +35 -74
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +3 -15
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +125 -201
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +7 -38
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +0 -10
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +0 -10
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +21 -51
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +24 -65
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +1 -7
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +0 -1
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +0 -1
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-editor/index.js +9 -28
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +0 -1
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +0 -1
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +8 -8
- package/lib/vtx-ellipsis-text/index.js +14 -27
- package/lib/vtx-ellipsis-text/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/css.js +0 -1
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.js +0 -1
- package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.less +13 -13
- package/lib/vtx-export/index.js +28 -61
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +0 -5
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +0 -5
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export-async/History.js +59 -100
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +64 -105
- package/lib/vtx-export-async/index.js.map +1 -1
- package/lib/vtx-export-async/style/css.js.map +1 -1
- package/lib/vtx-export-async/style/index.js.map +1 -1
- package/lib/vtx-export-async/util.js +2 -13
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +11 -33
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +5 -11
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +11 -33
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +3 -9
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +1 -8
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +1 -4
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +43 -43
- package/lib/vtx-form-layout/index.js +9 -24
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +0 -7
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +0 -7
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +216 -216
- package/lib/vtx-image/Image.js +73 -113
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +30 -59
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +17 -47
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +4 -11
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +0 -1
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-import/index.js +45 -78
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +10 -28
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +0 -3
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +0 -3
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-import/style/index.less +8 -8
- package/lib/vtx-import2/CheckResult.js +1 -8
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +11 -33
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +1 -6
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +7 -14
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +1 -6
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +51 -107
- package/lib/vtx-import2/index.js.map +1 -1
- package/lib/vtx-import2/style/css.js +0 -3
- package/lib/vtx-import2/style/css.js.map +1 -1
- package/lib/vtx-import2/style/index.js +0 -3
- package/lib/vtx-import2/style/index.js.map +1 -1
- package/lib/vtx-import2/style/index.less +102 -102
- package/lib/vtx-input/TextArea.js +10 -27
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +20 -45
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +0 -1
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +0 -1
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +24 -24
- package/lib/vtx-input/useLength.js +7 -20
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +2 -8
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +49 -82
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +0 -1
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +0 -1
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +3 -8
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +15 -26
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +3 -12
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +30 -60
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +11 -22
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +23 -51
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +1 -10
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/css.js.map +1 -1
- package/lib/vtx-page-layout/style/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +138 -138
- package/lib/vtx-rps-frame/index.js +37 -57
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-rps-frame/style/css.js.map +1 -1
- package/lib/vtx-rps-frame/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +30 -64
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +113 -113
- package/lib/vtx-search/VtxCol.js +7 -26
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +7 -14
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +61 -106
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +0 -4
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +0 -4
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +58 -93
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +0 -2
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +0 -2
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +50 -91
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +0 -8
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +0 -8
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +68 -68
- package/lib/vtx-signature/index.js +18 -33
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +0 -2
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +0 -2
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +33 -33
- package/lib/vtx-split-pane/Pane.js +11 -22
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +19 -39
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +51 -107
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +1 -6
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +0 -3
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +0 -3
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +76 -76
- package/lib/vtx-statistics-column/Back.js +2 -9
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +14 -30
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +14 -30
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +1 -4
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +1 -18
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js +1 -0
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +1 -0
- package/lib/vtx-statistics-column/style/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +59 -59
- package/lib/vtx-time-picker/index.js +4 -18
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-time-picker/style/css.js.map +1 -1
- package/lib/vtx-time-picker/style/index.js.map +1 -1
- package/lib/vtx-tree/index.js +49 -114
- package/lib/vtx-tree/index.js.map +1 -1
- package/lib/vtx-tree/style/css.js +0 -2
- package/lib/vtx-tree/style/css.js.map +1 -1
- package/lib/vtx-tree/style/index.js +0 -2
- package/lib/vtx-tree/style/index.js.map +1 -1
- package/lib/vtx-tree/utils.js +6 -27
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +27 -71
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +0 -3
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +0 -3
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +15 -33
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +78 -151
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +0 -6
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +0 -6
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +61 -61
- package/lib/vtx-wang-editor/index.js +74 -116
- package/lib/vtx-wang-editor/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/css.js +0 -1
- package/lib/vtx-wang-editor/style/css.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.js +0 -1
- package/lib/vtx-wang-editor/style/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +75 -136
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +69 -119
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +0 -1
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +0 -1
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +45 -45
- package/lib/vtx-ztree-select/index.js +85 -146
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +0 -3
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +0 -3
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +107 -107
- package/package.json +121 -121
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
@import (reference) '~antd/lib/style/themes/index.less';
|
|
2
|
-
@import '../../style/themes/index';
|
|
3
|
-
|
|
4
|
-
@prefix-cls: vtx-statistics-column;
|
|
5
|
-
.@{prefix-cls} {
|
|
6
|
-
position: relative;
|
|
7
|
-
padding: 20px;
|
|
8
|
-
background: @component-background;
|
|
9
|
-
&-nowrap {
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
}
|
|
13
|
-
&-item {
|
|
14
|
-
position: relative;
|
|
15
|
-
display: inline-block;
|
|
16
|
-
text-align: center;
|
|
17
|
-
&-space {
|
|
18
|
-
padding: 0 24px;
|
|
19
|
-
}
|
|
20
|
-
&--label {
|
|
21
|
-
margin-bottom: 8px;
|
|
22
|
-
color: @statistics-text-color;
|
|
23
|
-
line-height: 1;
|
|
24
|
-
}
|
|
25
|
-
&--value {
|
|
26
|
-
color: @text-color;
|
|
27
|
-
font-size: 24px;
|
|
28
|
-
line-height: 1;
|
|
29
|
-
}
|
|
30
|
-
&_pointer {
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
}
|
|
33
|
-
&-total &--value {
|
|
34
|
-
color: #13c2c2;
|
|
35
|
-
}
|
|
36
|
-
&-total {
|
|
37
|
-
&::after {
|
|
38
|
-
position: absolute;
|
|
39
|
-
top: 50%;
|
|
40
|
-
right: 0;
|
|
41
|
-
width: 1px;
|
|
42
|
-
height: 42px;
|
|
43
|
-
background: #e8e8e8;
|
|
44
|
-
transform: translate(0, -50%);
|
|
45
|
-
content: '';
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
&-back {
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 0;
|
|
52
|
-
left: 0;
|
|
53
|
-
padding: 0 5px;
|
|
54
|
-
color: @component-background;
|
|
55
|
-
background-color: @primary-color;
|
|
56
|
-
border-radius: @border-radius-base 0 @border-radius-base 0;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
@import (reference) '~antd/lib/style/themes/index.less';
|
|
2
|
+
@import '../../style/themes/index';
|
|
3
|
+
|
|
4
|
+
@prefix-cls: vtx-statistics-column;
|
|
5
|
+
.@{prefix-cls} {
|
|
6
|
+
position: relative;
|
|
7
|
+
padding: 20px;
|
|
8
|
+
background: @component-background;
|
|
9
|
+
&-nowrap {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
}
|
|
13
|
+
&-item {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: inline-block;
|
|
16
|
+
text-align: center;
|
|
17
|
+
&-space {
|
|
18
|
+
padding: 0 24px;
|
|
19
|
+
}
|
|
20
|
+
&--label {
|
|
21
|
+
margin-bottom: 8px;
|
|
22
|
+
color: @statistics-text-color;
|
|
23
|
+
line-height: 1;
|
|
24
|
+
}
|
|
25
|
+
&--value {
|
|
26
|
+
color: @text-color;
|
|
27
|
+
font-size: 24px;
|
|
28
|
+
line-height: 1;
|
|
29
|
+
}
|
|
30
|
+
&_pointer {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
&-total &--value {
|
|
34
|
+
color: #13c2c2;
|
|
35
|
+
}
|
|
36
|
+
&-total {
|
|
37
|
+
&::after {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
right: 0;
|
|
41
|
+
width: 1px;
|
|
42
|
+
height: 42px;
|
|
43
|
+
background: #e8e8e8;
|
|
44
|
+
transform: translate(0, -50%);
|
|
45
|
+
content: '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
&-back {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
padding: 0 5px;
|
|
54
|
+
color: @component-background;
|
|
55
|
+
background-color: @primary-color;
|
|
56
|
+
border-radius: @border-radius-base 0 @border-radius-base 0;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -4,31 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _timePicker = _interopRequireDefault(require("antd/lib/time-picker"));
|
|
11
|
-
|
|
12
9
|
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _excluded = ["value", "format"];
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
-
|
|
24
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
|
|
26
16
|
function VtxTimePicker(props, ref) {
|
|
27
17
|
var value = props.value,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
_props$format = props.format,
|
|
19
|
+
format = _props$format === void 0 ? 'HH:mm:ss' : _props$format,
|
|
20
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
32
21
|
var newValue = value ? _moment["default"].isMoment(value) ? value : (0, _moment["default"])(value, format) : null;
|
|
33
22
|
return /*#__PURE__*/_react["default"].createElement(_timePicker["default"], _extends({
|
|
34
23
|
value: newValue,
|
|
@@ -37,10 +26,7 @@ function VtxTimePicker(props, ref) {
|
|
|
37
26
|
ref: ref
|
|
38
27
|
}));
|
|
39
28
|
}
|
|
40
|
-
|
|
41
|
-
var _default = /*#__PURE__*/_react["default"].forwardRef(VtxTimePicker);
|
|
42
|
-
|
|
43
|
-
exports["default"] = _default;
|
|
29
|
+
var _default = exports["default"] = /*#__PURE__*/_react["default"].forwardRef(VtxTimePicker);
|
|
44
30
|
VtxTimePicker.propTypes = {
|
|
45
31
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].instanceOf(_moment["default"])]),
|
|
46
32
|
format: _propTypes["default"].string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["VtxTimePicker","props","ref","value","format","rest","newValue","moment","isMoment","React","forwardRef","propTypes","PropTypes","oneOfType","string","instanceOf"],"sources":["vtx-time-picker/index.jsx"],"sourcesContent":["import React from 'react';\nimport TimePicker from 'antd/lib/time-picker';\nimport moment from 'moment';\nimport PropTypes from 'prop-types';\n\nfunction VtxTimePicker(props, ref) {\n const { value, format = 'HH:mm:ss', ...rest } = props;\n const newValue = value ? (moment.isMoment(value) ? value : moment(value, format)) : null;\n return <TimePicker value={newValue} format={format} {...rest} ref={ref} />;\n}\n\nexport default React.forwardRef(VtxTimePicker);\n\nVtxTimePicker.propTypes = {\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(moment)]),\n format: PropTypes.string,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_timePicker","_moment","_propTypes","_excluded","obj","__esModule","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","VtxTimePicker","props","ref","value","_props$format","format","rest","newValue","moment","isMoment","createElement","_default","exports","React","forwardRef","propTypes","PropTypes","oneOfType","string","instanceOf"],"sources":["vtx-time-picker/index.jsx"],"sourcesContent":["import React from 'react';\r\nimport TimePicker from 'antd/lib/time-picker';\r\nimport moment from 'moment';\r\nimport PropTypes from 'prop-types';\r\n\r\nfunction VtxTimePicker(props, ref) {\r\n const { value, format = 'HH:mm:ss', ...rest } = props;\r\n const newValue = value ? (moment.isMoment(value) ? value : moment(value, format)) : null;\r\n return <TimePicker value={newValue} format={format} {...rest} ref={ref} />;\r\n}\r\n\r\nexport default React.forwardRef(VtxTimePicker);\r\n\r\nVtxTimePicker.propTypes = {\r\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(moment)]),\r\n format: PropTypes.string,\r\n};\r\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAmC,IAAAI,SAAA;AAAA,SAAAL,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,yBAAAN,MAAA,EAAAO,QAAA,QAAAP,MAAA,yBAAAJ,MAAA,GAAAY,6BAAA,CAAAR,MAAA,EAAAO,QAAA,OAAAN,GAAA,EAAAJ,CAAA,MAAAJ,MAAA,CAAAgB,qBAAA,QAAAC,gBAAA,GAAAjB,MAAA,CAAAgB,qBAAA,CAAAT,MAAA,QAAAH,CAAA,MAAAA,CAAA,GAAAa,gBAAA,CAAAX,MAAA,EAAAF,CAAA,MAAAI,GAAA,GAAAS,gBAAA,CAAAb,CAAA,OAAAU,QAAA,CAAAI,OAAA,CAAAV,GAAA,uBAAAR,MAAA,CAAAS,SAAA,CAAAU,oBAAA,CAAAR,IAAA,CAAAJ,MAAA,EAAAC,GAAA,aAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,cAAAL,MAAA;AAAA,SAAAY,8BAAAR,MAAA,EAAAO,QAAA,QAAAP,MAAA,yBAAAJ,MAAA,WAAAiB,UAAA,GAAApB,MAAA,CAAAqB,IAAA,CAAAd,MAAA,OAAAC,GAAA,EAAAJ,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAgB,UAAA,CAAAd,MAAA,EAAAF,CAAA,MAAAI,GAAA,GAAAY,UAAA,CAAAhB,CAAA,OAAAU,QAAA,CAAAI,OAAA,CAAAV,GAAA,kBAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,YAAAL,MAAA;AAEnC,SAASmB,aAAaA,CAACC,KAAK,EAAEC,GAAG,EAAE;EAC/B,IAAQC,KAAK,GAAmCF,KAAK,CAA7CE,KAAK;IAAAC,aAAA,GAAmCH,KAAK,CAAtCI,MAAM;IAANA,MAAM,GAAAD,aAAA,cAAG,UAAU,GAAAA,aAAA;IAAKE,IAAI,GAAAf,wBAAA,CAAKU,KAAK,EAAA3B,SAAA;EACrD,IAAMiC,QAAQ,GAAGJ,KAAK,GAAIK,kBAAM,CAACC,QAAQ,CAACN,KAAK,CAAC,GAAGA,KAAK,GAAG,IAAAK,kBAAM,EAACL,KAAK,EAAEE,MAAM,CAAC,GAAI,IAAI;EACxF,oBAAOrC,MAAA,YAAA0C,aAAA,CAACvC,WAAA,WAAU,EAAAM,QAAA;IAAC0B,KAAK,EAAEI,QAAS;IAACF,MAAM,EAAEA;EAAO,GAAKC,IAAI;IAAEJ,GAAG,EAAEA;EAAI,EAAE,CAAC;AAC9E;AAAC,IAAAS,QAAA,GAAAC,OAAA,2BAEcC,iBAAK,CAACC,UAAU,CAACd,aAAa,CAAC;AAE9CA,aAAa,CAACe,SAAS,GAAG;EACtBZ,KAAK,EAAEa,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,UAAU,CAACX,kBAAM,CAAC,CAAC,CAAC;EAC5EH,MAAM,EAAEW,qBAAS,CAACE;AACtB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-time-picker/style/index.js"],"sourcesContent":["import 'antd/lib/time-picker/style/index';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"css.js","names":["require"],"sources":["vtx-time-picker/style/index.js"],"sourcesContent":["import 'antd/lib/time-picker/style/index';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-time-picker/style/index.js"],"sourcesContent":["import 'antd/lib/time-picker/style/index';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","names":["require"],"sources":["vtx-time-picker/style/index.js"],"sourcesContent":["import 'antd/lib/time-picker/style/index';\r\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
|
package/lib/vtx-tree/index.js
CHANGED
|
@@ -1,68 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _antd = require("antd");
|
|
15
|
-
|
|
16
11
|
var _icons = require("@ant-design/icons");
|
|
17
|
-
|
|
18
12
|
var _utils = require("./utils");
|
|
19
|
-
|
|
20
13
|
var _excluded = ["prefixCls", "showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames"];
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
28
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
|
-
|
|
30
18
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
31
|
-
|
|
32
19
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
|
|
34
20
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
35
|
-
|
|
36
21
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
-
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
26
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
44
27
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
|
-
|
|
46
28
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
-
|
|
48
29
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
53
|
-
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
31
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
54
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
-
|
|
56
33
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
57
|
-
|
|
58
34
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
59
|
-
|
|
60
35
|
var getParentKey = function getParentKey(key, tree) {
|
|
61
36
|
var parentKey;
|
|
62
|
-
|
|
63
37
|
for (var i = 0; i < tree.length; i++) {
|
|
64
38
|
var node = tree[i];
|
|
65
|
-
|
|
66
39
|
if (node.children) {
|
|
67
40
|
if (node.children.some(function (item) {
|
|
68
41
|
return item.key === key;
|
|
@@ -73,58 +46,46 @@ var getParentKey = function getParentKey(key, tree) {
|
|
|
73
46
|
}
|
|
74
47
|
}
|
|
75
48
|
}
|
|
76
|
-
|
|
77
49
|
return parentKey;
|
|
78
50
|
};
|
|
79
|
-
|
|
80
51
|
var VtxTree = function VtxTree(_ref) {
|
|
81
52
|
var _ref$prefixCls = _ref.prefixCls,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
53
|
+
prefixCls = _ref$prefixCls === void 0 ? 'vtx-tree' : _ref$prefixCls,
|
|
54
|
+
_ref$showSearch = _ref.showSearch,
|
|
55
|
+
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
|
56
|
+
_ref$treeData = _ref.treeData,
|
|
57
|
+
treeData = _ref$treeData === void 0 ? [] : _ref$treeData,
|
|
58
|
+
_ref$searchPlaceholde = _ref.searchPlaceholder,
|
|
59
|
+
searchPlaceholder = _ref$searchPlaceholde === void 0 ? '请输入要查询的关键字' : _ref$searchPlaceholde,
|
|
60
|
+
renderMenuList = _ref.renderMenuList,
|
|
61
|
+
fieldNames = _ref.fieldNames,
|
|
62
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
93
63
|
var treeRef = (0, _react.useRef)();
|
|
94
|
-
|
|
95
64
|
var _useState = (0, _react.useState)(0),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
66
|
+
height = _useState2[0],
|
|
67
|
+
setHeight = _useState2[1];
|
|
100
68
|
var _useState3 = (0, _react.useState)(''),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
69
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
|
+
searchValue = _useState4[0],
|
|
71
|
+
setSearchValue = _useState4[1];
|
|
105
72
|
var _useState5 = (0, _react.useState)([]),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
73
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
74
|
+
expandedKeys = _useState6[0],
|
|
75
|
+
setExpandedKeys = _useState6[1];
|
|
110
76
|
var _useState7 = (0, _react.useState)(props.autoExpandParent || false),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
77
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
78
|
+
autoExpandParent = _useState8[0],
|
|
79
|
+
setAutoExpandParent = _useState8[1];
|
|
115
80
|
var _useState9 = (0, _react.useState)(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
81
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
82
|
+
selectedKeys = _useState10[0],
|
|
83
|
+
setSelectedKeys = _useState10[1];
|
|
120
84
|
var lastSelectedKey = _react["default"].useRef();
|
|
121
|
-
|
|
122
85
|
var cachedSelectedKeys = _react["default"].useRef();
|
|
123
|
-
|
|
124
86
|
var dataList = (0, _react.useMemo)(function () {
|
|
125
87
|
var dataList = [];
|
|
126
88
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
127
|
-
|
|
128
89
|
var generateList = function generateList(data) {
|
|
129
90
|
for (var i = 0; i < data.length; i++) {
|
|
130
91
|
var node = data[i];
|
|
@@ -133,13 +94,11 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
133
94
|
key: key,
|
|
134
95
|
title: node[titleKey]
|
|
135
96
|
});
|
|
136
|
-
|
|
137
97
|
if (node.children) {
|
|
138
98
|
generateList(node.children);
|
|
139
99
|
}
|
|
140
100
|
}
|
|
141
101
|
};
|
|
142
|
-
|
|
143
102
|
generateList(treeData);
|
|
144
103
|
return dataList;
|
|
145
104
|
}, [treeData]);
|
|
@@ -153,65 +112,55 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
153
112
|
setExpandedKeys(props.expandedKeys);
|
|
154
113
|
}
|
|
155
114
|
}, [props.expandedKeys]);
|
|
156
|
-
|
|
157
115
|
var onExpand = function onExpand(newExpandedKeys, info) {
|
|
158
116
|
var _props$onExpand;
|
|
159
|
-
|
|
160
117
|
setAutoExpandParent(false);
|
|
161
|
-
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0
|
|
162
|
-
|
|
118
|
+
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0 || _props$onExpand.call(props, newExpandedKeys, info);
|
|
163
119
|
if (!('expandedKeys' in props)) {
|
|
164
120
|
setExpandedKeys(newExpandedKeys);
|
|
165
121
|
}
|
|
166
122
|
};
|
|
167
|
-
|
|
168
123
|
var onChange = function onChange(e) {
|
|
169
124
|
var _props$onExpand2;
|
|
170
|
-
|
|
171
125
|
var value = e.target.value;
|
|
172
126
|
var newExpandedKeys = dataList.map(function (item) {
|
|
173
127
|
if (item.title.indexOf(value) > -1) {
|
|
174
128
|
return getParentKey(item.key, treeData);
|
|
175
129
|
}
|
|
176
|
-
|
|
177
130
|
return null;
|
|
178
131
|
}).filter(function (item, i, self) {
|
|
179
132
|
return item && self.indexOf(item) === i;
|
|
180
133
|
});
|
|
181
134
|
setSearchValue(value);
|
|
182
135
|
setAutoExpandParent(true);
|
|
183
|
-
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0
|
|
184
|
-
|
|
136
|
+
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 || _props$onExpand2.call(props, newExpandedKeys);
|
|
185
137
|
if (!('expandedKeys' in props)) {
|
|
186
138
|
setExpandedKeys(newExpandedKeys);
|
|
187
139
|
}
|
|
188
140
|
};
|
|
189
|
-
|
|
190
141
|
(0, _react.useEffect)(function () {
|
|
191
142
|
setHeight(treeRef.current.offsetHeight);
|
|
192
143
|
}, []);
|
|
193
|
-
|
|
194
144
|
var onSelect = function onSelect(keys, event) {
|
|
195
145
|
var _props$onSelect;
|
|
196
|
-
|
|
197
146
|
var multiple = props.multiple;
|
|
198
147
|
var node = event.node,
|
|
199
|
-
|
|
148
|
+
nativeEvent = event.nativeEvent;
|
|
200
149
|
var _node$key = node.key,
|
|
201
|
-
|
|
202
|
-
//
|
|
150
|
+
key = _node$key === void 0 ? '' : _node$key;
|
|
151
|
+
// const newState: DirectoryTreeState = {};
|
|
203
152
|
|
|
153
|
+
// We need wrap this event since some value is not same
|
|
204
154
|
var newEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
205
155
|
selected: true // Directory selected always true
|
|
156
|
+
});
|
|
206
157
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
158
|
+
// Windows / Mac single pick
|
|
210
159
|
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
211
|
-
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
160
|
+
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
212
161
|
|
|
162
|
+
// Generate new selected keys
|
|
213
163
|
var newSelectedKeys;
|
|
214
|
-
|
|
215
164
|
if (multiple && ctrlPick) {
|
|
216
165
|
// Control click
|
|
217
166
|
newSelectedKeys = keys;
|
|
@@ -234,19 +183,14 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
234
183
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
235
184
|
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
236
185
|
}
|
|
237
|
-
|
|
238
|
-
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
239
|
-
|
|
186
|
+
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
240
187
|
if (!('selectedKeys' in props)) {
|
|
241
188
|
setSelectedKeys(newSelectedKeys);
|
|
242
189
|
}
|
|
243
190
|
};
|
|
244
|
-
|
|
245
191
|
var newTreeData = (0, _react.useMemo)(function () {
|
|
246
192
|
var loop = function loop(data) {
|
|
247
193
|
return data.map(function (item) {
|
|
248
|
-
var _objectSpread3;
|
|
249
|
-
|
|
250
194
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
251
195
|
var strTitle = item[titleKey];
|
|
252
196
|
var index = strTitle.indexOf(searchValue);
|
|
@@ -255,17 +199,12 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
255
199
|
var title = index > -1 ? /*#__PURE__*/_react["default"].createElement("span", null, beforeStr, /*#__PURE__*/_react["default"].createElement("span", {
|
|
256
200
|
className: "".concat(prefixCls, "-search-value")
|
|
257
201
|
}, searchValue), afterStr) : /*#__PURE__*/_react["default"].createElement("span", null, strTitle);
|
|
258
|
-
|
|
259
202
|
if (item.children) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return _objectSpread(_objectSpread({}, item), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, titleKey, title), _defineProperty(_objectSpread2, "key", item.key), _defineProperty(_objectSpread2, "children", loop(item.children)), _objectSpread2));
|
|
203
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), "key", item.key), "children", loop(item.children)));
|
|
263
204
|
}
|
|
264
|
-
|
|
265
|
-
return _objectSpread(_objectSpread({}, item), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, titleKey, title), _defineProperty(_objectSpread3, "key", item.key), _objectSpread3));
|
|
205
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty({}, titleKey, title), "key", item.key));
|
|
266
206
|
});
|
|
267
207
|
};
|
|
268
|
-
|
|
269
208
|
return loop(treeData);
|
|
270
209
|
}, [treeData, searchValue]);
|
|
271
210
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -296,7 +235,6 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
296
235
|
titleRender: function titleRender(nodeData) {
|
|
297
236
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
298
237
|
var title = nodeData[titleKey];
|
|
299
|
-
|
|
300
238
|
if (renderMenuList) {
|
|
301
239
|
var menuList = renderMenuList(nodeData);
|
|
302
240
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -318,12 +256,10 @@ var VtxTree = function VtxTree(_ref) {
|
|
|
318
256
|
}, item.icon));
|
|
319
257
|
})));
|
|
320
258
|
}
|
|
321
|
-
|
|
322
259
|
return title;
|
|
323
260
|
}
|
|
324
261
|
}))));
|
|
325
262
|
};
|
|
326
|
-
|
|
327
263
|
VtxTree.propTypes = {
|
|
328
264
|
showSearch: _propTypes["default"].bool,
|
|
329
265
|
prefixCls: _propTypes["default"].string,
|
|
@@ -339,6 +275,5 @@ VtxTree.propTypes = {
|
|
|
339
275
|
renderMenuList: _propTypes["default"].func,
|
|
340
276
|
fieldNames: _propTypes["default"].array
|
|
341
277
|
};
|
|
342
|
-
var _default = VtxTree;
|
|
343
|
-
exports["default"] = _default;
|
|
278
|
+
var _default = exports["default"] = VtxTree;
|
|
344
279
|
//# sourceMappingURL=index.js.map
|