@vtx/components 3.1.155 → 3.1.156
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/README.md +19 -19
- package/lib/_util/filterSpecialCharacters.js +66 -55
- 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 +13 -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-color-picker/style/index.less +12 -12
- package/lib/vtx-combogrid/Combogrid.js +54 -96
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +40 -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 +34 -71
- package/lib/vtx-datagrid/CheckboxList.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +57 -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 +137 -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 +27 -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 +12 -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/style/index.less +6 -6
- 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 +73 -118
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +71 -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 +16 -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 -43
- 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 +76 -117
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +33 -63
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +23 -54
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +3 -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 +90 -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 +20 -40
- 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 +98 -181
- 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 +13 -31
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +23 -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 +51 -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 +6 -11
- 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 +33 -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 +37 -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-rps-frame/style/index.less +8 -8
- package/lib/vtx-scrollable-row/index.js +33 -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 +66 -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 +62 -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 +46 -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 +18 -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 +11 -23
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +20 -41
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +54 -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 +15 -32
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +14 -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 +84 -155
- 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 +36 -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 +89 -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 -127
- 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 +78 -142
- 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 +1 -1
|
@@ -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 n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(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","indexOf","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,QAAAZ,CAAA,GAAAH,MAAA,CAAAe,qBAAA,CAAAlB,CAAA,QAAAU,CAAA,MAAAA,CAAA,GAAAJ,CAAA,CAAAE,MAAA,EAAAE,CAAA,IAAAK,CAAA,GAAAT,CAAA,CAAAI,CAAA,UAAAD,CAAA,CAAAU,OAAA,CAAAJ,CAAA,QAAAK,oBAAA,CAAAR,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,gBAAAN,CAAA,CAAAmB,OAAA,CAAAb,CAAA,aAAAG,CAAA,CAAAH,CAAA,IAAAI,CAAA,CAAAJ,CAAA,YAAAG,CAAA;AAEnC,SAASY,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,GAAAb,wBAAA,CAAKQ,KAAK,EAAAvB,SAAA;EACrD,IAAM6B,QAAQ,GAAGJ,KAAK,GAAIK,kBAAM,CAACC,QAAQ,CAACN,KAAK,CAAC,GAAGA,KAAK,GAAG,IAAAK,kBAAM,EAACL,KAAK,EAAEE,MAAM,CAAC,GAAI,IAAI;EACxF,oBAAOjC,MAAA,YAAAsC,aAAA,CAACnC,WAAA,WAAU,EAAAM,QAAA;IAACsB,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,49 @@
|
|
|
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", "expandAction"];
|
|
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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
+
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); }
|
|
19
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
36
20
|
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
|
-
|
|
21
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
22
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
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); }
|
|
28
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
50
29
|
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) {
|
|
30
|
+
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; } }
|
|
31
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
33
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
34
|
+
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; } } }; }
|
|
35
|
+
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; } }
|
|
36
|
+
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; }
|
|
37
|
+
var _getParentKey = function getParentKey(key, tree) {
|
|
67
38
|
var parentKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
68
|
-
|
|
69
39
|
var _iterator = _createForOfIteratorHelper(tree),
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
_step;
|
|
72
41
|
try {
|
|
73
42
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
74
43
|
var node = _step.value;
|
|
75
44
|
if (node.key === key) return parentKey;
|
|
76
|
-
|
|
77
45
|
if (node.children) {
|
|
78
|
-
var found =
|
|
46
|
+
var found = _getParentKey(key, node.children, node.key);
|
|
79
47
|
if (found !== undefined) return found;
|
|
80
48
|
}
|
|
81
49
|
}
|
|
@@ -84,59 +52,47 @@ var getParentKey = function getParentKey(key, tree) {
|
|
|
84
52
|
} finally {
|
|
85
53
|
_iterator.f();
|
|
86
54
|
}
|
|
87
|
-
|
|
88
55
|
return undefined;
|
|
89
56
|
};
|
|
90
|
-
|
|
91
57
|
var VtxTree = function VtxTree(_ref, ref) {
|
|
92
58
|
var _ref$prefixCls = _ref.prefixCls,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
59
|
+
prefixCls = _ref$prefixCls === void 0 ? 'vtx-tree' : _ref$prefixCls,
|
|
60
|
+
_ref$showSearch = _ref.showSearch,
|
|
61
|
+
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
|
62
|
+
_ref$treeData = _ref.treeData,
|
|
63
|
+
treeData = _ref$treeData === void 0 ? [] : _ref$treeData,
|
|
64
|
+
_ref$searchPlaceholde = _ref.searchPlaceholder,
|
|
65
|
+
searchPlaceholder = _ref$searchPlaceholde === void 0 ? '请输入要查询的关键字' : _ref$searchPlaceholde,
|
|
66
|
+
renderMenuList = _ref.renderMenuList,
|
|
67
|
+
fieldNames = _ref.fieldNames,
|
|
68
|
+
titleClassName = _ref.titleClassName,
|
|
69
|
+
_ref$expandAction = _ref.expandAction,
|
|
70
|
+
expandAction = _ref$expandAction === void 0 ? 'click' : _ref$expandAction,
|
|
71
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
107
72
|
var treeRef = (0, _react.useRef)();
|
|
108
|
-
|
|
109
73
|
var _useState = (0, _react.useState)(0),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
74
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
75
|
+
height = _useState2[0],
|
|
76
|
+
setHeight = _useState2[1];
|
|
114
77
|
var _useState3 = (0, _react.useState)([]),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
+
expandedKeys = _useState4[0],
|
|
80
|
+
setExpandedKeys = _useState4[1];
|
|
119
81
|
var _useState5 = (0, _react.useState)(props.autoExpandParent || false),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
82
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
83
|
+
autoExpandParent = _useState6[0],
|
|
84
|
+
setAutoExpandParent = _useState6[1];
|
|
124
85
|
var _useState7 = (0, _react.useState)(props.selectedKeys || props.defaultSelectedKeys || []),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
86
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
87
|
+
selectedKeys = _useState8[0],
|
|
88
|
+
setSelectedKeys = _useState8[1];
|
|
129
89
|
var inputRef = (0, _react.useRef)();
|
|
130
|
-
|
|
131
90
|
var lastSelectedKey = _react["default"].useRef();
|
|
132
|
-
|
|
133
91
|
var cachedSelectedKeys = _react["default"].useRef();
|
|
134
|
-
|
|
135
92
|
var dataList = (0, _react.useMemo)(function () {
|
|
136
93
|
var dataList = [];
|
|
137
94
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
138
|
-
|
|
139
|
-
var generateList = function generateList(data) {
|
|
95
|
+
var _generateList = function generateList(data) {
|
|
140
96
|
for (var i = 0; i < data.length; i++) {
|
|
141
97
|
var node = data[i];
|
|
142
98
|
var key = node.key;
|
|
@@ -144,14 +100,12 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
144
100
|
key: key,
|
|
145
101
|
title: node[titleKey]
|
|
146
102
|
});
|
|
147
|
-
|
|
148
103
|
if (node.children) {
|
|
149
|
-
|
|
104
|
+
_generateList(node.children);
|
|
150
105
|
}
|
|
151
106
|
}
|
|
152
107
|
};
|
|
153
|
-
|
|
154
|
-
generateList(treeData);
|
|
108
|
+
_generateList(treeData);
|
|
155
109
|
return dataList;
|
|
156
110
|
}, [treeData]);
|
|
157
111
|
(0, _react.useEffect)(function () {
|
|
@@ -164,23 +118,18 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
164
118
|
setExpandedKeys(props.expandedKeys);
|
|
165
119
|
}
|
|
166
120
|
}, [props.expandedKeys]);
|
|
167
|
-
|
|
168
121
|
var onExpand = function onExpand(newExpandedKeys, info) {
|
|
169
122
|
var _props$onExpand;
|
|
170
|
-
|
|
171
123
|
setAutoExpandParent(false);
|
|
172
|
-
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0
|
|
173
|
-
|
|
124
|
+
(_props$onExpand = props.onExpand) === null || _props$onExpand === void 0 || _props$onExpand.call(props, newExpandedKeys, info);
|
|
174
125
|
if (!('expandedKeys' in props)) {
|
|
175
126
|
setExpandedKeys(newExpandedKeys);
|
|
176
127
|
}
|
|
177
128
|
};
|
|
178
|
-
|
|
179
129
|
var _useState9 = (0, _react.useState)(treeData),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
130
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
131
|
+
newTreeData = _useState0[0],
|
|
132
|
+
setNewTreeData = _useState0[1];
|
|
184
133
|
(0, _react.useEffect)(function () {
|
|
185
134
|
if (treeData !== null && treeData !== void 0 && treeData.length) {
|
|
186
135
|
filterTreeData(inputRef.current ? inputRef.current.input.value : '');
|
|
@@ -190,8 +139,6 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
190
139
|
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
191
140
|
var newTreeData = (0, _utils2.parseTreeData)(treeData, {
|
|
192
141
|
renderNode: function renderNode(item) {
|
|
193
|
-
var _objectSpread2;
|
|
194
|
-
|
|
195
142
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
196
143
|
var strTitle = item[titleKey] || '';
|
|
197
144
|
var index = strTitle.indexOf(searchValue);
|
|
@@ -205,7 +152,7 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
205
152
|
}, searchValue), afterStr) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
206
153
|
className: className
|
|
207
154
|
}, strTitle);
|
|
208
|
-
return _objectSpread(_objectSpread({}, item), {}, (
|
|
155
|
+
return _objectSpread(_objectSpread({}, item), {}, _defineProperty(_defineProperty(_defineProperty({}, titleKey, title), "key", item.key), "strTitle", strTitle));
|
|
209
156
|
},
|
|
210
157
|
filterNode: function filterNode(item) {
|
|
211
158
|
return item.strTitle.indexOf(searchValue) > -1;
|
|
@@ -213,31 +160,26 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
213
160
|
});
|
|
214
161
|
return setNewTreeData(newTreeData);
|
|
215
162
|
});
|
|
216
|
-
|
|
217
163
|
var _useDebounceFn = (0, _ahooks.useDebounceFn)(function (value) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
164
|
+
var _props$onExpand2;
|
|
165
|
+
var newExpandedKeys = dataList.map(function (item) {
|
|
166
|
+
if (item.title.indexOf(value) > -1) {
|
|
167
|
+
return _getParentKey(item.key, treeData);
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}).filter(function (item, i, self) {
|
|
171
|
+
return item && self.indexOf(item) === i;
|
|
172
|
+
});
|
|
173
|
+
setAutoExpandParent(true);
|
|
174
|
+
filterTreeData(value);
|
|
175
|
+
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 || _props$onExpand2.call(props, newExpandedKeys);
|
|
176
|
+
if (!('expandedKeys' in props)) {
|
|
177
|
+
setExpandedKeys(newExpandedKeys);
|
|
223
178
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
});
|
|
229
|
-
setAutoExpandParent(true);
|
|
230
|
-
filterTreeData(value);
|
|
231
|
-
(_props$onExpand2 = props.onExpand) === null || _props$onExpand2 === void 0 ? void 0 : _props$onExpand2.call(props, newExpandedKeys);
|
|
232
|
-
|
|
233
|
-
if (!('expandedKeys' in props)) {
|
|
234
|
-
setExpandedKeys(newExpandedKeys);
|
|
235
|
-
}
|
|
236
|
-
}, {
|
|
237
|
-
wait: 300
|
|
238
|
-
}),
|
|
239
|
-
onSearch = _useDebounceFn.run;
|
|
240
|
-
|
|
179
|
+
}, {
|
|
180
|
+
wait: 300
|
|
181
|
+
}),
|
|
182
|
+
onSearch = _useDebounceFn.run;
|
|
241
183
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
242
184
|
return {
|
|
243
185
|
onSearch: onSearch
|
|
@@ -247,40 +189,36 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
247
189
|
var resizeObserver = new ResizeObserver(function () {
|
|
248
190
|
setHeight(treeRef.current.offsetHeight);
|
|
249
191
|
});
|
|
250
|
-
|
|
251
192
|
if (treeRef.current) {
|
|
252
193
|
resizeObserver.observe(treeRef.current, {
|
|
253
194
|
box: 'border-box'
|
|
254
195
|
});
|
|
255
196
|
}
|
|
256
|
-
|
|
257
197
|
setHeight(treeRef.current.offsetHeight);
|
|
258
198
|
return function () {
|
|
259
199
|
resizeObserver.disconnect();
|
|
260
200
|
};
|
|
261
201
|
}, []);
|
|
262
|
-
|
|
263
202
|
var onSelect = function onSelect(keys, event) {
|
|
264
203
|
var _props$onSelect;
|
|
265
|
-
|
|
266
204
|
var multiple = props.multiple;
|
|
267
205
|
var node = event.node,
|
|
268
|
-
|
|
206
|
+
nativeEvent = event.nativeEvent;
|
|
269
207
|
var _node$key = node.key,
|
|
270
|
-
|
|
271
|
-
//
|
|
208
|
+
key = _node$key === void 0 ? '' : _node$key;
|
|
209
|
+
// const newState: DirectoryTreeState = {};
|
|
272
210
|
|
|
211
|
+
// We need wrap this event since some value is not same
|
|
273
212
|
var newEvent = _objectSpread(_objectSpread({}, event), {}, {
|
|
274
213
|
selected: true // Directory selected always true
|
|
214
|
+
});
|
|
275
215
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
216
|
+
// Windows / Mac single pick
|
|
279
217
|
var ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
280
|
-
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
218
|
+
var shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
281
219
|
|
|
220
|
+
// Generate new selected keys
|
|
282
221
|
var newSelectedKeys;
|
|
283
|
-
|
|
284
222
|
if (multiple && ctrlPick) {
|
|
285
223
|
// Control click
|
|
286
224
|
newSelectedKeys = keys;
|
|
@@ -303,14 +241,11 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
303
241
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
304
242
|
newEvent.selectedNodes = (0, _utils.convertDirectoryKeysToNodes)(treeData, newSelectedKeys);
|
|
305
243
|
}
|
|
306
|
-
|
|
307
|
-
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
308
|
-
|
|
244
|
+
(_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, newSelectedKeys, newEvent);
|
|
309
245
|
if (!('selectedKeys' in props)) {
|
|
310
246
|
setSelectedKeys(newSelectedKeys);
|
|
311
247
|
}
|
|
312
248
|
};
|
|
313
|
-
|
|
314
249
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
315
250
|
className: "".concat(prefixCls, "-wraaper")
|
|
316
251
|
}, showSearch && /*#__PURE__*/_react["default"].createElement(_antd.Input, {
|
|
@@ -345,7 +280,6 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
345
280
|
titleRender: function titleRender(nodeData) {
|
|
346
281
|
var titleKey = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.title) || 'title';
|
|
347
282
|
var title = nodeData[titleKey];
|
|
348
|
-
|
|
349
283
|
if (renderMenuList) {
|
|
350
284
|
var menuList = renderMenuList(nodeData);
|
|
351
285
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -367,12 +301,10 @@ var VtxTree = function VtxTree(_ref, ref) {
|
|
|
367
301
|
}, item.icon));
|
|
368
302
|
})));
|
|
369
303
|
}
|
|
370
|
-
|
|
371
304
|
return title;
|
|
372
305
|
}
|
|
373
306
|
}))));
|
|
374
307
|
};
|
|
375
|
-
|
|
376
308
|
VtxTree.propTypes = {
|
|
377
309
|
showSearch: _propTypes["default"].bool,
|
|
378
310
|
prefixCls: _propTypes["default"].string,
|
|
@@ -391,8 +323,5 @@ VtxTree.propTypes = {
|
|
|
391
323
|
defaultExpandAll: _propTypes["default"].bool,
|
|
392
324
|
expandAction: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].bool])
|
|
393
325
|
};
|
|
394
|
-
|
|
395
|
-
var _default = /*#__PURE__*/(0, _react.forwardRef)(VtxTree);
|
|
396
|
-
|
|
397
|
-
exports["default"] = _default;
|
|
326
|
+
var _default = exports["default"] = /*#__PURE__*/(0, _react.forwardRef)(VtxTree);
|
|
398
327
|
//# sourceMappingURL=index.js.map
|