@wavemaker/react-runtime 11.14.1-16.6404
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/base-action.js +32 -0
- package/actions/login-action.js +53 -0
- package/actions/logout-action.js +41 -0
- package/actions/navigation-action.js +145 -0
- package/actions/notification-action.js +147 -0
- package/actions/timer-action.js +164 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.js +115 -0
- package/actions/toast.service.js +94 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.js +456 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.js +72 -0
- package/components/advanced/login/index.js +307 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.js +158 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.js +239 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.js +61 -0
- package/components/basic/html/index.js +158 -0
- package/components/basic/icon/index.js +85 -0
- package/components/basic/iframe/iframe.utils.js +10 -0
- package/components/basic/iframe/index.js +95 -0
- package/components/basic/label/index.js +139 -0
- package/components/basic/message/index.js +120 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.js +117 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.js +168 -0
- package/components/basic/progress-bar/props.js +18 -0
- package/components/basic/progress-circle/index.js +196 -0
- package/components/basic/progress-circle/props.js +16 -0
- package/components/basic/richtexteditor/index.js +533 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.js +1023 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.js +350 -0
- package/components/basic/spinner/index.js +202 -0
- package/components/basic/spinner/props.js +12 -0
- package/components/basic/tile/index.js +91 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +142 -0
- package/components/basic/tree/index.js +503 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.js +154 -0
- package/components/basic/video/index.js +85 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/components/barColumnChart/index.js +132 -0
- package/components/chart/components/barColumnChart/props.js +5 -0
- package/components/chart/components/bubbleChart/index.js +176 -0
- package/components/chart/components/bubbleChart/props.js +5 -0
- package/components/chart/components/chartLegend/components/ClassicLegendItem.js +39 -0
- package/components/chart/components/chartLegend/components/FuriousLegendItem.js +81 -0
- package/components/chart/components/chartLegend/index.js +69 -0
- package/components/chart/components/chartLegend/props.js +5 -0
- package/components/chart/components/chartLegend/utils.js +31 -0
- package/components/chart/components/chartTooltip/index.js +53 -0
- package/components/chart/components/chartTooltip/styles.js +37 -0
- package/components/chart/components/chartTooltip/utils.js +23 -0
- package/components/chart/components/cumulativeLineChart/index.js +113 -0
- package/components/chart/components/cumulativeLineChart/props.js +5 -0
- package/components/chart/components/cumulativeLineChart/utils.js +34 -0
- package/components/chart/components/index.js +40 -0
- package/components/chart/components/lineAreaChart/index.js +140 -0
- package/components/chart/components/lineAreaChart/props.js +5 -0
- package/components/chart/components/noDataMessage/index.js +27 -0
- package/components/chart/components/pieDonutChart/index.js +171 -0
- package/components/chart/components/pieDonutChart/props.js +5 -0
- package/components/chart/constant.js +72 -0
- package/components/chart/index.js +930 -0
- package/components/chart/props.js +5 -0
- package/components/chart/utils.js +691 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.js +12 -0
- package/components/constants.js +1208 -0
- package/components/container/accordion/accordion-pane/index.js +108 -0
- package/components/container/accordion/accordion-pane/props.js +11 -0
- package/components/container/accordion/index.js +232 -0
- package/components/container/accordion/props.js +13 -0
- package/components/container/alignment-utils.js +183 -0
- package/components/container/index.js +188 -0
- package/components/container/layout-grid/grid-column/index.js +34 -0
- package/components/container/layout-grid/grid-row/index.js +24 -0
- package/components/container/layout-grid/index.js +33 -0
- package/components/container/linear-layout/index.js +72 -0
- package/components/container/linear-layout/linear-layout-item/index.js +43 -0
- package/components/container/panel/components/panel-header/index.js +144 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.js +286 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.js +5 -0
- package/components/container/tabs/index.js +379 -0
- package/components/container/tabs/props.js +20 -0
- package/components/container/tabs/tab-pane/index.js +42 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.js +100 -0
- package/components/container/wizard/components/WizardStep.js +89 -0
- package/components/container/wizard/index.js +710 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.js +133 -0
- package/components/container/wizard/wizard-action/index.js +22 -0
- package/components/container/wizard/wizard-step/index.js +94 -0
- package/components/data/card/card-actions/index.js +24 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.js +24 -0
- package/components/data/card/index.js +246 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/index.js +460 -0
- package/components/data/form/base-form/props.js +29 -0
- package/components/data/form/base-form/utils.js +42 -0
- package/components/data/form/dynamic-fields/index.js +196 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.js +237 -0
- package/components/data/form/form-action/index.js +71 -0
- package/components/data/form/form-body/index.js +26 -0
- package/components/data/form/form-context.js +34 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/validation-contrustor.js +313 -0
- package/components/data/form/form-controller/withFormController.js +320 -0
- package/components/data/form/form-field/base-field.js +138 -0
- package/components/data/form/form-field/index.js +36 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.js +26 -0
- package/components/data/form/form-header/index.js +56 -0
- package/components/data/form/index.js +39 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.js +98 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.js +241 -0
- package/components/data/list/components/ListHeader.js +59 -0
- package/components/data/list/components/ListItem.js +148 -0
- package/components/data/list/components/ListItemWithTemplate.js +59 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.js +165 -0
- package/components/data/list/components/LoadMoreButton.js +39 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.js +84 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.js +285 -0
- package/components/data/list/hooks/useListEventHandlers.js +291 -0
- package/components/data/list/hooks/useListPagination.js +168 -0
- package/components/data/list/hooks/useListState.js +98 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +121 -0
- package/components/data/list/index.js +611 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.js +53 -0
- package/components/data/list/utils/constants.js +81 -0
- package/components/data/list/utils/list-helpers.js +173 -0
- package/components/data/list/utils/list-widget-methods.js +114 -0
- package/components/data/live-filter/index.js +279 -0
- package/components/data/live-filter/props.js +12 -0
- package/components/data/live-form/index.js +93 -0
- package/components/data/live-form/props.js +16 -0
- package/components/data/pagination/components/BasicPagination.js +77 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.js +175 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.js +52 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.js +796 -0
- package/components/data/pagination/index.js +322 -0
- package/components/data/table/components/AddNewRow.js +190 -0
- package/components/data/table/components/EditableCell.js +91 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/TableBody.js +279 -0
- package/components/data/table/components/TableFilters.js +325 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.js +174 -0
- package/components/data/table/components/TablePanelHeading.js +68 -0
- package/components/data/table/components/index.js +74 -0
- package/components/data/table/hooks/index.js +219 -0
- package/components/data/table/hooks/useCellState.js +117 -0
- package/components/data/table/hooks/useDynamicColumns.js +85 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.js +184 -0
- package/components/data/table/hooks/usePaginationState.js +60 -0
- package/components/data/table/hooks/usePanelStructure.js +40 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.js +110 -0
- package/components/data/table/hooks/useRowHandlers.js +38 -0
- package/components/data/table/hooks/useRowSelection.js +213 -0
- package/components/data/table/hooks/useServerSideSorting.js +165 -0
- package/components/data/table/hooks/useTableColumns.js +263 -0
- package/components/data/table/hooks/useTableData.js +154 -0
- package/components/data/table/hooks/useTableEdit.js +467 -0
- package/components/data/table/hooks/useTableEffects.js +139 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.js +103 -0
- package/components/data/table/hooks/useTableState.js +69 -0
- package/components/data/table/hooks/useTableStateManager.js +558 -0
- package/components/data/table/index.js +1295 -0
- package/components/data/table/live-table/index.js +232 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.js +78 -0
- package/components/data/table/table-column/index.js +35 -0
- package/components/data/table/table-row/index.js +49 -0
- package/components/data/table/table-row-action/index.js +74 -0
- package/components/data/table/utils/buildSelectionColumns.js +173 -0
- package/components/data/table/utils/columnBuilder.js +209 -0
- package/components/data/table/utils/columnProxy.js +48 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.js +80 -0
- package/components/data/table/utils/crud-handlers.js +518 -0
- package/components/data/table/utils/dynamic-columns.js +118 -0
- package/components/data/table/utils/index.js +607 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/selectionUtils.js +166 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.js +124 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.js +80 -0
- package/components/dialogs/confirm-dialog/index.js +105 -0
- package/components/dialogs/dialog/index.js +56 -0
- package/components/dialogs/dialog-actions/index.js +18 -0
- package/components/dialogs/dialog-body/index.js +21 -0
- package/components/dialogs/dialog-content/index.js +30 -0
- package/components/dialogs/dialog-header/index.js +93 -0
- package/components/dialogs/iframe-dialog/index.js +114 -0
- package/components/dialogs/index.js +129 -0
- package/components/dialogs/login-dialog/index.js +369 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.js +96 -0
- package/components/dialogs/withDialogWrapper.js +108 -0
- package/components/form/button/index.js +216 -0
- package/components/form/button-group/index.js +60 -0
- package/components/input/calendar/index.js +546 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.js +340 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.js +488 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.js +259 -0
- package/components/input/color-picker/index.js +678 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.js +137 -0
- package/components/input/currency/index.js +263 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.js +230 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.js +476 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/radioset/index.js +379 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.js +490 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +220 -0
- package/components/input/epoch/date/index.js +520 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.js +108 -0
- package/components/input/epoch/datetime/index.js +656 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/datetime/utils.js +244 -0
- package/components/input/epoch/time/index.js +412 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.js +209 -0
- package/components/input/fileupload/Utils.js +134 -0
- package/components/input/fileupload/components/ListItems.js +140 -0
- package/components/input/fileupload/components/MultiUpload.js +85 -0
- package/components/input/fileupload/components/SingleUpload.js +65 -0
- package/components/input/fileupload/index.js +170 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.js +400 -0
- package/components/input/number/index.js +295 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.js +368 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.js +344 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.js +167 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.js +434 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.js +179 -0
- package/components/input/textarea/index.js +347 -0
- package/components/input/textarea/props.js +5 -0
- package/components/layout/footer/index.js +30 -0
- package/components/layout/header/index.js +30 -0
- package/components/layout/leftnav/index.js +44 -0
- package/components/layout/rightnav/index.js +32 -0
- package/components/layout/topnav/index.js +34 -0
- package/components/navbar/index.js +41 -0
- package/components/navbar/nav/index.js +102 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.js +44 -0
- package/components/navigation/breadcrumb/index.js +56 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.js +66 -0
- package/components/navigation/menu/constants.js +101 -0
- package/components/navigation/menu/index.js +807 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/popover/index.js +209 -0
- package/components/navigation/popover/props.js +15 -0
- package/components/page/content/index.js +28 -0
- package/components/page/error-boundary/index.js +108 -0
- package/components/page/index.js +137 -0
- package/components/page/page-content/index.js +23 -0
- package/components/page/partial/index.js +36 -0
- package/components/page/partial-container/index.js +48 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.js +33 -0
- package/components/prefab/container/index.js +46 -0
- package/components/prefab/index.js +67 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LocalizationProvider.js +79 -0
- package/context/PrefabContext.js +66 -0
- package/context/WidgetProvider.js +187 -0
- package/core/app-config.js +1 -0
- package/core/app.service.js +357 -0
- package/core/appVariablesStore.js +20 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.js +34 -0
- package/core/constants/index.js +27 -0
- package/core/dialog.service.js +76 -0
- package/core/event-notifier.js +151 -0
- package/core/formatter/date-formatters.js +222 -0
- package/core/formatter/index.js +131 -0
- package/core/formatter/number-formatters.js +142 -0
- package/core/formatter/security-formatters.js +323 -0
- package/core/formatter/string-formatters.js +52 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.js +412 -0
- package/core/script-registry.js +63 -0
- package/core/security.service.js +11 -0
- package/core/util/common.js +33 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.js +136 -0
- package/core/util/security.js +184 -0
- package/core/util/utils.js +189 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.js +430 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.js +251 -0
- package/higherOrder/BasePage.js +715 -0
- package/higherOrder/BasePartial.js +124 -0
- package/higherOrder/BasePrefab.js +145 -0
- package/higherOrder/DataNav.js +377 -0
- package/higherOrder/helper.js +43 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.js +183 -0
- package/hooks/useAccess.js +308 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.js +562 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.js +338 -0
- package/libs/index.js +20 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.js +371 -0
- package/package-lock.json +10177 -0
- package/package.json +95 -0
- package/store/index.js +33 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/slices/appConfigSlice.js +103 -0
- package/store/slices/authSlice.js +508 -0
- package/store/slices/i18nSlice.js +206 -0
- package/types/index.js +15 -0
- package/utils/dataset-util.js +174 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.js +140 -0
- package/utils/form-utils.js +187 -0
- package/utils/format-util.js +260 -0
- package/utils/page-params-util.js +24 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.js +343 -0
- package/utils/style-utils.js +73 -0
- package/utils/transformedDataset-utils.js +633 -0
- package/utils/widget-cleanup-util.js +84 -0
- package/utils/widgets.js +99 -0
- package/variables/base-variable.js +173 -0
- package/variables/constants.js +27 -0
- package/variables/live-variable.js +166 -0
- package/variables/model-variable.js +77 -0
- package/variables/service-variable.js +307 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDistinctFieldProperties = void 0;
|
|
7
|
+
exports.getDistinctValues = getDistinctValues;
|
|
8
|
+
exports.isDataSetWidget = void 0;
|
|
9
|
+
exports.isSearchWidgetType = isSearchWidgetType;
|
|
10
|
+
var _types = require("../types");
|
|
11
|
+
var _lodashEs = require("lodash-es");
|
|
12
|
+
var DATASET_WIDGETS = ["select", "autocomplete", "typeahead", "chips", "checkboxset", "radioset", "rating", "switch"];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Check if widget type is a dataset widget (similar to isDataSetWidget in Angular)
|
|
16
|
+
*/
|
|
17
|
+
var isDataSetWidget = exports.isDataSetWidget = function isDataSetWidget(widgettype) {
|
|
18
|
+
return DATASET_WIDGETS.includes(widgettype === null || widgettype === void 0 ? void 0 : widgettype.toLowerCase());
|
|
19
|
+
};
|
|
20
|
+
var getDistinctFieldProperties = exports.getDistinctFieldProperties = function getDistinctFieldProperties(dataSource, formField) {
|
|
21
|
+
var props = {};
|
|
22
|
+
var fieldColumn;
|
|
23
|
+
if (formField["isRelated"]) {
|
|
24
|
+
var _fieldColumn;
|
|
25
|
+
props.tableName = formField["lookup-type"];
|
|
26
|
+
fieldColumn = formField["lookup-field"];
|
|
27
|
+
props.distinctField = fieldColumn;
|
|
28
|
+
props.aliasColumn = (_fieldColumn = fieldColumn) === null || _fieldColumn === void 0 ? void 0 : _fieldColumn.replace(".", "$"); // For related fields, In response . is replaced by $
|
|
29
|
+
props.filterExpr = formField.filterexpressions ? (0, _lodashEs.isObject)(formField.filterexpressions) ? formField.filterexpressions : JSON.parse(formField.filterexpressions) : {};
|
|
30
|
+
} else {
|
|
31
|
+
props.tableName = dataSource.execute(_types.DataSource.Operation.GET_ENTITY_NAME);
|
|
32
|
+
fieldColumn = formField.field || formField.key;
|
|
33
|
+
props.distinctField = fieldColumn;
|
|
34
|
+
props.aliasColumn = fieldColumn;
|
|
35
|
+
}
|
|
36
|
+
return props;
|
|
37
|
+
};
|
|
38
|
+
function getDistinctValues(dataSource, formField, widget) {
|
|
39
|
+
var props;
|
|
40
|
+
return new Promise(function (res, rej) {
|
|
41
|
+
if (isDataSetWidget(formField.widget) && (!formField.isDataSetBound || widget === "filterwidget")) {
|
|
42
|
+
props = getDistinctFieldProperties(dataSource, formField);
|
|
43
|
+
dataSource.execute(_types.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS, {
|
|
44
|
+
fields: props.distinctField,
|
|
45
|
+
entityName: props.tableName,
|
|
46
|
+
pagesize: formField.limit,
|
|
47
|
+
filterExpr: formField.filterexpressions ? JSON.parse(formField.filterexpressions) : {}
|
|
48
|
+
}).then(function (response) {
|
|
49
|
+
res({
|
|
50
|
+
field: formField,
|
|
51
|
+
data: response.data,
|
|
52
|
+
aliasColumn: props.aliasColumn
|
|
53
|
+
});
|
|
54
|
+
}, rej)["catch"](function (error) {
|
|
55
|
+
rej({
|
|
56
|
+
field: formField,
|
|
57
|
+
data: [],
|
|
58
|
+
aliasColumn: props.aliasColumn
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function isSearchWidgetType(widget) {
|
|
65
|
+
return (0, _lodashEs.includes)([_types.FormWidgetType.AUTOCOMPLETE, _types.FormWidgetType.TYPEAHEAD, _types.FormWidgetType.CHIPS], widget);
|
|
66
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LIVE_CONSTANTS = void 0;
|
|
7
|
+
exports.getDistinctValuesForField = getDistinctValuesForField;
|
|
8
|
+
exports.interpolateBindExpressions = interpolateBindExpressions;
|
|
9
|
+
exports.stringStartsWith = exports.processFilterExpBindNode = void 0;
|
|
10
|
+
var _lodashEs = require("lodash-es");
|
|
11
|
+
var _fieldDataUtils = require("./field-data-utils");
|
|
12
|
+
var _ = require("./");
|
|
13
|
+
var LIVE_CONSTANTS = exports.LIVE_CONSTANTS = {
|
|
14
|
+
EMPTY_KEY: "EMPTY_NULL_FILTER",
|
|
15
|
+
EMPTY_VALUE: "No Value",
|
|
16
|
+
LABEL_KEY: "key",
|
|
17
|
+
LABEL_VALUE: "value",
|
|
18
|
+
NULL_EMPTY: ["null", "empty"],
|
|
19
|
+
NULL: "null",
|
|
20
|
+
EMPTY: "empty"
|
|
21
|
+
};
|
|
22
|
+
var stringStartsWith = exports.stringStartsWith = function stringStartsWith(str, startsWith, ignoreCase) {
|
|
23
|
+
if (!str) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
var regEx = new RegExp("^" + startsWith, ignoreCase ? "i" : "");
|
|
27
|
+
return regEx.test(str);
|
|
28
|
+
};
|
|
29
|
+
function interpolateBindExpressions(context, filterexpressions, callbackFn) {
|
|
30
|
+
var debouncedFn = (0, _lodashEs.debounce)(function () {
|
|
31
|
+
if ((0, _lodashEs.isFunction)(callbackFn)) {
|
|
32
|
+
callbackFn(filterexpressions);
|
|
33
|
+
}
|
|
34
|
+
}, 300);
|
|
35
|
+
|
|
36
|
+
// Call initially for expressions without bound variables
|
|
37
|
+
debouncedFn();
|
|
38
|
+
var filterExpressions = filterexpressions ? (0, _lodashEs.isObject)(filterexpressions) ? filterexpressions : JSON.parse(filterexpressions) : {};
|
|
39
|
+
|
|
40
|
+
// Just setup the bindings - no subscription needed
|
|
41
|
+
processFilterExpBindNode(context, filterExpressions);
|
|
42
|
+
// The filterExpressions object will be mutated directly by the watchers
|
|
43
|
+
// No need for subscription since changes happen in-place
|
|
44
|
+
}
|
|
45
|
+
var processFilterExpBindNode = exports.processFilterExpBindNode = function processFilterExpBindNode(context, filterExpressions, variable) {
|
|
46
|
+
var traverseFilterExpressions = function traverseFilterExpressions(expressions) {
|
|
47
|
+
if (expressions.rules) {
|
|
48
|
+
(0, _lodashEs.forEach)(expressions.rules, function (filExpObj, i) {
|
|
49
|
+
if (filExpObj.rules) {
|
|
50
|
+
traverseFilterExpressions(filExpObj);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
traverseFilterExpressions(filterExpressions);
|
|
56
|
+
|
|
57
|
+
// Return the mutated filterExpressions or nothing
|
|
58
|
+
return filterExpressions;
|
|
59
|
+
};
|
|
60
|
+
function getDistinctValuesForField(dataSource, formField, options) {
|
|
61
|
+
if (!dataSource || !formField || formField.isDataSetBound) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if ((0, _fieldDataUtils.isSearchWidgetType)(formField[options.widget])) {
|
|
65
|
+
var dataoptions = (0, _fieldDataUtils.getDistinctFieldProperties)(dataSource, formField);
|
|
66
|
+
formField.dataoptions = dataoptions;
|
|
67
|
+
formField.setFieldDataSet(formField, Object.assign(options || {}, dataoptions));
|
|
68
|
+
} else {
|
|
69
|
+
interpolateBindExpressions(formField.viewParent, formField.filterexpressions, function (filterexpressions) {
|
|
70
|
+
formField.filterexpressions = filterexpressions;
|
|
71
|
+
(0, _fieldDataUtils.getDistinctValues)(dataSource, formField, options.widget).then(function (res) {
|
|
72
|
+
formField.setFieldDataSet(res.data, {
|
|
73
|
+
aliasColumn: res.aliasColumn,
|
|
74
|
+
widget: options.widget,
|
|
75
|
+
isEnableEmptyFilter: (0, _.getEnableEmptyFilter)(options.enableemptyfilter),
|
|
76
|
+
EMPTY_VALUE: options.EMPTY_VALUE
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.LIVE_CONSTANTS = void 0;
|
|
8
|
+
exports.findOperationType = findOperationType;
|
|
9
|
+
exports.getEmptyMatchMode = getEmptyMatchMode;
|
|
10
|
+
exports.getEnableEmptyFilter = getEnableEmptyFilter;
|
|
11
|
+
exports.getMatchModeTypesMap = exports.getMatchModeMsgs = void 0;
|
|
12
|
+
exports.getRangeFieldValue = getRangeFieldValue;
|
|
13
|
+
exports.getRangeMatchMode = getRangeMatchMode;
|
|
14
|
+
exports.unsupportedStatePersistenceTypes = void 0;
|
|
15
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
|
+
var _lodashEs = require("lodash-es");
|
|
17
|
+
var _types = require("../types");
|
|
18
|
+
var _util = require("../../../core/util");
|
|
19
|
+
var Live_Operations = {
|
|
20
|
+
INSERT: "insert",
|
|
21
|
+
UPDATE: "update",
|
|
22
|
+
DELETE: "delete",
|
|
23
|
+
READ: "read"
|
|
24
|
+
};
|
|
25
|
+
var LIVE_CONSTANTS = exports.LIVE_CONSTANTS = {
|
|
26
|
+
EMPTY_KEY: "EMPTY_NULL_FILTER",
|
|
27
|
+
EMPTY_VALUE: "No Value",
|
|
28
|
+
LABEL_KEY: "key",
|
|
29
|
+
LABEL_VALUE: "value",
|
|
30
|
+
NULL_EMPTY: ["null", "empty"],
|
|
31
|
+
NULL: "null",
|
|
32
|
+
EMPTY: "empty"
|
|
33
|
+
};
|
|
34
|
+
function findOperationType(formdata, primaryKeys) {
|
|
35
|
+
var operation;
|
|
36
|
+
var isPrimary = false;
|
|
37
|
+
if (primaryKeys && !(0, _lodashEs.isEmpty)(formdata)) {
|
|
38
|
+
/*If only one column is primary key*/
|
|
39
|
+
if (primaryKeys.length === 1) {
|
|
40
|
+
if (formdata[primaryKeys[0]]) {
|
|
41
|
+
operation = Live_Operations.UPDATE;
|
|
42
|
+
}
|
|
43
|
+
/*If only no column is primary key*/
|
|
44
|
+
} else if (primaryKeys.length === 0) {
|
|
45
|
+
(0, _lodashEs.forEach)(formdata, function (value) {
|
|
46
|
+
if (value) {
|
|
47
|
+
isPrimary = true;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (isPrimary) {
|
|
51
|
+
operation = Live_Operations.UPDATE;
|
|
52
|
+
}
|
|
53
|
+
/*If multiple columns are primary key*/
|
|
54
|
+
} else {
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
isPrimary = (0, _lodashEs.some)(primaryKeys, function (primaryKey) {
|
|
57
|
+
if (formdata[primaryKey]) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
if (isPrimary) {
|
|
62
|
+
operation = Live_Operations.UPDATE;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return operation || Live_Operations.INSERT;
|
|
67
|
+
}
|
|
68
|
+
function isDefinedAndNotEmpty(val) {
|
|
69
|
+
return (0, _util.isDefined)(val) && val !== "" && val !== null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @ngdoc function
|
|
74
|
+
* @name wm.widgets.live.getRangeFieldValue
|
|
75
|
+
* @methodOf wm.widgets.live.LiveWidgetUtils
|
|
76
|
+
* @function
|
|
77
|
+
*
|
|
78
|
+
* @description
|
|
79
|
+
* Function to get the field value for range
|
|
80
|
+
*
|
|
81
|
+
* @param {string} minValue min value selected
|
|
82
|
+
* @param {string} maxValue max value selected
|
|
83
|
+
*/
|
|
84
|
+
function getRangeFieldValue(minValue, maxValue) {
|
|
85
|
+
var fieldValue;
|
|
86
|
+
if (isDefinedAndNotEmpty(minValue) && isDefinedAndNotEmpty(maxValue)) {
|
|
87
|
+
fieldValue = [minValue, maxValue];
|
|
88
|
+
} else if (isDefinedAndNotEmpty(minValue)) {
|
|
89
|
+
fieldValue = minValue;
|
|
90
|
+
} else if (isDefinedAndNotEmpty(maxValue)) {
|
|
91
|
+
fieldValue = maxValue;
|
|
92
|
+
}
|
|
93
|
+
return fieldValue;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @ngdoc function
|
|
97
|
+
* @name wm.widgets.live.getRangeMatchMode
|
|
98
|
+
* @methodOf wm.widgets.live.LiveWidgetUtils
|
|
99
|
+
* @function
|
|
100
|
+
*
|
|
101
|
+
* @description
|
|
102
|
+
* Function to get the match mode for range
|
|
103
|
+
*
|
|
104
|
+
* @param {string} minValue min value selected
|
|
105
|
+
* @param {string} maxValue max value selected
|
|
106
|
+
*/
|
|
107
|
+
function getRangeMatchMode(minValue, maxValue) {
|
|
108
|
+
var matchMode;
|
|
109
|
+
// If two values exists, then it is between. Otherwise, greater or lesser
|
|
110
|
+
if (isDefinedAndNotEmpty(minValue) && isDefinedAndNotEmpty(maxValue)) {
|
|
111
|
+
matchMode = _types.MatchMode.BETWEEN;
|
|
112
|
+
} else if (isDefinedAndNotEmpty(minValue)) {
|
|
113
|
+
matchMode = _types.MatchMode.GREATER;
|
|
114
|
+
} else if (isDefinedAndNotEmpty(maxValue)) {
|
|
115
|
+
matchMode = _types.MatchMode.LESSER;
|
|
116
|
+
}
|
|
117
|
+
return matchMode;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @ngdoc function
|
|
122
|
+
* @name wm.widgets.live.getEnableEmptyFilter
|
|
123
|
+
* @methodOf wm.widgets.live.LiveWidgetUtils
|
|
124
|
+
* @function
|
|
125
|
+
*
|
|
126
|
+
* @description
|
|
127
|
+
* This function checks if enable filter options is set on live filter
|
|
128
|
+
*
|
|
129
|
+
* @param {object} enableemptyfilter empty filter options
|
|
130
|
+
*/
|
|
131
|
+
function getEnableEmptyFilter(enableemptyfilter) {
|
|
132
|
+
return enableemptyfilter && (0, _lodashEs.intersection)(enableemptyfilter.split(","), LIVE_CONSTANTS.NULL_EMPTY).length > 0;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @ngdoc function
|
|
136
|
+
* @name wm.widgets.live.getEmptyMatchMode
|
|
137
|
+
* @methodOf wm.widgets.live.LiveWidgetUtils
|
|
138
|
+
* @function
|
|
139
|
+
*
|
|
140
|
+
* @description
|
|
141
|
+
* Function to get the match mode based on the filter selected
|
|
142
|
+
*
|
|
143
|
+
* @param {object} enableemptyfilter empty filter options
|
|
144
|
+
*/
|
|
145
|
+
function getEmptyMatchMode(enableemptyfilter) {
|
|
146
|
+
var matchMode;
|
|
147
|
+
var emptyFilterOptions = (0, _lodashEs.split)(enableemptyfilter, ",");
|
|
148
|
+
if ((0, _lodashEs.intersection)(emptyFilterOptions, LIVE_CONSTANTS.NULL_EMPTY).length === 2) {
|
|
149
|
+
matchMode = _types.MatchMode.NULLOREMPTY;
|
|
150
|
+
} else if ((0, _lodashEs.includes)(emptyFilterOptions, LIVE_CONSTANTS.NULL)) {
|
|
151
|
+
matchMode = _types.MatchMode.NULL;
|
|
152
|
+
} else if ((0, _lodashEs.includes)(emptyFilterOptions, LIVE_CONSTANTS.EMPTY)) {
|
|
153
|
+
matchMode = _types.MatchMode.EMPTY;
|
|
154
|
+
}
|
|
155
|
+
return matchMode;
|
|
156
|
+
}
|
|
157
|
+
var typesMap = {
|
|
158
|
+
number: ["number", "integer", "big_integer", "short", "float", "big_decimal", "double", "long", "byte"],
|
|
159
|
+
string: ["string", "text"],
|
|
160
|
+
character: ["character"],
|
|
161
|
+
date: ["date", "time", "timestamp", "datetime"]
|
|
162
|
+
};
|
|
163
|
+
var modes = {
|
|
164
|
+
number: ["exact", "notequals", "lessthan", "lessthanequal", "greaterthan", "greaterthanequal", "null", "isnotnull"],
|
|
165
|
+
string: ["anywhereignorecase", "anywhere", "startignorecase", "start", "endignorecase", "end", "exactignorecase", "exact", "notequalsignorecase", "notequals", "null", "isnotnull", "empty", "isnotempty", "nullorempty"],
|
|
166
|
+
character: ["exactignorecase", "exact", "notequalsignorecase", "notequals", "null", "isnotnull", "empty", "isnotempty", "nullorempty"],
|
|
167
|
+
date: ["exact", "lessthan", "lessthanequal", "greaterthan", "greaterthanequal", "null", "notequals", "isnotnull"]
|
|
168
|
+
};
|
|
169
|
+
var matchModeTypesMap = {
|
|
170
|
+
"boolean": ["exact", "null", "isnotnull"],
|
|
171
|
+
clob: [],
|
|
172
|
+
blob: []
|
|
173
|
+
};
|
|
174
|
+
var getMatchModeTypesMap = exports.getMatchModeTypesMap = function getMatchModeTypesMap(multiMode) {
|
|
175
|
+
if (multiMode) {
|
|
176
|
+
modes.number.push("in", "notin", "between");
|
|
177
|
+
modes.date.push("between");
|
|
178
|
+
modes.string.push("in", "notin");
|
|
179
|
+
modes.character.push("in", "notin");
|
|
180
|
+
}
|
|
181
|
+
(0, _lodashEs.forEach)(typesMap, function (types, primType) {
|
|
182
|
+
(0, _lodashEs.forEach)(types, function (type) {
|
|
183
|
+
matchModeTypesMap[type] = modes[primType];
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
// this is used in filter criteria when the user types the column name manually and where we dont know the type of the column
|
|
187
|
+
matchModeTypesMap["default"] = [].concat((0, _toConsumableArray2["default"])(modes["number"]), (0, _toConsumableArray2["default"])(modes["string"]), (0, _toConsumableArray2["default"])(modes["character"]), (0, _toConsumableArray2["default"])(modes["date"]));
|
|
188
|
+
return matchModeTypesMap;
|
|
189
|
+
};
|
|
190
|
+
var getMatchModeMsgs = exports.getMatchModeMsgs = function getMatchModeMsgs(appLocale) {
|
|
191
|
+
return {
|
|
192
|
+
start: appLocale.LABEL_STARTS_WITH,
|
|
193
|
+
startignorecase: appLocale.LABEL_STARTS_WITH_IGNORECASE,
|
|
194
|
+
end: appLocale.LABEL_ENDS_WITH,
|
|
195
|
+
endignorecase: appLocale.LABEL_ENDS_WITH_IGNORECASE,
|
|
196
|
+
anywhere: appLocale.LABEL_CONTAINS,
|
|
197
|
+
anywhereignorecase: appLocale.LABEL_CONTAINS_IGNORECASE,
|
|
198
|
+
exact: appLocale.LABEL_IS_EQUAL_TO,
|
|
199
|
+
exactignorecase: appLocale.LABEL_IS_EQUAL_TO_IGNORECASE,
|
|
200
|
+
notequals: appLocale.LABEL_IS_NOT_EQUAL_TO,
|
|
201
|
+
notequalsignorecase: appLocale.LABEL_IS_NOT_EQUAL_TO_IGNORECASE,
|
|
202
|
+
lessthan: appLocale.LABEL_LESS_THAN,
|
|
203
|
+
lessthanequal: appLocale.LABEL_LESS_THAN_OR_EQUALS_TO,
|
|
204
|
+
greaterthan: appLocale.LABEL_GREATER_THAN,
|
|
205
|
+
greaterthanequal: appLocale.LABEL_GREATER_THAN_OR_EQUALS_TO,
|
|
206
|
+
"null": appLocale.LABEL_IS_NULL,
|
|
207
|
+
isnotnull: appLocale.LABEL_IS_NOT_NULL,
|
|
208
|
+
empty: appLocale.LABEL_IS_EMPTY,
|
|
209
|
+
isnotempty: appLocale.LABEL_IS_NOT_EMPTY,
|
|
210
|
+
nullorempty: appLocale.LABEL_IS_NULL_OR_EMPTY,
|
|
211
|
+
"in": appLocale.LABEL_IN,
|
|
212
|
+
notin: appLocale.LABEL_NOT_IN,
|
|
213
|
+
between: appLocale.LABEL_BETWEEN
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
var unsupportedStatePersistenceTypes = exports.unsupportedStatePersistenceTypes = ["On-Demand", "Scroll"];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
13
|
+
var _button = require("@wavemaker/react-runtime/components/form/button");
|
|
14
|
+
var _dialogActions = require("@wavemaker/react-runtime/components/dialogs/dialog-actions");
|
|
15
|
+
var _dialogHeader = require("@wavemaker/react-runtime/components/dialogs/dialog-header");
|
|
16
|
+
var _dialogContent = require("@wavemaker/react-runtime/components/dialogs/dialog-content");
|
|
17
|
+
var _dialogs = require("@wavemaker/react-runtime/components/dialogs");
|
|
18
|
+
var _withDialogWrapper = _interopRequireDefault(require("../withDialogWrapper"));
|
|
19
|
+
var _dialogBody = require("../dialog-body");
|
|
20
|
+
var __jsx = _react["default"].createElement; // components
|
|
21
|
+
var DEFAULT_CLASS = "";
|
|
22
|
+
var WmConfirmDialog = function WmConfirmDialog(props) {
|
|
23
|
+
var isopen = props.isopen,
|
|
24
|
+
onClose = props.onClose,
|
|
25
|
+
_props$oktext = props.oktext,
|
|
26
|
+
oktext = _props$oktext === void 0 ? "OK" : _props$oktext,
|
|
27
|
+
_props$title = props.title,
|
|
28
|
+
title = _props$title === void 0 ? "Alert" : _props$title,
|
|
29
|
+
_props$alerttype = props.alerttype,
|
|
30
|
+
alerttype = _props$alerttype === void 0 ? "error" : _props$alerttype,
|
|
31
|
+
_props$iconclass = props.iconclass,
|
|
32
|
+
iconclass = _props$iconclass === void 0 ? "wi wi-warning" : _props$iconclass,
|
|
33
|
+
_props$text = props.text,
|
|
34
|
+
text = _props$text === void 0 ? "I am Alert Box!" : _props$text,
|
|
35
|
+
message = props.message,
|
|
36
|
+
close = props.close,
|
|
37
|
+
onOkClick = props.onOkClick;
|
|
38
|
+
var handleClose = function handleClose(event) {
|
|
39
|
+
if (onClose) {
|
|
40
|
+
onClose(event);
|
|
41
|
+
}
|
|
42
|
+
if (close) {
|
|
43
|
+
close(event);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Don't render if not open
|
|
48
|
+
if (!isopen) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return __jsx(_dialogs.WmDialog, (0, _extends2["default"])({}, props, {
|
|
52
|
+
open: isopen,
|
|
53
|
+
onClose: handleClose,
|
|
54
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, props.className)
|
|
55
|
+
}), __jsx("div", {
|
|
56
|
+
className: "app-alert-dialog app-dialog modal-dialog"
|
|
57
|
+
}, __jsx(_dialogContent.WmDialogContent, props, __jsx(_dialogHeader.WmDialogHeader, (0, _extends2["default"])({}, props, {
|
|
58
|
+
titleid: "alert-dialog-".concat(title),
|
|
59
|
+
heading: title,
|
|
60
|
+
onClose: close,
|
|
61
|
+
iconclass: iconclass
|
|
62
|
+
})), __jsx(_dialogBody.WmDialogBody, {
|
|
63
|
+
name: "",
|
|
64
|
+
listener: {}
|
|
65
|
+
}, __jsx(_DialogContentText["default"], {
|
|
66
|
+
className: "app-dialog-message text-".concat(alerttype)
|
|
67
|
+
}, message || text)), __jsx(_dialogActions.WmDialogFooter, {
|
|
68
|
+
name: "",
|
|
69
|
+
listener: {}
|
|
70
|
+
}, __jsx(_button.WmButton, {
|
|
71
|
+
"aria-label": oktext,
|
|
72
|
+
caption: oktext,
|
|
73
|
+
onClick: onOkClick,
|
|
74
|
+
className: "btn-primary ok-action ",
|
|
75
|
+
listener: {},
|
|
76
|
+
name: ""
|
|
77
|
+
})))));
|
|
78
|
+
};
|
|
79
|
+
WmConfirmDialog.displayName = "WmConfirmDialog";
|
|
80
|
+
var _default = exports["default"] = (0, _withDialogWrapper["default"])((0, _withBaseWrapper.withBaseWrapper)(WmConfirmDialog));
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
12
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
13
|
+
var _dialogActions = require("@wavemaker/react-runtime/components/dialogs/dialog-actions");
|
|
14
|
+
var _dialogHeader = require("@wavemaker/react-runtime/components/dialogs/dialog-header");
|
|
15
|
+
var _dialogContent = require("@wavemaker/react-runtime/components/dialogs/dialog-content");
|
|
16
|
+
var _dialogs = require("@wavemaker/react-runtime/components/dialogs");
|
|
17
|
+
var _button = require("@wavemaker/react-runtime/components/form/button");
|
|
18
|
+
var _dialogBody = require("@wavemaker/react-runtime/components/dialogs/dialog-body");
|
|
19
|
+
var _withDialogWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/components/dialogs/withDialogWrapper"));
|
|
20
|
+
var __jsx = _react["default"].createElement; // components
|
|
21
|
+
var DEFAULT_CLASS = "app-dialog modal-dialog app-confirm-dialog";
|
|
22
|
+
var WmConfirmDialog = function WmConfirmDialog(props) {
|
|
23
|
+
var _props$oktext = props.oktext,
|
|
24
|
+
oktext = _props$oktext === void 0 ? "OK" : _props$oktext,
|
|
25
|
+
_props$canceltext = props.canceltext,
|
|
26
|
+
canceltext = _props$canceltext === void 0 ? "CANCEL" : _props$canceltext,
|
|
27
|
+
_props$title = props.title,
|
|
28
|
+
title = _props$title === void 0 ? "Confirm" : _props$title,
|
|
29
|
+
_props$message = props.message,
|
|
30
|
+
message = _props$message === void 0 ? "I am confirm box!" : _props$message,
|
|
31
|
+
_props$iconclass = props.iconclass,
|
|
32
|
+
iconclass = _props$iconclass === void 0 ? "wm-sl-l sl-check" : _props$iconclass,
|
|
33
|
+
onOk = props.onOk,
|
|
34
|
+
onCancel = props.onCancel,
|
|
35
|
+
onClose = props.onClose,
|
|
36
|
+
_props$isDialog = props.isDialog,
|
|
37
|
+
isDialog = _props$isDialog === void 0 ? true : _props$isDialog,
|
|
38
|
+
close = props.close,
|
|
39
|
+
onOkClick = props.onOkClick;
|
|
40
|
+
var handleOk = function handleOk(event) {
|
|
41
|
+
if (onOk) {
|
|
42
|
+
onOk(event);
|
|
43
|
+
}
|
|
44
|
+
if (close) {
|
|
45
|
+
close(event);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var handleCancel = function handleCancel(event) {
|
|
49
|
+
if (onCancel) {
|
|
50
|
+
onCancel(event);
|
|
51
|
+
}
|
|
52
|
+
if (close) {
|
|
53
|
+
close(event);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var handleClose = function handleClose(event) {
|
|
57
|
+
if (onClose) {
|
|
58
|
+
onClose(event);
|
|
59
|
+
}
|
|
60
|
+
if (close) {
|
|
61
|
+
close(event);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return __jsx(_dialogs.WmDialog, (0, _extends2["default"])({}, props, {
|
|
65
|
+
open: props.isopen,
|
|
66
|
+
onClose: handleClose,
|
|
67
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, props.className),
|
|
68
|
+
"data-role": "confirm-dialog",
|
|
69
|
+
"aria-labelledby": "confirm-dialog-".concat(title),
|
|
70
|
+
"aria-describedby": "confirm-dialog-".concat(title, "-description")
|
|
71
|
+
}), __jsx(_dialogContent.WmDialogContent, {
|
|
72
|
+
name: "",
|
|
73
|
+
listener: {}
|
|
74
|
+
}, __jsx(_dialogHeader.WmDialogHeader, (0, _extends2["default"])({}, props, {
|
|
75
|
+
isDialog: isDialog,
|
|
76
|
+
titleid: "confirm-dialog-".concat(title),
|
|
77
|
+
heading: title,
|
|
78
|
+
iconclass: iconclass,
|
|
79
|
+
onClose: handleClose
|
|
80
|
+
})), __jsx(_dialogBody.WmDialogBody, {
|
|
81
|
+
name: "",
|
|
82
|
+
listener: {}
|
|
83
|
+
}, __jsx(_DialogContentText["default"], {
|
|
84
|
+
className: "app-dialog-message"
|
|
85
|
+
}, message)), __jsx(_dialogActions.WmDialogFooter, {
|
|
86
|
+
name: "",
|
|
87
|
+
listener: {}
|
|
88
|
+
}, __jsx(_button.WmButton, {
|
|
89
|
+
name: "",
|
|
90
|
+
listener: {},
|
|
91
|
+
caption: canceltext,
|
|
92
|
+
onClick: handleCancel,
|
|
93
|
+
className: "btn-default cancel-action",
|
|
94
|
+
"aria-label": canceltext
|
|
95
|
+
}), __jsx(_button.WmButton, {
|
|
96
|
+
name: "",
|
|
97
|
+
listener: {},
|
|
98
|
+
caption: oktext,
|
|
99
|
+
onClick: onOkClick || handleOk,
|
|
100
|
+
className: "btn-primary ok-action",
|
|
101
|
+
"aria-label": oktext
|
|
102
|
+
}))));
|
|
103
|
+
};
|
|
104
|
+
WmConfirmDialog.displayName = "WmConfirmDialog";
|
|
105
|
+
var _default = exports["default"] = (0, _withDialogWrapper["default"])((0, _withBaseWrapper.withBaseWrapper)(WmConfirmDialog));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.WmDialog = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
13
|
+
var _dialogs = _interopRequireDefault(require("@wavemaker/react-runtime/components/dialogs"));
|
|
14
|
+
var _withDialogWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/components/dialogs/withDialogWrapper"));
|
|
15
|
+
var _dialogHeader = require("@wavemaker/react-runtime/components/dialogs/dialog-header");
|
|
16
|
+
var _dialogContent = _interopRequireDefault(require("@wavemaker/react-runtime/components/dialogs/dialog-content"));
|
|
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
|
+
var WmDialog = exports.WmDialog = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
20
|
+
var handleClose = function handleClose(event) {
|
|
21
|
+
if (props.onClose) {
|
|
22
|
+
props.onClose(event);
|
|
23
|
+
}
|
|
24
|
+
if (props.close) {
|
|
25
|
+
props.close(event);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
if (!props.isopen) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return __jsx(_dialogs["default"], (0, _extends2["default"])({}, props, {
|
|
32
|
+
open: props.isopen,
|
|
33
|
+
onClose: handleClose,
|
|
34
|
+
className: (0, _clsx["default"])("app-dialog modal-dialog", props.className)
|
|
35
|
+
}), __jsx(_dialogContent["default"], props, props.dialogtype === "design-dialog" && props.showheader !== false && __jsx(_dialogHeader.WmDialogHeader, {
|
|
36
|
+
name: "",
|
|
37
|
+
listener: {},
|
|
38
|
+
titleid: "design-dialog-".concat(props.title),
|
|
39
|
+
heading: props.title,
|
|
40
|
+
onClose: handleClose,
|
|
41
|
+
iconclass: props.iconclass,
|
|
42
|
+
iconurl: props.iconurl,
|
|
43
|
+
iconwidth: props.iconwidth,
|
|
44
|
+
iconheight: props.iconheight,
|
|
45
|
+
iconmargin: props.iconmargin,
|
|
46
|
+
iconstyle: props.iconstyle,
|
|
47
|
+
closable: props.closable
|
|
48
|
+
}), props.children));
|
|
49
|
+
}, function (prevProps, nextProps) {
|
|
50
|
+
var keys = ["isopen", "sheetposition", "sheet", "styles", "dialogtype", "showheader", "title", "onClose", "close", "children", "modal", "closable"];
|
|
51
|
+
return keys.every(function (key) {
|
|
52
|
+
return prevProps[key] === nextProps[key];
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
WmDialog.displayName = "WmDialog";
|
|
56
|
+
var _default = exports["default"] = (0, _withDialogWrapper["default"])((0, _withBaseWrapper["default"])(WmDialog));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.WmDialogFooter = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
10
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
11
|
+
var __jsx = _react["default"].createElement;
|
|
12
|
+
var WmDialogFooter = exports.WmDialogFooter = function WmDialogFooter(props) {
|
|
13
|
+
var children = props.children;
|
|
14
|
+
return __jsx(_DialogActions["default"], {
|
|
15
|
+
className: "app-dialog-footer modal-footer"
|
|
16
|
+
}, children);
|
|
17
|
+
};
|
|
18
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmDialogFooter);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.WmDialogBody = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
10
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
11
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
12
|
+
var __jsx = _react["default"].createElement;
|
|
13
|
+
var DEFAULT_CLASS = "app-dialog-body modal-body";
|
|
14
|
+
var WmDialogBody = exports.WmDialogBody = function WmDialogBody(props) {
|
|
15
|
+
var children = props.children;
|
|
16
|
+
return __jsx(_Box["default"], {
|
|
17
|
+
component: "div",
|
|
18
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, props.className)
|
|
19
|
+
}, children);
|
|
20
|
+
};
|
|
21
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(WmDialogBody);
|