amis-ui 6.13.0-beta.7 → 6.13.0-beta.8
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/package.json +3 -3
- package/scss/components/form/_excel.scss +110 -4
- package/esm/components/404.d.ts +0 -53
- package/esm/components/404.js +0 -35
- package/esm/components/Alert.d.ts +0 -615
- package/esm/components/Alert.js +0 -266
- package/esm/components/Alert2.d.ts +0 -117
- package/esm/components/Alert2.js +0 -58
- package/esm/components/AlphabetIndexer.d.ts +0 -11
- package/esm/components/AlphabetIndexer.js +0 -48
- package/esm/components/AnchorNav.d.ts +0 -162
- package/esm/components/AnchorNav.js +0 -153
- package/esm/components/AnchorNavSection.d.ts +0 -2
- package/esm/components/AnchorNavSection.js +0 -7
- package/esm/components/ArrayInput.d.ts +0 -617
- package/esm/components/ArrayInput.js +0 -147
- package/esm/components/AsideNav.d.ts +0 -142
- package/esm/components/AsideNav.js +0 -133
- package/esm/components/AssociatedSelection.d.ts +0 -564
- package/esm/components/AssociatedSelection.js +0 -103
- package/esm/components/AutoSizer.d.ts +0 -2
- package/esm/components/AutoSizer.js +0 -8
- package/esm/components/Avatar.d.ts +0 -374
- package/esm/components/Avatar.js +0 -126
- package/esm/components/Badge.d.ts +0 -118
- package/esm/components/Badge.js +0 -154
- package/esm/components/BaiduMapPicker.d.ts +0 -100
- package/esm/components/BaiduMapPicker.js +0 -366
- package/esm/components/BarCode.d.ts +0 -56
- package/esm/components/BarCode.js +0 -42
- package/esm/components/Breadcrumb.d.ts +0 -115
- package/esm/components/Breadcrumb.js +0 -160
- package/esm/components/Button.d.ts +0 -147
- package/esm/components/Button.js +0 -63
- package/esm/components/CalendarMobile.d.ts +0 -431
- package/esm/components/CalendarMobile.js +0 -538
- package/esm/components/Card.d.ts +0 -444
- package/esm/components/Card.js +0 -88
- package/esm/components/Cascader.d.ts +0 -108
- package/esm/components/Cascader.js +0 -515
- package/esm/components/ChainedDropdownSelection.d.ts +0 -561
- package/esm/components/ChainedDropdownSelection.js +0 -104
- package/esm/components/ChainedSelection.d.ts +0 -554
- package/esm/components/ChainedSelection.js +0 -184
- package/esm/components/Checkbox.d.ts +0 -110
- package/esm/components/Checkbox.js +0 -87
- package/esm/components/CityArea.d.ts +0 -299
- package/esm/components/CityArea.js +0 -190
- package/esm/components/CityDB.d.ts +0 -13
- package/esm/components/CityDB.js +0 -3942
- package/esm/components/CodeMirror.d.ts +0 -29
- package/esm/components/CodeMirror.js +0 -140
- package/esm/components/Collapse.d.ts +0 -447
- package/esm/components/Collapse.js +0 -184
- package/esm/components/CollapseGroup.d.ts +0 -219
- package/esm/components/CollapseGroup.js +0 -117
- package/esm/components/ColorPicker.d.ts +0 -530
- package/esm/components/ColorPicker.js +0 -260
- package/esm/components/Combo.d.ts +0 -354
- package/esm/components/Combo.js +0 -212
- package/esm/components/ConditionBuilder.d.ts +0 -2
- package/esm/components/ConditionBuilder.js +0 -7
- package/esm/components/ConfirmBox.d.ts +0 -322
- package/esm/components/ConfirmBox.js +0 -129
- package/esm/components/ContextMenu.d.ts +0 -115
- package/esm/components/ContextMenu.js +0 -305
- package/esm/components/DatePicker.d.ts +0 -638
- package/esm/components/DatePicker.js +0 -717
- package/esm/components/DateRangePicker.d.ts +0 -1046
- package/esm/components/DateRangePicker.js +0 -1389
- package/esm/components/DiffEditor.d.ts +0 -21
- package/esm/components/DiffEditor.js +0 -119
- package/esm/components/DndContainer.d.ts +0 -205
- package/esm/components/DndContainer.js +0 -25
- package/esm/components/Drawer.d.ts +0 -158
- package/esm/components/Drawer.js +0 -269
- package/esm/components/DropDownSelection.d.ts +0 -557
- package/esm/components/DropDownSelection.js +0 -78
- package/esm/components/DropdownContextMenus.d.ts +0 -84
- package/esm/components/DropdownContextMenus.js +0 -93
- package/esm/components/Editor.d.ts +0 -681
- package/esm/components/Editor.js +0 -238
- package/esm/components/Form.d.ts +0 -31
- package/esm/components/Form.js +0 -84
- package/esm/components/FormField.d.ts +0 -287
- package/esm/components/FormField.js +0 -78
- package/esm/components/FormulaPicker.d.ts +0 -2
- package/esm/components/FormulaPicker.js +0 -7
- package/esm/components/GaodeMapPicker.d.ts +0 -89
- package/esm/components/GaodeMapPicker.js +0 -204
- package/esm/components/GridNav.d.ts +0 -53
- package/esm/components/GridNav.js +0 -125
- package/esm/components/GridNavItem.d.ts +0 -2
- package/esm/components/GridNavItem.js +0 -7
- package/esm/components/GroupedSelection.d.ts +0 -543
- package/esm/components/GroupedSelection.js +0 -138
- package/esm/components/HeadCellDropDown.d.ts +0 -2
- package/esm/components/HeadCellDropDown.js +0 -7
- package/esm/components/HorizontalScroll.d.ts +0 -75
- package/esm/components/HorizontalScroll.js +0 -271
- package/esm/components/Html.d.ts +0 -82
- package/esm/components/Html.js +0 -52
- package/esm/components/Icon.d.ts +0 -2
- package/esm/components/Icon.js +0 -7
- package/esm/components/ImageGallery.d.ts +0 -465
- package/esm/components/ImageGallery.js +0 -396
- package/esm/components/Input.d.ts +0 -18
- package/esm/components/Input.js +0 -75
- package/esm/components/InputBox.d.ts +0 -100
- package/esm/components/InputBox.js +0 -98
- package/esm/components/InputBoxWithSuggestion.d.ts +0 -272
- package/esm/components/InputBoxWithSuggestion.js +0 -69
- package/esm/components/InputJSONSchema.d.ts +0 -2
- package/esm/components/InputJSONSchema.js +0 -7
- package/esm/components/InputTable.d.ts +0 -317
- package/esm/components/InputTable.js +0 -176
- package/esm/components/JSONSchemaEditor.d.ts +0 -2
- package/esm/components/JSONSchemaEditor.js +0 -7
- package/esm/components/Layout.d.ts +0 -74
- package/esm/components/Layout.js +0 -60
- package/esm/components/Link.d.ts +0 -60
- package/esm/components/Link.js +0 -44
- package/esm/components/ListGroup.d.ts +0 -77
- package/esm/components/ListGroup.js +0 -31
- package/esm/components/ListMenu.d.ts +0 -568
- package/esm/components/ListMenu.js +0 -62
- package/esm/components/LocationPicker.d.ts +0 -467
- package/esm/components/LocationPicker.js +0 -208
- package/esm/components/Markdown.d.ts +0 -25
- package/esm/components/Markdown.js +0 -70
- package/esm/components/Menu.d.ts +0 -2
- package/esm/components/Menu.js +0 -7
- package/esm/components/MobileDevTool.d.ts +0 -12
- package/esm/components/MobileDevTool.js +0 -312
- package/esm/components/Modal.d.ts +0 -1316
- package/esm/components/Modal.js +0 -261
- package/esm/components/ModalManager.d.ts +0 -17
- package/esm/components/ModalManager.js +0 -42
- package/esm/components/MonthRangePicker.d.ts +0 -744
- package/esm/components/MultilineText.d.ts +0 -454
- package/esm/components/MultilineText.js +0 -90
- package/esm/components/NumberInput.d.ts +0 -201
- package/esm/components/NumberInput.js +0 -274
- package/esm/components/OverflowTpl.d.ts +0 -61
- package/esm/components/OverflowTpl.js +0 -101
- package/esm/components/Pagination.d.ts +0 -812
- package/esm/components/Pagination.js +0 -375
- package/esm/components/PdfViewer.d.ts +0 -49
- package/esm/components/PdfViewer.js +0 -83
- package/esm/components/Picker.d.ts +0 -277
- package/esm/components/Picker.js +0 -73
- package/esm/components/PickerColumn.d.ts +0 -62
- package/esm/components/PickerColumn.js +0 -276
- package/esm/components/PickerContainer.d.ts +0 -291
- package/esm/components/PickerContainer.js +0 -157
- package/esm/components/PopOverContainer.d.ts +0 -59
- package/esm/components/PopOverContainer.js +0 -149
- package/esm/components/PopUp.d.ts +0 -573
- package/esm/components/PopUp.js +0 -85
- package/esm/components/Progress.d.ts +0 -311
- package/esm/components/Progress.js +0 -136
- package/esm/components/PullRefresh.d.ts +0 -79
- package/esm/components/PullRefresh.js +0 -172
- package/esm/components/Radios.d.ts +0 -170
- package/esm/components/Radios.js +0 -122
- package/esm/components/Range.d.ts +0 -131
- package/esm/components/Range.js +0 -517
- package/esm/components/Rating.d.ts +0 -227
- package/esm/components/Rating.js +0 -341
- package/esm/components/ResultBox.d.ts +0 -532
- package/esm/components/ResultBox.js +0 -215
- package/esm/components/ResultList.d.ts +0 -554
- package/esm/components/ResultList.js +0 -254
- package/esm/components/ResultTableList.d.ts +0 -786
- package/esm/components/ResultTableList.js +0 -152
- package/esm/components/ResultTreeList.d.ts +0 -425
- package/esm/components/ResultTreeList.js +0 -239
- package/esm/components/RichText.d.ts +0 -48
- package/esm/components/RichText.js +0 -271
- package/esm/components/SearchBox.d.ts +0 -625
- package/esm/components/SearchBox.js +0 -299
- package/esm/components/Select.d.ts +0 -6498
- package/esm/components/Select.js +0 -843
- package/esm/components/SelectMobile.d.ts +0 -38
- package/esm/components/SelectMobile.js +0 -370
- package/esm/components/Selection.d.ts +0 -598
- package/esm/components/Selection.js +0 -166
- package/esm/components/Shape.d.ts +0 -58
- package/esm/components/Shape.js +0 -429
- package/esm/components/Signature.d.ts +0 -279
- package/esm/components/Signature.js +0 -291
- package/esm/components/Slider.d.ts +0 -56
- package/esm/components/Slider.js +0 -140
- package/esm/components/SparkLine.d.ts +0 -397
- package/esm/components/SparkLine.js +0 -62
- package/esm/components/Spinner.d.ts +0 -266
- package/esm/components/Spinner.js +0 -202
- package/esm/components/Steps.d.ts +0 -117
- package/esm/components/Steps.js +0 -76
- package/esm/components/Switch.d.ts +0 -105
- package/esm/components/Switch.js +0 -73
- package/esm/components/Tab.d.ts +0 -2
- package/esm/components/Tab.js +0 -7
- package/esm/components/Table.d.ts +0 -2
- package/esm/components/Table.js +0 -7
- package/esm/components/TableSelection.d.ts +0 -791
- package/esm/components/TableSelection.js +0 -169
- package/esm/components/Tabs.d.ts +0 -670
- package/esm/components/Tabs.js +0 -607
- package/esm/components/TabsTransfer.d.ts +0 -423
- package/esm/components/TabsTransfer.js +0 -219
- package/esm/components/TabsTransferPicker.d.ts +0 -267
- package/esm/components/TabsTransferPicker.js +0 -81
- package/esm/components/Tag.d.ts +0 -307
- package/esm/components/Tag.js +0 -137
- package/esm/components/Textarea.d.ts +0 -564
- package/esm/components/Textarea.js +0 -147
- package/esm/components/Timeline.d.ts +0 -56
- package/esm/components/Timeline.js +0 -60
- package/esm/components/TimelineItem.d.ts +0 -1292
- package/esm/components/TimelineItem.js +0 -101
- package/esm/components/Tinymce.d.ts +0 -66
- package/esm/components/Tinymce.js +0 -632
- package/esm/components/TitleBar.d.ts +0 -123
- package/esm/components/TitleBar.js +0 -48
- package/esm/components/Toast.d.ts +0 -591
- package/esm/components/Toast.js +0 -247
- package/esm/components/Tooltip.d.ts +0 -65
- package/esm/components/Tooltip.js +0 -36
- package/esm/components/TooltipWrapper.d.ts +0 -217
- package/esm/components/TooltipWrapper.js +0 -181
- package/esm/components/Transfer.d.ts +0 -1844
- package/esm/components/Transfer.js +0 -481
- package/esm/components/TransferDropDown.d.ts +0 -634
- package/esm/components/TransferDropDown.js +0 -98
- package/esm/components/TransferPicker.d.ts +0 -275
- package/esm/components/TransferPicker.js +0 -98
- package/esm/components/TransferSearch.d.ts +0 -283
- package/esm/components/TransferSearch.js +0 -100
- package/esm/components/Tree.d.ts +0 -1991
- package/esm/components/Tree.js +0 -1179
- package/esm/components/TreeSelection.d.ts +0 -601
- package/esm/components/TreeSelection.js +0 -201
- package/esm/components/UserSelect.d.ts +0 -541
- package/esm/components/UserSelect.js +0 -674
- package/esm/components/UserTabSelect.d.ts +0 -315
- package/esm/components/UserTabSelect.js +0 -227
- package/esm/components/VerificationCode.d.ts +0 -116
- package/esm/components/VerificationCode.js +0 -172
- package/esm/components/VirtualList.d.ts +0 -2
- package/esm/components/VirtualList.js +0 -7
- package/esm/components/WithRemoteConfig.d.ts +0 -383
- package/esm/components/WithRemoteConfig.js +0 -302
- package/esm/components/WithStore.d.ts +0 -72
- package/esm/components/WithStore.js +0 -48
- package/esm/components/calendar/Calendar.d.ts +0 -83
- package/esm/components/calendar/Calendar.js +0 -529
- package/esm/components/calendar/CalendarContainer.d.ts +0 -10
- package/esm/components/calendar/CalendarContainer.js +0 -27
- package/esm/components/calendar/DaysView.d.ts +0 -184
- package/esm/components/calendar/DaysView.js +0 -527
- package/esm/components/calendar/MonthsView.d.ts +0 -133
- package/esm/components/calendar/MonthsView.js +0 -175
- package/esm/components/calendar/QuartersView.d.ts +0 -102
- package/esm/components/calendar/QuartersView.js +0 -125
- package/esm/components/calendar/TimeView.d.ts +0 -183
- package/esm/components/calendar/TimeView.js +0 -559
- package/esm/components/calendar/YearsView.d.ts +0 -102
- package/esm/components/calendar/YearsView.js +0 -122
- package/esm/components/condition-builder/Expression.d.ts +0 -292
- package/esm/components/condition-builder/Expression.js +0 -121
- package/esm/components/condition-builder/Field.d.ts +0 -272
- package/esm/components/condition-builder/Field.js +0 -32
- package/esm/components/condition-builder/Formula.d.ts +0 -261
- package/esm/components/condition-builder/Func.d.ts +0 -273
- package/esm/components/condition-builder/Func.js +0 -75
- package/esm/components/condition-builder/Group.d.ts +0 -310
- package/esm/components/condition-builder/Group.js +0 -191
- package/esm/components/condition-builder/GroupOrItem.d.ts +0 -87
- package/esm/components/condition-builder/GroupOrItem.js +0 -105
- package/esm/components/condition-builder/InputSwitch.d.ts +0 -47
- package/esm/components/condition-builder/InputSwitch.js +0 -28
- package/esm/components/condition-builder/Item.d.ts +0 -287
- package/esm/components/condition-builder/Item.js +0 -232
- package/esm/components/condition-builder/Value.d.ts +0 -272
- package/esm/components/condition-builder/Value.js +0 -108
- package/esm/components/condition-builder/config.d.ts +0 -36
- package/esm/components/condition-builder/config.js +0 -120
- package/esm/components/condition-builder/index.d.ts +0 -319
- package/esm/components/condition-builder/index.js +0 -228
- package/esm/components/condition-builder/types.d.ts +0 -115
- package/esm/components/formula/CodeEditor.d.ts +0 -92
- package/esm/components/formula/CodeEditor.js +0 -99
- package/esm/components/formula/Editor.d.ts +0 -516
- package/esm/components/formula/Editor.js +0 -430
- package/esm/components/formula/FuncList.d.ts +0 -46
- package/esm/components/formula/FuncList.js +0 -63
- package/esm/components/formula/Input.d.ts +0 -292
- package/esm/components/formula/Input.js +0 -122
- package/esm/components/formula/Picker.d.ts +0 -492
- package/esm/components/formula/Picker.js +0 -454
- package/esm/components/formula/VariableList.d.ts +0 -58
- package/esm/components/formula/VariableList.js +0 -182
- package/esm/components/formula/plugin.d.ts +0 -51
- package/esm/components/formula/plugin.js +0 -372
- package/esm/components/icons.d.ts +0 -61
- package/esm/components/icons.js +0 -456
- package/esm/components/index.d.ts +0 -136
- package/esm/components/json-schema/Array.d.ts +0 -3
- package/esm/components/json-schema/Array.js +0 -129
- package/esm/components/json-schema/Item.d.ts +0 -5
- package/esm/components/json-schema/Item.js +0 -63
- package/esm/components/json-schema/Object.d.ts +0 -5
- package/esm/components/json-schema/Object.js +0 -265
- package/esm/components/json-schema/index.d.ts +0 -272
- package/esm/components/json-schema/index.js +0 -29
- package/esm/components/menu/MenuContext.d.ts +0 -83
- package/esm/components/menu/MenuContext.js +0 -25
- package/esm/components/menu/MenuItem.d.ts +0 -81
- package/esm/components/menu/MenuItem.js +0 -112
- package/esm/components/menu/PanelMenu.d.ts +0 -46
- package/esm/components/menu/PanelMenu.js +0 -68
- package/esm/components/menu/SubMenu.d.ts +0 -84
- package/esm/components/menu/SubMenu.js +0 -137
- package/esm/components/menu/index.d.ts +0 -381
- package/esm/components/menu/index.js +0 -369
- package/esm/components/schema-editor/Array.d.ts +0 -11
- package/esm/components/schema-editor/Array.js +0 -84
- package/esm/components/schema-editor/Common.d.ts +0 -61
- package/esm/components/schema-editor/Common.js +0 -161
- package/esm/components/schema-editor/Item.d.ts +0 -8
- package/esm/components/schema-editor/Item.js +0 -24
- package/esm/components/schema-editor/Object.d.ts +0 -51
- package/esm/components/schema-editor/Object.js +0 -294
- package/esm/components/schema-editor/SchemaVariableList.d.ts +0 -186
- package/esm/components/schema-editor/SchemaVariableList.js +0 -74
- package/esm/components/schema-editor/SchemaVariableListPicker.d.ts +0 -179
- package/esm/components/schema-editor/SchemaVariableListPicker.js +0 -34
- package/esm/components/schema-editor/index.d.ts +0 -797
- package/esm/components/schema-editor/index.js +0 -122
- package/esm/components/table/Cell.d.ts +0 -36
- package/esm/components/table/Cell.js +0 -43
- package/esm/components/table/ColGroup.d.ts +0 -24
- package/esm/components/table/ColGroup.js +0 -58
- package/esm/components/table/Head.d.ts +0 -45
- package/esm/components/table/Head.js +0 -150
- package/esm/components/table/HeadCellDropDown.d.ts +0 -289
- package/esm/components/table/HeadCellDropDown.js +0 -55
- package/esm/components/table/HeadCellFilter.d.ts +0 -414
- package/esm/components/table/HeadCellFilter.js +0 -131
- package/esm/components/table/HeadCellSelect.d.ts +0 -357
- package/esm/components/table/HeadCellSelect.js +0 -52
- package/esm/components/table/HeadCellSort.d.ts +0 -278
- package/esm/components/table/HeadCellSort.js +0 -88
- package/esm/components/table/ItemActionsWrapper.d.ts +0 -10
- package/esm/components/table/ItemActionsWrapper.js +0 -29
- package/esm/components/table/Row.d.ts +0 -56
- package/esm/components/table/Row.js +0 -224
- package/esm/components/table/SummaryRow.d.ts +0 -28
- package/esm/components/table/SummaryRow.js +0 -73
- package/esm/components/table/index.d.ts +0 -852
- package/esm/components/table/index.js +0 -1067
- package/esm/components/table/util.d.ts +0 -56
- package/esm/components/table/util.js +0 -263
- package/esm/components/virtual-list/AutoSizer.d.ts +0 -19
- package/esm/components/virtual-list/AutoSizer.js +0 -49
- package/esm/components/virtual-list/SizeAndPositionManager.d.ts +0 -70
- package/esm/components/virtual-list/SizeAndPositionManager.js +0 -216
- package/esm/components/virtual-list/constants.d.ts +0 -34
- package/esm/components/virtual-list/constants.js +0 -45
- package/esm/components/virtual-list/index.d.ts +0 -99
- package/esm/components/virtual-list/index.js +0 -288
- package/esm/components/withBadge.d.ts +0 -2
- package/esm/components/withBadge.js +0 -7
- package/esm/hooks/index.d.ts +0 -8
- package/esm/hooks/use-click-away.d.ts +0 -12
- package/esm/hooks/use-click-away.js +0 -55
- package/esm/hooks/use-on-screen.d.ts +0 -2
- package/esm/hooks/use-on-screen.js +0 -28
- package/esm/hooks/use-set-state.d.ts +0 -2
- package/esm/hooks/use-set-state.js +0 -19
- package/esm/hooks/use-sub-form.d.ts +0 -4
- package/esm/hooks/use-sub-form.js +0 -39
- package/esm/hooks/use-touch.d.ts +0 -16
- package/esm/hooks/use-touch.js +0 -77
- package/esm/hooks/use-update-effect.d.ts +0 -3
- package/esm/hooks/use-update-effect.js +0 -21
- package/esm/hooks/use-validation-resolver.d.ts +0 -7
- package/esm/hooks/use-validation-resolver.js +0 -115
- package/esm/icons/alert-danger.svg.js +0 -22
- package/esm/icons/alert-info.svg.js +0 -22
- package/esm/icons/alert-success.svg.js +0 -22
- package/esm/icons/alert-warning.svg.js +0 -22
- package/esm/icons/arrow-double-left.svg.js +0 -24
- package/esm/icons/arrow-double-right.svg.js +0 -24
- package/esm/icons/back.svg.js +0 -21
- package/esm/icons/calendar.svg.js +0 -31
- package/esm/icons/caret.svg.js +0 -21
- package/esm/icons/check.svg.js +0 -21
- package/esm/icons/clock.svg.js +0 -29
- package/esm/icons/close-small.svg.js +0 -24
- package/esm/icons/close.svg.js +0 -21
- package/esm/icons/cloud-upload.svg.js +0 -22
- package/esm/icons/column-filter.svg.js +0 -22
- package/esm/icons/columns.svg.js +0 -21
- package/esm/icons/compress-alt.svg.js +0 -21
- package/esm/icons/copy.svg.js +0 -26
- package/esm/icons/date.svg.js +0 -26
- package/esm/icons/department.svg.js +0 -52
- package/esm/icons/desk-empty.svg.js +0 -73
- package/esm/icons/dot.svg.js +0 -36
- package/esm/icons/down-arrow-bold.svg.js +0 -22
- package/esm/icons/down.svg.js +0 -23
- package/esm/icons/download.svg.js +0 -24
- package/esm/icons/drag-bar.svg.js +0 -53
- package/esm/icons/drag.svg.js +0 -22
- package/esm/icons/edit.svg.js +0 -21
- package/esm/icons/ellipsis-v.svg.js +0 -21
- package/esm/icons/enter.svg.js +0 -20
- package/esm/icons/exchange.svg.js +0 -21
- package/esm/icons/expand-alt.svg.js +0 -21
- package/esm/icons/fail.svg.js +0 -31
- package/esm/icons/file.svg.js +0 -22
- package/esm/icons/filter.svg.js +0 -21
- package/esm/icons/folder.svg.js +0 -24
- package/esm/icons/fullscreen.svg.js +0 -21
- package/esm/icons/function.svg.js +0 -21
- package/esm/icons/home.svg.js +0 -21
- package/esm/icons/if.svg.js +0 -21
- package/esm/icons/image.svg.js +0 -20
- package/esm/icons/info-circle.svg.js +0 -21
- package/esm/icons/info.svg.js +0 -27
- package/esm/icons/input-clear.svg.js +0 -20
- package/esm/icons/invisible.svg.js +0 -22
- package/esm/icons/left-arrow.svg.js +0 -23
- package/esm/icons/loading-outline.svg.js +0 -21
- package/esm/icons/location.svg.js +0 -20
- package/esm/icons/menu.svg.js +0 -20
- package/esm/icons/minus.svg.js +0 -21
- package/esm/icons/move.svg.js +0 -22
- package/esm/icons/mute.svg.js +0 -21
- package/esm/icons/new-edit.svg.js +0 -22
- package/esm/icons/pause.svg.js +0 -21
- package/esm/icons/pencil.svg.js +0 -21
- package/esm/icons/play.svg.js +0 -20
- package/esm/icons/plus-cicle.svg.js +0 -20
- package/esm/icons/plus-fine.svg.js +0 -21
- package/esm/icons/plus.svg.js +0 -21
- package/esm/icons/post.svg.js +0 -48
- package/esm/icons/question-mark.svg.js +0 -26
- package/esm/icons/question.svg.js +0 -21
- package/esm/icons/redo.svg.js +0 -21
- package/esm/icons/refresh.svg.js +0 -21
- package/esm/icons/reload.svg.js +0 -21
- package/esm/icons/remove.svg.js +0 -21
- package/esm/icons/retry.svg.js +0 -24
- package/esm/icons/right-arrow-bold.svg.js +0 -21
- package/esm/icons/right-arrow.svg.js +0 -23
- package/esm/icons/right-double-arrow.svg.js +0 -22
- package/esm/icons/role.svg.js +0 -43
- package/esm/icons/rotate-left.svg.js +0 -22
- package/esm/icons/rotate-right.svg.js +0 -22
- package/esm/icons/rotate-screen.svg.js +0 -21
- package/esm/icons/scale-origin.svg.js +0 -24
- package/esm/icons/schedule.svg.js +0 -24
- package/esm/icons/search.svg.js +0 -21
- package/esm/icons/setting.svg.js +0 -21
- package/esm/icons/slider-handle-icon.svg.js +0 -22
- package/esm/icons/sort-asc.svg.js +0 -21
- package/esm/icons/sort-default.svg.js +0 -21
- package/esm/icons/sort-desc.svg.js +0 -21
- package/esm/icons/star.svg.js +0 -21
- package/esm/icons/status-close.svg.js +0 -23
- package/esm/icons/steps-finsh.svg.js +0 -22
- package/esm/icons/sub-plus.svg.js +0 -20
- package/esm/icons/success.svg.js +0 -29
- package/esm/icons/transparent.svg.js +0 -38
- package/esm/icons/trash.svg.js +0 -22
- package/esm/icons/tree-down.svg.js +0 -21
- package/esm/icons/undo-normal.svg.js +0 -25
- package/esm/icons/undo.svg.js +0 -21
- package/esm/icons/unfullscreen.svg.js +0 -21
- package/esm/icons/upload.svg.js +0 -21
- package/esm/icons/user-remove.svg.js +0 -33
- package/esm/icons/view.svg.js +0 -22
- package/esm/icons/volume.svg.js +0 -24
- package/esm/icons/warning-mark.svg.js +0 -22
- package/esm/icons/warning.svg.js +0 -21
- package/esm/icons/window-restore.svg.js +0 -21
- package/esm/icons/zoom-in.svg.js +0 -21
- package/esm/icons/zoom-out.svg.js +0 -21
- package/esm/index.d.ts +0 -15
- package/esm/index.js +0 -154
- package/esm/locale/de-DE.d.ts +0 -1
- package/esm/locale/de-DE.js +0 -419
- package/esm/locale/en-US.d.ts +0 -1
- package/esm/locale/en-US.js +0 -425
- package/esm/locale/zh-CN.d.ts +0 -1
- package/esm/locale/zh-CN.js +0 -434
- package/esm/themes/ang.d.ts +0 -3
- package/esm/themes/ang.js +0 -15
- package/esm/themes/antd.d.ts +0 -1
- package/esm/themes/antd.js +0 -42
- package/esm/themes/cxd.d.ts +0 -3
- package/esm/themes/cxd.js +0 -455
- package/esm/themes/dark.d.ts +0 -3
- package/esm/themes/dark.js +0 -23
- package/esm/themes/default.d.ts +0 -4
- package/esm/utils/index.d.ts +0 -2
- package/esm/utils/smoothSignature.d.ts +0 -86
- package/esm/utils/vectorComputed.d.ts +0 -20
- package/esm/utils/vectorComputed.js +0 -75
- package/esm/withRemoteConfig.d.ts +0 -2
- package/esm/withRemoteConfig.js +0 -7
- package/esm/withStore.d.ts +0 -2
- package/esm/withStore.js +0 -7
- package/lib/components/404.d.ts +0 -53
- package/lib/components/404.js +0 -43
- package/lib/components/Alert.d.ts +0 -615
- package/lib/components/Alert.js +0 -279
- package/lib/components/Alert2.d.ts +0 -117
- package/lib/components/Alert2.js +0 -66
- package/lib/components/AlphabetIndexer.d.ts +0 -11
- package/lib/components/AlphabetIndexer.js +0 -59
- package/lib/components/AnchorNav.d.ts +0 -162
- package/lib/components/AnchorNav.js +0 -162
- package/lib/components/AnchorNavSection.d.ts +0 -2
- package/lib/components/AnchorNavSection.js +0 -14
- package/lib/components/ArrayInput.d.ts +0 -617
- package/lib/components/ArrayInput.js +0 -160
- package/lib/components/AsideNav.d.ts +0 -142
- package/lib/components/AsideNav.js +0 -140
- package/lib/components/AssociatedSelection.d.ts +0 -564
- package/lib/components/AssociatedSelection.js +0 -106
- package/lib/components/AutoSizer.d.ts +0 -2
- package/lib/components/AutoSizer.js +0 -15
- package/lib/components/Avatar.d.ts +0 -374
- package/lib/components/Avatar.js +0 -154
- package/lib/components/Badge.d.ts +0 -118
- package/lib/components/Badge.js +0 -165
- package/lib/components/BaiduMapPicker.d.ts +0 -100
- package/lib/components/BaiduMapPicker.js +0 -379
- package/lib/components/BarCode.d.ts +0 -56
- package/lib/components/BarCode.js +0 -52
- package/lib/components/Breadcrumb.d.ts +0 -115
- package/lib/components/Breadcrumb.js +0 -170
- package/lib/components/Button.d.ts +0 -147
- package/lib/components/Button.js +0 -71
- package/lib/components/CalendarMobile.d.ts +0 -431
- package/lib/components/CalendarMobile.js +0 -546
- package/lib/components/Card.d.ts +0 -444
- package/lib/components/Card.js +0 -100
- package/lib/components/Cascader.d.ts +0 -108
- package/lib/components/Cascader.js +0 -527
- package/lib/components/ChainedDropdownSelection.d.ts +0 -561
- package/lib/components/ChainedDropdownSelection.js +0 -116
- package/lib/components/ChainedSelection.d.ts +0 -554
- package/lib/components/ChainedSelection.js +0 -197
- package/lib/components/Checkbox.d.ts +0 -110
- package/lib/components/Checkbox.js +0 -95
- package/lib/components/CityArea.d.ts +0 -299
- package/lib/components/CityArea.js +0 -197
- package/lib/components/CityDB.d.ts +0 -13
- package/lib/components/CityDB.js +0 -3949
- package/lib/components/CodeMirror.d.ts +0 -29
- package/lib/components/CodeMirror.js +0 -152
- package/lib/components/Collapse.d.ts +0 -447
- package/lib/components/Collapse.js +0 -192
- package/lib/components/CollapseGroup.d.ts +0 -219
- package/lib/components/CollapseGroup.js +0 -124
- package/lib/components/ColorPicker.d.ts +0 -530
- package/lib/components/ColorPicker.js +0 -267
- package/lib/components/Combo.d.ts +0 -354
- package/lib/components/Combo.js +0 -165
- package/lib/components/ConditionBuilder.d.ts +0 -2
- package/lib/components/ConditionBuilder.js +0 -14
- package/lib/components/ConfirmBox.d.ts +0 -322
- package/lib/components/ConfirmBox.js +0 -141
- package/lib/components/ContextMenu.d.ts +0 -115
- package/lib/components/ContextMenu.js +0 -322
- package/lib/components/DatePicker.d.ts +0 -638
- package/lib/components/DatePicker.js +0 -725
- package/lib/components/DateRangePicker.d.ts +0 -1046
- package/lib/components/DateRangePicker.js +0 -1401
- package/lib/components/DiffEditor.d.ts +0 -21
- package/lib/components/DiffEditor.js +0 -130
- package/lib/components/DndContainer.d.ts +0 -205
- package/lib/components/DndContainer.js +0 -32
- package/lib/components/Drawer.d.ts +0 -158
- package/lib/components/Drawer.js +0 -279
- package/lib/components/DropDownSelection.d.ts +0 -557
- package/lib/components/DropDownSelection.js +0 -85
- package/lib/components/DropdownContextMenus.d.ts +0 -84
- package/lib/components/DropdownContextMenus.js +0 -101
- package/lib/components/Editor.d.ts +0 -681
- package/lib/components/Editor.js +0 -246
- package/lib/components/Form.d.ts +0 -31
- package/lib/components/Form.js +0 -97
- package/lib/components/FormField.d.ts +0 -287
- package/lib/components/FormField.js +0 -90
- package/lib/components/FormulaPicker.d.ts +0 -2
- package/lib/components/FormulaPicker.js +0 -14
- package/lib/components/GaodeMapPicker.d.ts +0 -89
- package/lib/components/GaodeMapPicker.js +0 -217
- package/lib/components/GridNav.d.ts +0 -53
- package/lib/components/GridNav.js +0 -133
- package/lib/components/GridNavItem.d.ts +0 -2
- package/lib/components/GridNavItem.js +0 -14
- package/lib/components/GroupedSelection.d.ts +0 -543
- package/lib/components/GroupedSelection.js +0 -150
- package/lib/components/HeadCellDropDown.d.ts +0 -2
- package/lib/components/HeadCellDropDown.js +0 -14
- package/lib/components/HorizontalScroll.d.ts +0 -75
- package/lib/components/HorizontalScroll.js +0 -283
- package/lib/components/Html.d.ts +0 -82
- package/lib/components/Html.js +0 -59
- package/lib/components/Icon.d.ts +0 -2
- package/lib/components/Icon.js +0 -14
- package/lib/components/ImageGallery.d.ts +0 -465
- package/lib/components/ImageGallery.js +0 -409
- package/lib/components/Input.d.ts +0 -18
- package/lib/components/Input.js +0 -86
- package/lib/components/InputBox.d.ts +0 -100
- package/lib/components/InputBox.js +0 -110
- package/lib/components/InputBoxWithSuggestion.d.ts +0 -272
- package/lib/components/InputBoxWithSuggestion.js +0 -81
- package/lib/components/InputJSONSchema.d.ts +0 -2
- package/lib/components/InputJSONSchema.js +0 -14
- package/lib/components/InputTable.d.ts +0 -317
- package/lib/components/InputTable.js +0 -189
- package/lib/components/JSONSchemaEditor.d.ts +0 -2
- package/lib/components/JSONSchemaEditor.js +0 -14
- package/lib/components/Layout.d.ts +0 -74
- package/lib/components/Layout.js +0 -56
- package/lib/components/Link.d.ts +0 -60
- package/lib/components/Link.js +0 -56
- package/lib/components/ListGroup.d.ts +0 -77
- package/lib/components/ListGroup.js +0 -43
- package/lib/components/ListMenu.d.ts +0 -568
- package/lib/components/ListMenu.js +0 -74
- package/lib/components/LocationPicker.d.ts +0 -467
- package/lib/components/LocationPicker.js +0 -220
- package/lib/components/Markdown.d.ts +0 -25
- package/lib/components/Markdown.js +0 -83
- package/lib/components/Menu.d.ts +0 -2
- package/lib/components/Menu.js +0 -14
- package/lib/components/MobileDevTool.d.ts +0 -12
- package/lib/components/MobileDevTool.js +0 -325
- package/lib/components/Modal.d.ts +0 -1316
- package/lib/components/Modal.js +0 -272
- package/lib/components/ModalManager.d.ts +0 -17
- package/lib/components/ModalManager.js +0 -53
- package/lib/components/MonthRangePicker.d.ts +0 -744
- package/lib/components/MultilineText.d.ts +0 -454
- package/lib/components/MultilineText.js +0 -102
- package/lib/components/NumberInput.d.ts +0 -201
- package/lib/components/NumberInput.js +0 -289
- package/lib/components/OverflowTpl.d.ts +0 -61
- package/lib/components/OverflowTpl.js +0 -109
- package/lib/components/Pagination.d.ts +0 -812
- package/lib/components/Pagination.js +0 -388
- package/lib/components/PdfViewer.d.ts +0 -49
- package/lib/components/PdfViewer.js +0 -89
- package/lib/components/Picker.d.ts +0 -277
- package/lib/components/Picker.js +0 -80
- package/lib/components/PickerColumn.d.ts +0 -62
- package/lib/components/PickerColumn.js +0 -288
- package/lib/components/PickerContainer.d.ts +0 -291
- package/lib/components/PickerContainer.js +0 -169
- package/lib/components/PopOverContainer.d.ts +0 -59
- package/lib/components/PopOverContainer.js +0 -162
- package/lib/components/PopUp.d.ts +0 -573
- package/lib/components/PopUp.js +0 -94
- package/lib/components/Progress.d.ts +0 -311
- package/lib/components/Progress.js +0 -148
- package/lib/components/PullRefresh.d.ts +0 -79
- package/lib/components/PullRefresh.js +0 -178
- package/lib/components/Radios.d.ts +0 -170
- package/lib/components/Radios.js +0 -119
- package/lib/components/Range.d.ts +0 -131
- package/lib/components/Range.js +0 -528
- package/lib/components/Rating.d.ts +0 -227
- package/lib/components/Rating.js +0 -349
- package/lib/components/ResultBox.d.ts +0 -532
- package/lib/components/ResultBox.js +0 -230
- package/lib/components/ResultList.d.ts +0 -554
- package/lib/components/ResultList.js +0 -268
- package/lib/components/ResultTableList.d.ts +0 -786
- package/lib/components/ResultTableList.js +0 -161
- package/lib/components/ResultTreeList.d.ts +0 -425
- package/lib/components/ResultTreeList.js +0 -254
- package/lib/components/RichText.d.ts +0 -48
- package/lib/components/RichText.js +0 -283
- package/lib/components/SearchBox.d.ts +0 -625
- package/lib/components/SearchBox.js +0 -315
- package/lib/components/Select.d.ts +0 -6498
- package/lib/components/Select.js +0 -861
- package/lib/components/SelectMobile.d.ts +0 -38
- package/lib/components/SelectMobile.js +0 -382
- package/lib/components/Selection.d.ts +0 -598
- package/lib/components/Selection.js +0 -176
- package/lib/components/Shape.d.ts +0 -58
- package/lib/components/Shape.js +0 -434
- package/lib/components/Signature.d.ts +0 -279
- package/lib/components/Signature.js +0 -295
- package/lib/components/Slider.d.ts +0 -56
- package/lib/components/Slider.js +0 -146
- package/lib/components/SparkLine.d.ts +0 -397
- package/lib/components/SparkLine.js +0 -74
- package/lib/components/Spinner.d.ts +0 -266
- package/lib/components/Spinner.js +0 -210
- package/lib/components/Steps.d.ts +0 -117
- package/lib/components/Steps.js +0 -84
- package/lib/components/Switch.d.ts +0 -105
- package/lib/components/Switch.js +0 -80
- package/lib/components/Tab.d.ts +0 -2
- package/lib/components/Tab.js +0 -14
- package/lib/components/Table.d.ts +0 -2
- package/lib/components/Table.js +0 -14
- package/lib/components/TableSelection.d.ts +0 -791
- package/lib/components/TableSelection.js +0 -183
- package/lib/components/Tabs.d.ts +0 -670
- package/lib/components/Tabs.js +0 -618
- package/lib/components/TabsTransfer.d.ts +0 -423
- package/lib/components/TabsTransfer.js +0 -232
- package/lib/components/TabsTransferPicker.d.ts +0 -267
- package/lib/components/TabsTransferPicker.js +0 -93
- package/lib/components/Tag.d.ts +0 -307
- package/lib/components/Tag.js +0 -146
- package/lib/components/Textarea.d.ts +0 -564
- package/lib/components/Textarea.js +0 -160
- package/lib/components/Timeline.d.ts +0 -56
- package/lib/components/Timeline.js +0 -68
- package/lib/components/TimelineItem.d.ts +0 -1292
- package/lib/components/TimelineItem.js +0 -118
- package/lib/components/Tinymce.d.ts +0 -66
- package/lib/components/Tinymce.js +0 -648
- package/lib/components/TitleBar.d.ts +0 -123
- package/lib/components/TitleBar.js +0 -51
- package/lib/components/Toast.d.ts +0 -591
- package/lib/components/Toast.js +0 -258
- package/lib/components/Tooltip.d.ts +0 -65
- package/lib/components/Tooltip.js +0 -43
- package/lib/components/TooltipWrapper.d.ts +0 -217
- package/lib/components/TooltipWrapper.js +0 -188
- package/lib/components/Transfer.d.ts +0 -1844
- package/lib/components/Transfer.js +0 -498
- package/lib/components/TransferDropDown.d.ts +0 -634
- package/lib/components/TransferDropDown.js +0 -106
- package/lib/components/TransferPicker.d.ts +0 -275
- package/lib/components/TransferPicker.js +0 -110
- package/lib/components/TransferSearch.d.ts +0 -283
- package/lib/components/TransferSearch.js +0 -113
- package/lib/components/Tree.d.ts +0 -1991
- package/lib/components/Tree.js +0 -1173
- package/lib/components/TreeSelection.d.ts +0 -601
- package/lib/components/TreeSelection.js +0 -209
- package/lib/components/UserSelect.d.ts +0 -541
- package/lib/components/UserSelect.js +0 -685
- package/lib/components/UserTabSelect.d.ts +0 -315
- package/lib/components/UserTabSelect.js +0 -235
- package/lib/components/VerificationCode.d.ts +0 -116
- package/lib/components/VerificationCode.js +0 -191
- package/lib/components/VirtualList.d.ts +0 -2
- package/lib/components/VirtualList.js +0 -14
- package/lib/components/WithRemoteConfig.d.ts +0 -383
- package/lib/components/WithRemoteConfig.js +0 -316
- package/lib/components/WithStore.d.ts +0 -72
- package/lib/components/WithStore.js +0 -61
- package/lib/components/calendar/Calendar.d.ts +0 -83
- package/lib/components/calendar/Calendar.js +0 -542
- package/lib/components/calendar/CalendarContainer.d.ts +0 -10
- package/lib/components/calendar/CalendarContainer.js +0 -38
- package/lib/components/calendar/DaysView.d.ts +0 -184
- package/lib/components/calendar/DaysView.js +0 -546
- package/lib/components/calendar/MonthsView.d.ts +0 -133
- package/lib/components/calendar/MonthsView.js +0 -188
- package/lib/components/calendar/QuartersView.d.ts +0 -102
- package/lib/components/calendar/QuartersView.js +0 -138
- package/lib/components/calendar/TimeView.d.ts +0 -183
- package/lib/components/calendar/TimeView.js +0 -574
- package/lib/components/calendar/YearsView.d.ts +0 -102
- package/lib/components/calendar/YearsView.js +0 -135
- package/lib/components/condition-builder/Expression.d.ts +0 -292
- package/lib/components/condition-builder/Expression.js +0 -133
- package/lib/components/condition-builder/Field.d.ts +0 -272
- package/lib/components/condition-builder/Field.js +0 -44
- package/lib/components/condition-builder/Formula.d.ts +0 -261
- package/lib/components/condition-builder/Func.d.ts +0 -273
- package/lib/components/condition-builder/Func.js +0 -87
- package/lib/components/condition-builder/Group.d.ts +0 -310
- package/lib/components/condition-builder/Group.js +0 -203
- package/lib/components/condition-builder/GroupOrItem.d.ts +0 -87
- package/lib/components/condition-builder/GroupOrItem.js +0 -117
- package/lib/components/condition-builder/InputSwitch.d.ts +0 -47
- package/lib/components/condition-builder/InputSwitch.js +0 -36
- package/lib/components/condition-builder/Item.d.ts +0 -287
- package/lib/components/condition-builder/Item.js +0 -244
- package/lib/components/condition-builder/Value.d.ts +0 -272
- package/lib/components/condition-builder/Value.js +0 -121
- package/lib/components/condition-builder/config.d.ts +0 -36
- package/lib/components/condition-builder/config.js +0 -125
- package/lib/components/condition-builder/index.d.ts +0 -319
- package/lib/components/condition-builder/index.js +0 -240
- package/lib/components/condition-builder/types.d.ts +0 -115
- package/lib/components/formula/CodeEditor.d.ts +0 -92
- package/lib/components/formula/CodeEditor.js +0 -110
- package/lib/components/formula/Editor.d.ts +0 -516
- package/lib/components/formula/Editor.js +0 -444
- package/lib/components/formula/FuncList.d.ts +0 -46
- package/lib/components/formula/FuncList.js +0 -75
- package/lib/components/formula/Input.d.ts +0 -292
- package/lib/components/formula/Input.js +0 -134
- package/lib/components/formula/Picker.d.ts +0 -492
- package/lib/components/formula/Picker.js +0 -467
- package/lib/components/formula/VariableList.d.ts +0 -58
- package/lib/components/formula/VariableList.js +0 -193
- package/lib/components/formula/plugin.d.ts +0 -51
- package/lib/components/formula/plugin.js +0 -381
- package/lib/components/icons.d.ts +0 -61
- package/lib/components/icons.js +0 -484
- package/lib/components/index.d.ts +0 -136
- package/lib/components/json-schema/Array.d.ts +0 -3
- package/lib/components/json-schema/Array.js +0 -140
- package/lib/components/json-schema/Item.d.ts +0 -5
- package/lib/components/json-schema/Item.js +0 -75
- package/lib/components/json-schema/Object.d.ts +0 -5
- package/lib/components/json-schema/Object.js +0 -278
- package/lib/components/json-schema/index.d.ts +0 -272
- package/lib/components/json-schema/index.js +0 -40
- package/lib/components/menu/MenuContext.d.ts +0 -83
- package/lib/components/menu/MenuContext.js +0 -29
- package/lib/components/menu/MenuItem.d.ts +0 -81
- package/lib/components/menu/MenuItem.js +0 -120
- package/lib/components/menu/PanelMenu.d.ts +0 -46
- package/lib/components/menu/PanelMenu.js +0 -74
- package/lib/components/menu/SubMenu.d.ts +0 -84
- package/lib/components/menu/SubMenu.js +0 -145
- package/lib/components/menu/index.d.ts +0 -381
- package/lib/components/menu/index.js +0 -379
- package/lib/components/schema-editor/Array.d.ts +0 -11
- package/lib/components/schema-editor/Array.js +0 -95
- package/lib/components/schema-editor/Common.d.ts +0 -61
- package/lib/components/schema-editor/Common.js +0 -174
- package/lib/components/schema-editor/Item.d.ts +0 -8
- package/lib/components/schema-editor/Item.js +0 -35
- package/lib/components/schema-editor/Object.d.ts +0 -51
- package/lib/components/schema-editor/Object.js +0 -305
- package/lib/components/schema-editor/SchemaVariableList.d.ts +0 -186
- package/lib/components/schema-editor/SchemaVariableList.js +0 -86
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +0 -179
- package/lib/components/schema-editor/SchemaVariableListPicker.js +0 -46
- package/lib/components/schema-editor/index.d.ts +0 -797
- package/lib/components/schema-editor/index.js +0 -131
- package/lib/components/table/Cell.d.ts +0 -36
- package/lib/components/table/Cell.js +0 -50
- package/lib/components/table/ColGroup.d.ts +0 -24
- package/lib/components/table/ColGroup.js +0 -69
- package/lib/components/table/Head.d.ts +0 -45
- package/lib/components/table/Head.js +0 -157
- package/lib/components/table/HeadCellDropDown.d.ts +0 -289
- package/lib/components/table/HeadCellDropDown.js +0 -63
- package/lib/components/table/HeadCellFilter.d.ts +0 -414
- package/lib/components/table/HeadCellFilter.js +0 -140
- package/lib/components/table/HeadCellSelect.d.ts +0 -357
- package/lib/components/table/HeadCellSelect.js +0 -60
- package/lib/components/table/HeadCellSort.d.ts +0 -278
- package/lib/components/table/HeadCellSort.js +0 -96
- package/lib/components/table/ItemActionsWrapper.d.ts +0 -10
- package/lib/components/table/ItemActionsWrapper.js +0 -40
- package/lib/components/table/Row.d.ts +0 -56
- package/lib/components/table/Row.js +0 -231
- package/lib/components/table/SummaryRow.d.ts +0 -28
- package/lib/components/table/SummaryRow.js +0 -81
- package/lib/components/table/index.d.ts +0 -852
- package/lib/components/table/index.js +0 -1081
- package/lib/components/table/util.d.ts +0 -56
- package/lib/components/table/util.js +0 -285
- package/lib/components/virtual-list/AutoSizer.d.ts +0 -19
- package/lib/components/virtual-list/AutoSizer.js +0 -76
- package/lib/components/virtual-list/SizeAndPositionManager.d.ts +0 -70
- package/lib/components/virtual-list/SizeAndPositionManager.js +0 -220
- package/lib/components/virtual-list/constants.d.ts +0 -34
- package/lib/components/virtual-list/constants.js +0 -53
- package/lib/components/virtual-list/index.d.ts +0 -99
- package/lib/components/virtual-list/index.js +0 -317
- package/lib/components/withBadge.d.ts +0 -2
- package/lib/components/withBadge.js +0 -14
- package/lib/helper.css +0 -47744
- package/lib/hooks/index.d.ts +0 -8
- package/lib/hooks/use-click-away.d.ts +0 -12
- package/lib/hooks/use-click-away.js +0 -59
- package/lib/hooks/use-on-screen.d.ts +0 -2
- package/lib/hooks/use-on-screen.js +0 -32
- package/lib/hooks/use-set-state.d.ts +0 -2
- package/lib/hooks/use-set-state.js +0 -27
- package/lib/hooks/use-sub-form.d.ts +0 -4
- package/lib/hooks/use-sub-form.js +0 -48
- package/lib/hooks/use-touch.d.ts +0 -16
- package/lib/hooks/use-touch.js +0 -81
- package/lib/hooks/use-update-effect.d.ts +0 -3
- package/lib/hooks/use-update-effect.js +0 -25
- package/lib/hooks/use-validation-resolver.d.ts +0 -7
- package/lib/hooks/use-validation-resolver.js +0 -125
- package/lib/icons/alert-danger.svg.js +0 -29
- package/lib/icons/alert-info.svg.js +0 -29
- package/lib/icons/alert-success.svg.js +0 -29
- package/lib/icons/alert-warning.svg.js +0 -29
- package/lib/icons/arrow-double-left.svg.js +0 -31
- package/lib/icons/arrow-double-right.svg.js +0 -31
- package/lib/icons/back.svg.js +0 -28
- package/lib/icons/calendar.svg.js +0 -38
- package/lib/icons/caret.svg.js +0 -28
- package/lib/icons/check.svg.js +0 -28
- package/lib/icons/clock.svg.js +0 -36
- package/lib/icons/close-small.svg.js +0 -31
- package/lib/icons/close.svg.js +0 -28
- package/lib/icons/cloud-upload.svg.js +0 -29
- package/lib/icons/column-filter.svg.js +0 -29
- package/lib/icons/columns.svg.js +0 -28
- package/lib/icons/compress-alt.svg.js +0 -28
- package/lib/icons/copy.svg.js +0 -33
- package/lib/icons/date.svg.js +0 -33
- package/lib/icons/department.svg.js +0 -59
- package/lib/icons/desk-empty.svg.js +0 -80
- package/lib/icons/dot.svg.js +0 -43
- package/lib/icons/down-arrow-bold.svg.js +0 -29
- package/lib/icons/down.svg.js +0 -30
- package/lib/icons/download.svg.js +0 -31
- package/lib/icons/drag-bar.svg.js +0 -60
- package/lib/icons/drag.svg.js +0 -29
- package/lib/icons/edit.svg.js +0 -28
- package/lib/icons/ellipsis-v.svg.js +0 -28
- package/lib/icons/enter.svg.js +0 -27
- package/lib/icons/exchange.svg.js +0 -28
- package/lib/icons/expand-alt.svg.js +0 -28
- package/lib/icons/fail.svg.js +0 -38
- package/lib/icons/file.svg.js +0 -29
- package/lib/icons/filter.svg.js +0 -28
- package/lib/icons/folder.svg.js +0 -31
- package/lib/icons/fullscreen.svg.js +0 -28
- package/lib/icons/function.svg.js +0 -28
- package/lib/icons/home.svg.js +0 -28
- package/lib/icons/if.svg.js +0 -28
- package/lib/icons/image.svg.js +0 -27
- package/lib/icons/info-circle.svg.js +0 -28
- package/lib/icons/info.svg.js +0 -34
- package/lib/icons/input-clear.svg.js +0 -27
- package/lib/icons/invisible.svg.js +0 -29
- package/lib/icons/left-arrow.svg.js +0 -30
- package/lib/icons/loading-outline.svg.js +0 -28
- package/lib/icons/location.svg.js +0 -27
- package/lib/icons/menu.svg.js +0 -27
- package/lib/icons/minus.svg.js +0 -28
- package/lib/icons/move.svg.js +0 -29
- package/lib/icons/mute.svg.js +0 -28
- package/lib/icons/new-edit.svg.js +0 -29
- package/lib/icons/pause.svg.js +0 -28
- package/lib/icons/pencil.svg.js +0 -28
- package/lib/icons/play.svg.js +0 -27
- package/lib/icons/plus-cicle.svg.js +0 -27
- package/lib/icons/plus-fine.svg.js +0 -28
- package/lib/icons/plus.svg.js +0 -28
- package/lib/icons/post.svg.js +0 -55
- package/lib/icons/question-mark.svg.js +0 -33
- package/lib/icons/question.svg.js +0 -28
- package/lib/icons/redo.svg.js +0 -28
- package/lib/icons/refresh.svg.js +0 -28
- package/lib/icons/reload.svg.js +0 -28
- package/lib/icons/remove.svg.js +0 -28
- package/lib/icons/retry.svg.js +0 -31
- package/lib/icons/right-arrow-bold.svg.js +0 -28
- package/lib/icons/right-arrow.svg.js +0 -30
- package/lib/icons/right-double-arrow.svg.js +0 -29
- package/lib/icons/role.svg.js +0 -50
- package/lib/icons/rotate-left.svg.js +0 -29
- package/lib/icons/rotate-right.svg.js +0 -29
- package/lib/icons/rotate-screen.svg.js +0 -28
- package/lib/icons/scale-origin.svg.js +0 -31
- package/lib/icons/schedule.svg.js +0 -31
- package/lib/icons/search.svg.js +0 -28
- package/lib/icons/setting.svg.js +0 -28
- package/lib/icons/slider-handle-icon.svg.js +0 -29
- package/lib/icons/sort-asc.svg.js +0 -28
- package/lib/icons/sort-default.svg.js +0 -28
- package/lib/icons/sort-desc.svg.js +0 -28
- package/lib/icons/star.svg.js +0 -28
- package/lib/icons/status-close.svg.js +0 -30
- package/lib/icons/steps-finsh.svg.js +0 -29
- package/lib/icons/sub-plus.svg.js +0 -27
- package/lib/icons/success.svg.js +0 -36
- package/lib/icons/transparent.svg.js +0 -45
- package/lib/icons/trash.svg.js +0 -29
- package/lib/icons/tree-down.svg.js +0 -28
- package/lib/icons/undo-normal.svg.js +0 -32
- package/lib/icons/undo.svg.js +0 -28
- package/lib/icons/unfullscreen.svg.js +0 -28
- package/lib/icons/upload.svg.js +0 -28
- package/lib/icons/user-remove.svg.js +0 -40
- package/lib/icons/view.svg.js +0 -29
- package/lib/icons/volume.svg.js +0 -31
- package/lib/icons/warning-mark.svg.js +0 -29
- package/lib/icons/warning.svg.js +0 -28
- package/lib/icons/window-restore.svg.js +0 -28
- package/lib/icons/zoom-in.svg.js +0 -28
- package/lib/icons/zoom-out.svg.js +0 -28
- package/lib/index.d.ts +0 -15
- package/lib/index.js +0 -344
- package/lib/locale/de-DE.d.ts +0 -1
- package/lib/locale/de-DE.js +0 -421
- package/lib/locale/en-US.d.ts +0 -1
- package/lib/locale/en-US.js +0 -427
- package/lib/locale/zh-CN.d.ts +0 -1
- package/lib/locale/zh-CN.js +0 -436
- package/lib/scss/helper.scss.js +0 -12
- package/lib/scss/themes/ang.scss.js +0 -12
- package/lib/scss/themes/antd.scss.js +0 -12
- package/lib/scss/themes/cxd.scss.js +0 -12
- package/lib/scss/themes/dark.scss.js +0 -12
- package/lib/scss/themes/default.scss.js +0 -12
- package/lib/themes/ang.css +0 -46140
- package/lib/themes/ang.d.ts +0 -3
- package/lib/themes/ang.js +0 -20
- package/lib/themes/antd.css +0 -46127
- package/lib/themes/antd.d.ts +0 -1
- package/lib/themes/antd.js +0 -44
- package/lib/themes/cxd.css +0 -46116
- package/lib/themes/cxd.d.ts +0 -3
- package/lib/themes/cxd.js +0 -459
- package/lib/themes/dark.css +0 -46147
- package/lib/themes/dark.d.ts +0 -3
- package/lib/themes/dark.js +0 -28
- package/lib/themes/default.css +0 -46116
- package/lib/themes/default.d.ts +0 -4
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/smoothSignature.d.ts +0 -86
- package/lib/utils/vectorComputed.d.ts +0 -20
- package/lib/utils/vectorComputed.js +0 -84
- package/lib/withRemoteConfig.d.ts +0 -2
- package/lib/withRemoteConfig.js +0 -14
- package/lib/withStore.d.ts +0 -2
- package/lib/withStore.js +0 -14
package/esm/components/Tree.js
DELETED
|
@@ -1,1179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* amis-ui v6.13.0-beta.7
|
|
3
|
-
* Copyright 2018-2025 fex
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { __extends, __assign, __spreadArray, __read, __values, __decorate, __metadata } from 'tslib';
|
|
7
|
-
import React__default from 'react';
|
|
8
|
-
import { resizeSensor, eachTree, getTreeAncestors, flattenTree, flattenTreeWithLeafNodes, getTreeParent, findTreeIndex, isVisible, highlight, hasAbility, calculateHeight, autobind, themeable, localeable } from 'amis-core';
|
|
9
|
-
import { value2array } from './Select.js';
|
|
10
|
-
import { Icon } from './icons.js';
|
|
11
|
-
import Checkbox from './Checkbox.js';
|
|
12
|
-
import Spinner from './Spinner.js';
|
|
13
|
-
import VirtualList from './virtual-list/index.js';
|
|
14
|
-
import TooltipWrapper from './TooltipWrapper.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @file Tree
|
|
18
|
-
* @description 树形组件
|
|
19
|
-
*
|
|
20
|
-
* 情况列举:
|
|
21
|
-
* 1. 选中父节点时,连带选中子节点 : autoChildren = true 前提条件
|
|
22
|
-
* 1.1 交互
|
|
23
|
-
* 1.1.1 子节点不可以取消勾选 cascade = false,
|
|
24
|
-
* 1.1.2 子节点可以取消勾选 cascade = true, withChildren 失效
|
|
25
|
-
* 1.2 数据(state.value)
|
|
26
|
-
* 1.2.1 只提交父节点数据 cascade = false
|
|
27
|
-
* 1.2.2 只提交子节点的数据 onlyChildren = true
|
|
28
|
-
* 1.2.3 全部数据提交 withChildren = true || cascade = true
|
|
29
|
-
*
|
|
30
|
-
* 2. 选中节点时,只选中当前节点,没有联动效果
|
|
31
|
-
*
|
|
32
|
-
* @author fex
|
|
33
|
-
*/
|
|
34
|
-
var TreeSelector = /** @class */ (function (_super) {
|
|
35
|
-
__extends(TreeSelector, _super);
|
|
36
|
-
function TreeSelector(props) {
|
|
37
|
-
var _this = _super.call(this, props) || this;
|
|
38
|
-
// 展开的节点
|
|
39
|
-
_this.unfolded = new WeakMap();
|
|
40
|
-
// key: child option, value: parent option;
|
|
41
|
-
_this.relations = new WeakMap();
|
|
42
|
-
_this.levels = new WeakMap();
|
|
43
|
-
_this.startPoint = {
|
|
44
|
-
x: 0,
|
|
45
|
-
y: 0
|
|
46
|
-
};
|
|
47
|
-
_this.root = React__default.createRef();
|
|
48
|
-
_this.virtualListRef = React__default.createRef();
|
|
49
|
-
var value = value2array(props.value, {
|
|
50
|
-
multiple: props.multiple,
|
|
51
|
-
delimiter: props.delimiter,
|
|
52
|
-
valueField: props.valueField,
|
|
53
|
-
labelField: props.labelField,
|
|
54
|
-
options: props.options,
|
|
55
|
-
pathSeparator: props.pathSeparator
|
|
56
|
-
}, props.enableNodePath);
|
|
57
|
-
_this.state = {
|
|
58
|
-
value: value,
|
|
59
|
-
valueSet: new Set(value),
|
|
60
|
-
flattenedOptions: [],
|
|
61
|
-
inputValue: '',
|
|
62
|
-
addingParent: null,
|
|
63
|
-
isAdding: false,
|
|
64
|
-
isEditing: false,
|
|
65
|
-
editingItem: null,
|
|
66
|
-
dropIndicator: undefined,
|
|
67
|
-
virtualHeight: 0
|
|
68
|
-
};
|
|
69
|
-
_this.syncUnFolded(props, undefined, true);
|
|
70
|
-
_this.flattenOptions(props, true);
|
|
71
|
-
return _this;
|
|
72
|
-
}
|
|
73
|
-
TreeSelector.prototype.componentDidMount = function () {
|
|
74
|
-
var _this = this;
|
|
75
|
-
var _a, _b;
|
|
76
|
-
var enableNodePath = this.props.enableNodePath;
|
|
77
|
-
// onRef只有渲染器的情况才会使用
|
|
78
|
-
(_b = (_a = this.props).onRef) === null || _b === void 0 ? void 0 : _b.call(_a, this);
|
|
79
|
-
enableNodePath && this.expandLazyLoadNodes();
|
|
80
|
-
this.handleVirtualHeight();
|
|
81
|
-
this.unSensor = resizeSensor(this.root.current, function () {
|
|
82
|
-
_this.handleVirtualHeight();
|
|
83
|
-
}, false, 'height');
|
|
84
|
-
};
|
|
85
|
-
TreeSelector.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
86
|
-
var props = this.props;
|
|
87
|
-
var state = this.state;
|
|
88
|
-
if (prevProps.options !== props.options) {
|
|
89
|
-
this.syncUnFolded(props);
|
|
90
|
-
this.flattenOptions(props);
|
|
91
|
-
}
|
|
92
|
-
if (prevProps.value !== props.value ||
|
|
93
|
-
prevProps.options !== props.options) {
|
|
94
|
-
var newValue = value2array(props.value, {
|
|
95
|
-
multiple: props.multiple,
|
|
96
|
-
delimiter: props.delimiter,
|
|
97
|
-
valueField: props.valueField,
|
|
98
|
-
pathSeparator: props.pathSeparator,
|
|
99
|
-
options: props.options,
|
|
100
|
-
labelField: props.labelField
|
|
101
|
-
}, props.enableNodePath);
|
|
102
|
-
this.setState({
|
|
103
|
-
value: newValue,
|
|
104
|
-
valueSet: new Set(newValue)
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (prevState.isAdding !== state.isAdding ||
|
|
108
|
-
prevState.flattenedOptions !== state.flattenedOptions) {
|
|
109
|
-
this.handleVirtualHeight();
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
TreeSelector.prototype.componentWillUnmount = function () {
|
|
113
|
-
// clear data
|
|
114
|
-
this.relations = this.unfolded = this.levels = new WeakMap();
|
|
115
|
-
if (this.unSensor) {
|
|
116
|
-
this.unSensor();
|
|
117
|
-
delete this.unSensor;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* 展开懒加载节点的父节点
|
|
122
|
-
*/
|
|
123
|
-
TreeSelector.prototype.expandLazyLoadNodes = function () {
|
|
124
|
-
var _a = this.props, pathSeparator = _a.pathSeparator, onExpandTree = _a.onExpandTree, _b = _a.nodePath, nodePath = _b === void 0 ? [] : _b;
|
|
125
|
-
var nodePathArr = nodePath.map(function (path) {
|
|
126
|
-
return path ? path.toString().split(pathSeparator) : [];
|
|
127
|
-
});
|
|
128
|
-
onExpandTree === null || onExpandTree === void 0 ? void 0 : onExpandTree(nodePathArr);
|
|
129
|
-
};
|
|
130
|
-
TreeSelector.prototype.syncUnFolded = function (props, unfoldedLevel, initial) {
|
|
131
|
-
// 传入默认展开层级需要重新初始化unfolded
|
|
132
|
-
var initFoldedLevel = typeof unfoldedLevel !== 'undefined';
|
|
133
|
-
var expandLevel = Number(initFoldedLevel ? unfoldedLevel : props.unfoldedLevel);
|
|
134
|
-
// 初始化树节点的展开状态
|
|
135
|
-
var unfolded = this.unfolded;
|
|
136
|
-
var _a = this.props, deferField = _a.deferField, foldedField = _a.foldedField, unfoldedField = _a.unfoldedField;
|
|
137
|
-
eachTree(props.options, function (node, index, level) {
|
|
138
|
-
if (unfolded.has(node) && !initFoldedLevel) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (node.children && node.children.length) {
|
|
142
|
-
var ret = true;
|
|
143
|
-
if (node[deferField] &&
|
|
144
|
-
node.loaded &&
|
|
145
|
-
!initFoldedLevel &&
|
|
146
|
-
unfoldedField &&
|
|
147
|
-
node[unfoldedField] !== false) {
|
|
148
|
-
ret = true;
|
|
149
|
-
}
|
|
150
|
-
else if (unfoldedField &&
|
|
151
|
-
typeof node[unfoldedField] !== 'undefined') {
|
|
152
|
-
ret = !!node[unfoldedField];
|
|
153
|
-
}
|
|
154
|
-
else if (foldedField && typeof node[foldedField] !== 'undefined') {
|
|
155
|
-
ret = !node[foldedField];
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
ret = !!props.initiallyOpen && !initFoldedLevel;
|
|
159
|
-
if (!ret && level <= expandLevel) {
|
|
160
|
-
ret = true;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
unfolded.set(node, ret);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
initFoldedLevel && this.forceUpdate();
|
|
167
|
-
this.flattenOptions(undefined, initial);
|
|
168
|
-
return unfolded;
|
|
169
|
-
};
|
|
170
|
-
TreeSelector.prototype.toggleUnfolded = function (node) {
|
|
171
|
-
var unfolded = this.unfolded;
|
|
172
|
-
var _a = this.props, deferField = _a.deferField, onDeferLoad = _a.onDeferLoad, unfoldedField = _a.unfoldedField;
|
|
173
|
-
if (node[deferField] && !node.loaded) {
|
|
174
|
-
onDeferLoad === null || onDeferLoad === void 0 ? void 0 : onDeferLoad(node);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
// ! hack: 在node上直接添加属性,options 在更新的时候旧的字段会保留
|
|
178
|
-
if (node[deferField] && node.loaded) {
|
|
179
|
-
node[unfoldedField] = !unfolded.get(node);
|
|
180
|
-
}
|
|
181
|
-
unfolded.set(node, !unfolded.get(node));
|
|
182
|
-
this.flattenOptions();
|
|
183
|
-
this.forceUpdate();
|
|
184
|
-
};
|
|
185
|
-
TreeSelector.prototype.isUnfolded = function (node) {
|
|
186
|
-
var unfolded = this.unfolded;
|
|
187
|
-
var parent = this.relations.get(node);
|
|
188
|
-
if (parent) {
|
|
189
|
-
return !!unfolded.get(node) && this.isUnfolded(parent);
|
|
190
|
-
}
|
|
191
|
-
return !!unfolded.get(node);
|
|
192
|
-
};
|
|
193
|
-
TreeSelector.prototype.clearSelect = function () {
|
|
194
|
-
var _this = this;
|
|
195
|
-
this.setState({
|
|
196
|
-
value: []
|
|
197
|
-
}, function () {
|
|
198
|
-
var _a = _this.props, joinValues = _a.joinValues, rootValue = _a.rootValue, onChange = _a.onChange;
|
|
199
|
-
onChange(joinValues ? rootValue : []);
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* enableNodePath为true时,将label和value转换成node path格式
|
|
204
|
-
*/
|
|
205
|
-
TreeSelector.prototype.transform2NodePath = function (value) {
|
|
206
|
-
var _a = this.props, multiple = _a.multiple, options = _a.options, valueField = _a.valueField, labelField = _a.labelField, joinValues = _a.joinValues, extractValue = _a.extractValue, pathSeparator = _a.pathSeparator, delimiter = _a.delimiter;
|
|
207
|
-
var nodesValuePath = [];
|
|
208
|
-
var selectedNodes = Array.isArray(value) ? value.concat() : [value];
|
|
209
|
-
var selectedNodesPath = selectedNodes.map(function (node) {
|
|
210
|
-
var _a, _b;
|
|
211
|
-
var _c;
|
|
212
|
-
var nodePath = (_c = getTreeAncestors(options, node, true)) === null || _c === void 0 ? void 0 : _c.reduce(function (acc, node) {
|
|
213
|
-
acc[labelField].push(node[labelField]);
|
|
214
|
-
acc[valueField].push(node[valueField]);
|
|
215
|
-
return acc;
|
|
216
|
-
}, (_a = {}, _a[labelField] = [], _a[valueField] = [], _a));
|
|
217
|
-
var nodeValuePath = nodePath[valueField].join(pathSeparator);
|
|
218
|
-
nodesValuePath.push(nodeValuePath);
|
|
219
|
-
return __assign(__assign({}, node), (_b = {}, _b[labelField] = nodePath[labelField].join(pathSeparator), _b[valueField] = nodeValuePath, _b));
|
|
220
|
-
});
|
|
221
|
-
if (multiple) {
|
|
222
|
-
return joinValues
|
|
223
|
-
? nodesValuePath.join(delimiter)
|
|
224
|
-
: extractValue
|
|
225
|
-
? nodesValuePath
|
|
226
|
-
: selectedNodesPath;
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
return joinValues || extractValue
|
|
230
|
-
? selectedNodesPath[0][valueField]
|
|
231
|
-
: selectedNodesPath[0];
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
TreeSelector.prototype.handleSelect = function (node, value) {
|
|
235
|
-
var _this = this;
|
|
236
|
-
var _a = this.props, joinValues = _a.joinValues, valueField = _a.valueField, deferField = _a.deferField, onChange = _a.onChange, enableNodePath = _a.enableNodePath, onlyLeaf = _a.onlyLeaf;
|
|
237
|
-
if (node[valueField] === undefined) {
|
|
238
|
-
if (node[deferField] && !node.loaded) {
|
|
239
|
-
this.toggleUnfolded(node);
|
|
240
|
-
}
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
if (onlyLeaf && Array.isArray(node.children) && node.children.length) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
this.setState({
|
|
247
|
-
value: [node]
|
|
248
|
-
}, function () {
|
|
249
|
-
onChange(enableNodePath
|
|
250
|
-
? _this.transform2NodePath(node)
|
|
251
|
-
: joinValues
|
|
252
|
-
? node[valueField]
|
|
253
|
-
: node);
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
TreeSelector.prototype.handleItemClick = function (node, checked) {
|
|
257
|
-
var _a;
|
|
258
|
-
var _b = this.props, onHandleNodeClick = _b.onHandleNodeClick, multiple = _b.multiple, _c = _b.nodeBehavior, nodeBehavior = _c === void 0 ? ['check'] : _c;
|
|
259
|
-
onHandleNodeClick && onHandleNodeClick(node);
|
|
260
|
-
if ((nodeBehavior === null || nodeBehavior === void 0 ? void 0 : nodeBehavior.includes('unfold')) && ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
261
|
-
this.toggleUnfolded(node);
|
|
262
|
-
}
|
|
263
|
-
if (nodeBehavior === null || nodeBehavior === void 0 ? void 0 : nodeBehavior.includes('check')) {
|
|
264
|
-
multiple ? this.handleCheck(node, !checked) : this.handleSelect(node);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
TreeSelector.prototype.handleCheck = function (item, checked) {
|
|
268
|
-
var _this = this;
|
|
269
|
-
// TODO: 重新梳理这里的逻辑
|
|
270
|
-
var props = this.props;
|
|
271
|
-
var value = this.state.valueSet;
|
|
272
|
-
var onlyChildren = props.onlyChildren, withChildren = props.withChildren, cascade = props.cascade, autoCheckChildren = props.autoCheckChildren, autoCancelParent = props.autoCancelParent, valueField = props.valueField;
|
|
273
|
-
if (checked) {
|
|
274
|
-
if (!value.has(item)) {
|
|
275
|
-
value.add(item);
|
|
276
|
-
}
|
|
277
|
-
// cascade 为 true 表示父节点跟子节点没有级联关系。
|
|
278
|
-
if (autoCheckChildren) {
|
|
279
|
-
var children = item.children ? __spreadArray([], __read(item.children), false) : [];
|
|
280
|
-
var hasDisabled = flattenTree(children).some(function (item) { return item === null || item === void 0 ? void 0 : item.disabled; });
|
|
281
|
-
if (onlyChildren) {
|
|
282
|
-
// 这个 isAllChecked 主要是判断如果有disabled的item项,这时父节点还是选中的话,针对性的处理逻辑
|
|
283
|
-
var isAllChecked = flattenTreeWithLeafNodes(children)
|
|
284
|
-
.filter(function (item) { return !(item === null || item === void 0 ? void 0 : item.disabled); })
|
|
285
|
-
.every(function (v) { return value.has(v); });
|
|
286
|
-
// 父级选中的时候,子节点也都选中,但是自己不选中
|
|
287
|
-
if (value.has(item) && children.length) {
|
|
288
|
-
value.delete(item);
|
|
289
|
-
}
|
|
290
|
-
while (children.length) {
|
|
291
|
-
var child = children.shift();
|
|
292
|
-
if (child.children && child.children.length) {
|
|
293
|
-
children.push.apply(children, child.children);
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
if (hasDisabled && isAllChecked) {
|
|
297
|
-
if (value.has(child) &&
|
|
298
|
-
child.value !== 'undefined' &&
|
|
299
|
-
!(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
300
|
-
value.delete(child);
|
|
301
|
-
}
|
|
302
|
-
continue;
|
|
303
|
-
}
|
|
304
|
-
if (!value.has(child) &&
|
|
305
|
-
child.value !== 'undefined' &&
|
|
306
|
-
!(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
307
|
-
value.add(child);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
// 这个 isAllChecked 主要是判断如果有disabled的item项,这时父节点还是选中的话,针对性的处理逻辑
|
|
313
|
-
var isAllChecked = flattenTree(children)
|
|
314
|
-
.filter(function (item) { return !(item === null || item === void 0 ? void 0 : item.disabled); })
|
|
315
|
-
.every(function (v) { return value.has(v); });
|
|
316
|
-
// 只要父节点选择了,子节点就不需要了,全部去掉勾选. withChildren时相反
|
|
317
|
-
while (children.length) {
|
|
318
|
-
var child = children.shift();
|
|
319
|
-
if (child === null || child === void 0 ? void 0 : child.disabled) {
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
// 判断下下面是否有禁用项
|
|
323
|
-
if (!hasDisabled) {
|
|
324
|
-
if (value.has(child)) {
|
|
325
|
-
value.delete(child);
|
|
326
|
-
}
|
|
327
|
-
if (withChildren || cascade) {
|
|
328
|
-
value.add(child);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
else {
|
|
332
|
-
isAllChecked ? value.delete(child) : value.add(child);
|
|
333
|
-
}
|
|
334
|
-
if (child.children && child.children.length) {
|
|
335
|
-
children.push.apply(children, child.children);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
var toCheck = item;
|
|
339
|
-
while (true) {
|
|
340
|
-
var parent_1 = getTreeParent(props.options, toCheck);
|
|
341
|
-
// 判断 parent 节点是否已经勾选,避免重复值
|
|
342
|
-
if ((parent_1 === null || parent_1 === void 0 ? void 0 : parent_1[valueField || 'value']) && !value.has(parent_1)) {
|
|
343
|
-
// 如果所有孩子节点都勾选了,应该自动勾选父级。
|
|
344
|
-
if (parent_1.children.every(function (child) { return value.has(child); })) {
|
|
345
|
-
if (!cascade && !withChildren) {
|
|
346
|
-
parent_1.children.forEach(function (child) {
|
|
347
|
-
if (value.has(child)) {
|
|
348
|
-
value.delete(child);
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
value.add(parent_1);
|
|
353
|
-
toCheck = parent_1;
|
|
354
|
-
continue;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
value.has(item) && value.delete(item);
|
|
364
|
-
if (autoCheckChildren) {
|
|
365
|
-
if (cascade || withChildren || onlyChildren) {
|
|
366
|
-
var children = item.children ? __spreadArray([], __read(item.children), false) : [];
|
|
367
|
-
while (children.length) {
|
|
368
|
-
var child = children.shift();
|
|
369
|
-
if (value.has(child) && !(child === null || child === void 0 ? void 0 : child.disabled)) {
|
|
370
|
-
value.delete(child);
|
|
371
|
-
}
|
|
372
|
-
if (child.children && child.children.length) {
|
|
373
|
-
children.push.apply(children, child.children);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (autoCancelParent && cascade) {
|
|
379
|
-
var toCheck = item;
|
|
380
|
-
while (true) {
|
|
381
|
-
var parent_2 = getTreeParent(props.options, toCheck);
|
|
382
|
-
//判断 parent 节点是否已经勾选
|
|
383
|
-
if (value.has(parent_2)) {
|
|
384
|
-
//当有一个子节点取消时要去掉父节点,也要去掉父节点的父节点,直至最外层
|
|
385
|
-
value.delete(parent_2);
|
|
386
|
-
toCheck = parent_2;
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
this.setState({
|
|
394
|
-
value: __spreadArray([], __read(value), false)
|
|
395
|
-
}, function () { return _this.fireChange(__spreadArray([], __read(value), false)); });
|
|
396
|
-
};
|
|
397
|
-
TreeSelector.prototype.fireChange = function (value) {
|
|
398
|
-
var _a = this.props, joinValues = _a.joinValues, extractValue = _a.extractValue, valueField = _a.valueField, delimiter = _a.delimiter, onChange = _a.onChange, enableNodePath = _a.enableNodePath;
|
|
399
|
-
onChange(enableNodePath
|
|
400
|
-
? this.transform2NodePath(value)
|
|
401
|
-
: joinValues
|
|
402
|
-
? value.map(function (item) { return item[valueField]; }).join(delimiter)
|
|
403
|
-
: extractValue
|
|
404
|
-
? value.map(function (item) { return item[valueField]; })
|
|
405
|
-
: value);
|
|
406
|
-
};
|
|
407
|
-
TreeSelector.prototype.handleAdd = function (parent) {
|
|
408
|
-
var _this = this;
|
|
409
|
-
if (parent === void 0) { parent = null; }
|
|
410
|
-
var _a = this.props, bultinCUD = _a.bultinCUD, onAdd = _a.onAdd, options = _a.options;
|
|
411
|
-
if (!bultinCUD) {
|
|
412
|
-
var idxes = findTreeIndex(options, function (item) { return item === parent; }) || [];
|
|
413
|
-
return onAdd && onAdd(idxes.concat(0));
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
this.setState({
|
|
417
|
-
isEditing: false,
|
|
418
|
-
isAdding: true,
|
|
419
|
-
addingParent: parent
|
|
420
|
-
}, function () {
|
|
421
|
-
var e_1, _a;
|
|
422
|
-
if (!parent) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
var result = [];
|
|
426
|
-
try {
|
|
427
|
-
for (var _b = __values(_this.state.flattenedOptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
428
|
-
var option = _c.value;
|
|
429
|
-
result.push(option);
|
|
430
|
-
if (option === parent) {
|
|
431
|
-
var insert = { isAdding: true };
|
|
432
|
-
_this.levels.set(insert, (_this.levels.get(option) || 0) + 1);
|
|
433
|
-
result.push(insert);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
438
|
-
finally {
|
|
439
|
-
try {
|
|
440
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
441
|
-
}
|
|
442
|
-
finally { if (e_1) throw e_1.error; }
|
|
443
|
-
}
|
|
444
|
-
_this.setState({ flattenedOptions: result });
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
TreeSelector.prototype.handleEdit = function (item) {
|
|
449
|
-
var _a = this.props, bultinCUD = _a.bultinCUD, onEdit = _a.onEdit, labelField = _a.labelField; _a.options;
|
|
450
|
-
if (!bultinCUD) {
|
|
451
|
-
onEdit === null || onEdit === void 0 ? void 0 : onEdit(item);
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
this.setState({
|
|
455
|
-
isEditing: true,
|
|
456
|
-
isAdding: false,
|
|
457
|
-
editingItem: item,
|
|
458
|
-
inputValue: item[labelField]
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
TreeSelector.prototype.handleRemove = function (item) {
|
|
463
|
-
var onDelete = this.props.onDelete;
|
|
464
|
-
onDelete && onDelete(item);
|
|
465
|
-
};
|
|
466
|
-
TreeSelector.prototype.handleInputChange = function (e) {
|
|
467
|
-
this.setState({
|
|
468
|
-
inputValue: e.currentTarget.value
|
|
469
|
-
});
|
|
470
|
-
};
|
|
471
|
-
TreeSelector.prototype.handleConfirm = function () {
|
|
472
|
-
var _a = this.state, value = _a.inputValue, isAdding = _a.isAdding, addingParent = _a.addingParent, editingItem = _a.editingItem, isEditing = _a.isEditing;
|
|
473
|
-
if (!value) {
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
var _b = this.props, labelField = _b.labelField, onAdd = _b.onAdd, options = _b.options, onEdit = _b.onEdit;
|
|
477
|
-
this.setState({
|
|
478
|
-
inputValue: '',
|
|
479
|
-
isAdding: false,
|
|
480
|
-
isEditing: false
|
|
481
|
-
}, function () {
|
|
482
|
-
var _a, _b;
|
|
483
|
-
if (isAdding && onAdd) {
|
|
484
|
-
var idxes = (addingParent &&
|
|
485
|
-
findTreeIndex(options, function (item) { return item === addingParent; })) ||
|
|
486
|
-
[];
|
|
487
|
-
onAdd(idxes.concat(0), (_a = {}, _a[labelField] = value, _a), true);
|
|
488
|
-
}
|
|
489
|
-
else if (isEditing && onEdit) {
|
|
490
|
-
onEdit(__assign(__assign({}, editingItem), (_b = {}, _b[labelField] = value, _b)), editingItem, true);
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
TreeSelector.prototype.handleCancel = function () {
|
|
495
|
-
var flattenedOptions = this.state.flattenedOptions;
|
|
496
|
-
var flattenedOptionsWithoutAdding = flattenedOptions.filter(function (item) { return !item.isAdding; });
|
|
497
|
-
this.setState({
|
|
498
|
-
inputValue: '',
|
|
499
|
-
isAdding: false,
|
|
500
|
-
isEditing: false,
|
|
501
|
-
flattenedOptions: flattenedOptionsWithoutAdding
|
|
502
|
-
});
|
|
503
|
-
};
|
|
504
|
-
TreeSelector.prototype.renderInput = function (prfix, testIdBuilder) {
|
|
505
|
-
if (prfix === void 0) { prfix = null; }
|
|
506
|
-
var _a = this.props, cx = _a.classnames, mobileUI = _a.mobileUI, __ = _a.translate;
|
|
507
|
-
var inputValue = this.state.inputValue;
|
|
508
|
-
return (React__default.createElement("div", { className: cx('Tree-itemLabel', {
|
|
509
|
-
'is-mobile': mobileUI
|
|
510
|
-
}) },
|
|
511
|
-
React__default.createElement("div", { className: cx('Tree-itemInput', {
|
|
512
|
-
'is-mobile': mobileUI
|
|
513
|
-
}) },
|
|
514
|
-
prfix,
|
|
515
|
-
React__default.createElement("input", __assign({ onChange: this.handleInputChange, value: inputValue, placeholder: __('placeholder.enter') }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('input').getTestId())),
|
|
516
|
-
React__default.createElement("a", __assign({ "data-tooltip": __('cancel'), onClick: this.handleCancel }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('cancel').getTestId()),
|
|
517
|
-
React__default.createElement(Icon, { icon: "close", className: "icon" })),
|
|
518
|
-
React__default.createElement("a", __assign({ "data-tooltip": __('confirm'), onClick: this.handleConfirm }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('confirm').getTestId()),
|
|
519
|
-
React__default.createElement(Icon, { icon: "check", className: "icon" })))));
|
|
520
|
-
};
|
|
521
|
-
TreeSelector.prototype.getOffsetPosition = function (element) {
|
|
522
|
-
var left = 0;
|
|
523
|
-
var top = 0;
|
|
524
|
-
while (element.offsetParent) {
|
|
525
|
-
left += element.offsetLeft;
|
|
526
|
-
top += element.offsetTop;
|
|
527
|
-
element = element.offsetParent;
|
|
528
|
-
}
|
|
529
|
-
return { left: left, top: top };
|
|
530
|
-
};
|
|
531
|
-
TreeSelector.prototype.getDropInfo = function (e, node) {
|
|
532
|
-
var _a;
|
|
533
|
-
var rect = e.currentTarget.getBoundingClientRect();
|
|
534
|
-
var dragNode = this.dragNode;
|
|
535
|
-
var deltaX = Math.min(50, rect.width * 0.3);
|
|
536
|
-
var gap = ((_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.length) ? 0 : 16;
|
|
537
|
-
// 计算相对位置
|
|
538
|
-
var offset = this.getOffsetPosition(this.root.current);
|
|
539
|
-
var targetOffset = this.getOffsetPosition(e.currentTarget);
|
|
540
|
-
var left = targetOffset.left - offset.left;
|
|
541
|
-
var top = targetOffset.top - offset.top;
|
|
542
|
-
var clientX = e.clientX, clientY = e.clientY;
|
|
543
|
-
var position = clientY >= rect.top + rect.height / 2 ? 'bottom' : 'top';
|
|
544
|
-
var indicator;
|
|
545
|
-
if (position === 'bottom' && clientX >= this.startPoint.x + deltaX) {
|
|
546
|
-
position = 'self';
|
|
547
|
-
indicator = {
|
|
548
|
-
top: top,
|
|
549
|
-
left: left,
|
|
550
|
-
width: rect.width,
|
|
551
|
-
height: rect.height
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
else {
|
|
555
|
-
indicator = {
|
|
556
|
-
top: position === 'bottom' ? top + rect.height : top,
|
|
557
|
-
left: left + gap,
|
|
558
|
-
width: rect.width - gap
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
return {
|
|
562
|
-
node: node,
|
|
563
|
-
dragNode: dragNode,
|
|
564
|
-
position: position,
|
|
565
|
-
indicator: indicator
|
|
566
|
-
};
|
|
567
|
-
};
|
|
568
|
-
TreeSelector.prototype.updateDropIndicator = function (e, node) {
|
|
569
|
-
// const gap = node?.children?.length ? 0 : 16;
|
|
570
|
-
this.dropInfo = this.getDropInfo(e, node);
|
|
571
|
-
var _a = this.dropInfo, dragNode = _a.dragNode, indicator = _a.indicator;
|
|
572
|
-
if (node === dragNode) {
|
|
573
|
-
this.setState({ dropIndicator: undefined });
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
this.setState({
|
|
577
|
-
dropIndicator: indicator
|
|
578
|
-
});
|
|
579
|
-
};
|
|
580
|
-
TreeSelector.prototype.onDragStart = function (node) {
|
|
581
|
-
var _this = this;
|
|
582
|
-
var draggable = this.props.draggable;
|
|
583
|
-
return function (e) {
|
|
584
|
-
var _a;
|
|
585
|
-
if (draggable) {
|
|
586
|
-
e.dataTransfer.effectAllowed = 'copyMove';
|
|
587
|
-
_this.dragNode = node;
|
|
588
|
-
_this.dropInfo = null;
|
|
589
|
-
_this.startPoint = {
|
|
590
|
-
x: e.clientX,
|
|
591
|
-
y: e.clientY
|
|
592
|
-
};
|
|
593
|
-
if ((_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
594
|
-
_this.unfolded.set(node, false);
|
|
595
|
-
_this.flattenOptions();
|
|
596
|
-
_this.forceUpdate();
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
else {
|
|
600
|
-
_this.dragNode = null;
|
|
601
|
-
_this.dropInfo = null;
|
|
602
|
-
}
|
|
603
|
-
e.stopPropagation();
|
|
604
|
-
};
|
|
605
|
-
};
|
|
606
|
-
TreeSelector.prototype.onDragOver = function (node) {
|
|
607
|
-
var _this = this;
|
|
608
|
-
return function (e) {
|
|
609
|
-
if (!_this.dragNode) {
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
_this.updateDropIndicator(e, node);
|
|
613
|
-
e.preventDefault();
|
|
614
|
-
};
|
|
615
|
-
};
|
|
616
|
-
TreeSelector.prototype.onDragEnd = function (dragNode) {
|
|
617
|
-
var _this = this;
|
|
618
|
-
return function (e) {
|
|
619
|
-
var _a, _b, _c;
|
|
620
|
-
_this.setState({
|
|
621
|
-
dropIndicator: undefined
|
|
622
|
-
});
|
|
623
|
-
var node = (_a = _this.dropInfo) === null || _a === void 0 ? void 0 : _a.node;
|
|
624
|
-
if (!_this.dropInfo || !node || dragNode === node) {
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
(_c = (_b = _this.props).onMove) === null || _c === void 0 ? void 0 : _c.call(_b, _this.dropInfo);
|
|
628
|
-
_this.dragNode = null;
|
|
629
|
-
_this.dropInfo = null;
|
|
630
|
-
e.preventDefault();
|
|
631
|
-
};
|
|
632
|
-
};
|
|
633
|
-
/**
|
|
634
|
-
* 将树形接口转换为平铺结构,以支持虚拟列表
|
|
635
|
-
* TODO: this.unfolded => reaction 更加合理
|
|
636
|
-
*/
|
|
637
|
-
TreeSelector.prototype.flattenOptions = function (props, initial) {
|
|
638
|
-
var _this = this;
|
|
639
|
-
var flattenedOptions = [];
|
|
640
|
-
eachTree((props === null || props === void 0 ? void 0 : props.options) || this.props.options, function (item, index, level, paths) {
|
|
641
|
-
var parent = paths[paths.length - 1];
|
|
642
|
-
if (!isVisible(item)) {
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
_this.levels.set(item, level);
|
|
646
|
-
parent && _this.relations.set(item, parent);
|
|
647
|
-
if (paths.length === 0) {
|
|
648
|
-
// 父节点
|
|
649
|
-
flattenedOptions.push(item);
|
|
650
|
-
}
|
|
651
|
-
else if (_this.isUnfolded(parent)) {
|
|
652
|
-
// 父节点是展开的状态
|
|
653
|
-
flattenedOptions.push(item);
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
if (initial) {
|
|
657
|
-
// 初始化
|
|
658
|
-
this.state = __assign(__assign({}, this.state), { flattenedOptions: flattenedOptions });
|
|
659
|
-
}
|
|
660
|
-
else {
|
|
661
|
-
this.setState({
|
|
662
|
-
flattenedOptions: flattenedOptions
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
/**
|
|
667
|
-
* 判断父元素是否勾选
|
|
668
|
-
* TODO: 递归可能需要优化
|
|
669
|
-
*/
|
|
670
|
-
TreeSelector.prototype.isParentChecked = function (item) {
|
|
671
|
-
if (!item || !this.relations.get(item)) {
|
|
672
|
-
return false;
|
|
673
|
-
}
|
|
674
|
-
var valueSet = this.state.valueSet;
|
|
675
|
-
var currentItem = item;
|
|
676
|
-
while (currentItem) {
|
|
677
|
-
var itemParent = this.relations.get(currentItem);
|
|
678
|
-
if (!itemParent) {
|
|
679
|
-
return false;
|
|
680
|
-
}
|
|
681
|
-
if (valueSet.has(itemParent)) {
|
|
682
|
-
return true;
|
|
683
|
-
}
|
|
684
|
-
currentItem = itemParent;
|
|
685
|
-
}
|
|
686
|
-
return false;
|
|
687
|
-
};
|
|
688
|
-
/**
|
|
689
|
-
* 判断 子元素 是否全部选中
|
|
690
|
-
*/
|
|
691
|
-
TreeSelector.prototype.isItemChildrenChecked = function (item) {
|
|
692
|
-
var _this = this;
|
|
693
|
-
if (!item || !item.children) {
|
|
694
|
-
return true;
|
|
695
|
-
}
|
|
696
|
-
return !item.children.some(function (child) { return !_this.isItemChecked(child); });
|
|
697
|
-
};
|
|
698
|
-
/**
|
|
699
|
-
* 判断子元素 部分勾选
|
|
700
|
-
*/
|
|
701
|
-
TreeSelector.prototype.isItemChildrenPartialChecked = function (item, checked) {
|
|
702
|
-
var e_2, _a;
|
|
703
|
-
if (!item || !item.children || checked) {
|
|
704
|
-
return false;
|
|
705
|
-
}
|
|
706
|
-
var checkedLength = 0;
|
|
707
|
-
var partialChildrenLength = 0;
|
|
708
|
-
try {
|
|
709
|
-
for (var _b = __values(item.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
710
|
-
var child = _c.value;
|
|
711
|
-
if (this.isItemChecked(child)) {
|
|
712
|
-
checkedLength++;
|
|
713
|
-
}
|
|
714
|
-
else if (this.isItemChildrenPartialChecked(child, false)) {
|
|
715
|
-
partialChildrenLength++;
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
720
|
-
finally {
|
|
721
|
-
try {
|
|
722
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
723
|
-
}
|
|
724
|
-
finally { if (e_2) throw e_2.error; }
|
|
725
|
-
}
|
|
726
|
-
return checkedLength !== 0 || partialChildrenLength !== 0;
|
|
727
|
-
};
|
|
728
|
-
/**
|
|
729
|
-
* 判断元素是否选中:checked
|
|
730
|
-
*/
|
|
731
|
-
TreeSelector.prototype.isItemChecked = function (item) {
|
|
732
|
-
var _a;
|
|
733
|
-
if (!item) {
|
|
734
|
-
return false;
|
|
735
|
-
}
|
|
736
|
-
var _b = this.props, autoCheckChildren = _b.autoCheckChildren, onlyChildren = _b.onlyChildren, multiple = _b.multiple, withChildren = _b.withChildren, cascade = _b.cascade;
|
|
737
|
-
var valueSet = this.state.valueSet;
|
|
738
|
-
var checked = valueSet.has(item);
|
|
739
|
-
if (checked) {
|
|
740
|
-
return true;
|
|
741
|
-
}
|
|
742
|
-
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
743
|
-
if (onlyChildren && autoCheckChildren) {
|
|
744
|
-
if (this.isItemChildrenChecked(item)) {
|
|
745
|
-
// 当前元素没有在 value 中,但是子组件全部勾选了
|
|
746
|
-
return true;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
var itemParent = this.relations.get(item);
|
|
751
|
-
if (itemParent && multiple && autoCheckChildren) {
|
|
752
|
-
// 当前节点为子节点
|
|
753
|
-
if (withChildren || cascade) {
|
|
754
|
-
return false;
|
|
755
|
-
}
|
|
756
|
-
return this.isParentChecked(item);
|
|
757
|
-
}
|
|
758
|
-
// 判断父组件是否勾选
|
|
759
|
-
return false;
|
|
760
|
-
};
|
|
761
|
-
/**
|
|
762
|
-
* item 是否 disabled 状态
|
|
763
|
-
* props.disabled === true return;
|
|
764
|
-
*
|
|
765
|
-
*/
|
|
766
|
-
TreeSelector.prototype.isItemDisabled = function (item, checked) {
|
|
767
|
-
var _a = this.props, disabledField = _a.disabledField, disabled = _a.disabled, autoCheckChildren = _a.autoCheckChildren, valueField = _a.valueField, multiple = _a.multiple, maxLength = _a.maxLength, minLength = _a.minLength, cascade = _a.cascade, onlyChildren = _a.onlyChildren;
|
|
768
|
-
var value = this.state.value;
|
|
769
|
-
var selfDisabled = item[disabledField];
|
|
770
|
-
var nodeDisabled = !!disabled ||
|
|
771
|
-
selfDisabled ||
|
|
772
|
-
(multiple && !autoCheckChildren && !item[valueField]);
|
|
773
|
-
if (nodeDisabled) {
|
|
774
|
-
return true;
|
|
775
|
-
}
|
|
776
|
-
if ((maxLength && !checked && value.length >= maxLength) ||
|
|
777
|
-
(minLength && checked && value.length <= minLength)) {
|
|
778
|
-
return true;
|
|
779
|
-
}
|
|
780
|
-
var itemParent = this.relations.get(item);
|
|
781
|
-
if (autoCheckChildren && multiple && checked && itemParent) {
|
|
782
|
-
if (!this.isItemChecked(itemParent)) {
|
|
783
|
-
return false;
|
|
784
|
-
}
|
|
785
|
-
// 子节点
|
|
786
|
-
if (onlyChildren) {
|
|
787
|
-
return false;
|
|
788
|
-
}
|
|
789
|
-
return !cascade;
|
|
790
|
-
}
|
|
791
|
-
return false;
|
|
792
|
-
};
|
|
793
|
-
TreeSelector.prototype.renderItem = function (_a) {
|
|
794
|
-
var _this = this;
|
|
795
|
-
var index = _a.index, style = _a.style;
|
|
796
|
-
var _b = this.props, itemClassName = _b.itemClassName, showIcon = _b.showIcon, showRadio = _b.showRadio, multiple = _b.multiple, labelField = _b.labelField, iconField = _b.iconField, deferField = _b.deferField, cascade = _b.cascade, cx = _b.classnames, highlightTxt = _b.highlightTxt, creatable = _b.creatable, editable = _b.editable, removable = _b.removable, createTip = _b.createTip, editTip = _b.editTip, removeTip = _b.removeTip, __ = _b.translate, itemRender = _b.itemRender, draggable = _b.draggable, loadingConfig = _b.loadingConfig, enableDefaultIcon = _b.enableDefaultIcon, valueField = _b.valueField, mobileUI = _b.mobileUI, testIdBuilder = _b.testIdBuilder, itemActionsRender = _b.itemActionsRender, actionClassName = _b.actionClassName;
|
|
797
|
-
var item = this.state.flattenedOptions[index];
|
|
798
|
-
if (!item) {
|
|
799
|
-
return null;
|
|
800
|
-
}
|
|
801
|
-
var _c = this.state, isAdding = _c.isAdding, editingItem = _c.editingItem, isEditing = _c.isEditing;
|
|
802
|
-
var checked = this.isItemChecked(item);
|
|
803
|
-
var disabled = this.isItemDisabled(item, checked);
|
|
804
|
-
var partial = this.isItemChildrenPartialChecked(item, checked);
|
|
805
|
-
var checkedInValue = !!~this.state.value.indexOf(item);
|
|
806
|
-
var itemTestBuilder = testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("item-".concat(item[valueField] || item[labelField] || index));
|
|
807
|
-
var checkbox = multiple ? (React__default.createElement(Checkbox, { size: "sm", disabled: disabled, checked: checked || partial, partial: partial, onChange: this.handleCheck.bind(this, item, !checked), testIdBuilder: itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('chekbx') })) : showRadio ? (React__default.createElement(Checkbox, { size: "sm", disabled: disabled, checked: checked, onChange: this.handleSelect.bind(this, item), testIdBuilder: itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('chekbx') })) : null;
|
|
808
|
-
var isLeaf = (!item.children || !item.children.length) && !item.placeholder;
|
|
809
|
-
var iconValue = item[iconField] ||
|
|
810
|
-
(enableDefaultIcon !== false
|
|
811
|
-
? (Array.isArray(item.children) && item.children.length) ||
|
|
812
|
-
item[deferField]
|
|
813
|
-
? 'folder'
|
|
814
|
-
: 'file'
|
|
815
|
-
: false);
|
|
816
|
-
var level = this.levels.has(item) ? this.levels.get(item) - 1 : 0;
|
|
817
|
-
var body = null;
|
|
818
|
-
if (isEditing && editingItem === item) {
|
|
819
|
-
body = this.renderInput(checkbox, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('edit'));
|
|
820
|
-
}
|
|
821
|
-
else if (item.isAdding) {
|
|
822
|
-
body = this.renderInput(React__default.createElement("span", { className: cx('Tree-itemArrowPlaceholder') }), itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('add'));
|
|
823
|
-
}
|
|
824
|
-
else {
|
|
825
|
-
var isFolded = !this.isUnfolded(item);
|
|
826
|
-
body = (React__default.createElement("div", { className: cx('Tree-itemLabel', {
|
|
827
|
-
'is-children-checked': multiple &&
|
|
828
|
-
!cascade &&
|
|
829
|
-
this.isItemChildrenChecked(item) &&
|
|
830
|
-
!disabled,
|
|
831
|
-
'is-checked': checkedInValue,
|
|
832
|
-
'is-disabled': disabled
|
|
833
|
-
}), draggable: draggable, onDragStart: this.onDragStart(item), onDragOver: this.onDragOver(item), onDragEnd: this.onDragEnd(item) },
|
|
834
|
-
draggable && (React__default.createElement("a", __assign({ className: cx('Tree-itemDrager drag-bar') }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('drag-bar').getTestId()),
|
|
835
|
-
React__default.createElement(Icon, { icon: "drag-bar", className: "icon" }))),
|
|
836
|
-
item.loading ? (React__default.createElement(Spinner, { size: "sm", show: true, icon: "reload", spinnerClassName: cx('Tree-spinner'), loadingConfig: loadingConfig })) : !isLeaf || (item[deferField] && !item.loaded) ? (React__default.createElement("div", __assign({ onClick: function () { return _this.toggleUnfolded(item); }, className: cx('Tree-itemArrow', {
|
|
837
|
-
'is-folded': isFolded
|
|
838
|
-
}) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild(isFolded ? 'open' : 'fold').getTestId()),
|
|
839
|
-
React__default.createElement(Icon, { icon: "down-arrow-bold", className: "icon" }))) : (React__default.createElement("span", { className: cx('Tree-itemArrowPlaceholder') })),
|
|
840
|
-
checkbox,
|
|
841
|
-
React__default.createElement("div", __assign({ className: cx('Tree-itemLabel-item', { 'is-mobile': mobileUI }) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('content').getTestId(), { onClick: function () { return !disabled && _this.handleItemClick(item, checked); } }),
|
|
842
|
-
showIcon ? (React__default.createElement("i", { className: cx("Tree-itemIcon ".concat((Array.isArray(item.children) && item.children.length) ||
|
|
843
|
-
item[deferField]
|
|
844
|
-
? 'Tree-folderIcon'
|
|
845
|
-
: 'Tree-leafIcon')) }, iconValue ? React__default.createElement(Icon, { icon: iconValue, className: "icon" }) : null)) : null,
|
|
846
|
-
React__default.createElement("span", __assign({ className: cx('Tree-itemText'), title: item[labelField] }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('text').getTestId()), itemRender
|
|
847
|
-
? itemRender(item, {
|
|
848
|
-
index: index,
|
|
849
|
-
multiple: multiple,
|
|
850
|
-
checked: checked,
|
|
851
|
-
labelField: labelField,
|
|
852
|
-
onChange: function () { return _this.handleCheck(item, !checked); },
|
|
853
|
-
disabled: disabled || item.disabled,
|
|
854
|
-
classnames: cx
|
|
855
|
-
})
|
|
856
|
-
: highlightTxt
|
|
857
|
-
? highlight("".concat(item[labelField]), highlightTxt)
|
|
858
|
-
: "".concat(item[labelField])),
|
|
859
|
-
!disabled && !isAdding && !isEditing ? (React__default.createElement("div", { className: cx('Tree-item-icons', actionClassName), onClick: function (e) { return e.stopPropagation(); } },
|
|
860
|
-
creatable &&
|
|
861
|
-
!(item[deferField] && !item.loaded) &&
|
|
862
|
-
hasAbility(item, 'creatable') ? (React__default.createElement(TooltipWrapper, { placement: 'bottom', tooltip: __(createTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
863
|
-
React__default.createElement("a", __assign({ onClick: this.handleAdd.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('add').getTestId()),
|
|
864
|
-
React__default.createElement(Icon, { icon: "plus", className: "icon" })))) : null,
|
|
865
|
-
removable && hasAbility(item, 'removable') ? (React__default.createElement(TooltipWrapper, { placement: 'bottom', tooltip: __(removeTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
866
|
-
React__default.createElement("a", __assign({ onClick: this.handleRemove.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('remove').getTestId()),
|
|
867
|
-
React__default.createElement(Icon, { icon: "minus", className: "icon" })))) : null,
|
|
868
|
-
editable && hasAbility(item, 'editable') ? (React__default.createElement(TooltipWrapper, { placement: 'bottom', tooltip: __(editTip), trigger: 'hover', tooltipTheme: "dark" },
|
|
869
|
-
React__default.createElement("a", __assign({ onClick: this.handleEdit.bind(this, item) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getChild('edit').getTestId()),
|
|
870
|
-
React__default.createElement(Icon, { icon: "new-edit", className: "icon" })))) : null,
|
|
871
|
-
itemActionsRender && (React__default.createElement("div", { className: cx('Tree-itemActions') }, itemActionsRender(item, __assign(__assign({}, item), { index: index, multiple: multiple, checked: checked, labelField: labelField, onChange: function () { return _this.handleCheck(item, !checked); }, disabled: disabled || item.disabled, classnames: cx })))))) : null)));
|
|
872
|
-
}
|
|
873
|
-
return (React__default.createElement("li", __assign({ key: "".concat(item[valueField || 'value'], "-").concat(index), className: cx("Tree-item ".concat(itemClassName || ''), {
|
|
874
|
-
'Tree-item--isLeaf': isLeaf,
|
|
875
|
-
'is-child': this.relations.get(item)
|
|
876
|
-
}), style: __assign(__assign({}, style), { paddingLeft: "calc(".concat(level, " * var(--Tree-indent))") }) }, itemTestBuilder === null || itemTestBuilder === void 0 ? void 0 : itemTestBuilder.getTestId()), body));
|
|
877
|
-
};
|
|
878
|
-
TreeSelector.prototype.isEmptyOrNotExist = function (obj) {
|
|
879
|
-
return obj === '' || obj === undefined || obj === null;
|
|
880
|
-
};
|
|
881
|
-
TreeSelector.prototype.getAvailableOptions = function () {
|
|
882
|
-
var _this = this;
|
|
883
|
-
var _a = this.props, options = _a.options, onlyChildren = _a.onlyChildren, valueField = _a.valueField;
|
|
884
|
-
var flattendOptions = flattenTree(options, function (item) {
|
|
885
|
-
var _a;
|
|
886
|
-
return onlyChildren
|
|
887
|
-
? ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length)
|
|
888
|
-
? null
|
|
889
|
-
: item
|
|
890
|
-
: _this.isEmptyOrNotExist(item[valueField || 'value'])
|
|
891
|
-
? null
|
|
892
|
-
: item;
|
|
893
|
-
}).filter(function (a) { return a && !a.disabled; });
|
|
894
|
-
return flattendOptions;
|
|
895
|
-
};
|
|
896
|
-
TreeSelector.prototype.handleCheckAll = function (availableOptions, checkedAll) {
|
|
897
|
-
var _this = this;
|
|
898
|
-
this.setState({
|
|
899
|
-
value: checkedAll ? [] : availableOptions
|
|
900
|
-
}, function () { return _this.fireChange(checkedAll ? [] : availableOptions); });
|
|
901
|
-
};
|
|
902
|
-
TreeSelector.prototype.handleToggle = function (bool) {
|
|
903
|
-
var _this = this;
|
|
904
|
-
var availableOptions = this.getAvailableOptions();
|
|
905
|
-
if (bool === undefined) {
|
|
906
|
-
var checkedAll = availableOptions.every(function (option) {
|
|
907
|
-
return _this.isItemChecked(option);
|
|
908
|
-
});
|
|
909
|
-
this.handleCheckAll(availableOptions, checkedAll);
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
this.handleCheckAll(availableOptions, bool);
|
|
913
|
-
};
|
|
914
|
-
TreeSelector.prototype.renderCheckAll = function () {
|
|
915
|
-
var _this = this;
|
|
916
|
-
var _a = this.props, multiple = _a.multiple, checkAll = _a.checkAll, checkAllLabel = _a.checkAllLabel, cx = _a.classnames, __ = _a.translate, disabled = _a.disabled, mobileUI = _a.mobileUI;
|
|
917
|
-
if (!multiple || !checkAll) {
|
|
918
|
-
return null;
|
|
919
|
-
}
|
|
920
|
-
var availableOptions = this.getAvailableOptions();
|
|
921
|
-
var checkedAll = availableOptions.every(function (option) {
|
|
922
|
-
return _this.isItemChecked(option);
|
|
923
|
-
});
|
|
924
|
-
var checkedPartial = availableOptions.some(function (option) {
|
|
925
|
-
return _this.isItemChecked(option);
|
|
926
|
-
});
|
|
927
|
-
return (React__default.createElement("div", { className: cx('Tree-itemLabel'), onClick: function () { return _this.handleCheckAll(availableOptions, checkedAll); } },
|
|
928
|
-
React__default.createElement(Checkbox, { size: "sm", disabled: disabled, checked: checkedPartial, partial: checkedPartial && !checkedAll }),
|
|
929
|
-
React__default.createElement("div", { className: cx('Tree-itemLabel-item', {
|
|
930
|
-
'is-mobile': mobileUI
|
|
931
|
-
}) },
|
|
932
|
-
React__default.createElement("span", { className: cx('Tree-itemText') }, __(checkAllLabel)))));
|
|
933
|
-
};
|
|
934
|
-
TreeSelector.prototype.renderList = function (list) {
|
|
935
|
-
var _this = this;
|
|
936
|
-
var _a = this.props, virtualThreshold = _a.virtualThreshold, _b = _a.itemHeight, itemHeight = _b === void 0 ? 32 : _b;
|
|
937
|
-
var virtualHeight = this.state.virtualHeight;
|
|
938
|
-
if (virtualThreshold && list.length > virtualThreshold) {
|
|
939
|
-
return (React__default.createElement("div", { ref: this.virtualListRef },
|
|
940
|
-
React__default.createElement(VirtualList, { height: virtualHeight, itemCount: list.length, prefix: this.renderCheckAll(), itemSize: itemHeight,
|
|
941
|
-
//! hack: 让 VirtualList 重新渲染
|
|
942
|
-
renderItem: this.renderItem.bind(this) })));
|
|
943
|
-
}
|
|
944
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
945
|
-
this.renderCheckAll(),
|
|
946
|
-
list.map(function (item, index) { return _this.renderItem({ index: index }); })));
|
|
947
|
-
};
|
|
948
|
-
TreeSelector.prototype.handleVirtualHeight = function () {
|
|
949
|
-
var _a = this.props, virtualThreshold = _a.virtualThreshold, _b = _a.itemHeight, itemHeight = _b === void 0 ? 32 : _b, height = _a.height;
|
|
950
|
-
var flattenedOptions = this.state.flattenedOptions;
|
|
951
|
-
if (virtualThreshold && flattenedOptions.length > virtualThreshold) {
|
|
952
|
-
if (height && height > 0) {
|
|
953
|
-
// tree 对应元素
|
|
954
|
-
var treeElement = this.root.current;
|
|
955
|
-
// 虚拟列表 对应元素
|
|
956
|
-
var virtualElement = this.virtualListRef.current;
|
|
957
|
-
if (treeElement && virtualElement) {
|
|
958
|
-
var virtualHeight = treeElement.offsetHeight -
|
|
959
|
-
calculateHeight(treeElement, virtualElement);
|
|
960
|
-
this.setState({ virtualHeight: virtualHeight });
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
else {
|
|
964
|
-
this.setState({ virtualHeight: flattenedOptions.length * itemHeight });
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
TreeSelector.prototype.render = function () {
|
|
969
|
-
var _a = this.props, className = _a.className, placeholder = _a.placeholder, hideRoot = _a.hideRoot, rootLabel = _a.rootLabel, showOutline = _a.showOutline, showIcon = _a.showIcon, cx = _a.classnames, creatable = _a.creatable, rootCreatable = _a.rootCreatable, rootCreateTip = _a.rootCreateTip, disabled = _a.disabled, draggable = _a.draggable, __ = _a.translate, testIdBuilder = _a.testIdBuilder, actionClassName = _a.actionClassName, height = _a.height;
|
|
970
|
-
var _b = this.state, value = _b.value, isAdding = _b.isAdding, addingParent = _b.addingParent, isEditing = _b.isEditing, dropIndicator = _b.dropIndicator, flattenedOptions = _b.flattenedOptions;
|
|
971
|
-
var addBtn = null;
|
|
972
|
-
if (creatable && rootCreatable !== false && hideRoot) {
|
|
973
|
-
addBtn = (React__default.createElement("a", __assign({ className: cx('Tree-addTopBtn', {
|
|
974
|
-
'is-disabled': isAdding || isEditing
|
|
975
|
-
}), onClick: this.handleAdd.bind(this, null) }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild('add').getTestId()),
|
|
976
|
-
React__default.createElement(Icon, { icon: "plus", className: "icon" }),
|
|
977
|
-
React__default.createElement("span", null, __(rootCreateTip))));
|
|
978
|
-
}
|
|
979
|
-
var style = {};
|
|
980
|
-
if (height && height > 0) {
|
|
981
|
-
style = {
|
|
982
|
-
height: "".concat(height, "px"),
|
|
983
|
-
maxHeight: 'none'
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
return (React__default.createElement("div", __assign({ className: cx("Tree ".concat(className || ''), {
|
|
987
|
-
'Tree--outline': showOutline,
|
|
988
|
-
'is-disabled': disabled,
|
|
989
|
-
'is-draggable': draggable
|
|
990
|
-
}), style: style, ref: this.root }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getTestId()),
|
|
991
|
-
(flattenedOptions && flattenedOptions.length) ||
|
|
992
|
-
addBtn ||
|
|
993
|
-
hideRoot === false ? (React__default.createElement("ul", { className: cx('Tree-list') }, hideRoot ? (React__default.createElement(React__default.Fragment, null,
|
|
994
|
-
addBtn,
|
|
995
|
-
isAdding && !addingParent ? (React__default.createElement("li", { className: cx('Tree-item') }, this.renderInput())) : null,
|
|
996
|
-
this.renderList(flattenedOptions))) : (React__default.createElement("li", { className: cx('Tree-rootItem', {
|
|
997
|
-
'is-checked': !value || !value.length
|
|
998
|
-
}) },
|
|
999
|
-
React__default.createElement("div", { className: cx('Tree-itemLabel') },
|
|
1000
|
-
React__default.createElement("span", __assign({ className: cx('Tree-itemText'), onClick: this.clearSelect }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("root-item").getTestId()),
|
|
1001
|
-
showIcon ? (React__default.createElement("i", { className: cx('Tree-itemIcon Tree-rootIcon') },
|
|
1002
|
-
React__default.createElement(Icon, { icon: "home", className: "icon" }))) : null,
|
|
1003
|
-
rootLabel),
|
|
1004
|
-
!disabled &&
|
|
1005
|
-
creatable &&
|
|
1006
|
-
rootCreatable !== false &&
|
|
1007
|
-
!isAdding &&
|
|
1008
|
-
!isEditing ? (React__default.createElement("div", { className: cx('Tree-item-icons', actionClassName) }, creatable ? (React__default.createElement("a", __assign({ onClick: this.handleAdd.bind(this, null), "data-tooltip": rootCreateTip, "data-position": "left" }, testIdBuilder === null || testIdBuilder === void 0 ? void 0 : testIdBuilder.getChild("root-add").getTestId()),
|
|
1009
|
-
React__default.createElement(Icon, { icon: "plus", className: "icon" }))) : null)) : null),
|
|
1010
|
-
React__default.createElement("ul", { className: cx('Tree-sublist') },
|
|
1011
|
-
isAdding && !addingParent ? (React__default.createElement("li", { className: cx('Tree-item') }, this.renderInput())) : null,
|
|
1012
|
-
this.renderList(flattenedOptions)))))) : (React__default.createElement("div", { className: cx('Tree-placeholder') }, placeholder)),
|
|
1013
|
-
dropIndicator && (React__default.createElement("div", { className: cx('Tree-dropIndicator', {
|
|
1014
|
-
'Tree-dropIndicator--hover': !!dropIndicator.height
|
|
1015
|
-
}), style: dropIndicator }))));
|
|
1016
|
-
};
|
|
1017
|
-
TreeSelector.defaultProps = {
|
|
1018
|
-
showIcon: true,
|
|
1019
|
-
showOutline: false,
|
|
1020
|
-
initiallyOpen: true,
|
|
1021
|
-
unfoldedLevel: 1,
|
|
1022
|
-
showRadio: false,
|
|
1023
|
-
multiple: false,
|
|
1024
|
-
disabled: false,
|
|
1025
|
-
withChildren: false,
|
|
1026
|
-
onlyChildren: false,
|
|
1027
|
-
labelField: 'label',
|
|
1028
|
-
valueField: 'value',
|
|
1029
|
-
iconField: 'icon',
|
|
1030
|
-
deferField: 'defer',
|
|
1031
|
-
unfoldedField: 'unfolded',
|
|
1032
|
-
foldedField: 'foled',
|
|
1033
|
-
disabledField: 'disabled',
|
|
1034
|
-
joinValues: true,
|
|
1035
|
-
extractValue: false,
|
|
1036
|
-
delimiter: ',',
|
|
1037
|
-
hideRoot: true,
|
|
1038
|
-
rootLabel: 'Tree.root',
|
|
1039
|
-
rootValue: 0,
|
|
1040
|
-
autoCheckChildren: true,
|
|
1041
|
-
autoCancelParent: false,
|
|
1042
|
-
cascade: false,
|
|
1043
|
-
selfDisabledAffectChildren: true,
|
|
1044
|
-
rootCreateTip: 'Tree.addRoot',
|
|
1045
|
-
createTip: 'Tree.addChild',
|
|
1046
|
-
editTip: 'Tree.editNode',
|
|
1047
|
-
removeTip: 'Tree.removeNode',
|
|
1048
|
-
enableNodePath: false,
|
|
1049
|
-
pathSeparator: '/',
|
|
1050
|
-
nodePath: [],
|
|
1051
|
-
virtualThreshold: 100,
|
|
1052
|
-
itemHeight: 32,
|
|
1053
|
-
enableDefaultIcon: true
|
|
1054
|
-
};
|
|
1055
|
-
__decorate([
|
|
1056
|
-
autobind,
|
|
1057
|
-
__metadata("design:type", Function),
|
|
1058
|
-
__metadata("design:paramtypes", [Object]),
|
|
1059
|
-
__metadata("design:returntype", void 0)
|
|
1060
|
-
], TreeSelector.prototype, "toggleUnfolded", null);
|
|
1061
|
-
__decorate([
|
|
1062
|
-
autobind,
|
|
1063
|
-
__metadata("design:type", Function),
|
|
1064
|
-
__metadata("design:paramtypes", []),
|
|
1065
|
-
__metadata("design:returntype", void 0)
|
|
1066
|
-
], TreeSelector.prototype, "clearSelect", null);
|
|
1067
|
-
__decorate([
|
|
1068
|
-
autobind,
|
|
1069
|
-
__metadata("design:type", Function),
|
|
1070
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
1071
|
-
__metadata("design:returntype", void 0)
|
|
1072
|
-
], TreeSelector.prototype, "handleSelect", null);
|
|
1073
|
-
__decorate([
|
|
1074
|
-
autobind,
|
|
1075
|
-
__metadata("design:type", Function),
|
|
1076
|
-
__metadata("design:paramtypes", [Object, Boolean]),
|
|
1077
|
-
__metadata("design:returntype", void 0)
|
|
1078
|
-
], TreeSelector.prototype, "handleItemClick", null);
|
|
1079
|
-
__decorate([
|
|
1080
|
-
autobind,
|
|
1081
|
-
__metadata("design:type", Function),
|
|
1082
|
-
__metadata("design:paramtypes", [Object, Boolean]),
|
|
1083
|
-
__metadata("design:returntype", void 0)
|
|
1084
|
-
], TreeSelector.prototype, "handleCheck", null);
|
|
1085
|
-
__decorate([
|
|
1086
|
-
autobind,
|
|
1087
|
-
__metadata("design:type", Function),
|
|
1088
|
-
__metadata("design:paramtypes", [Object]),
|
|
1089
|
-
__metadata("design:returntype", void 0)
|
|
1090
|
-
], TreeSelector.prototype, "handleAdd", null);
|
|
1091
|
-
__decorate([
|
|
1092
|
-
autobind,
|
|
1093
|
-
__metadata("design:type", Function),
|
|
1094
|
-
__metadata("design:paramtypes", [Object]),
|
|
1095
|
-
__metadata("design:returntype", void 0)
|
|
1096
|
-
], TreeSelector.prototype, "handleEdit", null);
|
|
1097
|
-
__decorate([
|
|
1098
|
-
autobind,
|
|
1099
|
-
__metadata("design:type", Function),
|
|
1100
|
-
__metadata("design:paramtypes", [Object]),
|
|
1101
|
-
__metadata("design:returntype", void 0)
|
|
1102
|
-
], TreeSelector.prototype, "handleRemove", null);
|
|
1103
|
-
__decorate([
|
|
1104
|
-
autobind,
|
|
1105
|
-
__metadata("design:type", Function),
|
|
1106
|
-
__metadata("design:paramtypes", [Object]),
|
|
1107
|
-
__metadata("design:returntype", void 0)
|
|
1108
|
-
], TreeSelector.prototype, "handleInputChange", null);
|
|
1109
|
-
__decorate([
|
|
1110
|
-
autobind,
|
|
1111
|
-
__metadata("design:type", Function),
|
|
1112
|
-
__metadata("design:paramtypes", []),
|
|
1113
|
-
__metadata("design:returntype", void 0)
|
|
1114
|
-
], TreeSelector.prototype, "handleConfirm", null);
|
|
1115
|
-
__decorate([
|
|
1116
|
-
autobind,
|
|
1117
|
-
__metadata("design:type", Function),
|
|
1118
|
-
__metadata("design:paramtypes", []),
|
|
1119
|
-
__metadata("design:returntype", void 0)
|
|
1120
|
-
], TreeSelector.prototype, "handleCancel", null);
|
|
1121
|
-
__decorate([
|
|
1122
|
-
autobind,
|
|
1123
|
-
__metadata("design:type", Function),
|
|
1124
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
1125
|
-
__metadata("design:returntype", Object)
|
|
1126
|
-
], TreeSelector.prototype, "getDropInfo", null);
|
|
1127
|
-
__decorate([
|
|
1128
|
-
autobind,
|
|
1129
|
-
__metadata("design:type", Function),
|
|
1130
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
1131
|
-
__metadata("design:returntype", void 0)
|
|
1132
|
-
], TreeSelector.prototype, "updateDropIndicator", null);
|
|
1133
|
-
__decorate([
|
|
1134
|
-
autobind,
|
|
1135
|
-
__metadata("design:type", Function),
|
|
1136
|
-
__metadata("design:paramtypes", [Object]),
|
|
1137
|
-
__metadata("design:returntype", void 0)
|
|
1138
|
-
], TreeSelector.prototype, "onDragStart", null);
|
|
1139
|
-
__decorate([
|
|
1140
|
-
autobind,
|
|
1141
|
-
__metadata("design:type", Function),
|
|
1142
|
-
__metadata("design:paramtypes", [Object]),
|
|
1143
|
-
__metadata("design:returntype", void 0)
|
|
1144
|
-
], TreeSelector.prototype, "onDragOver", null);
|
|
1145
|
-
__decorate([
|
|
1146
|
-
autobind,
|
|
1147
|
-
__metadata("design:type", Function),
|
|
1148
|
-
__metadata("design:paramtypes", [Object]),
|
|
1149
|
-
__metadata("design:returntype", void 0)
|
|
1150
|
-
], TreeSelector.prototype, "onDragEnd", null);
|
|
1151
|
-
__decorate([
|
|
1152
|
-
autobind,
|
|
1153
|
-
__metadata("design:type", Function),
|
|
1154
|
-
__metadata("design:paramtypes", [Object]),
|
|
1155
|
-
__metadata("design:returntype", void 0)
|
|
1156
|
-
], TreeSelector.prototype, "renderItem", null);
|
|
1157
|
-
__decorate([
|
|
1158
|
-
autobind,
|
|
1159
|
-
__metadata("design:type", Function),
|
|
1160
|
-
__metadata("design:paramtypes", [Array, Boolean]),
|
|
1161
|
-
__metadata("design:returntype", void 0)
|
|
1162
|
-
], TreeSelector.prototype, "handleCheckAll", null);
|
|
1163
|
-
__decorate([
|
|
1164
|
-
autobind,
|
|
1165
|
-
__metadata("design:type", Function),
|
|
1166
|
-
__metadata("design:paramtypes", [Boolean]),
|
|
1167
|
-
__metadata("design:returntype", void 0)
|
|
1168
|
-
], TreeSelector.prototype, "handleToggle", null);
|
|
1169
|
-
__decorate([
|
|
1170
|
-
autobind,
|
|
1171
|
-
__metadata("design:type", Function),
|
|
1172
|
-
__metadata("design:paramtypes", [Object]),
|
|
1173
|
-
__metadata("design:returntype", void 0)
|
|
1174
|
-
], TreeSelector.prototype, "renderList", null);
|
|
1175
|
-
return TreeSelector;
|
|
1176
|
-
}(React__default.Component));
|
|
1177
|
-
var Tree = themeable(localeable(TreeSelector));
|
|
1178
|
-
|
|
1179
|
-
export { TreeSelector, Tree as default };
|