@sap-ux/ui-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +20 -0
- package/dist/components/Icons.d.ts +105 -0
- package/dist/components/Icons.d.ts.map +1 -0
- package/dist/components/Icons.js +401 -0
- package/dist/components/Icons.js.map +1 -0
- package/dist/components/UIBreadcrumb/UIBreadcrumb.d.ts +23 -0
- package/dist/components/UIBreadcrumb/UIBreadcrumb.d.ts.map +1 -0
- package/dist/components/UIBreadcrumb/UIBreadcrumb.js +38 -0
- package/dist/components/UIBreadcrumb/UIBreadcrumb.js.map +1 -0
- package/dist/components/UIBreadcrumb/index.d.ts +2 -0
- package/dist/components/UIBreadcrumb/index.d.ts.map +1 -0
- package/dist/components/UIBreadcrumb/index.js +14 -0
- package/dist/components/UIBreadcrumb/index.js.map +1 -0
- package/dist/components/UIButton/UIActionButton.d.ts +23 -0
- package/dist/components/UIButton/UIActionButton.d.ts.map +1 -0
- package/dist/components/UIButton/UIActionButton.js +97 -0
- package/dist/components/UIButton/UIActionButton.js.map +1 -0
- package/dist/components/UIButton/UIDefaultButton.d.ts +23 -0
- package/dist/components/UIButton/UIDefaultButton.d.ts.map +1 -0
- package/dist/components/UIButton/UIDefaultButton.js +227 -0
- package/dist/components/UIButton/UIDefaultButton.js.map +1 -0
- package/dist/components/UIButton/UIIconButton.d.ts +37 -0
- package/dist/components/UIButton/UIIconButton.d.ts.map +1 -0
- package/dist/components/UIButton/UIIconButton.js +106 -0
- package/dist/components/UIButton/UIIconButton.js.map +1 -0
- package/dist/components/UIButton/UISplitButton.d.ts +36 -0
- package/dist/components/UIButton/UISplitButton.d.ts.map +1 -0
- package/dist/components/UIButton/UISplitButton.js +67 -0
- package/dist/components/UIButton/UISplitButton.js.map +1 -0
- package/dist/components/UIButton/index.d.ts +7 -0
- package/dist/components/UIButton/index.d.ts.map +1 -0
- package/dist/components/UIButton/index.js +17 -0
- package/dist/components/UIButton/index.js.map +1 -0
- package/dist/components/UICallout/UICallout.d.ts +37 -0
- package/dist/components/UICallout/UICallout.d.ts.map +1 -0
- package/dist/components/UICallout/UICallout.js +90 -0
- package/dist/components/UICallout/UICallout.js.map +1 -0
- package/dist/components/UICallout/index.d.ts +2 -0
- package/dist/components/UICallout/index.d.ts.map +1 -0
- package/dist/components/UICallout/index.js +14 -0
- package/dist/components/UICallout/index.js.map +1 -0
- package/dist/components/UICheckbox/UICheckbox.d.ts +34 -0
- package/dist/components/UICheckbox/UICheckbox.d.ts.map +1 -0
- package/dist/components/UICheckbox/UICheckbox.js +135 -0
- package/dist/components/UICheckbox/UICheckbox.js.map +1 -0
- package/dist/components/UICheckbox/index.d.ts +2 -0
- package/dist/components/UICheckbox/index.d.ts.map +1 -0
- package/dist/components/UICheckbox/index.js +14 -0
- package/dist/components/UICheckbox/index.js.map +1 -0
- package/dist/components/UIChoiceGroup/UIChoiceGroup.d.ts +28 -0
- package/dist/components/UIChoiceGroup/UIChoiceGroup.d.ts.map +1 -0
- package/dist/components/UIChoiceGroup/UIChoiceGroup.js +182 -0
- package/dist/components/UIChoiceGroup/UIChoiceGroup.js.map +1 -0
- package/dist/components/UIChoiceGroup/index.d.ts +2 -0
- package/dist/components/UIChoiceGroup/index.d.ts.map +1 -0
- package/dist/components/UIChoiceGroup/index.js +14 -0
- package/dist/components/UIChoiceGroup/index.js.map +1 -0
- package/dist/components/UIComboBox/Callout.scss +7 -0
- package/dist/components/UIComboBox/UIComboBox.d.ts +190 -0
- package/dist/components/UIComboBox/UIComboBox.d.ts.map +1 -0
- package/dist/components/UIComboBox/UIComboBox.js +468 -0
- package/dist/components/UIComboBox/UIComboBox.js.map +1 -0
- package/dist/components/UIComboBox/UIComboBox.scss +245 -0
- package/dist/components/UIComboBox/_mixins.scss +24 -0
- package/dist/components/UIComboBox/index.d.ts +2 -0
- package/dist/components/UIComboBox/index.d.ts.map +1 -0
- package/dist/components/UIComboBox/index.js +14 -0
- package/dist/components/UIComboBox/index.js.map +1 -0
- package/dist/components/UIContextualMenu/UIContextualMenu.d.ts +32 -0
- package/dist/components/UIContextualMenu/UIContextualMenu.d.ts.map +1 -0
- package/dist/components/UIContextualMenu/UIContextualMenu.js +124 -0
- package/dist/components/UIContextualMenu/UIContextualMenu.js.map +1 -0
- package/dist/components/UIContextualMenu/UIContextualMenu.scss +211 -0
- package/dist/components/UIContextualMenu/UIHighlightMenuOption.d.ts +20 -0
- package/dist/components/UIContextualMenu/UIHighlightMenuOption.d.ts.map +1 -0
- package/dist/components/UIContextualMenu/UIHighlightMenuOption.js +51 -0
- package/dist/components/UIContextualMenu/UIHighlightMenuOption.js.map +1 -0
- package/dist/components/UIContextualMenu/UIHighlightMenuOption.scss +23 -0
- package/dist/components/UIContextualMenu/_variables.scss +30 -0
- package/dist/components/UIContextualMenu/index.d.ts +3 -0
- package/dist/components/UIContextualMenu/index.d.ts.map +1 -0
- package/dist/components/UIContextualMenu/index.js +15 -0
- package/dist/components/UIContextualMenu/index.js.map +1 -0
- package/dist/components/UIDatePicker/UIDatePicker.d.ts +49 -0
- package/dist/components/UIDatePicker/UIDatePicker.d.ts.map +1 -0
- package/dist/components/UIDatePicker/UIDatePicker.js +72 -0
- package/dist/components/UIDatePicker/UIDatePicker.js.map +1 -0
- package/dist/components/UIDatePicker/UIDatePicker.scss +38 -0
- package/dist/components/UIDatePicker/index.d.ts +2 -0
- package/dist/components/UIDatePicker/index.d.ts.map +1 -0
- package/dist/components/UIDatePicker/index.js +14 -0
- package/dist/components/UIDatePicker/index.js.map +1 -0
- package/dist/components/UIDialog/UIDialog.d.ts +102 -0
- package/dist/components/UIDialog/UIDialog.d.ts.map +1 -0
- package/dist/components/UIDialog/UIDialog.js +250 -0
- package/dist/components/UIDialog/UIDialog.js.map +1 -0
- package/dist/components/UIDialog/index.d.ts +2 -0
- package/dist/components/UIDialog/index.d.ts.map +1 -0
- package/dist/components/UIDialog/index.js +14 -0
- package/dist/components/UIDialog/index.js.map +1 -0
- package/dist/components/UIDropdown/UIDropdown.d.ts +76 -0
- package/dist/components/UIDropdown/UIDropdown.d.ts.map +1 -0
- package/dist/components/UIDropdown/UIDropdown.js +166 -0
- package/dist/components/UIDropdown/UIDropdown.js.map +1 -0
- package/dist/components/UIDropdown/UIDropdown.scss +80 -0
- package/dist/components/UIDropdown/index.d.ts +2 -0
- package/dist/components/UIDropdown/index.d.ts.map +1 -0
- package/dist/components/UIDropdown/index.js +14 -0
- package/dist/components/UIDropdown/index.js.map +1 -0
- package/dist/components/UIFlexibleTable/RowActions.d.ts +17 -0
- package/dist/components/UIFlexibleTable/RowActions.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/RowActions.js +68 -0
- package/dist/components/UIFlexibleTable/RowActions.js.map +1 -0
- package/dist/components/UIFlexibleTable/RowData.d.ts +16 -0
- package/dist/components/UIFlexibleTable/RowData.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/RowData.js +109 -0
- package/dist/components/UIFlexibleTable/RowData.js.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTable.d.ts +12 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTable.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTable.js +256 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTable.js.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTable.scss +408 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableActionButton.d.ts +20 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableActionButton.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableActionButton.js +20 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableActionButton.js.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRow.d.ts +28 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRow.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRow.js +165 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRow.js.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRowActionButton.d.ts +21 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRowActionButton.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRowActionButton.js +20 -0
- package/dist/components/UIFlexibleTable/UIFlexibleTableRowActionButton.js.map +1 -0
- package/dist/components/UIFlexibleTable/index.d.ts +6 -0
- package/dist/components/UIFlexibleTable/index.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/index.js +18 -0
- package/dist/components/UIFlexibleTable/index.js.map +1 -0
- package/dist/components/UIFlexibleTable/types.d.ts +103 -0
- package/dist/components/UIFlexibleTable/types.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/types.js +9 -0
- package/dist/components/UIFlexibleTable/types.js.map +1 -0
- package/dist/components/UIFlexibleTable/utils.d.ts +29 -0
- package/dist/components/UIFlexibleTable/utils.d.ts.map +1 -0
- package/dist/components/UIFlexibleTable/utils.js +53 -0
- package/dist/components/UIFlexibleTable/utils.js.map +1 -0
- package/dist/components/UIFocusZone/UIFocusTrapZone.d.ts +22 -0
- package/dist/components/UIFocusZone/UIFocusTrapZone.d.ts.map +1 -0
- package/dist/components/UIFocusZone/UIFocusTrapZone.js +33 -0
- package/dist/components/UIFocusZone/UIFocusTrapZone.js.map +1 -0
- package/dist/components/UIFocusZone/UIFocusZone.d.ts +23 -0
- package/dist/components/UIFocusZone/UIFocusZone.d.ts.map +1 -0
- package/dist/components/UIFocusZone/UIFocusZone.js +35 -0
- package/dist/components/UIFocusZone/UIFocusZone.js.map +1 -0
- package/dist/components/UIFocusZone/index.d.ts +3 -0
- package/dist/components/UIFocusZone/index.d.ts.map +1 -0
- package/dist/components/UIFocusZone/index.js +15 -0
- package/dist/components/UIFocusZone/index.js.map +1 -0
- package/dist/components/UIIcon/UIIcon.d.ts +24 -0
- package/dist/components/UIIcon/UIIcon.d.ts.map +1 -0
- package/dist/components/UIIcon/UIIcon.js +37 -0
- package/dist/components/UIIcon/UIIcon.js.map +1 -0
- package/dist/components/UIIcon/UIIcon.scss +3 -0
- package/dist/components/UIIcon/index.d.ts +2 -0
- package/dist/components/UIIcon/index.d.ts.map +1 -0
- package/dist/components/UIIcon/index.js +14 -0
- package/dist/components/UIIcon/index.js.map +1 -0
- package/dist/components/UIInput/UITextInput.d.ts +25 -0
- package/dist/components/UIInput/UITextInput.d.ts.map +1 -0
- package/dist/components/UIInput/UITextInput.js +180 -0
- package/dist/components/UIInput/UITextInput.js.map +1 -0
- package/dist/components/UIInput/index.d.ts +2 -0
- package/dist/components/UIInput/index.d.ts.map +1 -0
- package/dist/components/UIInput/index.js +14 -0
- package/dist/components/UIInput/index.js.map +1 -0
- package/dist/components/UILabel/UILabel.d.ts +30 -0
- package/dist/components/UILabel/UILabel.d.ts.map +1 -0
- package/dist/components/UILabel/UILabel.js +64 -0
- package/dist/components/UILabel/UILabel.js.map +1 -0
- package/dist/components/UILabel/index.d.ts +2 -0
- package/dist/components/UILabel/index.d.ts.map +1 -0
- package/dist/components/UILabel/index.js +14 -0
- package/dist/components/UILabel/index.js.map +1 -0
- package/dist/components/UILink/UILink.d.ts +22 -0
- package/dist/components/UILink/UILink.d.ts.map +1 -0
- package/dist/components/UILink/UILink.js +58 -0
- package/dist/components/UILink/UILink.js.map +1 -0
- package/dist/components/UILink/index.d.ts +2 -0
- package/dist/components/UILink/index.d.ts.map +1 -0
- package/dist/components/UILink/index.js +14 -0
- package/dist/components/UILink/index.js.map +1 -0
- package/dist/components/UIList/UIList.d.ts +31 -0
- package/dist/components/UIList/UIList.d.ts.map +1 -0
- package/dist/components/UIList/UIList.js +120 -0
- package/dist/components/UIList/UIList.js.map +1 -0
- package/dist/components/UIList/UIList.scss +16 -0
- package/dist/components/UIList/index.d.ts +2 -0
- package/dist/components/UIList/index.d.ts.map +1 -0
- package/dist/components/UIList/index.js +14 -0
- package/dist/components/UIList/index.js.map +1 -0
- package/dist/components/UILoader/UILoader.d.ts +27 -0
- package/dist/components/UILoader/UILoader.d.ts.map +1 -0
- package/dist/components/UILoader/UILoader.js +78 -0
- package/dist/components/UILoader/UILoader.js.map +1 -0
- package/dist/components/UILoader/UILoader.scss +32 -0
- package/dist/components/UILoader/index.d.ts +2 -0
- package/dist/components/UILoader/index.d.ts.map +1 -0
- package/dist/components/UILoader/index.js +14 -0
- package/dist/components/UILoader/index.js.map +1 -0
- package/dist/components/UIMessageBar/UIMessageBar.d.ts +25 -0
- package/dist/components/UIMessageBar/UIMessageBar.d.ts.map +1 -0
- package/dist/components/UIMessageBar/UIMessageBar.js +59 -0
- package/dist/components/UIMessageBar/UIMessageBar.js.map +1 -0
- package/dist/components/UIMessageBar/index.d.ts +2 -0
- package/dist/components/UIMessageBar/index.d.ts.map +1 -0
- package/dist/components/UIMessageBar/index.js +14 -0
- package/dist/components/UIMessageBar/index.js.map +1 -0
- package/dist/components/UIModal/UIModal.d.ts +23 -0
- package/dist/components/UIModal/UIModal.d.ts.map +1 -0
- package/dist/components/UIModal/UIModal.js +43 -0
- package/dist/components/UIModal/UIModal.js.map +1 -0
- package/dist/components/UIModal/index.d.ts +2 -0
- package/dist/components/UIModal/index.d.ts.map +1 -0
- package/dist/components/UIModal/index.js +14 -0
- package/dist/components/UIModal/index.js.map +1 -0
- package/dist/components/UIOverlay/UIOverlay.d.ts +22 -0
- package/dist/components/UIOverlay/UIOverlay.d.ts.map +1 -0
- package/dist/components/UIOverlay/UIOverlay.js +38 -0
- package/dist/components/UIOverlay/UIOverlay.js.map +1 -0
- package/dist/components/UIOverlay/index.d.ts +2 -0
- package/dist/components/UIOverlay/index.d.ts.map +1 -0
- package/dist/components/UIOverlay/index.js +14 -0
- package/dist/components/UIOverlay/index.js.map +1 -0
- package/dist/components/UISearchBox/UISearchBox.d.ts +22 -0
- package/dist/components/UISearchBox/UISearchBox.d.ts.map +1 -0
- package/dist/components/UISearchBox/UISearchBox.js +155 -0
- package/dist/components/UISearchBox/UISearchBox.js.map +1 -0
- package/dist/components/UISearchBox/index.d.ts +4 -0
- package/dist/components/UISearchBox/index.d.ts.map +1 -0
- package/dist/components/UISearchBox/index.js +14 -0
- package/dist/components/UISearchBox/index.js.map +1 -0
- package/dist/components/UISection/UISection.d.ts +33 -0
- package/dist/components/UISection/UISection.d.ts.map +1 -0
- package/dist/components/UISection/UISection.js +47 -0
- package/dist/components/UISection/UISection.js.map +1 -0
- package/dist/components/UISection/UISection.scss +76 -0
- package/dist/components/UISection/UISections.d.ts +251 -0
- package/dist/components/UISection/UISections.d.ts.map +1 -0
- package/dist/components/UISection/UISections.js +709 -0
- package/dist/components/UISection/UISections.js.map +1 -0
- package/dist/components/UISection/UISections.scss +62 -0
- package/dist/components/UISection/UISplitter.d.ts +97 -0
- package/dist/components/UISection/UISplitter.d.ts.map +1 -0
- package/dist/components/UISection/UISplitter.js +221 -0
- package/dist/components/UISection/UISplitter.js.map +1 -0
- package/dist/components/UISection/UISplitter.scss +212 -0
- package/dist/components/UISection/_mixins.scss +14 -0
- package/dist/components/UISection/_variables.scss +1 -0
- package/dist/components/UISection/index.d.ts +4 -0
- package/dist/components/UISection/index.d.ts.map +1 -0
- package/dist/components/UISection/index.js +16 -0
- package/dist/components/UISection/index.js.map +1 -0
- package/dist/components/UITable/UITable-helper.d.ts +85 -0
- package/dist/components/UITable/UITable-helper.d.ts.map +1 -0
- package/dist/components/UITable/UITable-helper.js +267 -0
- package/dist/components/UITable/UITable-helper.js.map +1 -0
- package/dist/components/UITable/UITable.d.ts +212 -0
- package/dist/components/UITable/UITable.d.ts.map +1 -0
- package/dist/components/UITable/UITable.js +762 -0
- package/dist/components/UITable/UITable.js.map +1 -0
- package/dist/components/UITable/UITable.scss +194 -0
- package/dist/components/UITable/index.d.ts +3 -0
- package/dist/components/UITable/index.d.ts.map +1 -0
- package/dist/components/UITable/index.js +15 -0
- package/dist/components/UITable/index.js.map +1 -0
- package/dist/components/UITable/types.d.ts +76 -0
- package/dist/components/UITable/types.d.ts.map +1 -0
- package/dist/components/UITable/types.js +27 -0
- package/dist/components/UITable/types.js.map +1 -0
- package/dist/components/UITabs/UITabs.d.ts +28 -0
- package/dist/components/UITabs/UITabs.d.ts.map +1 -0
- package/dist/components/UITabs/UITabs.js +70 -0
- package/dist/components/UITabs/UITabs.js.map +1 -0
- package/dist/components/UITabs/index.d.ts +2 -0
- package/dist/components/UITabs/index.d.ts.map +1 -0
- package/dist/components/UITabs/index.js +14 -0
- package/dist/components/UITabs/index.js.map +1 -0
- package/dist/components/UIToggle/UIToggle.d.ts +39 -0
- package/dist/components/UIToggle/UIToggle.d.ts.map +1 -0
- package/dist/components/UIToggle/UIToggle.js +181 -0
- package/dist/components/UIToggle/UIToggle.js.map +1 -0
- package/dist/components/UIToggle/index.d.ts +2 -0
- package/dist/components/UIToggle/index.d.ts.map +1 -0
- package/dist/components/UIToggle/index.js +14 -0
- package/dist/components/UIToggle/index.js.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.d.ts +31 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.js +132 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.js.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.scss +13 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.types.d.ts +23 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.types.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.types.js +3 -0
- package/dist/components/UIToggleGroup/UIToggleGroup.types.js.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.d.ts +26 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.js +74 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.js.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.scss +74 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.types.d.ts +11 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.types.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.types.js +3 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/UIToggleGroupOption.types.js.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/index.d.ts +3 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/index.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/index.js +15 -0
- package/dist/components/UIToggleGroup/UIToggleGroupOption/index.js.map +1 -0
- package/dist/components/UIToggleGroup/index.d.ts +3 -0
- package/dist/components/UIToggleGroup/index.d.ts.map +1 -0
- package/dist/components/UIToggleGroup/index.js +15 -0
- package/dist/components/UIToggleGroup/index.js.map +1 -0
- package/dist/components/UIToolbar/UIToolbar.d.ts +37 -0
- package/dist/components/UIToolbar/UIToolbar.d.ts.map +1 -0
- package/dist/components/UIToolbar/UIToolbar.js +101 -0
- package/dist/components/UIToolbar/UIToolbar.js.map +1 -0
- package/dist/components/UIToolbar/UIToolbar.scss +48 -0
- package/dist/components/UIToolbar/UIToolbarColumn.d.ts +8 -0
- package/dist/components/UIToolbar/UIToolbarColumn.d.ts.map +1 -0
- package/dist/components/UIToolbar/UIToolbarColumn.js +30 -0
- package/dist/components/UIToolbar/UIToolbarColumn.js.map +1 -0
- package/dist/components/UIToolbar/UIToolbarDivider.d.ts +26 -0
- package/dist/components/UIToolbar/UIToolbarDivider.d.ts.map +1 -0
- package/dist/components/UIToolbar/UIToolbarDivider.js +51 -0
- package/dist/components/UIToolbar/UIToolbarDivider.js.map +1 -0
- package/dist/components/UIToolbar/index.d.ts +4 -0
- package/dist/components/UIToolbar/index.d.ts.map +1 -0
- package/dist/components/UIToolbar/index.js +16 -0
- package/dist/components/UIToolbar/index.js.map +1 -0
- package/dist/components/UITooltip/UITooltip.d.ts +29 -0
- package/dist/components/UITooltip/UITooltip.d.ts.map +1 -0
- package/dist/components/UITooltip/UITooltip.js +79 -0
- package/dist/components/UITooltip/UITooltip.js.map +1 -0
- package/dist/components/UITooltip/UITooltipUtils.d.ts +17 -0
- package/dist/components/UITooltip/UITooltipUtils.d.ts.map +1 -0
- package/dist/components/UITooltip/UITooltipUtils.js +47 -0
- package/dist/components/UITooltip/UITooltipUtils.js.map +1 -0
- package/dist/components/UITooltip/index.d.ts +3 -0
- package/dist/components/UITooltip/index.d.ts.map +1 -0
- package/dist/components/UITooltip/index.js +15 -0
- package/dist/components/UITooltip/index.js.map +1 -0
- package/dist/components/UITreeDropdown/UITreeDropdown.d.ts +255 -0
- package/dist/components/UITreeDropdown/UITreeDropdown.d.ts.map +1 -0
- package/dist/components/UITreeDropdown/UITreeDropdown.js +638 -0
- package/dist/components/UITreeDropdown/UITreeDropdown.js.map +1 -0
- package/dist/components/UITreeDropdown/UITreeDropdown.scss +82 -0
- package/dist/components/UITreeDropdown/index.d.ts +2 -0
- package/dist/components/UITreeDropdown/index.d.ts.map +1 -0
- package/dist/components/UITreeDropdown/index.js +14 -0
- package/dist/components/UITreeDropdown/index.js.map +1 -0
- package/dist/components/UIVerticalDivider/UIVerticalDivider.d.ts +24 -0
- package/dist/components/UIVerticalDivider/UIVerticalDivider.d.ts.map +1 -0
- package/dist/components/UIVerticalDivider/UIVerticalDivider.js +42 -0
- package/dist/components/UIVerticalDivider/UIVerticalDivider.js.map +1 -0
- package/dist/components/UIVerticalDivider/index.d.ts +2 -0
- package/dist/components/UIVerticalDivider/index.d.ts.map +1 -0
- package/dist/components/UIVerticalDivider/index.js +14 -0
- package/dist/components/UIVerticalDivider/index.js.map +1 -0
- package/dist/components/UIVirtualList/UIAutoSizer.d.ts +22 -0
- package/dist/components/UIVirtualList/UIAutoSizer.d.ts.map +1 -0
- package/dist/components/UIVirtualList/UIAutoSizer.js +33 -0
- package/dist/components/UIVirtualList/UIAutoSizer.js.map +1 -0
- package/dist/components/UIVirtualList/UICellMeasurer.d.ts +23 -0
- package/dist/components/UIVirtualList/UICellMeasurer.d.ts.map +1 -0
- package/dist/components/UIVirtualList/UICellMeasurer.js +33 -0
- package/dist/components/UIVirtualList/UICellMeasurer.js.map +1 -0
- package/dist/components/UIVirtualList/UIVirtualList.d.ts +43 -0
- package/dist/components/UIVirtualList/UIVirtualList.d.ts.map +1 -0
- package/dist/components/UIVirtualList/UIVirtualList.js +70 -0
- package/dist/components/UIVirtualList/UIVirtualList.js.map +1 -0
- package/dist/components/UIVirtualList/index.d.ts +4 -0
- package/dist/components/UIVirtualList/index.d.ts.map +1 -0
- package/dist/components/UIVirtualList/index.js +16 -0
- package/dist/components/UIVirtualList/index.js.map +1 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +46 -0
- package/dist/components/index.js.map +1 -0
- package/dist/helper/ValidationMessage/MessageWrapper.d.ts +18 -0
- package/dist/helper/ValidationMessage/MessageWrapper.d.ts.map +1 -0
- package/dist/helper/ValidationMessage/MessageWrapper.js +35 -0
- package/dist/helper/ValidationMessage/MessageWrapper.js.map +1 -0
- package/dist/helper/ValidationMessage/MessageWrapper.scss +44 -0
- package/dist/helper/ValidationMessage/index.d.ts +3 -0
- package/dist/helper/ValidationMessage/index.d.ts.map +1 -0
- package/dist/helper/ValidationMessage/index.js +15 -0
- package/dist/helper/ValidationMessage/index.js.map +1 -0
- package/dist/helper/ValidationMessage/utils.d.ts +32 -0
- package/dist/helper/ValidationMessage/utils.d.ts.map +1 -0
- package/dist/helper/ValidationMessage/utils.js +124 -0
- package/dist/helper/ValidationMessage/utils.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/_color.scss +435 -0
- package/dist/styles/_mixins.scss +15 -0
- package/dist/styles/_theia_materialcolors.scss +279 -0
- package/dist/styles/_typography.scss +72 -0
- package/dist/styles/_variables.scss +24 -0
- package/dist/styles/ui-components.scss +5 -0
- package/dist/utilities/DeepMerge.d.ts +10 -0
- package/dist/utilities/DeepMerge.d.ts.map +1 -0
- package/dist/utilities/DeepMerge.js +43 -0
- package/dist/utilities/DeepMerge.js.map +1 -0
- package/dist/utilities/Focus.d.ts +5 -0
- package/dist/utilities/Focus.d.ts.map +1 -0
- package/dist/utilities/Focus.js +8 -0
- package/dist/utilities/Focus.js.map +1 -0
- package/dist/utilities/Id.d.ts +3 -0
- package/dist/utilities/Id.d.ts.map +1 -0
- package/dist/utilities/Id.js +6 -0
- package/dist/utilities/Id.js.map +1 -0
- package/dist/utilities/Keys.d.ts +3 -0
- package/dist/utilities/Keys.d.ts.map +1 -0
- package/dist/utilities/Keys.js +6 -0
- package/dist/utilities/Keys.js.map +1 -0
- package/dist/utilities/index.d.ts +4 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +16 -0
- package/dist/utilities/index.js.map +1 -0
- package/package.json +78 -0
- package/storybook/509.1060f8f464e74d7e89e3.manager.bundle.js +17 -0
- package/storybook/685.6d7c03ae84f4f4910fd8.manager.bundle.js +10 -0
- package/storybook/720.3f79f56f8617ba9b098b.manager.bundle.js +1 -0
- package/storybook/730.e07ff5529508942d85d4.manager.bundle.js +15 -0
- package/storybook/759.8ae5af3b1b3b446a9919.manager.bundle.js +296 -0
- package/storybook/906.cf93a831.iframe.bundle.js +1 -0
- package/storybook/93.4e7a890e.iframe.bundle.js +301 -0
- package/storybook/975.15c711f75c0452ae9e9f.manager.bundle.js +2 -0
- package/storybook/978.a517622963996a3b8256.manager.bundle.js +894 -0
- package/storybook/983.515d3eedbfaed61e9ae7.manager.bundle.js +1 -0
- package/storybook/favicon.ico +0 -0
- package/storybook/iframe.html +380 -0
- package/storybook/index.html +177 -0
- package/storybook/main.e843f431b2692c06059a.manager.bundle.js +1 -0
- package/storybook/main.fd2077c6.iframe.bundle.js +98 -0
- package/storybook/project.json +1 -0
- package/storybook/runtime~main.1118f177d5097a42d314.manager.bundle.js +2 -0
- package/storybook/runtime~main.e0688c57.iframe.bundle.js +2 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UISections = exports.ANIMATION_TIME = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const UISection_1 = require("./UISection");
|
|
9
|
+
const UISplitter_1 = require("./UISplitter");
|
|
10
|
+
require("./UISections.scss");
|
|
11
|
+
exports.ANIMATION_TIME = 300;
|
|
12
|
+
const SECTIONS_ANIMATION_CLASS = 'sections--animated';
|
|
13
|
+
/**
|
|
14
|
+
* UISections component.
|
|
15
|
+
* @exports
|
|
16
|
+
* @class {UISections}
|
|
17
|
+
* @extends {React.Component<UISectionsProps, UISectionsState>}
|
|
18
|
+
*/
|
|
19
|
+
class UISections extends react_1.default.Component {
|
|
20
|
+
/**
|
|
21
|
+
* Initializes component properties.
|
|
22
|
+
*
|
|
23
|
+
* @param {UISectionsProps} props
|
|
24
|
+
*/
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super(props);
|
|
27
|
+
this.resizeSections = [];
|
|
28
|
+
this.isFullScreen = false;
|
|
29
|
+
this.rootSize = 0;
|
|
30
|
+
this.ignoreAnimation = false;
|
|
31
|
+
this.state = {
|
|
32
|
+
sizes: undefined
|
|
33
|
+
};
|
|
34
|
+
this.onWindowResize = this.onWindowResize.bind(this);
|
|
35
|
+
this.rootRef = react_1.default.createRef();
|
|
36
|
+
this.sizeProperty = props.vertical ? 'height' : 'width';
|
|
37
|
+
this.domSizeProperty = props.vertical ? 'clientHeight' : 'clientWidth';
|
|
38
|
+
this.startPositionProperty = props.vertical ? 'top' : 'left';
|
|
39
|
+
this.endPositionProperty = props.vertical ? 'bottom' : 'right';
|
|
40
|
+
this.sizeProperty = props.vertical ? 'height' : 'width';
|
|
41
|
+
window.addEventListener('resize', this.onWindowResize);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Updates state sizes.
|
|
45
|
+
*
|
|
46
|
+
* @param {number} layoutSize
|
|
47
|
+
* @param {Array<number | UISectionSize | undefine>} sizes
|
|
48
|
+
* @returns {UISectionSize[]}
|
|
49
|
+
*/
|
|
50
|
+
updateStateSizes(layoutSize, sizes) {
|
|
51
|
+
let uiSizes = sizes;
|
|
52
|
+
const dynamicSectionIndex = this.getDynamicSectionIndex();
|
|
53
|
+
// Calculate size for dynamic section
|
|
54
|
+
let availableSize = 0;
|
|
55
|
+
sizes.forEach((section, index) => {
|
|
56
|
+
if (typeof section === 'object' && section.size === undefined) {
|
|
57
|
+
const position = this.getSectionPosition(section);
|
|
58
|
+
section.size = Math.abs(this.rootSize - position.end - position.start);
|
|
59
|
+
}
|
|
60
|
+
if (index !== dynamicSectionIndex) {
|
|
61
|
+
availableSize += (typeof section === 'object' ? section.size : section) || 0;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
availableSize = layoutSize - availableSize;
|
|
65
|
+
// Check if number array is passed as sizes. Convert array of number to array of UISectionSize
|
|
66
|
+
if (typeof sizes[0] !== 'object') {
|
|
67
|
+
uiSizes = [];
|
|
68
|
+
let start = 0;
|
|
69
|
+
sizes.forEach((size, index) => {
|
|
70
|
+
size = dynamicSectionIndex !== index ? size : availableSize;
|
|
71
|
+
uiSizes.push({
|
|
72
|
+
percentage: false,
|
|
73
|
+
size,
|
|
74
|
+
start
|
|
75
|
+
});
|
|
76
|
+
start += size || 0;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// Apply size for dynamic section
|
|
80
|
+
const dynamicSection = uiSizes[dynamicSectionIndex];
|
|
81
|
+
if (dynamicSection) {
|
|
82
|
+
dynamicSection.size = availableSize;
|
|
83
|
+
}
|
|
84
|
+
// Recalculate start and end positions
|
|
85
|
+
this.recalculatePositions(uiSizes);
|
|
86
|
+
// Validate min sizes
|
|
87
|
+
this.validateStateMinSizes(uiSizes);
|
|
88
|
+
return uiSizes;
|
|
89
|
+
}
|
|
90
|
+
componentDidMount() {
|
|
91
|
+
const { sizesAsPercents, sizes } = this.props;
|
|
92
|
+
this.rootSize = this.getRootSize();
|
|
93
|
+
if (!sizesAsPercents && sizes) {
|
|
94
|
+
// Calculate state
|
|
95
|
+
this.setState({
|
|
96
|
+
sizes: this.updateStateSizes(this.rootSize, sizes)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
componentDidUpdate() {
|
|
101
|
+
this.ignoreAnimation = false;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets derived state from properties.
|
|
105
|
+
*
|
|
106
|
+
* @param {UISectionProps} nextProps
|
|
107
|
+
* @param {UISectionsState} prevState
|
|
108
|
+
*
|
|
109
|
+
* @returns {UISectionsState | null}
|
|
110
|
+
*/
|
|
111
|
+
static getDerivedStateFromProps(nextProps, prevState) {
|
|
112
|
+
// Handle property "animation" as array
|
|
113
|
+
let animate = prevState.animate;
|
|
114
|
+
let visibleSections;
|
|
115
|
+
let dynamicSection = 0;
|
|
116
|
+
if (Array.isArray(nextProps.animation)) {
|
|
117
|
+
visibleSections = UISections.getVisibleSections(nextProps.children);
|
|
118
|
+
// Check if there is transition for section with enabled animation
|
|
119
|
+
let transitionAnimation;
|
|
120
|
+
for (let i = 0; i < nextProps.animation.length; i++) {
|
|
121
|
+
if (visibleSections?.includes(i) !== prevState.visibleSections?.includes(i)) {
|
|
122
|
+
transitionAnimation = transitionAnimation || nextProps.animation[i];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (transitionAnimation !== undefined) {
|
|
126
|
+
// Visibility of sections changed - apply animation for transition section
|
|
127
|
+
animate = transitionAnimation;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
animate = nextProps.animation;
|
|
132
|
+
}
|
|
133
|
+
// Find dynamic section index
|
|
134
|
+
nextProps.sizes?.forEach((size, index) => {
|
|
135
|
+
if (size === undefined) {
|
|
136
|
+
dynamicSection = index;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return {
|
|
140
|
+
animate,
|
|
141
|
+
visibleSections,
|
|
142
|
+
dynamicSection
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Validates state min sizes.
|
|
147
|
+
*
|
|
148
|
+
* @param {UISectionSize[]} sizes
|
|
149
|
+
*/
|
|
150
|
+
validateStateMinSizes(sizes) {
|
|
151
|
+
// Prerequisite. Get size infos
|
|
152
|
+
let minSizesSum = 0;
|
|
153
|
+
let recalculateSizes = false;
|
|
154
|
+
const sizesInfo = [];
|
|
155
|
+
for (let i = 0; i < this.props.children.length; i++) {
|
|
156
|
+
//const size = this.getSectionCurrentSize(i);
|
|
157
|
+
const size = sizes[i].size || 0;
|
|
158
|
+
const minSize = this.getMinSectionSize(i);
|
|
159
|
+
if (minSize > size) {
|
|
160
|
+
recalculateSizes = true;
|
|
161
|
+
}
|
|
162
|
+
minSizesSum += minSize;
|
|
163
|
+
// Sizes data
|
|
164
|
+
sizesInfo.push({
|
|
165
|
+
size,
|
|
166
|
+
minSize,
|
|
167
|
+
spareSize: size - minSize
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
// First Part. Check if full screen required
|
|
171
|
+
const layoutSize = this.getRootSize();
|
|
172
|
+
// Second Part. Calculate sections which less than min size.
|
|
173
|
+
if (recalculateSizes && layoutSize >= minSizesSum) {
|
|
174
|
+
const recalculatedSizes = this.calculateSectionSizes(sizesInfo);
|
|
175
|
+
for (let i = 0; i < sizes.length; i++) {
|
|
176
|
+
sizes[i] = recalculatedSizes[i];
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Check full screen toggle
|
|
180
|
+
const isFullScreen = layoutSize < minSizesSum;
|
|
181
|
+
if (isFullScreen !== this.isFullScreen) {
|
|
182
|
+
this.isFullScreen = isFullScreen;
|
|
183
|
+
this.props.onToggleFullscreen?.(isFullScreen);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
onWindowResize() {
|
|
187
|
+
let { sizes } = this.state;
|
|
188
|
+
// Dynamic section index
|
|
189
|
+
const layoutSize = this.getRootSize();
|
|
190
|
+
if (sizes) {
|
|
191
|
+
// Update sizes after resize
|
|
192
|
+
sizes = this.updateStateSizes(layoutSize, sizes);
|
|
193
|
+
// Apply state
|
|
194
|
+
this.ignoreAnimation = true;
|
|
195
|
+
this.setState({
|
|
196
|
+
sizes: sizes
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
this.rootSize = layoutSize;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Method returns indices of visible sections.
|
|
203
|
+
*
|
|
204
|
+
* @param {React.ReactNodeArray} sections Section elements.
|
|
205
|
+
* @returns {number[]} Indices of visible sections.
|
|
206
|
+
*/
|
|
207
|
+
static getVisibleSections(sections) {
|
|
208
|
+
const visibleSections = [];
|
|
209
|
+
sections.forEach((child, i) => {
|
|
210
|
+
if (!UISections.isSectionVisible(child)) {
|
|
211
|
+
visibleSections.push(i);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
return visibleSections;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Method checks is passed child section visible or not.
|
|
218
|
+
*
|
|
219
|
+
* @param {React.ReactElement | undefined} node React child node.
|
|
220
|
+
* @returns {boolean} True if section visible.
|
|
221
|
+
*/
|
|
222
|
+
static isSectionVisible(node) {
|
|
223
|
+
if (node && node.type === UISection_1.UISection) {
|
|
224
|
+
return !node.props.hidden;
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Method called when resizing of section started.
|
|
230
|
+
*/
|
|
231
|
+
onSplitterResizeStart() {
|
|
232
|
+
const rootDom = this.rootRef.current;
|
|
233
|
+
const resizeSections = [];
|
|
234
|
+
if (rootDom && rootDom.childNodes) {
|
|
235
|
+
rootDom.classList.remove(SECTIONS_ANIMATION_CLASS);
|
|
236
|
+
for (let i = 0; i < rootDom.childNodes.length; i++) {
|
|
237
|
+
const minSectionSize = this.getMinSectionSize(i);
|
|
238
|
+
const siblingMinSectionSize = this.getMinSectionSize(i === 0 ? 1 : 0);
|
|
239
|
+
const sectionDom = rootDom.children[i];
|
|
240
|
+
const maxSize = Math.max(minSectionSize, rootDom[this.domSizeProperty] - siblingMinSectionSize);
|
|
241
|
+
resizeSections.push({
|
|
242
|
+
size: sectionDom[this.domSizeProperty],
|
|
243
|
+
dom: sectionDom,
|
|
244
|
+
maxSize,
|
|
245
|
+
section: this.resizeSections[i]
|
|
246
|
+
? this.resizeSections[i].section
|
|
247
|
+
: {
|
|
248
|
+
percentage: false
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
this.resizeSections = resizeSections;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Method called when resizing of section is happening.
|
|
257
|
+
*
|
|
258
|
+
* @param {number} position Delta position in pixels.
|
|
259
|
+
* @returns {boolean} If resizing was happened - it can return false when splitter meets resizing limitation.
|
|
260
|
+
*/
|
|
261
|
+
onSplitterResize(position) {
|
|
262
|
+
const resizeSections = position !== 0 ? this.resizeSections : [];
|
|
263
|
+
let left = 0;
|
|
264
|
+
for (let i = 0; i < resizeSections.length; i++) {
|
|
265
|
+
const minSectionSize = this.getMinSectionSize(i);
|
|
266
|
+
const resizeSection = resizeSections[i];
|
|
267
|
+
let newSize = resizeSection.size + (i === 0 ? position : -position);
|
|
268
|
+
if (minSectionSize === resizeSection.maxSize) {
|
|
269
|
+
// Ignore resize - section is not resizable
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
// Do not allow size exceed min and max boundaries
|
|
273
|
+
if (newSize < minSectionSize) {
|
|
274
|
+
position = this.correctBoundaryPosition(position, minSectionSize, newSize, i === 0);
|
|
275
|
+
newSize = minSectionSize;
|
|
276
|
+
}
|
|
277
|
+
else if (newSize > resizeSection.maxSize) {
|
|
278
|
+
position = this.correctBoundaryPosition(position, resizeSection.maxSize, newSize, i === 0);
|
|
279
|
+
newSize = resizeSection.maxSize;
|
|
280
|
+
}
|
|
281
|
+
const sectionSize = {
|
|
282
|
+
percentage: false
|
|
283
|
+
};
|
|
284
|
+
const nextSession = resizeSections[i + 1];
|
|
285
|
+
const right = nextSession ? nextSession.size - position : 0;
|
|
286
|
+
if (i > 0) {
|
|
287
|
+
sectionSize.size = newSize;
|
|
288
|
+
sectionSize.start = left;
|
|
289
|
+
resizeSection.dom.style[this.startPositionProperty] = left + 'px';
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
sectionSize.start = 0;
|
|
293
|
+
resizeSection.dom.style[this.startPositionProperty] = '0px';
|
|
294
|
+
}
|
|
295
|
+
sectionSize.end = right;
|
|
296
|
+
resizeSection.dom.style[this.endPositionProperty] = right + 'px';
|
|
297
|
+
resizeSection.section = sectionSize;
|
|
298
|
+
left += newSize;
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Method returns corrected position based on boundary and size.
|
|
304
|
+
*
|
|
305
|
+
* @param {number} position Delta position in pixels.
|
|
306
|
+
* @param {number} boundary Boundary position.
|
|
307
|
+
* @param {number} size Section size.
|
|
308
|
+
* @param {boolean} positive Direction.
|
|
309
|
+
* @returns {number} Position after correction based on boundary.
|
|
310
|
+
*/
|
|
311
|
+
correctBoundaryPosition(position, boundary, size, positive) {
|
|
312
|
+
const diff = boundary - size;
|
|
313
|
+
return position + (positive ? diff : -diff);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Method called when resizing session ended.
|
|
317
|
+
*/
|
|
318
|
+
onSplitterResizeEnd() {
|
|
319
|
+
const rootDom = this.rootRef.current;
|
|
320
|
+
if (rootDom && this.isAnimationEnabled()) {
|
|
321
|
+
rootDom.classList.add(SECTIONS_ANIMATION_CLASS);
|
|
322
|
+
}
|
|
323
|
+
const sizes = this.resizeSections.map((resizeSection) => resizeSection.section);
|
|
324
|
+
if (sizes.some((size) => size.end !== undefined || size.start !== undefined || size.size !== undefined)) {
|
|
325
|
+
this.setState({
|
|
326
|
+
sizes
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
this.props.onResize?.(sizes);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Method called when splitter with type 'Toggle' was toggled.
|
|
333
|
+
*/
|
|
334
|
+
onSplitterToggle() {
|
|
335
|
+
if (this.props.onClose) {
|
|
336
|
+
this.props.onClose();
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Method returns visible children sections count.
|
|
341
|
+
*
|
|
342
|
+
* @returns {number} Count of visible children sections.
|
|
343
|
+
*/
|
|
344
|
+
getVisibleChildrenCount() {
|
|
345
|
+
return this.props.children.filter((child) => child && UISections.isSectionVisible(child))
|
|
346
|
+
.length;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Method returns size of section in percents.
|
|
350
|
+
*
|
|
351
|
+
* @param {number} index Target section index.
|
|
352
|
+
* @param {number} childrenCount Count of children.
|
|
353
|
+
* @param {boolean} [reverse=false] Reverse calculation(width vs right).
|
|
354
|
+
* @returns {number} Size of section in percents. For example 50% => 0.5.
|
|
355
|
+
*/
|
|
356
|
+
getSizePercents(index, childrenCount, reverse = false) {
|
|
357
|
+
const { sizes = [], sizesAsPercents } = this.props;
|
|
358
|
+
let propSize = sizes[index];
|
|
359
|
+
if (propSize === undefined && index === this.state.dynamicSection) {
|
|
360
|
+
// Find available size
|
|
361
|
+
let newSize = 100;
|
|
362
|
+
sizes.every((size) => {
|
|
363
|
+
if (size) {
|
|
364
|
+
newSize -= size;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
propSize = newSize;
|
|
368
|
+
}
|
|
369
|
+
if (propSize && sizesAsPercents) {
|
|
370
|
+
return reverse ? 100 - propSize : propSize;
|
|
371
|
+
}
|
|
372
|
+
return childrenCount > 0 ? 100 / childrenCount : 0;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Method gets section size when section size is not percent based and 'sizes' prop is passed from outside.
|
|
376
|
+
*
|
|
377
|
+
* @param {number} index Section index to look up.
|
|
378
|
+
* @param {number} childrenCount Count of visible children.
|
|
379
|
+
* @returns {React.CSSProperties | undefined} CSS Style object or undefined if no style from 'sizes' prop.
|
|
380
|
+
*/
|
|
381
|
+
getSectionSize(index, childrenCount) {
|
|
382
|
+
if (this.props.sizesAsPercents ||
|
|
383
|
+
!this.props.sizes ||
|
|
384
|
+
childrenCount < 2 ||
|
|
385
|
+
(index >= this.props.sizes.length && index >= childrenCount)) {
|
|
386
|
+
return undefined;
|
|
387
|
+
}
|
|
388
|
+
const sectionStyle = {
|
|
389
|
+
[this.sizeProperty]: this.props.sizes[index] ? this.props.sizes[index] + 'px' : this.props.sizes[index]
|
|
390
|
+
};
|
|
391
|
+
if (index === 0) {
|
|
392
|
+
sectionStyle[this.startPositionProperty] = 0;
|
|
393
|
+
}
|
|
394
|
+
if (index === this.props.sizes.length - 1) {
|
|
395
|
+
sectionStyle[this.endPositionProperty] = 0;
|
|
396
|
+
}
|
|
397
|
+
else if (this.props.sizes[index + 1]) {
|
|
398
|
+
sectionStyle[this.endPositionProperty] = this.props.sizes[index + 1] + 'px';
|
|
399
|
+
}
|
|
400
|
+
return sectionStyle;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Gets position style value.
|
|
404
|
+
*
|
|
405
|
+
* @param {number} childrenCount
|
|
406
|
+
* @param {string} value
|
|
407
|
+
*
|
|
408
|
+
* @returns {string}
|
|
409
|
+
*/
|
|
410
|
+
getPositionStyleValue(childrenCount, value) {
|
|
411
|
+
return childrenCount === 1 ? '0%' : value;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Method returns style object for passed visible section.
|
|
415
|
+
* Method calculates size of section depending on several points.
|
|
416
|
+
* 1. Section - resized or not.
|
|
417
|
+
* 2. Animation - off or on.
|
|
418
|
+
*
|
|
419
|
+
* @param {number} index Index of section.
|
|
420
|
+
* @returns {SectionStyleCalculation} Object which contains visibility state and styles to apply.
|
|
421
|
+
*/
|
|
422
|
+
getVisibleSectionStyle(index) {
|
|
423
|
+
const sectionStyle = {
|
|
424
|
+
visible: true,
|
|
425
|
+
style: {}
|
|
426
|
+
};
|
|
427
|
+
// Use values from state or calculate initial percents
|
|
428
|
+
const childrenCount = this.getVisibleChildrenCount();
|
|
429
|
+
const stateSize = this.state.sizes && this.state.sizes[index];
|
|
430
|
+
if (childrenCount === this.props.children.length && stateSize) {
|
|
431
|
+
sectionStyle.style = {
|
|
432
|
+
...(stateSize.start !== undefined && { [this.startPositionProperty]: stateSize.start + 'px' }),
|
|
433
|
+
...(stateSize.end !== undefined && { [this.endPositionProperty]: stateSize.end + 'px' })
|
|
434
|
+
};
|
|
435
|
+
if (stateSize.size !== undefined && (stateSize.start === undefined || stateSize.end === undefined)) {
|
|
436
|
+
// No need to provide size if start and end defined
|
|
437
|
+
sectionStyle.style[this.sizeProperty] = stateSize.size + 'px';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
const toggleSectionSize = this.getSectionSize(index, childrenCount);
|
|
442
|
+
if (toggleSectionSize) {
|
|
443
|
+
sectionStyle.style = { ...sectionStyle.style, ...toggleSectionSize };
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
const size = this.getSizePercents(index, childrenCount, true);
|
|
447
|
+
sectionStyle.style = {
|
|
448
|
+
[this.startPositionProperty]: this.getPositionStyleValue(childrenCount, `${index * size}%`),
|
|
449
|
+
[this.endPositionProperty]: this.getPositionStyleValue(childrenCount, `${(childrenCount - (index + 1)) * size}%`)
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return sectionStyle;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Method returns style object for passed hidden section.
|
|
457
|
+
* Method calculates size of section depending on several points.
|
|
458
|
+
* 1. Section - resized or not.
|
|
459
|
+
* 2. Animation - off or on.
|
|
460
|
+
*
|
|
461
|
+
* @param {number} index Index of section.
|
|
462
|
+
* @returns {SectionStyleCalculation} Object which contains visibility state and styles to apply.
|
|
463
|
+
*/
|
|
464
|
+
getHiddenSectionStyle(index) {
|
|
465
|
+
const sectionStyle = {
|
|
466
|
+
visible: false
|
|
467
|
+
};
|
|
468
|
+
// Hidden section when animation is ON
|
|
469
|
+
let stateSize = this.state.sizes && this.state.sizes[index];
|
|
470
|
+
if (!stateSize &&
|
|
471
|
+
this.props.splitterType === UISplitter_1.UISplitterType.Toggle &&
|
|
472
|
+
this.props.sizes &&
|
|
473
|
+
this.props.sizes[index]) {
|
|
474
|
+
stateSize = {
|
|
475
|
+
size: this.props.sizes[index],
|
|
476
|
+
percentage: false
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
let unit;
|
|
480
|
+
let size = 0;
|
|
481
|
+
if (stateSize) {
|
|
482
|
+
unit = 'px';
|
|
483
|
+
if (stateSize.size) {
|
|
484
|
+
size = stateSize.size;
|
|
485
|
+
}
|
|
486
|
+
else if (stateSize?.start !== undefined && stateSize?.end !== undefined) {
|
|
487
|
+
size = this.getRootSize() - stateSize.end - stateSize.start;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
const childrenCount = this.props.children.length;
|
|
492
|
+
const sectionSize = this.getSectionSize(index, childrenCount);
|
|
493
|
+
if (sectionSize && sectionSize.width) {
|
|
494
|
+
size = parseFloat(sectionSize.width.toString());
|
|
495
|
+
unit = 'px';
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
size = this.getSizePercents(index, childrenCount);
|
|
499
|
+
unit = '%';
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
const hiddenPosition = -size + unit;
|
|
503
|
+
sectionStyle.style = {
|
|
504
|
+
[this.endPositionProperty]: index === 0 ? '100%' : hiddenPosition,
|
|
505
|
+
[this.startPositionProperty]: index === 0 ? hiddenPosition : '100%'
|
|
506
|
+
};
|
|
507
|
+
return sectionStyle;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Method returns minimal size for passed section.
|
|
511
|
+
*
|
|
512
|
+
* @param {number} index Index of section.
|
|
513
|
+
* @returns {number} Minimal size of section.
|
|
514
|
+
*/
|
|
515
|
+
getMinSectionSize(index) {
|
|
516
|
+
const minSectionSize = this.props.minSectionSize;
|
|
517
|
+
let minSize = 0;
|
|
518
|
+
if (minSectionSize) {
|
|
519
|
+
minSize = Array.isArray(minSectionSize) ? minSectionSize[index] : minSectionSize;
|
|
520
|
+
}
|
|
521
|
+
return minSize;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Method returns class names string depending on props and component state.
|
|
525
|
+
*
|
|
526
|
+
* @param {boolean} fullSizeMode Is full size mode - only ine sction visible.
|
|
527
|
+
* @returns {number} Minimal size of section.
|
|
528
|
+
*/
|
|
529
|
+
getClassNames(fullSizeMode) {
|
|
530
|
+
let classNames = ` ${this.props.vertical ? 'sections--vertical' : 'sections--horizontal'}`;
|
|
531
|
+
// Animation
|
|
532
|
+
const sectionsAnimationClass = ` ${SECTIONS_ANIMATION_CLASS}`;
|
|
533
|
+
classNames += `${this.isAnimationEnabled() ? sectionsAnimationClass : ''}`;
|
|
534
|
+
// Full 'screen' mode - only one section visible
|
|
535
|
+
classNames += `${fullSizeMode ? ' sections--full' : ''}`;
|
|
536
|
+
return classNames;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Method returns section's react element based on passed section index.
|
|
540
|
+
*
|
|
541
|
+
* @param {number} index Section index.
|
|
542
|
+
* @param {boolean} isSectionHidden Is section hidden.
|
|
543
|
+
* @returns {React.ReactElement | undefined} Section's react element.
|
|
544
|
+
*/
|
|
545
|
+
getSection(index, isSectionHidden) {
|
|
546
|
+
const childNode = this.props.children[index];
|
|
547
|
+
const sectionStyle = UISections.isSectionVisible(childNode)
|
|
548
|
+
? this.getVisibleSectionStyle(index)
|
|
549
|
+
: this.getHiddenSectionStyle(index);
|
|
550
|
+
if (!sectionStyle) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const splitterType = this.props.splitterType || UISplitter_1.UISplitterType.Resize;
|
|
554
|
+
const splitterLayoutType = this.props.splitterLayoutType || UISplitter_1.UISplitterLayoutType.Standard;
|
|
555
|
+
let isSplitterVisible = this.props.splitter && index > 0;
|
|
556
|
+
const isSingleSection = this.getVisibleChildrenCount() === 1;
|
|
557
|
+
if (isSingleSection && !this.isAnimationEnabled()) {
|
|
558
|
+
isSplitterVisible = false;
|
|
559
|
+
}
|
|
560
|
+
return (react_1.default.createElement("div", { key: index, className: `sections__item${isSplitterVisible ? ' sections__item--' + splitterType : ''}${!sectionStyle.visible ? ' sections__item--hidden' : ''}`, style: sectionStyle.style },
|
|
561
|
+
isSplitterVisible && childNode && (react_1.default.createElement(UISplitter_1.UISplitter, { vertical: this.props.vertical, onResize: this.onSplitterResize.bind(this), onResizeStart: this.onSplitterResizeStart.bind(this), onResizeEnd: this.onSplitterResizeEnd.bind(this), onToggle: this.onSplitterToggle.bind(this), hidden: isSectionHidden || isSingleSection, type: splitterType, title: this.props.splitterTitle, splitterLayoutType: splitterLayoutType })),
|
|
562
|
+
childNode));
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Method checks if animation enabled with current state.
|
|
566
|
+
*
|
|
567
|
+
* @returns {boolean} True if animation is enabled.
|
|
568
|
+
*/
|
|
569
|
+
isAnimationEnabled() {
|
|
570
|
+
return !this.ignoreAnimation && (this.props.animation === true || this.state.animate);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Method returns index of dynamicly sized section.
|
|
574
|
+
*
|
|
575
|
+
* @returns {number} Index of dynamicly sized section.
|
|
576
|
+
*/
|
|
577
|
+
getDynamicSectionIndex() {
|
|
578
|
+
return this.state.dynamicSection !== undefined ? this.state.dynamicSection : 0;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Method converts passed positions to section position object.
|
|
582
|
+
*
|
|
583
|
+
* @param {UISectionSize} section Section size.
|
|
584
|
+
* @returns Position object.
|
|
585
|
+
*/
|
|
586
|
+
getSectionPosition(section) {
|
|
587
|
+
return { start: section.start || 0, end: section.end || 0 };
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Method calculates spare size for passed section.
|
|
591
|
+
*
|
|
592
|
+
* @param {SizeCalculationInfo} origin Section size.
|
|
593
|
+
* @param {SizeCalculationInfo[]} sizes All section sizes.
|
|
594
|
+
* @returns {number} Spare size.
|
|
595
|
+
*/
|
|
596
|
+
getSpareSize(origin, sizes) {
|
|
597
|
+
let increaseSize = 0;
|
|
598
|
+
let target = origin.minSize - origin.size;
|
|
599
|
+
for (const info of sizes) {
|
|
600
|
+
if (info === origin) {
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
if (info.spareSize > 0) {
|
|
604
|
+
const useSize = Math.min(info.spareSize, target);
|
|
605
|
+
// Update targets
|
|
606
|
+
increaseSize += useSize;
|
|
607
|
+
info.spareSize -= useSize;
|
|
608
|
+
info.size -= useSize;
|
|
609
|
+
target -= useSize;
|
|
610
|
+
}
|
|
611
|
+
if (target <= 0) {
|
|
612
|
+
// Desireable target meet requirement
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return increaseSize;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Method converts SizeCalculationInfo into UISectionSize before applying sizes to state.
|
|
620
|
+
*
|
|
621
|
+
* @param {SizeCalculationInfo[]} sizes Section sizes.
|
|
622
|
+
* @returns {UISectionSize[]} Section sizes applyable for state.
|
|
623
|
+
*/
|
|
624
|
+
calculateSectionSizes(sizes) {
|
|
625
|
+
// Calculate sizes
|
|
626
|
+
for (const section of sizes) {
|
|
627
|
+
if (section.size < section.minSize) {
|
|
628
|
+
const diff = this.getSpareSize(section, sizes);
|
|
629
|
+
if (diff) {
|
|
630
|
+
section.size += diff;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
// Apply sizes to state
|
|
635
|
+
const stateSizes = [];
|
|
636
|
+
for (let i = 0; i < sizes.length; i++) {
|
|
637
|
+
const sectionSize = {
|
|
638
|
+
percentage: false
|
|
639
|
+
};
|
|
640
|
+
const current = sizes[i];
|
|
641
|
+
const next = sizes[i + 1];
|
|
642
|
+
const right = next ? next.size : 0;
|
|
643
|
+
if (i > 0) {
|
|
644
|
+
sectionSize.size = current.size;
|
|
645
|
+
sectionSize.start = undefined;
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
sectionSize.start = 0;
|
|
649
|
+
}
|
|
650
|
+
sectionSize.end = right;
|
|
651
|
+
stateSizes.push(sectionSize);
|
|
652
|
+
}
|
|
653
|
+
return stateSizes;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Method recalculates "start" and "end" position based on size property.
|
|
657
|
+
*
|
|
658
|
+
* @param {UISectionSize[]} sizes Section sizes.
|
|
659
|
+
*/
|
|
660
|
+
recalculatePositions(sizes) {
|
|
661
|
+
// Recalculate positions - START
|
|
662
|
+
let start = 0;
|
|
663
|
+
sizes.forEach((section) => {
|
|
664
|
+
section.start = start;
|
|
665
|
+
// Next start
|
|
666
|
+
start += section.size || 0;
|
|
667
|
+
});
|
|
668
|
+
// Recalculate positions - END
|
|
669
|
+
let end = 0;
|
|
670
|
+
for (let i = sizes.length - 1; i >= 0; i--) {
|
|
671
|
+
sizes[i].end = end;
|
|
672
|
+
// Next start
|
|
673
|
+
end += sizes[i].size || 0;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Method returns size of sections container.
|
|
678
|
+
*
|
|
679
|
+
* @returns {UISectionSize[]} Size of sections container.
|
|
680
|
+
*/
|
|
681
|
+
getRootSize() {
|
|
682
|
+
const rootDom = this.rootRef.current;
|
|
683
|
+
return rootDom?.getBoundingClientRect()[this.sizeProperty] || 0;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* @returns {React.ReactElement}
|
|
687
|
+
*/
|
|
688
|
+
render() {
|
|
689
|
+
const sections = [];
|
|
690
|
+
let visibleSections = 0;
|
|
691
|
+
for (let i = 0; i < this.props.children.length; i++) {
|
|
692
|
+
const childNode = this.props.children[i];
|
|
693
|
+
const isSectionHidden = !UISections.isSectionVisible(childNode);
|
|
694
|
+
if (!isSectionHidden) {
|
|
695
|
+
visibleSections++;
|
|
696
|
+
}
|
|
697
|
+
const section = this.getSection(i, isSectionHidden);
|
|
698
|
+
if (section) {
|
|
699
|
+
sections.push(section);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return (react_1.default.createElement("div", { ref: this.rootRef, className: `sections ${this.getClassNames(visibleSections === 1)}`, style: {
|
|
703
|
+
...(this.props.height && { height: this.props.height })
|
|
704
|
+
} }, sections));
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
exports.UISections = UISections;
|
|
708
|
+
UISections.Section = UISection_1.UISection;
|
|
709
|
+
//# sourceMappingURL=UISections.js.map
|