@wavemaker/react-runtime 11.14.1-15.6409
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,611 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports["default"] = void 0;
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
16
|
+
var _List = _interopRequireDefault(require("@mui/material/List"));
|
|
17
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
18
|
+
var _components = require("@wavemaker/react-runtime/components/data/pagination/components");
|
|
19
|
+
var _components2 = require("./components");
|
|
20
|
+
var _common = require("@wavemaker/react-runtime/components/common");
|
|
21
|
+
var _hooks = require("./hooks");
|
|
22
|
+
var _constants = require("./utils/constants");
|
|
23
|
+
var _listHelpers = require("./utils/list-helpers");
|
|
24
|
+
var _utils = require("../table/utils");
|
|
25
|
+
var _listWidgetMethods = require("./utils/list-widget-methods");
|
|
26
|
+
var _types = require("../types");
|
|
27
|
+
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); }
|
|
28
|
+
var __jsx = _react["default"].createElement;
|
|
29
|
+
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; }
|
|
30
|
+
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; } // Import hooks
|
|
31
|
+
// Import components
|
|
32
|
+
// Import utilities
|
|
33
|
+
var WmList = function WmList(props) {
|
|
34
|
+
var _paginationState$pagi5, _paginationState$pagi6;
|
|
35
|
+
// ==================== PROPS DESTRUCTURING ====================
|
|
36
|
+
var className = props.className,
|
|
37
|
+
styles = props.styles,
|
|
38
|
+
width = props.width,
|
|
39
|
+
height = props.height,
|
|
40
|
+
_props$tabIndex = props.tabIndex,
|
|
41
|
+
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
|
42
|
+
_props$name = props.name,
|
|
43
|
+
name = _props$name === void 0 ? "list" : _props$name,
|
|
44
|
+
_props$boundarylinks = props.boundarylinks,
|
|
45
|
+
boundarylinks = _props$boundarylinks === void 0 ? _constants.LIST_DEFAULTS.BOUNDARY_LINKS : _props$boundarylinks,
|
|
46
|
+
_props$collapsible = props.collapsible,
|
|
47
|
+
collapsible = _props$collapsible === void 0 ? _constants.LIST_DEFAULTS.COLLAPSIBLE : _props$collapsible,
|
|
48
|
+
_props$direction = props.direction,
|
|
49
|
+
direction = _props$direction === void 0 ? _constants.LIST_DIRECTION.VERTICAL : _props$direction,
|
|
50
|
+
_props$disableitem = props.disableitem,
|
|
51
|
+
disableitem = _props$disableitem === void 0 ? false : _props$disableitem,
|
|
52
|
+
_props$enablereorder = props.enablereorder,
|
|
53
|
+
enablereorder = _props$enablereorder === void 0 ? false : _props$enablereorder,
|
|
54
|
+
_props$multiselect = props.multiselect,
|
|
55
|
+
multiselect = _props$multiselect === void 0 ? _constants.LIST_DEFAULTS.MULTISELECT : _props$multiselect,
|
|
56
|
+
_props$selectfirstite = props.selectfirstitem,
|
|
57
|
+
selectfirstitem = _props$selectfirstite === void 0 ? _constants.LIST_DEFAULTS.SELECT_FIRST_ITEM : _props$selectfirstite,
|
|
58
|
+
_props$selectionlimit = props.selectionlimit,
|
|
59
|
+
selectionlimit = _props$selectionlimit === void 0 ? _constants.LIST_DEFAULTS.SELECTION_LIMIT : _props$selectionlimit,
|
|
60
|
+
_props$hidehorizontal = props.hidehorizontalscrollbar,
|
|
61
|
+
hidehorizontalscrollbar = _props$hidehorizontal === void 0 ? false : _props$hidehorizontal,
|
|
62
|
+
_props$dataset = props.dataset,
|
|
63
|
+
dataset = _props$dataset === void 0 ? [] : _props$dataset,
|
|
64
|
+
_props$datafield = props.datafield,
|
|
65
|
+
datafield = _props$datafield === void 0 ? "" : _props$datafield,
|
|
66
|
+
_props$displayfield = props.displayfield,
|
|
67
|
+
displayfield = _props$displayfield === void 0 ? "" : _props$displayfield,
|
|
68
|
+
displaylabel = props.displaylabel,
|
|
69
|
+
getDisplayExpression = props.getDisplayExpression,
|
|
70
|
+
datasource = props.datasource,
|
|
71
|
+
_props$deferload = props.deferload,
|
|
72
|
+
deferload = _props$deferload === void 0 ? false : _props$deferload,
|
|
73
|
+
_props$groupby = props.groupby,
|
|
74
|
+
groupby = _props$groupby === void 0 ? "" : _props$groupby,
|
|
75
|
+
_props$orderby = props.orderby,
|
|
76
|
+
orderby = _props$orderby === void 0 ? "" : _props$orderby,
|
|
77
|
+
_props$navigation = props.navigation,
|
|
78
|
+
navigation = _props$navigation === void 0 ? _constants.LIST_NAVIGATION_TYPES.NONE : _props$navigation,
|
|
79
|
+
_props$navigationalig = props.navigationalign,
|
|
80
|
+
navigationalign = _props$navigationalig === void 0 ? _constants.LIST_ALIGN.LEFT : _props$navigationalig,
|
|
81
|
+
_props$pagesize = props.pagesize,
|
|
82
|
+
pagesize = _props$pagesize === void 0 ? _constants.LIST_DEFAULTS.PAGESIZE : _props$pagesize,
|
|
83
|
+
_props$maxsize = props.maxsize,
|
|
84
|
+
maxsize = _props$maxsize === void 0 ? _constants.LIST_DEFAULTS.MAX_SIZE : _props$maxsize,
|
|
85
|
+
_props$showcount = props.showcount,
|
|
86
|
+
showcount = _props$showcount === void 0 ? _constants.LIST_DEFAULTS.SHOW_COUNT : _props$showcount,
|
|
87
|
+
_props$showrecordcoun = props.showrecordcount,
|
|
88
|
+
showrecordcount = _props$showrecordcoun === void 0 ? _constants.LIST_DEFAULTS.SHOW_RECORD_COUNT : _props$showrecordcoun,
|
|
89
|
+
_props$allowpagesizec = props.allowpagesizechange,
|
|
90
|
+
allowpagesizechange = _props$allowpagesizec === void 0 ? true : _props$allowpagesizec,
|
|
91
|
+
_props$pagesizeoption = props.pagesizeoptions,
|
|
92
|
+
pagesizeoptions = _props$pagesizeoption === void 0 ? "5,10,20,50,100" : _props$pagesizeoption,
|
|
93
|
+
_props$paginationclas = props.paginationclass,
|
|
94
|
+
paginationclass = _props$paginationclas === void 0 ? "" : _props$paginationclas,
|
|
95
|
+
_props$showNavigation = props.showNavigation,
|
|
96
|
+
showNavigation = _props$showNavigation === void 0 ? true : _props$showNavigation,
|
|
97
|
+
_props$title = props.title,
|
|
98
|
+
title = _props$title === void 0 ? "" : _props$title,
|
|
99
|
+
_props$subheading = props.subheading,
|
|
100
|
+
subheading = _props$subheading === void 0 ? "" : _props$subheading,
|
|
101
|
+
_props$iconclass = props.iconclass,
|
|
102
|
+
iconclass = _props$iconclass === void 0 ? "" : _props$iconclass,
|
|
103
|
+
_props$nodatamessage = props.nodatamessage,
|
|
104
|
+
nodatamessage = _props$nodatamessage === void 0 ? _constants.LIST_MESSAGES.NO_DATA : _props$nodatamessage,
|
|
105
|
+
_props$loadingdatamsg = props.loadingdatamsg,
|
|
106
|
+
loadingdatamsg = _props$loadingdatamsg === void 0 ? _constants.LIST_MESSAGES.LOADING : _props$loadingdatamsg,
|
|
107
|
+
_props$loadingicon = props.loadingicon,
|
|
108
|
+
loadingicon = _props$loadingicon === void 0 ? "fa-spinner" : _props$loadingicon,
|
|
109
|
+
_props$ondemandmessag = props.ondemandmessage,
|
|
110
|
+
ondemandmessage = _props$ondemandmessag === void 0 ? _constants.LIST_MESSAGES.LOAD_MORE : _props$ondemandmessag,
|
|
111
|
+
_props$listclass = props.listclass,
|
|
112
|
+
listclass = _props$listclass === void 0 ? "list-group media-list" : _props$listclass,
|
|
113
|
+
_props$itemclass = props.itemclass,
|
|
114
|
+
itemclass = _props$itemclass === void 0 ? "list-group-item" : _props$itemclass,
|
|
115
|
+
_props$horizontalalig = props.horizontalalign,
|
|
116
|
+
horizontalalign = _props$horizontalalig === void 0 ? _constants.LIST_ALIGN.LEFT : _props$horizontalalig,
|
|
117
|
+
itemsperrow = props.itemsperrow,
|
|
118
|
+
_props$statehandler = props.statehandler,
|
|
119
|
+
statehandler = _props$statehandler === void 0 ? "URL" : _props$statehandler,
|
|
120
|
+
onSelect = props.onSelect,
|
|
121
|
+
onClick = props.onClick,
|
|
122
|
+
onDblclick = props.onDblclick,
|
|
123
|
+
onMouseEnter = props.onMouseEnter,
|
|
124
|
+
onMouseLeave = props.onMouseLeave,
|
|
125
|
+
onReorder = props.onReorder,
|
|
126
|
+
onSelectionlimitexceed = props.onSelectionlimitexceed,
|
|
127
|
+
onBeforedatarender = props.onBeforedatarender,
|
|
128
|
+
onRender = props.onRender,
|
|
129
|
+
onPaginationchange = props.onPaginationchange,
|
|
130
|
+
onSetrecord = props.onSetrecord,
|
|
131
|
+
onPageChange = props.onPageChange,
|
|
132
|
+
renderItem = props.renderItem,
|
|
133
|
+
children = props.children,
|
|
134
|
+
listener = props.listener;
|
|
135
|
+
|
|
136
|
+
// ==================== DATASOURCE SUBSCRIPTION ====================
|
|
137
|
+
// Disable state management for On-Demand and Scroll navigation
|
|
138
|
+
var effectiveStateHandlerForSubscription = navigation === _constants.LIST_NAVIGATION_TYPES.ON_DEMAND || navigation === _constants.LIST_NAVIGATION_TYPES.SCROLL ? "none" : statehandler;
|
|
139
|
+
|
|
140
|
+
// Subscribe to 'toggle-variable-state' event to handle state params
|
|
141
|
+
(0, _hooks.useDataSourceSubscription)({
|
|
142
|
+
datasource: datasource,
|
|
143
|
+
statehandler: effectiveStateHandlerForSubscription,
|
|
144
|
+
name: name,
|
|
145
|
+
onPageRestored: function onPageRestored(restoredPage) {
|
|
146
|
+
// Store the restored page number to apply when pagination is ready
|
|
147
|
+
setRestoredPageNumber(restoredPage);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// ==================== STATE INITIALIZATION ====================
|
|
152
|
+
var widgetInstance = listener === null || listener === void 0 ? void 0 : listener.Widgets[name];
|
|
153
|
+
|
|
154
|
+
// is dataset from modal variable
|
|
155
|
+
var _useState = (0, _react.useState)(false),
|
|
156
|
+
isDatasetFromModalVariable = _useState[0],
|
|
157
|
+
setIsDatasetFromModalVariable = _useState[1];
|
|
158
|
+
|
|
159
|
+
// Ensure dataset is always an array and add unique IDs
|
|
160
|
+
var safeDataset = (0, _react.useMemo)(function () {
|
|
161
|
+
var data = (0, _listHelpers.getSafeDataset)(dataset);
|
|
162
|
+
return (0, _utils.addUniqueRowIds)(data, {
|
|
163
|
+
type: "list"
|
|
164
|
+
});
|
|
165
|
+
}, [dataset]);
|
|
166
|
+
|
|
167
|
+
// Initial render tracking
|
|
168
|
+
var _useState2 = (0, _react.useState)(true),
|
|
169
|
+
initialRender = _useState2[0],
|
|
170
|
+
setinitialRender = _useState2[1];
|
|
171
|
+
|
|
172
|
+
// User interaction tracking
|
|
173
|
+
var userInitiatedSelectionRef = _react["default"].useRef(false);
|
|
174
|
+
|
|
175
|
+
// ==================== ON-DEMAND NAVIGATION STATE ====================
|
|
176
|
+
// For On-Demand navigation, accumulate data from multiple pages
|
|
177
|
+
var _useState3 = (0, _react.useState)([]),
|
|
178
|
+
accumulatedData = _useState3[0],
|
|
179
|
+
setAccumulatedData = _useState3[1];
|
|
180
|
+
var _useState4 = (0, _react.useState)(-1),
|
|
181
|
+
lastLoadedPage = _useState4[0],
|
|
182
|
+
setLastLoadedPage = _useState4[1];
|
|
183
|
+
var _useState5 = (0, _react.useState)(true),
|
|
184
|
+
isFirstLoad = _useState5[0],
|
|
185
|
+
setIsFirstLoad = _useState5[1];
|
|
186
|
+
var _useState6 = (0, _react.useState)(0),
|
|
187
|
+
onDemandCurrentPage = _useState6[0],
|
|
188
|
+
setOnDemandCurrentPage = _useState6[1];
|
|
189
|
+
|
|
190
|
+
// Determine if we're using server-side pagination
|
|
191
|
+
// Check if datasource is API-aware (server-side) rather than checking runtime pagination data
|
|
192
|
+
var isServerSidePagination = (0, _react.useMemo)(function () {
|
|
193
|
+
return !!(datasource && datasource.execute && datasource.execute(_types.DataSource.Operation.IS_PAGEABLE));
|
|
194
|
+
}, [datasource]);
|
|
195
|
+
|
|
196
|
+
// Use accumulated data for On-Demand navigation, otherwise use regular dataset
|
|
197
|
+
var effectiveDataset = (0, _react.useMemo)(function () {
|
|
198
|
+
if (navigation === _constants.LIST_NAVIGATION_TYPES.ON_DEMAND && datasource && accumulatedData.length > 0) {
|
|
199
|
+
return accumulatedData;
|
|
200
|
+
}
|
|
201
|
+
return safeDataset;
|
|
202
|
+
}, [navigation, datasource, accumulatedData, safeDataset]);
|
|
203
|
+
|
|
204
|
+
// ==================== STATE PERSISTENCE ====================
|
|
205
|
+
// Restore persisted state before initializing hooks
|
|
206
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
207
|
+
var _datasource$paginatio;
|
|
208
|
+
// Skip state restoration for On-Demand and Scroll navigation
|
|
209
|
+
if (navigation === _constants.LIST_NAVIGATION_TYPES.ON_DEMAND || navigation === _constants.LIST_NAVIGATION_TYPES.SCROLL) {
|
|
210
|
+
return {
|
|
211
|
+
initialPage: 1,
|
|
212
|
+
initialPageSize: pagesize,
|
|
213
|
+
initialSelectedItems: [],
|
|
214
|
+
initialActualPageSize: undefined
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
var persisted = (0, _listHelpers.getListState)(name, statehandler);
|
|
218
|
+
|
|
219
|
+
// Determine the actual page size (original datasource page size)
|
|
220
|
+
var actualPageSize;
|
|
221
|
+
if ((persisted === null || persisted === void 0 ? void 0 : persisted.actualpagesize) !== undefined) {
|
|
222
|
+
// If we have a persisted actualPageSize, use it (it should never change)
|
|
223
|
+
actualPageSize = persisted.actualpagesize;
|
|
224
|
+
} else if (datasource !== null && datasource !== void 0 && (_datasource$paginatio = datasource.pagination) !== null && _datasource$paginatio !== void 0 && _datasource$paginatio.size) {
|
|
225
|
+
// Otherwise, if this is the first load, capture it from datasource
|
|
226
|
+
actualPageSize = datasource.pagination.size;
|
|
227
|
+
} else if (datasource !== null && datasource !== void 0 && datasource.maxResults) {
|
|
228
|
+
// Fallback to maxResults if available
|
|
229
|
+
actualPageSize = datasource.maxResults;
|
|
230
|
+
}
|
|
231
|
+
if (persisted) {
|
|
232
|
+
// Get the pagination page
|
|
233
|
+
var restoredPage = persisted.pagination || 1;
|
|
234
|
+
|
|
235
|
+
// Get selected indices for the restored page if selectedItem exists
|
|
236
|
+
var selectedItemIndexes = persisted.selectedItem ? persisted.selectedItem.filter(function (item) {
|
|
237
|
+
return item.page === restoredPage;
|
|
238
|
+
}).map(function (item) {
|
|
239
|
+
return item.index;
|
|
240
|
+
}) : [];
|
|
241
|
+
|
|
242
|
+
// Get persisted page size
|
|
243
|
+
var persistedPageSize = persisted.pagesize || pagesize;
|
|
244
|
+
|
|
245
|
+
// Set datasource maxResults if we have a persisted pageSize and datasource
|
|
246
|
+
if (persisted.pagesize && isServerSidePagination && datasource && datasource.maxResults !== undefined) {
|
|
247
|
+
datasource.maxResults = persistedPageSize;
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
initialPage: restoredPage,
|
|
251
|
+
initialPageSize: persistedPageSize,
|
|
252
|
+
initialSelectedItems: selectedItemIndexes,
|
|
253
|
+
initialActualPageSize: actualPageSize
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
initialPage: 1,
|
|
258
|
+
initialPageSize: pagesize,
|
|
259
|
+
initialSelectedItems: [],
|
|
260
|
+
initialActualPageSize: actualPageSize
|
|
261
|
+
};
|
|
262
|
+
}, [name, statehandler, pagesize, navigation, isServerSidePagination, datasource]),
|
|
263
|
+
initialPage = _useMemo.initialPage,
|
|
264
|
+
initialPageSize = _useMemo.initialPageSize,
|
|
265
|
+
initialSelectedItems = _useMemo.initialSelectedItems,
|
|
266
|
+
initialActualPageSize = _useMemo.initialActualPageSize;
|
|
267
|
+
|
|
268
|
+
// ==================== PAGE RESTORE STATE ====================
|
|
269
|
+
// Store the restored page number until pagination state is ready
|
|
270
|
+
var _useState7 = (0, _react.useState)(null),
|
|
271
|
+
restoredPageNumber = _useState7[0],
|
|
272
|
+
setRestoredPageNumber = _useState7[1];
|
|
273
|
+
|
|
274
|
+
// ==================== DATA PROCESSING HOOKS ====================
|
|
275
|
+
// Process dataset with ordering and transformations
|
|
276
|
+
var orderedDataset = (0, _hooks.useListData)(effectiveDataset, {
|
|
277
|
+
datafield: datafield,
|
|
278
|
+
displayfield: displayfield,
|
|
279
|
+
displaylabel: displaylabel,
|
|
280
|
+
getDisplayExpression: getDisplayExpression,
|
|
281
|
+
orderby: orderby,
|
|
282
|
+
groupby: groupby
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
// Drag and drop functionality
|
|
286
|
+
var _useDragAndDrop = (0, _components2.useDragAndDrop)(orderedDataset, onReorder, orderby),
|
|
287
|
+
items = _useDragAndDrop.items,
|
|
288
|
+
handleDragEnd = _useDragAndDrop.handleDragEnd,
|
|
289
|
+
hasBeenReordered = _useDragAndDrop.hasBeenReordered;
|
|
290
|
+
|
|
291
|
+
// Group data if groupby is specified
|
|
292
|
+
var groupedData = (0, _hooks.useGroupedData)(items, groupby);
|
|
293
|
+
|
|
294
|
+
// ==================== PAGINATION HOOK ====================
|
|
295
|
+
var paginationState = (0, _hooks.useListPagination)({
|
|
296
|
+
items: items,
|
|
297
|
+
groupedData: groupedData,
|
|
298
|
+
groupby: groupby,
|
|
299
|
+
pagesize: initialPageSize,
|
|
300
|
+
allowpagesizechange: allowpagesizechange,
|
|
301
|
+
pagesizeoptions: pagesizeoptions,
|
|
302
|
+
navigation: navigation,
|
|
303
|
+
initialPage: initialPage,
|
|
304
|
+
datasource: datasource
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// ==================== LIST STATE HOOK ====================
|
|
308
|
+
var listState = (0, _hooks.useListState)(items, paginationState.currentPageSize, selectfirstitem, selectionlimit, listener, name);
|
|
309
|
+
|
|
310
|
+
// ==================== EVENT HANDLERS HOOK ====================
|
|
311
|
+
var eventHandlers = (0, _hooks.useListEventHandlers)({
|
|
312
|
+
items: items,
|
|
313
|
+
multiselect: multiselect,
|
|
314
|
+
disableitem: disableitem,
|
|
315
|
+
selectionlimit: selectionlimit,
|
|
316
|
+
collapsible: collapsible,
|
|
317
|
+
selectedItems: listState.selectedItems,
|
|
318
|
+
setSelectedItems: listState.setSelectedItems,
|
|
319
|
+
activeItems: listState.activeItems,
|
|
320
|
+
setActiveItems: listState.setActiveItems,
|
|
321
|
+
firstSelectedItem: listState.firstSelectedItem,
|
|
322
|
+
setFirstSelectedItem: listState.setFirstSelectedItem,
|
|
323
|
+
groupCollapsed: listState.groupCollapsed,
|
|
324
|
+
setGroupCollapsed: listState.setGroupCollapsed,
|
|
325
|
+
currentPage: paginationState.currentPage,
|
|
326
|
+
setCurrentPage: paginationState.setCurrentPage,
|
|
327
|
+
visibleItems: paginationState.visibleItems,
|
|
328
|
+
setVisibleItems: paginationState.setVisibleItems,
|
|
329
|
+
isLoadingMore: listState.isLoadingMore,
|
|
330
|
+
setIsLoadingMore: listState.setIsLoadingMore,
|
|
331
|
+
onClick: onClick,
|
|
332
|
+
onDblclick: onDblclick,
|
|
333
|
+
onMouseEnter: onMouseEnter,
|
|
334
|
+
onMouseLeave: onMouseLeave,
|
|
335
|
+
onSelectionlimitexceed: onSelectionlimitexceed,
|
|
336
|
+
onPaginationchange: onPaginationchange,
|
|
337
|
+
onPageChange: onPageChange,
|
|
338
|
+
onSetrecord: onSetrecord,
|
|
339
|
+
widgetInstance: widgetInstance,
|
|
340
|
+
onSelect: onSelect,
|
|
341
|
+
userInitiatedSelectionRef: userInitiatedSelectionRef,
|
|
342
|
+
datasource: datasource,
|
|
343
|
+
pagesize: paginationState.currentPageSize,
|
|
344
|
+
navigation: navigation,
|
|
345
|
+
onDemandCurrentPage: onDemandCurrentPage,
|
|
346
|
+
setOnDemandCurrentPage: setOnDemandCurrentPage,
|
|
347
|
+
isServerSidePagination: isServerSidePagination,
|
|
348
|
+
listener: listener,
|
|
349
|
+
name: name
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// ==================== WIDGET METHODS ====================
|
|
353
|
+
var widgetMethods = (0, _listWidgetMethods.useListWidgetMethods)(items, listState, multiselect, onSelect, widgetInstance, listener, userInitiatedSelectionRef, name);
|
|
354
|
+
|
|
355
|
+
// ==================== STATE MANAGEMENT ====================
|
|
356
|
+
// Disable state management for On-Demand and Scroll navigation
|
|
357
|
+
var effectiveStateHandler = navigation === _constants.LIST_NAVIGATION_TYPES.ON_DEMAND || navigation === _constants.LIST_NAVIGATION_TYPES.SCROLL ? "none" : statehandler;
|
|
358
|
+
var stateManager = (0, _hooks.useListStateManager)({
|
|
359
|
+
name: name,
|
|
360
|
+
storage: effectiveStateHandler,
|
|
361
|
+
currentPage: paginationState.currentPage,
|
|
362
|
+
currentPageSize: paginationState.currentPageSize,
|
|
363
|
+
selectedItems: listState.selectedItems,
|
|
364
|
+
items: items,
|
|
365
|
+
initialActualPageSize: initialActualPageSize,
|
|
366
|
+
multiselect: multiselect,
|
|
367
|
+
isServerSidePagination: isServerSidePagination,
|
|
368
|
+
datasource: datasource
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// ==================== ALL SIDE EFFECTS ====================
|
|
372
|
+
(0, _hooks.useListEffects)({
|
|
373
|
+
name: name,
|
|
374
|
+
navigation: navigation,
|
|
375
|
+
datasource: datasource,
|
|
376
|
+
safeDataset: safeDataset,
|
|
377
|
+
items: items,
|
|
378
|
+
orderedDataset: orderedDataset,
|
|
379
|
+
groupedData: groupedData,
|
|
380
|
+
groupby: groupby,
|
|
381
|
+
orderby: orderby,
|
|
382
|
+
selectfirstitem: selectfirstitem,
|
|
383
|
+
statehandler: effectiveStateHandler,
|
|
384
|
+
accumulatedData: accumulatedData,
|
|
385
|
+
lastLoadedPage: lastLoadedPage,
|
|
386
|
+
isFirstLoad: isFirstLoad,
|
|
387
|
+
onDemandCurrentPage: onDemandCurrentPage,
|
|
388
|
+
hasBeenReordered: hasBeenReordered,
|
|
389
|
+
initialRender: initialRender,
|
|
390
|
+
initialPage: initialPage,
|
|
391
|
+
initialPageSize: initialPageSize,
|
|
392
|
+
initialSelectedItems: initialSelectedItems,
|
|
393
|
+
initialActualPageSize: initialActualPageSize,
|
|
394
|
+
setAccumulatedData: setAccumulatedData,
|
|
395
|
+
setLastLoadedPage: setLastLoadedPage,
|
|
396
|
+
setIsFirstLoad: setIsFirstLoad,
|
|
397
|
+
setOnDemandCurrentPage: setOnDemandCurrentPage,
|
|
398
|
+
setinitialRender: setinitialRender,
|
|
399
|
+
listState: listState,
|
|
400
|
+
paginationState: paginationState,
|
|
401
|
+
widgetMethods: widgetMethods,
|
|
402
|
+
onSelect: onSelect,
|
|
403
|
+
widgetInstance: widgetInstance,
|
|
404
|
+
listener: listener,
|
|
405
|
+
userInitiatedSelectionRef: userInitiatedSelectionRef,
|
|
406
|
+
restoredPageNumber: restoredPageNumber,
|
|
407
|
+
setRestoredPageNumber: setRestoredPageNumber,
|
|
408
|
+
showNavigation: showNavigation,
|
|
409
|
+
stateManager: stateManager
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
// ==================== COMPUTED VALUES ====================
|
|
413
|
+
// Use datasource noDataFound if available, otherwise check safeDataset
|
|
414
|
+
var noDataFound = !safeDataset || safeDataset.length === 0;
|
|
415
|
+
var itemsPerRowClass = (0, _listHelpers.getItemsPerRowClass)(itemsperrow, direction);
|
|
416
|
+
var textAlignClass = (0, _listHelpers.getTextAlignClass)(horizontalalign);
|
|
417
|
+
|
|
418
|
+
// ==================== EVENT HANDLER FUNCTIONS ====================
|
|
419
|
+
var handlePageSizeChange = function handlePageSizeChange(newPageSize) {
|
|
420
|
+
// Get the old page size BEFORE updating
|
|
421
|
+
var oldPageSize = paginationState.currentPageSize;
|
|
422
|
+
|
|
423
|
+
// Get current persisted state to access all selected items across pages
|
|
424
|
+
var currentPersistedState = (0, _listHelpers.getListState)(name, statehandler);
|
|
425
|
+
|
|
426
|
+
// Build the state for page size change
|
|
427
|
+
var newState = stateManager.getStateForPageSizeChange(newPageSize, currentPersistedState === null || currentPersistedState === void 0 ? void 0 : currentPersistedState.selectedItem, (currentPersistedState === null || currentPersistedState === void 0 ? void 0 : currentPersistedState.pagesize) || oldPageSize);
|
|
428
|
+
|
|
429
|
+
// Save the state BEFORE changing page size
|
|
430
|
+
(0, _listHelpers.saveListState)(name, statehandler, newState);
|
|
431
|
+
|
|
432
|
+
// Update datasource maxResults if datasource has paging capability (similar to Angular)
|
|
433
|
+
if (isServerSidePagination && datasource && datasource.maxResults !== undefined) {
|
|
434
|
+
datasource.maxResults = newPageSize;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Update page size
|
|
438
|
+
paginationState.setCurrentPageSize(newPageSize);
|
|
439
|
+
|
|
440
|
+
// Reset to first page (similar to Angular behavior)
|
|
441
|
+
paginationState.setCurrentPage(1);
|
|
442
|
+
paginationState.setVisibleItems(newPageSize);
|
|
443
|
+
};
|
|
444
|
+
var showPaginationBasedOnVariableConfiguration = (0, _react.useMemo)(function () {
|
|
445
|
+
var _paginationState$pagi, _paginationState$pagi2, _paginationState$pagi3, _paginationState$pagi4;
|
|
446
|
+
// if dataset is from modal variable(means client side pagination, all records are loaded in the dataset on first load itself) then show pagination if records are greater than 5 records
|
|
447
|
+
|
|
448
|
+
if (isDatasetFromModalVariable && paginationState !== null && paginationState !== void 0 && paginationState.totalItems) {
|
|
449
|
+
// if records are less than 5 records then do not show pagination
|
|
450
|
+
if ((paginationState === null || paginationState === void 0 ? void 0 : paginationState.totalItems) < _constants.LIST_DEFAULTS.PAGESIZE_FOR_MODAL_VARIABLE) {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
// In modal variable if total records are greater than 5 then set current page size to 5 and show pagination
|
|
454
|
+
paginationState.setCurrentPageSize(_constants.LIST_DEFAULTS.PAGESIZE_FOR_MODAL_VARIABLE);
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
if ((paginationState === null || paginationState === void 0 || (_paginationState$pagi = paginationState.paginationMeta) === null || _paginationState$pagi === void 0 ? void 0 : _paginationState$pagi.totalElements) === undefined || (paginationState === null || paginationState === void 0 || (_paginationState$pagi2 = paginationState.paginationMeta) === null || _paginationState$pagi2 === void 0 ? void 0 : _paginationState$pagi2.size) === undefined) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
return (paginationState === null || paginationState === void 0 || (_paginationState$pagi3 = paginationState.paginationMeta) === null || _paginationState$pagi3 === void 0 ? void 0 : _paginationState$pagi3.totalElements) > ((_paginationState$pagi4 = paginationState.paginationMeta) === null || _paginationState$pagi4 === void 0 ? void 0 : _paginationState$pagi4.size);
|
|
461
|
+
}, [paginationState === null || paginationState === void 0 || (_paginationState$pagi5 = paginationState.paginationMeta) === null || _paginationState$pagi5 === void 0 ? void 0 : _paginationState$pagi5.totalElements, paginationState === null || paginationState === void 0 || (_paginationState$pagi6 = paginationState.paginationMeta) === null || _paginationState$pagi6 === void 0 ? void 0 : _paginationState$pagi6.size, isDatasetFromModalVariable, paginationState === null || paginationState === void 0 ? void 0 : paginationState.totalItems]);
|
|
462
|
+
|
|
463
|
+
// check if dataset is from modal variable
|
|
464
|
+
(0, _react.useEffect)(function () {
|
|
465
|
+
(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
466
|
+
var result;
|
|
467
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
468
|
+
while (1) switch (_context.prev = _context.next) {
|
|
469
|
+
case 0:
|
|
470
|
+
_context.next = 2;
|
|
471
|
+
return datasource && datasource.execute && (datasource === null || datasource === void 0 ? void 0 : datasource.execute(_types.DataSource.Operation.IS_API_AWARE));
|
|
472
|
+
case 2:
|
|
473
|
+
result = _context.sent;
|
|
474
|
+
if (result === false) {
|
|
475
|
+
setIsDatasetFromModalVariable(true);
|
|
476
|
+
} else {
|
|
477
|
+
setIsDatasetFromModalVariable(false);
|
|
478
|
+
}
|
|
479
|
+
case 4:
|
|
480
|
+
case "end":
|
|
481
|
+
return _context.stop();
|
|
482
|
+
}
|
|
483
|
+
}, _callee);
|
|
484
|
+
}))();
|
|
485
|
+
}, [datasource]);
|
|
486
|
+
|
|
487
|
+
// ==================== RENDER ====================
|
|
488
|
+
return __jsx(_Box["default"], {
|
|
489
|
+
className: (0, _clsx["default"])(_constants.DEFAULT_CLS, groupby ? listclass : className),
|
|
490
|
+
sx: _objectSpread(_objectSpread({}, styles), {}, {
|
|
491
|
+
height: "".concat(height, " !important"),
|
|
492
|
+
width: "".concat(width, " !important"),
|
|
493
|
+
overflow: "inherit !important",
|
|
494
|
+
position: "relative"
|
|
495
|
+
}),
|
|
496
|
+
component: "div",
|
|
497
|
+
"data-name": name,
|
|
498
|
+
"data-navigation": navigation
|
|
499
|
+
}, __jsx(_components2.ListHeader, {
|
|
500
|
+
title: title,
|
|
501
|
+
subheading: subheading,
|
|
502
|
+
iconclass: iconclass
|
|
503
|
+
}), datasource !== null && datasource !== void 0 && datasource.loading ? __jsx(_common.AppSpinner, {
|
|
504
|
+
show: true,
|
|
505
|
+
spinnermessages: [loadingdatamsg]
|
|
506
|
+
}) : /* Main Content */
|
|
507
|
+
__jsx(_components.InlineNavigation, {
|
|
508
|
+
navigation: navigation,
|
|
509
|
+
currentPage: paginationState.currentPage,
|
|
510
|
+
totalPages: paginationState.effectiveTotalPages,
|
|
511
|
+
noDataFound: noDataFound,
|
|
512
|
+
onPageChange: eventHandlers.handlePageChange,
|
|
513
|
+
isLoading: listState.isLoadingMore,
|
|
514
|
+
showNavigation: showNavigation
|
|
515
|
+
}, __jsx(_List["default"], {
|
|
516
|
+
className: (0, _clsx["default"])("app-livelist-container", "clearfix", listclass, textAlignClass, hidehorizontalscrollbar ? "hide-scrollbar" : "", direction === _constants.LIST_DIRECTION.HORIZONTAL ? "app-horizontal-list" : ""),
|
|
517
|
+
tabIndex: tabIndex,
|
|
518
|
+
role: "list",
|
|
519
|
+
sx: {
|
|
520
|
+
"& .app-livelist": {
|
|
521
|
+
overflowX: "hidden"
|
|
522
|
+
},
|
|
523
|
+
'&[data-dnd-dragging="true"]': {
|
|
524
|
+
overflowX: "hidden"
|
|
525
|
+
},
|
|
526
|
+
// Simple horizontal list layout
|
|
527
|
+
"& .app-horizontal-list": {
|
|
528
|
+
display: "flex",
|
|
529
|
+
flexDirection: "row",
|
|
530
|
+
flexWrap: direction === _constants.LIST_DIRECTION.HORIZONTAL ? "wrap" : "nowrap",
|
|
531
|
+
"& .app-list-item": {
|
|
532
|
+
minWidth: "fit-content",
|
|
533
|
+
flexShrink: 0
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}, noDataFound ? __jsx(_components2.NoDataMessage, {
|
|
538
|
+
message: nodatamessage
|
|
539
|
+
}) : __jsx(_components2.ListItems, {
|
|
540
|
+
items: items,
|
|
541
|
+
groupedData: groupedData,
|
|
542
|
+
groupby: groupby,
|
|
543
|
+
navigation: navigation,
|
|
544
|
+
currentPage: paginationState.currentPage,
|
|
545
|
+
pagesize: paginationState.currentPageSize,
|
|
546
|
+
visibleItems: paginationState.visibleItems,
|
|
547
|
+
orderby: orderby,
|
|
548
|
+
disableitem: disableitem,
|
|
549
|
+
itemclass: itemclass,
|
|
550
|
+
itemsPerRowClass: itemsPerRowClass,
|
|
551
|
+
direction: direction,
|
|
552
|
+
enablereorder: enablereorder,
|
|
553
|
+
activeItems: listState.activeItems,
|
|
554
|
+
name: name,
|
|
555
|
+
tabIndex: tabIndex,
|
|
556
|
+
renderItem: renderItem,
|
|
557
|
+
itemTemplate: children,
|
|
558
|
+
nodatamessage: nodatamessage,
|
|
559
|
+
ondemandmessage: ondemandmessage,
|
|
560
|
+
loadingicon: loadingicon,
|
|
561
|
+
loadingdatamsg: loadingdatamsg,
|
|
562
|
+
paginationclass: paginationclass,
|
|
563
|
+
isLoadingMore: listState.isLoadingMore,
|
|
564
|
+
collapsible: collapsible,
|
|
565
|
+
showcount: showcount,
|
|
566
|
+
groupCollapsed: listState.groupCollapsed,
|
|
567
|
+
handleListItemClick: eventHandlers.handleListItemClick,
|
|
568
|
+
handleListItemDoubleClick: eventHandlers.handleListItemDoubleClick,
|
|
569
|
+
handleListItemMouseEnter: eventHandlers.handleListItemMouseEnter,
|
|
570
|
+
handleListItemMouseLeave: eventHandlers.handleListItemMouseLeave,
|
|
571
|
+
handleDragEnd: handleDragEnd,
|
|
572
|
+
handleLoadMore: eventHandlers.handleLoadMore,
|
|
573
|
+
handleHeaderClick: eventHandlers.handleHeaderClick,
|
|
574
|
+
onBeforedatarender: onBeforedatarender,
|
|
575
|
+
onRender: onRender,
|
|
576
|
+
widgetInstance: widgetInstance,
|
|
577
|
+
rawDataset: safeDataset,
|
|
578
|
+
datasource: datasource,
|
|
579
|
+
totalItems: paginationState.totalItems,
|
|
580
|
+
isServerSidePagination: isServerSidePagination,
|
|
581
|
+
showNavigation: showNavigation
|
|
582
|
+
})), showPaginationBasedOnVariableConfiguration && showNavigation && navigation && navigation !== _constants.LIST_NAVIGATION_TYPES.INLINE && navigation !== _constants.LIST_NAVIGATION_TYPES.ON_DEMAND && navigation !== _constants.LIST_NAVIGATION_TYPES.NONE && __jsx(_Box["default"], {
|
|
583
|
+
component: "div",
|
|
584
|
+
className: "panel-footer"
|
|
585
|
+
}, __jsx(_components2.ListPagination, {
|
|
586
|
+
name: name,
|
|
587
|
+
navigation: navigation,
|
|
588
|
+
orderedDataset: groupby ? Array(paginationState.totalItems).fill(null) : items,
|
|
589
|
+
pagesize: paginationState.currentPageSize,
|
|
590
|
+
navigationalign: navigationalign,
|
|
591
|
+
showrecordcount: showrecordcount,
|
|
592
|
+
maxsize: maxsize,
|
|
593
|
+
boundarylinks: boundarylinks,
|
|
594
|
+
paginationclass: paginationclass,
|
|
595
|
+
allowpagesizechange: allowpagesizechange,
|
|
596
|
+
pagesizeoptions: pagesizeoptions,
|
|
597
|
+
widgetInstance: widgetInstance,
|
|
598
|
+
onPaginationChange: eventHandlers.handlePaginationChange,
|
|
599
|
+
onSetRecord: eventHandlers.handleSetRecord,
|
|
600
|
+
onPageSizeChange: handlePageSizeChange,
|
|
601
|
+
currentPage: paginationState.currentPage,
|
|
602
|
+
listener: listener,
|
|
603
|
+
paginationMeta: paginationState.paginationMeta,
|
|
604
|
+
totalItems: paginationState.totalItems,
|
|
605
|
+
datasource: datasource,
|
|
606
|
+
isLoadingMore: listState.isLoadingMore,
|
|
607
|
+
setIsLoadingMore: listState.setIsLoadingMore,
|
|
608
|
+
isServerSidePagination: isServerSidePagination
|
|
609
|
+
}))));
|
|
610
|
+
};
|
|
611
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmList);
|
|
@@ -0,0 +1,53 @@
|
|
|
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.MediaWmListtemplate = void 0;
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _ListItem = require("../components/ListItem");
|
|
12
|
+
var _image = _interopRequireDefault(require("next/image"));
|
|
13
|
+
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); }
|
|
14
|
+
var __jsx = _react["default"].createElement;
|
|
15
|
+
// Default List Item Template Component
|
|
16
|
+
|
|
17
|
+
var MediaWmListtemplate = exports.MediaWmListtemplate = function MediaWmListtemplate() {
|
|
18
|
+
var context = (0, _react.useContext)(_ListItem.ListItemContext);
|
|
19
|
+
var item = (context === null || context === void 0 ? void 0 : context.item) || {};
|
|
20
|
+
return __jsx(_material.Box, {
|
|
21
|
+
component: "div",
|
|
22
|
+
className: "media"
|
|
23
|
+
}, __jsx(_material.Box, {
|
|
24
|
+
component: "div",
|
|
25
|
+
className: "media-left"
|
|
26
|
+
}, __jsx(_image["default"], {
|
|
27
|
+
src: (item === null || item === void 0 ? void 0 : item.picurl) || "/placeholder.png",
|
|
28
|
+
alt: "Profile",
|
|
29
|
+
className: "media-object",
|
|
30
|
+
width: 32,
|
|
31
|
+
height: 32,
|
|
32
|
+
style: {
|
|
33
|
+
borderRadius: "50%"
|
|
34
|
+
}
|
|
35
|
+
})), __jsx(_material.Box, {
|
|
36
|
+
component: "div",
|
|
37
|
+
className: "media-body"
|
|
38
|
+
}, __jsx(_material.Typography, {
|
|
39
|
+
className: "media-heading",
|
|
40
|
+
variant: "h6"
|
|
41
|
+
}, (item === null || item === void 0 ? void 0 : item.title) || "No Name"), __jsx(_material.Typography, {
|
|
42
|
+
className: "text-muted",
|
|
43
|
+
variant: "body2"
|
|
44
|
+
}, (item === null || item === void 0 ? void 0 : item.description) || "No Description")), __jsx(_material.Box, {
|
|
45
|
+
component: "div",
|
|
46
|
+
className: "media-right media-top"
|
|
47
|
+
}, __jsx(_material.Button, {
|
|
48
|
+
className: "btn-transparent",
|
|
49
|
+
"aria-label": "Share"
|
|
50
|
+
}, __jsx("i", {
|
|
51
|
+
className: "wi wi-share fa-2x"
|
|
52
|
+
}))));
|
|
53
|
+
};
|