native-document 1.0.164 → 1.0.166
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/components.d.ts +2 -0
- package/devtools/widget.js +1 -1
- package/dist/native-document.components.min.js +11074 -2735
- package/dist/native-document.dev.js +2269 -392
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/eslint.config.js +28 -33
- package/i18n.js +1 -1
- package/i18n.ts +2 -0
- package/index.js +4 -1
- package/package.json +3 -2
- package/src/components/$traits/has-draggable/HasDraggable.d.ts +4 -0
- package/src/components/$traits/has-draggable/HasDraggable.js +13 -0
- package/src/components/$traits/has-items/HasItems.d.ts +9 -0
- package/src/components/$traits/has-items/HasItems.js +6 -6
- package/src/components/$traits/has-position/HasFullPosition.d.ts +14 -0
- package/src/components/$traits/has-position/HasFullPosition.js +44 -0
- package/src/components/$traits/has-position/HasPosition.d.ts +7 -0
- package/src/components/$traits/has-position/HasPosition.js +23 -1
- package/src/components/$traits/has-resizable/HasResizable.d.ts +13 -0
- package/src/components/$traits/has-resizable/HasResizable.js +9 -0
- package/src/components/$traits/has-validation/HasValidation.d.ts +17 -0
- package/src/components/$traits/has-validation/HasValidation.js +54 -7
- package/src/components/BaseComponent.d.ts +32 -0
- package/src/components/BaseComponent.js +65 -9
- package/src/components/accordion/Accordion.js +39 -14
- package/src/components/accordion/AccordionItem.js +45 -14
- package/src/components/accordion/index.js +2 -2
- package/src/components/accordion/types/Accordion.d.ts +47 -0
- package/src/components/accordion/types/AccordionItem.d.ts +48 -0
- package/src/components/alert/Alert.js +70 -38
- package/src/components/alert/index.js +2 -2
- package/src/components/alert/types/Alert.d.ts +62 -0
- package/src/components/avatar/Avatar.js +49 -12
- package/src/components/avatar/AvatarGroup.js +50 -2
- package/src/components/avatar/index.js +2 -2
- package/src/components/avatar/types/Avatar.d.ts +74 -0
- package/src/components/avatar/types/AvatarGroup.d.ts +32 -0
- package/src/components/badge/Badge.js +125 -5
- package/src/components/badge/index.js +2 -2
- package/src/components/badge/types/Badge.d.ts +51 -0
- package/src/components/breadcrumb/BreadCrumb.js +61 -5
- package/src/components/breadcrumb/index.js +2 -2
- package/src/components/breadcrumb/types/BreadCrumb.d.ts +42 -0
- package/src/components/button/Button.js +164 -9
- package/src/components/button/index.js +1 -1
- package/src/components/button/types/Button.d.ts +62 -0
- package/src/components/card/Card.js +128 -10
- package/src/components/card/index.js +3 -3
- package/src/components/card/types/Card.d.ts +42 -0
- package/src/components/context-menu/ContextMenu.js +49 -5
- package/src/components/context-menu/ContextMenuGroup.js +15 -2
- package/src/components/context-menu/ContextMenuItem.js +14 -2
- package/src/components/context-menu/index.js +5 -5
- package/src/components/context-menu/types/ContextMenu.d.ts +30 -0
- package/src/components/context-menu/types/ContextMenuGroup.d.ts +18 -0
- package/src/components/context-menu/types/ContextMenuItem.d.ts +18 -0
- package/src/components/divider/Divider.js +120 -4
- package/src/components/divider/index.js +3 -3
- package/src/components/divider/types/Divider.d.ts +55 -0
- package/src/components/dropdown/Dropdown.js +239 -16
- package/src/components/dropdown/DropdownDivider.js +22 -2
- package/src/components/dropdown/DropdownGroup.js +44 -5
- package/src/components/dropdown/DropdownItem.js +76 -3
- package/src/components/dropdown/DropdownTrigger.js +49 -20
- package/src/components/dropdown/helpers.js +1 -1
- package/src/components/dropdown/index.js +6 -6
- package/src/components/dropdown/types/Dropdown.d.ts +88 -0
- package/src/components/dropdown/types/DropdownDivider.d.ts +20 -0
- package/src/components/dropdown/types/DropdownGroup.d.ts +25 -0
- package/src/components/dropdown/types/DropdownItem.d.ts +41 -0
- package/src/components/dropdown/types/DropdownTrigger.d.ts +32 -0
- package/src/components/form/FormControl.js +156 -13
- package/src/components/form/field/Field.js +172 -9
- package/src/components/form/field/FieldCollection.js +116 -12
- package/src/components/form/field/types/AutocompleteField.js +92 -2
- package/src/components/form/field/types/CheckboxField.js +43 -2
- package/src/components/form/field/types/CheckboxGroupField.js +83 -6
- package/src/components/form/field/types/ColorField.js +56 -3
- package/src/components/form/field/types/DateField.js +155 -4
- package/src/components/form/field/types/EmailField.js +54 -4
- package/src/components/form/field/types/FileField.js +140 -6
- package/src/components/form/field/types/HiddenField.js +27 -1
- package/src/components/form/field/types/ImageField.js +82 -3
- package/src/components/form/field/types/NumberField.js +97 -4
- package/src/components/form/field/types/PasswordField.js +103 -7
- package/src/components/form/field/types/RadioField.js +75 -4
- package/src/components/form/field/types/RangeField.js +67 -1
- package/src/components/form/field/types/SearchField.js +41 -2
- package/src/components/form/field/types/SelectField.js +133 -4
- package/src/components/form/field/types/StringField.js +91 -2
- package/src/components/form/field/types/TelField.js +55 -4
- package/src/components/form/field/types/TextAreaField.js +76 -2
- package/src/components/form/field/types/TimeField.js +120 -5
- package/src/components/form/field/types/UrlField.js +59 -4
- package/src/components/form/field/types/file-field-mode/FileAvatarMode.js +83 -4
- package/src/components/form/field/types/file-field-mode/FileDropzoneMode.js +61 -3
- package/src/components/form/field/types/file-field-mode/FileItemPreview.js +79 -3
- package/src/components/form/field/types/file-field-mode/FileNativeMode.js +24 -2
- package/src/components/form/field/types/file-field-mode/FileUploadButtonMode.js +64 -3
- package/src/components/form/field/types/file-field-mode/FileWallMode.js +56 -3
- package/src/components/form/index.js +28 -28
- package/src/components/form/types/Field.d.ts +73 -0
- package/src/components/form/types/FieldCollection.d.ts +53 -0
- package/src/components/form/types/FormControl.d.ts +64 -0
- package/src/components/form/types/fields/AutocompleteField.d.ts +48 -0
- package/src/components/form/types/fields/CheckboxField.d.ts +33 -0
- package/src/components/form/types/fields/CheckboxGroupField.d.ts +49 -0
- package/src/components/form/types/fields/ColorField.d.ts +37 -0
- package/src/components/form/types/fields/DateField.d.ts +70 -0
- package/src/components/form/types/fields/EmailField.d.ts +35 -0
- package/src/components/form/types/fields/FileAvatarMode.d.ts +46 -0
- package/src/components/form/types/fields/FileDropzoneMode.d.ts +28 -0
- package/src/components/form/types/fields/FileField.d.ts +56 -0
- package/src/components/form/types/fields/FileItemPreview.d.ts +35 -0
- package/src/components/form/types/fields/FileNativeMode.d.ts +21 -0
- package/src/components/form/types/fields/FileUploadButtonMode.d.ts +34 -0
- package/src/components/form/types/fields/FileWallMode.d.ts +32 -0
- package/src/components/form/types/fields/HiddenField.d.ts +26 -0
- package/src/components/form/types/fields/ImageField.d.ts +45 -0
- package/src/components/form/types/fields/NumberField.d.ts +48 -0
- package/src/components/form/types/fields/PasswordField.d.ts +46 -0
- package/src/components/form/types/fields/RadioField.d.ts +48 -0
- package/src/components/form/types/fields/RangeField.d.ts +44 -0
- package/src/components/form/types/fields/SearchField.d.ts +34 -0
- package/src/components/form/types/fields/SelectField.d.ts +71 -0
- package/src/components/form/types/fields/StringField.d.ts +48 -0
- package/src/components/form/types/fields/TelField.d.ts +37 -0
- package/src/components/form/types/fields/TextAreaField.d.ts +44 -0
- package/src/components/form/types/fields/TimeField.d.ts +51 -0
- package/src/components/form/types/fields/UrlField.d.ts +35 -0
- package/src/components/form/validation/Validation.js +54 -54
- package/src/components/index.d.ts +160 -0
- package/src/components/list/List.js +99 -15
- package/src/components/list/ListGroup.js +58 -8
- package/src/components/list/ListItem.js +79 -18
- package/src/components/list/index.js +5 -5
- package/src/components/list/types/List.d.ts +43 -0
- package/src/components/list/types/ListGroup.d.ts +37 -0
- package/src/components/list/types/ListItem.d.ts +42 -0
- package/src/components/menu/HasMenuItem.js +55 -6
- package/src/components/menu/Menu.js +113 -22
- package/src/components/menu/MenuDivider.js +18 -2
- package/src/components/menu/MenuGroup.js +61 -6
- package/src/components/menu/MenuItem.js +95 -11
- package/src/components/menu/MenuLink.js +27 -2
- package/src/components/menu/index.js +6 -6
- package/src/components/menu/types/Menu.d.ts +60 -0
- package/src/components/menu/types/MenuDivider.d.ts +19 -0
- package/src/components/menu/types/MenuGroup.d.ts +44 -0
- package/src/components/menu/types/MenuItem.d.ts +46 -0
- package/src/components/menu/types/MenuLink.d.ts +16 -0
- package/src/components/modal/Modal.js +258 -17
- package/src/components/modal/index.js +3 -3
- package/src/components/modal/types/Modal.d.ts +94 -0
- package/src/components/pagination/Pagination.js +155 -7
- package/src/components/pagination/index.js +3 -3
- package/src/components/pagination/types/Pagination.d.ts +68 -0
- package/src/components/popover/Popover.js +198 -11
- package/src/components/popover/PopoverFooter.js +33 -9
- package/src/components/popover/PopoverHeader.js +33 -8
- package/src/components/popover/index.js +4 -4
- package/src/components/popover/types/Popover.d.ts +83 -0
- package/src/components/popover/types/PopoverFooter.d.ts +24 -0
- package/src/components/popover/types/PopoverHeader.d.ts +26 -0
- package/src/components/progress/Progress.js +182 -13
- package/src/components/progress/index.js +3 -3
- package/src/components/progress/types/Progress.d.ts +77 -0
- package/src/components/skeleton/Skeleton.js +117 -49
- package/src/components/skeleton/index.js +3 -3
- package/src/components/skeleton/types/Skeleton.d.ts +55 -0
- package/src/components/slider/Slider.js +207 -10
- package/src/components/slider/index.js +2 -2
- package/src/components/slider/types/Slider.d.ts +82 -0
- package/src/components/spacer/Spacer.js +11 -2
- package/src/components/spacer/index.js +2 -2
- package/src/components/spacer/types/Spacer.d.ts +19 -0
- package/src/components/spinner/Spinner.js +180 -9
- package/src/components/spinner/index.js +3 -3
- package/src/components/spinner/types/Spinner.d.ts +71 -0
- package/src/components/splitter/Splitter.js +76 -13
- package/src/components/splitter/SplitterGutter.js +67 -5
- package/src/components/splitter/SplitterPanel.js +69 -2
- package/src/components/splitter/index.js +5 -5
- package/src/components/splitter/types/Splitter.d.ts +38 -0
- package/src/components/splitter/types/SplitterGutter.d.ts +38 -0
- package/src/components/splitter/types/SplitterPanel.d.ts +41 -0
- package/src/components/stacks/AbsoluteStack.js +23 -3
- package/src/components/stacks/FixedStack.js +23 -3
- package/src/components/stacks/HStack.js +24 -3
- package/src/components/stacks/PositionStack.js +111 -3
- package/src/components/stacks/RelativeStack.js +23 -3
- package/src/components/stacks/Stack.js +73 -2
- package/src/components/stacks/VStack.js +24 -4
- package/src/components/stacks/index.js +7 -7
- package/src/components/stacks/types/AbsoluteStack.d.ts +16 -0
- package/src/components/stacks/types/FixedStack.d.ts +16 -0
- package/src/components/stacks/types/HStack.d.ts +16 -0
- package/src/components/stacks/types/PositionStack.d.ts +54 -0
- package/src/components/stacks/types/RelativeStack.d.ts +17 -0
- package/src/components/stacks/types/Stack.d.ts +39 -0
- package/src/components/stacks/types/VStack.d.ts +16 -0
- package/src/components/stepper/Stepper.js +152 -12
- package/src/components/stepper/StepperStep.js +104 -3
- package/src/components/stepper/index.js +4 -4
- package/src/components/stepper/types/Stepper.d.ts +68 -0
- package/src/components/stepper/types/StepperStep.d.ts +54 -0
- package/src/components/switch/Switch.js +143 -6
- package/src/components/switch/index.js +1 -1
- package/src/components/switch/types/Switch.d.ts +55 -0
- package/src/components/table/Column.js +105 -6
- package/src/components/table/ColumnGroup.js +48 -3
- package/src/components/table/DataTable.js +256 -19
- package/src/components/table/SimpleTable.js +58 -4
- package/src/components/table/index.js +2 -2
- package/src/components/table/types/Column.d.ts +49 -0
- package/src/components/table/types/ColumnGroup.d.ts +28 -0
- package/src/components/table/types/DataTable.d.ts +97 -0
- package/src/components/table/types/SimpleTable.d.ts +40 -0
- package/src/components/tabs/Tabs.js +192 -5
- package/src/components/tabs/index.js +3 -3
- package/src/components/tabs/types/Tabs.d.ts +78 -0
- package/src/components/toast/Toast.js +133 -5
- package/src/components/toast/index.js +3 -3
- package/src/components/toast/types/Toast.d.ts +57 -0
- package/src/components/toast/types/ToastError.d.ts +7 -0
- package/src/components/toast/types/ToastInfo.d.ts +7 -0
- package/src/components/toast/types/ToastSuccess.d.ts +7 -0
- package/src/components/toast/types/ToastWarning.d.ts +7 -0
- package/src/components/tooltip/Tooltip.js +157 -13
- package/src/components/tooltip/index.js +2 -2
- package/src/components/tooltip/prototypes.js +1 -1
- package/src/components/tooltip/types/Tooltip.d.ts +65 -0
- package/src/core/data/MemoryManager.js +2 -2
- package/src/core/data/Observable.js +15 -18
- package/src/core/data/ObservableArray.js +118 -46
- package/src/core/data/ObservableChecker.js +2 -2
- package/src/core/data/ObservableItem.js +135 -21
- package/src/core/data/ObservableObject.js +126 -35
- package/src/core/data/ObservableResource.js +113 -3
- package/src/core/data/Store.js +142 -26
- package/src/core/data/observable-helpers/observable.is-to.js +196 -1
- package/src/core/data/observable-helpers/observable.prototypes.js +33 -8
- package/src/core/elements/anchor/anchor-with-sentinel.js +23 -2
- package/src/core/elements/anchor/anchor.js +16 -7
- package/src/core/elements/anchor/one-child-anchor-overwriting.js +2 -2
- package/src/core/elements/content-formatter.js +1 -1
- package/src/core/elements/control/for-each-array.js +9 -9
- package/src/core/elements/control/for-each.js +14 -14
- package/src/core/elements/control/show-if.js +11 -11
- package/src/core/elements/control/show-when.js +5 -5
- package/src/core/elements/control/switch.js +14 -14
- package/src/core/elements/description-list.js +1 -1
- package/src/core/elements/form.js +2 -2
- package/src/core/elements/fragment.js +1 -1
- package/src/core/elements/html5-semantics.js +1 -1
- package/src/core/elements/img.js +3 -3
- package/src/core/elements/interactive.js +1 -1
- package/src/core/elements/list.js +1 -1
- package/src/core/elements/medias.js +1 -1
- package/src/core/elements/meta-data.js +1 -1
- package/src/core/elements/svg.js +1 -1
- package/src/core/elements/table.js +1 -1
- package/src/core/errors/ArgTypesError.js +1 -1
- package/src/core/utils/HasEventEmitter.js +36 -2
- package/src/core/utils/args-types.js +9 -9
- package/src/core/utils/cache.js +1 -1
- package/src/core/utils/callback-handler.js +29 -0
- package/src/core/utils/debug-manager.js +6 -6
- package/src/core/utils/events.js +139 -139
- package/src/core/utils/filters/date.js +84 -3
- package/src/core/utils/filters/standard.js +136 -11
- package/src/core/utils/filters/strings.js +34 -2
- package/src/core/utils/filters/utils.js +40 -4
- package/src/core/utils/formatters.js +4 -4
- package/src/core/utils/helpers.js +39 -7
- package/src/core/utils/localstorage.js +11 -11
- package/src/core/utils/memoize.js +56 -3
- package/src/core/utils/plugins-manager.js +3 -3
- package/src/core/utils/property-accumulator.js +6 -6
- package/src/core/utils/prototypes.js +26 -1
- package/src/core/utils/shortcut-manager.js +2 -2
- package/src/core/utils/validator.js +8 -8
- package/src/core/wrappers/AttributesWrapper.js +32 -22
- package/src/core/wrappers/DocumentObserver.js +3 -3
- package/src/core/wrappers/ElementCreator.js +5 -5
- package/src/core/wrappers/HtmlElementWrapper.js +38 -12
- package/src/core/wrappers/NDElement.js +328 -22
- package/src/core/wrappers/NdPrototype.js +60 -16
- package/src/core/wrappers/SingletonView.js +50 -2
- package/src/core/wrappers/SvgElementWrapper.js +1 -1
- package/src/core/wrappers/constants.js +35 -2
- package/src/core/wrappers/prototypes/attributes-extensions.js +7 -7
- package/src/core/wrappers/prototypes/nd-element-extensions.js +72 -6
- package/src/core/wrappers/prototypes/nd-element.transition.extensions.js +42 -2
- package/src/core/wrappers/template-cloner/NodeCloner.js +53 -8
- package/src/core/wrappers/template-cloner/TemplateCloner.js +75 -6
- package/src/core/wrappers/template-cloner/attributes-hydrator.js +58 -2
- package/src/core/wrappers/template-cloner/utils.js +42 -6
- package/src/fetch/NativeFetch.js +3 -3
- package/src/i18n/bin/scan.js +6 -6
- package/src/i18n/index.d.ts +2 -0
- package/src/i18n/service/I18nService.d.ts +27 -0
- package/src/i18n/service/I18nService.js +5 -5
- package/src/i18n/service/functions.d.ts +22 -0
- package/src/i18n/service/functions.js +2 -2
- package/src/router/Route.js +3 -3
- package/src/router/RouteGroupHelper.js +2 -2
- package/src/router/Router.js +15 -15
- package/src/router/RouterComponent.js +33 -7
- package/src/router/link.js +4 -4
- package/src/router/modes/HashRouter.js +2 -2
- package/src/router/modes/HistoryRouter.js +2 -2
- package/src/router/modes/MemoryRouter.js +1 -1
- package/src/ui/components/accordion/AccordionItemRender.js +3 -3
- package/src/ui/components/accordion/AccordionRender.js +1 -1
- package/src/ui/components/alert/AlertRender.js +10 -10
- package/src/ui/components/avatar/avata-group/AvatarGroupRender.js +1 -1
- package/src/ui/components/avatar/avatar/AvatarRender.js +1 -1
- package/src/ui/components/breadcrumb/BreadcrumbRender.js +2 -2
- package/src/ui/components/button/ButtonRender.js +1 -1
- package/src/ui/components/contextmenu/ContextmenuRender.js +5 -5
- package/src/ui/components/dropdown/DropdownRender.js +8 -8
- package/src/ui/components/dropdown/group/DropdownGroupRender.js +2 -2
- package/src/ui/components/dropdown/item/DropdownItemRender.js +1 -1
- package/src/ui/components/form/FieldCollectionRender.js +2 -2
- package/src/ui/components/form/FormControlRender.js +5 -5
- package/src/ui/components/form/fields/AutocompleteFieldRender.js +3 -3
- package/src/ui/components/form/fields/CheckboxFieldRender.js +1 -1
- package/src/ui/components/form/fields/CheckboxGroupFieldRender.js +1 -1
- package/src/ui/components/form/fields/DateFieldRender.js +7 -7
- package/src/ui/components/form/fields/EmailFieldRender.js +1 -1
- package/src/ui/components/form/fields/FieldRender.js +4 -4
- package/src/ui/components/form/fields/FileFieldRender.js +1 -1
- package/src/ui/components/form/fields/PasswordFieldRender.js +2 -2
- package/src/ui/components/form/fields/RadioFieldRender.js +1 -1
- package/src/ui/components/form/fields/RangeFieldRender.js +1 -1
- package/src/ui/components/form/fields/SelectFieldRender.js +2 -2
- package/src/ui/components/form/fields/SliderFieldRender.js +6 -6
- package/src/ui/components/form/fields/StringFieldRender.js +1 -1
- package/src/ui/components/form/fields/TelFieldRender.js +1 -1
- package/src/ui/components/form/fields/TextAreaFieldRender.js +1 -1
- package/src/ui/components/form/fields/TimeFieldRender.js +3 -3
- package/src/ui/components/form/fields/UrlFieldRender.js +1 -1
- package/src/ui/components/form/file-upload-mode/FileAvatarModeRender.js +1 -1
- package/src/ui/components/form/file-upload-mode/FileDropzoneModeRender.js +2 -2
- package/src/ui/components/form/file-upload-mode/FileUploadButtonModeRender.js +2 -2
- package/src/ui/components/form/file-upload-mode/FileWallModeRender.js +1 -1
- package/src/ui/components/form/helpers.js +8 -8
- package/src/ui/components/form/index.js +27 -27
- package/src/ui/components/menu/MenuDividerRender.js +1 -1
- package/src/ui/components/menu/MenuGroupRender.js +3 -3
- package/src/ui/components/menu/MenuItemRender.js +2 -2
- package/src/ui/components/menu/MenuLinkRender.js +3 -3
- package/src/ui/components/menu/helpers.js +4 -4
- package/src/ui/components/modal/ModalRender.js +4 -4
- package/src/ui/components/pagination/PaginationRender.js +9 -9
- package/src/ui/components/popover/PopoverRender.js +7 -7
- package/src/ui/components/progress/ProgressRender.js +12 -12
- package/src/ui/components/skeleton/SkeletonRender.js +56 -0
- package/src/ui/components/splitter/SplitterGutterRender.js +1 -1
- package/src/ui/components/splitter/SplitterPanelRender.js +2 -2
- package/src/ui/components/stacks/PositionStackRender.js +1 -1
- package/src/ui/components/stacks/StackRender.js +1 -1
- package/src/ui/components/stacks/absolute-stack/AbsoluteStackRender.js +1 -1
- package/src/ui/components/stacks/fixed-stack/FixedStackRender.js +1 -1
- package/src/ui/components/stacks/h-stack/HStackRender.js +1 -1
- package/src/ui/components/stacks/index.js +5 -5
- package/src/ui/components/stacks/relative-stack/RelativeStackRender.js +1 -1
- package/src/ui/components/stacks/v-stack/VStackRender.js +1 -1
- package/src/ui/components/stepper/StepperRender.js +2 -2
- package/src/ui/components/stepper/StepperStepRender.js +4 -4
- package/src/ui/components/switch/SwitchRender.js +4 -4
- package/src/ui/components/table/data-table/DataTableRender.js +5 -5
- package/src/ui/components/table/data-table/bulk-actions.js +7 -7
- package/src/ui/components/table/data-table/pagination.js +6 -6
- package/src/ui/components/table/data-table/tables.js +25 -25
- package/src/ui/components/table/data-table/toolbar.js +3 -3
- package/src/ui/components/table/simple-table/SimpleTableRender.js +8 -8
- package/src/ui/components/tabs/TabsRender.js +11 -11
- package/src/ui/components/toast/ToastRender.js +3 -3
- package/src/ui/components/tooltip/TooltipRender.js +1 -1
- package/src/ui/index.js +36 -36
- package/types/elements.d.ts +163 -1037
- package/types/forms.d.ts +16 -20
- package/types/globals.d.ts +543 -0
- package/types/images.d.ts +2 -2
- package/types/observable-resource.d.ts +3 -0
- package/types/property-accumulator.d.ts +4 -4
- package/types/store.d.ts +26 -2
- package/types/validator.ts +3 -3
- package/ui.js +1 -0
- package/src/components/form/field/DefaultRender.js +0 -77
- package/src/components/form/field/FieldFactory.js +0 -107
- package/src/components/skeleton/SkeletonCard.js +0 -0
- package/src/components/skeleton/SkeletonList.js +0 -0
- package/src/components/skeleton/SkeletonParagraph.js +0 -0
- package/src/components/skeleton/SkeletonTable.js +0 -0
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import BaseComponent from
|
|
2
|
-
import HasEventEmitter from
|
|
3
|
-
import Validator from
|
|
4
|
-
import SplitterPanel from
|
|
5
|
-
|
|
1
|
+
import BaseComponent from '../BaseComponent';
|
|
2
|
+
import HasEventEmitter from '../../core/utils/HasEventEmitter';
|
|
3
|
+
import Validator from '../../core/utils/validator';
|
|
4
|
+
import SplitterPanel from './SplitterPanel';
|
|
5
|
+
import { $ } from '../../core/data/Observable';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Resizable split-pane layout. Supports horizontal/vertical orientation, gutter size, collapsible panels, and dynamic panel management.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const splitter = new Splitter()
|
|
13
|
+
* .horizontal()
|
|
14
|
+
* .gutterSize(6)
|
|
15
|
+
* .panel(Div('Left content'), { minSize: '200px' })
|
|
16
|
+
* .panel(Div('Right content'), { minSize: '300px' })
|
|
17
|
+
* .onResize((sizes) => console.log(sizes));
|
|
18
|
+
*
|
|
19
|
+
* @constructor
|
|
20
|
+
* @param {GlobalAttributes} [props]
|
|
21
|
+
*/
|
|
6
22
|
export default function Splitter(props = {}) {
|
|
7
23
|
if(!(this instanceof Splitter)) {
|
|
8
24
|
return new Splitter(props);
|
|
@@ -15,7 +31,7 @@ export default function Splitter(props = {}) {
|
|
|
15
31
|
panels: [],
|
|
16
32
|
gutterSize: 8,
|
|
17
33
|
render: null,
|
|
18
|
-
props
|
|
34
|
+
props,
|
|
19
35
|
};
|
|
20
36
|
|
|
21
37
|
this.$element = null;
|
|
@@ -26,35 +42,68 @@ BaseComponent.use(Splitter, HasEventEmitter);
|
|
|
26
42
|
|
|
27
43
|
Splitter.defaultTemplate = null;
|
|
28
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Registers the render template for Splitter.
|
|
47
|
+
* @param {(description: {
|
|
48
|
+
* orientation: 'horizontal'|'vertical',
|
|
49
|
+
* panels: SplitterPanel[]|Observable<SplitterPanel[]>,
|
|
50
|
+
* gutterSize: number,
|
|
51
|
+
* render: ((desc: *, instance: Splitter) => NdChild)|null,
|
|
52
|
+
* props: GlobalAttributes,
|
|
53
|
+
* }, instance: Splitter) => NdChild} template
|
|
54
|
+
*/
|
|
29
55
|
Splitter.use = function(template) {
|
|
30
56
|
Splitter.defaultTemplate = template;
|
|
31
57
|
};
|
|
32
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @returns {this}
|
|
61
|
+
*/
|
|
33
62
|
Splitter.prototype.dynamic = function(){
|
|
34
63
|
this.$description.panels = $.array([]);
|
|
35
64
|
return this;
|
|
36
65
|
};
|
|
37
66
|
|
|
67
|
+
/**
|
|
68
|
+
* @param {string} orientation
|
|
69
|
+
* @returns {this}
|
|
70
|
+
*/
|
|
38
71
|
Splitter.prototype.orientation = function(orientation) {
|
|
39
72
|
this.$description.orientation = orientation;
|
|
40
73
|
return this;
|
|
41
74
|
};
|
|
42
75
|
|
|
76
|
+
/**
|
|
77
|
+
* @returns {this}
|
|
78
|
+
*/
|
|
43
79
|
Splitter.prototype.horizontal = function() {
|
|
44
80
|
this.$description.orientation = 'horizontal';
|
|
45
81
|
return this;
|
|
46
82
|
};
|
|
47
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @returns {this}
|
|
86
|
+
*/
|
|
48
87
|
Splitter.prototype.vertical = function() {
|
|
49
88
|
this.$description.orientation = 'vertical';
|
|
50
89
|
return this;
|
|
51
90
|
};
|
|
52
91
|
|
|
92
|
+
/**
|
|
93
|
+
* @param {number} gutterSize
|
|
94
|
+
* @returns {this}
|
|
95
|
+
*/
|
|
53
96
|
Splitter.prototype.gutterSize = function(gutterSize) {
|
|
54
97
|
this.$description.gutterSize = gutterSize;
|
|
55
98
|
return this;
|
|
56
99
|
};
|
|
57
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @param {SplitterPanel|NdChild} content
|
|
103
|
+
* @param {GlobalAttributes} [options={}]
|
|
104
|
+
* @param {GlobalAttributes} [props={}]
|
|
105
|
+
* @returns {this}
|
|
106
|
+
*/
|
|
58
107
|
Splitter.prototype.panel = function(content, options = {}, props = {}) {
|
|
59
108
|
const panel = content instanceof SplitterPanel
|
|
60
109
|
? content
|
|
@@ -63,6 +112,10 @@ Splitter.prototype.panel = function(content, options = {}, props = {}) {
|
|
|
63
112
|
return this;
|
|
64
113
|
};
|
|
65
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @param {SplitterPanel[]} panels
|
|
117
|
+
* @returns {this}
|
|
118
|
+
*/
|
|
66
119
|
Splitter.prototype.panels = function(panels) {
|
|
67
120
|
if(Validator.isObservable(this.$description.panels)) {
|
|
68
121
|
this.$description.panels.clear();
|
|
@@ -73,29 +126,39 @@ Splitter.prototype.panels = function(panels) {
|
|
|
73
126
|
return this;
|
|
74
127
|
};
|
|
75
128
|
|
|
76
|
-
|
|
129
|
+
/**
|
|
130
|
+
* @param {SplitterPanel} panel
|
|
131
|
+
* @returns {this}
|
|
132
|
+
*/
|
|
77
133
|
Splitter.prototype.removePanel = function(panel) {
|
|
78
134
|
this.$description.panels.remove(panel);
|
|
79
135
|
// TODO: remove the unnecessary gutter
|
|
80
136
|
return this;
|
|
81
|
-
}
|
|
137
|
+
};
|
|
82
138
|
|
|
139
|
+
/**
|
|
140
|
+
* @param {(sizes: number[]) => void} handler
|
|
141
|
+
* @returns {this}
|
|
142
|
+
*/
|
|
83
143
|
Splitter.prototype.onResize = function(handler) {
|
|
84
144
|
this.on('resize', handler);
|
|
85
145
|
return this;
|
|
86
146
|
};
|
|
87
147
|
|
|
148
|
+
/**
|
|
149
|
+
* @param {(panel: SplitterPanel) => void} handler
|
|
150
|
+
* @returns {this}
|
|
151
|
+
*/
|
|
88
152
|
Splitter.prototype.onPanelAdd = function(handler) {
|
|
89
153
|
this.on('panelAdd', handler);
|
|
90
154
|
return this;
|
|
91
155
|
};
|
|
92
156
|
|
|
157
|
+
/**
|
|
158
|
+
* @param {(panel: SplitterPanel) => void} handler
|
|
159
|
+
* @returns {this}
|
|
160
|
+
*/
|
|
93
161
|
Splitter.prototype.onPanelRemove = function(handler) {
|
|
94
162
|
this.on('panelRemove', handler);
|
|
95
163
|
return this;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
Splitter.prototype.render = function(renderFn) {
|
|
99
|
-
this.$description.render = renderFn;
|
|
100
|
-
return this;
|
|
101
164
|
};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import BaseComponent from
|
|
2
|
-
import HasEventEmitter from
|
|
1
|
+
import BaseComponent from '../BaseComponent';
|
|
2
|
+
import HasEventEmitter from '../../core/utils/HasEventEmitter';
|
|
3
3
|
import { $ } from '../../core/data/Observable';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The drag handle between two SplitterPanel instances.
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const gutter = new SplitterGutter(leftPanel, rightPanel)
|
|
11
|
+
* .horizontal()
|
|
12
|
+
* .size(8)
|
|
13
|
+
* .onDragStart(() => console.log('drag start'));
|
|
14
|
+
*
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param {SplitterPanel} [leftPanel]
|
|
17
|
+
* @param {SplitterPanel} [rightPanel]
|
|
18
|
+
* @param {GlobalAttributes} [props={}]
|
|
19
|
+
*/
|
|
6
20
|
export default function SplitterGutter(leftPanel, rightPanel, props = {}) {
|
|
7
21
|
if(!(this instanceof SplitterGutter)) {
|
|
8
22
|
return new SplitterGutter(leftPanel, rightPanel, props);
|
|
@@ -17,7 +31,7 @@ export default function SplitterGutter(leftPanel, rightPanel, props = {}) {
|
|
|
17
31
|
cursor: 'col-resize',
|
|
18
32
|
size: 2,
|
|
19
33
|
isDragging: $(false),
|
|
20
|
-
props
|
|
34
|
+
props,
|
|
21
35
|
};
|
|
22
36
|
}
|
|
23
37
|
|
|
@@ -26,52 +40,100 @@ BaseComponent.use(SplitterGutter, HasEventEmitter);
|
|
|
26
40
|
|
|
27
41
|
SplitterGutter.defaultTemplate = null;
|
|
28
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Registers the render template for SplitterGutter.
|
|
45
|
+
* @param {(description: {
|
|
46
|
+
* leftPanel: SplitterPanel|null,
|
|
47
|
+
* rightPanel: SplitterPanel|null,
|
|
48
|
+
* orientation: 'horizontal'|'vertical',
|
|
49
|
+
* cursor: string,
|
|
50
|
+
* size: number,
|
|
51
|
+
* isDragging: Observable<boolean>,
|
|
52
|
+
* props: GlobalAttributes,
|
|
53
|
+
* }, instance: SplitterGutter) => NdChild} template
|
|
54
|
+
*/
|
|
29
55
|
SplitterGutter.use = function(template) {
|
|
30
56
|
SplitterGutter.defaultTemplate = template;
|
|
31
57
|
};
|
|
32
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @returns {this}
|
|
61
|
+
*/
|
|
33
62
|
SplitterGutter.prototype.vertical = function() {
|
|
34
63
|
this.$description.orientation = 'vertical';
|
|
35
64
|
this.$description.cursor = 'row-resize';
|
|
36
65
|
return this;
|
|
37
66
|
};
|
|
38
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @returns {this}
|
|
70
|
+
*/
|
|
39
71
|
SplitterGutter.prototype.horizontal = function() {
|
|
40
72
|
this.$description.orientation = 'horizontal';
|
|
41
73
|
this.$description.cursor = 'col-resize';
|
|
42
74
|
return this;
|
|
43
|
-
}
|
|
75
|
+
};
|
|
44
76
|
|
|
77
|
+
/**
|
|
78
|
+
* @param {SplitterPanel} leftPanel
|
|
79
|
+
* @param {SplitterPanel} rightPanel
|
|
80
|
+
* @returns {this}
|
|
81
|
+
*/
|
|
45
82
|
SplitterGutter.prototype.panels = function(leftPanel, rightPanel) {
|
|
46
83
|
this.$description.leftPanel = leftPanel;
|
|
47
84
|
this.$description.rightPanel = rightPanel;
|
|
48
85
|
return this;
|
|
49
86
|
};
|
|
50
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @param {SplitterPanel} leftPanel
|
|
90
|
+
* @returns {this}
|
|
91
|
+
*/
|
|
51
92
|
SplitterGutter.prototype.leftPanel = function(leftPanel) {
|
|
52
93
|
this.$description.leftPanel = leftPanel;
|
|
53
94
|
return this;
|
|
54
95
|
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @param {SplitterPanel} rightPanel
|
|
99
|
+
* @returns {this}
|
|
100
|
+
*/
|
|
55
101
|
SplitterGutter.prototype.rightPanel = function(rightPanel) {
|
|
56
102
|
this.$description.rightPanel = rightPanel;
|
|
57
103
|
return this;
|
|
58
104
|
};
|
|
59
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @param {number} size
|
|
108
|
+
* @returns {this}
|
|
109
|
+
*/
|
|
60
110
|
SplitterGutter.prototype.size = function(size) {
|
|
61
111
|
this.$description.size = size;
|
|
62
112
|
return this;
|
|
63
113
|
};
|
|
64
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @param {Function} handler
|
|
117
|
+
* @returns {this}
|
|
118
|
+
*/
|
|
65
119
|
SplitterGutter.prototype.onDragStart = function(handler) {
|
|
66
120
|
this.on('dragStart', handler);
|
|
67
121
|
return this;
|
|
68
122
|
};
|
|
69
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @param {Function} handler
|
|
126
|
+
* @returns {this}
|
|
127
|
+
*/
|
|
70
128
|
SplitterGutter.prototype.onDrag = function(handler) {
|
|
71
129
|
this.on('drag', handler);
|
|
72
130
|
return this;
|
|
73
131
|
};
|
|
74
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @param {Function} handler
|
|
135
|
+
* @returns {this}
|
|
136
|
+
*/
|
|
75
137
|
SplitterGutter.prototype.onDragEnd = function(handler) {
|
|
76
138
|
this.on('dragEnd', handler);
|
|
77
139
|
return this;
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import BaseComponent from
|
|
1
|
+
import BaseComponent from '../BaseComponent';
|
|
2
2
|
import { $ } from '../../core/data/Observable';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A resizable panel inside a Splitter. Configures size constraints and collapsed/collapsible state.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const panel = new SplitterPanel(Div('Panel content'))
|
|
10
|
+
* .size('30%')
|
|
11
|
+
* .minSize('150px')
|
|
12
|
+
* .maxSize('60%')
|
|
13
|
+
* .collapsible(true)
|
|
14
|
+
* .collapsed(false);
|
|
15
|
+
*
|
|
16
|
+
* @constructor
|
|
17
|
+
* @param {NdChild} [content]
|
|
18
|
+
* @param {GlobalAttributes} [props={}]
|
|
19
|
+
*/
|
|
4
20
|
export default function SplitterPanel(content, props = {}) {
|
|
5
21
|
if(!(this instanceof SplitterPanel)) {
|
|
6
22
|
return new SplitterPanel(content, props);
|
|
@@ -19,7 +35,7 @@ export default function SplitterPanel(content, props = {}) {
|
|
|
19
35
|
resizable: true,
|
|
20
36
|
data: null,
|
|
21
37
|
render: null,
|
|
22
|
-
props
|
|
38
|
+
props,
|
|
23
39
|
};
|
|
24
40
|
}
|
|
25
41
|
|
|
@@ -27,49 +43,100 @@ BaseComponent.extends(SplitterPanel);
|
|
|
27
43
|
|
|
28
44
|
SplitterPanel.defaultTemplate = null;
|
|
29
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Registers the render template for SplitterPanel.
|
|
48
|
+
* @param {(description: {
|
|
49
|
+
* orientation: 'horizontal'|'vertical',
|
|
50
|
+
* content: NdChild|null,
|
|
51
|
+
* size: Observable<string|number|null>,
|
|
52
|
+
* minSize: string|number|null,
|
|
53
|
+
* maxSize: string|number|null,
|
|
54
|
+
* collapsible: boolean,
|
|
55
|
+
* collapsed: boolean,
|
|
56
|
+
* resizable: boolean,
|
|
57
|
+
* data: *|null,
|
|
58
|
+
* render: ((desc: *, instance: SplitterPanel) => NdChild)|null,
|
|
59
|
+
* props: GlobalAttributes,
|
|
60
|
+
* }, instance: SplitterPanel) => NdChild} template
|
|
61
|
+
*/
|
|
30
62
|
SplitterPanel.use = function(template) {
|
|
31
63
|
SplitterPanel.defaultTemplate = template;
|
|
32
64
|
};
|
|
33
65
|
|
|
66
|
+
/**
|
|
67
|
+
* @param {NdChild} content
|
|
68
|
+
* @returns {this}
|
|
69
|
+
*/
|
|
34
70
|
SplitterPanel.prototype.content = function(content) {
|
|
35
71
|
this.$description.content = content;
|
|
36
72
|
return this;
|
|
37
73
|
};
|
|
38
74
|
|
|
75
|
+
/**
|
|
76
|
+
* @param {number} size
|
|
77
|
+
* @returns {this}
|
|
78
|
+
*/
|
|
39
79
|
SplitterPanel.prototype.size = function(size) {
|
|
40
80
|
this.$description.size.set(size);
|
|
41
81
|
return this;
|
|
42
82
|
};
|
|
43
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @param {number} size
|
|
86
|
+
* @returns {this}
|
|
87
|
+
*/
|
|
44
88
|
SplitterPanel.prototype.minSize = function(size) {
|
|
45
89
|
this.$description.minSize = size;
|
|
46
90
|
return this;
|
|
47
91
|
};
|
|
48
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @param {number} size
|
|
95
|
+
* @returns {this}
|
|
96
|
+
*/
|
|
49
97
|
SplitterPanel.prototype.maxSize = function(size) {
|
|
50
98
|
this.$description.maxSize = size;
|
|
51
99
|
return this;
|
|
52
100
|
};
|
|
53
101
|
|
|
102
|
+
/**
|
|
103
|
+
* @param {boolean} [collapsible]
|
|
104
|
+
* @returns {this}
|
|
105
|
+
*/
|
|
54
106
|
SplitterPanel.prototype.collapsible = function(collapsible = true) {
|
|
55
107
|
this.$description.collapsible = collapsible;
|
|
56
108
|
return this;
|
|
57
109
|
};
|
|
58
110
|
|
|
111
|
+
/**
|
|
112
|
+
* @param {*} [collapsed]
|
|
113
|
+
* @returns {this}
|
|
114
|
+
*/
|
|
59
115
|
SplitterPanel.prototype.collapsed = function(collapsed = true) {
|
|
60
116
|
this.$description.collapsed = collapsed;
|
|
61
117
|
return this;
|
|
62
118
|
};
|
|
63
119
|
|
|
120
|
+
/**
|
|
121
|
+
* @param {*} [resizable]
|
|
122
|
+
* @returns {this}
|
|
123
|
+
*/
|
|
64
124
|
SplitterPanel.prototype.resizable = function(resizable = true) {
|
|
65
125
|
this.$description.resizable = resizable;
|
|
66
126
|
return this;
|
|
67
127
|
};
|
|
68
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @returns {this}
|
|
131
|
+
*/
|
|
69
132
|
SplitterPanel.prototype.fixed = function() {
|
|
70
133
|
return this.resizable(false);
|
|
71
134
|
};
|
|
72
135
|
|
|
136
|
+
/**
|
|
137
|
+
* @param {*} data
|
|
138
|
+
* @returns {this}
|
|
139
|
+
*/
|
|
73
140
|
SplitterPanel.prototype.data = function(data) {
|
|
74
141
|
this.$description.data = data;
|
|
75
142
|
return this;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Splitter from
|
|
2
|
-
import SplitterPanel from
|
|
3
|
-
import SplitterGutter from
|
|
1
|
+
import Splitter from './Splitter';
|
|
2
|
+
import SplitterPanel from './SplitterPanel';
|
|
3
|
+
import SplitterGutter from './SplitterGutter';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
Splitter,
|
|
8
8
|
SplitterPanel,
|
|
9
|
-
SplitterGutter
|
|
10
|
-
}
|
|
9
|
+
SplitterGutter,
|
|
10
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ValidChild } from '../../../../types/elements';
|
|
2
|
+
import type { ObservableItem } from '../../../../types/observable';
|
|
3
|
+
import type { BaseComponent } from '../../BaseComponent';
|
|
4
|
+
import type { SplitterPanelInterface } from './SplitterPanel';
|
|
5
|
+
import type { GlobalAttributes } from '../../../../types/globals';
|
|
6
|
+
|
|
7
|
+
export type SplitterDescription = {
|
|
8
|
+
orientation: 'horizontal' | 'vertical';
|
|
9
|
+
panels: SplitterPanelInterface[] | ObservableItem<SplitterPanelInterface[]>;
|
|
10
|
+
gutterSize: number;
|
|
11
|
+
render: ((desc: SplitterDescription, instance: SplitterInterface) => ValidChild) | null;
|
|
12
|
+
props: GlobalAttributes;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface SplitterInterface extends BaseComponent {
|
|
16
|
+
dynamic(): this;
|
|
17
|
+
orientation(orientation: 'horizontal' | 'vertical'): this;
|
|
18
|
+
horizontal(): this;
|
|
19
|
+
vertical(): this;
|
|
20
|
+
gutterSize(gutterSize: number): this;
|
|
21
|
+
panel(content: SplitterPanelInterface | ValidChild, options?: Record<string, unknown>, props?: Record<string, unknown>): this;
|
|
22
|
+
panels(panels: SplitterPanelInterface[]): this;
|
|
23
|
+
removePanel(panel: SplitterPanelInterface): this;
|
|
24
|
+
onResize(handler: (sizes: number[]) => void): this;
|
|
25
|
+
onPanelAdd(handler: (panel: SplitterPanelInterface) => void): this;
|
|
26
|
+
onPanelRemove(handler: (panel: SplitterPanelInterface) => void): this;
|
|
27
|
+
render(renderFn: (desc: SplitterDescription, instance: SplitterInterface) => ValidChild): this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare function Splitter(props?: Record<string, unknown>): SplitterInterface;
|
|
32
|
+
export declare namespace Splitter {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
function use(template: (description: SplitterDescription, instance: SplitterInterface) => ValidChild): void;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ValidChild } from '../../../../types/elements';
|
|
2
|
+
import type { BaseComponent } from '../../BaseComponent';
|
|
3
|
+
import type { SplitterPanelInterface } from './SplitterPanel';
|
|
4
|
+
import type { GlobalAttributes } from '../../../../types/globals';
|
|
5
|
+
import {ObservableItem} from "../../../../types/observable";
|
|
6
|
+
|
|
7
|
+
export type SplitterGutterDescription = {
|
|
8
|
+
leftPanel: SplitterPanelInterface | null;
|
|
9
|
+
rightPanel: SplitterPanelInterface | null;
|
|
10
|
+
orientation: 'horizontal' | 'vertical';
|
|
11
|
+
cursor: string;
|
|
12
|
+
size: number;
|
|
13
|
+
isDragging: ObservableItem<boolean>;
|
|
14
|
+
props: GlobalAttributes;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface SplitterGutterInterface extends BaseComponent {
|
|
18
|
+
vertical(): this;
|
|
19
|
+
horizontal(): this;
|
|
20
|
+
panels(leftPanel: SplitterPanelInterface, rightPanel: SplitterPanelInterface): this;
|
|
21
|
+
leftPanel(leftPanel: SplitterPanelInterface): this;
|
|
22
|
+
rightPanel(rightPanel: SplitterPanelInterface): this;
|
|
23
|
+
size(size: number): this;
|
|
24
|
+
onDragStart(handler: (event: MouseEvent) => void): this;
|
|
25
|
+
onDrag(handler: (event: MouseEvent) => void): this;
|
|
26
|
+
onDragEnd(handler: () => void): this;
|
|
27
|
+
render(renderFn: (description: SplitterGutterDescription, instance: SplitterGutterInterface) => ValidChild): this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare function SplitterGutter(leftPanel?: SplitterPanelInterface, rightPanel?: SplitterPanelInterface, props?: Record<string, unknown>): SplitterGutterInterface;
|
|
32
|
+
export declare namespace SplitterGutter {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
function use(template: (description: SplitterGutterDescription, instance: SplitterGutterInterface) => ValidChild): void;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ValidChild } from '../../../../types/elements';
|
|
2
|
+
import type { ObservableItem } from '../../../../types/observable';
|
|
3
|
+
import type { BaseComponent } from '../../BaseComponent';
|
|
4
|
+
import type { GlobalAttributes } from '../../../../types/globals';
|
|
5
|
+
|
|
6
|
+
export type SplitterPanelDescription = {
|
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
|
8
|
+
content: ValidChild | null;
|
|
9
|
+
size: ObservableItem<string | number | null>;
|
|
10
|
+
minSize: string | number | null;
|
|
11
|
+
maxSize: string | number | null;
|
|
12
|
+
collapsible: boolean;
|
|
13
|
+
collapsed: boolean;
|
|
14
|
+
resizable: boolean;
|
|
15
|
+
data: unknown | null;
|
|
16
|
+
render: ((desc: SplitterPanelDescription, instance: SplitterPanelInterface) => ValidChild) | null;
|
|
17
|
+
props: GlobalAttributes;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export interface SplitterPanelInterface extends BaseComponent {
|
|
21
|
+
content(content: ValidChild): this;
|
|
22
|
+
size(size: string | number): this;
|
|
23
|
+
minSize(size: string | number): this;
|
|
24
|
+
maxSize(size: string | number): this;
|
|
25
|
+
collapsible(collapsible?: boolean): this;
|
|
26
|
+
collapsed(collapsed?: boolean): this;
|
|
27
|
+
resizable(resizable?: boolean): this;
|
|
28
|
+
fixed(): this;
|
|
29
|
+
data(data: unknown): this;
|
|
30
|
+
render(renderFn: (description: SplitterPanelDescription, instance: SplitterPanelInterface) => ValidChild): this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export declare function SplitterPanel(content?: ValidChild, props?: Record<string, unknown>): SplitterPanelInterface;
|
|
35
|
+
export declare namespace SplitterPanel {
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
function use(template: (description: SplitterPanelDescription, instance: SplitterPanelInterface) => ValidChild): void;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import BaseComponent from
|
|
2
|
-
import PositionStack from
|
|
3
|
-
import DebugManager from
|
|
1
|
+
import BaseComponent from '../BaseComponent';
|
|
2
|
+
import PositionStack from './PositionStack';
|
|
3
|
+
import DebugManager from '../../core/utils/debug-manager';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {NdChild} content
|
|
10
|
+
* @param {GlobalAttributes} [props={}]
|
|
11
|
+
*/
|
|
5
12
|
export default function AbsoluteStack(content, props = {}) {
|
|
6
13
|
if(!(this instanceof AbsoluteStack)) {
|
|
7
14
|
return new AbsoluteStack(content, props);
|
|
@@ -14,10 +21,20 @@ BaseComponent.extends(AbsoluteStack, PositionStack);
|
|
|
14
21
|
|
|
15
22
|
AbsoluteStack.defaultTemplate = null;
|
|
16
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Registers the render template for AbsoluteStack.
|
|
26
|
+
* @param {(description: {
|
|
27
|
+
* [key: string]: *
|
|
28
|
+
* }, instance: AbsoluteStack) => NdChild} template
|
|
29
|
+
*/
|
|
17
30
|
AbsoluteStack.use = function(template) {
|
|
18
31
|
AbsoluteStack.defaultTemplate = template;
|
|
19
32
|
};
|
|
20
33
|
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} name
|
|
36
|
+
* @param {(s: AbsoluteStack) => AbsoluteStack} callback
|
|
37
|
+
*/
|
|
21
38
|
AbsoluteStack.preset = function(name, callback) {
|
|
22
39
|
if(AbsoluteStack.prototype[name] || AbsoluteStack[name]) {
|
|
23
40
|
DebugManager.warn(`Warning: the ${name} method already exists in AbsoluteStack.`);
|
|
@@ -26,6 +43,9 @@ AbsoluteStack.preset = function(name, callback) {
|
|
|
26
43
|
AbsoluteStack[name] = (content, props) => callback(new AbsoluteStack(content, props));
|
|
27
44
|
};
|
|
28
45
|
|
|
46
|
+
/**
|
|
47
|
+
* @param {Record<string, (s: AbsoluteStack) => AbsoluteStack>} presets
|
|
48
|
+
*/
|
|
29
49
|
AbsoluteStack.presets = function(presets) {
|
|
30
50
|
for(const name in presets) {
|
|
31
51
|
AbsoluteStack.preset(name, presets[name]);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import BaseComponent from
|
|
2
|
-
import PositionStack from
|
|
3
|
-
import DebugManager from
|
|
1
|
+
import BaseComponent from '../BaseComponent';
|
|
2
|
+
import PositionStack from './PositionStack';
|
|
3
|
+
import DebugManager from '../../core/utils/debug-manager';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @constructor
|
|
9
|
+
* @param {NdChild} content
|
|
10
|
+
* @param {GlobalAttributes} [props={}]
|
|
11
|
+
*/
|
|
5
12
|
export default function FixedStack(content, props = {}) {
|
|
6
13
|
if(!(this instanceof FixedStack)) {
|
|
7
14
|
return new FixedStack(content, props);
|
|
@@ -14,10 +21,20 @@ BaseComponent.extends(FixedStack, PositionStack);
|
|
|
14
21
|
|
|
15
22
|
FixedStack.defaultTemplate = null;
|
|
16
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Registers the render template for FixedStack.
|
|
26
|
+
* @param {(description: {
|
|
27
|
+
* [key: string]: *
|
|
28
|
+
* }, instance: FixedStack) => NdChild} template
|
|
29
|
+
*/
|
|
17
30
|
FixedStack.use = function(template) {
|
|
18
31
|
FixedStack.defaultTemplate = template;
|
|
19
32
|
};
|
|
20
33
|
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} name
|
|
36
|
+
* @param {(s: FixedStack) => FixedStack} callback
|
|
37
|
+
*/
|
|
21
38
|
FixedStack.preset = function(name, callback) {
|
|
22
39
|
if(FixedStack.prototype[name] || FixedStack[name]) {
|
|
23
40
|
DebugManager.warn(`Warning: the ${name} method already exists in FixedStack.`);
|
|
@@ -26,6 +43,9 @@ FixedStack.preset = function(name, callback) {
|
|
|
26
43
|
FixedStack[name] = (content, props) => callback(new FixedStack(content, props));
|
|
27
44
|
};
|
|
28
45
|
|
|
46
|
+
/**
|
|
47
|
+
* @param {Record<string, (s: FixedStack) => FixedStack>} presets
|
|
48
|
+
*/
|
|
29
49
|
FixedStack.presets = function(presets) {
|
|
30
50
|
for(const name in presets) {
|
|
31
51
|
FixedStack.preset(name, presets[name]);
|