@vtx/components 3.1.149 → 3.1.151
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 +60 -49
- 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 +8 -16
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +2 -9
- 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 +3 -13
- 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 +26 -42
- 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 +1 -30
- 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 +14 -33
- 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 +55 -96
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +41 -66
- 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 +6 -15
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/CheckboxList.js +35 -71
- package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +58 -105
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +6 -18
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +138 -217
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +15 -46
- 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 +28 -58
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +35 -77
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +2 -8
- 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 +13 -32
- 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 +16 -29
- 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 +38 -73
- 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/ColumnsSelect.js +11 -23
- package/lib/vtx-export-async/ColumnsSelect.js.map +1 -1
- package/lib/vtx-export-async/History.js +75 -117
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +72 -116
- 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 +9 -21
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +17 -39
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +6 -12
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +19 -50
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +4 -10
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +2 -9
- 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 +10 -25
- 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 +220 -220
- package/lib/vtx-image/Image.js +77 -117
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +34 -63
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +24 -54
- 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 +91 -143
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +15 -33
- 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 +2 -9
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +16 -38
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +2 -7
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +8 -15
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +2 -7
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +91 -176
- 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 +14 -31
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +24 -49
- 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 +10 -23
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +3 -9
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +52 -85
- 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 +4 -9
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +16 -27
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +4 -13
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +34 -64
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +12 -23
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +32 -61
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +2 -11
- 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 +38 -58
- 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 +34 -68
- 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 +8 -27
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +8 -15
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +67 -112
- 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 +63 -98
- 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 +47 -99
- 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 +19 -34
- 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 +12 -23
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +21 -41
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +55 -111
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +2 -7
- 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 +4 -11
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +16 -32
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +15 -31
- 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 +2 -19
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js +0 -1
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +0 -1
- 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 +8 -22
- 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 +83 -153
- 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 +10 -31
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +37 -81
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +0 -4
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +0 -4
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +17 -35
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +90 -167
- 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 +84 -126
- 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 +80 -141
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +77 -138
- 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 +91 -159
- 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 +109 -109
- package/package.json +122 -122
|
@@ -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
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
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
|
-
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
|
-
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
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","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","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,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAN,CAAA,MAAAA,CAAA,GAAAO,SAAA,CAAAC,MAAA,EAAAR,CAAA,UAAAS,CAAA,GAAAF,SAAA,CAAAP,CAAA,YAAAU,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAAA,SAAAO,yBAAAd,CAAA,EAAAS,CAAA,gBAAAT,CAAA,iBAAAe,CAAA,EAAAL,CAAA,EAAAM,CAAA,GAAAC,6BAAA,CAAAjB,CAAA,EAAAS,CAAA,OAAAN,MAAA,CAAAe,qBAAA,QAAAC,CAAA,GAAAhB,MAAA,CAAAe,qBAAA,CAAAlB,CAAA,QAAAU,CAAA,MAAAA,CAAA,GAAAS,CAAA,CAAAX,MAAA,EAAAE,CAAA,IAAAK,CAAA,GAAAI,CAAA,CAAAT,CAAA,GAAAD,CAAA,CAAAW,QAAA,CAAAL,CAAA,QAAAM,oBAAA,CAAAT,IAAA,CAAAZ,CAAA,EAAAe,CAAA,MAAAC,CAAA,CAAAD,CAAA,IAAAf,CAAA,CAAAe,CAAA,aAAAC,CAAA;AAAA,SAAAC,8BAAAP,CAAA,EAAAV,CAAA,gBAAAU,CAAA,iBAAAD,CAAA,gBAAAH,CAAA,IAAAI,CAAA,SAAAC,cAAA,CAAAC,IAAA,CAAAF,CAAA,EAAAJ,CAAA,SAAAN,CAAA,CAAAoB,QAAA,CAAAd,CAAA,aAAAG,CAAA,CAAAH,CAAA,IAAAI,CAAA,CAAAJ,CAAA,YAAAG,CAAA;AAEnC,SAASa,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,GAAAd,wBAAA,CAAKS,KAAK,EAAAxB,SAAA;EACrD,IAAM8B,QAAQ,GAAGJ,KAAK,GAAIK,kBAAM,CAACC,QAAQ,CAACN,KAAK,CAAC,GAAGA,KAAK,GAAG,IAAAK,kBAAM,EAACL,KAAK,EAAEE,MAAM,CAAC,GAAI,IAAI;EACxF,oBAAOlC,MAAA,YAAAuC,aAAA,CAACpC,WAAA,WAAU,EAAAM,QAAA;IAACuB,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,81 +1,50 @@
|
|
|
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 _ahooks = require("ahooks");
|
|
21
|
-
|
|
22
14
|
var _utils2 = require("@vtx/utils");
|
|
23
|
-
|
|
24
15
|
var _excluded = ["prefixCls", "showSearch", "treeData", "searchPlaceholder", "renderMenuList", "fieldNames", "titleClassName"];
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
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); }
|
|
33
|
-
|
|
34
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
-
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
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); }
|
|
18
|
+
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 && {}.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; }
|
|
19
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
36
21
|
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."); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
-
|
|
22
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
28
|
+
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); }
|
|
29
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
50
30
|
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."); }
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
61
|
-
|
|
62
|
-
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); }
|
|
63
|
-
|
|
64
|
-
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; }
|
|
65
|
-
|
|
66
|
-
var getParentKey = function getParentKey(key, tree) {
|
|
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; } }
|
|
32
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
33
|
+
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; }
|
|
34
|
+
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; }
|
|
35
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
36
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
38
|
+
var _getParentKey = function getParentKey(key, tree) {
|
|
67
39
|
var parentKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
68
|
-
|
|
69
40
|
var _iterator = _createForOfIteratorHelper(tree),
|
|
70
|
-
|
|
71
|
-
|
|
41
|
+
_step;
|
|
72
42
|
try {
|
|
73
43
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
74
44
|
var node = _step.value;
|
|
75
45
|
if (node.key === key) return parentKey;
|
|
76
|
-
|
|
77
46
|
if (node.children) {
|
|
78
|
-
var found =
|
|
47
|
+
var found = _getParentKey(key, node.children, node.key);
|
|
79
48
|
if (found !== undefined) return found;
|
|
80
49
|
}
|
|
81
50
|
}
|
|
@@ -84,57 +53,45 @@ var getParentKey = function getParentKey(key, tree) {
|
|
|
84
53
|
} finally {
|
|
85
54
|
_iterator.f();
|
|
86
55
|
}
|
|
87
|
-
|
|
88
56
|
return undefined;
|
|
89
57
|
};
|
|
90
|
-
|
|
91
58
|
var VtxTree = function VtxTree(_ref, ref) {
|
|
92
59
|
var _ref$prefixCls = _ref.prefixCls,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
60
|
+
prefixCls = _ref$prefixCls === void 0 ? 'vtx-tree' : _ref$prefixCls,
|
|
61
|
+
_ref$showSearch = _ref.showSearch,
|
|
62
|
+
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
|
63
|
+
_ref$treeData = _ref.treeData,
|
|
64
|
+
treeData = _ref$treeData === void 0 ? [] : _ref$treeData,
|
|
65
|
+
_ref$searchPlaceholde = _ref.searchPlaceholder,
|
|
66
|
+
searchPlaceholder = _ref$searchPlaceholde === void 0 ? '请输入要查询的关键字' : _ref$searchPlaceholde,
|
|
67
|
+
renderMenuList = _ref.renderMenuList,
|
|
68
|
+
fieldNames = _ref.fieldNames,
|
|
69
|
+
titleClassName = _ref.titleClassName,
|
|
70
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
105
71
|
var treeRef = (0, _react.useRef)();
|
|
106
|
-
|
|
107
72
|
var _useState = (0, _react.useState)(0),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
height = _useState2[0],
|
|
75
|
+
setHeight = _useState2[1];
|
|
112
76
|
var _useState3 = (0, _react.useState)([]),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
77
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
78
|
+
expandedKeys = _useState4[0],
|
|
79
|
+
setExpandedKeys = _useState4[1];
|
|
117
80
|
var _useState5 = (0, _react.useState)(props.autoExpandParent || false),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
82
|
+
autoExpandParent = _useState6[0],
|
|
83
|
+
setAutoExpandParent = _useState6[1];
|
|
122
84
|
var _useState7 = (0, _react.useState)(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
85
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
86
|
+
selectedKeys = _useState8[0],
|
|
87
|
+
setSelectedKeys = _useState8[1];
|
|
127
88
|
var inputRef = (0, _react.useRef)();
|
|
128
|
-
|
|
129
89
|
var lastSelectedKey = _react["default"].useRef();
|
|
130
|
-
|
|
131
90
|
var cachedSelectedKeys = _react["default"].useRef();
|
|
132
|
-
|
|
133
91
|
var dataList = (0, _react.useMemo)(function () {
|
|
134
92
|
var dataList = [];
|
|
135
93
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
136
|
-
|
|
137
|
-
var generateList = function generateList(data) {
|
|
94
|
+
var _generateList = function generateList(data) {
|
|
138
95
|
for (var i = 0; i < data.length; i++) {
|
|
139
96
|
var node = data[i];
|
|
140
97
|
var key = node.key;
|
|
@@ -142,14 +99,12 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
142
99
|
key: key,
|
|
143
100
|
title: node[titleKey]
|
|
144
101
|
});
|
|
145
|
-
|
|
146
102
|
if (node.children) {
|
|
147
|
-
|
|
103
|
+
_generateList(node.children);
|
|
148
104
|
}
|
|
149
105
|
}
|
|
150
106
|
};
|
|
151
|
-
|
|
152
|
-
generateList(treeData);
|
|
107
|
+
_generateList(treeData);
|
|
153
108
|
return dataList;
|
|
154
109
|
}, [treeData]);
|
|
155
110
|
(0, _react.useEffect)(function () {
|
|
@@ -162,23 +117,18 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
162
117
|
setExpandedKeys(props.expandedKeys);
|
|
163
118
|
}
|
|
164
119
|
}, [props.expandedKeys]);
|
|
165
|
-
|
|
166
120
|
var onExpand = function onExpand(newExpandedKeys, info) {
|
|
167
121
|
var _props$onExpand;
|
|
168
|
-
|
|
169
122
|
setAutoExpandParent(false);
|
|
170
|
-
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0
|
|
171
|
-
|
|
123
|
+
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0 || _props$onExpand.call(props, newExpandedKeys, info);
|
|
172
124
|
if (!('expandedKeys' in props)) {
|
|
173
125
|
setExpandedKeys(newExpandedKeys);
|
|
174
126
|
}
|
|
175
127
|
};
|
|
176
|
-
|
|
177
128
|
var _useState9 = (0, _react.useState)(treeData),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
129
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
130
|
+
newTreeData = _useState10[0],
|
|
131
|
+
setNewTreeData = _useState10[1];
|
|
182
132
|
(0, _react.useEffect)(function () {
|
|
183
133
|
if (treeData !== null && treeData !== void 0 && treeData.length) {
|
|
184
134
|
filterTreeData(inputRef.current ? inputRef.current.input.value : '');
|
|
@@ -188,8 +138,6 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
188
138
|
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
189
139
|
var newTreeData = (0, _utils2.parseTreeData)(treeData, {
|
|
190
140
|
renderNode: function renderNode(item) {
|
|
191
|
-
var _objectSpread2;
|
|
192
|
-
|
|
193
141
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
194
142
|
var strTitle = item[titleKey] || '';
|
|
195
143
|
var index = strTitle.indexOf(searchValue);
|
|
@@ -203,7 +151,7 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
203
151
|
}, searchValue), afterStr) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
204
152
|
className: className
|
|
205
153
|
}, strTitle);
|
|
206
|
-
return _objectSpread(_objectSpread({}, item), {}, (
|
|
154
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), "key", item.key), "strTitle", strTitle));
|
|
207
155
|
},
|
|
208
156
|
filterNode: function filterNode(item) {
|
|
209
157
|
return item.strTitle.indexOf(searchValue) > -1;
|
|
@@ -211,31 +159,26 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
211
159
|
});
|
|
212
160
|
return setNewTreeData(newTreeData);
|
|
213
161
|
});
|
|
214
|
-
|
|
215
162
|
var _useDebounceFn = (0, _ahooks.useDebounceFn)(function (value) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
163
|
+
var _props$onExpand2;
|
|
164
|
+
var newExpandedKeys = dataList.map(function (item) {
|
|
165
|
+
if (item.title.indexOf(value) > -1) {
|
|
166
|
+
return _getParentKey(item.key, treeData);
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}).filter(function (item, i, self) {
|
|
170
|
+
return item && self.indexOf(item) === i;
|
|
171
|
+
});
|
|
172
|
+
setAutoExpandParent(true);
|
|
173
|
+
filterTreeData(value);
|
|
174
|
+
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 || _props$onExpand2.call(props, newExpandedKeys);
|
|
175
|
+
if (!('expandedKeys' in props)) {
|
|
176
|
+
setExpandedKeys(newExpandedKeys);
|
|
221
177
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
});
|
|
227
|
-
setAutoExpandParent(true);
|
|
228
|
-
filterTreeData(value);
|
|
229
|
-
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 ? void 0 : _props$onExpand2.call(props, newExpandedKeys);
|
|
230
|
-
|
|
231
|
-
if (!('expandedKeys' in props)) {
|
|
232
|
-
setExpandedKeys(newExpandedKeys);
|
|
233
|
-
}
|
|
234
|
-
}, {
|
|
235
|
-
wait: 300
|
|
236
|
-
}),
|
|
237
|
-
onSearch = _useDebounceFn.run;
|
|
238
|
-
|
|
178
|
+
}, {
|
|
179
|
+
wait: 300
|
|
180
|
+
}),
|
|
181
|
+
onSearch = _useDebounceFn.run;
|
|
239
182
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
240
183
|
return {
|
|
241
184
|
onSearch: onSearch
|
|
@@ -245,40 +188,36 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
245
188
|
var resizeObserver = new ResizeObserver(function () {
|
|
246
189
|
setHeight(treeRef.current.offsetHeight);
|
|
247
190
|
});
|
|
248
|
-
|
|
249
191
|
if (treeRef.current) {
|
|
250
192
|
resizeObserver.observe(treeRef.current, {
|
|
251
193
|
box: 'border-box'
|
|
252
194
|
});
|
|
253
195
|
}
|
|
254
|
-
|
|
255
196
|
setHeight(treeRef.current.offsetHeight);
|
|
256
197
|
return function () {
|
|
257
198
|
resizeObserver.disconnect();
|
|
258
199
|
};
|
|
259
200
|
}, []);
|
|
260
|
-
|
|
261
201
|
var onSelect = function onSelect(keys, event) {
|
|
262
202
|
var _props$onSelect;
|
|
263
|
-
|
|
264
203
|
var multiple = props.multiple;
|
|
265
204
|
var node = event.node,
|
|
266
|
-
|
|
205
|
+
nativeEvent = event.nativeEvent;
|
|
267
206
|
var _node$key = node.key,
|
|
268
|
-
|
|
269
|
-
//
|
|
207
|
+
key = _node$key === void 0 ? '' : _node$key;
|
|
208
|
+
// const newState: DirectoryTreeState = {};
|
|
270
209
|
|
|
210
|
+
// We need wrap this event since some value is not same
|
|
271
211
|
var newEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
272
212
|
selected: true // Directory selected always true
|
|
213
|
+
});
|
|
273
214
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
215
|
+
// Windows / Mac single pick
|
|
277
216
|
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
278
|
-
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
217
|
+
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
279
218
|
|
|
219
|
+
// Generate new selected keys
|
|
280
220
|
var newSelectedKeys;
|
|
281
|
-
|
|
282
221
|
if (multiple && ctrlPick) {
|
|
283
222
|
// Control click
|
|
284
223
|
newSelectedKeys = keys;
|
|
@@ -301,14 +240,11 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
301
240
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
302
241
|
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
303
242
|
}
|
|
304
|
-
|
|
305
|
-
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
306
|
-
|
|
243
|
+
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
307
244
|
if (!('selectedKeys' in props)) {
|
|
308
245
|
setSelectedKeys(newSelectedKeys);
|
|
309
246
|
}
|
|
310
247
|
};
|
|
311
|
-
|
|
312
248
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
313
249
|
className: "".concat(prefixCls, "-wraaper")
|
|
314
250
|
}, showSearch && /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
@@ -343,7 +279,6 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
343
279
|
titleRender: function titleRender(nodeData) {
|
|
344
280
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
345
281
|
var title = nodeData[titleKey];
|
|
346
|
-
|
|
347
282
|
if (renderMenuList) {
|
|
348
283
|
var menuList = renderMenuList(nodeData);
|
|
349
284
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -365,12 +300,10 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
365
300
|
}, item.icon));
|
|
366
301
|
})));
|
|
367
302
|
}
|
|
368
|
-
|
|
369
303
|
return title;
|
|
370
304
|
}
|
|
371
305
|
}))));
|
|
372
306
|
};
|
|
373
|
-
|
|
374
307
|
VtxTree.propTypes = {
|
|
375
308
|
showSearch: _propTypes["default"].bool,
|
|
376
309
|
prefixCls: _propTypes["default"].string,
|
|
@@ -388,8 +321,5 @@ VtxTree.propTypes = {
|
|
|
388
321
|
fieldNames: _propTypes["default"].array,
|
|
389
322
|
defaultExpandAll: _propTypes["default"].bool
|
|
390
323
|
};
|
|
391
|
-
|
|
392
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(VtxTree);
|
|
393
|
-
|
|
394
|
-
exports["default"] = _default;
|
|
324
|
+
var _default = exports["default"] = /*#__PURE__*/(0, _react.forwardRef)(VtxTree);
|
|
395
325
|
//# sourceMappingURL=index.js.map
|