@wavemaker/react-runtime 11.14.1-rc.236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/base-action.js +32 -0
- package/actions/login-action.js +53 -0
- package/actions/logout-action.js +41 -0
- package/actions/navigation-action.js +145 -0
- package/actions/notification-action.js +147 -0
- package/actions/timer-action.js +164 -0
- package/actions/toast-provider.js +111 -0
- package/actions/toast.js +115 -0
- package/actions/toast.service.js +94 -0
- package/actions/types/index.js +11 -0
- package/components/advanced/carousel/index.js +456 -0
- package/components/advanced/carousel/props.js +5 -0
- package/components/advanced/carousel/template.js +72 -0
- package/components/advanced/login/index.js +307 -0
- package/components/advanced/login/props.js +5 -0
- package/components/advanced/marquee/index.js +158 -0
- package/components/advanced/marquee/props.js +5 -0
- package/components/basic/anchor/index.js +239 -0
- package/components/basic/anchor/props.js +5 -0
- package/components/basic/audio/index.js +61 -0
- package/components/basic/html/index.js +158 -0
- package/components/basic/icon/index.js +85 -0
- package/components/basic/iframe/iframe.utils.js +10 -0
- package/components/basic/iframe/index.js +95 -0
- package/components/basic/label/index.js +139 -0
- package/components/basic/message/index.js +120 -0
- package/components/basic/message/props.js +5 -0
- package/components/basic/picture/index.js +117 -0
- package/components/basic/picture/props.js +5 -0
- package/components/basic/progress-bar/index.js +168 -0
- package/components/basic/progress-bar/props.js +18 -0
- package/components/basic/progress-circle/index.js +196 -0
- package/components/basic/progress-circle/props.js +16 -0
- package/components/basic/richtexteditor/index.js +533 -0
- package/components/basic/richtexteditor/props.js +5 -0
- package/components/basic/search/index.js +1023 -0
- package/components/basic/search/props.js +5 -0
- package/components/basic/search/providers.js +350 -0
- package/components/basic/spinner/index.js +202 -0
- package/components/basic/spinner/props.js +12 -0
- package/components/basic/tile/index.js +91 -0
- package/components/basic/tree/Components/TreeNodeComponent.js +142 -0
- package/components/basic/tree/index.js +503 -0
- package/components/basic/tree/props.js +5 -0
- package/components/basic/tree/utils.js +154 -0
- package/components/basic/video/index.js +85 -0
- package/components/basic/video/props.js +5 -0
- package/components/chart/components/barColumnChart/index.js +132 -0
- package/components/chart/components/barColumnChart/props.js +5 -0
- package/components/chart/components/bubbleChart/index.js +176 -0
- package/components/chart/components/bubbleChart/props.js +5 -0
- package/components/chart/components/chartLegend/components/ClassicLegendItem.js +39 -0
- package/components/chart/components/chartLegend/components/FuriousLegendItem.js +81 -0
- package/components/chart/components/chartLegend/index.js +69 -0
- package/components/chart/components/chartLegend/props.js +5 -0
- package/components/chart/components/chartLegend/utils.js +31 -0
- package/components/chart/components/chartTooltip/index.js +53 -0
- package/components/chart/components/chartTooltip/styles.js +37 -0
- package/components/chart/components/chartTooltip/utils.js +23 -0
- package/components/chart/components/cumulativeLineChart/index.js +113 -0
- package/components/chart/components/cumulativeLineChart/props.js +5 -0
- package/components/chart/components/cumulativeLineChart/utils.js +34 -0
- package/components/chart/components/index.js +40 -0
- package/components/chart/components/lineAreaChart/index.js +140 -0
- package/components/chart/components/lineAreaChart/props.js +5 -0
- package/components/chart/components/noDataMessage/index.js +27 -0
- package/components/chart/components/pieDonutChart/index.js +171 -0
- package/components/chart/components/pieDonutChart/props.js +5 -0
- package/components/chart/constant.js +72 -0
- package/components/chart/index.js +930 -0
- package/components/chart/props.js +5 -0
- package/components/chart/utils.js +691 -0
- package/components/common/AppSpinner.js +36 -0
- package/components/common/app-spinner.js +26 -0
- package/components/common/index.js +12 -0
- package/components/constants.js +1208 -0
- package/components/container/accordion/accordion-pane/index.js +108 -0
- package/components/container/accordion/accordion-pane/props.js +11 -0
- package/components/container/accordion/index.js +232 -0
- package/components/container/accordion/props.js +13 -0
- package/components/container/alignment-utils.js +183 -0
- package/components/container/index.js +188 -0
- package/components/container/layout-grid/grid-column/index.js +34 -0
- package/components/container/layout-grid/grid-row/index.js +24 -0
- package/components/container/layout-grid/index.js +33 -0
- package/components/container/linear-layout/index.js +72 -0
- package/components/container/linear-layout/linear-layout-item/index.js +43 -0
- package/components/container/panel/components/panel-header/index.js +144 -0
- package/components/container/panel/components/panel-header/props.js +5 -0
- package/components/container/panel/hooks.js +144 -0
- package/components/container/panel/index.js +286 -0
- package/components/container/panel/props.js +5 -0
- package/components/container/props.js +5 -0
- package/components/container/tabs/index.js +379 -0
- package/components/container/tabs/props.js +20 -0
- package/components/container/tabs/tab-pane/index.js +42 -0
- package/components/container/tabs/tab-pane/props.js +5 -0
- package/components/container/wizard/WizardContext.js +16 -0
- package/components/container/wizard/components/StepComponents.js +100 -0
- package/components/container/wizard/components/WizardStep.js +89 -0
- package/components/container/wizard/index.js +710 -0
- package/components/container/wizard/props.js +5 -0
- package/components/container/wizard/utils.js +133 -0
- package/components/container/wizard/wizard-action/index.js +22 -0
- package/components/container/wizard/wizard-step/index.js +94 -0
- package/components/data/card/card-actions/index.js +24 -0
- package/components/data/card/card-content/index.js +38 -0
- package/components/data/card/card-footer/index.js +24 -0
- package/components/data/card/index.js +246 -0
- package/components/data/card/props.js +5 -0
- package/components/data/form/base-form/constant.js +39 -0
- package/components/data/form/base-form/index.js +460 -0
- package/components/data/form/base-form/props.js +29 -0
- package/components/data/form/base-form/utils.js +42 -0
- package/components/data/form/dynamic-fields/index.js +196 -0
- package/components/data/form/dynamic-fields/props.js +5 -0
- package/components/data/form/dynamic-fields/utils.js +237 -0
- package/components/data/form/form-action/index.js +71 -0
- package/components/data/form/form-body/index.js +26 -0
- package/components/data/form/form-context.js +34 -0
- package/components/data/form/form-controller/props.js +19 -0
- package/components/data/form/form-controller/validation-contrustor.js +313 -0
- package/components/data/form/form-controller/withFormController.js +320 -0
- package/components/data/form/form-field/base-field.js +138 -0
- package/components/data/form/form-field/index.js +36 -0
- package/components/data/form/form-field/props.js +5 -0
- package/components/data/form/form-footer/index.js +26 -0
- package/components/data/form/form-header/index.js +56 -0
- package/components/data/form/index.js +39 -0
- package/components/data/form/props.js +5 -0
- package/components/data/list/components/GroupHeader.js +35 -0
- package/components/data/list/components/GroupedListItems.js +98 -0
- package/components/data/list/components/ListContainer.js +27 -0
- package/components/data/list/components/ListDND.js +241 -0
- package/components/data/list/components/ListHeader.js +59 -0
- package/components/data/list/components/ListItem.js +148 -0
- package/components/data/list/components/ListItemWithTemplate.js +59 -0
- package/components/data/list/components/ListItems.js +231 -0
- package/components/data/list/components/ListPagination.js +165 -0
- package/components/data/list/components/LoadMoreButton.js +39 -0
- package/components/data/list/components/NoDataMessage.js +22 -0
- package/components/data/list/components/StandardListItems.js +84 -0
- package/components/data/list/components/index.js +119 -0
- package/components/data/list/components/props.js +5 -0
- package/components/data/list/hooks/index.js +75 -0
- package/components/data/list/hooks/props.js +5 -0
- package/components/data/list/hooks/useCurrentPageItems.js +48 -0
- package/components/data/list/hooks/useGroupedData.js +37 -0
- package/components/data/list/hooks/useListData.js +60 -0
- package/components/data/list/hooks/useListEffects.js +285 -0
- package/components/data/list/hooks/useListEventHandlers.js +291 -0
- package/components/data/list/hooks/useListPagination.js +168 -0
- package/components/data/list/hooks/useListState.js +98 -0
- package/components/data/list/hooks/useListStateManager.js +195 -0
- package/components/data/list/hooks/usePaginatedGroupedData.js +121 -0
- package/components/data/list/index.js +611 -0
- package/components/data/list/props.js +5 -0
- package/components/data/list/templates/media-template.js +53 -0
- package/components/data/list/utils/constants.js +81 -0
- package/components/data/list/utils/list-helpers.js +173 -0
- package/components/data/list/utils/list-widget-methods.js +114 -0
- package/components/data/live-filter/index.js +279 -0
- package/components/data/live-filter/props.js +12 -0
- package/components/data/live-form/index.js +93 -0
- package/components/data/live-form/props.js +16 -0
- package/components/data/pagination/components/BasicPagination.js +77 -0
- package/components/data/pagination/components/ClassicPagination.js +191 -0
- package/components/data/pagination/components/InlinePagination.js +99 -0
- package/components/data/pagination/components/LoadingComponent.js +31 -0
- package/components/data/pagination/components/PageSizeSelector.js +175 -0
- package/components/data/pagination/components/PagerNavigation.js +105 -0
- package/components/data/pagination/components/TotalRecords.js +52 -0
- package/components/data/pagination/components/index.js +47 -0
- package/components/data/pagination/components/props.js +5 -0
- package/components/data/pagination/hooks/index.js +19 -0
- package/components/data/pagination/hooks/props.js +5 -0
- package/components/data/pagination/hooks/useNavigationSize.js +44 -0
- package/components/data/pagination/hooks/usePagination.js +796 -0
- package/components/data/pagination/index.js +322 -0
- package/components/data/table/components/AddNewRow.js +190 -0
- package/components/data/table/components/EditableCell.js +91 -0
- package/components/data/table/components/FieldValidationError.js +24 -0
- package/components/data/table/components/RowExpansionButton.js +74 -0
- package/components/data/table/components/TableBody.js +279 -0
- package/components/data/table/components/TableFilters.js +325 -0
- package/components/data/table/components/TableFooterActions.js +48 -0
- package/components/data/table/components/TableHeader.js +174 -0
- package/components/data/table/components/TablePanelHeading.js +68 -0
- package/components/data/table/components/index.js +74 -0
- package/components/data/table/hooks/index.js +219 -0
- package/components/data/table/hooks/useCellState.js +117 -0
- package/components/data/table/hooks/useDynamicColumns.js +85 -0
- package/components/data/table/hooks/useEditingState.js +47 -0
- package/components/data/table/hooks/useFormWidget.js +184 -0
- package/components/data/table/hooks/usePaginationState.js +60 -0
- package/components/data/table/hooks/usePanelStructure.js +40 -0
- package/components/data/table/hooks/useResponsiveColumns.js +34 -0
- package/components/data/table/hooks/useRowExpansion.js +110 -0
- package/components/data/table/hooks/useRowHandlers.js +38 -0
- package/components/data/table/hooks/useRowSelection.js +213 -0
- package/components/data/table/hooks/useServerSideSorting.js +165 -0
- package/components/data/table/hooks/useTableColumns.js +263 -0
- package/components/data/table/hooks/useTableData.js +154 -0
- package/components/data/table/hooks/useTableEdit.js +467 -0
- package/components/data/table/hooks/useTableEffects.js +139 -0
- package/components/data/table/hooks/useTableFilter.js +389 -0
- package/components/data/table/hooks/useTableInitialization.js +103 -0
- package/components/data/table/hooks/useTableState.js +69 -0
- package/components/data/table/hooks/useTableStateManager.js +558 -0
- package/components/data/table/index.js +1295 -0
- package/components/data/table/live-table/index.js +232 -0
- package/components/data/table/props.js +5 -0
- package/components/data/table/table-action/index.js +78 -0
- package/components/data/table/table-column/index.js +35 -0
- package/components/data/table/table-row/index.js +49 -0
- package/components/data/table/table-row-action/index.js +74 -0
- package/components/data/table/utils/buildSelectionColumns.js +173 -0
- package/components/data/table/utils/columnBuilder.js +209 -0
- package/components/data/table/utils/columnProxy.js +48 -0
- package/components/data/table/utils/columnWidthDistribution.js +98 -0
- package/components/data/table/utils/constants.js +80 -0
- package/components/data/table/utils/crud-handlers.js +518 -0
- package/components/data/table/utils/dynamic-columns.js +118 -0
- package/components/data/table/utils/index.js +607 -0
- package/components/data/table/utils/renderDisplayCell.js +183 -0
- package/components/data/table/utils/selectionUtils.js +166 -0
- package/components/data/table/utils/table-helpers.js +100 -0
- package/components/data/table/utils/validation.js +124 -0
- package/components/data/types.js +113 -0
- package/components/data/utils/field-data-utils.js +66 -0
- package/components/data/utils/filter-field-util.js +81 -0
- package/components/data/utils/index.js +216 -0
- package/components/dialogs/alert-dialog/index.js +80 -0
- package/components/dialogs/confirm-dialog/index.js +105 -0
- package/components/dialogs/dialog/index.js +56 -0
- package/components/dialogs/dialog-actions/index.js +18 -0
- package/components/dialogs/dialog-body/index.js +21 -0
- package/components/dialogs/dialog-content/index.js +30 -0
- package/components/dialogs/dialog-header/index.js +93 -0
- package/components/dialogs/iframe-dialog/index.js +114 -0
- package/components/dialogs/index.js +129 -0
- package/components/dialogs/login-dialog/index.js +369 -0
- package/components/dialogs/login-dialog/props.js +5 -0
- package/components/dialogs/page-dialog/index.js +96 -0
- package/components/dialogs/withDialogWrapper.js +108 -0
- package/components/form/button/index.js +216 -0
- package/components/form/button-group/index.js +60 -0
- package/components/input/calendar/index.js +546 -0
- package/components/input/calendar/props.js +5 -0
- package/components/input/calendar/utils.js +340 -0
- package/components/input/chips/SortableChip/index.js +115 -0
- package/components/input/chips/SortableChip/props.js +5 -0
- package/components/input/chips/index.js +488 -0
- package/components/input/chips/props.js +5 -0
- package/components/input/chips/utils.js +259 -0
- package/components/input/color-picker/index.js +678 -0
- package/components/input/color-picker/props.js +5 -0
- package/components/input/composite/index.js +137 -0
- package/components/input/currency/index.js +263 -0
- package/components/input/currency/props.js +5 -0
- package/components/input/default/checkbox/index.js +230 -0
- package/components/input/default/checkbox/props.js +5 -0
- package/components/input/default/checkboxset/index.js +476 -0
- package/components/input/default/checkboxset/props.js +5 -0
- package/components/input/default/radioset/index.js +379 -0
- package/components/input/default/radioset/props.js +5 -0
- package/components/input/default/switch/index.js +490 -0
- package/components/input/default/switch/prop.js +5 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +220 -0
- package/components/input/epoch/date/index.js +520 -0
- package/components/input/epoch/date/props.js +5 -0
- package/components/input/epoch/date/styled.js +70 -0
- package/components/input/epoch/date/utils.js +108 -0
- package/components/input/epoch/datetime/index.js +656 -0
- package/components/input/epoch/datetime/props.js +5 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/datetime/utils.js +244 -0
- package/components/input/epoch/time/index.js +412 -0
- package/components/input/epoch/time/props.js +5 -0
- package/components/input/epoch/time/utils.js +209 -0
- package/components/input/fileupload/Utils.js +134 -0
- package/components/input/fileupload/components/ListItems.js +140 -0
- package/components/input/fileupload/components/MultiUpload.js +85 -0
- package/components/input/fileupload/components/SingleUpload.js +65 -0
- package/components/input/fileupload/index.js +170 -0
- package/components/input/fileupload/props.js +5 -0
- package/components/input/fileupload/useFileUpload.js +400 -0
- package/components/input/number/index.js +295 -0
- package/components/input/number/props.js +5 -0
- package/components/input/rating/index.js +368 -0
- package/components/input/rating/props.js +5 -0
- package/components/input/select/index.js +344 -0
- package/components/input/select/props.js +5 -0
- package/components/input/slider/index.js +167 -0
- package/components/input/slider/props.js +5 -0
- package/components/input/text/index.js +434 -0
- package/components/input/text/props.js +5 -0
- package/components/input/text/util.js +179 -0
- package/components/input/textarea/index.js +347 -0
- package/components/input/textarea/props.js +5 -0
- package/components/layout/footer/index.js +30 -0
- package/components/layout/header/index.js +30 -0
- package/components/layout/leftnav/index.js +44 -0
- package/components/layout/rightnav/index.js +32 -0
- package/components/layout/topnav/index.js +34 -0
- package/components/navbar/index.js +41 -0
- package/components/navbar/nav/index.js +102 -0
- package/components/navbar/nav/props.js +5 -0
- package/components/navbar/nav-item/index.js +44 -0
- package/components/navigation/breadcrumb/index.js +56 -0
- package/components/navigation/breadcrumb/props.js +5 -0
- package/components/navigation/menu/components/ListItems.js +66 -0
- package/components/navigation/menu/constants.js +101 -0
- package/components/navigation/menu/index.js +807 -0
- package/components/navigation/menu/props.js +5 -0
- package/components/navigation/popover/index.js +209 -0
- package/components/navigation/popover/props.js +15 -0
- package/components/page/content/index.js +28 -0
- package/components/page/error-boundary/index.js +108 -0
- package/components/page/index.js +137 -0
- package/components/page/page-content/index.js +23 -0
- package/components/page/partial/index.js +36 -0
- package/components/page/partial-container/index.js +48 -0
- package/components/page/props.js +5 -0
- package/components/page/toast-container/index.js +33 -0
- package/components/prefab/container/index.js +46 -0
- package/components/prefab/index.js +67 -0
- package/context/AppContext.js +25 -0
- package/context/AppSpinnerProvider.js +43 -0
- package/context/LocalizationProvider.js +79 -0
- package/context/PrefabContext.js +66 -0
- package/context/WidgetProvider.js +187 -0
- package/core/app-config.js +1 -0
- package/core/app.service.js +357 -0
- package/core/appVariablesStore.js +20 -0
- package/core/appstore.js +88 -0
- package/core/constants/currency-constant.js +1071 -0
- package/core/constants/events.js +34 -0
- package/core/constants/index.js +27 -0
- package/core/dialog.service.js +76 -0
- package/core/event-notifier.js +151 -0
- package/core/formatter/date-formatters.js +222 -0
- package/core/formatter/index.js +131 -0
- package/core/formatter/number-formatters.js +142 -0
- package/core/formatter/security-formatters.js +323 -0
- package/core/formatter/string-formatters.js +52 -0
- package/core/formatter/types.js +18 -0
- package/core/formatters.js +24 -0
- package/core/proxy-service.js +412 -0
- package/core/script-registry.js +63 -0
- package/core/security.service.js +11 -0
- package/core/util/common.js +33 -0
- package/core/util/dom.js +107 -0
- package/core/util/index.js +136 -0
- package/core/util/security.js +184 -0
- package/core/util/utils.js +189 -0
- package/core/widget-observer.js +98 -0
- package/higherOrder/BaseApp.js +430 -0
- package/higherOrder/BaseAppProps.js +5 -0
- package/higherOrder/BaseDateTime.js +251 -0
- package/higherOrder/BasePage.js +715 -0
- package/higherOrder/BasePartial.js +124 -0
- package/higherOrder/BasePrefab.js +145 -0
- package/higherOrder/DataNav.js +377 -0
- package/higherOrder/helper.js +43 -0
- package/higherOrder/props.js +5 -0
- package/higherOrder/withBaseWrapper.js +183 -0
- package/hooks/useAccess.js +308 -0
- package/hooks/useAppConfig.js +42 -0
- package/hooks/useAuth.js +562 -0
- package/hooks/useDataSourceSubscription.js +125 -0
- package/hooks/useDebounce.js +76 -0
- package/hooks/useDeviceVisibility.js +49 -0
- package/hooks/useHttp.js +338 -0
- package/libs/index.js +20 -0
- package/mui-config/theme-provider.js +17 -0
- package/mui-config/theme.js +371 -0
- package/package-lock.json +10183 -0
- package/package.json +95 -0
- package/store/index.js +33 -0
- package/store/middleware/navigationMiddleware.js +48 -0
- package/store/slices/appConfigSlice.js +103 -0
- package/store/slices/authSlice.js +508 -0
- package/store/slices/i18nSlice.js +206 -0
- package/types/index.js +15 -0
- package/utils/dataset-util.js +174 -0
- package/utils/eval-expression.js +32 -0
- package/utils/form-state.util.js +140 -0
- package/utils/form-utils.js +187 -0
- package/utils/format-util.js +260 -0
- package/utils/page-params-util.js +24 -0
- package/utils/resource-url.js +27 -0
- package/utils/state-persistance.js +343 -0
- package/utils/style-utils.js +73 -0
- package/utils/transformedDataset-utils.js +633 -0
- package/utils/widget-cleanup-util.js +84 -0
- package/utils/widgets.js +99 -0
- package/variables/base-variable.js +173 -0
- package/variables/constants.js +27 -0
- package/variables/live-variable.js +166 -0
- package/variables/model-variable.js +77 -0
- package/variables/service-variable.js +307 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports["default"] = exports.WmAnchor = void 0;
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
+
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
15
|
+
var _image = _interopRequireDefault(require("next/image"));
|
|
16
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
17
|
+
var _Link = _interopRequireDefault(require("@mui/material/Link"));
|
|
18
|
+
var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
|
|
19
|
+
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/higherOrder/withBaseWrapper"));
|
|
20
|
+
var _navigation = require("next/navigation");
|
|
21
|
+
var _excluded = ["caption", "iconclass", "styles", "className", "iconheight", "iconwidth", "iconmargin", "iconurl", "iconposition", "badgevalue", "listener", "hyperlink", "encodeurl", "onClick", "shortcutkey", "arialabel", "target"];
|
|
22
|
+
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); }
|
|
23
|
+
var __jsx = _react["default"].createElement;
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
// Define regex outside component to avoid recreation on each render
|
|
27
|
+
var GO_TO_PAGE_REGEX = /(?:\w+\?\.)?Actions(?:\?\.)?goToPage_(\w+)(?:\?\.)?invoke\(\)/;
|
|
28
|
+
var DEFAULT_CLASS = "app-anchor";
|
|
29
|
+
var getCurrentPageName = function getCurrentPageName(pathname) {
|
|
30
|
+
var segments = pathname.split("/").filter(Boolean);
|
|
31
|
+
return segments[segments.length - 1];
|
|
32
|
+
};
|
|
33
|
+
var WmAnchor = exports.WmAnchor = function WmAnchor(props) {
|
|
34
|
+
var _clsx, _listener$appLocale;
|
|
35
|
+
var _props$caption = props.caption,
|
|
36
|
+
caption = _props$caption === void 0 ? "Link" : _props$caption,
|
|
37
|
+
iconclass = props.iconclass,
|
|
38
|
+
styles = props.styles,
|
|
39
|
+
className = props.className,
|
|
40
|
+
iconheight = props.iconheight,
|
|
41
|
+
iconwidth = props.iconwidth,
|
|
42
|
+
iconmargin = props.iconmargin,
|
|
43
|
+
iconurl = props.iconurl,
|
|
44
|
+
_props$iconposition = props.iconposition,
|
|
45
|
+
iconposition = _props$iconposition === void 0 ? "left" : _props$iconposition,
|
|
46
|
+
badgevalue = props.badgevalue,
|
|
47
|
+
listener = props.listener,
|
|
48
|
+
hyperlink = props.hyperlink,
|
|
49
|
+
encodeurl = props.encodeurl,
|
|
50
|
+
onClick = props.onClick,
|
|
51
|
+
shortcutkey = props.shortcutkey,
|
|
52
|
+
arialabel = props.arialabel,
|
|
53
|
+
target = props.target,
|
|
54
|
+
restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
55
|
+
var path = (0, _navigation.usePathname)();
|
|
56
|
+
var _useState = (0, _react.useState)(false),
|
|
57
|
+
isActive = _useState[0],
|
|
58
|
+
setIsActive = _useState[1];
|
|
59
|
+
|
|
60
|
+
// Extract navigation info from onClick
|
|
61
|
+
var navigationInfo = (0, _react.useMemo)(function () {
|
|
62
|
+
if (!onClick) return {
|
|
63
|
+
hasGoToPageExpr: false,
|
|
64
|
+
goToPageName: null,
|
|
65
|
+
isCurrentPage: false
|
|
66
|
+
};
|
|
67
|
+
var fnStr = onClick.toString();
|
|
68
|
+
var match = GO_TO_PAGE_REGEX.exec(fnStr);
|
|
69
|
+
if (!match) return {
|
|
70
|
+
hasGoToPageExpr: false,
|
|
71
|
+
goToPageName: null,
|
|
72
|
+
isCurrentPage: false
|
|
73
|
+
};
|
|
74
|
+
var pageName = match[1];
|
|
75
|
+
var currentPageName = getCurrentPageName(path);
|
|
76
|
+
return {
|
|
77
|
+
hasGoToPageExpr: true,
|
|
78
|
+
goToPageName: pageName,
|
|
79
|
+
isCurrentPage: pageName === currentPageName
|
|
80
|
+
};
|
|
81
|
+
}, [onClick, path]);
|
|
82
|
+
|
|
83
|
+
// Process hyperlink for href attribute
|
|
84
|
+
var processedHyperlink = (0, _react.useMemo)(function () {
|
|
85
|
+
if (!hyperlink) return "#";
|
|
86
|
+
var processedLink = hyperlink;
|
|
87
|
+
if (encodeurl === "true") {
|
|
88
|
+
processedLink = encodeURIComponent(processedLink);
|
|
89
|
+
}
|
|
90
|
+
if (processedLink.startsWith("www.")) {
|
|
91
|
+
processedLink = "//".concat(processedLink);
|
|
92
|
+
}
|
|
93
|
+
return processedLink;
|
|
94
|
+
}, [hyperlink, encodeurl]);
|
|
95
|
+
|
|
96
|
+
// Check if hyperlink matches current path
|
|
97
|
+
var doesHyperlinkMatchCurrentPath = (0, _react.useMemo)(function () {
|
|
98
|
+
if (!hyperlink) return false;
|
|
99
|
+
var processedLink = hyperlink;
|
|
100
|
+
if (processedLink.startsWith("www.")) {
|
|
101
|
+
processedLink = "//".concat(processedLink);
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
if (processedLink.startsWith("/")) {
|
|
105
|
+
return path === processedLink;
|
|
106
|
+
}
|
|
107
|
+
var url = new URL(processedLink, window.location.origin);
|
|
108
|
+
return path === url.pathname;
|
|
109
|
+
} catch (_unused) {
|
|
110
|
+
return path.endsWith(processedLink);
|
|
111
|
+
}
|
|
112
|
+
}, [hyperlink, path]);
|
|
113
|
+
|
|
114
|
+
// Determine active state
|
|
115
|
+
(0, _react.useEffect)(function () {
|
|
116
|
+
var lastSegment = path.split("/").pop();
|
|
117
|
+
var activeByCaptionMatch = caption && lastSegment && lastSegment.toLowerCase() === String(caption).toLowerCase();
|
|
118
|
+
var activeByHyperlink = doesHyperlinkMatchCurrentPath;
|
|
119
|
+
var activeByNavigationExpr = navigationInfo.isCurrentPage;
|
|
120
|
+
setIsActive(activeByCaptionMatch || activeByHyperlink || activeByNavigationExpr);
|
|
121
|
+
}, [caption, path, doesHyperlinkMatchCurrentPath, navigationInfo.isCurrentPage]);
|
|
122
|
+
|
|
123
|
+
// Calculate icon position styles
|
|
124
|
+
var iconPositionStyles = (0, _react.useMemo)(function () {
|
|
125
|
+
if (iconposition === "top") {
|
|
126
|
+
return {
|
|
127
|
+
flexDirection: "column",
|
|
128
|
+
alignItems: "center"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
direction: iconposition === "right" ? "rtl" : "ltr"
|
|
133
|
+
};
|
|
134
|
+
}, [iconposition]);
|
|
135
|
+
var handleClick = function handleClick(e) {
|
|
136
|
+
if (!hyperlink || navigationInfo.hasGoToPageExpr) {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
}
|
|
139
|
+
if (onClick) {
|
|
140
|
+
onClick(e);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
function handleMouseEnter(event) {
|
|
144
|
+
var _props$onMouseEnter;
|
|
145
|
+
(_props$onMouseEnter = props.onMouseEnter) === null || _props$onMouseEnter === void 0 || _props$onMouseEnter.call(props, event, props);
|
|
146
|
+
}
|
|
147
|
+
function handleMouseLeave(event) {
|
|
148
|
+
var _props$onMouseLeave;
|
|
149
|
+
(_props$onMouseLeave = props.onMouseLeave) === null || _props$onMouseLeave === void 0 || _props$onMouseLeave.call(props, event, props);
|
|
150
|
+
}
|
|
151
|
+
function handleDoubleClick(event) {
|
|
152
|
+
var _props$onDoubleClick;
|
|
153
|
+
(_props$onDoubleClick = props.onDoubleClick) === null || _props$onDoubleClick === void 0 || _props$onDoubleClick.call(props, event, props);
|
|
154
|
+
}
|
|
155
|
+
function handleFocus(event) {
|
|
156
|
+
var _props$onFocus;
|
|
157
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, event, props);
|
|
158
|
+
}
|
|
159
|
+
function handleBlur(event) {
|
|
160
|
+
var _props$onBlur;
|
|
161
|
+
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, event, props);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Disable context menu if no hyperlink
|
|
165
|
+
var handleContextMenu = function handleContextMenu(e) {
|
|
166
|
+
if (!hyperlink) {
|
|
167
|
+
e.preventDefault();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var domEvents = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.onMouseEnter && {
|
|
171
|
+
onMouseEnter: handleMouseEnter
|
|
172
|
+
}), props.onMouseLeave && {
|
|
173
|
+
onMouseLeave: handleMouseLeave
|
|
174
|
+
}), props.onDoubleClick && {
|
|
175
|
+
onDoubleClick: handleDoubleClick
|
|
176
|
+
}), props.onFocus && {
|
|
177
|
+
onFocus: handleFocus
|
|
178
|
+
}), props.onBlur && {
|
|
179
|
+
onBlur: handleBlur
|
|
180
|
+
}), props.onClick && {
|
|
181
|
+
onClick: handleClick
|
|
182
|
+
});
|
|
183
|
+
var iconstyles = {
|
|
184
|
+
height: iconheight || "auto",
|
|
185
|
+
width: iconwidth || "auto",
|
|
186
|
+
margin: iconmargin || "0 4"
|
|
187
|
+
};
|
|
188
|
+
return __jsx(_Link["default"], (0, _extends2["default"])({}, domEvents, {
|
|
189
|
+
style: _objectSpread(_objectSpread({}, iconPositionStyles), styles),
|
|
190
|
+
caption: caption,
|
|
191
|
+
role: "link",
|
|
192
|
+
tabIndex: props.tabindex,
|
|
193
|
+
className: (0, _clsx2["default"])((_clsx = {}, (0, _defineProperty2["default"])(_clsx, DEFAULT_CLASS, true), (0, _defineProperty2["default"])(_clsx, className || "", Boolean(className)), (0, _defineProperty2["default"])(_clsx, "active", isActive), _clsx)),
|
|
194
|
+
href: processedHyperlink,
|
|
195
|
+
onContextMenu: handleContextMenu,
|
|
196
|
+
accessKey: shortcutkey,
|
|
197
|
+
"aria-label": arialabel || (badgevalue && caption ? "".concat(caption, " ").concat(badgevalue) : caption) || null,
|
|
198
|
+
"aria-current": isActive ? "page" : undefined,
|
|
199
|
+
target: target,
|
|
200
|
+
title: props.hint,
|
|
201
|
+
"data-identifier": "anchor"
|
|
202
|
+
}, restProps), iconurl && __jsx(_image["default"], {
|
|
203
|
+
alt: "Image",
|
|
204
|
+
src: iconurl,
|
|
205
|
+
className: (0, _clsx2["default"])("anchor-image-icon", iconclass),
|
|
206
|
+
"aria-hidden": "true",
|
|
207
|
+
style: iconstyles,
|
|
208
|
+
width: parseInt(iconwidth || "24", 10),
|
|
209
|
+
height: parseInt(iconheight || "24", 10)
|
|
210
|
+
}), iconclass && __jsx("i", {
|
|
211
|
+
className: (0, _clsx2["default"])("app-icon", iconclass),
|
|
212
|
+
"aria-hidden": "true",
|
|
213
|
+
style: iconstyles
|
|
214
|
+
}), caption && __jsx(_react["default"].Fragment, null, __jsx(_Box["default"], {
|
|
215
|
+
component: "span",
|
|
216
|
+
className: "sr-only"
|
|
217
|
+
}, "".concat(caption, " ").concat(listener === null || listener === void 0 || (_listener$appLocale = listener.appLocale) === null || _listener$appLocale === void 0 ? void 0 : _listener$appLocale.LABEL_ICON)), __jsx(_Box["default"], {
|
|
218
|
+
component: "span",
|
|
219
|
+
className: "anchor-caption"
|
|
220
|
+
}, caption)), badgevalue && __jsx(_Badge["default"], {
|
|
221
|
+
component: "span",
|
|
222
|
+
sx: {
|
|
223
|
+
fontSize: "inherit",
|
|
224
|
+
"& .MuiBadge-badge": {
|
|
225
|
+
transform: "none"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
title: String(badgevalue),
|
|
229
|
+
badgeContent: badgevalue,
|
|
230
|
+
className: "badge pull-right"
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
233
|
+
WmAnchor.displayName = "WmAnchor";
|
|
234
|
+
var _default = exports["default"] = (0, _withBaseWrapper["default"])(/*#__PURE__*/(0, _react.memo)(WmAnchor, function (prev, next) {
|
|
235
|
+
var keysToCompare = ["caption", "iconclass", "iconheight", "iconwidth", "iconurl", "iconmargin", "hyperlink", "iconposition", "badgevalue", "encodeurl", "className", "styles", "onClick", "arialabel", "target", "shortcutkey"];
|
|
236
|
+
return keysToCompare.every(function (key) {
|
|
237
|
+
return prev[key] === next[key];
|
|
238
|
+
});
|
|
239
|
+
}));
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
14
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
15
|
+
var _resourceUrl = require("@wavemaker/react-runtime/utils/resource-url");
|
|
16
|
+
var _excluded = ["mp3format", "prefabName", "muted", "controls", "loop", "audiopreload", "audiosupportmessage", "autoplay", "hint", "arialabel", "tabindex", "styles", "className"];
|
|
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 DEFAULT_CLASS = "app-audio";
|
|
20
|
+
var WmAudio = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
21
|
+
var mp3format = props.mp3format,
|
|
22
|
+
prefabName = props.prefabName,
|
|
23
|
+
muted = props.muted,
|
|
24
|
+
controls = props.controls,
|
|
25
|
+
loop = props.loop,
|
|
26
|
+
audiopreload = props.audiopreload,
|
|
27
|
+
audiosupportmessage = props.audiosupportmessage,
|
|
28
|
+
autoplay = props.autoplay,
|
|
29
|
+
hint = props.hint,
|
|
30
|
+
arialabel = props.arialabel,
|
|
31
|
+
tabindex = props.tabindex,
|
|
32
|
+
styles = props.styles,
|
|
33
|
+
className = props.className,
|
|
34
|
+
restProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
35
|
+
var computedSrc = (0, _react.useMemo)(function () {
|
|
36
|
+
return (0, _resourceUrl.prefixPrefabResourceUrl)(mp3format);
|
|
37
|
+
}, [mp3format, prefabName]);
|
|
38
|
+
return __jsx(_Box["default"], (0, _extends2["default"])({
|
|
39
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, className),
|
|
40
|
+
title: hint,
|
|
41
|
+
"aria-label": arialabel,
|
|
42
|
+
tabIndex: tabindex,
|
|
43
|
+
sx: styles,
|
|
44
|
+
style: styles
|
|
45
|
+
}, restProps), __jsx("audio", {
|
|
46
|
+
title: hint,
|
|
47
|
+
src: computedSrc,
|
|
48
|
+
muted: muted,
|
|
49
|
+
controls: controls,
|
|
50
|
+
loop: loop,
|
|
51
|
+
preload: audiopreload,
|
|
52
|
+
autoPlay: autoplay
|
|
53
|
+
}, audiosupportmessage, "Your browser does not support the audio element."));
|
|
54
|
+
}, function (prev, current) {
|
|
55
|
+
var keys = ["mp3format", "hint", "arialabel", "tabindex"];
|
|
56
|
+
return keys.every(function (key) {
|
|
57
|
+
return prev[key] === current[key];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
WmAudio.displayName = "WmAudio";
|
|
61
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmAudio);
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _material = require("@mui/material");
|
|
13
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
14
|
+
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); }
|
|
15
|
+
var __jsx = _react["default"].createElement;
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
// Get dynamic styles based props
|
|
19
|
+
var getStyles = function getStyles(props) {
|
|
20
|
+
var _props$styles = props.styles,
|
|
21
|
+
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
22
|
+
height = props.height,
|
|
23
|
+
width = props.width,
|
|
24
|
+
horizontalalign = props.horizontalalign;
|
|
25
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, styles), height ? {
|
|
26
|
+
height: height
|
|
27
|
+
} : {}), width ? {
|
|
28
|
+
width: width
|
|
29
|
+
} : {}), horizontalalign ? {
|
|
30
|
+
textAlign: horizontalalign
|
|
31
|
+
} : {});
|
|
32
|
+
};
|
|
33
|
+
var WmHtml = function WmHtml(props) {
|
|
34
|
+
var name = props.name,
|
|
35
|
+
className = props.className,
|
|
36
|
+
arialabel = props.arialabel,
|
|
37
|
+
onMouseEnter = props.onMouseEnter,
|
|
38
|
+
onMouseLeave = props.onMouseLeave,
|
|
39
|
+
onClick = props.onClick,
|
|
40
|
+
onDoubleClick = props.onDoubleClick,
|
|
41
|
+
onTap = props.onTap,
|
|
42
|
+
onDoubletap = props.onDoubletap,
|
|
43
|
+
eventCallback = props.eventCallback,
|
|
44
|
+
forwardedRef = props.forwardedRef,
|
|
45
|
+
hint = props.hint;
|
|
46
|
+
var htmlRef = (0, _react.useRef)(null);
|
|
47
|
+
var _useState = (0, _react.useState)(false),
|
|
48
|
+
initialContentSet = _useState[0],
|
|
49
|
+
setInitialContentSet = _useState[1];
|
|
50
|
+
var _useState2 = (0, _react.useState)(null),
|
|
51
|
+
boundContentAttr = _useState2[0],
|
|
52
|
+
setBoundContentAttr = _useState2[1];
|
|
53
|
+
var touchStartRef = (0, _react.useRef)(0);
|
|
54
|
+
|
|
55
|
+
// Initialize content and check for bound content
|
|
56
|
+
(0, _react.useEffect)(function () {
|
|
57
|
+
var element = htmlRef.current;
|
|
58
|
+
if (!element) return;
|
|
59
|
+
|
|
60
|
+
// Check for content.bind attribute
|
|
61
|
+
var bindAttr = element.getAttribute("content.bind");
|
|
62
|
+
setBoundContentAttr(bindAttr);
|
|
63
|
+
|
|
64
|
+
// If there's a bound content attribute, clear the content
|
|
65
|
+
if (bindAttr && !initialContentSet) {
|
|
66
|
+
setInitialContentSet(true);
|
|
67
|
+
}
|
|
68
|
+
}, [initialContentSet]);
|
|
69
|
+
|
|
70
|
+
// Event handlers with proper types
|
|
71
|
+
var handleClick = (0, _react.useCallback)(function (e) {
|
|
72
|
+
onClick === null || onClick === void 0 || onClick(e, props);
|
|
73
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("click", {
|
|
74
|
+
$event: e
|
|
75
|
+
});
|
|
76
|
+
}, [onClick, props, eventCallback]);
|
|
77
|
+
var handleDoubleClick = (0, _react.useCallback)(function (e) {
|
|
78
|
+
onDoubleClick === null || onDoubleClick === void 0 || onDoubleClick(e, props);
|
|
79
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("dblclick", {
|
|
80
|
+
$event: e
|
|
81
|
+
});
|
|
82
|
+
}, [onDoubleClick, props, eventCallback]);
|
|
83
|
+
var handleMouseEnter = (0, _react.useCallback)(function (e) {
|
|
84
|
+
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter(e, props);
|
|
85
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("mouseenter", {
|
|
86
|
+
$event: e
|
|
87
|
+
});
|
|
88
|
+
}, [onMouseEnter, props, eventCallback]);
|
|
89
|
+
var handleMouseLeave = (0, _react.useCallback)(function (e) {
|
|
90
|
+
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave(e, props);
|
|
91
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("mouseleave", {
|
|
92
|
+
$event: e
|
|
93
|
+
});
|
|
94
|
+
}, [onMouseLeave, props, eventCallback]);
|
|
95
|
+
|
|
96
|
+
// Improved touch event handling
|
|
97
|
+
var handleTouchStart = (0, _react.useCallback)(function (e) {
|
|
98
|
+
var currentTime = new Date().getTime();
|
|
99
|
+
if (onTap) {
|
|
100
|
+
onTap(e, props);
|
|
101
|
+
}
|
|
102
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("tap", {
|
|
103
|
+
$event: e
|
|
104
|
+
});
|
|
105
|
+
if (currentTime - touchStartRef.current < 300) {
|
|
106
|
+
if (onDoubletap) {
|
|
107
|
+
onDoubletap(e, props);
|
|
108
|
+
}
|
|
109
|
+
eventCallback === null || eventCallback === void 0 || eventCallback("doubletap", {
|
|
110
|
+
$event: e
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
touchStartRef.current = currentTime;
|
|
114
|
+
}, [onTap, onDoubletap, props, eventCallback]);
|
|
115
|
+
var handleRefCallback = (0, _react.useCallback)(function (node) {
|
|
116
|
+
htmlRef.current = node;
|
|
117
|
+
if (typeof forwardedRef === "function") {
|
|
118
|
+
forwardedRef(node);
|
|
119
|
+
} else if (forwardedRef && node) {
|
|
120
|
+
forwardedRef.current = node;
|
|
121
|
+
}
|
|
122
|
+
}, [forwardedRef]);
|
|
123
|
+
var handleFocus = (0, _react.useCallback)(function (e) {
|
|
124
|
+
var _props$onFocus;
|
|
125
|
+
props === null || props === void 0 || (_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, e, props);
|
|
126
|
+
}, [props === null || props === void 0 ? void 0 : props.onFocus, props]);
|
|
127
|
+
var handleBlur = (0, _react.useCallback)(function (e) {
|
|
128
|
+
var _props$onBlur;
|
|
129
|
+
props === null || props === void 0 || (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e, props);
|
|
130
|
+
}, [props === null || props === void 0 ? void 0 : props.onBlur, props]);
|
|
131
|
+
var domEvents = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (props === null || props === void 0 ? void 0 : props.onFocus) && {
|
|
132
|
+
onFocus: handleFocus
|
|
133
|
+
}), (props === null || props === void 0 ? void 0 : props.onBlur) && {
|
|
134
|
+
onBlur: handleBlur
|
|
135
|
+
}), (props === null || props === void 0 ? void 0 : props.onClick) && {
|
|
136
|
+
onClick: handleClick
|
|
137
|
+
}), (props === null || props === void 0 ? void 0 : props.onDoubleClick) && {
|
|
138
|
+
onDoubleClick: handleDoubleClick
|
|
139
|
+
}), (props === null || props === void 0 ? void 0 : props.onMouseEnter) && {
|
|
140
|
+
onMouseEnter: handleMouseEnter
|
|
141
|
+
}), (props === null || props === void 0 ? void 0 : props.onMouseLeave) && {
|
|
142
|
+
onMouseLeave: handleMouseLeave
|
|
143
|
+
}), (props === null || props === void 0 ? void 0 : props.onTouchStart) && {
|
|
144
|
+
onTouchStart: handleTouchStart
|
|
145
|
+
});
|
|
146
|
+
return __jsx(_material.Box, (0, _extends2["default"])({
|
|
147
|
+
component: "div",
|
|
148
|
+
ref: handleRefCallback,
|
|
149
|
+
title: hint,
|
|
150
|
+
className: "".concat(className, " app-html-container"),
|
|
151
|
+
"data-element-type": "wm-html",
|
|
152
|
+
"data-name": name,
|
|
153
|
+
"aria-label": arialabel
|
|
154
|
+
}, domEvents, {
|
|
155
|
+
style: getStyles(props)
|
|
156
|
+
}), props.children);
|
|
157
|
+
};
|
|
158
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmHtml);
|
|
@@ -0,0 +1,85 @@
|
|
|
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.WmIcon = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
14
|
+
var _label = _interopRequireDefault(require("@wavemaker/react-runtime/components/basic/label"));
|
|
15
|
+
var _image = _interopRequireDefault(require("next/image"));
|
|
16
|
+
var _resourceUrl = require("@wavemaker/react-runtime/utils/resource-url");
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
18
|
+
var __jsx = _react["default"].createElement;
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
var DEFAULT_CLASS = "app-icon-wrapper";
|
|
22
|
+
var WmIcon = exports.WmIcon = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
23
|
+
var name = props.name,
|
|
24
|
+
listener = props.listener,
|
|
25
|
+
caption = props.caption,
|
|
26
|
+
hint = props.hint,
|
|
27
|
+
_props$iconclass = props.iconclass,
|
|
28
|
+
iconclass = _props$iconclass === void 0 ? "wm-sl-l sl-user" : _props$iconclass,
|
|
29
|
+
iconurl = props.iconurl,
|
|
30
|
+
prefabName = props.prefabName,
|
|
31
|
+
_props$iconposition = props.iconposition,
|
|
32
|
+
iconposition = _props$iconposition === void 0 ? "left" : _props$iconposition,
|
|
33
|
+
iconsize = props.iconsize,
|
|
34
|
+
arialabel = props.arialabel,
|
|
35
|
+
styles = props.styles,
|
|
36
|
+
className = props.className,
|
|
37
|
+
id = props.id;
|
|
38
|
+
var computedIconUrl = (0, _react.useMemo)(function () {
|
|
39
|
+
return (0, _resourceUrl.prefixPrefabResourceUrl)(iconurl, prefabName);
|
|
40
|
+
}, [iconurl, prefabName]);
|
|
41
|
+
var listItemStyles = _objectSpread(_objectSpread({}, styles), {}, {
|
|
42
|
+
fontSize: iconsize
|
|
43
|
+
});
|
|
44
|
+
return __jsx(_Box["default"], {
|
|
45
|
+
className: (0, _clsx["default"])(DEFAULT_CLASS, className),
|
|
46
|
+
sx: _objectSpread(_objectSpread({}, listItemStyles), {}, {
|
|
47
|
+
flexDirection: iconposition === "right" ? "row-reverse" : "row"
|
|
48
|
+
}),
|
|
49
|
+
component: "span",
|
|
50
|
+
"aria-label": arialabel,
|
|
51
|
+
id: id,
|
|
52
|
+
"data-icon-position": iconposition
|
|
53
|
+
}, __jsx(_Box["default"], {
|
|
54
|
+
component: "span",
|
|
55
|
+
className: "sr-only"
|
|
56
|
+
}, caption, " Icon"), computedIconUrl ? __jsx(_image["default"], {
|
|
57
|
+
"data-identifier": "img",
|
|
58
|
+
alt: "Image",
|
|
59
|
+
src: computedIconUrl,
|
|
60
|
+
className: (0, _clsx["default"])("anchor-image-icon", iconclass),
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
style: {
|
|
63
|
+
width: iconsize || "auto",
|
|
64
|
+
height: iconsize || "auto"
|
|
65
|
+
},
|
|
66
|
+
width: parseInt(iconsize || "24", 10),
|
|
67
|
+
height: parseInt(iconsize || "24", 10)
|
|
68
|
+
}) : __jsx("i", {
|
|
69
|
+
className: (0, _clsx["default"])("app-icon", iconclass),
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
style: {
|
|
72
|
+
width: iconsize || "auto",
|
|
73
|
+
height: iconsize || "auto"
|
|
74
|
+
}
|
|
75
|
+
}), caption && __jsx(_label["default"], {
|
|
76
|
+
listener: listener,
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
className: "app-label",
|
|
79
|
+
name: name,
|
|
80
|
+
caption: caption,
|
|
81
|
+
hint: hint
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
WmIcon.displayName = "WmIcon";
|
|
85
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmIcon);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.needsEncoding = void 0;
|
|
7
|
+
var needsEncoding = exports.needsEncoding = function needsEncoding(url) {
|
|
8
|
+
// Matches anything not in the safe character set
|
|
9
|
+
return /[^A-Za-z0-9\-._~:/?#\[\]@!$&'()*+,;=%]/.test(url);
|
|
10
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
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.WmIframe = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
13
|
+
var _withBaseWrapper = require("@wavemaker/react-runtime/higherOrder/withBaseWrapper");
|
|
14
|
+
var _security = require("@wavemaker/react-runtime/core/util/security");
|
|
15
|
+
var _iframe = require("./iframe.utils");
|
|
16
|
+
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); }
|
|
17
|
+
var __jsx = _react["default"].createElement;
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
// Extend BaseProps with optional properties
|
|
21
|
+
|
|
22
|
+
var DEFAULT_CLASS = "embed-responsive app-iframe";
|
|
23
|
+
var WmIframe = exports.WmIframe = function WmIframe(props) {
|
|
24
|
+
var iframesrc = props.iframesrc,
|
|
25
|
+
_props$encodeurl = props.encodeurl,
|
|
26
|
+
encodeurl = _props$encodeurl === void 0 ? false : _props$encodeurl,
|
|
27
|
+
name = props.name,
|
|
28
|
+
hint = props.hint,
|
|
29
|
+
arialabel = props.arialabel,
|
|
30
|
+
_props$width = props.width,
|
|
31
|
+
width = _props$width === void 0 ? "300px" : _props$width,
|
|
32
|
+
_props$height = props.height,
|
|
33
|
+
height = _props$height === void 0 ? "150px" : _props$height,
|
|
34
|
+
className = props.className,
|
|
35
|
+
styles = props.styles;
|
|
36
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
37
|
+
if (!iframesrc) {
|
|
38
|
+
return {
|
|
39
|
+
safeIframeSrc: undefined,
|
|
40
|
+
showContentLoadError: false,
|
|
41
|
+
errorMsg: ""
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
var url = iframesrc;
|
|
45
|
+
if (encodeurl && (0, _iframe.needsEncoding)(url)) {
|
|
46
|
+
url = encodeURIComponent(url);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Check for insecure content request
|
|
50
|
+
var isInsecure = (0, _security.isInsecureContentRequest)(url);
|
|
51
|
+
var error = isInsecure ? "Error: Cannot display content from ".concat(iframesrc) : "";
|
|
52
|
+
|
|
53
|
+
// Only process URL if it's secure
|
|
54
|
+
var trustedUrl = !isInsecure ? _security.securityService.trustAs(url, _security.SecurityContext.RESOURCE_URL) : "";
|
|
55
|
+
return {
|
|
56
|
+
safeIframeSrc: trustedUrl,
|
|
57
|
+
showContentLoadError: isInsecure,
|
|
58
|
+
errorMsg: error
|
|
59
|
+
};
|
|
60
|
+
}, [iframesrc, encodeurl]),
|
|
61
|
+
safeIframeSrc = _useMemo.safeIframeSrc,
|
|
62
|
+
showContentLoadError = _useMemo.showContentLoadError,
|
|
63
|
+
errorMsg = _useMemo.errorMsg;
|
|
64
|
+
return __jsx(_Box["default"], {
|
|
65
|
+
component: "div",
|
|
66
|
+
className: DEFAULT_CLASS,
|
|
67
|
+
width: width,
|
|
68
|
+
height: height,
|
|
69
|
+
style: styles,
|
|
70
|
+
title: hint
|
|
71
|
+
}, __jsx(_Box["default"], {
|
|
72
|
+
seamless: true,
|
|
73
|
+
component: "iframe",
|
|
74
|
+
className: (0, _clsx["default"])("embed-responsive-item iframe-content", className),
|
|
75
|
+
src: safeIframeSrc,
|
|
76
|
+
title: arialabel || "iframe",
|
|
77
|
+
name: name,
|
|
78
|
+
sx: _objectSpread({
|
|
79
|
+
border: 0,
|
|
80
|
+
margin: 0,
|
|
81
|
+
width: width || "100%",
|
|
82
|
+
height: height || "400px"
|
|
83
|
+
}, styles),
|
|
84
|
+
"aria-label": arialabel || "iframe"
|
|
85
|
+
}), showContentLoadError && __jsx(_Box["default"], {
|
|
86
|
+
component: "div",
|
|
87
|
+
className: "wm-content-info readonly-wrapper"
|
|
88
|
+
}, __jsx(_Box["default"], {
|
|
89
|
+
component: "p",
|
|
90
|
+
className: "wm-message",
|
|
91
|
+
title: hint || errorMsg
|
|
92
|
+
}, errorMsg)));
|
|
93
|
+
};
|
|
94
|
+
WmIframe.displayName = "WmIframe";
|
|
95
|
+
var _default = exports["default"] = (0, _withBaseWrapper.withBaseWrapper)(WmIframe);
|