native-document 1.0.165 → 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 +3 -0
- 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,5 +1,5 @@
|
|
|
1
|
-
import { ElementCreator } from
|
|
2
|
-
import NodeCloner from
|
|
1
|
+
import { ElementCreator } from '../ElementCreator';
|
|
2
|
+
import NodeCloner from './NodeCloner';
|
|
3
3
|
|
|
4
4
|
const pathProcess = (target, path, data) => {
|
|
5
5
|
if(path.HYDRATE_TEXT) {
|
|
@@ -37,7 +37,7 @@ const prepareBindingMetadata = (bindDingData) => {
|
|
|
37
37
|
for (const attr in bindDingData.attributes) {
|
|
38
38
|
attributes.push({
|
|
39
39
|
name: attr,
|
|
40
|
-
value: bindDingData.attributes[attr]
|
|
40
|
+
value: bindDingData.attributes[attr],
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -48,7 +48,7 @@ const prepareBindingMetadata = (bindDingData) => {
|
|
|
48
48
|
classAndStyles.push({
|
|
49
49
|
name: 'class',
|
|
50
50
|
key: className,
|
|
51
|
-
value: bindDingData.classes[className]
|
|
51
|
+
value: bindDingData.classes[className],
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -59,7 +59,7 @@ const prepareBindingMetadata = (bindDingData) => {
|
|
|
59
59
|
classAndStyles.push({
|
|
60
60
|
name: 'style',
|
|
61
61
|
key: property,
|
|
62
|
-
value: bindDingData.styles[property]
|
|
62
|
+
value: bindDingData.styles[property],
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -71,7 +71,16 @@ const prepareBindingMetadata = (bindDingData) => {
|
|
|
71
71
|
bindDingData._attachLength = bindDingData.attach.length;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Applies a binding to a DOM node via its NodeCloner, routing to the correct binding type.
|
|
76
|
+
* Called internally by TemplateCloner's binder methods (text, style, class, attr, event).
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
* @param {Function|string} value - Binding callback or property name
|
|
80
|
+
* @param {'value'|'style'|'class'|'attach'|string} targetType - Binding type determining which NodeCloner method to call
|
|
81
|
+
* @param {HTMLElement} element - Target DOM element
|
|
82
|
+
* @param {string} property - Attribute name or method name (used for 'attach' and 'attr' types)
|
|
83
|
+
*/
|
|
75
84
|
export const $hydrateFn = function(value, targetType, element, property) {
|
|
76
85
|
element.nodeCloner = element.nodeCloner || new NodeCloner(element);
|
|
77
86
|
if(targetType === 'value') {
|
|
@@ -85,6 +94,14 @@ export const $hydrateFn = function(value, targetType, element, property) {
|
|
|
85
94
|
element.nodeCloner.attr(targetType, { property, value });
|
|
86
95
|
};
|
|
87
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Attaches all event handler bindings from a BindingData object to a cloned DOM node.
|
|
99
|
+
*
|
|
100
|
+
* @internal
|
|
101
|
+
* @param {HTMLElement} node - Cloned DOM node
|
|
102
|
+
* @param {BindingData} bindDingData - Pre-compiled binding metadata containing attachment definitions
|
|
103
|
+
* @param {Array} data - Data array passed to each attachment callback
|
|
104
|
+
*/
|
|
88
105
|
export const bindAttachMethods = (node, bindDingData, data) => {
|
|
89
106
|
for(let i = 0, length = bindDingData._attachLength; i < length; i++) {
|
|
90
107
|
const method = bindDingData.attach[i];
|
|
@@ -94,6 +111,14 @@ export const bindAttachMethods = (node, bindDingData, data) => {
|
|
|
94
111
|
}
|
|
95
112
|
};
|
|
96
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Prepares a BindingData object for efficient hydration by building attribute caches
|
|
116
|
+
* and flattening binding lists into indexed arrays.
|
|
117
|
+
* Called once per template during compilation.
|
|
118
|
+
*
|
|
119
|
+
* @internal
|
|
120
|
+
* @param {BindingData} bindDingData - Binding metadata object to optimise in-place
|
|
121
|
+
*/
|
|
97
122
|
export const optimizeBindingData = (bindDingData) => {
|
|
98
123
|
buildAttributesCache(bindDingData);
|
|
99
124
|
prepareBindingMetadata(bindDingData);
|
|
@@ -101,6 +126,17 @@ export const optimizeBindingData = (bindDingData) => {
|
|
|
101
126
|
|
|
102
127
|
|
|
103
128
|
const $applyBindingParents = [];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Traverses a cloned DOM tree and applies all compiled binding steps to each matching node.
|
|
132
|
+
* Uses a pre-built path index for O(n) traversal without querySelector.
|
|
133
|
+
*
|
|
134
|
+
* @internal
|
|
135
|
+
* @param {HTMLElement} root - Root cloned node
|
|
136
|
+
* @param {Array} data - Data array passed to each binding callback
|
|
137
|
+
* @param {Array} paths - Pre-compiled binding paths from template analysis
|
|
138
|
+
* @param {number} pathSize - Number of paths to process (paths.length - 1)
|
|
139
|
+
*/
|
|
104
140
|
export const hydrateClonedNode = (root, data, paths, pathSize) => {
|
|
105
141
|
const rootPath = paths[pathSize];
|
|
106
142
|
$applyBindingParents[rootPath.id] = root;
|
package/src/fetch/NativeFetch.js
CHANGED
|
@@ -2,7 +2,7 @@ export default function NativeFetch($baseUrl) {
|
|
|
2
2
|
|
|
3
3
|
const $interceptors = {
|
|
4
4
|
request: [],
|
|
5
|
-
response: []
|
|
5
|
+
response: [],
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
this.interceptors = {
|
|
@@ -11,7 +11,7 @@ export default function NativeFetch($baseUrl) {
|
|
|
11
11
|
},
|
|
12
12
|
request: (callback) => {
|
|
13
13
|
$interceptors.request.push(callback);
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
this.fetch = async function(method, endpoint, params = {}, options = {}) {
|
|
@@ -28,7 +28,7 @@ export default function NativeFetch($baseUrl) {
|
|
|
28
28
|
let configs = {
|
|
29
29
|
method,
|
|
30
30
|
headers: {
|
|
31
|
-
...(options.headers || {})
|
|
31
|
+
...(options.headers || {}),
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
if(params) {
|
package/src/i18n/bin/scan.js
CHANGED
|
@@ -8,8 +8,8 @@ const Debug = {
|
|
|
8
8
|
$warning: [],
|
|
9
9
|
warn(category, message, data) {
|
|
10
10
|
Debug.$warning.push({ message: `[${category}] ${message}`, data });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
function scanFolder(dirPath, callback) {
|
|
15
15
|
const files = Fs.readdirSync(dirPath);
|
|
@@ -42,11 +42,11 @@ function scanFile(filePath) {
|
|
|
42
42
|
function getKey(args, filePath) {
|
|
43
43
|
const trimmed = args.trim();
|
|
44
44
|
const firstChar = trimmed[0];
|
|
45
|
-
if(firstChar !== '"' && firstChar !==
|
|
45
|
+
if(firstChar !== '"' && firstChar !== '\'') {
|
|
46
46
|
Debug.warn('Key Extract', '', {
|
|
47
47
|
message: `can't extract key from ("${args}") in file.`,
|
|
48
48
|
args: args,
|
|
49
|
-
file: filePath
|
|
49
|
+
file: filePath,
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
return;
|
|
@@ -93,7 +93,7 @@ function scan() {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
console.log(
|
|
96
|
+
console.log(':: scan locales');
|
|
97
97
|
scanFolder(config.locales, (filePath) => {
|
|
98
98
|
if(!filePath.endsWith('.json')) {
|
|
99
99
|
return;
|
|
@@ -108,7 +108,7 @@ function scan() {
|
|
|
108
108
|
return acc;
|
|
109
109
|
}, {});
|
|
110
110
|
|
|
111
|
-
console.log(
|
|
111
|
+
console.log('-- ' + locale + ` : ${absentKeys.length} keys are absent in locale file.`);
|
|
112
112
|
if(!config?.save) {
|
|
113
113
|
console.log('-- display result:');
|
|
114
114
|
console.log(result);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ObservableItem } from '../../../types/observable';
|
|
2
|
+
|
|
3
|
+
export interface I18nResources {
|
|
4
|
+
[language: string]: {
|
|
5
|
+
translation: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface I18nServiceInstance {
|
|
10
|
+
init(resources: I18nResources): Promise<void>;
|
|
11
|
+
current: ObservableItem<string>;
|
|
12
|
+
use(lng: string): Promise<void>;
|
|
13
|
+
tr(key: string, ...args: unknown[]): string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const I18nService: I18nServiceInstance;
|
|
17
|
+
|
|
18
|
+
export declare function tr(
|
|
19
|
+
key: string,
|
|
20
|
+
params?: Record<string, ObservableItem<unknown> | unknown>
|
|
21
|
+
): ObservableItem<string>;
|
|
22
|
+
|
|
23
|
+
declare global {
|
|
24
|
+
interface String {
|
|
25
|
+
tr(params?: Record<string, ObservableItem<unknown> | unknown>): ObservableItem<string>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import i18next from
|
|
2
|
-
import {Observable} from
|
|
3
|
-
import {hasObservableParams, getObservableParams, getParams} from
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
import {Observable} from '../../core/data/Observable';
|
|
3
|
+
import {hasObservableParams, getObservableParams, getParams} from './functions';
|
|
4
4
|
|
|
5
5
|
const I18nService = (function () {
|
|
6
6
|
const defaultLang = import.meta.env.VITE_LOCALE || 'en';
|
|
@@ -13,7 +13,7 @@ const I18nService = (function () {
|
|
|
13
13
|
lng: import.meta.env.VITE_LOCALE,
|
|
14
14
|
fallbackLng: import.meta.env.VITE_FALLBACK_LANGUE || 'en',
|
|
15
15
|
debug: import.meta.env.VITE_ENV === 'development',
|
|
16
|
-
resources
|
|
16
|
+
resources,
|
|
17
17
|
});
|
|
18
18
|
},
|
|
19
19
|
current: $current,
|
|
@@ -22,7 +22,7 @@ const I18nService = (function () {
|
|
|
22
22
|
},
|
|
23
23
|
tr(key, ...args) {
|
|
24
24
|
return i18next.t(key, ...args) || key;
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
26
|
};
|
|
27
27
|
}());
|
|
28
28
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ObservableItem } from '../../types/observable';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolves all param values — unwraps ObservableItem values to their current value.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getParams(
|
|
7
|
+
params: Record<string, ObservableItem<unknown> | unknown> | null | undefined
|
|
8
|
+
): Record<string, unknown>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Returns true if any param value is an ObservableItem.
|
|
12
|
+
*/
|
|
13
|
+
export declare function hasObservableParams(
|
|
14
|
+
params: Record<string, unknown> | null | undefined
|
|
15
|
+
): boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns only the ObservableItem values from a params object.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getObservableParams(
|
|
21
|
+
params: Record<string, ObservableItem<unknown> | unknown> | null | undefined
|
|
22
|
+
): ObservableItem<unknown>[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Observable} from
|
|
2
|
-
import Validator from
|
|
1
|
+
import {Observable} from '../../core/data/Observable';
|
|
2
|
+
import Validator from '../../core/utils/validator';
|
|
3
3
|
|
|
4
4
|
export const getParams = (params) => {
|
|
5
5
|
if(!params) {
|
package/src/router/Route.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {trim} from
|
|
1
|
+
import {trim} from '../core/utils/helpers.js';
|
|
2
2
|
|
|
3
3
|
export const RouteParamPatterns = {
|
|
4
4
|
id: '[0-9]+',
|
|
@@ -39,7 +39,7 @@ export function Route($path, $component, $options = {}) {
|
|
|
39
39
|
$path = '/'+trim($path, '/').replace(/\/+/, '/');
|
|
40
40
|
|
|
41
41
|
let $pattern = null;
|
|
42
|
-
|
|
42
|
+
const $name = $options.name || null;
|
|
43
43
|
|
|
44
44
|
const $middlewares = $options.middlewares || [];
|
|
45
45
|
const $shouldRebuild = $options.shouldRebuild || false;
|
|
@@ -123,5 +123,5 @@ export function Route($path, $component, $options = {}) {
|
|
|
123
123
|
|
|
124
124
|
const queryString = (typeof configs.query === 'object') ? (new URLSearchParams(configs.query)).toString() : null;
|
|
125
125
|
return (configs.basePath ? configs.basePath : '') + (queryString ? `${path}?${queryString}` : path);
|
|
126
|
-
}
|
|
126
|
+
};
|
|
127
127
|
}
|
package/src/router/Router.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {Route} from
|
|
2
|
-
import Validator from
|
|
3
|
-
import RouterError from
|
|
4
|
-
import {RouteGroupHelper} from
|
|
5
|
-
import {trim} from
|
|
6
|
-
import HashRouter from
|
|
7
|
-
import HistoryRouter from
|
|
8
|
-
import MemoryRouter from
|
|
9
|
-
import DebugManager from
|
|
10
|
-
import {RouterComponent} from
|
|
1
|
+
import {Route} from './Route.js';
|
|
2
|
+
import Validator from '../core/utils/validator.js';
|
|
3
|
+
import RouterError from './errors/RouterError.js';
|
|
4
|
+
import {RouteGroupHelper} from './RouteGroupHelper.js';
|
|
5
|
+
import {trim} from '../core/utils/helpers.js';
|
|
6
|
+
import HashRouter from './modes/HashRouter.js';
|
|
7
|
+
import HistoryRouter from './modes/HistoryRouter.js';
|
|
8
|
+
import MemoryRouter from './modes/MemoryRouter.js';
|
|
9
|
+
import DebugManager from '../core/utils/debug-manager.js';
|
|
10
|
+
import {RouterComponent} from './RouterComponent.js';
|
|
11
11
|
|
|
12
12
|
export const DEFAULT_ROUTER_NAME = 'default';
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ export default function Router($options = {}) {
|
|
|
45
45
|
DebugManager.warn('Route Listener', 'Error in listener:', e);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
49
|
|
|
50
50
|
this.routes = () => [...$routes];
|
|
51
51
|
this.currentState = () => ({ ...$currentState });
|
|
@@ -62,7 +62,7 @@ export default function Router($options = {}) {
|
|
|
62
62
|
...options,
|
|
63
63
|
middlewares: RouteGroupHelper.fullMiddlewares($groupTree, options?.middlewares || []),
|
|
64
64
|
name: options?.name ? RouteGroupHelper.fullName($groupTree, options.name) : null,
|
|
65
|
-
layout: options?.layout || RouteGroupHelper.layout($groupTree)
|
|
65
|
+
layout: options?.layout || RouteGroupHelper.layout($groupTree),
|
|
66
66
|
});
|
|
67
67
|
$routes.push(route);
|
|
68
68
|
if(route.name()) {
|
|
@@ -125,7 +125,7 @@ export default function Router($options = {}) {
|
|
|
125
125
|
route,
|
|
126
126
|
params: [],
|
|
127
127
|
query: [],
|
|
128
|
-
path: route.url({ name: target })
|
|
128
|
+
path: route.url({ name: target }),
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -138,7 +138,7 @@ export default function Router($options = {}) {
|
|
|
138
138
|
route,
|
|
139
139
|
params: target.params,
|
|
140
140
|
query: target.query,
|
|
141
|
-
path: route.url({ ...target })
|
|
141
|
+
path: route.url({ ...target }),
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -285,7 +285,7 @@ Router.redirectTo = function(pathOrRouteName, params = null, name = null) {
|
|
|
285
285
|
const router = Router.get(name);
|
|
286
286
|
const route = router.resolve({ name: pathOrRouteName, params });
|
|
287
287
|
if(route) {
|
|
288
|
-
target = { name: pathOrRouteName, params}
|
|
288
|
+
target = { name: pathOrRouteName, params};
|
|
289
289
|
}
|
|
290
290
|
return router.push(target);
|
|
291
291
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Validator from
|
|
2
|
-
import {Anchor} from
|
|
3
|
-
import {ElementCreator} from
|
|
1
|
+
import Validator from '../core/utils/validator';
|
|
2
|
+
import {Anchor} from '../../elements';
|
|
3
|
+
import {ElementCreator} from '../core/wrappers/ElementCreator';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -16,6 +16,9 @@ export function RouterComponent(router, container) {
|
|
|
16
16
|
|
|
17
17
|
let $lastNodeInserted = null;
|
|
18
18
|
|
|
19
|
+
const $lifecycles = new Map();
|
|
20
|
+
let $currentPath = null;
|
|
21
|
+
|
|
19
22
|
const getNodeAnchorForLayout = (node, path) => {
|
|
20
23
|
const existingAnchor = $routeInstanceAnchors.get(node);
|
|
21
24
|
if(existingAnchor) {
|
|
@@ -53,7 +56,7 @@ export function RouterComponent(router, container) {
|
|
|
53
56
|
};
|
|
54
57
|
|
|
55
58
|
const updateContainerByLayout = (layout, node, route, path) => {
|
|
56
|
-
|
|
59
|
+
const nodeToInsert = getNodeToInsert(node);
|
|
57
60
|
|
|
58
61
|
const cachedLayout = $layoutCache.get(nodeToInsert);
|
|
59
62
|
if(cachedLayout) {
|
|
@@ -79,7 +82,7 @@ export function RouterComponent(router, container) {
|
|
|
79
82
|
$currentLayout = ElementCreator.getChild(layout(anchor));
|
|
80
83
|
$layoutCache.set(nodeToInsert, $currentLayout);
|
|
81
84
|
container.appendChild($currentLayout);
|
|
82
|
-
}
|
|
85
|
+
};
|
|
83
86
|
|
|
84
87
|
const updateContainer = function(node, route, path) {
|
|
85
88
|
const layout = route.layout();
|
|
@@ -87,7 +90,7 @@ export function RouterComponent(router, container) {
|
|
|
87
90
|
updateContainerByLayout(layout, node, route, path);
|
|
88
91
|
return;
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
const nodeToInsert = getNodeToInsert(node);
|
|
91
94
|
|
|
92
95
|
cleanContainer();
|
|
93
96
|
container.appendChild(nodeToInsert);
|
|
@@ -98,16 +101,39 @@ export function RouterComponent(router, container) {
|
|
|
98
101
|
if(!state.route) {
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
104
|
+
|
|
101
105
|
const { route, params, query, path } = state;
|
|
106
|
+
|
|
107
|
+
if($currentPath && $currentPath !== path) {
|
|
108
|
+
$lifecycles.get($currentPath)?.onLeave?.();
|
|
109
|
+
}
|
|
110
|
+
|
|
102
111
|
if($cache.has(path)) {
|
|
103
112
|
const cacheNode = $cache.get(path);
|
|
104
113
|
updateContainer(cacheNode, route);
|
|
114
|
+
|
|
115
|
+
$lifecycles.get(path)?.onEnter?.(params, query);
|
|
116
|
+
$currentPath = path;
|
|
117
|
+
|
|
105
118
|
return;
|
|
106
119
|
}
|
|
120
|
+
const pathLifecycles = {};
|
|
121
|
+
$lifecycles.set(path, pathLifecycles);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
107
125
|
const Component = route.component();
|
|
108
|
-
const node = Component({
|
|
126
|
+
const node = Component({
|
|
127
|
+
params,
|
|
128
|
+
query,
|
|
129
|
+
onEnter: (cb) => { pathLifecycles.onEnter = cb; },
|
|
130
|
+
onLeave: (cb) => { pathLifecycles.onLeave = cb; },
|
|
131
|
+
});
|
|
109
132
|
$cache.set(path, node);
|
|
110
133
|
updateContainer(node, route, path);
|
|
134
|
+
|
|
135
|
+
pathLifecycles.onEnter?.(params, query);
|
|
136
|
+
$currentPath = path;
|
|
111
137
|
};
|
|
112
138
|
|
|
113
139
|
router.subscribe(handleCurrentRouterState);
|
package/src/router/link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Validator from
|
|
2
|
-
import {Link as NativeLink} from
|
|
3
|
-
import Router, {DEFAULT_ROUTER_NAME} from
|
|
4
|
-
import RouterError from
|
|
1
|
+
import Validator from '../core/utils/validator';
|
|
2
|
+
import {Link as NativeLink} from '../../elements';
|
|
3
|
+
import Router, {DEFAULT_ROUTER_NAME} from './Router';
|
|
4
|
+
import RouterError from './errors/RouterError';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export function Link(options, children){
|
|
@@ -32,7 +32,7 @@ export default function HashRouter() {
|
|
|
32
32
|
*/
|
|
33
33
|
const setHash = (path) => {
|
|
34
34
|
window.location.replace(`${window.location.pathname}${window.location.search}#${path}`);
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
|
|
37
37
|
const getCurrentHash = () => window.location.hash.slice(1);
|
|
38
38
|
|
|
@@ -79,5 +79,5 @@ export default function HashRouter() {
|
|
|
79
79
|
$history.push({ route, params, query, path });
|
|
80
80
|
$currentIndex = 0;
|
|
81
81
|
this.handleRouteChange(route, params, query, path);
|
|
82
|
-
}
|
|
82
|
+
};
|
|
83
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DebugManager from
|
|
1
|
+
import DebugManager from '../../core/utils/debug-manager.js';
|
|
2
2
|
|
|
3
3
|
export default function HistoryRouter() {
|
|
4
4
|
|
|
@@ -60,6 +60,6 @@ export default function HistoryRouter() {
|
|
|
60
60
|
});
|
|
61
61
|
const { route, params, query, path } = this.resolve(defaultPath || (window.location.pathname+window.location.search));
|
|
62
62
|
this.handleRouteChange(route, params, query, path);
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
64
|
|
|
65
65
|
};
|
|
@@ -18,7 +18,7 @@ const buildHeader = ($desc, instance) => {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const indicatorClass = $desc.expanded.transform(
|
|
21
|
-
(expanded) => 'accordion-indicator' + (expanded ? ' is-expanded' : '')
|
|
21
|
+
(expanded) => 'accordion-indicator' + (expanded ? ' is-expanded' : ''),
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
const content = [
|
|
@@ -53,11 +53,11 @@ const buildIndicator = ($desc) => {
|
|
|
53
53
|
const buildContent = ($desc, instance) => {
|
|
54
54
|
if($desc.renderContent) {
|
|
55
55
|
return ShowIf($desc.expanded, () =>
|
|
56
|
-
Div({class: 'accordion-content'}, $desc.renderContent($desc, instance))
|
|
56
|
+
Div({class: 'accordion-content'}, $desc.renderContent($desc, instance)),
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return ShowIf($desc.expanded, () =>
|
|
61
|
-
Div({class: 'accordion-content'}, $desc.content)
|
|
61
|
+
Div({class: 'accordion-content'}, $desc.content),
|
|
62
62
|
);
|
|
63
63
|
};
|
|
@@ -27,13 +27,13 @@ const buildBody = ($desc, instance) => {
|
|
|
27
27
|
if($desc.renderTitle) {
|
|
28
28
|
body.push(Div({class: 'alert-title'}, [
|
|
29
29
|
$desc.renderTitle($desc, instance),
|
|
30
|
-
$desc.closable ? buildClose($desc, instance) : null
|
|
30
|
+
$desc.closable ? buildClose($desc, instance) : null,
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
33
|
else if($desc.title) {
|
|
34
34
|
body.push(Div({class: 'alert-title'}, [
|
|
35
35
|
$desc.title,
|
|
36
|
-
$desc.closable ? buildClose($desc, instance) : null
|
|
36
|
+
$desc.closable ? buildClose($desc, instance) : null,
|
|
37
37
|
]));
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -52,7 +52,7 @@ const buildBody = ($desc, instance) => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
return Div({class: 'alert-body'}, body);
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
|
|
57
57
|
const buildFooter = ($desc, instance) => {
|
|
58
58
|
const actions = $desc.actions.map((action) => {
|
|
@@ -70,12 +70,12 @@ const buildFooter = ($desc, instance) => {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
return Div({class: 'alert-footer'}, actions);
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
|
|
75
75
|
const buildClose = ($desc, instance) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
76
|
+
return Button('×', { class: 'alert-close' })
|
|
77
|
+
.nd.onClick(() => {
|
|
78
|
+
instance.emit('close');
|
|
79
|
+
instance.hide();
|
|
80
|
+
});
|
|
81
|
+
};
|
|
@@ -39,7 +39,7 @@ function buildMore(count, $desc) {
|
|
|
39
39
|
const isClickable = $desc.onMoreClick ? ' is-clickable' : '';
|
|
40
40
|
|
|
41
41
|
const span = Span({
|
|
42
|
-
class: 'avatar-group-more is-' + size + ' is-' + shape + isClickable
|
|
42
|
+
class: 'avatar-group-more is-' + size + ' is-' + shape + isClickable,
|
|
43
43
|
}, '+' + count);
|
|
44
44
|
|
|
45
45
|
if($desc.onMoreClick) {
|
|
@@ -8,8 +8,8 @@ export default function BreadcrumbRender($desc, instance) {
|
|
|
8
8
|
|
|
9
9
|
return Nav(instance.resolveProps(),
|
|
10
10
|
OrderedList({ class: 'breadcrumb-list' },
|
|
11
|
-
ForEachArray($desc.items, (item) => buildItem(item, $desc, instance))
|
|
12
|
-
)
|
|
11
|
+
ForEachArray($desc.items, (item) => buildItem(item, $desc, instance)),
|
|
12
|
+
),
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Div, ShowIf} from
|
|
2
|
-
import {createPortal} from
|
|
1
|
+
import {Div, ShowIf} from '../../../core/elements';
|
|
2
|
+
import {createPortal} from '../../../core/elements/anchor/anchor';
|
|
3
3
|
import {computePosition, flip, shift} from '@floating-ui/dom';
|
|
4
4
|
|
|
5
5
|
import './contextmenu.css';
|
|
@@ -57,12 +57,12 @@ export const contextMenuHandler = (trigger, instance, data = null) => {
|
|
|
57
57
|
placement: 'bottom-start',
|
|
58
58
|
middleware: [
|
|
59
59
|
flip(),
|
|
60
|
-
shift({padding: 8})
|
|
60
|
+
shift({padding: 8}),
|
|
61
61
|
],
|
|
62
62
|
}).then(({x, y}) => {
|
|
63
63
|
$positionX.set(x);
|
|
64
64
|
$positionY.set(y);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
})
|
|
68
|
-
}
|
|
67
|
+
});
|
|
68
|
+
};
|