@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,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _material = require("@mui/material");
|
|
15
|
+
var _core = require("@dnd-kit/core");
|
|
16
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
17
|
+
var _modifiers = require("@dnd-kit/modifiers");
|
|
18
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
|
+
var _lodash = require("lodash");
|
|
20
|
+
var _search = _interopRequireDefault(require("@wavemaker/react-runtime/components/basic/search"));
|
|
21
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
22
|
+
var _SortableChip = _interopRequireDefault(require("./SortableChip"));
|
|
23
|
+
var _utils = require("./utils");
|
|
24
|
+
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); }
|
|
25
|
+
var __jsx = _react["default"].createElement;
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
var DEFAULT_CLASS = "app-chips nav nav-pills list-inline";
|
|
29
|
+
var WmChips = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
30
|
+
var _props$allowonlyselec = props.allowonlyselect,
|
|
31
|
+
allowonlyselect = _props$allowonlyselec === void 0 ? false : _props$allowonlyselec,
|
|
32
|
+
_props$autofocus = props.autofocus,
|
|
33
|
+
autofocus = _props$autofocus === void 0 ? false : _props$autofocus,
|
|
34
|
+
_props$chipclass = props.chipclass,
|
|
35
|
+
chipclass = _props$chipclass === void 0 ? "" : _props$chipclass,
|
|
36
|
+
_props$className = props.className,
|
|
37
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
38
|
+
_props$datafield = props.datafield,
|
|
39
|
+
datafield = _props$datafield === void 0 ? "All Fields" : _props$datafield,
|
|
40
|
+
_props$dataset = props.dataset,
|
|
41
|
+
dataset = _props$dataset === void 0 ? ["Option 1", "Option 2", "Option 3"] : _props$dataset,
|
|
42
|
+
datavalue = props.datavalue,
|
|
43
|
+
dateformat = props.dateformat,
|
|
44
|
+
_props$disabled = props.disabled,
|
|
45
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
46
|
+
displayexpression = props.displayexpression,
|
|
47
|
+
displayfield = props.displayfield,
|
|
48
|
+
displayimagesrc = props.displayimagesrc,
|
|
49
|
+
_props$enablereorder = props.enablereorder,
|
|
50
|
+
enablereorder = _props$enablereorder === void 0 ? false : _props$enablereorder,
|
|
51
|
+
groupby = props.groupby,
|
|
52
|
+
_props$inputposition = props.inputposition,
|
|
53
|
+
inputposition = _props$inputposition === void 0 ? "last" : _props$inputposition,
|
|
54
|
+
_props$inputwidth = props.inputwidth,
|
|
55
|
+
inputwidth = _props$inputwidth === void 0 ? "default" : _props$inputwidth,
|
|
56
|
+
limit = props.limit,
|
|
57
|
+
match = props.match,
|
|
58
|
+
_props$matchmode = props.matchmode,
|
|
59
|
+
matchmode = _props$matchmode === void 0 ? "contains" : _props$matchmode,
|
|
60
|
+
maxsize = props.maxsize,
|
|
61
|
+
_props$minchars = props.minchars,
|
|
62
|
+
minchars = _props$minchars === void 0 ? 1 : _props$minchars,
|
|
63
|
+
name = props.name,
|
|
64
|
+
orderby = props.orderby,
|
|
65
|
+
_props$placeholder = props.placeholder,
|
|
66
|
+
placeholder = _props$placeholder === void 0 ? "Type here.." : _props$placeholder,
|
|
67
|
+
_props$readonly = props.readonly,
|
|
68
|
+
readonly = _props$readonly === void 0 ? false : _props$readonly,
|
|
69
|
+
searchkey = props.searchkey,
|
|
70
|
+
_props$showsearchicon = props.showsearchicon,
|
|
71
|
+
showsearchicon = _props$showsearchicon === void 0 ? false : _props$showsearchicon,
|
|
72
|
+
_props$tabindex = props.tabindex,
|
|
73
|
+
tabindex = _props$tabindex === void 0 ? 0 : _props$tabindex,
|
|
74
|
+
_props$type = props.type,
|
|
75
|
+
type = _props$type === void 0 ? "search" : _props$type,
|
|
76
|
+
_props$debouncetime = props.debouncetime,
|
|
77
|
+
debouncetime = _props$debouncetime === void 0 ? 250 : _props$debouncetime,
|
|
78
|
+
_props$datacompletems = props.datacompletemsg,
|
|
79
|
+
datacompletemsg = _props$datacompletems === void 0 ? "No more data to load" : _props$datacompletems,
|
|
80
|
+
width = props.width,
|
|
81
|
+
height = props.height,
|
|
82
|
+
_props$styles = props.styles,
|
|
83
|
+
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
84
|
+
listener = props.listener,
|
|
85
|
+
onAdd = props.onAdd,
|
|
86
|
+
onBeforeadd = props.onBeforeadd,
|
|
87
|
+
onBeforeremove = props.onBeforeremove,
|
|
88
|
+
onBeforereorder = props.onBeforereorder,
|
|
89
|
+
onBeforeservicecall = props.onBeforeservicecall,
|
|
90
|
+
onChipclick = props.onChipclick,
|
|
91
|
+
onChipselect = props.onChipselect,
|
|
92
|
+
onChange = props.onChange,
|
|
93
|
+
onRemove = props.onRemove,
|
|
94
|
+
onReorder = props.onReorder,
|
|
95
|
+
dataPath = props.dataPath;
|
|
96
|
+
|
|
97
|
+
// State management
|
|
98
|
+
var _useState = (0, _react.useState)([]),
|
|
99
|
+
chipsList = _useState[0],
|
|
100
|
+
setChipsList = _useState[1];
|
|
101
|
+
var _useState2 = (0, _react.useState)(false),
|
|
102
|
+
saturate = _useState2[0],
|
|
103
|
+
setSaturate = _useState2[1];
|
|
104
|
+
var _useState3 = (0, _react.useState)(""),
|
|
105
|
+
searchQuery = _useState3[0],
|
|
106
|
+
setSearchQuery = _useState3[1];
|
|
107
|
+
var _useState4 = (0, _react.useState)([]),
|
|
108
|
+
modelByValue = _useState4[0],
|
|
109
|
+
setModelByValue = _useState4[1];
|
|
110
|
+
var _useState5 = (0, _react.useState)([]),
|
|
111
|
+
datasetItems = _useState5[0],
|
|
112
|
+
setDatasetItems = _useState5[1];
|
|
113
|
+
var _useState6 = (0, _react.useState)(0),
|
|
114
|
+
uniqueKeyCounter = _useState6[0],
|
|
115
|
+
setUniqueKeyCounter = _useState6[1];
|
|
116
|
+
var _useState7 = (0, _react.useState)(false),
|
|
117
|
+
isInitialized = _useState7[0],
|
|
118
|
+
setIsInitialized = _useState7[1];
|
|
119
|
+
|
|
120
|
+
// Computed values
|
|
121
|
+
var maxSizeReached = "Max size reached";
|
|
122
|
+
var isFullWidth = inputwidth === "full";
|
|
123
|
+
|
|
124
|
+
// Generate stable unique key that doesn't change on re-renders
|
|
125
|
+
var generateStableKeyCb = (0, _react.useCallback)(function (item, index) {
|
|
126
|
+
return (0, _utils.generateStableKey)(item, index, datafield);
|
|
127
|
+
}, [datafield]);
|
|
128
|
+
|
|
129
|
+
// Generate unique key for new chips (only when adding new items)
|
|
130
|
+
var generateUniqueKey = (0, _react.useCallback)(function () {
|
|
131
|
+
var key = "chip_new_".concat(uniqueKeyCounter);
|
|
132
|
+
setUniqueKeyCounter(function (prev) {
|
|
133
|
+
return prev + 1;
|
|
134
|
+
});
|
|
135
|
+
return key;
|
|
136
|
+
}, [uniqueKeyCounter]);
|
|
137
|
+
var processDatasetCb = (0, _react.useCallback)(function (data) {
|
|
138
|
+
return (0, _utils.processDataset)(data, displayfield, displayexpression, displayimagesrc, datafield, generateStableKeyCb);
|
|
139
|
+
}, [displayfield, displayexpression, displayimagesrc, datafield, generateStableKeyCb]);
|
|
140
|
+
(0, _react.useEffect)(function () {
|
|
141
|
+
var items = processDatasetCb(dataset);
|
|
142
|
+
setDatasetItems(items);
|
|
143
|
+
setIsInitialized(true);
|
|
144
|
+
}, [dataset]);
|
|
145
|
+
var createCustomDataModel = (0, _react.useCallback)(function (val) {
|
|
146
|
+
var fieldKey = displayfield || "label";
|
|
147
|
+
var customObj = {};
|
|
148
|
+
customObj[fieldKey] = val;
|
|
149
|
+
customObj._uniqueKey = generateUniqueKey();
|
|
150
|
+
return customObj;
|
|
151
|
+
}, [displayfield, generateUniqueKey]);
|
|
152
|
+
var updateMaxSize = (0, _react.useCallback)(function (currentLength) {
|
|
153
|
+
var length = currentLength !== undefined ? currentLength : chipsList.length;
|
|
154
|
+
setSaturate(maxsize > 0 && length === maxsize);
|
|
155
|
+
}, [maxsize, chipsList.length]);
|
|
156
|
+
var updateQueryModel = (0, _react.useCallback)(/*#__PURE__*/function () {
|
|
157
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
|
158
|
+
var dataValue, newChipsList, searchQuery;
|
|
159
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
160
|
+
while (1) switch (_context.prev = _context.next) {
|
|
161
|
+
case 0:
|
|
162
|
+
if (!(!data || !isInitialized)) {
|
|
163
|
+
_context.next = 4;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
setChipsList([]);
|
|
167
|
+
setModelByValue([]);
|
|
168
|
+
return _context.abrupt("return");
|
|
169
|
+
case 4:
|
|
170
|
+
if (typeof data === "string") {
|
|
171
|
+
dataValue = data.split(",");
|
|
172
|
+
} else if (Array.isArray(data)) {
|
|
173
|
+
dataValue = (0, _toConsumableArray2["default"])(data);
|
|
174
|
+
} else {
|
|
175
|
+
dataValue = [data];
|
|
176
|
+
}
|
|
177
|
+
setChipsList([]);
|
|
178
|
+
if (maxsize && dataValue.length > maxsize) {
|
|
179
|
+
dataValue = (0, _lodash.slice)(dataValue, 0, maxsize);
|
|
180
|
+
}
|
|
181
|
+
newChipsList = [];
|
|
182
|
+
searchQuery = [];
|
|
183
|
+
dataValue.forEach(function (val, i) {
|
|
184
|
+
var itemFound = (0, _lodash.find)(datasetItems, function (item) {
|
|
185
|
+
var value_obj = val.dataObject ? val.dataObject : val;
|
|
186
|
+
return (0, _lodash.isEqual)(item.value, value_obj);
|
|
187
|
+
});
|
|
188
|
+
if (itemFound) {
|
|
189
|
+
newChipsList.push(_objectSpread(_objectSpread({}, itemFound), {}, {
|
|
190
|
+
key: generateStableKeyCb(itemFound.value, i),
|
|
191
|
+
// Use stable key for dataset items
|
|
192
|
+
active: false,
|
|
193
|
+
isDuplicate: false,
|
|
194
|
+
imgSrc: itemFound.displayImage,
|
|
195
|
+
iscustom: false
|
|
196
|
+
}));
|
|
197
|
+
} else if (datafield === "All Fields") {
|
|
198
|
+
var dataObj = val;
|
|
199
|
+
var isCustom = false;
|
|
200
|
+
if (!(0, _lodash.isEqual)(val, dataObj)) {
|
|
201
|
+
dataObj = createCustomDataModel(val);
|
|
202
|
+
isCustom = true;
|
|
203
|
+
if (dataObj) {
|
|
204
|
+
dataValue[i] = dataObj;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
var finalDataObj = dataObj || val;
|
|
208
|
+
var chipObj = {
|
|
209
|
+
key: generateStableKeyCb(finalDataObj, i),
|
|
210
|
+
value: finalDataObj,
|
|
211
|
+
label: isCustom ? val : finalDataObj[displayfield || "label" || Object.keys(finalDataObj)[0]] || "",
|
|
212
|
+
displayValue: isCustom ? val : finalDataObj[displayfield || Object.keys(finalDataObj)[0]] || "",
|
|
213
|
+
displayImage: null,
|
|
214
|
+
dataObject: finalDataObj,
|
|
215
|
+
active: false,
|
|
216
|
+
isDuplicate: false,
|
|
217
|
+
imgSrc: null,
|
|
218
|
+
iscustom: isCustom
|
|
219
|
+
};
|
|
220
|
+
newChipsList.push(chipObj);
|
|
221
|
+
} else {
|
|
222
|
+
searchQuery.push(val);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
if (searchQuery.length && datafield !== "All Fields") {
|
|
226
|
+
searchQuery.forEach(function (val, searchIndex) {
|
|
227
|
+
var chipObj = {
|
|
228
|
+
key: generateStableKeyCb(val, newChipsList.length + searchIndex),
|
|
229
|
+
value: val,
|
|
230
|
+
label: String(val),
|
|
231
|
+
displayValue: String(val),
|
|
232
|
+
displayImage: null,
|
|
233
|
+
dataObject: val,
|
|
234
|
+
active: false,
|
|
235
|
+
isDuplicate: false,
|
|
236
|
+
imgSrc: null,
|
|
237
|
+
iscustom: true
|
|
238
|
+
};
|
|
239
|
+
newChipsList.push(chipObj);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
setChipsList(newChipsList);
|
|
243
|
+
setModelByValue(dataValue);
|
|
244
|
+
updateMaxSize(newChipsList.length);
|
|
245
|
+
case 14:
|
|
246
|
+
case "end":
|
|
247
|
+
return _context.stop();
|
|
248
|
+
}
|
|
249
|
+
}, _callee);
|
|
250
|
+
}));
|
|
251
|
+
return function (_x) {
|
|
252
|
+
return _ref.apply(this, arguments);
|
|
253
|
+
};
|
|
254
|
+
}(), [datasetItems, maxsize, datafield, displayfield, generateStableKeyCb, createCustomDataModel, isInitialized]);
|
|
255
|
+
var debouncedUpdateQueryModel = (0, _react.useMemo)(function () {
|
|
256
|
+
return (0, _lodash.debounce)(updateQueryModel, 150);
|
|
257
|
+
}, [updateQueryModel]);
|
|
258
|
+
(0, _react.useEffect)(function () {
|
|
259
|
+
if (isInitialized && datavalue !== undefined) {
|
|
260
|
+
debouncedUpdateQueryModel(datavalue);
|
|
261
|
+
}
|
|
262
|
+
}, [datavalue, debouncedUpdateQueryModel]);
|
|
263
|
+
var addItem = (0, _react.useCallback)(function (newItem) {
|
|
264
|
+
(0, _utils.performAddItem)(newItem, chipsList, modelByValue, setChipsList, setModelByValue, setSearchQuery, updateMaxSize, listener, name, datafield, displayfield, createCustomDataModel, generateUniqueKey, maxsize, onBeforeadd, onChange, onAdd, props);
|
|
265
|
+
}, [chipsList, modelByValue, updateMaxSize, onChange, onAdd, onBeforeadd, listener, name, datafield, displayfield, createCustomDataModel, generateUniqueKey, maxsize, props]);
|
|
266
|
+
var removeItem = (0, _react.useCallback)(function (event, item, index) {
|
|
267
|
+
(0, _utils.performRemoveItem)(event, item, index, chipsList, modelByValue, setChipsList, setModelByValue, updateMaxSize, listener, name, onBeforeremove, onChange, onRemove, props);
|
|
268
|
+
}, [chipsList, modelByValue, updateMaxSize, onChange, onRemove, onBeforeremove, listener, name, props]);
|
|
269
|
+
var handleChipClick = (0, _react.useCallback)(function (event, chip, index) {
|
|
270
|
+
if (readonly) return;
|
|
271
|
+
if (onChipclick && listener !== null && listener !== void 0 && listener.Widgets && name && name in listener.Widgets) {
|
|
272
|
+
onChipclick(event, listener.Widgets[name], chip);
|
|
273
|
+
}
|
|
274
|
+
}, [readonly, onChipclick, listener, name]);
|
|
275
|
+
var handleChipSelect = (0, _react.useCallback)(function (chip, index) {
|
|
276
|
+
if (readonly) return;
|
|
277
|
+
var newChipsList = chipsList.map(function (item, i) {
|
|
278
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
279
|
+
active: i === index
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
setChipsList(newChipsList);
|
|
283
|
+
if (onChipselect && listener !== null && listener !== void 0 && listener.Widgets && name && name in listener.Widgets) {
|
|
284
|
+
onChipselect(new MouseEvent("focus"), listener.Widgets[name], chip);
|
|
285
|
+
}
|
|
286
|
+
}, [readonly, chipsList, onChipselect, listener, name]);
|
|
287
|
+
var handleKeyDown = (0, _react.useCallback)(function (event, index) {
|
|
288
|
+
if (readonly) return;
|
|
289
|
+
if ((event.key == "Backspace" || event.key == "Delete") && index !== undefined) {
|
|
290
|
+
removeItem(event, chipsList[index], index);
|
|
291
|
+
}
|
|
292
|
+
}, [readonly, chipsList, removeItem]);
|
|
293
|
+
var handleSearchSelect = (0, _react.useCallback)(function (event, widget, selectedValue) {
|
|
294
|
+
if (selectedValue) {
|
|
295
|
+
addItem(selectedValue);
|
|
296
|
+
setSearchQuery("");
|
|
297
|
+
}
|
|
298
|
+
}, [addItem]);
|
|
299
|
+
var handleSearchSubmit = (0, _react.useCallback)(function (event, widget) {
|
|
300
|
+
var currentQuery = (widget === null || widget === void 0 ? void 0 : widget.query) || searchQuery;
|
|
301
|
+
var trimmedQuery = (0, _lodash.trim)(currentQuery);
|
|
302
|
+
if (!trimmedQuery) return;
|
|
303
|
+
if (allowonlyselect) return;
|
|
304
|
+
if (maxsize && chipsList.length >= maxsize) return;
|
|
305
|
+
addItem(trimmedQuery);
|
|
306
|
+
}, [searchQuery, allowonlyselect, addItem, maxsize, chipsList.length]);
|
|
307
|
+
var handleSearchChange = (0, _react.useCallback)(function (event, widget, newValue) {
|
|
308
|
+
setSearchQuery(newValue || "");
|
|
309
|
+
}, []);
|
|
310
|
+
var handleSearchAction = (0, _react.useCallback)(function (event, widget) {
|
|
311
|
+
var currentQuery = (widget === null || widget === void 0 ? void 0 : widget.query) || searchQuery;
|
|
312
|
+
var trimmedQuery = (0, _lodash.trim)(currentQuery);
|
|
313
|
+
if (!trimmedQuery) return;
|
|
314
|
+
if (allowonlyselect) return;
|
|
315
|
+
if (maxsize && chipsList.length >= maxsize) return;
|
|
316
|
+
addItem(trimmedQuery);
|
|
317
|
+
}, [searchQuery, allowonlyselect, addItem, maxsize, chipsList.length]);
|
|
318
|
+
var handleSearchKeyDown = (0, _react.useCallback)(function (event) {
|
|
319
|
+
if (event.key === "Enter") {
|
|
320
|
+
var inputElement = event.target;
|
|
321
|
+
var currentQuery = (inputElement === null || inputElement === void 0 ? void 0 : inputElement.value) || searchQuery || "";
|
|
322
|
+
var trimmedQuery = (0, _lodash.trim)(currentQuery);
|
|
323
|
+
if (!trimmedQuery) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (allowonlyselect) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (maxsize && chipsList.length >= maxsize) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}, [searchQuery, allowonlyselect, maxsize, chipsList.length]);
|
|
334
|
+
var renderChipsList = function renderChipsList() {
|
|
335
|
+
var sensors = (0, _core.useSensors)((0, _core.useSensor)(_core.PointerSensor, {
|
|
336
|
+
activationConstraint: {
|
|
337
|
+
distance: 5
|
|
338
|
+
}
|
|
339
|
+
}));
|
|
340
|
+
var handleDndEnd = function handleDndEnd(event) {
|
|
341
|
+
var active = event.active,
|
|
342
|
+
over = event.over;
|
|
343
|
+
if (!over || !enablereorder) return;
|
|
344
|
+
if (active.id === over.id) return;
|
|
345
|
+
var oldIndex = chipsList.findIndex(function (chip) {
|
|
346
|
+
return chip.key === active.id;
|
|
347
|
+
});
|
|
348
|
+
var newIndex = chipsList.findIndex(function (chip) {
|
|
349
|
+
return chip.key === over.id;
|
|
350
|
+
});
|
|
351
|
+
if (oldIndex === -1 || newIndex === -1) return;
|
|
352
|
+
var newChipsList = (0, _sortable.arrayMove)(chipsList, oldIndex, newIndex);
|
|
353
|
+
var changedItem = {
|
|
354
|
+
oldIndex: oldIndex,
|
|
355
|
+
newIndex: newIndex,
|
|
356
|
+
item: newChipsList[newIndex]
|
|
357
|
+
};
|
|
358
|
+
if (onBeforereorder && listener !== null && listener !== void 0 && listener.Widgets && name && name in listener.Widgets) {
|
|
359
|
+
var allowReorder = onBeforereorder(new MouseEvent("dragend"), listener.Widgets[name], newChipsList, changedItem);
|
|
360
|
+
if (allowReorder === false) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
var newModelByValue = (0, _sortable.arrayMove)(modelByValue, oldIndex, newIndex);
|
|
365
|
+
setChipsList(newChipsList);
|
|
366
|
+
setModelByValue(newModelByValue);
|
|
367
|
+
if (onChange && listener !== null && listener !== void 0 && listener.Widgets && name && name in listener.Widgets) {
|
|
368
|
+
onChange(new MouseEvent("dragend"), listener.Widgets[name], newModelByValue, modelByValue);
|
|
369
|
+
}
|
|
370
|
+
if (onReorder && listener !== null && listener !== void 0 && listener.Widgets && name && name in listener.Widgets) {
|
|
371
|
+
onReorder(new MouseEvent("dragend"), listener.Widgets[name], newChipsList, changedItem);
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
if (enablereorder && !readonly && !disabled) {
|
|
375
|
+
return __jsx(_core.DndContext, {
|
|
376
|
+
sensors: sensors,
|
|
377
|
+
collisionDetection: _core.closestCenter,
|
|
378
|
+
onDragEnd: handleDndEnd,
|
|
379
|
+
modifiers: [_modifiers.restrictToParentElement]
|
|
380
|
+
}, __jsx(_sortable.SortableContext, {
|
|
381
|
+
items: chipsList.map(function (chip) {
|
|
382
|
+
return chip.key;
|
|
383
|
+
}),
|
|
384
|
+
strategy: _sortable.horizontalListSortingStrategy
|
|
385
|
+
}, __jsx(_material.Box, {
|
|
386
|
+
component: "ul",
|
|
387
|
+
display: "flex",
|
|
388
|
+
flexWrap: "wrap",
|
|
389
|
+
gap: 1,
|
|
390
|
+
className: DEFAULT_CLASS,
|
|
391
|
+
name: name
|
|
392
|
+
}, inputposition === "first" && renderSearchInput(), chipsList.map(function (chip, index) {
|
|
393
|
+
return __jsx(_SortableChip["default"], {
|
|
394
|
+
key: chip.key,
|
|
395
|
+
chip: chip,
|
|
396
|
+
index: index,
|
|
397
|
+
readonly: readonly,
|
|
398
|
+
disabled: disabled,
|
|
399
|
+
chipclass: chipclass,
|
|
400
|
+
enablereorder: enablereorder,
|
|
401
|
+
handleChipClick: handleChipClick,
|
|
402
|
+
handleChipSelect: handleChipSelect,
|
|
403
|
+
handleKeyDown: handleKeyDown,
|
|
404
|
+
removeItem: removeItem,
|
|
405
|
+
chipsList: chipsList,
|
|
406
|
+
setChipsList: setChipsList
|
|
407
|
+
});
|
|
408
|
+
}), inputposition === "last" && renderSearchInput())));
|
|
409
|
+
}
|
|
410
|
+
return __jsx(_material.Box, {
|
|
411
|
+
component: "ul",
|
|
412
|
+
display: "flex",
|
|
413
|
+
flexWrap: "wrap",
|
|
414
|
+
gap: 1,
|
|
415
|
+
className: DEFAULT_CLASS,
|
|
416
|
+
name: name
|
|
417
|
+
}, inputposition === "first" && renderSearchInput(), chipsList.map(function (chip, index) {
|
|
418
|
+
return __jsx(_SortableChip["default"], {
|
|
419
|
+
key: chip.key,
|
|
420
|
+
chip: chip,
|
|
421
|
+
index: index,
|
|
422
|
+
readonly: readonly,
|
|
423
|
+
disabled: disabled,
|
|
424
|
+
chipclass: chipclass,
|
|
425
|
+
enablereorder: false,
|
|
426
|
+
handleChipClick: handleChipClick,
|
|
427
|
+
handleChipSelect: handleChipSelect,
|
|
428
|
+
handleKeyDown: handleKeyDown,
|
|
429
|
+
removeItem: removeItem,
|
|
430
|
+
chipsList: chipsList,
|
|
431
|
+
setChipsList: setChipsList
|
|
432
|
+
});
|
|
433
|
+
}), inputposition === "last" && renderSearchInput());
|
|
434
|
+
};
|
|
435
|
+
var renderSearchInput = function renderSearchInput() {
|
|
436
|
+
return __jsx(_material.Box, {
|
|
437
|
+
component: "li",
|
|
438
|
+
className: (0, _clsx["default"])("app-chip-search", className, {
|
|
439
|
+
"full-width": isFullWidth
|
|
440
|
+
})
|
|
441
|
+
}, __jsx(_search["default"], {
|
|
442
|
+
name: "app-chip-search",
|
|
443
|
+
disabled: disabled || saturate,
|
|
444
|
+
readonly: readonly,
|
|
445
|
+
datafield: datafield,
|
|
446
|
+
searchkey: searchkey,
|
|
447
|
+
orderby: orderby,
|
|
448
|
+
placeholder: saturate ? maxSizeReached : placeholder,
|
|
449
|
+
showsearchicon: showsearchicon,
|
|
450
|
+
tabindex: tabindex,
|
|
451
|
+
minchars: minchars,
|
|
452
|
+
debouncetime: debouncetime,
|
|
453
|
+
matchmode: matchmode,
|
|
454
|
+
datacompletemsg: datacompletemsg,
|
|
455
|
+
groupby: groupby,
|
|
456
|
+
match: match,
|
|
457
|
+
dateformat: dateformat,
|
|
458
|
+
dataset: dataset,
|
|
459
|
+
displayfield: displayfield,
|
|
460
|
+
displayexpression: displayexpression,
|
|
461
|
+
displayimagesrc: displayimagesrc,
|
|
462
|
+
type: type,
|
|
463
|
+
limit: limit,
|
|
464
|
+
datavalue: searchQuery,
|
|
465
|
+
onSelect: handleSearchSelect,
|
|
466
|
+
onSubmit: handleSearchSubmit,
|
|
467
|
+
onSearch: handleSearchAction,
|
|
468
|
+
onChange: handleSearchChange,
|
|
469
|
+
onKeyDown: handleSearchKeyDown,
|
|
470
|
+
onBeforeservicecall: onBeforeservicecall,
|
|
471
|
+
listener: listener,
|
|
472
|
+
"class": "app-chip-input",
|
|
473
|
+
width: isFullWidth ? "100%" : undefined,
|
|
474
|
+
autofocus: autofocus,
|
|
475
|
+
dataPath: dataPath
|
|
476
|
+
}));
|
|
477
|
+
};
|
|
478
|
+
return __jsx(_material.Box, {
|
|
479
|
+
ref: ref,
|
|
480
|
+
component: "div",
|
|
481
|
+
style: _objectSpread({
|
|
482
|
+
width: width,
|
|
483
|
+
height: height
|
|
484
|
+
}, styles)
|
|
485
|
+
}, renderChipsList());
|
|
486
|
+
});
|
|
487
|
+
WmChips.displayName = "WmChips";
|
|
488
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmChips);
|