@wavemaker-ai/react-runtime 1.0.0-rc.309
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/actions/base-action.d.ts +7 -0
- package/actions/base-action.js +30 -0
- package/actions/login-action.d.ts +11 -0
- package/actions/login-action.js +54 -0
- package/actions/logout-action.d.ts +10 -0
- package/actions/logout-action.js +39 -0
- package/actions/navigation-action.d.ts +35 -0
- package/actions/navigation-action.js +381 -0
- package/actions/notification-action.d.ts +20 -0
- package/actions/notification-action.js +164 -0
- package/actions/timer-action.d.ts +27 -0
- package/actions/timer-action.js +162 -0
- package/actions/toast-provider.d.ts +12 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.d.ts +7 -0
- package/actions/toast.js +117 -0
- package/actions/toast.service.d.ts +17 -0
- package/actions/toast.service.js +93 -0
- package/actions/types/index.d.ts +26 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.d.ts +72 -0
- package/components/advanced/carousel/index.js +467 -0
- package/components/advanced/carousel/props.d.ts +40 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.d.ts +72 -0
- package/components/advanced/carousel/template.js +83 -0
- package/components/advanced/login/index.d.ts +75 -0
- package/components/advanced/login/index.js +317 -0
- package/components/advanced/login/props.d.ts +41 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.d.ts +68 -0
- package/components/advanced/marquee/index.js +169 -0
- package/components/advanced/marquee/props.d.ts +32 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.d.ts +83 -0
- package/components/basic/anchor/index.js +255 -0
- package/components/basic/anchor/props.d.ts +76 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.d.ts +72 -0
- package/components/basic/audio/index.js +73 -0
- package/components/basic/audio/props.d.ts +48 -0
- package/components/basic/audio/props.js +5 -0
- package/components/basic/html/index.d.ts +69 -0
- package/components/basic/html/index.js +224 -0
- package/components/basic/html/props.d.ts +32 -0
- package/components/basic/html/props.js +5 -0
- package/components/basic/html/utils.d.ts +4 -0
- package/components/basic/html/utils.js +36 -0
- package/components/basic/icon/index.d.ts +71 -0
- package/components/basic/icon/index.js +93 -0
- package/components/basic/icon/props.d.ts +46 -0
- package/components/basic/icon/props.js +5 -0
- package/components/basic/iframe/iframe.utils.d.ts +2 -0
- package/components/basic/iframe/iframe.utils.js +17 -0
- package/components/basic/iframe/index.d.ts +67 -0
- package/components/basic/iframe/index.js +111 -0
- package/components/basic/iframe/props.d.ts +27 -0
- package/components/basic/iframe/props.js +5 -0
- package/components/basic/label/index.d.ts +72 -0
- package/components/basic/label/index.js +145 -0
- package/components/basic/label/props.d.ts +54 -0
- package/components/basic/label/props.js +5 -0
- package/components/basic/message/index.d.ts +18 -0
- package/components/basic/message/index.js +146 -0
- package/components/basic/message/props.d.ts +51 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.d.ts +75 -0
- package/components/basic/picture/index.js +131 -0
- package/components/basic/picture/props.d.ts +57 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.d.ts +73 -0
- package/components/basic/progress-bar/index.js +183 -0
- package/components/basic/progress-bar/props.d.ts +66 -0
- package/components/basic/progress-bar/props.js +41 -0
- package/components/basic/progress-circle/index.d.ts +78 -0
- package/components/basic/progress-circle/index.js +197 -0
- package/components/basic/progress-circle/props.d.ts +80 -0
- package/components/basic/progress-circle/props.js +39 -0
- package/components/basic/richtexteditor/index.d.ts +143 -0
- package/components/basic/richtexteditor/index.js +513 -0
- package/components/basic/richtexteditor/props.d.ts +89 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.d.ts +178 -0
- package/components/basic/search/index.js +1257 -0
- package/components/basic/search/props.d.ts +233 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.d.ts +53 -0
- package/components/basic/search/providers.js +415 -0
- package/components/basic/spinner/index.d.ts +74 -0
- package/components/basic/spinner/index.js +205 -0
- package/components/basic/spinner/props.d.ts +63 -0
- package/components/basic/spinner/props.js +27 -0
- package/components/basic/tile/index.d.ts +68 -0
- package/components/basic/tile/index.js +104 -0
- package/components/basic/tile/props.d.ts +11 -0
- package/components/basic/tile/props.js +5 -0
- package/components/basic/tree/Components/TreeNodeComponent.d.ts +4 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +174 -0
- package/components/basic/tree/hooks/useTreePartialNodeApi.d.ts +17 -0
- package/components/basic/tree/hooks/useTreePartialNodeApi.js +157 -0
- package/components/basic/tree/index.d.ts +83 -0
- package/components/basic/tree/index.js +529 -0
- package/components/basic/tree/props.d.ts +127 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.d.ts +39 -0
- package/components/basic/tree/utils.js +272 -0
- package/components/basic/video/index.d.ts +79 -0
- package/components/basic/video/index.js +108 -0
- package/components/basic/video/props.d.ts +77 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/index.d.ts +129 -0
- package/components/chart/index.js +58 -0
- package/components/chart/props.d.ts +188 -0
- package/components/chart/props.js +81 -0
- package/components/chart/src/ChartRenderer.d.ts +14 -0
- package/components/chart/src/ChartRenderer.js +226 -0
- package/components/chart/src/chart.d.ts +4 -0
- package/components/chart/src/chart.js +284 -0
- package/components/chart/src/chartStyles.generated.d.ts +7 -0
- package/components/chart/src/chartStyles.generated.js +14 -0
- package/components/chart/src/chartUtils.d.ts +26 -0
- package/components/chart/src/chartUtils.js +461 -0
- package/components/chart/src/constants.d.ts +28 -0
- package/components/chart/src/constants.js +139 -0
- package/components/chart/src/css.d.js +1 -0
- package/components/chart/src/d3Setup.d.ts +11 -0
- package/components/chart/src/d3Setup.js +37 -0
- package/components/chart/src/dataUtils.d.ts +79 -0
- package/components/chart/src/dataUtils.js +612 -0
- package/components/chart/src/formatUtils.d.ts +5 -0
- package/components/chart/src/formatUtils.js +63 -0
- package/components/chart/src/index.d.ts +3 -0
- package/components/chart/src/index.js +25 -0
- package/components/chart/src/nvd3Source.generated.d.ts +6 -0
- package/components/chart/src/nvd3Source.generated.js +13 -0
- package/components/chart/src/pieDonutResponsiveLayout.d.ts +30 -0
- package/components/chart/src/pieDonutResponsiveLayout.js +155 -0
- package/components/chart/src/types.d.ts +115 -0
- package/components/chart/src/types.js +5 -0
- package/components/common/AppSpinner.d.ts +9 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.d.ts +5 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +12 -0
- package/components/constants.d.ts +1135 -0
- package/components/constants.js +1211 -0
- package/components/container/accordion/accordion-pane/index.d.ts +81 -0
- package/components/container/accordion/accordion-pane/index.js +126 -0
- package/components/container/accordion/accordion-pane/props.d.ts +88 -0
- package/components/container/accordion/accordion-pane/props.js +24 -0
- package/components/container/accordion/index.d.ts +76 -0
- package/components/container/accordion/index.js +254 -0
- package/components/container/accordion/props.d.ts +57 -0
- package/components/container/accordion/props.js +21 -0
- package/components/container/index.d.ts +84 -0
- package/components/container/index.js +178 -0
- package/components/container/layout-grid/grid-column/index.d.ts +70 -0
- package/components/container/layout-grid/grid-column/index.js +45 -0
- package/components/container/layout-grid/grid-column/props.d.ts +27 -0
- package/components/container/layout-grid/grid-column/props.js +5 -0
- package/components/container/layout-grid/grid-row/index.d.ts +66 -0
- package/components/container/layout-grid/grid-row/index.js +31 -0
- package/components/container/layout-grid/grid-row/props.d.ts +6 -0
- package/components/container/layout-grid/grid-row/props.js +5 -0
- package/components/container/layout-grid/index.d.ts +68 -0
- package/components/container/layout-grid/index.js +40 -0
- package/components/container/layout-grid/props.d.ts +6 -0
- package/components/container/layout-grid/props.js +5 -0
- package/components/container/linear-layout/index.d.ts +67 -0
- package/components/container/linear-layout/index.js +83 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +64 -0
- package/components/container/linear-layout/linear-layout-item/index.js +54 -0
- package/components/container/linear-layout/linear-layout-item/props.d.ts +14 -0
- package/components/container/linear-layout/linear-layout-item/props.js +5 -0
- package/components/container/linear-layout/props.d.ts +41 -0
- package/components/container/linear-layout/props.js +5 -0
- package/components/container/panel/components/panel-content/index.d.ts +8 -0
- package/components/container/panel/components/panel-content/index.js +18 -0
- package/components/container/panel/components/panel-header/index.d.ts +4 -0
- package/components/container/panel/components/panel-header/index.js +149 -0
- package/components/container/panel/components/panel-header/props.d.ts +50 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.d.ts +22 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.d.ts +118 -0
- package/components/container/panel/index.js +307 -0
- package/components/container/panel/props.d.ts +158 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.d.ts +72 -0
- package/components/container/props.js +5 -0
- package/components/container/repeat-template/index.d.ts +82 -0
- package/components/container/repeat-template/index.js +45 -0
- package/components/container/repeat-template/props.d.ts +6 -0
- package/components/container/repeat-template/props.js +5 -0
- package/components/container/tabs/index.d.ts +84 -0
- package/components/container/tabs/index.js +556 -0
- package/components/container/tabs/props.d.ts +104 -0
- package/components/container/tabs/props.js +40 -0
- package/components/container/tabs/tab-pane/index.d.ts +91 -0
- package/components/container/tabs/tab-pane/index.js +131 -0
- package/components/container/tabs/tab-pane/props.d.ts +84 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/tabs/utils.d.ts +17 -0
- package/components/container/tabs/utils.js +51 -0
- package/components/container/wizard/WizardContext.d.ts +4 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.d.ts +16 -0
- package/components/container/wizard/components/StepComponents.js +101 -0
- package/components/container/wizard/components/WizardStep.d.ts +5 -0
- package/components/container/wizard/components/WizardStep.js +96 -0
- package/components/container/wizard/index.d.ts +166 -0
- package/components/container/wizard/index.js +967 -0
- package/components/container/wizard/props.d.ts +281 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.d.ts +12 -0
- package/components/container/wizard/utils.js +178 -0
- package/components/container/wizard/wizard-action/index.d.ts +18 -0
- package/components/container/wizard/wizard-action/index.js +97 -0
- package/components/container/wizard/wizard-step/index.d.ts +63 -0
- package/components/container/wizard/wizard-step/index.js +124 -0
- package/components/data/card/card-actions/index.d.ts +67 -0
- package/components/data/card/card-actions/index.js +32 -0
- package/components/data/card/card-content/index.d.ts +67 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.d.ts +67 -0
- package/components/data/card/card-footer/index.js +32 -0
- package/components/data/card/index.d.ts +89 -0
- package/components/data/card/index.js +247 -0
- package/components/data/card/props.d.ts +131 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.d.ts +33 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/hooks/index.d.ts +7 -0
- package/components/data/form/base-form/hooks/index.js +77 -0
- package/components/data/form/base-form/hooks/useFormDataSync.d.ts +16 -0
- package/components/data/form/base-form/hooks/useFormDataSync.js +238 -0
- package/components/data/form/base-form/hooks/useFormOperations.d.ts +13 -0
- package/components/data/form/base-form/hooks/useFormOperations.js +175 -0
- package/components/data/form/base-form/hooks/useFormSubmission.d.ts +11 -0
- package/components/data/form/base-form/hooks/useFormSubmission.js +291 -0
- package/components/data/form/base-form/hooks/useFormValidation.d.ts +11 -0
- package/components/data/form/base-form/hooks/useFormValidation.js +176 -0
- package/components/data/form/base-form/hooks/useParentFormRelationship.d.ts +12 -0
- package/components/data/form/base-form/hooks/useParentFormRelationship.js +127 -0
- package/components/data/form/base-form/index.d.ts +3 -0
- package/components/data/form/base-form/index.js +802 -0
- package/components/data/form/base-form/props.d.ts +297 -0
- package/components/data/form/base-form/props.js +180 -0
- package/components/data/form/base-form/utils.d.ts +75 -0
- package/components/data/form/base-form/utils.js +411 -0
- package/components/data/form/dynamic-fields/constant.d.ts +1 -0
- package/components/data/form/dynamic-fields/constant.js +53 -0
- package/components/data/form/dynamic-fields/index.d.ts +2 -0
- package/components/data/form/dynamic-fields/index.js +167 -0
- package/components/data/form/dynamic-fields/props.d.ts +70 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.d.ts +46 -0
- package/components/data/form/dynamic-fields/utils.js +272 -0
- package/components/data/form/form-action/index.d.ts +137 -0
- package/components/data/form/form-action/index.js +94 -0
- package/components/data/form/form-body/index.d.ts +5 -0
- package/components/data/form/form-body/index.js +28 -0
- package/components/data/form/form-context.d.ts +91 -0
- package/components/data/form/form-context.js +65 -0
- package/components/data/form/form-controller/hooks/index.d.ts +7 -0
- package/components/data/form/form-controller/hooks/index.js +132 -0
- package/components/data/form/form-controller/props.d.ts +139 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/utils.d.ts +5 -0
- package/components/data/form/form-controller/utils.js +135 -0
- package/components/data/form/form-controller/validation-contrustor.d.ts +3 -0
- package/components/data/form/form-controller/validation-contrustor.js +573 -0
- package/components/data/form/form-controller/withFormController.d.ts +3 -0
- package/components/data/form/form-controller/withFormController.js +309 -0
- package/components/data/form/form-dynamic-section/index.d.ts +5 -0
- package/components/data/form/form-dynamic-section/index.js +46 -0
- package/components/data/form/form-dynamic-section/props.d.ts +5 -0
- package/components/data/form/form-dynamic-section/props.js +5 -0
- package/components/data/form/form-field/base-field.d.ts +3 -0
- package/components/data/form/form-field/base-field.js +172 -0
- package/components/data/form/form-field/index.d.ts +14 -0
- package/components/data/form/form-field/index.js +87 -0
- package/components/data/form/form-field/props.d.ts +206 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.d.ts +6 -0
- package/components/data/form/form-footer/index.js +27 -0
- package/components/data/form/form-header/index.d.ts +12 -0
- package/components/data/form/form-header/index.js +61 -0
- package/components/data/form/index.d.ts +4 -0
- package/components/data/form/index.js +76 -0
- package/components/data/form/props.d.ts +130 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.d.ts +6 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.d.ts +6 -0
- package/components/data/list/components/GroupedListItems.js +108 -0
- package/components/data/list/components/ListContainer.d.ts +6 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.d.ts +39 -0
- package/components/data/list/components/ListDND.js +246 -0
- package/components/data/list/components/ListHeader.d.ts +7 -0
- package/components/data/list/components/ListHeader.js +50 -0
- package/components/data/list/components/ListItem.d.ts +18 -0
- package/components/data/list/components/ListItem.js +166 -0
- package/components/data/list/components/ListItemWithTemplate.d.ts +6 -0
- package/components/data/list/components/ListItemWithTemplate.js +113 -0
- package/components/data/list/components/ListItems.d.ts +7 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.d.ts +7 -0
- package/components/data/list/components/ListPagination.js +183 -0
- package/components/data/list/components/LoadMoreButton.d.ts +6 -0
- package/components/data/list/components/LoadMoreButton.js +35 -0
- package/components/data/list/components/NoDataMessage.d.ts +6 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.d.ts +6 -0
- package/components/data/list/components/StandardListItems.js +88 -0
- package/components/data/list/components/index.d.ts +12 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.d.ts +245 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.d.ts +11 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.d.ts +89 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.d.ts +6 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.d.ts +9 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.d.ts +9 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.d.ts +67 -0
- package/components/data/list/hooks/useListEffects.js +355 -0
- package/components/data/list/hooks/useListEventHandlers.d.ts +9 -0
- package/components/data/list/hooks/useListEventHandlers.js +323 -0
- package/components/data/list/hooks/useListPagination.d.ts +8 -0
- package/components/data/list/hooks/useListPagination.js +163 -0
- package/components/data/list/hooks/useListState.d.ts +28 -0
- package/components/data/list/hooks/useListState.js +114 -0
- package/components/data/list/hooks/useListStateManager.d.ts +26 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.d.ts +6 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +134 -0
- package/components/data/list/index.d.ts +174 -0
- package/components/data/list/index.js +691 -0
- package/components/data/list/props.d.ts +405 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.d.ts +2 -0
- package/components/data/list/templates/media-template.js +50 -0
- package/components/data/list/utils/constants.d.ts +52 -0
- package/components/data/list/utils/constants.js +82 -0
- package/components/data/list/utils/list-helpers.d.ts +41 -0
- package/components/data/list/utils/list-helpers.js +187 -0
- package/components/data/list/utils/list-widget-methods.d.ts +4 -0
- package/components/data/list/utils/list-widget-methods.js +159 -0
- package/components/data/list/utils/widget-instance-utils.d.ts +33 -0
- package/components/data/list/utils/widget-instance-utils.js +83 -0
- package/components/data/live-filter/index.d.ts +15 -0
- package/components/data/live-filter/index.js +304 -0
- package/components/data/live-filter/props.d.ts +96 -0
- package/components/data/live-filter/props.js +16 -0
- package/components/data/live-form/index.d.ts +15 -0
- package/components/data/live-form/index.js +143 -0
- package/components/data/live-form/props.d.ts +50 -0
- package/components/data/live-form/props.js +20 -0
- package/components/data/pagination/components/BasicPagination.d.ts +3 -0
- package/components/data/pagination/components/BasicPagination.js +133 -0
- package/components/data/pagination/components/ClassicPagination.d.ts +3 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.d.ts +11 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.d.ts +3 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.d.ts +3 -0
- package/components/data/pagination/components/PageSizeSelector.js +188 -0
- package/components/data/pagination/components/PagerNavigation.d.ts +3 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.d.ts +3 -0
- package/components/data/pagination/components/TotalRecords.js +48 -0
- package/components/data/pagination/components/index.d.ts +6 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.d.ts +54 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.d.ts +2 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.d.ts +232 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.d.ts +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.d.ts +35 -0
- package/components/data/pagination/hooks/usePagination.js +1095 -0
- package/components/data/pagination/index.d.ts +13 -0
- package/components/data/pagination/index.js +454 -0
- package/components/data/table/components/AddNewRow.d.ts +3 -0
- package/components/data/table/components/AddNewRow.js +194 -0
- package/components/data/table/components/EditableCell.d.ts +4 -0
- package/components/data/table/components/EditableCell.js +92 -0
- package/components/data/table/components/FieldValidationError.d.ts +4 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowCells.d.ts +29 -0
- package/components/data/table/components/RowCells.js +81 -0
- package/components/data/table/components/RowExpansionButton.d.ts +4 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/SummaryCell.d.ts +3 -0
- package/components/data/table/components/SummaryCell.js +111 -0
- package/components/data/table/components/SummaryRow.d.ts +3 -0
- package/components/data/table/components/SummaryRow.js +54 -0
- package/components/data/table/components/SummaryRowFooter.d.ts +3 -0
- package/components/data/table/components/SummaryRowFooter.js +46 -0
- package/components/data/table/components/TableBody.d.ts +3 -0
- package/components/data/table/components/TableBody.js +278 -0
- package/components/data/table/components/TableDataRow.d.ts +27 -0
- package/components/data/table/components/TableDataRow.js +119 -0
- package/components/data/table/components/TableFilters.d.ts +24 -0
- package/components/data/table/components/TableFilters.js +429 -0
- package/components/data/table/components/TableFooterActions.d.ts +3 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.d.ts +3 -0
- package/components/data/table/components/TableHeader.js +450 -0
- package/components/data/table/components/TablePanelHeading.d.ts +3 -0
- package/components/data/table/components/TablePanelHeading.js +202 -0
- package/components/data/table/components/index.d.ts +12 -0
- package/components/data/table/components/index.js +95 -0
- package/components/data/table/hooks/index.d.ts +19 -0
- package/components/data/table/hooks/index.js +231 -0
- package/components/data/table/hooks/use-edited-rows.d.ts +16 -0
- package/components/data/table/hooks/use-edited-rows.js +141 -0
- package/components/data/table/hooks/useCellState.d.ts +10 -0
- package/components/data/table/hooks/useCellState.js +110 -0
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
- package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
- package/components/data/table/hooks/useDynamicColumns.d.ts +34 -0
- package/components/data/table/hooks/useDynamicColumns.js +105 -0
- package/components/data/table/hooks/useEditingState.d.ts +5 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.d.ts +2 -0
- package/components/data/table/hooks/useFormWidget.js +190 -0
- package/components/data/table/hooks/usePaginationState.d.ts +6 -0
- package/components/data/table/hooks/usePaginationState.js +81 -0
- package/components/data/table/hooks/usePanelStructure.d.ts +2 -0
- package/components/data/table/hooks/usePanelStructure.js +43 -0
- package/components/data/table/hooks/useResponsiveColumns.d.ts +84 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.d.ts +5 -0
- package/components/data/table/hooks/useRowExpansion.js +140 -0
- package/components/data/table/hooks/useRowHandlers.d.ts +5 -0
- package/components/data/table/hooks/useRowHandlers.js +72 -0
- package/components/data/table/hooks/useRowSelection.d.ts +2 -0
- package/components/data/table/hooks/useRowSelection.js +428 -0
- package/components/data/table/hooks/useServerSideSorting.d.ts +26 -0
- package/components/data/table/hooks/useServerSideSorting.js +203 -0
- package/components/data/table/hooks/useTableColumns.d.ts +2 -0
- package/components/data/table/hooks/useTableColumns.js +360 -0
- package/components/data/table/hooks/useTableData.d.ts +2 -0
- package/components/data/table/hooks/useTableData.js +199 -0
- package/components/data/table/hooks/useTableEdit.d.ts +4 -0
- package/components/data/table/hooks/useTableEdit.js +651 -0
- package/components/data/table/hooks/useTableEffects.d.ts +25 -0
- package/components/data/table/hooks/useTableEffects.js +157 -0
- package/components/data/table/hooks/useTableFilter.d.ts +26 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.d.ts +5 -0
- package/components/data/table/hooks/useTableInitialization.js +105 -0
- package/components/data/table/hooks/useTableState.d.ts +2 -0
- package/components/data/table/hooks/useTableState.js +75 -0
- package/components/data/table/hooks/useTableStateManager.d.ts +38 -0
- package/components/data/table/hooks/useTableStateManager.js +633 -0
- package/components/data/table/index.d.ts +287 -0
- package/components/data/table/index.js +1830 -0
- package/components/data/table/live-table/index.d.ts +75 -0
- package/components/data/table/live-table/index.js +283 -0
- package/components/data/table/props.d.ts +1368 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.d.ts +65 -0
- package/components/data/table/table-action/index.js +94 -0
- package/components/data/table/table-column/index.d.ts +65 -0
- package/components/data/table/table-column/index.js +44 -0
- package/components/data/table/table-group/index.d.ts +13 -0
- package/components/data/table/table-group/index.js +26 -0
- package/components/data/table/table-row/index.d.ts +65 -0
- package/components/data/table/table-row/index.js +58 -0
- package/components/data/table/table-row-action/index.d.ts +69 -0
- package/components/data/table/table-row-action/index.js +95 -0
- package/components/data/table/utils/buildSelectionColumns.d.ts +3 -0
- package/components/data/table/utils/buildSelectionColumns.js +161 -0
- package/components/data/table/utils/columnBuilder.d.ts +35 -0
- package/components/data/table/utils/columnBuilder.js +225 -0
- package/components/data/table/utils/columnProxy.d.ts +21 -0
- package/components/data/table/utils/columnProxy.js +117 -0
- package/components/data/table/utils/columnWidthDistribution.d.ts +22 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.d.ts +52 -0
- package/components/data/table/utils/constants.js +84 -0
- package/components/data/table/utils/crud-handlers.d.ts +11 -0
- package/components/data/table/utils/crud-handlers.js +523 -0
- package/components/data/table/utils/dynamic-columns.d.ts +38 -0
- package/components/data/table/utils/dynamic-columns.js +222 -0
- package/components/data/table/utils/groupHeaderUtils.d.ts +18 -0
- package/components/data/table/utils/groupHeaderUtils.js +102 -0
- package/components/data/table/utils/index.d.ts +101 -0
- package/components/data/table/utils/index.js +849 -0
- package/components/data/table/utils/renderDisplayCell.d.ts +11 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/script-page-size-broadcast.d.ts +2 -0
- package/components/data/table/utils/script-page-size-broadcast.js +45 -0
- package/components/data/table/utils/selectionUtils.d.ts +37 -0
- package/components/data/table/utils/selectionUtils.js +165 -0
- package/components/data/table/utils/table-helpers.d.ts +62 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.d.ts +13 -0
- package/components/data/table/utils/validation.js +125 -0
- package/components/data/types.d.ts +104 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.d.ts +7 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.d.ts +13 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.d.ts +90 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.d.ts +158 -0
- package/components/dialogs/alert-dialog/index.js +90 -0
- package/components/dialogs/alert-dialog/props.d.ts +43 -0
- package/components/dialogs/alert-dialog/props.js +5 -0
- package/components/dialogs/confirm-dialog/index.d.ts +160 -0
- package/components/dialogs/confirm-dialog/index.js +115 -0
- package/components/dialogs/confirm-dialog/props.d.ts +47 -0
- package/components/dialogs/confirm-dialog/props.js +5 -0
- package/components/dialogs/dialog/index.d.ts +170 -0
- package/components/dialogs/dialog/index.js +73 -0
- package/components/dialogs/dialog/props.d.ts +66 -0
- package/components/dialogs/dialog/props.js +5 -0
- package/components/dialogs/dialog-actions/index.d.ts +67 -0
- package/components/dialogs/dialog-actions/index.js +28 -0
- package/components/dialogs/dialog-actions/props.d.ts +14 -0
- package/components/dialogs/dialog-actions/props.js +5 -0
- package/components/dialogs/dialog-body/index.d.ts +66 -0
- package/components/dialogs/dialog-body/index.js +32 -0
- package/components/dialogs/dialog-body/props.d.ts +15 -0
- package/components/dialogs/dialog-body/props.js +5 -0
- package/components/dialogs/dialog-content/index.d.ts +69 -0
- package/components/dialogs/dialog-content/index.js +43 -0
- package/components/dialogs/dialog-content/props.d.ts +27 -0
- package/components/dialogs/dialog-content/props.js +5 -0
- package/components/dialogs/dialog-header/index.d.ts +84 -0
- package/components/dialogs/dialog-header/index.js +104 -0
- package/components/dialogs/dialog-header/props.d.ts +73 -0
- package/components/dialogs/dialog-header/props.js +5 -0
- package/components/dialogs/iframe-dialog/index.d.ts +178 -0
- package/components/dialogs/iframe-dialog/index.js +131 -0
- package/components/dialogs/iframe-dialog/props.d.ts +83 -0
- package/components/dialogs/iframe-dialog/props.js +5 -0
- package/components/dialogs/index.d.ts +4 -0
- package/components/dialogs/index.js +139 -0
- package/components/dialogs/login-dialog/index.d.ts +163 -0
- package/components/dialogs/login-dialog/index.js +370 -0
- package/components/dialogs/login-dialog/props.d.ts +98 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.d.ts +162 -0
- package/components/dialogs/page-dialog/index.js +105 -0
- package/components/dialogs/page-dialog/props.d.ts +59 -0
- package/components/dialogs/page-dialog/props.js +5 -0
- package/components/dialogs/props.d.ts +41 -0
- package/components/dialogs/props.js +5 -0
- package/components/dialogs/withDialogWrapper.d.ts +59 -0
- package/components/dialogs/withDialogWrapper.js +124 -0
- package/components/form/button/index.d.ts +77 -0
- package/components/form/button/index.js +255 -0
- package/components/form/button/props.d.ts +71 -0
- package/components/form/button/props.js +5 -0
- package/components/form/button-group/index.d.ts +69 -0
- package/components/form/button-group/index.js +74 -0
- package/components/form/button-group/props.d.ts +24 -0
- package/components/form/button-group/props.js +5 -0
- package/components/input/calendar/index.d.ts +130 -0
- package/components/input/calendar/index.js +566 -0
- package/components/input/calendar/props.d.ts +105 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.d.ts +51 -0
- package/components/input/calendar/utils.js +336 -0
- package/components/input/chips/SortableChip/index.d.ts +4 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.d.ts +16 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.d.ts +224 -0
- package/components/input/chips/index.js +583 -0
- package/components/input/chips/props.d.ts +232 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.d.ts +22 -0
- package/components/input/chips/utils.js +292 -0
- package/components/input/color-picker/index.d.ts +151 -0
- package/components/input/color-picker/index.js +689 -0
- package/components/input/color-picker/props.d.ts +131 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.d.ts +69 -0
- package/components/input/composite/index.js +147 -0
- package/components/input/composite/props.d.ts +23 -0
- package/components/input/composite/props.js +5 -0
- package/components/input/currency/index.d.ts +175 -0
- package/components/input/currency/index.js +265 -0
- package/components/input/currency/props.d.ts +154 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.d.ts +150 -0
- package/components/input/default/checkbox/index.js +253 -0
- package/components/input/default/checkbox/props.d.ts +78 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.d.ts +191 -0
- package/components/input/default/checkboxset/index.js +478 -0
- package/components/input/default/checkboxset/props.d.ts +199 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/checkboxset/utils.d.ts +2 -0
- package/components/input/default/checkboxset/utils.js +30 -0
- package/components/input/default/radioset/index.d.ts +182 -0
- package/components/input/default/radioset/index.js +364 -0
- package/components/input/default/radioset/props.d.ts +172 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.d.ts +174 -0
- package/components/input/default/switch/index.js +519 -0
- package/components/input/default/switch/prop.d.ts +153 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.d.ts +4 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +218 -0
- package/components/input/epoch/date/index.d.ts +86 -0
- package/components/input/epoch/date/index.js +606 -0
- package/components/input/epoch/date/props.d.ts +274 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.d.ts +3 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.d.ts +20 -0
- package/components/input/epoch/date/utils.js +201 -0
- package/components/input/epoch/datetime/index.d.ts +86 -0
- package/components/input/epoch/datetime/index.js +717 -0
- package/components/input/epoch/datetime/props.d.ts +212 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/utils.d.ts +20 -0
- package/components/input/epoch/datetime/utils.js +283 -0
- package/components/input/epoch/time/index.d.ts +86 -0
- package/components/input/epoch/time/index.js +478 -0
- package/components/input/epoch/time/props.d.ts +155 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.d.ts +24 -0
- package/components/input/epoch/time/utils.js +240 -0
- package/components/input/fileupload/Utils.d.ts +14 -0
- package/components/input/fileupload/Utils.js +139 -0
- package/components/input/fileupload/components/ListItems.d.ts +11 -0
- package/components/input/fileupload/components/ListItems.js +135 -0
- package/components/input/fileupload/components/MultiUpload.d.ts +4 -0
- package/components/input/fileupload/components/MultiUpload.js +78 -0
- package/components/input/fileupload/components/SingleUpload.d.ts +4 -0
- package/components/input/fileupload/components/SingleUpload.js +58 -0
- package/components/input/fileupload/index.d.ts +92 -0
- package/components/input/fileupload/index.js +179 -0
- package/components/input/fileupload/props.d.ts +320 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.d.ts +36 -0
- package/components/input/fileupload/useFileUpload.js +414 -0
- package/components/input/number/index.d.ts +164 -0
- package/components/input/number/index.js +406 -0
- package/components/input/number/props.d.ts +119 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.d.ts +208 -0
- package/components/input/rating/index.js +461 -0
- package/components/input/rating/props.d.ts +195 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.d.ts +173 -0
- package/components/input/select/index.js +492 -0
- package/components/input/select/props.d.ts +134 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.d.ts +162 -0
- package/components/input/slider/index.js +337 -0
- package/components/input/slider/props.d.ts +101 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.d.ts +177 -0
- package/components/input/text/index.js +499 -0
- package/components/input/text/props.d.ts +141 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.d.ts +42 -0
- package/components/input/text/util.js +334 -0
- package/components/input/textarea/index.d.ts +151 -0
- package/components/input/textarea/index.js +366 -0
- package/components/input/textarea/props.d.ts +85 -0
- package/components/input/textarea/props.js +5 -0
- package/components/input/upload/index.d.ts +142 -0
- package/components/input/upload/index.js +133 -0
- package/components/input/upload/props.d.ts +61 -0
- package/components/input/upload/props.js +5 -0
- package/components/input/util/index.d.ts +1 -0
- package/components/input/util/index.js +11 -0
- package/components/layout/footer/index.d.ts +15 -0
- package/components/layout/footer/index.js +37 -0
- package/components/layout/footer/props.d.ts +8 -0
- package/components/layout/footer/props.js +5 -0
- package/components/layout/header/index.d.ts +15 -0
- package/components/layout/header/index.js +40 -0
- package/components/layout/header/props.d.ts +8 -0
- package/components/layout/header/props.js +5 -0
- package/components/layout/leftnav/index.d.ts +15 -0
- package/components/layout/leftnav/index.js +54 -0
- package/components/layout/leftnav/props.d.ts +25 -0
- package/components/layout/leftnav/props.js +5 -0
- package/components/layout/rightnav/index.d.ts +15 -0
- package/components/layout/rightnav/index.js +38 -0
- package/components/layout/rightnav/props.d.ts +13 -0
- package/components/layout/rightnav/props.js +5 -0
- package/components/layout/topnav/index.d.ts +15 -0
- package/components/layout/topnav/index.js +40 -0
- package/components/layout/topnav/props.d.ts +8 -0
- package/components/layout/topnav/props.js +5 -0
- package/components/navbar/index.d.ts +70 -0
- package/components/navbar/index.js +101 -0
- package/components/navbar/nav/index.d.ts +90 -0
- package/components/navbar/nav/index.js +244 -0
- package/components/navbar/nav/props.d.ts +56 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.d.ts +63 -0
- package/components/navbar/nav-item/index.js +66 -0
- package/components/navbar/nav-item/props.d.ts +29 -0
- package/components/navbar/nav-item/props.js +5 -0
- package/components/navigation/breadcrumb/index.d.ts +66 -0
- package/components/navigation/breadcrumb/index.js +67 -0
- package/components/navigation/breadcrumb/props.d.ts +6 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.d.ts +23 -0
- package/components/navigation/menu/components/ListItems.js +71 -0
- package/components/navigation/menu/constants.d.ts +53 -0
- package/components/navigation/menu/constants.js +102 -0
- package/components/navigation/menu/hooks/useHoverState.hook.d.ts +17 -0
- package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.d.ts +12 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.d.ts +5 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
- package/components/navigation/menu/index.d.ts +105 -0
- package/components/navigation/menu/index.js +1031 -0
- package/components/navigation/menu/props.d.ts +74 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/menu/utils/action-task.d.ts +1 -0
- package/components/navigation/menu/utils/action-task.js +14 -0
- package/components/navigation/menu/utils/role-filter.d.ts +9 -0
- package/components/navigation/menu/utils/role-filter.js +76 -0
- package/components/navigation/popover/index.d.ts +97 -0
- package/components/navigation/popover/index.js +310 -0
- package/components/navigation/popover/props.d.ts +28 -0
- package/components/navigation/popover/props.js +13 -0
- package/components/page/content/index.d.ts +15 -0
- package/components/page/content/index.js +35 -0
- package/components/page/content/props.d.ts +6 -0
- package/components/page/content/props.js +5 -0
- package/components/page/error-boundary/index.d.ts +13 -0
- package/components/page/error-boundary/index.js +119 -0
- package/components/page/error-boundary/props.d.ts +30 -0
- package/components/page/error-boundary/props.js +5 -0
- package/components/page/index.d.ts +15 -0
- package/components/page/index.js +151 -0
- package/components/page/page-content/index.d.ts +15 -0
- package/components/page/page-content/index.js +34 -0
- package/components/page/page-content/props.d.ts +16 -0
- package/components/page/page-content/props.js +5 -0
- package/components/page/partial/index.d.ts +61 -0
- package/components/page/partial/index.js +46 -0
- package/components/page/partial/props.d.ts +6 -0
- package/components/page/partial/props.js +5 -0
- package/components/page/partial-container/index.d.ts +13 -0
- package/components/page/partial-container/index.js +112 -0
- package/components/page/partial-container/props.d.ts +38 -0
- package/components/page/partial-container/props.js +5 -0
- package/components/page/props.d.ts +33 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.d.ts +13 -0
- package/components/page/toast-container/index.js +43 -0
- package/components/page/toast-container/props.d.ts +8 -0
- package/components/page/toast-container/props.js +5 -0
- package/components/prefab/container/index.d.ts +12 -0
- package/components/prefab/container/index.js +64 -0
- package/components/prefab/container/props.d.ts +23 -0
- package/components/prefab/container/props.js +5 -0
- package/components/prefab/index.d.ts +12 -0
- package/components/prefab/index.js +69 -0
- package/components/prefab/props.d.ts +18 -0
- package/components/prefab/props.js +5 -0
- package/context/AppContext.d.ts +9 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.d.ts +15 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LayoutProvider.d.ts +7 -0
- package/context/LayoutProvider.js +66 -0
- package/context/LocalizationProvider.d.ts +4 -0
- package/context/LocalizationProvider.js +80 -0
- package/context/PrefabContext.d.ts +15 -0
- package/context/PrefabContext.js +195 -0
- package/context/WidgetProvider.d.ts +19 -0
- package/context/WidgetProvider.js +274 -0
- package/core/app-config.js +1 -0
- package/core/app.service.d.ts +19 -0
- package/core/app.service.js +366 -0
- package/core/appVariablesStore.d.ts +5 -0
- package/core/appVariablesStore.js +23 -0
- package/core/appstore.d.ts +35 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.d.ts +11 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.d.ts +24 -0
- package/core/constants/events.js +63 -0
- package/core/constants/index.d.ts +10 -0
- package/core/constants/index.js +49 -0
- package/core/dialog.service.d.ts +31 -0
- package/core/dialog.service.js +75 -0
- package/core/event-notifier.d.ts +20 -0
- package/core/event-notifier.js +150 -0
- package/core/formatter/array-formatters.d.ts +4 -0
- package/core/formatter/array-formatters.js +33 -0
- package/core/formatter/date-formatters.d.ts +9 -0
- package/core/formatter/date-formatters.js +245 -0
- package/core/formatter/index.d.ts +19 -0
- package/core/formatter/index.js +133 -0
- package/core/formatter/number-formatters.d.ts +20 -0
- package/core/formatter/number-formatters.js +181 -0
- package/core/formatter/security-formatters.d.ts +25 -0
- package/core/formatter/security-formatters.js +321 -0
- package/core/formatter/string-formatters.d.ts +10 -0
- package/core/formatter/string-formatters.js +49 -0
- package/core/formatter/types.d.ts +33 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.d.ts +3 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.d.ts +6 -0
- package/core/proxy-service.js +571 -0
- package/core/script-registry.d.ts +23 -0
- package/core/script-registry.js +149 -0
- package/core/security.service.d.ts +12 -0
- package/core/security.service.js +11 -0
- package/core/util/compare.d.ts +1 -0
- package/core/util/compare.js +36 -0
- package/core/util/dom.d.ts +4 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.d.ts +65 -0
- package/core/util/index.js +191 -0
- package/core/util/safe-is-equal.js +156 -0
- package/core/util/security.d.ts +64 -0
- package/core/util/security.js +183 -0
- package/core/util/utils.d.ts +34 -0
- package/core/util/utils.js +228 -0
- package/core/widget-observer.d.ts +3 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.d.ts +13 -0
- package/higherOrder/BaseApp.js +614 -0
- package/higherOrder/BaseAppProps.d.ts +37 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.d.ts +62 -0
- package/higherOrder/BaseDateTime.js +268 -0
- package/higherOrder/BasePage.d.ts +10 -0
- package/higherOrder/BasePage.js +909 -0
- package/higherOrder/BasePartial.d.ts +7 -0
- package/higherOrder/BasePartial.js +125 -0
- package/higherOrder/BasePrefab.d.ts +17 -0
- package/higherOrder/BasePrefab.js +234 -0
- package/higherOrder/DataNav.d.ts +53 -0
- package/higherOrder/DataNav.js +461 -0
- package/higherOrder/helper.d.ts +32 -0
- package/higherOrder/helper.js +81 -0
- package/higherOrder/props.d.ts +116 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.d.ts +5 -0
- package/higherOrder/withBaseWrapper.js +218 -0
- package/higherOrder/withStandalone.d.ts +11 -0
- package/higherOrder/withStandalone.js +29 -0
- package/hooks/useAccess.d.ts +18 -0
- package/hooks/useAccess.js +321 -0
- package/hooks/useAppConfig.d.ts +3 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.d.ts +55 -0
- package/hooks/useAuth.js +568 -0
- package/hooks/useDataSourceSubscription.d.ts +15 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.d.ts +21 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.d.ts +4 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.d.ts +57 -0
- package/hooks/useHttp.js +531 -0
- package/libs/index.js +13 -0
- package/libs/prefab/index.js +20 -0
- package/mui-config/theme-provider.d.ts +3 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.d.ts +2 -0
- package/mui-config/theme.js +364 -0
- package/package-lock.json +16455 -0
- package/package.json +135 -0
- package/providers/AppProviders.js +27 -0
- package/runtime-dynamic/App.d.ts +7 -0
- package/runtime-dynamic/App.js +144 -0
- package/runtime-dynamic/app-initializer.d.ts +15 -0
- package/runtime-dynamic/app-initializer.js +447 -0
- package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
- package/runtime-dynamic/components/ErrorBoundary.js +93 -0
- package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
- package/runtime-dynamic/components/PageWrapper.js +43 -0
- package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
- package/runtime-dynamic/components/PrefabPreview.js +84 -0
- package/runtime-dynamic/components/partial-content.d.ts +15 -0
- package/runtime-dynamic/components/partial-content.js +50 -0
- package/runtime-dynamic/components/prefab-content.d.ts +10 -0
- package/runtime-dynamic/components/prefab-content.js +31 -0
- package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
- package/runtime-dynamic/components/use-dynamic-component.js +165 -0
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
- package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
- package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
- package/runtime-dynamic/factories/prefab-factory.js +82 -0
- package/runtime-dynamic/factories/startup-info.d.ts +6 -0
- package/runtime-dynamic/factories/startup-info.js +28 -0
- package/runtime-dynamic/factories/utils.d.ts +23 -0
- package/runtime-dynamic/factories/utils.js +131 -0
- package/runtime-dynamic/index.d.ts +14 -0
- package/runtime-dynamic/index.js +191 -0
- package/runtime-dynamic/main.d.ts +2 -0
- package/runtime-dynamic/main.js +84 -0
- package/runtime-dynamic/preview-mode.d.ts +15 -0
- package/runtime-dynamic/preview-mode.js +31 -0
- package/runtime-dynamic/preview-navigation.d.ts +6 -0
- package/runtime-dynamic/preview-navigation.js +38 -0
- package/runtime-dynamic/preview-resource-base.d.ts +12 -0
- package/runtime-dynamic/preview-resource-base.js +65 -0
- package/runtime-dynamic/registry/component-registry.d.ts +3 -0
- package/runtime-dynamic/registry/component-registry.js +353 -0
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
- package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
- package/runtime-dynamic/registry/index.d.ts +2 -0
- package/runtime-dynamic/registry/index.js +63 -0
- package/runtime-dynamic/registry/store.d.ts +9 -0
- package/runtime-dynamic/registry/store.js +26 -0
- package/runtime-dynamic/routes.d.ts +2 -0
- package/runtime-dynamic/routes.js +107 -0
- package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
- package/runtime-dynamic/services/app-extension-provider.js +45 -0
- package/runtime-dynamic/services/cache.d.ts +29 -0
- package/runtime-dynamic/services/cache.js +57 -0
- package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
- package/runtime-dynamic/services/component-ref-provider.js +149 -0
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +53 -0
- package/runtime-dynamic/services/fragment-url.d.ts +16 -0
- package/runtime-dynamic/services/fragment-url.js +74 -0
- package/runtime-dynamic/services/index.d.ts +10 -0
- package/runtime-dynamic/services/index.js +152 -0
- package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
- package/runtime-dynamic/services/markup-transpiler.js +250 -0
- package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
- package/runtime-dynamic/services/prefab-resources.js +159 -0
- package/runtime-dynamic/services/resource-manager.d.ts +2 -0
- package/runtime-dynamic/services/resource-manager.js +66 -0
- package/runtime-dynamic/services/script-executor.d.ts +8 -0
- package/runtime-dynamic/services/script-executor.js +90 -0
- package/runtime-dynamic/services/variable-factory.d.ts +2 -0
- package/runtime-dynamic/services/variable-factory.js +260 -0
- package/runtime-dynamic/services/variable-registry.d.ts +12 -0
- package/runtime-dynamic/services/variable-registry.js +118 -0
- package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
- package/runtime-dynamic/services/variable-transpiler.js +159 -0
- package/runtime-dynamic/shims/next-image.d.ts +35 -0
- package/runtime-dynamic/shims/next-image.js +60 -0
- package/runtime-dynamic/shims/next-link.d.ts +25 -0
- package/runtime-dynamic/shims/next-link.js +33 -0
- package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
- package/runtime-dynamic/shims/next-navigation.js +52 -0
- package/runtime-dynamic/utils/index.d.ts +9 -0
- package/runtime-dynamic/utils/index.js +40 -0
- package/store/bindActions/i18nActions.d.ts +7 -0
- package/store/bindActions/i18nActions.js +18 -0
- package/store/index.d.ts +18 -0
- package/store/index.js +40 -0
- package/store/middleware/navigationMiddleware.d.ts +10 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/middleware/pendingTabNavigationIntentMiddleware.d.ts +6 -0
- package/store/middleware/pendingTabNavigationIntentMiddleware.js +25 -0
- package/store/slices/appConfigSlice.d.ts +21 -0
- package/store/slices/appConfigSlice.js +105 -0
- package/store/slices/authSlice.d.ts +54 -0
- package/store/slices/authSlice.js +526 -0
- package/store/slices/i18nSlice.d.ts +25 -0
- package/store/slices/i18nSlice.js +206 -0
- package/store/slices/navigationSlice.d.ts +7 -0
- package/store/slices/navigationSlice.js +35 -0
- package/store/viewport.service.d.ts +45 -0
- package/store/viewport.service.js +255 -0
- package/tsconfig.declaration.tsbuildinfo +1 -0
- package/types/global.d.js +3 -0
- package/types/index.d.ts +64 -0
- package/types/index.js +15 -0
- package/utils/attr.d.ts +1 -0
- package/utils/attr.js +92 -0
- package/utils/custom-expression/index.d.ts +43 -0
- package/utils/custom-expression/index.js +161 -0
- package/utils/custom-expression/parser.d.ts +15 -0
- package/utils/custom-expression/parser.js +208 -0
- package/utils/dataset-util.d.ts +31 -0
- package/utils/dataset-util.js +173 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.d.ts +62 -0
- package/utils/form-state.util.js +167 -0
- package/utils/form-utils.d.ts +84 -0
- package/utils/form-utils.js +232 -0
- package/utils/format-util.d.ts +25 -0
- package/utils/format-util.js +300 -0
- package/utils/layoutsize-util.d.ts +1 -0
- package/utils/layoutsize-util.js +57 -0
- package/utils/lib-error-skipper.d.ts +11 -0
- package/utils/lib-error-skipper.js +75 -0
- package/utils/page-params-util.d.ts +20 -0
- package/utils/page-params-util.js +56 -0
- package/utils/pending-tab-navigation-intent.d.ts +4 -0
- package/utils/pending-tab-navigation-intent.js +25 -0
- package/utils/resource-url.d.ts +1 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.d.ts +27 -0
- package/utils/state-persistance.js +411 -0
- package/utils/style-utils.d.ts +28 -0
- package/utils/style-utils.js +92 -0
- package/utils/transformedDataset-utils.d.ts +67 -0
- package/utils/transformedDataset-utils.js +645 -0
- package/utils/widget-cleanup-util.d.ts +32 -0
- package/utils/widget-cleanup-util.js +109 -0
- package/utils/widgets.d.ts +3 -0
- package/utils/widgets.js +97 -0
- package/variables/base-variable.d.ts +61 -0
- package/variables/base-variable.js +180 -0
- package/variables/constants.d.ts +21 -0
- package/variables/constants.js +27 -0
- package/variables/crud-variable.d.ts +39 -0
- package/variables/crud-variable.js +227 -0
- package/variables/live-variable.d.ts +58 -0
- package/variables/live-variable.js +226 -0
- package/variables/metadata.service.d.ts +24 -0
- package/variables/metadata.service.js +122 -0
- package/variables/model-variable.d.ts +12 -0
- package/variables/model-variable.js +86 -0
- package/variables/service-variable.d.ts +41 -0
- package/variables/service-variable.js +356 -0
- package/wm-namespace.d.ts +11 -0
- package/wm-namespace.js +14 -0
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.WmMenu = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
16
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
17
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
18
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
19
|
+
var _withBaseWrapper = require("@wavemaker-ai/react-runtime/higherOrder/withBaseWrapper");
|
|
20
|
+
var _transformedDatasetUtils = require("@wavemaker-ai/react-runtime/utils/transformedDataset-utils");
|
|
21
|
+
var _constants = require("./constants");
|
|
22
|
+
var _lodash = require("lodash");
|
|
23
|
+
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
24
|
+
var _ListItems = require("./components/ListItems");
|
|
25
|
+
var _utils = require("@wavemaker-ai/react-runtime/core/util/utils");
|
|
26
|
+
var _navigation = require("next/navigation");
|
|
27
|
+
var _actionTask = require("@wavemaker-ai/react-runtime/components/navigation/menu/utils/action-task");
|
|
28
|
+
var _roleFilter = require("@wavemaker-ai/react-runtime/components/navigation/menu/utils/role-filter");
|
|
29
|
+
var _useKeyboardMovements = require("./hooks/useKeyboardMovements.hook");
|
|
30
|
+
var _useTransformedDataset = require("./hooks/useTransformedDataset.hook");
|
|
31
|
+
var _useHoverState2 = require("./hooks/useHoverState.hook");
|
|
32
|
+
var _constants2 = require("@wavemaker-ai/react-runtime/core/constants");
|
|
33
|
+
var _attr = require("@wavemaker-ai/react-runtime/utils/attr");
|
|
34
|
+
var _excluded = ["menualign", "menuposition", "menulayout", "menuclass", "linktarget", "iconclass", "type", "animateitems", "disableMenuContext", "showonhover", "panelPosition", "autoclose", "autoopen", "hint", "arialabel", "width", "height", "iconposition", "caption", "shortcutkey", "onClick", "onSelect", "navNodes", "styles", "conditionalstyles", "className", "children", "listener", "name", "resetNavNodes", "nodes$", "dataset", "orderby", "itemlabel", "itemlink", "itemicon", "itemaction", "userrole", "loggedInUser", "itemchildren", "isactive", "displayValue", "onActionsclick", "dataPath", "isFromNav", "onNavItemActivate", "isNavItemActive"];
|
|
35
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
36
|
+
var __jsx = _react["default"].createElement;
|
|
37
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
|
+
/**
|
|
40
|
+
* Checks if the current path matches the nav item link.
|
|
41
|
+
* Uses path-segment matching to avoid false positives when one page name
|
|
42
|
+
* is a substring of another (e.g. "Tasks" should not match "/TasksService").
|
|
43
|
+
*/
|
|
44
|
+
var isPathMatchingLink = function isPathMatchingLink(path, link) {
|
|
45
|
+
var cleanLink = link.replace(/^#\/?/, "").split("?")[0].trim();
|
|
46
|
+
if (!cleanLink) return false;
|
|
47
|
+
// Match link as a full path segment: preceded by ^ or /, followed by $ or /
|
|
48
|
+
return new RegExp("(^|/)".concat(cleanLink, "($|/)"), "i").test(path);
|
|
49
|
+
};
|
|
50
|
+
var _hasLinkToCurrentPage = function hasLinkToCurrentPage(nodes, currentPath) {
|
|
51
|
+
if (!nodes || !Array.isArray(nodes)) return false;
|
|
52
|
+
return nodes.some(function (node) {
|
|
53
|
+
if (node.link === currentPath) return true;
|
|
54
|
+
return node.children && _hasLinkToCurrentPage(node.children, currentPath);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Main component
|
|
59
|
+
var WmMenu = exports.WmMenu = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
60
|
+
var _listener$appConfig2, _listener$appLocale;
|
|
61
|
+
var _props$menualign = props.menualign,
|
|
62
|
+
menualign = _props$menualign === void 0 ? "left" : _props$menualign,
|
|
63
|
+
_props$menuposition = props.menuposition,
|
|
64
|
+
initialMenuPosition = _props$menuposition === void 0 ? "down,right" : _props$menuposition,
|
|
65
|
+
_props$menulayout = props.menulayout,
|
|
66
|
+
menulayout = _props$menulayout === void 0 ? "vertical" : _props$menulayout,
|
|
67
|
+
menuclass = props.menuclass,
|
|
68
|
+
_props$linktarget = props.linktarget,
|
|
69
|
+
linktarget = _props$linktarget === void 0 ? "_self" : _props$linktarget,
|
|
70
|
+
iconclass = props.iconclass,
|
|
71
|
+
_props$type = props.type,
|
|
72
|
+
type = _props$type === void 0 ? "button" : _props$type,
|
|
73
|
+
animateitems = props.animateitems,
|
|
74
|
+
_props$disableMenuCon = props.disableMenuContext,
|
|
75
|
+
disableMenuContext = _props$disableMenuCon === void 0 ? false : _props$disableMenuCon,
|
|
76
|
+
_props$showonhover = props.showonhover,
|
|
77
|
+
showonhover = _props$showonhover === void 0 ? false : _props$showonhover,
|
|
78
|
+
panelPosition = props.panelPosition,
|
|
79
|
+
_props$autoclose = props.autoclose,
|
|
80
|
+
autoclose = _props$autoclose === void 0 ? "outsideClick" : _props$autoclose,
|
|
81
|
+
_props$autoopen = props.autoopen,
|
|
82
|
+
autoopen = _props$autoopen === void 0 ? "never" : _props$autoopen,
|
|
83
|
+
hint = props.hint,
|
|
84
|
+
arialabel = props.arialabel,
|
|
85
|
+
width = props.width,
|
|
86
|
+
height = props.height,
|
|
87
|
+
_props$iconposition = props.iconposition,
|
|
88
|
+
iconposition = _props$iconposition === void 0 ? "left" : _props$iconposition,
|
|
89
|
+
caption = props.caption,
|
|
90
|
+
shortcutkey = props.shortcutkey,
|
|
91
|
+
onClick = props.onClick,
|
|
92
|
+
onSelect = props.onSelect,
|
|
93
|
+
_props$navNodes = props.navNodes,
|
|
94
|
+
navNodes = _props$navNodes === void 0 ? [] : _props$navNodes,
|
|
95
|
+
styles = props.styles,
|
|
96
|
+
conditionalstyles = props.conditionalstyles,
|
|
97
|
+
className = props.className,
|
|
98
|
+
children = props.children,
|
|
99
|
+
listener = props.listener,
|
|
100
|
+
name = props.name,
|
|
101
|
+
resetNavNodes = props.resetNavNodes,
|
|
102
|
+
nodes$ = props.nodes$,
|
|
103
|
+
dataset = props.dataset,
|
|
104
|
+
orderby = props.orderby,
|
|
105
|
+
_props$itemlabel = props.itemlabel,
|
|
106
|
+
itemlabel = _props$itemlabel === void 0 ? "label" : _props$itemlabel,
|
|
107
|
+
_props$itemlink = props.itemlink,
|
|
108
|
+
itemlink = _props$itemlink === void 0 ? "Link" : _props$itemlink,
|
|
109
|
+
_props$itemicon = props.itemicon,
|
|
110
|
+
itemicon = _props$itemicon === void 0 ? "Icon" : _props$itemicon,
|
|
111
|
+
itemaction = props.itemaction,
|
|
112
|
+
userrole = props.userrole,
|
|
113
|
+
loggedInUser = props.loggedInUser,
|
|
114
|
+
_props$itemchildren = props.itemchildren,
|
|
115
|
+
itemchildren = _props$itemchildren === void 0 ? "children" : _props$itemchildren,
|
|
116
|
+
isactive = props.isactive,
|
|
117
|
+
displayValue = props.displayValue,
|
|
118
|
+
onActionsclick = props.onActionsclick,
|
|
119
|
+
dataPath = props.dataPath,
|
|
120
|
+
_props$isFromNav = props.isFromNav,
|
|
121
|
+
isFromNav = _props$isFromNav === void 0 ? false : _props$isFromNav,
|
|
122
|
+
onNavItemActivate = props.onNavItemActivate,
|
|
123
|
+
_props$isNavItemActiv = props.isNavItemActive,
|
|
124
|
+
isNavItemActive = _props$isNavItemActiv === void 0 ? false : _props$isNavItemActiv,
|
|
125
|
+
restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
126
|
+
|
|
127
|
+
// deeply cloning the dataset, it was getting mutated in the useTransformedDataset hook
|
|
128
|
+
var deepCloneDataset = (0, _lodash.cloneDeep)(dataset);
|
|
129
|
+
var itemLabelWrapper = typeof itemlabel === "function" ? function (rest) {
|
|
130
|
+
return itemlabel(_objectSpread({
|
|
131
|
+
App: listener === null || listener === void 0 ? void 0 : listener.App
|
|
132
|
+
}, rest));
|
|
133
|
+
} : itemlabel;
|
|
134
|
+
var path = (0, _navigation.usePathname)();
|
|
135
|
+
var user = (0, _react.useMemo)(function () {
|
|
136
|
+
var _ref, _listener$appConfig;
|
|
137
|
+
return (_ref = loggedInUser !== null && loggedInUser !== void 0 ? loggedInUser : listener === null || listener === void 0 || (_listener$appConfig = listener.appConfig) === null || _listener$appConfig === void 0 ? void 0 : _listener$appConfig.loggedInUser) !== null && _ref !== void 0 ? _ref : null;
|
|
138
|
+
}, [loggedInUser, listener === null || listener === void 0 || (_listener$appConfig2 = listener.appConfig) === null || _listener$appConfig2 === void 0 ? void 0 : _listener$appConfig2.loggedInUser]);
|
|
139
|
+
|
|
140
|
+
// State
|
|
141
|
+
var _useState = (0, _react.useState)(false),
|
|
142
|
+
open = _useState[0],
|
|
143
|
+
setOpen = _useState[1];
|
|
144
|
+
var _useState2 = (0, _react.useState)(null),
|
|
145
|
+
activeItem = _useState2[0],
|
|
146
|
+
setActiveItem = _useState2[1];
|
|
147
|
+
var _useState3 = (0, _react.useState)(-1),
|
|
148
|
+
focusedIndex = _useState3[0],
|
|
149
|
+
setFocusedIndex = _useState3[1];
|
|
150
|
+
var _useState4 = (0, _react.useState)(initialMenuPosition),
|
|
151
|
+
menuPosition = _useState4[0],
|
|
152
|
+
setMenuPosition = _useState4[1];
|
|
153
|
+
|
|
154
|
+
// Refs
|
|
155
|
+
var buttonRef = (0, _react.useRef)(null);
|
|
156
|
+
var menuRef = (0, _react.useRef)(null);
|
|
157
|
+
|
|
158
|
+
// Custom hooks
|
|
159
|
+
var keyboardMovements = (0, _useKeyboardMovements.useKeyboardMovements)(menuPosition);
|
|
160
|
+
var transformedDataset = (0, _useTransformedDataset.useTransformedDataset)(deepCloneDataset, itemLabelWrapper, orderby, itemchildren, dataPath);
|
|
161
|
+
|
|
162
|
+
// Apply role-based filtering if userrole prop is provided
|
|
163
|
+
var filteredDataset = (0, _react.useMemo)(function () {
|
|
164
|
+
if (!userrole || !transformedDataset) {
|
|
165
|
+
return transformedDataset;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Get user roles from the logged-in user
|
|
169
|
+
var userRoles = (user === null || user === void 0 ? void 0 : user.roles) || [];
|
|
170
|
+
|
|
171
|
+
// Apply role filtering with the dynamic userrole key
|
|
172
|
+
return (0, _roleFilter.filterMenuNodesByRole)(transformedDataset, userRoles, userrole);
|
|
173
|
+
}, [transformedDataset, userrole, user === null || user === void 0 ? void 0 : user.roles]);
|
|
174
|
+
var _useHoverState = (0, _useHoverState2.useHoverState)(),
|
|
175
|
+
hoveredPaths = _useHoverState.hoveredPaths,
|
|
176
|
+
handlePathMouseEnter = _useHoverState.handlePathMouseEnter,
|
|
177
|
+
handlePathMouseLeave = _useHoverState.handlePathMouseLeave;
|
|
178
|
+
|
|
179
|
+
// Hover handlers for showonhover functionality
|
|
180
|
+
var handleContainerMouseEnter = (0, _react.useCallback)(function () {
|
|
181
|
+
if (showonhover) {
|
|
182
|
+
setOpen(true);
|
|
183
|
+
}
|
|
184
|
+
}, [showonhover]);
|
|
185
|
+
var handleContainerMouseLeave = (0, _react.useCallback)(function (event) {
|
|
186
|
+
var _relatedTarget$classL, _relatedTarget$closes, _relatedTarget$closes2;
|
|
187
|
+
if (!showonhover) return;
|
|
188
|
+
var relatedTarget = event === null || event === void 0 ? void 0 : event.relatedTarget;
|
|
189
|
+
var isMovingToMenu = relatedTarget && (((_relatedTarget$classL = relatedTarget.classList) === null || _relatedTarget$classL === void 0 ? void 0 : _relatedTarget$classL.contains("dropdown-menu")) || ((_relatedTarget$closes = relatedTarget.closest) === null || _relatedTarget$closes === void 0 ? void 0 : _relatedTarget$closes.call(relatedTarget, ".dropdown-menu")) !== null || ((_relatedTarget$closes2 = relatedTarget.closest) === null || _relatedTarget$closes2 === void 0 ? void 0 : _relatedTarget$closes2.call(relatedTarget, ".app-menu")) !== null);
|
|
190
|
+
if (!isMovingToMenu) {
|
|
191
|
+
setOpen(false);
|
|
192
|
+
setFocusedIndex(-1);
|
|
193
|
+
setActiveItem(null);
|
|
194
|
+
}
|
|
195
|
+
}, [showonhover]);
|
|
196
|
+
|
|
197
|
+
// Memoized values
|
|
198
|
+
var transformChildrenDataset = (0, _react.useCallback)(function (children) {
|
|
199
|
+
if (!children || !Array.isArray(children)) return [];
|
|
200
|
+
return (0, _transformedDatasetUtils.transformDataset)(children, "", itemLabelWrapper, undefined, undefined, orderby, undefined, undefined, itemchildren);
|
|
201
|
+
}, [itemLabelWrapper, orderby]);
|
|
202
|
+
var createRefsForNodes = (0, _react.useCallback)(function (nodes) {
|
|
203
|
+
if (!nodes || !Array.isArray(nodes)) return [];
|
|
204
|
+
return nodes.map(function (node) {
|
|
205
|
+
var _dataObject;
|
|
206
|
+
var nodeWithRef = _objectSpread({}, node);
|
|
207
|
+
if (!nodeWithRef.nodeRef) {
|
|
208
|
+
nodeWithRef.nodeRef = /*#__PURE__*/_react["default"].createRef();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Check for children at node.children first, then at dataObject.children (where datasetItems stores them)
|
|
212
|
+
var existingChildren = nodeWithRef.children || ((_dataObject = nodeWithRef.dataObject) === null || _dataObject === void 0 ? void 0 : _dataObject.children);
|
|
213
|
+
if (existingChildren && existingChildren.length) {
|
|
214
|
+
var _existingChildren$;
|
|
215
|
+
// If children already have dataObject (already transformed by datasetItems), just add refs
|
|
216
|
+
// Otherwise, transform them first
|
|
217
|
+
var alreadyTransformed = ((_existingChildren$ = existingChildren[0]) === null || _existingChildren$ === void 0 ? void 0 : _existingChildren$.dataObject) !== undefined;
|
|
218
|
+
var processedChildren = alreadyTransformed ? existingChildren : transformChildrenDataset(existingChildren);
|
|
219
|
+
nodeWithRef.children = createRefsForNodes(processedChildren);
|
|
220
|
+
}
|
|
221
|
+
return nodeWithRef;
|
|
222
|
+
});
|
|
223
|
+
}, [transformChildrenDataset]);
|
|
224
|
+
var nodesWithRefs = (0, _react.useMemo)(function () {
|
|
225
|
+
return createRefsForNodes(filteredDataset);
|
|
226
|
+
}, [filteredDataset, createRefsForNodes]);
|
|
227
|
+
var flattenNodes = (0, _react.useCallback)(function (nodes) {
|
|
228
|
+
if (!nodes || !Array.isArray(nodes)) return [];
|
|
229
|
+
return nodes.reduce(function (acc, node) {
|
|
230
|
+
acc.push(node);
|
|
231
|
+
if (node.children && node.children.length) {
|
|
232
|
+
acc.push.apply(acc, (0, _toConsumableArray2["default"])(flattenNodes(node.children)));
|
|
233
|
+
}
|
|
234
|
+
return acc;
|
|
235
|
+
}, []);
|
|
236
|
+
}, []);
|
|
237
|
+
var flattenedNodes = (0, _react.useMemo)(function () {
|
|
238
|
+
return flattenNodes(nodesWithRefs);
|
|
239
|
+
}, [nodesWithRefs, flattenNodes]);
|
|
240
|
+
var getNodeProperties = (0, _react.useCallback)(function (node) {
|
|
241
|
+
var dataObject = node.dataObject || {};
|
|
242
|
+
var label;
|
|
243
|
+
var children;
|
|
244
|
+
|
|
245
|
+
// Handle itemlabel - can be a string (field name) or function (expression)
|
|
246
|
+
if (typeof itemLabelWrapper === "function") {
|
|
247
|
+
try {
|
|
248
|
+
label = itemLabelWrapper(dataObject);
|
|
249
|
+
} catch (error) {
|
|
250
|
+
console.warn("Error evaluating itemlabel expression:", error);
|
|
251
|
+
label = (node === null || node === void 0 ? void 0 : node["label"]) || dataObject["label"];
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
label = (node === null || node === void 0 ? void 0 : node[itemLabelWrapper]) || dataObject[itemLabelWrapper];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Handle itemchildren - can be a string (field name) or function (expression)
|
|
258
|
+
if (typeof itemchildren === "function") {
|
|
259
|
+
try {
|
|
260
|
+
var childrenData = itemchildren(dataObject);
|
|
261
|
+
if (Array.isArray(childrenData)) {
|
|
262
|
+
children = transformChildrenDataset(childrenData);
|
|
263
|
+
} else {
|
|
264
|
+
children = childrenData;
|
|
265
|
+
}
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.warn("Error evaluating itemchildren expression:", error);
|
|
268
|
+
children = (node === null || node === void 0 ? void 0 : node["children"]) || dataObject["children"];
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
// First check for already-transformed children (stored at 'children' by datasetItems),
|
|
272
|
+
// then fall back to raw data at the itemchildren key
|
|
273
|
+
children = (node === null || node === void 0 ? void 0 : node.children) || (dataObject === null || dataObject === void 0 ? void 0 : dataObject.children) || (node === null || node === void 0 ? void 0 : node[itemchildren]) || (dataObject === null || dataObject === void 0 ? void 0 : dataObject[itemchildren]);
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
label: label,
|
|
277
|
+
icon: (node === null || node === void 0 ? void 0 : node[itemicon]) || dataObject[itemicon],
|
|
278
|
+
link: (node === null || node === void 0 ? void 0 : node[itemlink]) || dataObject[itemlink] || dataObject["link"],
|
|
279
|
+
hint: (node === null || node === void 0 ? void 0 : node[hint]) || dataObject[hint],
|
|
280
|
+
disabled: (node === null || node === void 0 ? void 0 : node.disabled) || dataObject.disabled,
|
|
281
|
+
children: children
|
|
282
|
+
};
|
|
283
|
+
}, [itemlabel, itemicon, itemlink, hint, itemchildren]);
|
|
284
|
+
|
|
285
|
+
// Computed styles
|
|
286
|
+
var buttonStyles = (0, _react.useMemo)(function () {
|
|
287
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, styles), conditionalstyles), width !== undefined && {
|
|
288
|
+
width: typeof width === "number" ? "".concat(width, "px") : width
|
|
289
|
+
}), height !== undefined && {
|
|
290
|
+
height: typeof height === "number" ? "".concat(height, "px") : height
|
|
291
|
+
});
|
|
292
|
+
}, [styles, conditionalstyles, width, height]);
|
|
293
|
+
var menuContainerStyles = (0, _react.useMemo)(function () {
|
|
294
|
+
return {
|
|
295
|
+
textAlign: menualign,
|
|
296
|
+
position: "relative"
|
|
297
|
+
};
|
|
298
|
+
}, [menualign]);
|
|
299
|
+
var getMenuLayoutStyles = (0, _react.useCallback)(function () {
|
|
300
|
+
switch (menulayout) {
|
|
301
|
+
case _constants.LAYOUT.HORIZONTAL:
|
|
302
|
+
return {
|
|
303
|
+
display: "flex",
|
|
304
|
+
flexDirection: "row"
|
|
305
|
+
};
|
|
306
|
+
case _constants.LAYOUT.GRID:
|
|
307
|
+
return {
|
|
308
|
+
display: "grid",
|
|
309
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))",
|
|
310
|
+
gap: "8px"
|
|
311
|
+
};
|
|
312
|
+
case _constants.LAYOUT.VERTICAL:
|
|
313
|
+
default:
|
|
314
|
+
return {
|
|
315
|
+
display: "block"
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
}, [menulayout]);
|
|
319
|
+
|
|
320
|
+
// Event handlers
|
|
321
|
+
var handleMenuClick = (0, _react.useCallback)(function (event) {
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
if (onClick && listener !== null && listener !== void 0 && listener.Widgets && name && listener.Widgets[name]) {
|
|
324
|
+
onClick(event, listener.Widgets[name]);
|
|
325
|
+
}
|
|
326
|
+
setOpen(function (prevState) {
|
|
327
|
+
return !prevState;
|
|
328
|
+
});
|
|
329
|
+
if (!open) {
|
|
330
|
+
setActiveItem(null);
|
|
331
|
+
setFocusedIndex(-1);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// If menu is from nav, notify nav to activate the nav item when menu button is clicked
|
|
335
|
+
if (isFromNav && onNavItemActivate) {
|
|
336
|
+
onNavItemActivate();
|
|
337
|
+
}
|
|
338
|
+
}, [onClick, listener, name, open, isFromNav, onNavItemActivate]);
|
|
339
|
+
var handleMenuItemClick = (0, _react.useCallback)(function (event, item) {
|
|
340
|
+
var _item$dataObject, _item$dataObject2, _item$dataObject3, _item$dataObject4, _item$dataObject5;
|
|
341
|
+
// since event is a synthetic event, we need to convert it to a native event to support the angular behavior
|
|
342
|
+
event = event.nativeEvent;
|
|
343
|
+
var _getNodeProperties = getNodeProperties(item),
|
|
344
|
+
label = _getNodeProperties.label,
|
|
345
|
+
icon = _getNodeProperties.icon,
|
|
346
|
+
link = _getNodeProperties.link;
|
|
347
|
+
|
|
348
|
+
// Only prevent default if item has children (submenu) or no valid link
|
|
349
|
+
if (item.children && item.children.length > 0 || !link || link === "#") {
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
}
|
|
352
|
+
setActiveItem(item);
|
|
353
|
+
var index = flattenedNodes.findIndex(function (node) {
|
|
354
|
+
return node === item;
|
|
355
|
+
});
|
|
356
|
+
if (index !== -1) {
|
|
357
|
+
setFocusedIndex(index);
|
|
358
|
+
}
|
|
359
|
+
(0, _actionTask.executeActionTaskFromItem)(item, listener);
|
|
360
|
+
if (item.children && item.children.length > 0) {
|
|
361
|
+
item.expanded = !item.expanded;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Create a simplified item object with only the required properties
|
|
365
|
+
var simplifiedItem = _objectSpread(_objectSpread({}, item.dataObject || {}), {}, {
|
|
366
|
+
name: ((_item$dataObject = item.dataObject) === null || _item$dataObject === void 0 ? void 0 : _item$dataObject.name) || name,
|
|
367
|
+
label: label,
|
|
368
|
+
dataValue: ((_item$dataObject2 = item.dataObject) === null || _item$dataObject2 === void 0 ? void 0 : _item$dataObject2.dataValue) || label,
|
|
369
|
+
value: ((_item$dataObject3 = item.dataObject) === null || _item$dataObject3 === void 0 ? void 0 : _item$dataObject3.dataValue) || label,
|
|
370
|
+
icon: ((_item$dataObject4 = item.dataObject) === null || _item$dataObject4 === void 0 ? void 0 : _item$dataObject4.icon) || icon,
|
|
371
|
+
link: link,
|
|
372
|
+
target: (_item$dataObject5 = item.dataObject) === null || _item$dataObject5 === void 0 ? void 0 : _item$dataObject5.target
|
|
373
|
+
}, item === null || item === void 0 ? void 0 : item.value);
|
|
374
|
+
if (onSelect) {
|
|
375
|
+
onSelect(event, props, simplifiedItem);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// If menu is from nav, notify nav to activate the nav item
|
|
379
|
+
if (isFromNav && onNavItemActivate) {
|
|
380
|
+
onNavItemActivate();
|
|
381
|
+
}
|
|
382
|
+
if (name && listener !== null && listener !== void 0 && listener.Widgets[name]) {
|
|
383
|
+
listener.Widgets[name].displayValue = label;
|
|
384
|
+
}
|
|
385
|
+
if (listener !== null && listener !== void 0 && listener.onChange) {
|
|
386
|
+
listener.onChange(name, {
|
|
387
|
+
datavalue: label
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
var routeName = (0, _constants2.hyperLinkMofify)((0, _utils.getRouteNameFromLink)((simplifiedItem === null || simplifiedItem === void 0 ? void 0 : simplifiedItem.link) || ""));
|
|
391
|
+
// Check if target route is the current page - skip navigation to prevent refresh
|
|
392
|
+
var currentPath = window.location.pathname;
|
|
393
|
+
if (routeName !== currentPath) {
|
|
394
|
+
// timeout is used so that onSelect can perform its actions before the navigation happens
|
|
395
|
+
setTimeout(function () {
|
|
396
|
+
// this function is used to navigate when menuitem is expected to work as anchor
|
|
397
|
+
(0, _utils.triggerItemAction)(simplifiedItem);
|
|
398
|
+
}, 0);
|
|
399
|
+
}
|
|
400
|
+
if (autoclose === _constants.AUTO_CLOSE.ALWAYS && (!item.children || item.children.length === 0)) {
|
|
401
|
+
setOpen(false);
|
|
402
|
+
setFocusedIndex(-1);
|
|
403
|
+
}
|
|
404
|
+
onActionsclick === null || onActionsclick === void 0 || onActionsclick(item);
|
|
405
|
+
}, [flattenedNodes, onSelect, props, name, listener, autoclose, getNodeProperties, isFromNav, onNavItemActivate]);
|
|
406
|
+
|
|
407
|
+
// Keyboard navigation
|
|
408
|
+
var focusNode = (0, _react.useCallback)(function (index) {
|
|
409
|
+
var _flattenedNodes$index;
|
|
410
|
+
if ((_flattenedNodes$index = flattenedNodes[index]) !== null && _flattenedNodes$index !== void 0 && (_flattenedNodes$index = _flattenedNodes$index.nodeRef) !== null && _flattenedNodes$index !== void 0 && _flattenedNodes$index.current) {
|
|
411
|
+
flattenedNodes[index].nodeRef.current.focus();
|
|
412
|
+
}
|
|
413
|
+
}, [flattenedNodes]);
|
|
414
|
+
var closeMenu = (0, _react.useCallback)(function () {
|
|
415
|
+
var _buttonRef$current;
|
|
416
|
+
setOpen(false);
|
|
417
|
+
setFocusedIndex(-1);
|
|
418
|
+
setActiveItem(null);
|
|
419
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
420
|
+
}, []);
|
|
421
|
+
var toggleMenu = (0, _react.useCallback)(function () {
|
|
422
|
+
setOpen(function (prevOpen) {
|
|
423
|
+
return !prevOpen;
|
|
424
|
+
});
|
|
425
|
+
}, []);
|
|
426
|
+
var handleArrowDown = (0, _react.useCallback)(function (event) {
|
|
427
|
+
if (keyboardMovements.MOVE_DOWN !== "DOWN-ARROW") return;
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
if (!open) {
|
|
430
|
+
setOpen(true);
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
var nextIndex = focusedIndex < 0 ? 0 : (focusedIndex + 1) % flattenedNodes.length;
|
|
434
|
+
setFocusedIndex(nextIndex);
|
|
435
|
+
focusNode(nextIndex);
|
|
436
|
+
}, [keyboardMovements, open, focusedIndex, flattenedNodes.length, focusNode]);
|
|
437
|
+
var handleArrowUp = (0, _react.useCallback)(function (event) {
|
|
438
|
+
if (keyboardMovements.MOVE_UP !== "UP-ARROW") return;
|
|
439
|
+
event.preventDefault();
|
|
440
|
+
if (!open) {
|
|
441
|
+
setOpen(true);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if (focusedIndex === 0) {
|
|
445
|
+
closeMenu();
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
var prevIndex = focusedIndex <= 0 ? flattenedNodes.length - 1 : (focusedIndex - 1) % flattenedNodes.length;
|
|
449
|
+
setFocusedIndex(prevIndex);
|
|
450
|
+
focusNode(prevIndex);
|
|
451
|
+
}, [keyboardMovements, open, focusedIndex, flattenedNodes.length, focusNode, closeMenu]);
|
|
452
|
+
var handleEnterOrSpace = (0, _react.useCallback)(function (event) {
|
|
453
|
+
if (keyboardMovements.ON_ENTER !== "ENTER") return;
|
|
454
|
+
event.preventDefault();
|
|
455
|
+
if (focusedIndex >= 0 && flattenedNodes[focusedIndex]) {
|
|
456
|
+
handleMenuItemClick(event, flattenedNodes[focusedIndex]);
|
|
457
|
+
} else if (open) {
|
|
458
|
+
closeMenu();
|
|
459
|
+
}
|
|
460
|
+
}, [keyboardMovements, focusedIndex, flattenedNodes, handleMenuItemClick, open, closeMenu]);
|
|
461
|
+
var handleEscape = (0, _react.useCallback)(function (event) {
|
|
462
|
+
if (keyboardMovements.ON_ESCAPE !== "ESC") return;
|
|
463
|
+
event.preventDefault();
|
|
464
|
+
closeMenu();
|
|
465
|
+
}, [keyboardMovements, closeMenu]);
|
|
466
|
+
var moveFocusHorizontally = (0, _react.useCallback)(function (direction) {
|
|
467
|
+
var nextIndex = (focusedIndex + direction + flattenedNodes.length) % flattenedNodes.length;
|
|
468
|
+
setFocusedIndex(nextIndex);
|
|
469
|
+
focusNode(nextIndex);
|
|
470
|
+
}, [focusedIndex, flattenedNodes.length, focusNode]);
|
|
471
|
+
var expandAndFocusChild = (0, _react.useCallback)(function (currentItem) {
|
|
472
|
+
currentItem.expanded = true;
|
|
473
|
+
var firstChild = currentItem.children[0];
|
|
474
|
+
var childIndex = flattenedNodes.findIndex(function (node) {
|
|
475
|
+
return node === firstChild;
|
|
476
|
+
});
|
|
477
|
+
if (childIndex !== -1) {
|
|
478
|
+
setFocusedIndex(childIndex);
|
|
479
|
+
setActiveItem(flattenedNodes[childIndex]);
|
|
480
|
+
focusNode(childIndex);
|
|
481
|
+
}
|
|
482
|
+
}, [flattenedNodes, focusNode]);
|
|
483
|
+
var collapseAndFocusParent = (0, _react.useCallback)(function (currentItem) {
|
|
484
|
+
var parentIndex = flattenedNodes.findIndex(function (node) {
|
|
485
|
+
var _node$children;
|
|
486
|
+
return (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.some(function (child) {
|
|
487
|
+
return child === currentItem;
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
if (parentIndex !== -1) {
|
|
491
|
+
flattenedNodes[parentIndex].expanded = false;
|
|
492
|
+
setFocusedIndex(parentIndex);
|
|
493
|
+
setActiveItem(flattenedNodes[parentIndex]);
|
|
494
|
+
focusNode(parentIndex);
|
|
495
|
+
}
|
|
496
|
+
}, [flattenedNodes, focusNode]);
|
|
497
|
+
var handleArrowRight = (0, _react.useCallback)(function (event) {
|
|
498
|
+
if (menulayout === _constants.LAYOUT.HORIZONTAL || keyboardMovements.MOVE_RIGHT !== "RIGHT-ARROW") return;
|
|
499
|
+
event.preventDefault();
|
|
500
|
+
if (focusedIndex >= 0 && flattenedNodes[focusedIndex]) {
|
|
501
|
+
var currentItem = flattenedNodes[focusedIndex];
|
|
502
|
+
if (currentItem.children && currentItem.children.length > 0) {
|
|
503
|
+
expandAndFocusChild(currentItem);
|
|
504
|
+
} else if (menulayout === _constants.LAYOUT.HORIZONTAL) {
|
|
505
|
+
moveFocusHorizontally(1);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}, [menulayout, keyboardMovements, focusedIndex, flattenedNodes, expandAndFocusChild, moveFocusHorizontally]);
|
|
509
|
+
var handleArrowLeft = (0, _react.useCallback)(function (event) {
|
|
510
|
+
if (menulayout === _constants.LAYOUT.HORIZONTAL || keyboardMovements.MOVE_LEFT !== "LEFT-ARROW") return;
|
|
511
|
+
event.preventDefault();
|
|
512
|
+
if (focusedIndex >= 0 && flattenedNodes[focusedIndex]) {
|
|
513
|
+
var currentItem = flattenedNodes[focusedIndex];
|
|
514
|
+
if (menulayout === _constants.LAYOUT.HORIZONTAL) {
|
|
515
|
+
moveFocusHorizontally(-1);
|
|
516
|
+
} else {
|
|
517
|
+
collapseAndFocusParent(currentItem);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}, [menulayout, keyboardMovements, focusedIndex, flattenedNodes, moveFocusHorizontally, collapseAndFocusParent]);
|
|
521
|
+
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
522
|
+
var key = event.key;
|
|
523
|
+
if (key === "Enter" && document.activeElement === buttonRef.current) {
|
|
524
|
+
event.preventDefault();
|
|
525
|
+
toggleMenu();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (!open && key === "Enter") {
|
|
529
|
+
event.preventDefault();
|
|
530
|
+
setOpen(true);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (!open && !["ArrowDown", "ArrowUp", "Enter", " "].includes(key)) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (flattenedNodes.length === 0 && open) return;
|
|
537
|
+
var keyHandlers = {
|
|
538
|
+
ArrowDown: handleArrowDown,
|
|
539
|
+
ArrowUp: handleArrowUp,
|
|
540
|
+
Enter: handleEnterOrSpace,
|
|
541
|
+
" ": handleEnterOrSpace,
|
|
542
|
+
Escape: handleEscape,
|
|
543
|
+
Tab: closeMenu,
|
|
544
|
+
ArrowRight: handleArrowRight,
|
|
545
|
+
ArrowLeft: handleArrowLeft
|
|
546
|
+
};
|
|
547
|
+
var handler = keyHandlers[key];
|
|
548
|
+
if (handler) {
|
|
549
|
+
handler(event);
|
|
550
|
+
}
|
|
551
|
+
}, [open, flattenedNodes.length, toggleMenu, handleArrowDown, handleArrowUp, handleEnterOrSpace, handleEscape, closeMenu, handleArrowRight, handleArrowLeft]);
|
|
552
|
+
|
|
553
|
+
// Render functions
|
|
554
|
+
/**
|
|
555
|
+
* Recursively renders menu items with path-based hover tracking.
|
|
556
|
+
*
|
|
557
|
+
* @param nodes - Array of menu nodes to render
|
|
558
|
+
* @param pathPrefix - Parent path prefix for generating unique item paths
|
|
559
|
+
* e.g., "" for root, "0" for first item's children, "0-1" for nested
|
|
560
|
+
*
|
|
561
|
+
* Path structure examples:
|
|
562
|
+
* - Root item 0: "0"
|
|
563
|
+
* - Root item 1: "1"
|
|
564
|
+
* - First child of item 0: "0-0"
|
|
565
|
+
* - Second child of item 1: "1-1"
|
|
566
|
+
* - Grandchild: "0-0-0"
|
|
567
|
+
*/
|
|
568
|
+
var renderMenuItems = (0, _react.useCallback)(function (nodes) {
|
|
569
|
+
var pathPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
570
|
+
if (!nodes || !Array.isArray(nodes)) return null;
|
|
571
|
+
return nodes.map(function (node, index) {
|
|
572
|
+
var _value;
|
|
573
|
+
var _getNodeProperties2 = getNodeProperties(node),
|
|
574
|
+
label = _getNodeProperties2.label,
|
|
575
|
+
icon = _getNodeProperties2.icon,
|
|
576
|
+
link = _getNodeProperties2.link,
|
|
577
|
+
hint = _getNodeProperties2.hint,
|
|
578
|
+
disabled = _getNodeProperties2.disabled,
|
|
579
|
+
children = _getNodeProperties2.children;
|
|
580
|
+
|
|
581
|
+
// Generate unique path for this menu item by combining parent path with index
|
|
582
|
+
var itemPath = pathPrefix ? "".concat(pathPrefix, "-").concat(index) : "".concat(index);
|
|
583
|
+
var nodeValueLink = node === null || node === void 0 || (_value = node.value) === null || _value === void 0 ? void 0 : _value.link;
|
|
584
|
+
var isActive = nodeValueLink && typeof nodeValueLink === "string" ? isPathMatchingLink(path, nodeValueLink) : link ? isPathMatchingLink(path, link) : false;
|
|
585
|
+
var _menuPosition$split = menuPosition.split(","),
|
|
586
|
+
_menuPosition$split2 = (0, _slicedToArray2["default"])(_menuPosition$split, 2),
|
|
587
|
+
verticalPos = _menuPosition$split2[0],
|
|
588
|
+
horizontalPos = _menuPosition$split2[1];
|
|
589
|
+
|
|
590
|
+
// Check if this specific path is currently hovered
|
|
591
|
+
var isHovered = hoveredPaths.has(itemPath);
|
|
592
|
+
|
|
593
|
+
// Submenu opens when item is expanded OR hovered
|
|
594
|
+
var isSubmenuOpen = node.expanded || isHovered;
|
|
595
|
+
var submenuClassName = (0, _ListItems.buildMenuListClasses)(iconposition, menulayout, horizontalPos, panelPosition, animateitems, menuPosition, isHovered);
|
|
596
|
+
return __jsx(_Box["default"], {
|
|
597
|
+
component: "li",
|
|
598
|
+
key: index,
|
|
599
|
+
className: (0, _clsx["default"])(children && children.length > 0 && "dropdown-submenu", "app-menu-item", {
|
|
600
|
+
active: isActive,
|
|
601
|
+
hovered: isHovered
|
|
602
|
+
})
|
|
603
|
+
// Track hover state for this item's path
|
|
604
|
+
,
|
|
605
|
+
onMouseEnter: function onMouseEnter() {
|
|
606
|
+
return handlePathMouseEnter(itemPath);
|
|
607
|
+
},
|
|
608
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
609
|
+
return handlePathMouseLeave(itemPath, e);
|
|
610
|
+
},
|
|
611
|
+
style: {
|
|
612
|
+
position: "relative"
|
|
613
|
+
}
|
|
614
|
+
}, __jsx(_Link["default"], {
|
|
615
|
+
title: label,
|
|
616
|
+
className: disabled ? "disabled" : "",
|
|
617
|
+
onClick: function onClick(event) {
|
|
618
|
+
handleMenuItemClick(event, node);
|
|
619
|
+
}
|
|
620
|
+
}, children && children.length > 0 && __jsx("span", {
|
|
621
|
+
className: (0, _clsx["default"])("pull-right fa caret", _constants.menuAlignClass[menualign] || "fa-caret-right")
|
|
622
|
+
}), icon && __jsx("i", {
|
|
623
|
+
className: "app-icon ".concat(icon)
|
|
624
|
+
}), __jsx("span", {
|
|
625
|
+
className: "anchor-caption"
|
|
626
|
+
}, label)), children && children.length > 0 && (type !== "anchor" ? __jsx(_ListItems.CollapsibleMenu, {
|
|
627
|
+
isOpen: isSubmenuOpen,
|
|
628
|
+
verticalPos: verticalPos,
|
|
629
|
+
className: submenuClassName,
|
|
630
|
+
style: getMenuLayoutStyles()
|
|
631
|
+
// IMPORTANT: Submenu container also tracks the PARENT's path
|
|
632
|
+
// This keeps the parent in hover state when mouse moves to submenu
|
|
633
|
+
,
|
|
634
|
+
onMouseEnter: function onMouseEnter() {
|
|
635
|
+
return handlePathMouseEnter(itemPath);
|
|
636
|
+
},
|
|
637
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
638
|
+
return handlePathMouseLeave(itemPath, e);
|
|
639
|
+
}
|
|
640
|
+
}, renderMenuItems(children, itemPath)) : isSubmenuOpen && open && __jsx(_ListItems.MenuList, {
|
|
641
|
+
iconposition: iconposition,
|
|
642
|
+
className: submenuClassName,
|
|
643
|
+
style: getMenuLayoutStyles()
|
|
644
|
+
// Same hover tracking for anchor-type menus
|
|
645
|
+
,
|
|
646
|
+
onMouseEnter: function onMouseEnter() {
|
|
647
|
+
return handlePathMouseEnter(itemPath);
|
|
648
|
+
},
|
|
649
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
650
|
+
return handlePathMouseLeave(itemPath, e);
|
|
651
|
+
},
|
|
652
|
+
onClick: function onClick(event) {
|
|
653
|
+
return onActionsclick === null || onActionsclick === void 0 ? void 0 : onActionsclick(node);
|
|
654
|
+
}
|
|
655
|
+
}, renderMenuItems(children, itemPath))));
|
|
656
|
+
});
|
|
657
|
+
}, [getNodeProperties, menuPosition, hoveredPaths, handlePathMouseEnter, handlePathMouseLeave, hint, handleMenuItemClick, activeItem, linktarget, iconposition, animateitems, menualign, getMenuLayoutStyles, type, open, panelPosition]);
|
|
658
|
+
|
|
659
|
+
// Effects
|
|
660
|
+
(0, _react.useEffect)(function () {
|
|
661
|
+
if (!open) return;
|
|
662
|
+
setActiveItem(null);
|
|
663
|
+
setFocusedIndex(-1);
|
|
664
|
+
}, [open]);
|
|
665
|
+
(0, _react.useEffect)(function () {
|
|
666
|
+
if (autoopen === _constants.AUTO_OPEN.ALWAYS) {
|
|
667
|
+
setOpen(true);
|
|
668
|
+
} else if (autoopen === _constants.AUTO_OPEN.ACTIVE_PAGE) {
|
|
669
|
+
var hasActiveItem = filteredDataset.some(function (node) {
|
|
670
|
+
return _hasLinkToCurrentPage([node], window.location.pathname);
|
|
671
|
+
});
|
|
672
|
+
if (hasActiveItem) {
|
|
673
|
+
setOpen(true);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}, [filteredDataset, autoopen]);
|
|
677
|
+
var notifiedPathRef = (0, _react.useRef)(null);
|
|
678
|
+
(0, _react.useEffect)(function () {
|
|
679
|
+
if (!isFromNav || !onNavItemActivate || !filteredDataset || filteredDataset.length === 0) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// Check if any menu item is active using the same logic as renderMenuItems
|
|
684
|
+
var _checkIfActive = function checkIfActive(nodes) {
|
|
685
|
+
if (!nodes || !Array.isArray(nodes)) return false;
|
|
686
|
+
return nodes.some(function (node) {
|
|
687
|
+
var _value2;
|
|
688
|
+
var _getNodeProperties3 = getNodeProperties(node),
|
|
689
|
+
link = _getNodeProperties3.link,
|
|
690
|
+
children = _getNodeProperties3.children;
|
|
691
|
+
var nodeValueLink = node === null || node === void 0 || (_value2 = node.value) === null || _value2 === void 0 ? void 0 : _value2.link;
|
|
692
|
+
var isActive = nodeValueLink && typeof nodeValueLink === "string" ? isPathMatchingLink(path, nodeValueLink) : link ? isPathMatchingLink(path, link) : false;
|
|
693
|
+
if (isActive) return true;
|
|
694
|
+
if (children && children.length > 0) {
|
|
695
|
+
return _checkIfActive(children);
|
|
696
|
+
}
|
|
697
|
+
return false;
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
var hasActiveItem = _checkIfActive(filteredDataset);
|
|
701
|
+
|
|
702
|
+
// Notify nav if there's an active item and we haven't notified for this path yet
|
|
703
|
+
if (hasActiveItem && notifiedPathRef.current !== path) {
|
|
704
|
+
onNavItemActivate();
|
|
705
|
+
notifiedPathRef.current = path;
|
|
706
|
+
setOpen(true);
|
|
707
|
+
} else if (!hasActiveItem) {
|
|
708
|
+
// Reset when no active item found
|
|
709
|
+
notifiedPathRef.current = null;
|
|
710
|
+
}
|
|
711
|
+
}, [path, filteredDataset, isFromNav, onNavItemActivate, getNodeProperties]);
|
|
712
|
+
(0, _react.useEffect)(function () {
|
|
713
|
+
// Handle outside click for both "outsideClick" and "always" autoclose modes
|
|
714
|
+
if (!open || autoclose === _constants.AUTO_CLOSE.NEVER || autoclose === _constants.AUTO_CLOSE.DISABLED) return;
|
|
715
|
+
var handleOutsideClick = function handleOutsideClick(event) {
|
|
716
|
+
var _menuRef$current, _buttonRef$current2;
|
|
717
|
+
if (!event.target) return;
|
|
718
|
+
var clickedInsideMenu = (_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : _menuRef$current.contains(event.target);
|
|
719
|
+
var clickedOnButton = (_buttonRef$current2 = buttonRef.current) === null || _buttonRef$current2 === void 0 ? void 0 : _buttonRef$current2.contains(event.target);
|
|
720
|
+
if (!clickedInsideMenu && !clickedOnButton) {
|
|
721
|
+
var _buttonRef$current3;
|
|
722
|
+
setOpen(false);
|
|
723
|
+
setFocusedIndex(-1);
|
|
724
|
+
setActiveItem(null);
|
|
725
|
+
(_buttonRef$current3 = buttonRef.current) === null || _buttonRef$current3 === void 0 || _buttonRef$current3.focus();
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
document.addEventListener("mousedown", handleOutsideClick);
|
|
729
|
+
return function () {
|
|
730
|
+
document.removeEventListener("mousedown", handleOutsideClick);
|
|
731
|
+
};
|
|
732
|
+
}, [open, autoclose]);
|
|
733
|
+
(0, _react.useEffect)(function () {
|
|
734
|
+
if (!shortcutkey) return;
|
|
735
|
+
var handleShortcutKey = function handleShortcutKey(event) {
|
|
736
|
+
var isModifierKey = event.altKey || navigator.platform.indexOf("Mac") !== -1 && event.ctrlKey && event.altKey;
|
|
737
|
+
if (isModifierKey && event.key.toLowerCase() === shortcutkey.toLowerCase()) {
|
|
738
|
+
var _buttonRef$current4;
|
|
739
|
+
event.preventDefault();
|
|
740
|
+
setOpen(function (prev) {
|
|
741
|
+
return !prev;
|
|
742
|
+
});
|
|
743
|
+
(_buttonRef$current4 = buttonRef.current) === null || _buttonRef$current4 === void 0 || _buttonRef$current4.focus();
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
window.addEventListener("keydown", handleShortcutKey);
|
|
747
|
+
return function () {
|
|
748
|
+
window.removeEventListener("keydown", handleShortcutKey);
|
|
749
|
+
};
|
|
750
|
+
}, [shortcutkey]);
|
|
751
|
+
|
|
752
|
+
// Fallback: run action task once when nodes$ is absent and an active item exists in the dataset
|
|
753
|
+
var executedInitialActiveRef = (0, _react.useRef)(false);
|
|
754
|
+
(0, _react.useEffect)(function () {
|
|
755
|
+
if (nodes$ && typeof nodes$.subscribe === "function") return; // nodes$ flow will handle it
|
|
756
|
+
if (executedInitialActiveRef.current) return;
|
|
757
|
+
if (!transformedDataset || transformedDataset.length === 0) return;
|
|
758
|
+
var itemFound = false;
|
|
759
|
+
var _getItem = function getItem(nodes) {
|
|
760
|
+
if (!nodes || !Array.isArray(nodes)) return;
|
|
761
|
+
nodes.forEach(function (item) {
|
|
762
|
+
var _dataObject2;
|
|
763
|
+
if (itemFound) return;
|
|
764
|
+
if (item !== null && item !== void 0 && item.isactive || item !== null && item !== void 0 && (_dataObject2 = item.dataObject) !== null && _dataObject2 !== void 0 && _dataObject2.isactive) {
|
|
765
|
+
itemFound = true;
|
|
766
|
+
if (listener !== null && listener !== void 0 && listener.Widgets && name && onSelect) {
|
|
767
|
+
var widget = listener.Widgets[name];
|
|
768
|
+
if (widget) {
|
|
769
|
+
onSelect({}, widget, item);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
(0, _actionTask.executeActionTaskFromItem)(item, listener);
|
|
773
|
+
}
|
|
774
|
+
if (item.children && !(0, _lodash.isEmpty)(item.children)) {
|
|
775
|
+
_getItem(item.children);
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
};
|
|
779
|
+
_getItem(transformedDataset);
|
|
780
|
+
if (itemFound) {
|
|
781
|
+
executedInitialActiveRef.current = true;
|
|
782
|
+
}
|
|
783
|
+
}, []);
|
|
784
|
+
(0, _react.useEffect)(function () {
|
|
785
|
+
if (!nodes$ || typeof nodes$.subscribe !== "function") return;
|
|
786
|
+
var datasetSubscription = nodes$.subscribe(function () {
|
|
787
|
+
if (!dataset) return;
|
|
788
|
+
var itemFound = false;
|
|
789
|
+
var _getItem2 = function getItem(nodes) {
|
|
790
|
+
if (!nodes || !Array.isArray(nodes)) return;
|
|
791
|
+
nodes.forEach(function (item) {
|
|
792
|
+
if (itemFound) return;
|
|
793
|
+
if (item.isactive) {
|
|
794
|
+
itemFound = true;
|
|
795
|
+
if (listener !== null && listener !== void 0 && listener.Widgets && name && onSelect) {
|
|
796
|
+
var widget = listener.Widgets[name];
|
|
797
|
+
if (widget) {
|
|
798
|
+
onSelect({}, widget, item);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return false;
|
|
802
|
+
}
|
|
803
|
+
if (item.children && !(0, _lodash.isEmpty)(item.children)) {
|
|
804
|
+
_getItem2(item.children);
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
_getItem2(dataset);
|
|
809
|
+
});
|
|
810
|
+
return function () {
|
|
811
|
+
if (datasetSubscription && typeof datasetSubscription.unsubscribe === "function") {
|
|
812
|
+
datasetSubscription.unsubscribe();
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
}, [dataset, nodes$, name, listener, onSelect]);
|
|
816
|
+
|
|
817
|
+
// ============ Exposed Methods Implementation ============
|
|
818
|
+
// 1. onShow - Lifecycle callback triggered when menu opens
|
|
819
|
+
var onShowCallback = (0, _react.useCallback)(function () {
|
|
820
|
+
// Similar to Angular's @HostListener('onShown') - lines 121-129
|
|
821
|
+
// Focus first item if opened via keyboard
|
|
822
|
+
if (open && flattenedNodes.length > 0 && focusedIndex === 0) {
|
|
823
|
+
setTimeout(function () {
|
|
824
|
+
var _flattenedNodes$;
|
|
825
|
+
(_flattenedNodes$ = flattenedNodes[0]) === null || _flattenedNodes$ === void 0 || (_flattenedNodes$ = _flattenedNodes$.nodeRef) === null || _flattenedNodes$ === void 0 || (_flattenedNodes$ = _flattenedNodes$.current) === null || _flattenedNodes$ === void 0 || _flattenedNodes$.focus();
|
|
826
|
+
}, 0);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
// add the open class to the menu
|
|
830
|
+
setOpen(true);
|
|
831
|
+
}, [open, flattenedNodes, focusedIndex, props, listener, name]);
|
|
832
|
+
|
|
833
|
+
// 2. onHide - Lifecycle callback triggered when menu closes
|
|
834
|
+
var onHideCallback = (0, _react.useCallback)(function () {
|
|
835
|
+
// Similar to Angular's @HostListener('onHidden') - lines 130-137
|
|
836
|
+
// Reset menu state
|
|
837
|
+
setFocusedIndex(-1);
|
|
838
|
+
setActiveItem(null);
|
|
839
|
+
|
|
840
|
+
// Reset menuposition to original value
|
|
841
|
+
setMenuPosition(initialMenuPosition);
|
|
842
|
+
|
|
843
|
+
// remove the open class from the menu
|
|
844
|
+
setOpen(false);
|
|
845
|
+
}, [initialMenuPosition, props, listener, name]);
|
|
846
|
+
|
|
847
|
+
// 3. resetNodes - Method to reset/rebuild menu items
|
|
848
|
+
var resetNodesMethod = (0, _react.useCallback)(function () {
|
|
849
|
+
// Similar to Angular's resetNodes() - lines 227-233
|
|
850
|
+
// Call the parent resetNavNodes if available
|
|
851
|
+
if (resetNavNodes) {
|
|
852
|
+
resetNavNodes();
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Auto-open logic from Angular implementation
|
|
856
|
+
if (autoopen === _constants.AUTO_OPEN.ACTIVE_PAGE && _hasLinkToCurrentPage(transformedDataset, path)) {
|
|
857
|
+
setOpen(true);
|
|
858
|
+
} else if (autoopen === _constants.AUTO_OPEN.ALWAYS) {
|
|
859
|
+
setOpen(true);
|
|
860
|
+
}
|
|
861
|
+
}, [resetNavNodes, autoopen, transformedDataset, path]);
|
|
862
|
+
|
|
863
|
+
// 4. setMenuPosition - Method to programmatically change menu position
|
|
864
|
+
var setMenuPositionMethod = (0, _react.useCallback)(function (position) {
|
|
865
|
+
// Similar to Angular's setMenuPosition() - lines 261-287
|
|
866
|
+
var validPositions = [_constants.POSITION.DOWN_RIGHT, _constants.POSITION.DOWN_LEFT, _constants.POSITION.UP_RIGHT, _constants.POSITION.UP_LEFT, _constants.POSITION.INLINE];
|
|
867
|
+
if (validPositions.includes(position)) {
|
|
868
|
+
setMenuPosition(position);
|
|
869
|
+
} else {
|
|
870
|
+
console.warn("Invalid menu position: ".concat(position, ". Valid positions are: ").concat(validPositions.join(", ")));
|
|
871
|
+
}
|
|
872
|
+
}, []);
|
|
873
|
+
|
|
874
|
+
// 5. onKeyDown - Expose keyboard handler
|
|
875
|
+
var onKeyDownMethod = (0, _react.useCallback)(function (event, eventAction) {
|
|
876
|
+
// Similar to Angular's onKeyDown($event, eventAction) - lines 145-173
|
|
877
|
+
// This matches Angular's signature: onKeyDown($event, eventAction)
|
|
878
|
+
if (eventAction) {
|
|
879
|
+
// Handle specific event action if provided
|
|
880
|
+
}
|
|
881
|
+
handleKeyDown(event);
|
|
882
|
+
}, [handleKeyDown]);
|
|
883
|
+
|
|
884
|
+
// 6. onMenuItemSelect - Expose menu item select handler
|
|
885
|
+
var onMenuItemSelectMethod = (0, _react.useCallback)(function (event, item) {
|
|
886
|
+
var _listener$Widgets;
|
|
887
|
+
// Similar to Angular's onMenuItemSelect(args) - lines 289-293
|
|
888
|
+
// This matches Angular's signature: onMenuItemSelect({ $event, $item })
|
|
889
|
+
if (onSelect && listener !== null && listener !== void 0 && (_listener$Widgets = listener.Widgets) !== null && _listener$Widgets !== void 0 && _listener$Widgets[name]) {
|
|
890
|
+
onSelect(event, listener.Widgets[name], item);
|
|
891
|
+
}
|
|
892
|
+
}, [onSelect, listener, name]);
|
|
893
|
+
|
|
894
|
+
// ============ Expose Methods to Widget Proxy ============
|
|
895
|
+
// This makes methods accessible via Page.Widgets.menu4.methodName
|
|
896
|
+
(0, _react.useEffect)(function () {
|
|
897
|
+
if (listener !== null && listener !== void 0 && listener.onChange && name) {
|
|
898
|
+
Object.defineProperty(onShowCallback, "name", {
|
|
899
|
+
value: "onShow",
|
|
900
|
+
writable: false
|
|
901
|
+
});
|
|
902
|
+
Object.defineProperty(onHideCallback, "name", {
|
|
903
|
+
value: "onHide",
|
|
904
|
+
writable: false
|
|
905
|
+
});
|
|
906
|
+
Object.defineProperty(onKeyDownMethod, "name", {
|
|
907
|
+
value: "onKeyDown",
|
|
908
|
+
writable: false
|
|
909
|
+
});
|
|
910
|
+
Object.defineProperty(resetNodesMethod, "name", {
|
|
911
|
+
value: "resetNodes",
|
|
912
|
+
writable: false
|
|
913
|
+
});
|
|
914
|
+
Object.defineProperty(setMenuPositionMethod, "name", {
|
|
915
|
+
value: "setMenuPosition",
|
|
916
|
+
writable: false
|
|
917
|
+
});
|
|
918
|
+
Object.defineProperty(onMenuItemSelectMethod, "name", {
|
|
919
|
+
value: "onMenuItemSelect",
|
|
920
|
+
writable: false
|
|
921
|
+
});
|
|
922
|
+
listener.onChange(name, {
|
|
923
|
+
onShow: onShowCallback,
|
|
924
|
+
onHide: onHideCallback,
|
|
925
|
+
onKeyDown: onKeyDownMethod,
|
|
926
|
+
resetNodes: resetNodesMethod,
|
|
927
|
+
setMenuPosition: setMenuPositionMethod,
|
|
928
|
+
onMenuItemSelect: onMenuItemSelectMethod
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
}, []);
|
|
932
|
+
|
|
933
|
+
// Memoized class names and styles
|
|
934
|
+
var _menuPosition$split3 = menuPosition.split(","),
|
|
935
|
+
_menuPosition$split4 = (0, _slicedToArray2["default"])(_menuPosition$split3, 2),
|
|
936
|
+
verticalPos = _menuPosition$split4[0],
|
|
937
|
+
horizontalPos = _menuPosition$split4[1];
|
|
938
|
+
var mainMenuClassName = (0, _react.useMemo)(function () {
|
|
939
|
+
return (0, _ListItems.buildMenuListClasses)(iconposition, menulayout, horizontalPos, panelPosition, animateitems, menuPosition);
|
|
940
|
+
}, [iconposition, menulayout, horizontalPos, panelPosition, animateitems, menuPosition]);
|
|
941
|
+
var hoverEventHandlers = showonhover ? {
|
|
942
|
+
onMouseEnter: handleContainerMouseEnter,
|
|
943
|
+
onMouseLeave: handleContainerMouseLeave
|
|
944
|
+
} : {};
|
|
945
|
+
|
|
946
|
+
// Render
|
|
947
|
+
return __jsx("div", (0, _extends2["default"])({
|
|
948
|
+
caption: caption,
|
|
949
|
+
ref: menuRef,
|
|
950
|
+
className: (0, _clsx["default"])("dropdown", "app-menu", {
|
|
951
|
+
open: open
|
|
952
|
+
}, className)
|
|
953
|
+
}, hoverEventHandlers, {
|
|
954
|
+
onKeyDown: handleKeyDown,
|
|
955
|
+
role: "menu",
|
|
956
|
+
"aria-label": arialabel || "Menu",
|
|
957
|
+
"aria-expanded": open,
|
|
958
|
+
type: type,
|
|
959
|
+
name: name
|
|
960
|
+
}), __jsx(_Tooltip["default"], {
|
|
961
|
+
title: hint || "",
|
|
962
|
+
enterDelay: _constants.TOOLTIP_ENTER_DELAY,
|
|
963
|
+
disableHoverListener: !hint
|
|
964
|
+
}, type === "anchor" ? __jsx("a", (0, _extends2["default"])({
|
|
965
|
+
className: (0, _clsx["default"])("dropdown-toggle app-anchor", isNavItemActive && "active"),
|
|
966
|
+
"icon-position": "left",
|
|
967
|
+
role: "button",
|
|
968
|
+
onClick: handleMenuClick,
|
|
969
|
+
"aria-label": arialabel || "Menu",
|
|
970
|
+
"aria-expanded": open,
|
|
971
|
+
"aria-haspopup": "true",
|
|
972
|
+
accessKey: shortcutkey,
|
|
973
|
+
tabIndex: props.tabindex,
|
|
974
|
+
style: {
|
|
975
|
+
width: width !== undefined ? typeof width === "number" ? "".concat(width, "px") : width : undefined,
|
|
976
|
+
height: height !== undefined ? typeof height === "number" ? "".concat(height, "px") : height : undefined,
|
|
977
|
+
textAlign: menualign
|
|
978
|
+
}
|
|
979
|
+
}, (0, _attr.removeInvalidAttributes)(restProps)), iconclass && __jsx("i", {
|
|
980
|
+
className: (0, _clsx["default"])("app-icon", iconclass),
|
|
981
|
+
"aria-hidden": "true"
|
|
982
|
+
}), __jsx("span", {
|
|
983
|
+
className: "sr-only"
|
|
984
|
+
}, "".concat(caption, " ").concat(listener === null || listener === void 0 || (_listener$appLocale = listener.appLocale) === null || _listener$appLocale === void 0 ? void 0 : _listener$appLocale.LABEL_ICON)), __jsx("span", {
|
|
985
|
+
className: "anchor-caption"
|
|
986
|
+
}, caption || ""), __jsx("span", {
|
|
987
|
+
className: (0, _clsx["default"])("pull-right caret fa", menuPosition !== null && menuPosition !== void 0 && menuPosition.startsWith("up") ? _constants.CARET_CLS.UP : _constants.CARET_CLS.DOWN)
|
|
988
|
+
})) : __jsx(_Button["default"], (0, _extends2["default"])({
|
|
989
|
+
className: (0, _clsx["default"])("btn dropdown-toggle", "icon-position-".concat(iconposition), "app-button", menuclass, "menu-layout-".concat(menulayout), "menu-align-".concat(menualign), open ? "open" : "", menuPosition !== null && menuPosition !== void 0 && menuPosition.startsWith("up") ? "dropup" : "", menuPosition === _constants.POSITION.INLINE ? "dropinline-menu" : ""),
|
|
990
|
+
ref: buttonRef,
|
|
991
|
+
onClick: handleMenuClick,
|
|
992
|
+
"aria-haspopup": "true",
|
|
993
|
+
"aria-expanded": open,
|
|
994
|
+
"aria-label": arialabel || "Menu",
|
|
995
|
+
accessKey: shortcutkey,
|
|
996
|
+
tabIndex: props.tabindex,
|
|
997
|
+
style: _objectSpread(_objectSpread({
|
|
998
|
+
width: width !== undefined ? typeof width === "number" ? "".concat(width, "px") : width : undefined,
|
|
999
|
+
height: height !== undefined ? typeof height === "number" ? "".concat(height, "px") : height : undefined
|
|
1000
|
+
}, buttonStyles), menuContainerStyles)
|
|
1001
|
+
}, (0, _attr.removeInvalidAttributes)(restProps)), iconclass && __jsx("i", {
|
|
1002
|
+
className: (0, _clsx["default"])("app-icon", iconclass),
|
|
1003
|
+
"aria-hidden": "true"
|
|
1004
|
+
}), __jsx("span", {
|
|
1005
|
+
className: "btn-caption"
|
|
1006
|
+
}, caption), __jsx("span", {
|
|
1007
|
+
className: (0, _clsx["default"])("pull-right caret fa", menuPosition !== null && menuPosition !== void 0 && menuPosition.startsWith("up") ? _constants.CARET_CLS.UP : _constants.CARET_CLS.DOWN)
|
|
1008
|
+
}))), type !== "anchor" ? __jsx(_ListItems.CollapsibleMenu, (0, _extends2["default"])({
|
|
1009
|
+
isOpen: open,
|
|
1010
|
+
verticalPos: verticalPos,
|
|
1011
|
+
className: mainMenuClassName,
|
|
1012
|
+
style: getMenuLayoutStyles()
|
|
1013
|
+
}, hoverEventHandlers), renderMenuItems(nodesWithRefs)) : open && __jsx(_ListItems.MenuList, (0, _extends2["default"])({
|
|
1014
|
+
iconposition: iconposition,
|
|
1015
|
+
className: mainMenuClassName,
|
|
1016
|
+
style: getMenuLayoutStyles()
|
|
1017
|
+
}, hoverEventHandlers), renderMenuItems(nodesWithRefs)));
|
|
1018
|
+
});
|
|
1019
|
+
WmMenu.displayName = "WmMenu";
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* The WmMenu component renders a navigation menu with support for hierarchical items,
|
|
1023
|
+
* dataset binding, role-based filtering, and configurable layout/position.
|
|
1024
|
+
*
|
|
1025
|
+
* - [Playground](https://react-components.wavemaker.ai/?path=/story/navigation-menu--showcase)
|
|
1026
|
+
*
|
|
1027
|
+
* - [Docs](https://react-components.wavemaker.ai/?path=/story/navigation-menu--docs)
|
|
1028
|
+
*
|
|
1029
|
+
* @param props - {@link WmMenuExtendedProps}
|
|
1030
|
+
*/
|
|
1031
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmMenu);
|