@wavemaker/react-runtime 11.14.1-16.6404
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.js +32 -0
- package/actions/login-action.js +53 -0
- package/actions/logout-action.js +41 -0
- package/actions/navigation-action.js +145 -0
- package/actions/notification-action.js +147 -0
- package/actions/timer-action.js +164 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.js +115 -0
- package/actions/toast.service.js +94 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.js +456 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.js +72 -0
- package/components/advanced/login/index.js +307 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.js +158 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.js +239 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.js +61 -0
- package/components/basic/html/index.js +158 -0
- package/components/basic/icon/index.js +85 -0
- package/components/basic/iframe/iframe.utils.js +10 -0
- package/components/basic/iframe/index.js +95 -0
- package/components/basic/label/index.js +139 -0
- package/components/basic/message/index.js +120 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.js +117 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.js +168 -0
- package/components/basic/progress-bar/props.js +18 -0
- package/components/basic/progress-circle/index.js +196 -0
- package/components/basic/progress-circle/props.js +16 -0
- package/components/basic/richtexteditor/index.js +533 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.js +1023 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.js +350 -0
- package/components/basic/spinner/index.js +202 -0
- package/components/basic/spinner/props.js +12 -0
- package/components/basic/tile/index.js +91 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +142 -0
- package/components/basic/tree/index.js +503 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.js +154 -0
- package/components/basic/video/index.js +85 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/components/barColumnChart/index.js +132 -0
- package/components/chart/components/barColumnChart/props.js +5 -0
- package/components/chart/components/bubbleChart/index.js +176 -0
- package/components/chart/components/bubbleChart/props.js +5 -0
- package/components/chart/components/chartLegend/components/ClassicLegendItem.js +39 -0
- package/components/chart/components/chartLegend/components/FuriousLegendItem.js +81 -0
- package/components/chart/components/chartLegend/index.js +69 -0
- package/components/chart/components/chartLegend/props.js +5 -0
- package/components/chart/components/chartLegend/utils.js +31 -0
- package/components/chart/components/chartTooltip/index.js +53 -0
- package/components/chart/components/chartTooltip/styles.js +37 -0
- package/components/chart/components/chartTooltip/utils.js +23 -0
- package/components/chart/components/cumulativeLineChart/index.js +113 -0
- package/components/chart/components/cumulativeLineChart/props.js +5 -0
- package/components/chart/components/cumulativeLineChart/utils.js +34 -0
- package/components/chart/components/index.js +40 -0
- package/components/chart/components/lineAreaChart/index.js +140 -0
- package/components/chart/components/lineAreaChart/props.js +5 -0
- package/components/chart/components/noDataMessage/index.js +27 -0
- package/components/chart/components/pieDonutChart/index.js +171 -0
- package/components/chart/components/pieDonutChart/props.js +5 -0
- package/components/chart/constant.js +72 -0
- package/components/chart/index.js +930 -0
- package/components/chart/props.js +5 -0
- package/components/chart/utils.js +691 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.js +12 -0
- package/components/constants.js +1208 -0
- package/components/container/accordion/accordion-pane/index.js +108 -0
- package/components/container/accordion/accordion-pane/props.js +11 -0
- package/components/container/accordion/index.js +232 -0
- package/components/container/accordion/props.js +13 -0
- package/components/container/alignment-utils.js +183 -0
- package/components/container/index.js +188 -0
- package/components/container/layout-grid/grid-column/index.js +34 -0
- package/components/container/layout-grid/grid-row/index.js +24 -0
- package/components/container/layout-grid/index.js +33 -0
- package/components/container/linear-layout/index.js +72 -0
- package/components/container/linear-layout/linear-layout-item/index.js +43 -0
- package/components/container/panel/components/panel-header/index.js +144 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.js +286 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.js +5 -0
- package/components/container/tabs/index.js +379 -0
- package/components/container/tabs/props.js +20 -0
- package/components/container/tabs/tab-pane/index.js +42 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.js +100 -0
- package/components/container/wizard/components/WizardStep.js +89 -0
- package/components/container/wizard/index.js +710 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.js +133 -0
- package/components/container/wizard/wizard-action/index.js +22 -0
- package/components/container/wizard/wizard-step/index.js +94 -0
- package/components/data/card/card-actions/index.js +24 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.js +24 -0
- package/components/data/card/index.js +246 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/index.js +460 -0
- package/components/data/form/base-form/props.js +29 -0
- package/components/data/form/base-form/utils.js +42 -0
- package/components/data/form/dynamic-fields/index.js +196 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.js +237 -0
- package/components/data/form/form-action/index.js +71 -0
- package/components/data/form/form-body/index.js +26 -0
- package/components/data/form/form-context.js +34 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/validation-contrustor.js +313 -0
- package/components/data/form/form-controller/withFormController.js +320 -0
- package/components/data/form/form-field/base-field.js +138 -0
- package/components/data/form/form-field/index.js +36 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.js +26 -0
- package/components/data/form/form-header/index.js +56 -0
- package/components/data/form/index.js +39 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.js +98 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.js +241 -0
- package/components/data/list/components/ListHeader.js +59 -0
- package/components/data/list/components/ListItem.js +148 -0
- package/components/data/list/components/ListItemWithTemplate.js +59 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.js +165 -0
- package/components/data/list/components/LoadMoreButton.js +39 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.js +84 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.js +285 -0
- package/components/data/list/hooks/useListEventHandlers.js +291 -0
- package/components/data/list/hooks/useListPagination.js +168 -0
- package/components/data/list/hooks/useListState.js +98 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +121 -0
- package/components/data/list/index.js +611 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.js +53 -0
- package/components/data/list/utils/constants.js +81 -0
- package/components/data/list/utils/list-helpers.js +173 -0
- package/components/data/list/utils/list-widget-methods.js +114 -0
- package/components/data/live-filter/index.js +279 -0
- package/components/data/live-filter/props.js +12 -0
- package/components/data/live-form/index.js +93 -0
- package/components/data/live-form/props.js +16 -0
- package/components/data/pagination/components/BasicPagination.js +77 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.js +175 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.js +52 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.js +796 -0
- package/components/data/pagination/index.js +322 -0
- package/components/data/table/components/AddNewRow.js +190 -0
- package/components/data/table/components/EditableCell.js +91 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/TableBody.js +279 -0
- package/components/data/table/components/TableFilters.js +325 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.js +174 -0
- package/components/data/table/components/TablePanelHeading.js +68 -0
- package/components/data/table/components/index.js +74 -0
- package/components/data/table/hooks/index.js +219 -0
- package/components/data/table/hooks/useCellState.js +117 -0
- package/components/data/table/hooks/useDynamicColumns.js +85 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.js +184 -0
- package/components/data/table/hooks/usePaginationState.js +60 -0
- package/components/data/table/hooks/usePanelStructure.js +40 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.js +110 -0
- package/components/data/table/hooks/useRowHandlers.js +38 -0
- package/components/data/table/hooks/useRowSelection.js +213 -0
- package/components/data/table/hooks/useServerSideSorting.js +165 -0
- package/components/data/table/hooks/useTableColumns.js +263 -0
- package/components/data/table/hooks/useTableData.js +154 -0
- package/components/data/table/hooks/useTableEdit.js +467 -0
- package/components/data/table/hooks/useTableEffects.js +139 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.js +103 -0
- package/components/data/table/hooks/useTableState.js +69 -0
- package/components/data/table/hooks/useTableStateManager.js +558 -0
- package/components/data/table/index.js +1295 -0
- package/components/data/table/live-table/index.js +232 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.js +78 -0
- package/components/data/table/table-column/index.js +35 -0
- package/components/data/table/table-row/index.js +49 -0
- package/components/data/table/table-row-action/index.js +74 -0
- package/components/data/table/utils/buildSelectionColumns.js +173 -0
- package/components/data/table/utils/columnBuilder.js +209 -0
- package/components/data/table/utils/columnProxy.js +48 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.js +80 -0
- package/components/data/table/utils/crud-handlers.js +518 -0
- package/components/data/table/utils/dynamic-columns.js +118 -0
- package/components/data/table/utils/index.js +607 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/selectionUtils.js +166 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.js +124 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.js +80 -0
- package/components/dialogs/confirm-dialog/index.js +105 -0
- package/components/dialogs/dialog/index.js +56 -0
- package/components/dialogs/dialog-actions/index.js +18 -0
- package/components/dialogs/dialog-body/index.js +21 -0
- package/components/dialogs/dialog-content/index.js +30 -0
- package/components/dialogs/dialog-header/index.js +93 -0
- package/components/dialogs/iframe-dialog/index.js +114 -0
- package/components/dialogs/index.js +129 -0
- package/components/dialogs/login-dialog/index.js +369 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.js +96 -0
- package/components/dialogs/withDialogWrapper.js +108 -0
- package/components/form/button/index.js +216 -0
- package/components/form/button-group/index.js +60 -0
- package/components/input/calendar/index.js +546 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.js +340 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.js +488 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.js +259 -0
- package/components/input/color-picker/index.js +678 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.js +137 -0
- package/components/input/currency/index.js +263 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.js +230 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.js +476 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/radioset/index.js +379 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.js +490 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +220 -0
- package/components/input/epoch/date/index.js +520 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.js +108 -0
- package/components/input/epoch/datetime/index.js +656 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/datetime/utils.js +244 -0
- package/components/input/epoch/time/index.js +412 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.js +209 -0
- package/components/input/fileupload/Utils.js +134 -0
- package/components/input/fileupload/components/ListItems.js +140 -0
- package/components/input/fileupload/components/MultiUpload.js +85 -0
- package/components/input/fileupload/components/SingleUpload.js +65 -0
- package/components/input/fileupload/index.js +170 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.js +400 -0
- package/components/input/number/index.js +295 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.js +368 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.js +344 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.js +167 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.js +434 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.js +179 -0
- package/components/input/textarea/index.js +347 -0
- package/components/input/textarea/props.js +5 -0
- package/components/layout/footer/index.js +30 -0
- package/components/layout/header/index.js +30 -0
- package/components/layout/leftnav/index.js +44 -0
- package/components/layout/rightnav/index.js +32 -0
- package/components/layout/topnav/index.js +34 -0
- package/components/navbar/index.js +41 -0
- package/components/navbar/nav/index.js +102 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.js +44 -0
- package/components/navigation/breadcrumb/index.js +56 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.js +66 -0
- package/components/navigation/menu/constants.js +101 -0
- package/components/navigation/menu/index.js +807 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/popover/index.js +209 -0
- package/components/navigation/popover/props.js +15 -0
- package/components/page/content/index.js +28 -0
- package/components/page/error-boundary/index.js +108 -0
- package/components/page/index.js +137 -0
- package/components/page/page-content/index.js +23 -0
- package/components/page/partial/index.js +36 -0
- package/components/page/partial-container/index.js +48 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.js +33 -0
- package/components/prefab/container/index.js +46 -0
- package/components/prefab/index.js +67 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LocalizationProvider.js +79 -0
- package/context/PrefabContext.js +66 -0
- package/context/WidgetProvider.js +187 -0
- package/core/app-config.js +1 -0
- package/core/app.service.js +357 -0
- package/core/appVariablesStore.js +20 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.js +34 -0
- package/core/constants/index.js +27 -0
- package/core/dialog.service.js +76 -0
- package/core/event-notifier.js +151 -0
- package/core/formatter/date-formatters.js +222 -0
- package/core/formatter/index.js +131 -0
- package/core/formatter/number-formatters.js +142 -0
- package/core/formatter/security-formatters.js +323 -0
- package/core/formatter/string-formatters.js +52 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.js +412 -0
- package/core/script-registry.js +63 -0
- package/core/security.service.js +11 -0
- package/core/util/common.js +33 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.js +136 -0
- package/core/util/security.js +184 -0
- package/core/util/utils.js +189 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.js +430 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.js +251 -0
- package/higherOrder/BasePage.js +715 -0
- package/higherOrder/BasePartial.js +124 -0
- package/higherOrder/BasePrefab.js +145 -0
- package/higherOrder/DataNav.js +377 -0
- package/higherOrder/helper.js +43 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.js +183 -0
- package/hooks/useAccess.js +308 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.js +562 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.js +338 -0
- package/libs/index.js +20 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.js +371 -0
- package/package-lock.json +10177 -0
- package/package.json +95 -0
- package/store/index.js +33 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/slices/appConfigSlice.js +103 -0
- package/store/slices/authSlice.js +508 -0
- package/store/slices/i18nSlice.js +206 -0
- package/types/index.js +15 -0
- package/utils/dataset-util.js +174 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.js +140 -0
- package/utils/form-utils.js +187 -0
- package/utils/format-util.js +260 -0
- package/utils/page-params-util.js +24 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.js +343 -0
- package/utils/style-utils.js +73 -0
- package/utils/transformedDataset-utils.js +633 -0
- package/utils/widget-cleanup-util.js +84 -0
- package/utils/widgets.js +99 -0
- package/variables/base-variable.js +173 -0
- package/variables/constants.js +27 -0
- package/variables/live-variable.js +166 -0
- package/variables/model-variable.js +77 -0
- package/variables/service-variable.js +307 -0
|
@@ -0,0 +1,379 @@
|
|
|
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.useTabsContext = exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
|
+
var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
|
|
14
|
+
var _tabs = require("@base-ui-components/react/tabs");
|
|
15
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
16
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
17
|
+
var _tabPane = _interopRequireDefault(require("@wavemaker/react-runtime/components/container/tabs/tab-pane"));
|
|
18
|
+
var _props = require("./props");
|
|
19
|
+
var _statePersistance = require("@wavemaker/react-runtime/utils/state-persistance");
|
|
20
|
+
var _isArray = _interopRequireDefault(require("lodash-es/isArray"));
|
|
21
|
+
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); }
|
|
22
|
+
var __jsx = _react["default"].createElement;
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
var DEFAULT_CLASS = "nav nav-tabs";
|
|
26
|
+
|
|
27
|
+
// Helper function to check if a component is WmTabPane
|
|
28
|
+
var isTabPaneComponent = function isTabPaneComponent(child) {
|
|
29
|
+
var _child$type;
|
|
30
|
+
var displayName = child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 || (_child$type = _child$type.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName;
|
|
31
|
+
return displayName && (displayName.includes("WmTabpane") || displayName.includes("WmTabPane"));
|
|
32
|
+
};
|
|
33
|
+
var TabsContext = /*#__PURE__*/(0, _react.createContext)({
|
|
34
|
+
selectedIndex: 0,
|
|
35
|
+
setSelectedIndex: function setSelectedIndex() {}
|
|
36
|
+
});
|
|
37
|
+
var useTabsContext = exports.useTabsContext = function useTabsContext() {
|
|
38
|
+
return (0, _react.useContext)(TabsContext);
|
|
39
|
+
};
|
|
40
|
+
var WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
41
|
+
var props = _objectSpread(_objectSpread({}, _props.DEFAULT_PROPS), Props);
|
|
42
|
+
|
|
43
|
+
// Destructure all used props
|
|
44
|
+
var defaultpaneindex = props.defaultpaneindex,
|
|
45
|
+
statehandler = props.statehandler,
|
|
46
|
+
name = props.name,
|
|
47
|
+
listener = props.listener,
|
|
48
|
+
type = props.type,
|
|
49
|
+
dataset = props.dataset,
|
|
50
|
+
children = props.children,
|
|
51
|
+
render = props.render,
|
|
52
|
+
iconposition = props.iconposition,
|
|
53
|
+
_props$tabsposition = props.tabsposition,
|
|
54
|
+
tabsposition = _props$tabsposition === void 0 ? "top" : _props$tabsposition,
|
|
55
|
+
justified = props.justified,
|
|
56
|
+
nodatamessage = props.nodatamessage,
|
|
57
|
+
styles = props.styles,
|
|
58
|
+
className = props.className,
|
|
59
|
+
onChange = props.onChange;
|
|
60
|
+
var panesCount = (0, _react.useRef)(0);
|
|
61
|
+
var prevSelectedIndex = (0, _react.useRef)(null);
|
|
62
|
+
var currentSelectedIndex = (0, _react.useRef)(defaultpaneindex || 0);
|
|
63
|
+
var _useState = (0, _react.useState)(defaultpaneindex || 0),
|
|
64
|
+
selectedIndex = _useState[0],
|
|
65
|
+
setSelectedIndex = _useState[1];
|
|
66
|
+
|
|
67
|
+
// Keep currentSelectedIndex ref in sync with state
|
|
68
|
+
(0, _react.useEffect)(function () {
|
|
69
|
+
currentSelectedIndex.current = selectedIndex;
|
|
70
|
+
}, [selectedIndex]);
|
|
71
|
+
|
|
72
|
+
// Helper function to change tab with proper state management
|
|
73
|
+
var changeTab = function changeTab(newIndex) {
|
|
74
|
+
if (newIndex >= 0 && newIndex < panesCount.current && newIndex !== currentSelectedIndex.current) {
|
|
75
|
+
prevSelectedIndex.current = currentSelectedIndex.current;
|
|
76
|
+
setSelectedIndex(newIndex);
|
|
77
|
+
saveStateToStorage(newIndex);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// go to previous tab - using useCallback to ensure fresh closure
|
|
84
|
+
var prev = _react["default"].useCallback(function () {
|
|
85
|
+
var currentIndex = currentSelectedIndex.current;
|
|
86
|
+
var targetIndex = currentIndex - 1;
|
|
87
|
+
if (targetIndex >= 0) {
|
|
88
|
+
changeTab(targetIndex);
|
|
89
|
+
} else {
|
|
90
|
+
// Wrap around to the last tab when at the first tab
|
|
91
|
+
changeTab(panesCount.current - 1);
|
|
92
|
+
}
|
|
93
|
+
}, []);
|
|
94
|
+
|
|
95
|
+
// go to next tab - using useCallback to ensure fresh closure
|
|
96
|
+
var next = _react["default"].useCallback(function () {
|
|
97
|
+
var currentIndex = currentSelectedIndex.current;
|
|
98
|
+
var targetIndex = currentIndex + 1;
|
|
99
|
+
if (targetIndex < panesCount.current) {
|
|
100
|
+
changeTab(targetIndex);
|
|
101
|
+
} else {
|
|
102
|
+
// Wrap around to the first tab when at the last tab
|
|
103
|
+
changeTab(0);
|
|
104
|
+
}
|
|
105
|
+
}, []);
|
|
106
|
+
|
|
107
|
+
// go to specific tab - using useCallback to ensure fresh closure
|
|
108
|
+
// Accepts 1-based index (1 = first tab, 2 = second tab, etc.)
|
|
109
|
+
var _goToTab = _react["default"].useCallback(function (tabNumber) {
|
|
110
|
+
// Convert from 1-based to 0-based index
|
|
111
|
+
var index = tabNumber - 1;
|
|
112
|
+
|
|
113
|
+
// Validate the tab number is within valid range
|
|
114
|
+
if (tabNumber >= 1 && tabNumber <= panesCount.current && index !== currentSelectedIndex.current) {
|
|
115
|
+
changeTab(index);
|
|
116
|
+
}
|
|
117
|
+
}, []);
|
|
118
|
+
|
|
119
|
+
// get the current active tab name
|
|
120
|
+
var getActiveTabName = _react["default"].useCallback(function () {
|
|
121
|
+
var _activeChild$props;
|
|
122
|
+
var currentIndex = currentSelectedIndex.current;
|
|
123
|
+
if (type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) > 0) {
|
|
124
|
+
var _dataset$currentIndex;
|
|
125
|
+
return ((_dataset$currentIndex = dataset[currentIndex]) === null || _dataset$currentIndex === void 0 ? void 0 : _dataset$currentIndex.name) || null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// For static tabs, get the child at the current index
|
|
129
|
+
var childrenArray = _react["default"].Children.toArray(children);
|
|
130
|
+
var activeChild = childrenArray[currentIndex];
|
|
131
|
+
return (activeChild === null || activeChild === void 0 || (_activeChild$props = activeChild.props) === null || _activeChild$props === void 0 ? void 0 : _activeChild$props.name) || null;
|
|
132
|
+
}, [type, dataset, children]);
|
|
133
|
+
|
|
134
|
+
// get the active tab widget from listener
|
|
135
|
+
var getActiveTab = _react["default"].useCallback(function () {
|
|
136
|
+
var _listener$Widgets;
|
|
137
|
+
var activeTabName = getActiveTabName();
|
|
138
|
+
return activeTabName ? listener === null || listener === void 0 || (_listener$Widgets = listener.Widgets) === null || _listener$Widgets === void 0 ? void 0 : _listener$Widgets[activeTabName] : null;
|
|
139
|
+
}, [getActiveTabName, listener]);
|
|
140
|
+
var updateListener = function updateListener() {
|
|
141
|
+
if (listener && listener.onChange) {
|
|
142
|
+
listener.onChange(name, {
|
|
143
|
+
prev: prev,
|
|
144
|
+
next: next,
|
|
145
|
+
activeTab: getActiveTab(),
|
|
146
|
+
panes: {
|
|
147
|
+
length: panesCount.current
|
|
148
|
+
},
|
|
149
|
+
goToTab: function goToTab(tabNumber) {
|
|
150
|
+
_goToTab(tabNumber);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// register the methods
|
|
157
|
+
(0, _react.useEffect)(function () {
|
|
158
|
+
updateListener();
|
|
159
|
+
}, [prev, next, _goToTab]); // Add dependencies to ensure fresh functions
|
|
160
|
+
|
|
161
|
+
// State handler functions
|
|
162
|
+
var getStateFromStorage = function getStateFromStorage() {
|
|
163
|
+
if (!statehandler || statehandler === "none") return null;
|
|
164
|
+
return (0, _statePersistance.getWidgetState)({
|
|
165
|
+
name: name,
|
|
166
|
+
type: "tabs",
|
|
167
|
+
storage: statehandler
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
var saveStateToStorage = function saveStateToStorage(index) {
|
|
171
|
+
if (!statehandler || statehandler === "none") return;
|
|
172
|
+
(0, _statePersistance.setWidgetState)({
|
|
173
|
+
name: name,
|
|
174
|
+
type: "tabs",
|
|
175
|
+
storage: statehandler
|
|
176
|
+
}, String(index));
|
|
177
|
+
};
|
|
178
|
+
(0, _react.useEffect)(function () {
|
|
179
|
+
var targetIndex = defaultpaneindex || 0;
|
|
180
|
+
|
|
181
|
+
// Try to restore from state handler first
|
|
182
|
+
var savedState = getStateFromStorage();
|
|
183
|
+
if (savedState) {
|
|
184
|
+
targetIndex = savedState;
|
|
185
|
+
} else {
|
|
186
|
+
// Convert defaultpaneindex to number if it's a string
|
|
187
|
+
if (defaultpaneindex !== undefined) {
|
|
188
|
+
var parsedIndex = parseInt(defaultpaneindex.toString(), 10);
|
|
189
|
+
targetIndex = isNaN(parsedIndex) ? 0 : parsedIndex;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
setSelectedIndex(targetIndex);
|
|
193
|
+
currentSelectedIndex.current = targetIndex;
|
|
194
|
+
// Don't set prevSelectedIndex here as it should remain null for initial state
|
|
195
|
+
}, [defaultpaneindex, statehandler, name]);
|
|
196
|
+
|
|
197
|
+
// ============================================================================
|
|
198
|
+
// Rendering Helpers
|
|
199
|
+
// ============================================================================
|
|
200
|
+
|
|
201
|
+
var renderTabHeader = _react["default"].useCallback(function (item, index) {
|
|
202
|
+
return __jsx(_tabs.Tabs.Tab, (0, _extends2["default"])({}, item, {
|
|
203
|
+
title: item.title || item.name || "Tab ".concat(index + 1),
|
|
204
|
+
name: item.name || "Tab ".concat(index + 1),
|
|
205
|
+
key: index,
|
|
206
|
+
value: index,
|
|
207
|
+
id: "tab-".concat(index),
|
|
208
|
+
"aria-controls": "tabpanel-".concat(index),
|
|
209
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
210
|
+
className: (0, _clsx["default"])("tab-header", item.className, {
|
|
211
|
+
active: selectedIndex === index,
|
|
212
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled
|
|
213
|
+
}),
|
|
214
|
+
hidden: item.show === false,
|
|
215
|
+
role: "tab",
|
|
216
|
+
"aria-selected": selectedIndex === index,
|
|
217
|
+
tabIndex: selectedIndex === index ? 0 : -1,
|
|
218
|
+
render: function render(prop) {
|
|
219
|
+
return __jsx("li", prop, __jsx("div", {
|
|
220
|
+
style: {
|
|
221
|
+
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
222
|
+
gap: "var(--wm-anchor-gap)"
|
|
223
|
+
},
|
|
224
|
+
className: "tab-heading",
|
|
225
|
+
"icon-position": iconposition || "left",
|
|
226
|
+
title: item.title || item.name || "Tab ".concat(index + 1),
|
|
227
|
+
"aria-selected": selectedIndex === index,
|
|
228
|
+
"aria-disabled": item.disabled,
|
|
229
|
+
"aria-hidden": item.show === false,
|
|
230
|
+
"aria-controls": "tabpanel-".concat(index)
|
|
231
|
+
}, item.paneicon && __jsx("i", {
|
|
232
|
+
className: "app-icon ".concat(item.paneicon)
|
|
233
|
+
}), __jsx(_Typography["default"], {
|
|
234
|
+
variant: "body2",
|
|
235
|
+
component: "span"
|
|
236
|
+
}, item.title || item.name || "Tab ".concat(index + 1)), item.badgevalue && __jsx(_Typography["default"], {
|
|
237
|
+
variant: "body2",
|
|
238
|
+
component: "span",
|
|
239
|
+
className: "label label-".concat(item.badgetype || "default")
|
|
240
|
+
}, item.badgevalue)));
|
|
241
|
+
}
|
|
242
|
+
}));
|
|
243
|
+
}, [selectedIndex, iconposition]);
|
|
244
|
+
var renderDynamicTabs = _react["default"].useCallback(function () {
|
|
245
|
+
if (!(dataset !== null && dataset !== void 0 && dataset.length)) return null;
|
|
246
|
+
var headers = [];
|
|
247
|
+
var tabIndex = 0;
|
|
248
|
+
var addTabHeader = function addTabHeader(itemProps) {
|
|
249
|
+
headers.push(__jsx(_react["default"].Fragment, {
|
|
250
|
+
key: tabIndex
|
|
251
|
+
}, renderTabHeader(itemProps, tabIndex)));
|
|
252
|
+
tabIndex++;
|
|
253
|
+
};
|
|
254
|
+
dataset.forEach(function (item, index) {
|
|
255
|
+
if (render) {
|
|
256
|
+
var _rendered$props;
|
|
257
|
+
var rendered = render(item, index, dataset);
|
|
258
|
+
var _children = rendered === null || rendered === void 0 || (_rendered$props = rendered.props) === null || _rendered$props === void 0 ? void 0 : _rendered$props.children;
|
|
259
|
+
if ((0, _isArray["default"])(_children)) {
|
|
260
|
+
_children.filter(isTabPaneComponent).forEach(function (child) {
|
|
261
|
+
return addTabHeader(child.props);
|
|
262
|
+
});
|
|
263
|
+
} else if (_children !== null && _children !== void 0 && _children.props) {
|
|
264
|
+
addTabHeader(_children.props);
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
addTabHeader(item);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
panesCount.current = tabIndex;
|
|
271
|
+
return headers;
|
|
272
|
+
}, [dataset, render, renderTabHeader]);
|
|
273
|
+
var renderStaticTabs = _react["default"].useCallback(function () {
|
|
274
|
+
panesCount.current = _react["default"].Children.count(children);
|
|
275
|
+
return _react["default"].Children.map(children, function (child, index) {
|
|
276
|
+
if (!child) return null;
|
|
277
|
+
return __jsx(_react["default"].Fragment, {
|
|
278
|
+
key: index
|
|
279
|
+
}, renderTabHeader(child.props, index));
|
|
280
|
+
});
|
|
281
|
+
}, [children, renderTabHeader]);
|
|
282
|
+
var renderTabs = _react["default"].useMemo(function () {
|
|
283
|
+
return type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) > 0 ? renderDynamicTabs() : renderStaticTabs();
|
|
284
|
+
}, [type, dataset, renderDynamicTabs, renderStaticTabs]);
|
|
285
|
+
|
|
286
|
+
// for vertical tabs, we need to set the flex direction to row
|
|
287
|
+
var orientation = tabsposition === "left" || tabsposition === "right" ? "vertical" : "horizontal";
|
|
288
|
+
|
|
289
|
+
// Get the proper flex direction based on tab position
|
|
290
|
+
var getFlexDirection = function getFlexDirection() {
|
|
291
|
+
switch (tabsposition) {
|
|
292
|
+
case "left":
|
|
293
|
+
return "row";
|
|
294
|
+
case "right":
|
|
295
|
+
return "row-reverse";
|
|
296
|
+
case "bottom":
|
|
297
|
+
return "column-reverse";
|
|
298
|
+
case "top":
|
|
299
|
+
default:
|
|
300
|
+
return "column";
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var renderTabPanels = function renderTabPanels() {
|
|
304
|
+
if (type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) > 0) {
|
|
305
|
+
return dataset === null || dataset === void 0 ? void 0 : dataset.map(function (item, index) {
|
|
306
|
+
return __jsx(_react["default"].Fragment, {
|
|
307
|
+
key: index
|
|
308
|
+
}, render ? render(item, index, dataset) : __jsx(_tabPane["default"], (0, _extends2["default"])({}, item, {
|
|
309
|
+
key: index,
|
|
310
|
+
value: selectedIndex,
|
|
311
|
+
listener: listener // Pass the updated listener context
|
|
312
|
+
,
|
|
313
|
+
className: (0, _clsx["default"])("tab-pane", {
|
|
314
|
+
active: selectedIndex === index,
|
|
315
|
+
disabled: item.disabled,
|
|
316
|
+
hidden: item.show === false
|
|
317
|
+
})
|
|
318
|
+
})));
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return children;
|
|
322
|
+
};
|
|
323
|
+
if (type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) <= 0) {
|
|
324
|
+
return __jsx("div", null, nodatamessage);
|
|
325
|
+
}
|
|
326
|
+
return __jsx(TabsContext.Provider, {
|
|
327
|
+
value: {
|
|
328
|
+
selectedIndex: selectedIndex,
|
|
329
|
+
setSelectedIndex: setSelectedIndex
|
|
330
|
+
}
|
|
331
|
+
}, __jsx(_tabs.Tabs.Root, {
|
|
332
|
+
style: _objectSpread(_objectSpread({}, styles), {}, {
|
|
333
|
+
display: "flex",
|
|
334
|
+
flexDirection: getFlexDirection()
|
|
335
|
+
}),
|
|
336
|
+
value: selectedIndex,
|
|
337
|
+
onValueChange: function onValueChange(value) {
|
|
338
|
+
var newIndex = value;
|
|
339
|
+
var oldIndex = currentSelectedIndex.current;
|
|
340
|
+
|
|
341
|
+
// Update refs and state
|
|
342
|
+
prevSelectedIndex.current = oldIndex;
|
|
343
|
+
currentSelectedIndex.current = newIndex;
|
|
344
|
+
setSelectedIndex(newIndex);
|
|
345
|
+
saveStateToStorage(newIndex);
|
|
346
|
+
onChange === null || onChange === void 0 || onChange(null, props, newIndex, oldIndex);
|
|
347
|
+
|
|
348
|
+
// Notify listener about tab change
|
|
349
|
+
updateListener();
|
|
350
|
+
},
|
|
351
|
+
orientation: orientation,
|
|
352
|
+
className: (0, _clsx["default"])("app-tabs clearfix", className, {
|
|
353
|
+
vertical: orientation === "vertical",
|
|
354
|
+
justified: justified
|
|
355
|
+
})
|
|
356
|
+
}, __jsx(_tabs.Tabs.List, {
|
|
357
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, {
|
|
358
|
+
"nav-stacked": orientation === "vertical",
|
|
359
|
+
"nav-justified": justified
|
|
360
|
+
}),
|
|
361
|
+
role: "tablist",
|
|
362
|
+
render: function render(props, state) {
|
|
363
|
+
return __jsx("ul", props, renderTabs);
|
|
364
|
+
}
|
|
365
|
+
}), __jsx("div", {
|
|
366
|
+
className: "tab-content",
|
|
367
|
+
style: {
|
|
368
|
+
flex: orientation === "vertical" ? 1 : undefined,
|
|
369
|
+
minWidth: orientation === "vertical" ? 0 : undefined
|
|
370
|
+
}
|
|
371
|
+
}, renderTabPanels())));
|
|
372
|
+
}, function (prev, next) {
|
|
373
|
+
var keys = ["dataset", "defaultpaneindex", "justified", "tabsposition", "nodatamessage", "statehandler", "autotabactivation", "transition", "type", "iconposition", "render", "selectedindex", "children"];
|
|
374
|
+
return keys.every(function (key) {
|
|
375
|
+
return (0, _isEqual["default"])(prev[key], next[key]);
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
WmTabs.displayName = "WmTabs";
|
|
379
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmTabs);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_PROPS = void 0;
|
|
7
|
+
var DEFAULT_PROPS = exports.DEFAULT_PROPS = {
|
|
8
|
+
type: "static",
|
|
9
|
+
dataset: [],
|
|
10
|
+
defaultpaneindex: 0,
|
|
11
|
+
tabsposition: "top",
|
|
12
|
+
nodatamessage: "No Data Found",
|
|
13
|
+
statehandler: "none",
|
|
14
|
+
autotabactivation: true,
|
|
15
|
+
transition: "none",
|
|
16
|
+
iconposition: "left",
|
|
17
|
+
enablescroll: false,
|
|
18
|
+
listener: {},
|
|
19
|
+
name: ""
|
|
20
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.WmTabpane = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
11
|
+
var _tabs = require("@base-ui-components/react/tabs");
|
|
12
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
13
|
+
var _ = require("..");
|
|
14
|
+
var __jsx = _react["default"].createElement;
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
var WmTabpane = exports.WmTabpane = function WmTabpane(props) {
|
|
18
|
+
var _clsx;
|
|
19
|
+
var className = props.className,
|
|
20
|
+
disabled = props.disabled,
|
|
21
|
+
renderPartial = props.renderPartial,
|
|
22
|
+
name = props.name,
|
|
23
|
+
index = props.index;
|
|
24
|
+
var _useTabsContext = (0, _.useTabsContext)(),
|
|
25
|
+
selectedIndex = _useTabsContext.selectedIndex;
|
|
26
|
+
return __jsx(_tabs.Tabs.Panel, {
|
|
27
|
+
value: index,
|
|
28
|
+
className: (0, _clsx2["default"])((_clsx = {
|
|
29
|
+
disabled: disabled
|
|
30
|
+
}, (0, _defineProperty2["default"])(_clsx, className, !!className), (0, _defineProperty2["default"])(_clsx, "active", selectedIndex === index), _clsx)),
|
|
31
|
+
role: "tabpanel",
|
|
32
|
+
style: _objectSpread({
|
|
33
|
+
width: "100%"
|
|
34
|
+
}, props === null || props === void 0 ? void 0 : props.styles),
|
|
35
|
+
"data-pane-name": name
|
|
36
|
+
}, __jsx("div", {
|
|
37
|
+
className: "tab-body",
|
|
38
|
+
"data-widget-id": props["data-widget-id"]
|
|
39
|
+
}, renderPartial ? renderPartial(props, props.onLoad) : props.children));
|
|
40
|
+
};
|
|
41
|
+
WmTabpane.displayName = "WmTabpane";
|
|
42
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmTabpane);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useWizardContext = exports["default"] = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var WizardContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
9
|
+
var useWizardContext = exports.useWizardContext = function useWizardContext() {
|
|
10
|
+
var context = (0, _react.useContext)(WizardContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error("useWizardContext must be used within a WizardProvider");
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
var _default = exports["default"] = WizardContext;
|
|
@@ -0,0 +1,100 @@
|
|
|
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.CustomStepLabel = exports.CustomStepIcon = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
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); }
|
|
13
|
+
var __jsx = _react["default"].createElement;
|
|
14
|
+
// Custom Step Icon Component
|
|
15
|
+
var CustomStepIcon = exports.CustomStepIcon = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
16
|
+
var step = props.step,
|
|
17
|
+
_props$index = props.index,
|
|
18
|
+
index = _props$index === void 0 ? 0 : _props$index,
|
|
19
|
+
_props$wizardClass = props.wizardClass,
|
|
20
|
+
wizardClass = _props$wizardClass === void 0 ? "" : _props$wizardClass,
|
|
21
|
+
active = props.active,
|
|
22
|
+
completed = props.completed;
|
|
23
|
+
if (!step) return null;
|
|
24
|
+
var isNumber = wizardClass === null || wizardClass === void 0 ? void 0 : wizardClass.includes("number");
|
|
25
|
+
var isDottedStepper = wizardClass === null || wizardClass === void 0 ? void 0 : wizardClass.includes("dottedstepper");
|
|
26
|
+
var isTextInline = wizardClass === null || wizardClass === void 0 ? void 0 : wizardClass.includes("text-inline");
|
|
27
|
+
var isIconStepper = wizardClass === null || wizardClass === void 0 ? void 0 : wizardClass.includes("iconstepper");
|
|
28
|
+
var isCompleted = step.isDone;
|
|
29
|
+
var iconContent = (0, _react.useMemo)(function () {
|
|
30
|
+
if (isCompleted && (isDottedStepper || isNumber)) {
|
|
31
|
+
return __jsx(_material.Box, {
|
|
32
|
+
component: "i",
|
|
33
|
+
className: "app-icon wi wi-done"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (isNumber && !isCompleted) {
|
|
37
|
+
return __jsx(_material.Box, {
|
|
38
|
+
component: "span",
|
|
39
|
+
className: "count"
|
|
40
|
+
}, index + 1);
|
|
41
|
+
}
|
|
42
|
+
if ((isDottedStepper || isTextInline && !isIconStepper) && !isCompleted) {
|
|
43
|
+
return __jsx(_material.Box, {
|
|
44
|
+
component: "span",
|
|
45
|
+
className: "dottedstepper"
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (isIconStepper && step.iconclass && (!isCompleted || isCompleted && !step.doneiconclass)) {
|
|
49
|
+
return __jsx(_material.Box, {
|
|
50
|
+
component: "span",
|
|
51
|
+
className: "app-icon ".concat(step.iconclass)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (step.doneiconclass && isCompleted && isIconStepper) {
|
|
55
|
+
return __jsx(_material.Box, {
|
|
56
|
+
component: "span",
|
|
57
|
+
className: "app-icon ".concat(step.doneiconclass)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}, [step, index, isCompleted, isDottedStepper, isNumber, isTextInline, isIconStepper]);
|
|
62
|
+
return __jsx(_material.Box, {
|
|
63
|
+
component: "span",
|
|
64
|
+
className: (0, _clsx["default"])("wizard-step-number", {
|
|
65
|
+
active: active,
|
|
66
|
+
completed: isCompleted,
|
|
67
|
+
disabled: step.disabled
|
|
68
|
+
}, isDottedStepper && !completed && "has-dotted-stepper")
|
|
69
|
+
}, iconContent);
|
|
70
|
+
});
|
|
71
|
+
CustomStepIcon.displayName = "CustomStepIcon";
|
|
72
|
+
|
|
73
|
+
// Custom Step Label Component
|
|
74
|
+
var CustomStepLabel = exports.CustomStepLabel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
75
|
+
var step = props.step,
|
|
76
|
+
index = props.index,
|
|
77
|
+
wizardClass = props.wizardClass,
|
|
78
|
+
children = props.children;
|
|
79
|
+
var isTextInline = wizardClass === null || wizardClass === void 0 ? void 0 : wizardClass.includes("text-inline");
|
|
80
|
+
return __jsx(_react["default"].Fragment, null, __jsx(_material.Box, {
|
|
81
|
+
component: "span",
|
|
82
|
+
className: "title-wrapper"
|
|
83
|
+
}, isTextInline && __jsx(_material.Typography, {
|
|
84
|
+
component: "span",
|
|
85
|
+
className: "step-number",
|
|
86
|
+
variant: "caption"
|
|
87
|
+
}, "0".concat(index + 1)), __jsx(_material.Typography, {
|
|
88
|
+
component: "span",
|
|
89
|
+
variant: "body2",
|
|
90
|
+
className: "step-title"
|
|
91
|
+
}, step.title)), step.subtitle && __jsx(_material.Typography, {
|
|
92
|
+
component: "span",
|
|
93
|
+
className: "subtitle-wrapper",
|
|
94
|
+
variant: "caption"
|
|
95
|
+
}, __jsx(_material.Box, {
|
|
96
|
+
component: "span",
|
|
97
|
+
className: "step-title"
|
|
98
|
+
}, step.subtitle)), children);
|
|
99
|
+
});
|
|
100
|
+
CustomStepLabel.displayName = "CustomStepLabel";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.WizardStep = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _StepComponents = require("./StepComponents");
|
|
13
|
+
var __jsx = _react["default"].createElement;
|
|
14
|
+
var STEP_CLASS = "app-wizard-step";
|
|
15
|
+
var WizardStep = exports.WizardStep = function WizardStep(_ref) {
|
|
16
|
+
var step = _ref.step,
|
|
17
|
+
index = _ref.index,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
_ref$nonLinear = _ref.nonLinear,
|
|
20
|
+
nonLinear = _ref$nonLinear === void 0 ? false : _ref$nonLinear,
|
|
21
|
+
_ref$orientation = _ref.orientation,
|
|
22
|
+
orientation = _ref$orientation === void 0 ? "horizontal" : _ref$orientation,
|
|
23
|
+
onStepClick = _ref.onStepClick,
|
|
24
|
+
current = _ref.current;
|
|
25
|
+
var stepProps = {};
|
|
26
|
+
var labelProps = {};
|
|
27
|
+
if (step.disabled) {
|
|
28
|
+
stepProps.disabled = true;
|
|
29
|
+
}
|
|
30
|
+
if (step.done || step.isDone) {
|
|
31
|
+
stepProps.completed = true;
|
|
32
|
+
}
|
|
33
|
+
if (step.show === false || step.show === "false") {
|
|
34
|
+
stepProps.hidden = true;
|
|
35
|
+
}
|
|
36
|
+
return __jsx(_material.Step, (0, _extends2["default"])({
|
|
37
|
+
key: step.name
|
|
38
|
+
}, stepProps, {
|
|
39
|
+
className: (0, _clsx["default"])(STEP_CLASS, current ? "current" : step.done || step.isDone ? "active" : "disabled")
|
|
40
|
+
}, stepProps), nonLinear || step.done || step.isDone ? __jsx(_material.Box, {
|
|
41
|
+
component: "a",
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return onStepClick(index);
|
|
44
|
+
},
|
|
45
|
+
className: (0, _clsx["default"])({
|
|
46
|
+
current: current,
|
|
47
|
+
active: step.done || step.isDone,
|
|
48
|
+
disabled: !current && !(step.done || step.isDone)
|
|
49
|
+
}),
|
|
50
|
+
"aria-current": step.active ? "step" : undefined,
|
|
51
|
+
"aria-label": step.subtitle ? "step ".concat(index + 1, " ").concat(step.title, " ").concat(step.subtitle) : "step ".concat(index + 1, " ").concat(step.title),
|
|
52
|
+
"aria-disabled": step.disabled
|
|
53
|
+
}, __jsx(_material.StepLabel, (0, _extends2["default"])({}, labelProps, {
|
|
54
|
+
slots: {
|
|
55
|
+
stepIcon: _StepComponents.CustomStepIcon
|
|
56
|
+
},
|
|
57
|
+
slotProps: {
|
|
58
|
+
stepIcon: {
|
|
59
|
+
step: step,
|
|
60
|
+
index: index,
|
|
61
|
+
wizardClass: className,
|
|
62
|
+
active: step.active,
|
|
63
|
+
completed: step.done || step.isDone
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}), __jsx(_StepComponents.CustomStepLabel, {
|
|
67
|
+
step: step,
|
|
68
|
+
index: index,
|
|
69
|
+
wizardClass: className || ""
|
|
70
|
+
}))) : __jsx(_material.StepLabel, (0, _extends2["default"])({}, labelProps, {
|
|
71
|
+
slots: {
|
|
72
|
+
stepIcon: _StepComponents.CustomStepIcon
|
|
73
|
+
},
|
|
74
|
+
slotProps: {
|
|
75
|
+
stepIcon: {
|
|
76
|
+
step: step,
|
|
77
|
+
index: index,
|
|
78
|
+
wizardClass: className,
|
|
79
|
+
active: step.active,
|
|
80
|
+
completed: step.done || step.isDone
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}), __jsx(_StepComponents.CustomStepLabel, {
|
|
84
|
+
step: step,
|
|
85
|
+
index: index,
|
|
86
|
+
wizardClass: className || ""
|
|
87
|
+
})), orientation === "vertical" && __jsx(_material.StepContent, null, step.active && step.content));
|
|
88
|
+
};
|
|
89
|
+
WizardStep.displayName = "WizardStep";
|