@wavemaker/react-runtime 11.14.1-rc.236
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 +10183 -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,456 @@
|
|
|
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"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
15
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
16
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
18
|
+
var _lodashEs = require("lodash-es");
|
|
19
|
+
var _excluded = ["name", "animation", "animationinterval", "controls", "nodatamessage", "height", "width", "children", "className", "styles", "render", "onChange"];
|
|
20
|
+
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); }
|
|
21
|
+
var __jsx = _react["default"].createElement;
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
var DEFAULT_CLASS = "app-carousel carousel";
|
|
25
|
+
var StyledCarousel = (0, _styles.styled)(_Box["default"], {
|
|
26
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
27
|
+
return !["ownerState"].includes(prop);
|
|
28
|
+
}
|
|
29
|
+
})(function (_ref) {
|
|
30
|
+
var ownerState = _ref.ownerState;
|
|
31
|
+
var height = ownerState.height,
|
|
32
|
+
width = ownerState.width,
|
|
33
|
+
isAnimating = ownerState.isAnimating;
|
|
34
|
+
return {
|
|
35
|
+
position: "relative",
|
|
36
|
+
width: width || "100%",
|
|
37
|
+
height: height || "480px",
|
|
38
|
+
overflow: "hidden",
|
|
39
|
+
"& .carousel-inner": {
|
|
40
|
+
position: "relative",
|
|
41
|
+
width: "100%",
|
|
42
|
+
height: "100%",
|
|
43
|
+
overflow: "hidden"
|
|
44
|
+
},
|
|
45
|
+
"& .carousel-item": {
|
|
46
|
+
position: "absolute",
|
|
47
|
+
top: 0,
|
|
48
|
+
left: 0,
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
opacity: 1,
|
|
52
|
+
transition: isAnimating ? "transform 0.6s ease-in-out" : "none",
|
|
53
|
+
transform: "translate3d(0, 0, 0)",
|
|
54
|
+
WebkitTransform: "translate3d(0, 0, 0)",
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
"&.active": {
|
|
59
|
+
opacity: 1,
|
|
60
|
+
transform: "translate3d(0, 0, 0)",
|
|
61
|
+
WebkitTransform: "translate3d(0, 0, 0)",
|
|
62
|
+
zIndex: 2
|
|
63
|
+
},
|
|
64
|
+
"&.carousel-item-left": {
|
|
65
|
+
transform: "translate3d(-100%, 0, 0)",
|
|
66
|
+
WebkitTransform: "translate3d(-100%, 0, 0)",
|
|
67
|
+
zIndex: 1
|
|
68
|
+
},
|
|
69
|
+
"&.carousel-item-right": {
|
|
70
|
+
transform: "translate3d(100%, 0, 0)",
|
|
71
|
+
WebkitTransform: "translate3d(100%, 0, 0)",
|
|
72
|
+
zIndex: 1
|
|
73
|
+
},
|
|
74
|
+
"&.carousel-item-prev": {
|
|
75
|
+
transform: "translate3d(-100%, 0, 0)",
|
|
76
|
+
WebkitTransform: "translate3d(-100%, 0, 0)",
|
|
77
|
+
zIndex: 1,
|
|
78
|
+
"&.carousel-item-left": {
|
|
79
|
+
transform: "translate3d(0, 0, 0)",
|
|
80
|
+
WebkitTransform: "translate3d(0, 0, 0)",
|
|
81
|
+
zIndex: 2
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"&.carousel-item-next": {
|
|
85
|
+
transform: "translate3d(100%, 0, 0)",
|
|
86
|
+
WebkitTransform: "translate3d(100%, 0, 0)",
|
|
87
|
+
zIndex: 1,
|
|
88
|
+
"&.carousel-item-right": {
|
|
89
|
+
transform: "translate3d(0, 0, 0)",
|
|
90
|
+
WebkitTransform: "translate3d(0, 0, 0)",
|
|
91
|
+
zIndex: 2
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
// Special handling for active items during animation
|
|
95
|
+
"&.active.carousel-item-left": {
|
|
96
|
+
transform: "translate3d(-100%, 0, 0)",
|
|
97
|
+
WebkitTransform: "translate3d(-100%, 0, 0)",
|
|
98
|
+
zIndex: 1
|
|
99
|
+
},
|
|
100
|
+
"&.active.carousel-item-right": {
|
|
101
|
+
transform: "translate3d(100%, 0, 0)",
|
|
102
|
+
WebkitTransform: "translate3d(100%, 0, 0)",
|
|
103
|
+
zIndex: 1
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
// Navigation controls
|
|
107
|
+
"& .carousel-control": {
|
|
108
|
+
zIndex: 5,
|
|
109
|
+
height: "inherit"
|
|
110
|
+
},
|
|
111
|
+
// Hide controls based on controls prop
|
|
112
|
+
"&.hide-navs .carousel-control": {
|
|
113
|
+
display: "none"
|
|
114
|
+
},
|
|
115
|
+
"&.hide-indicators .carousel-indicators": {
|
|
116
|
+
display: "none"
|
|
117
|
+
},
|
|
118
|
+
"&.hide-both .carousel-control, &.hide-both .carousel-indicators": {
|
|
119
|
+
display: "none"
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
var WmCarousel = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
124
|
+
var name = props.name,
|
|
125
|
+
_props$animation = props.animation,
|
|
126
|
+
animation = _props$animation === void 0 ? "auto" : _props$animation,
|
|
127
|
+
_props$animationinter = props.animationinterval,
|
|
128
|
+
animationinterval = _props$animationinter === void 0 ? 3 : _props$animationinter,
|
|
129
|
+
_props$controls = props.controls,
|
|
130
|
+
controls = _props$controls === void 0 ? "both" : _props$controls,
|
|
131
|
+
_props$nodatamessage = props.nodatamessage,
|
|
132
|
+
nodatamessage = _props$nodatamessage === void 0 ? "No Data Found" : _props$nodatamessage,
|
|
133
|
+
_props$height = props.height,
|
|
134
|
+
height = _props$height === void 0 ? "480px" : _props$height,
|
|
135
|
+
_props$width = props.width,
|
|
136
|
+
width = _props$width === void 0 ? "100%" : _props$width,
|
|
137
|
+
children = props.children,
|
|
138
|
+
className = props.className,
|
|
139
|
+
styles = props.styles,
|
|
140
|
+
render = props.render,
|
|
141
|
+
onChange = props.onChange,
|
|
142
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
143
|
+
var dataset = props.dataset || [];
|
|
144
|
+
var _useState = (0, _react.useState)(0),
|
|
145
|
+
activeIndex = _useState[0],
|
|
146
|
+
setActiveIndex = _useState[1];
|
|
147
|
+
var _useState2 = (0, _react.useState)(false),
|
|
148
|
+
isAnimating = _useState2[0],
|
|
149
|
+
setIsAnimating = _useState2[1];
|
|
150
|
+
var _useState3 = (0, _react.useState)(false),
|
|
151
|
+
isPaused = _useState3[0],
|
|
152
|
+
setIsPaused = _useState3[1];
|
|
153
|
+
var _useState4 = (0, _react.useState)("right"),
|
|
154
|
+
direction = _useState4[0],
|
|
155
|
+
setDirection = _useState4[1];
|
|
156
|
+
var _useState5 = (0, _react.useState)(0),
|
|
157
|
+
prevActiveIndex = _useState5[0],
|
|
158
|
+
setPrevActiveIndex = _useState5[1];
|
|
159
|
+
var intervalRef = (0, _react.useRef)(undefined);
|
|
160
|
+
var carouselRef = (0, _react.useRef)(null);
|
|
161
|
+
dataset = (0, _lodashEs.isPlainObject)(dataset) ? [dataset] : dataset;
|
|
162
|
+
|
|
163
|
+
// Determine if it's a dynamic carousel (has dataset) or static (has children)
|
|
164
|
+
var isDynamic = dataset && dataset.length > 0;
|
|
165
|
+
var items = isDynamic ? dataset : _react["default"].Children.toArray(children || []);
|
|
166
|
+
var itemCount = items.length;
|
|
167
|
+
var ownerState = (0, _react.useMemo)(function () {
|
|
168
|
+
return {
|
|
169
|
+
height: height,
|
|
170
|
+
width: width,
|
|
171
|
+
isAnimating: isAnimating
|
|
172
|
+
};
|
|
173
|
+
}, [height, width, isAnimating]);
|
|
174
|
+
|
|
175
|
+
// Auto-play functionality
|
|
176
|
+
var startAutoPlay = (0, _react.useCallback)(function () {
|
|
177
|
+
if (animation === "auto" && animationinterval > 0 && itemCount > 1) {
|
|
178
|
+
intervalRef.current = setInterval(function () {
|
|
179
|
+
if (!isPaused) {
|
|
180
|
+
setActiveIndex(function (prevIndex) {
|
|
181
|
+
var newIndex = (prevIndex + 1) % itemCount;
|
|
182
|
+
setDirection("right");
|
|
183
|
+
setPrevActiveIndex(prevIndex);
|
|
184
|
+
setIsAnimating(true);
|
|
185
|
+
setTimeout(function () {
|
|
186
|
+
return setIsAnimating(false);
|
|
187
|
+
}, 600);
|
|
188
|
+
return newIndex;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}, animationinterval * 1000);
|
|
192
|
+
}
|
|
193
|
+
}, [animation, animationinterval, itemCount, isPaused]);
|
|
194
|
+
var stopAutoPlay = (0, _react.useCallback)(function () {
|
|
195
|
+
if (intervalRef.current) {
|
|
196
|
+
clearInterval(intervalRef.current);
|
|
197
|
+
intervalRef.current = undefined;
|
|
198
|
+
}
|
|
199
|
+
}, []);
|
|
200
|
+
|
|
201
|
+
// Start/stop auto-play based on props
|
|
202
|
+
(0, _react.useEffect)(function () {
|
|
203
|
+
if (animation === "auto" && !isPaused) {
|
|
204
|
+
startAutoPlay();
|
|
205
|
+
} else {
|
|
206
|
+
stopAutoPlay();
|
|
207
|
+
}
|
|
208
|
+
return function () {
|
|
209
|
+
return stopAutoPlay();
|
|
210
|
+
};
|
|
211
|
+
}, [animation, startAutoPlay, stopAutoPlay, isPaused]);
|
|
212
|
+
|
|
213
|
+
// Navigation functions
|
|
214
|
+
var goToSlide = (0, _react.useCallback)(function (index, slideDirection) {
|
|
215
|
+
if (index >= 0 && index < itemCount && index !== activeIndex) {
|
|
216
|
+
setIsAnimating(true);
|
|
217
|
+
var oldIndex = activeIndex;
|
|
218
|
+
|
|
219
|
+
// Determine slide direction
|
|
220
|
+
var dir = slideDirection;
|
|
221
|
+
if (!dir) {
|
|
222
|
+
// Handle circular navigation properly
|
|
223
|
+
if (index === 0 && activeIndex === itemCount - 1) {
|
|
224
|
+
dir = "right"; // Last to first
|
|
225
|
+
} else if (index === itemCount - 1 && activeIndex === 0) {
|
|
226
|
+
dir = "left"; // First to last
|
|
227
|
+
} else if (index > activeIndex) {
|
|
228
|
+
dir = "right";
|
|
229
|
+
} else {
|
|
230
|
+
dir = "left";
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
setDirection(dir);
|
|
234
|
+
setPrevActiveIndex(activeIndex);
|
|
235
|
+
|
|
236
|
+
// Set new active index
|
|
237
|
+
setActiveIndex(index);
|
|
238
|
+
|
|
239
|
+
// Call onChange callback
|
|
240
|
+
onChange === null || onChange === void 0 || onChange(null, props, index, oldIndex);
|
|
241
|
+
|
|
242
|
+
// Reset animation state after transition
|
|
243
|
+
setTimeout(function () {
|
|
244
|
+
return setIsAnimating(false);
|
|
245
|
+
}, 600);
|
|
246
|
+
}
|
|
247
|
+
}, [activeIndex, itemCount, onChange, props]);
|
|
248
|
+
var goToPrevious = (0, _react.useCallback)(function () {
|
|
249
|
+
var newIndex = activeIndex === 0 ? itemCount - 1 : activeIndex - 1;
|
|
250
|
+
goToSlide(newIndex, "left");
|
|
251
|
+
}, [activeIndex, itemCount, goToSlide]);
|
|
252
|
+
var goToNext = (0, _react.useCallback)(function () {
|
|
253
|
+
var newIndex = (activeIndex + 1) % itemCount;
|
|
254
|
+
goToSlide(newIndex, "right");
|
|
255
|
+
}, [activeIndex, itemCount, goToSlide]);
|
|
256
|
+
|
|
257
|
+
// Mouse event handlers for pause/resume
|
|
258
|
+
var handleMouseEnter = (0, _react.useCallback)(function (event) {
|
|
259
|
+
var _props$onMouseEnter;
|
|
260
|
+
setIsPaused(true);
|
|
261
|
+
(_props$onMouseEnter = props.onMouseEnter) === null || _props$onMouseEnter === void 0 || _props$onMouseEnter.call(props, event, props);
|
|
262
|
+
}, [props]);
|
|
263
|
+
var handleMouseLeave = (0, _react.useCallback)(function (event) {
|
|
264
|
+
var _props$onMouseLeave;
|
|
265
|
+
setIsPaused(false);
|
|
266
|
+
(_props$onMouseLeave = props.onMouseLeave) === null || _props$onMouseLeave === void 0 || _props$onMouseLeave.call(props, event, props);
|
|
267
|
+
}, [props]);
|
|
268
|
+
var handleClick = (0, _react.useCallback)(function (event) {
|
|
269
|
+
var _props$onClick;
|
|
270
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event, props);
|
|
271
|
+
}, [props]);
|
|
272
|
+
var handleDoubleClick = (0, _react.useCallback)(function (event) {
|
|
273
|
+
var _props$onDoubleClick;
|
|
274
|
+
(_props$onDoubleClick = props.onDoubleClick) === null || _props$onDoubleClick === void 0 || _props$onDoubleClick.call(props, event, props);
|
|
275
|
+
}, [props]);
|
|
276
|
+
|
|
277
|
+
// Keyboard navigation
|
|
278
|
+
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
279
|
+
switch (event.key) {
|
|
280
|
+
case "ArrowLeft":
|
|
281
|
+
event.preventDefault();
|
|
282
|
+
goToPrevious();
|
|
283
|
+
break;
|
|
284
|
+
case "ArrowRight":
|
|
285
|
+
event.preventDefault();
|
|
286
|
+
goToNext();
|
|
287
|
+
break;
|
|
288
|
+
case " ":
|
|
289
|
+
// Space key
|
|
290
|
+
event.preventDefault();
|
|
291
|
+
setIsPaused(function (prev) {
|
|
292
|
+
return !prev;
|
|
293
|
+
});
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
}, [goToPrevious, goToNext]);
|
|
297
|
+
|
|
298
|
+
// Get navigation class based on controls prop
|
|
299
|
+
var getNavigationClass = function getNavigationClass() {
|
|
300
|
+
switch (controls) {
|
|
301
|
+
case "indicators":
|
|
302
|
+
return "hide-navs";
|
|
303
|
+
case "navs":
|
|
304
|
+
return "hide-indicators";
|
|
305
|
+
case "none":
|
|
306
|
+
return "hide-both";
|
|
307
|
+
default:
|
|
308
|
+
return "";
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// Render carousel items
|
|
313
|
+
var renderCarouselItems = function renderCarouselItems() {
|
|
314
|
+
if (itemCount === 0) {
|
|
315
|
+
return __jsx("div", {
|
|
316
|
+
className: "carousel-item active"
|
|
317
|
+
}, __jsx(_Typography["default"], {
|
|
318
|
+
variant: "body1",
|
|
319
|
+
sx: {
|
|
320
|
+
textAlign: "center",
|
|
321
|
+
color: "text.secondary"
|
|
322
|
+
}
|
|
323
|
+
}, nodatamessage));
|
|
324
|
+
}
|
|
325
|
+
return items.map(function (item, index) {
|
|
326
|
+
var isActive = index === activeIndex;
|
|
327
|
+
var isPrevious = index === prevActiveIndex;
|
|
328
|
+
var getItemClasses = function getItemClasses() {
|
|
329
|
+
var classes = "carousel-item";
|
|
330
|
+
if (isActive && !isAnimating) {
|
|
331
|
+
classes += " active";
|
|
332
|
+
} else if (isAnimating) {
|
|
333
|
+
if (isActive) {
|
|
334
|
+
// New active item coming in
|
|
335
|
+
if (direction === "left") {
|
|
336
|
+
classes += " carousel-item-prev carousel-item-left";
|
|
337
|
+
} else {
|
|
338
|
+
classes += " carousel-item-next carousel-item-right";
|
|
339
|
+
}
|
|
340
|
+
} else if (isPrevious) {
|
|
341
|
+
// Previous active item going out
|
|
342
|
+
if (direction === "left") {
|
|
343
|
+
classes += " active carousel-item-right";
|
|
344
|
+
} else {
|
|
345
|
+
classes += " active carousel-item-left";
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
// Position other items off-screen
|
|
349
|
+
if (index < activeIndex) {
|
|
350
|
+
classes += " carousel-item-left";
|
|
351
|
+
} else {
|
|
352
|
+
classes += " carousel-item-right";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
} else {
|
|
356
|
+
// Default positioning when not animating
|
|
357
|
+
if (isActive) {
|
|
358
|
+
classes += " active";
|
|
359
|
+
} else if (index < activeIndex) {
|
|
360
|
+
classes += " carousel-item-left";
|
|
361
|
+
} else if (index > activeIndex) {
|
|
362
|
+
classes += " carousel-item-right";
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return classes;
|
|
366
|
+
};
|
|
367
|
+
return __jsx("div", {
|
|
368
|
+
key: index,
|
|
369
|
+
className: getItemClasses(),
|
|
370
|
+
"aria-hidden": index !== activeIndex && !isAnimating
|
|
371
|
+
}, isDynamic && render ? render(item, index) : item);
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
// Render navigation controls
|
|
376
|
+
var renderNavControls = function renderNavControls() {
|
|
377
|
+
if (controls === "indicators" || controls === "none") return null;
|
|
378
|
+
return __jsx(_react["default"].Fragment, null, __jsx("div", {
|
|
379
|
+
"aria-disabled": itemCount <= 1,
|
|
380
|
+
className: "left carousel-control carousel-control-prev app-anchor",
|
|
381
|
+
tabIndex: 0,
|
|
382
|
+
onClick: goToPrevious,
|
|
383
|
+
"aria-label": "".concat(activeIndex + 1, " of ").concat(itemCount),
|
|
384
|
+
name: name,
|
|
385
|
+
disabled: itemCount <= 1
|
|
386
|
+
}, __jsx("span", {
|
|
387
|
+
"aria-hidden": "true",
|
|
388
|
+
className: "icon-prev carousel-control-prev-icon"
|
|
389
|
+
})), __jsx("div", {
|
|
390
|
+
"aria-disabled": itemCount <= 1,
|
|
391
|
+
className: "right carousel-control carousel-control-next app-anchor",
|
|
392
|
+
tabIndex: 0,
|
|
393
|
+
onClick: goToNext,
|
|
394
|
+
"aria-label": "Next slide",
|
|
395
|
+
name: name,
|
|
396
|
+
disabled: itemCount <= 1
|
|
397
|
+
}, __jsx("span", {
|
|
398
|
+
"aria-hidden": "true",
|
|
399
|
+
className: "icon-next carousel-control-next-icon"
|
|
400
|
+
})));
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
// Render indicators
|
|
404
|
+
var renderIndicators = function renderIndicators() {
|
|
405
|
+
if (controls === "navs" || controls === "none" || itemCount <= 1) return null;
|
|
406
|
+
return __jsx("ul", {
|
|
407
|
+
className: "carousel-indicators",
|
|
408
|
+
role: "tablist"
|
|
409
|
+
}, items.map(function (_, index) {
|
|
410
|
+
return __jsx("li", {
|
|
411
|
+
key: index,
|
|
412
|
+
className: (0, _clsx["default"])({
|
|
413
|
+
active: index === activeIndex
|
|
414
|
+
}),
|
|
415
|
+
onClick: function onClick() {
|
|
416
|
+
return goToSlide(index);
|
|
417
|
+
},
|
|
418
|
+
role: "tab",
|
|
419
|
+
"aria-label": "Slide ".concat(index + 1),
|
|
420
|
+
"aria-selected": index === activeIndex
|
|
421
|
+
});
|
|
422
|
+
}));
|
|
423
|
+
};
|
|
424
|
+
return __jsx(StyledCarousel, (0, _extends2["default"])({
|
|
425
|
+
ref: carouselRef,
|
|
426
|
+
ownerState: ownerState,
|
|
427
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, getNavigationClass(), props.className),
|
|
428
|
+
sx: props.styles,
|
|
429
|
+
onMouseEnter: handleMouseEnter,
|
|
430
|
+
onMouseLeave: handleMouseLeave,
|
|
431
|
+
onClick: handleClick,
|
|
432
|
+
onDoubleClick: handleDoubleClick,
|
|
433
|
+
onKeyDown: handleKeyDown,
|
|
434
|
+
tabIndex: props.tabindex || 0,
|
|
435
|
+
role: "region",
|
|
436
|
+
"aria-label": props.arialabel || "Carousel",
|
|
437
|
+
"aria-live": animation === "auto" ? "polite" : "off"
|
|
438
|
+
}, rest), __jsx("div", {
|
|
439
|
+
className: "carousel slide",
|
|
440
|
+
style: _objectSpread({}, styles)
|
|
441
|
+
}, __jsx("div", {
|
|
442
|
+
className: "carousel-inner",
|
|
443
|
+
role: "group"
|
|
444
|
+
}, renderCarouselItems()), renderNavControls(), renderIndicators()));
|
|
445
|
+
}, function (prevProps, nextProps) {
|
|
446
|
+
// Custom comparison for memoization
|
|
447
|
+
var keysToCompare = ["dataset", "animation", "animationinterval", "controls", "children", "className", "styles"];
|
|
448
|
+
return keysToCompare.every(function (key) {
|
|
449
|
+
if (key === "dataset") {
|
|
450
|
+
return JSON.stringify(prevProps[key]) === JSON.stringify(nextProps[key]);
|
|
451
|
+
}
|
|
452
|
+
return prevProps[key] === nextProps[key];
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
WmCarousel.displayName = "WmCarousel";
|
|
456
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmCarousel);
|
|
@@ -0,0 +1,72 @@
|
|
|
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"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
14
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
16
|
+
var _excluded = ["name", "horizontalalign", "children", "className", "styles", "item", "index"];
|
|
17
|
+
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); }
|
|
18
|
+
var __jsx = _react["default"].createElement;
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
var DEFAULT_CLASS = "app-carousel-item";
|
|
22
|
+
var WmCarouselTemplate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
23
|
+
var name = props.name,
|
|
24
|
+
_props$horizontalalig = props.horizontalalign,
|
|
25
|
+
horizontalalign = _props$horizontalalig === void 0 ? "center" : _props$horizontalalig,
|
|
26
|
+
children = props.children,
|
|
27
|
+
className = props.className,
|
|
28
|
+
styles = props.styles,
|
|
29
|
+
item = props.item,
|
|
30
|
+
index = props.index,
|
|
31
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
32
|
+
var getAlignmentStyles = function getAlignmentStyles() {
|
|
33
|
+
switch (horizontalalign) {
|
|
34
|
+
case "left":
|
|
35
|
+
return {
|
|
36
|
+
justifyContent: "flex-start",
|
|
37
|
+
textAlign: "left"
|
|
38
|
+
};
|
|
39
|
+
case "right":
|
|
40
|
+
return {
|
|
41
|
+
justifyContent: "flex-end",
|
|
42
|
+
textAlign: "right"
|
|
43
|
+
};
|
|
44
|
+
case "center":
|
|
45
|
+
default:
|
|
46
|
+
return {
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
textAlign: "center"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return __jsx(_Box["default"], (0, _extends2["default"])({
|
|
53
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, className),
|
|
54
|
+
sx: _objectSpread(_objectSpread({
|
|
55
|
+
width: "100%",
|
|
56
|
+
height: "100%",
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center"
|
|
59
|
+
}, getAlignmentStyles()), styles)
|
|
60
|
+
}, rest), children);
|
|
61
|
+
}, function (prevProps, nextProps) {
|
|
62
|
+
// Custom comparison for memoization
|
|
63
|
+
var keysToCompare = ["horizontalalign", "children", "className", "styles", "item", "index"];
|
|
64
|
+
return keysToCompare.every(function (key) {
|
|
65
|
+
if (key === "item") {
|
|
66
|
+
return JSON.stringify(prevProps[key]) === JSON.stringify(nextProps[key]);
|
|
67
|
+
}
|
|
68
|
+
return prevProps[key] === nextProps[key];
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
WmCarouselTemplate.displayName = "WmCarouselTemplate";
|
|
72
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmCarouselTemplate);
|