@wavemaker-ai/react-runtime 1.0.0-rc.647469 → 1.0.0-rc.647499
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.d.ts +7 -0
- package/actions/login-action.d.ts +11 -0
- package/actions/logout-action.d.ts +10 -0
- package/actions/navigation-action.d.ts +35 -0
- package/actions/navigation-action.js +23 -5
- package/actions/notification-action.d.ts +20 -0
- package/actions/timer-action.d.ts +27 -0
- package/components/advanced/carousel/index.d.ts +1 -0
- package/components/advanced/carousel/index.js +2 -1
- package/components/advanced/carousel/template.d.ts +1 -0
- package/components/advanced/carousel/template.js +2 -1
- package/components/advanced/login/index.d.ts +1 -0
- package/components/advanced/marquee/index.d.ts +1 -0
- package/components/advanced/marquee/index.js +2 -1
- package/components/basic/anchor/index.d.ts +1 -0
- package/components/basic/anchor/index.js +4 -3
- package/components/basic/audio/index.d.ts +1 -0
- package/components/basic/audio/index.js +3 -2
- package/components/basic/html/index.d.ts +1 -0
- package/components/basic/icon/index.d.ts +1 -0
- package/components/basic/icon/index.js +4 -7
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +8 -4
- package/components/basic/iframe/index.d.ts +1 -0
- package/components/basic/label/index.d.ts +1 -0
- package/components/basic/label/index.js +3 -2
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +1 -0
- package/components/basic/picture/index.js +3 -4
- package/components/basic/progress-bar/index.d.ts +1 -0
- package/components/basic/progress-bar/index.js +2 -1
- package/components/basic/progress-circle/index.d.ts +1 -0
- package/components/basic/richtexteditor/index.d.ts +2 -0
- package/components/basic/search/index.d.ts +3 -0
- package/components/basic/search/index.js +7 -4
- package/components/basic/search/props.d.ts +2 -0
- package/components/basic/spinner/index.d.ts +1 -0
- package/components/basic/tile/index.d.ts +1 -0
- package/components/basic/tile/index.js +2 -1
- package/components/basic/tree/Components/TreeNodeComponent.js +9 -5
- package/components/basic/tree/index.d.ts +1 -0
- package/components/basic/tree/index.js +14 -3
- package/components/basic/tree/utils.d.ts +2 -0
- package/components/basic/tree/utils.js +11 -1
- package/components/basic/video/index.d.ts +1 -0
- package/components/basic/video/index.js +40 -23
- package/components/chart/index.d.ts +1 -0
- package/components/common/AppSpinner.js +2 -5
- package/components/container/accordion/accordion-pane/index.d.ts +1 -0
- package/components/container/accordion/accordion-pane/index.js +1 -4
- package/components/container/accordion/index.d.ts +1 -0
- package/components/container/index.d.ts +3 -0
- package/components/container/index.js +6 -1
- package/components/container/layout-grid/grid-column/index.d.ts +1 -0
- package/components/container/layout-grid/grid-row/index.d.ts +1 -0
- package/components/container/layout-grid/index.d.ts +1 -0
- package/components/container/layout-grid/index.js +4 -8
- package/components/container/linear-layout/index.d.ts +1 -0
- package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
- package/components/container/panel/components/panel-header/index.js +11 -6
- package/components/container/panel/components/panel-header/props.d.ts +5 -0
- package/components/container/panel/index.d.ts +1 -0
- package/components/container/panel/index.js +2 -1
- package/components/container/props.d.ts +2 -0
- package/components/container/repeat-template/index.d.ts +22 -1
- package/components/container/repeat-template/index.js +2 -1
- package/components/container/tabs/index.d.ts +3 -1
- package/components/container/tabs/index.js +102 -51
- package/components/container/tabs/props.d.ts +12 -0
- package/components/container/tabs/tab-pane/index.d.ts +1 -0
- package/components/container/tabs/tab-pane/index.js +28 -11
- package/components/container/wizard/index.d.ts +2 -0
- package/components/container/wizard/wizard-step/index.d.ts +1 -0
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +1 -0
- package/components/data/card/card-actions/index.js +3 -5
- package/components/data/card/card-content/index.d.ts +1 -0
- package/components/data/card/card-content/index.js +3 -13
- package/components/data/card/card-footer/index.d.ts +1 -0
- package/components/data/card/card-footer/index.js +3 -5
- package/components/data/card/index.d.ts +1 -0
- package/components/data/card/index.js +3 -14
- package/components/data/form/dynamic-fields/index.js +7 -1
- package/components/data/form/dynamic-fields/props.d.ts +1 -0
- package/components/data/form/form-action/index.d.ts +2 -0
- package/components/data/form/form-body/index.js +2 -1
- package/components/data/form/form-field/base-field.js +4 -3
- package/components/data/form/form-footer/index.js +2 -1
- package/components/data/list/components/ListItemWithTemplate.js +4 -2
- package/components/data/list/hooks/props.d.ts +2 -2
- package/components/data/list/hooks/useListEventHandlers.js +6 -6
- package/components/data/list/index.d.ts +2 -0
- package/components/data/list/index.js +3 -4
- package/components/data/list/props.d.ts +2 -1
- package/components/data/list/utils/list-widget-methods.d.ts +2 -1
- package/components/data/table/components/RowCells.d.ts +16 -2
- package/components/data/table/components/RowCells.js +38 -24
- package/components/data/table/components/TableBody.js +11 -3
- package/components/data/table/components/TableDataRow.d.ts +3 -0
- package/components/data/table/components/TableDataRow.js +11 -3
- package/components/data/table/components/TableHeader.js +1 -4
- package/components/data/table/hooks/index.d.ts +1 -0
- package/components/data/table/hooks/index.js +12 -0
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +16 -0
- package/components/data/table/hooks/useCustomExpressionColumns.js +88 -0
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +26 -5
- package/components/data/table/hooks/useTableInitialization.js +2 -1
- package/components/data/table/index.d.ts +4 -0
- package/components/data/table/index.js +77 -12
- package/components/data/table/live-table/index.d.ts +1 -0
- package/components/data/table/props.d.ts +7 -0
- package/components/data/table/table-action/index.d.ts +1 -0
- package/components/data/table/table-column/index.d.ts +1 -0
- package/components/data/table/table-row/index.d.ts +1 -0
- package/components/data/table/table-row-action/index.d.ts +1 -0
- package/components/data/table/utils/buildSelectionColumns.js +7 -1
- package/components/data/table/utils/columnBuilder.js +1 -1
- package/components/data/table/utils/index.js +2 -2
- package/components/data/table/utils/renderDisplayCell.js +1 -1
- package/components/dialogs/alert-dialog/index.d.ts +2 -0
- package/components/dialogs/confirm-dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.d.ts +2 -0
- package/components/dialogs/dialog/index.js +2 -4
- package/components/dialogs/dialog-actions/index.d.ts +1 -0
- package/components/dialogs/dialog-body/index.d.ts +1 -0
- package/components/dialogs/dialog-content/index.d.ts +1 -0
- package/components/dialogs/dialog-header/index.d.ts +1 -0
- package/components/dialogs/iframe-dialog/index.d.ts +2 -0
- package/components/dialogs/login-dialog/index.d.ts +2 -0
- package/components/dialogs/page-dialog/index.d.ts +2 -0
- package/components/form/button/index.d.ts +1 -0
- package/components/form/button/index.js +4 -3
- package/components/form/button-group/index.d.ts +1 -0
- package/components/form/button-group/index.js +2 -1
- package/components/input/calendar/index.d.ts +2 -0
- package/components/input/chips/index.d.ts +2 -0
- package/components/input/color-picker/index.d.ts +2 -0
- package/components/input/composite/index.d.ts +1 -0
- package/components/input/currency/index.d.ts +2 -0
- package/components/input/default/checkbox/index.d.ts +2 -0
- package/components/input/default/checkboxset/index.d.ts +2 -0
- package/components/input/default/radioset/index.d.ts +2 -0
- package/components/input/default/switch/index.d.ts +2 -0
- package/components/input/epoch/date/components/DatePickerPopover.js +11 -29
- package/components/input/epoch/date/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.d.ts +1 -0
- package/components/input/epoch/datetime/index.js +10 -25
- package/components/input/epoch/time/index.d.ts +1 -0
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +0 -17
- package/components/input/epoch/time/utils.js +1 -18
- package/components/input/fileupload/index.d.ts +1 -0
- package/components/input/number/index.d.ts +2 -0
- package/components/input/rating/index.d.ts +2 -0
- package/components/input/rating/index.js +14 -17
- package/components/input/select/index.d.ts +2 -0
- package/components/input/select/index.js +1 -4
- package/components/input/slider/index.d.ts +2 -0
- package/components/input/slider/index.js +13 -12
- package/components/input/text/index.d.ts +2 -0
- package/components/input/text/index.js +3 -14
- package/components/input/textarea/index.d.ts +2 -0
- package/components/input/textarea/index.js +7 -10
- package/components/input/upload/index.d.ts +2 -0
- package/components/input/upload/index.js +3 -5
- package/components/layout/footer/index.js +2 -1
- package/components/layout/footer/props.d.ts +1 -0
- package/components/layout/header/index.js +2 -1
- package/components/layout/header/props.d.ts +1 -0
- package/components/layout/leftnav/index.js +2 -1
- package/components/layout/leftnav/props.d.ts +1 -0
- package/components/layout/rightnav/index.js +2 -1
- package/components/layout/rightnav/props.d.ts +1 -0
- package/components/layout/topnav/index.js +2 -1
- package/components/layout/topnav/props.d.ts +1 -0
- package/components/navbar/index.d.ts +1 -0
- package/components/navbar/index.js +2 -1
- package/components/navbar/nav/index.d.ts +1 -0
- package/components/navbar/nav-item/index.d.ts +1 -0
- package/components/navbar/nav-item/index.js +2 -1
- package/components/navigation/breadcrumb/index.d.ts +1 -0
- package/components/navigation/menu/index.d.ts +1 -0
- package/components/navigation/menu/index.js +5 -4
- package/components/navigation/popover/index.d.ts +2 -1
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +13 -9
- package/components/page/partial/index.d.ts +1 -0
- package/components/prefab/container/index.js +2 -1
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +40 -35
- package/core/constants/events.js +6 -0
- package/core/constants/index.d.ts +9 -1
- package/core/constants/index.js +32 -5
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +38 -13
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +15 -5
- package/core/security.service.d.ts +12 -0
- package/core/util/index.js +3 -2
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +0 -17
- package/higherOrder/BasePage.js +53 -104
- package/higherOrder/BasePrefab.js +69 -59
- package/higherOrder/props.d.ts +1 -0
- package/higherOrder/withBaseWrapper.js +3 -4
- package/hooks/useAccess.js +13 -0
- package/mui-config/theme-provider.d.ts +3 -0
- package/mui-config/theme.d.ts +2 -0
- package/mui-config/theme.js +1 -4
- package/package-lock.json +2640 -615
- package/package.json +23 -4
- package/runtime-dynamic/App.d.ts +7 -0
- package/runtime-dynamic/App.js +144 -0
- package/runtime-dynamic/app-initializer.d.ts +15 -0
- package/runtime-dynamic/app-initializer.js +447 -0
- package/runtime-dynamic/components/ErrorBoundary.d.ts +18 -0
- package/runtime-dynamic/components/ErrorBoundary.js +93 -0
- package/runtime-dynamic/components/PageWrapper.d.ts +1 -0
- package/runtime-dynamic/components/PageWrapper.js +43 -0
- package/runtime-dynamic/components/PrefabPreview.d.ts +1 -0
- package/runtime-dynamic/components/PrefabPreview.js +84 -0
- package/runtime-dynamic/components/partial-content.d.ts +15 -0
- package/runtime-dynamic/components/partial-content.js +50 -0
- package/runtime-dynamic/components/prefab-content.d.ts +10 -0
- package/runtime-dynamic/components/prefab-content.js +31 -0
- package/runtime-dynamic/components/use-dynamic-component.d.ts +10 -0
- package/runtime-dynamic/components/use-dynamic-component.js +165 -0
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +8 -0
- package/runtime-dynamic/factories/build-base-page-like-component.js +59 -0
- package/runtime-dynamic/factories/prefab-factory.d.ts +3 -0
- package/runtime-dynamic/factories/prefab-factory.js +82 -0
- package/runtime-dynamic/factories/startup-info.d.ts +6 -0
- package/runtime-dynamic/factories/startup-info.js +28 -0
- package/runtime-dynamic/factories/utils.d.ts +23 -0
- package/runtime-dynamic/factories/utils.js +131 -0
- package/runtime-dynamic/index.d.ts +14 -0
- package/runtime-dynamic/index.js +191 -0
- package/runtime-dynamic/main.d.ts +2 -0
- package/runtime-dynamic/main.js +84 -0
- package/runtime-dynamic/preview-mode.d.ts +15 -0
- package/runtime-dynamic/preview-mode.js +31 -0
- package/runtime-dynamic/preview-navigation.d.ts +6 -0
- package/runtime-dynamic/preview-navigation.js +38 -0
- package/runtime-dynamic/preview-resource-base.d.ts +12 -0
- package/runtime-dynamic/preview-resource-base.js +65 -0
- package/runtime-dynamic/registry/component-registry.d.ts +3 -0
- package/runtime-dynamic/registry/component-registry.js +353 -0
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +7 -0
- package/runtime-dynamic/registry/custom-widget-registry.js +18 -0
- package/runtime-dynamic/registry/index.d.ts +2 -0
- package/runtime-dynamic/registry/index.js +63 -0
- package/runtime-dynamic/registry/store.d.ts +9 -0
- package/runtime-dynamic/registry/store.js +26 -0
- package/runtime-dynamic/routes.d.ts +2 -0
- package/runtime-dynamic/routes.js +107 -0
- package/runtime-dynamic/services/app-extension-provider.d.ts +1 -0
- package/runtime-dynamic/services/app-extension-provider.js +45 -0
- package/runtime-dynamic/services/cache.d.ts +29 -0
- package/runtime-dynamic/services/cache.js +57 -0
- package/runtime-dynamic/services/component-ref-provider.d.ts +12 -0
- package/runtime-dynamic/services/component-ref-provider.js +149 -0
- package/runtime-dynamic/services/css-scoping.d.ts +2 -0
- package/runtime-dynamic/services/css-scoping.js +53 -0
- package/runtime-dynamic/services/fragment-url.d.ts +16 -0
- package/runtime-dynamic/services/fragment-url.js +74 -0
- package/runtime-dynamic/services/index.d.ts +10 -0
- package/runtime-dynamic/services/index.js +152 -0
- package/runtime-dynamic/services/markup-transpiler.d.ts +12 -0
- package/runtime-dynamic/services/markup-transpiler.js +250 -0
- package/runtime-dynamic/services/prefab-resources.d.ts +18 -0
- package/runtime-dynamic/services/prefab-resources.js +159 -0
- package/runtime-dynamic/services/resource-manager.d.ts +2 -0
- package/runtime-dynamic/services/resource-manager.js +66 -0
- package/runtime-dynamic/services/script-executor.d.ts +8 -0
- package/runtime-dynamic/services/script-executor.js +90 -0
- package/runtime-dynamic/services/variable-factory.d.ts +2 -0
- package/runtime-dynamic/services/variable-factory.js +260 -0
- package/runtime-dynamic/services/variable-registry.d.ts +12 -0
- package/runtime-dynamic/services/variable-registry.js +118 -0
- package/runtime-dynamic/services/variable-transpiler.d.ts +5 -0
- package/runtime-dynamic/services/variable-transpiler.js +159 -0
- package/runtime-dynamic/shims/next-image.d.ts +35 -0
- package/runtime-dynamic/shims/next-image.js +60 -0
- package/runtime-dynamic/shims/next-link.d.ts +25 -0
- package/runtime-dynamic/shims/next-link.js +33 -0
- package/runtime-dynamic/shims/next-navigation.d.ts +16 -0
- package/runtime-dynamic/shims/next-navigation.js +52 -0
- package/runtime-dynamic/utils/index.d.ts +9 -0
- package/runtime-dynamic/utils/index.js +40 -0
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +10 -8
- package/store/slices/authSlice.js +46 -32
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +1 -0
- package/utils/attr.js +71 -14
- package/utils/custom-expression/index.d.ts +43 -0
- package/utils/custom-expression/index.js +161 -0
- package/utils/custom-expression/parser.d.ts +15 -0
- package/utils/custom-expression/parser.js +208 -0
- package/utils/layoutsize-util.d.ts +1 -0
- package/utils/layoutsize-util.js +57 -0
- package/utils/lib-error-skipper.d.ts +4 -26
- package/utils/lib-error-skipper.js +41 -165
- package/utils/style-utils.d.ts +6 -0
- package/utils/style-utils.js +10 -1
- package/variables/metadata.service.js +2 -3
- package/variables/model-variable.js +10 -7
- package/variables/service-variable.d.ts +1 -0
- package/variables/service-variable.js +26 -6
- package/components/input/epoch/datetime/styled.d.ts +0 -78
- package/components/input/epoch/datetime/styled.js +0 -90
|
@@ -91,6 +91,7 @@ declare const _default: React.ComponentType<{
|
|
|
91
91
|
eventCallback?: (eventName: string, data: any) => void;
|
|
92
92
|
forwardedRef?: React.ForwardedRef<any>;
|
|
93
93
|
viewParent?: any;
|
|
94
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
94
95
|
hint?: string;
|
|
95
96
|
arialabel?: string;
|
|
96
97
|
tabindex?: number;
|
|
@@ -16,6 +16,7 @@ var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
|
16
16
|
var _hooks = require("./hooks");
|
|
17
17
|
var _panelHeader = _interopRequireDefault(require("./components/panel-header"));
|
|
18
18
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker-ai/react-runtime/higherOrder/withBaseWrapper"));
|
|
19
|
+
var _attr = require("@wavemaker-ai/react-runtime/utils/attr");
|
|
19
20
|
var _excluded = ["actions", "badgetype", "badgevalue", "closable", "collapsible", "enablefullscreen", "expanded", "fullscreen", "helptext", "hint", "iconclass", "iconheight", "iconmargin", "iconurl", "iconwidth", "subheading", "title", "className", "style", "children", "height", "name", "itemlabel", "itemlink", "itemicon", "itemchildren", "onActionsclick", "onClose", "onCollapse", "onExpand", "onExitfullscreen", "onFullscreen", "onLoad", "onMouseEnter", "onMouseLeave", "onMouseOut", "onMouseOver", "onPropertyChange", "listener", "Widgets"];
|
|
20
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
21
22
|
var __jsx = _react["default"].createElement;
|
|
@@ -224,7 +225,7 @@ var WmPanel = exports.WmPanel = function WmPanel(props) {
|
|
|
224
225
|
onMouseOut: handleMouseOut,
|
|
225
226
|
hidden: !show,
|
|
226
227
|
component: "div"
|
|
227
|
-
}, componentProps, {
|
|
228
|
+
}, (0, _attr.removeInvalidAttributes)(componentProps), {
|
|
228
229
|
style: _objectSpread(_objectSpread({}, props.styles), props.conditionalstyle)
|
|
229
230
|
}), showHeader && __jsx(_material.Box, {
|
|
230
231
|
className: (0, _clsx["default"])("panel-heading", {
|
|
@@ -62,6 +62,8 @@ export interface ContainerPropsBase {
|
|
|
62
62
|
*/
|
|
63
63
|
onLoad?: (widget?: Record<string, unknown>) => void;
|
|
64
64
|
layoutClassName?: string;
|
|
65
|
+
layoutWidth?: string;
|
|
66
|
+
layoutHeight?: string;
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Combined props for the WmContainer component, including base WaveMaker props.
|
|
@@ -22,7 +22,27 @@ declare const _default: import("react").ComponentType<{
|
|
|
22
22
|
conditionalclass?: string;
|
|
23
23
|
showindevice?: ("xs" | "sm" | "md" | "lg" | "all")[];
|
|
24
24
|
onClick?: (event?: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
25
|
-
onDoubleClick?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal
|
|
25
|
+
onDoubleClick?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal
|
|
26
|
+
/**
|
|
27
|
+
* The WmRepeatTemplate component wraps content for use in repeat/list
|
|
28
|
+
* contexts. Typically used as a template inside list or repeat containers.
|
|
29
|
+
*
|
|
30
|
+
* - [Playground](https://react-components.wavemaker.ai/?path=/story/container-repeattemplate--showcase)
|
|
31
|
+
*
|
|
32
|
+
* - [Docs](https://react-components.wavemaker.ai/?path=/story/container-repeattemplate--docs#tab-overview)
|
|
33
|
+
*
|
|
34
|
+
* @param props - {@link WmRepeatTemplateProps}
|
|
35
|
+
*/
|
|
36
|
+
? /**
|
|
37
|
+
* The WmRepeatTemplate component wraps content for use in repeat/list
|
|
38
|
+
* contexts. Typically used as a template inside list or repeat containers.
|
|
39
|
+
*
|
|
40
|
+
* - [Playground](https://react-components.wavemaker.ai/?path=/story/container-repeattemplate--showcase)
|
|
41
|
+
*
|
|
42
|
+
* - [Docs](https://react-components.wavemaker.ai/?path=/story/container-repeattemplate--docs#tab-overview)
|
|
43
|
+
*
|
|
44
|
+
* @param props - {@link WmRepeatTemplateProps}
|
|
45
|
+
*/: string | number | null) => void;
|
|
26
46
|
onMouseEnter?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
27
47
|
onMouseLeave?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
28
48
|
onMouseOver?: (event: React.MouseEvent<HTMLElement>, widget?: Record<string, any>, newVal?: string | number | null, oldVal?: string | number | null) => void;
|
|
@@ -35,6 +55,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
35
55
|
eventCallback?: (eventName: string, data: any) => void;
|
|
36
56
|
forwardedRef?: React.ForwardedRef<any>;
|
|
37
57
|
viewParent?: any;
|
|
58
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
38
59
|
hint?: string;
|
|
39
60
|
arialabel?: string;
|
|
40
61
|
tabindex?: number;
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker-ai/react-runtime/higherOrder/withBaseWrapper"));
|
|
13
13
|
var _lodashEs = require("lodash-es");
|
|
14
|
+
var _attr = require("@wavemaker-ai/react-runtime/utils/attr");
|
|
14
15
|
var _excluded = ["name", "show", "children"];
|
|
15
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); }
|
|
16
17
|
var __jsx = _react["default"].createElement;
|
|
@@ -22,7 +23,7 @@ var WmRepeatTemplate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
22
23
|
return __jsx("div", (0, _extends2["default"])({
|
|
23
24
|
className: "app-repeat-item",
|
|
24
25
|
hidden: !show
|
|
25
|
-
}, restProps), children);
|
|
26
|
+
}, (0, _attr.removeInvalidAttributes)(restProps)), children);
|
|
26
27
|
}, function (prev, next) {
|
|
27
28
|
var keys = ["name", "show", "children", "hidden", "className", "styles"];
|
|
28
29
|
return keys.every(function (key) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { WmTabsProps } from "./props";
|
|
2
|
+
import { WmTabsProps, PaneHeaderProps } from "./props";
|
|
3
3
|
export declare const useTabsContext: () => {
|
|
4
4
|
selectedIndex: number;
|
|
5
5
|
setSelectedIndex: (index: number) => void;
|
|
6
6
|
tabsContainerName?: string;
|
|
7
|
+
updatePaneHeader: (name: string | undefined, headerProps: PaneHeaderProps) => void;
|
|
7
8
|
};
|
|
8
9
|
export declare const WmTabs: React.MemoExoticComponent<(Props: WmTabsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
10
|
/**
|
|
@@ -57,6 +58,7 @@ declare const _default: React.ComponentType<{
|
|
|
57
58
|
eventCallback?: (eventName: string, data: any) => void;
|
|
58
59
|
forwardedRef?: React.ForwardedRef<any>;
|
|
59
60
|
viewParent?: any;
|
|
61
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
60
62
|
hint?: string;
|
|
61
63
|
arialabel?: string;
|
|
62
64
|
tabindex?: number;
|
|
@@ -25,6 +25,28 @@ var __jsx = _react["default"].createElement;
|
|
|
25
25
|
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; }
|
|
26
26
|
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; }
|
|
27
27
|
var DEFAULT_CLASS = "nav nav-tabs";
|
|
28
|
+
var PANE_HEADER_PROP_KEYS = ["name", "title", "disabled", "show", "paneicon", "badgevalue", "badgetype", "className", "onHeaderclick", "onHeaderClick"];
|
|
29
|
+
var getPaneHeaderProps = function getPaneHeaderProps(props) {
|
|
30
|
+
return {
|
|
31
|
+
name: props === null || props === void 0 ? void 0 : props.name,
|
|
32
|
+
title: props === null || props === void 0 ? void 0 : props.title,
|
|
33
|
+
disabled: props === null || props === void 0 ? void 0 : props.disabled,
|
|
34
|
+
show: props === null || props === void 0 ? void 0 : props.show,
|
|
35
|
+
paneicon: props === null || props === void 0 ? void 0 : props.paneicon,
|
|
36
|
+
badgevalue: props === null || props === void 0 ? void 0 : props.badgevalue,
|
|
37
|
+
badgetype: props === null || props === void 0 ? void 0 : props.badgetype,
|
|
38
|
+
className: props === null || props === void 0 ? void 0 : props.className,
|
|
39
|
+
onHeaderclick: props === null || props === void 0 ? void 0 : props.onHeaderclick,
|
|
40
|
+
onHeaderClick: props === null || props === void 0 ? void 0 : props.onHeaderClick
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
var arePaneHeaderPropsEqual = function arePaneHeaderPropsEqual() {
|
|
44
|
+
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
45
|
+
var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46
|
+
return PANE_HEADER_PROP_KEYS.every(function (key) {
|
|
47
|
+
return Object.is(prev[key], next[key]);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
28
50
|
|
|
29
51
|
// Helper function to check if a component is WmTabPane
|
|
30
52
|
var isTabPaneComponent = function isTabPaneComponent(child) {
|
|
@@ -35,7 +57,8 @@ var isTabPaneComponent = function isTabPaneComponent(child) {
|
|
|
35
57
|
var TabsContext = /*#__PURE__*/(0, _react.createContext)({
|
|
36
58
|
selectedIndex: 0,
|
|
37
59
|
setSelectedIndex: function setSelectedIndex() {},
|
|
38
|
-
tabsContainerName: undefined
|
|
60
|
+
tabsContainerName: undefined,
|
|
61
|
+
updatePaneHeader: function updatePaneHeader() {}
|
|
39
62
|
});
|
|
40
63
|
var useTabsContext = exports.useTabsContext = function useTabsContext() {
|
|
41
64
|
return (0, _react.useContext)(TabsContext);
|
|
@@ -63,6 +86,7 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
63
86
|
|
|
64
87
|
// Pending tab from NavigateTo (cross-page); mirrored from Redux via store middleware so this works without Provider
|
|
65
88
|
var initialPendingTabRef = (0, _react.useRef)((0, _pendingTabNavigationIntent.getPendingTabNavigationIntent)());
|
|
89
|
+
var Widgets = listener === null || listener === void 0 ? void 0 : listener.Widgets;
|
|
66
90
|
var panesCount = (0, _react.useRef)(0);
|
|
67
91
|
var prevSelectedIndex = (0, _react.useRef)(null);
|
|
68
92
|
|
|
@@ -86,10 +110,24 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
86
110
|
var _useState2 = (0, _react.useState)(new Set()),
|
|
87
111
|
hiddenTabNames = _useState2[0],
|
|
88
112
|
setHiddenTabNames = _useState2[1];
|
|
113
|
+
var _useState3 = (0, _react.useState)({}),
|
|
114
|
+
paneHeaderOverrides = _useState3[0],
|
|
115
|
+
setPaneHeaderOverrides = _useState3[1];
|
|
89
116
|
// Track which tab indices have been rendered at least once (for dynamic tabs)
|
|
90
|
-
var
|
|
91
|
-
renderedTabIndices =
|
|
92
|
-
setRenderedTabIndices =
|
|
117
|
+
var _useState4 = (0, _react.useState)(new Set([selectedIndex])),
|
|
118
|
+
renderedTabIndices = _useState4[0],
|
|
119
|
+
setRenderedTabIndices = _useState4[1];
|
|
120
|
+
var updatePaneHeader = (0, _react.useCallback)(function (paneName, headerProps) {
|
|
121
|
+
if (!paneName) return;
|
|
122
|
+
var nextHeaderProps = getPaneHeaderProps(headerProps);
|
|
123
|
+
setPaneHeaderOverrides(function (prev) {
|
|
124
|
+
var prevHeaderProps = prev[paneName];
|
|
125
|
+
if (arePaneHeaderPropsEqual(prevHeaderProps, nextHeaderProps)) {
|
|
126
|
+
return prev;
|
|
127
|
+
}
|
|
128
|
+
return _objectSpread(_objectSpread({}, prev), {}, (0, _defineProperty2["default"])({}, paneName, nextHeaderProps));
|
|
129
|
+
});
|
|
130
|
+
}, []);
|
|
93
131
|
|
|
94
132
|
// Keep currentSelectedIndex ref in sync with state
|
|
95
133
|
(0, _react.useEffect)(function () {
|
|
@@ -156,10 +194,9 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
156
194
|
}
|
|
157
195
|
}, []);
|
|
158
196
|
|
|
159
|
-
// get the
|
|
160
|
-
var
|
|
197
|
+
// get the active tab name for a given index
|
|
198
|
+
var getActiveTabNameByIndex = _react["default"].useCallback(function (currentIndex) {
|
|
161
199
|
var _activeChild$props;
|
|
162
|
-
var currentIndex = currentSelectedIndex.current;
|
|
163
200
|
if (type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) > 0) {
|
|
164
201
|
var _dataset$currentIndex;
|
|
165
202
|
return ((_dataset$currentIndex = dataset[currentIndex]) === null || _dataset$currentIndex === void 0 ? void 0 : _dataset$currentIndex.name) || null;
|
|
@@ -174,15 +211,17 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
174
211
|
// get the active tab widget from listener
|
|
175
212
|
var getActiveTab = _react["default"].useCallback(function () {
|
|
176
213
|
var _listener$Widgets;
|
|
177
|
-
var
|
|
214
|
+
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : currentSelectedIndex.current;
|
|
215
|
+
var activeTabName = getActiveTabNameByIndex(index);
|
|
178
216
|
return activeTabName ? listener === null || listener === void 0 || (_listener$Widgets = listener.Widgets) === null || _listener$Widgets === void 0 ? void 0 : _listener$Widgets[activeTabName] : null;
|
|
179
|
-
}, [
|
|
217
|
+
}, [getActiveTabNameByIndex, listener]);
|
|
180
218
|
var updateListener = function updateListener() {
|
|
219
|
+
var activeIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : currentSelectedIndex.current;
|
|
181
220
|
if (listener && listener.onChange) {
|
|
182
221
|
listener.onChange(name, {
|
|
183
222
|
prev: prev,
|
|
184
223
|
next: next,
|
|
185
|
-
activeTab: getActiveTab(),
|
|
224
|
+
activeTab: getActiveTab(activeIndex),
|
|
186
225
|
panes: {
|
|
187
226
|
length: panesCount.current
|
|
188
227
|
},
|
|
@@ -210,6 +249,13 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
210
249
|
});
|
|
211
250
|
}
|
|
212
251
|
};
|
|
252
|
+
var getLatestTabsWidget = function getLatestTabsWidget(activeIndex) {
|
|
253
|
+
var _listener$Widgets2;
|
|
254
|
+
var registeredTabsWidget = name ? listener === null || listener === void 0 || (_listener$Widgets2 = listener.Widgets) === null || _listener$Widgets2 === void 0 ? void 0 : _listener$Widgets2[name] : null;
|
|
255
|
+
return _objectSpread(_objectSpread({}, registeredTabsWidget || props), {}, {
|
|
256
|
+
activeTab: getActiveTab(activeIndex)
|
|
257
|
+
});
|
|
258
|
+
};
|
|
213
259
|
|
|
214
260
|
// register the methods
|
|
215
261
|
(0, _react.useEffect)(function () {
|
|
@@ -236,10 +282,8 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
236
282
|
(0, _react.useEffect)(function () {
|
|
237
283
|
// If a tab was targeted via navigation (NavigateTo action with tabName),
|
|
238
284
|
// honour that selection and skip the default/saved-state logic entirely.
|
|
239
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
240
285
|
var pendingTab = initialPendingTabRef.current;
|
|
241
286
|
if (pendingTab && children) {
|
|
242
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
243
287
|
var visibleChildren = (0, _utils.filterVisibleChildren)(children, new Set());
|
|
244
288
|
var matchIndex = visibleChildren.findIndex(function (c) {
|
|
245
289
|
var _c$props2;
|
|
@@ -278,10 +322,9 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
278
322
|
return;
|
|
279
323
|
}
|
|
280
324
|
if (item !== null && item !== void 0 && item.onHeaderclick) {
|
|
281
|
-
|
|
282
|
-
item.onHeaderclick(e, listener === null || listener === void 0 || (_listener$Widgets2 = listener.Widgets) === null || _listener$Widgets2 === void 0 ? void 0 : _listener$Widgets2[name], index);
|
|
325
|
+
item.onHeaderclick(e, Widgets === null || Widgets === void 0 ? void 0 : Widgets[name], index);
|
|
283
326
|
}
|
|
284
|
-
}, []);
|
|
327
|
+
}, [Widgets, name]);
|
|
285
328
|
var renderTabHeader = _react["default"].useCallback(function (item, index) {
|
|
286
329
|
return __jsx(_tabs.Tabs.Tab, (0, _extends2["default"])({}, item, {
|
|
287
330
|
title: item.title || item.name || "Tab ".concat(index + 1),
|
|
@@ -301,11 +344,9 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
301
344
|
tabIndex: selectedIndex === index ? 0 : -1,
|
|
302
345
|
render: function render(prop) {
|
|
303
346
|
return __jsx("li", prop, __jsx("div", {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
className: "tab-heading",
|
|
347
|
+
className: (0, _clsx["default"])("tab-heading", "wm-tabs-heading", {
|
|
348
|
+
"wm-tabs-heading-disabled": item.disabled
|
|
349
|
+
}),
|
|
309
350
|
"icon-position": iconposition || "left",
|
|
310
351
|
title: item.title || item.name || "Tab ".concat(index + 1),
|
|
311
352
|
"aria-selected": selectedIndex === index,
|
|
@@ -327,15 +368,19 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
327
368
|
}, item.badgevalue)));
|
|
328
369
|
}
|
|
329
370
|
}));
|
|
330
|
-
}, [selectedIndex, iconposition]);
|
|
371
|
+
}, [selectedIndex, iconposition, handleTabHeaderClick]);
|
|
331
372
|
var renderDynamicTabs = _react["default"].useCallback(function () {
|
|
332
373
|
if (!(dataset !== null && dataset !== void 0 && dataset.length)) return null;
|
|
333
374
|
var headers = [];
|
|
334
375
|
var tabIndex = 0;
|
|
335
376
|
var addTabHeader = function addTabHeader(itemProps) {
|
|
377
|
+
var paneName = itemProps === null || itemProps === void 0 ? void 0 : itemProps.name;
|
|
378
|
+
var latestWidgetState = paneName ? (Widgets === null || Widgets === void 0 ? void 0 : Widgets[paneName]) || {} : {};
|
|
379
|
+
var headerOverrides = paneName ? paneHeaderOverrides[paneName] || {} : {};
|
|
380
|
+
var resolvedItemProps = _objectSpread(_objectSpread(_objectSpread({}, itemProps), latestWidgetState), headerOverrides);
|
|
336
381
|
headers.push(__jsx(_react["default"].Fragment, {
|
|
337
382
|
key: tabIndex
|
|
338
|
-
}, renderTabHeader(
|
|
383
|
+
}, renderTabHeader(resolvedItemProps, tabIndex)));
|
|
339
384
|
tabIndex++;
|
|
340
385
|
};
|
|
341
386
|
dataset.forEach(function (item, index) {
|
|
@@ -356,25 +401,34 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
356
401
|
});
|
|
357
402
|
panesCount.current = tabIndex;
|
|
358
403
|
return headers;
|
|
359
|
-
}, [dataset, render, renderTabHeader]);
|
|
404
|
+
}, [dataset, render, renderTabHeader, Widgets, paneHeaderOverrides]);
|
|
360
405
|
var renderStaticTabs = _react["default"].useCallback(function () {
|
|
361
406
|
// Consider only panes with show !== false and not hidden via internal state
|
|
362
407
|
var visibleChildren = (0, _utils.filterVisibleChildren)(children, hiddenTabNames);
|
|
363
408
|
panesCount.current = visibleChildren.length;
|
|
364
409
|
return visibleChildren.map(function (child, index) {
|
|
365
|
-
var _child$props
|
|
410
|
+
var _child$props;
|
|
366
411
|
if (!child) return null;
|
|
367
412
|
var paneName = child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.name;
|
|
368
|
-
var latestWidgetState = paneName ? (
|
|
369
|
-
var
|
|
413
|
+
var latestWidgetState = paneName ? (Widgets === null || Widgets === void 0 ? void 0 : Widgets[paneName]) || {} : {};
|
|
414
|
+
var headerOverrides = paneName ? paneHeaderOverrides[paneName] || {} : {};
|
|
415
|
+
var itemProps = _objectSpread(_objectSpread(_objectSpread({}, child.props), latestWidgetState), headerOverrides);
|
|
370
416
|
return __jsx(_react["default"].Fragment, {
|
|
371
417
|
key: index
|
|
372
418
|
}, renderTabHeader(itemProps, index));
|
|
373
419
|
});
|
|
374
|
-
}, [children, renderTabHeader, hiddenTabNames]);
|
|
420
|
+
}, [children, renderTabHeader, hiddenTabNames, Widgets, paneHeaderOverrides]);
|
|
375
421
|
var renderTabs = _react["default"].useMemo(function () {
|
|
376
422
|
return type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) > 0 ? renderDynamicTabs() : renderStaticTabs();
|
|
377
423
|
}, [type, dataset, renderDynamicTabs, renderStaticTabs]);
|
|
424
|
+
var tabsContextValue = (0, _react.useMemo)(function () {
|
|
425
|
+
return {
|
|
426
|
+
selectedIndex: selectedIndex,
|
|
427
|
+
setSelectedIndex: setSelectedIndex,
|
|
428
|
+
tabsContainerName: name,
|
|
429
|
+
updatePaneHeader: updatePaneHeader
|
|
430
|
+
};
|
|
431
|
+
}, [selectedIndex, name, updatePaneHeader]);
|
|
378
432
|
|
|
379
433
|
// for vertical tabs, we need to set the flex direction to row
|
|
380
434
|
var orientation = tabsposition === "left" || tabsposition === "right" ? "vertical" : "horizontal";
|
|
@@ -403,9 +457,16 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
403
457
|
});
|
|
404
458
|
}
|
|
405
459
|
|
|
406
|
-
// For static tabs, render only visible panes
|
|
460
|
+
// For static tabs, render only visible panes with corrected indices
|
|
461
|
+
// so they match the sequential header indices assigned by renderStaticTabs
|
|
407
462
|
var visibleChildren = (0, _utils.filterVisibleChildren)(children, hiddenTabNames);
|
|
408
|
-
return visibleChildren
|
|
463
|
+
return visibleChildren.map(function (child, idx) {
|
|
464
|
+
if (!(child !== null && child !== void 0 && child.props)) return child;
|
|
465
|
+
if (child.props.index === idx) return child;
|
|
466
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
467
|
+
index: idx
|
|
468
|
+
});
|
|
469
|
+
});
|
|
409
470
|
};
|
|
410
471
|
if (type === "dynamic" && (dataset === null || dataset === void 0 ? void 0 : dataset.length) <= 0) {
|
|
411
472
|
return __jsx("div", null, nodatamessage);
|
|
@@ -413,11 +474,7 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
413
474
|
// moves tab list to end for right/bottom (appendNode), so content is first in DOM.
|
|
414
475
|
var contentFirst = tabsposition === "right" || tabsposition === "bottom";
|
|
415
476
|
return __jsx(TabsContext.Provider, {
|
|
416
|
-
value:
|
|
417
|
-
selectedIndex: selectedIndex,
|
|
418
|
-
setSelectedIndex: setSelectedIndex,
|
|
419
|
-
tabsContainerName: name
|
|
420
|
-
}
|
|
477
|
+
value: tabsContextValue
|
|
421
478
|
}, __jsx(_tabs.Tabs.Root, {
|
|
422
479
|
style: styles,
|
|
423
480
|
name: name,
|
|
@@ -432,10 +489,10 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
432
489
|
currentSelectedIndex.current = newIndex;
|
|
433
490
|
setSelectedIndex(newIndex);
|
|
434
491
|
saveStateToStorage(newIndex);
|
|
435
|
-
onChange === null || onChange === void 0 || onChange(null, props, newIndex, oldIndex);
|
|
436
492
|
|
|
437
|
-
//
|
|
438
|
-
updateListener();
|
|
493
|
+
// Publish activeTab before external handlers read wm.Widgets[name].activeTab.
|
|
494
|
+
updateListener(newIndex);
|
|
495
|
+
onChange === null || onChange === void 0 || onChange(null, getLatestTabsWidget(newIndex), newIndex, oldIndex);
|
|
439
496
|
},
|
|
440
497
|
orientation: orientation,
|
|
441
498
|
className: (0, _clsx["default"])("app-tabs clearfix", className, {
|
|
@@ -444,14 +501,11 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
444
501
|
inverted: contentFirst
|
|
445
502
|
})
|
|
446
503
|
}, contentFirst ? __jsx(_react["default"].Fragment, null, __jsx("div", {
|
|
447
|
-
className: (0, _clsx["default"])("tab-content", {
|
|
504
|
+
className: (0, _clsx["default"])("tab-content", "wm-tabs-content", {
|
|
448
505
|
"tab-stacked": orientation === "vertical",
|
|
449
|
-
"tab-justified": justified
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
flex: orientation === "vertical" ? 1 : undefined,
|
|
453
|
-
minWidth: orientation === "vertical" ? 0 : undefined
|
|
454
|
-
}
|
|
506
|
+
"tab-justified": justified,
|
|
507
|
+
"wm-tabs-content-vertical": orientation === "vertical"
|
|
508
|
+
})
|
|
455
509
|
}, renderTabPanels()), __jsx(_tabs.Tabs.List, {
|
|
456
510
|
className: (0, _clsx["default"])(DEFAULT_CLASS, {
|
|
457
511
|
"nav-stacked": orientation === "vertical",
|
|
@@ -471,14 +525,11 @@ var WmTabs = exports.WmTabs = /*#__PURE__*/(0, _react.memo)(function (Props) {
|
|
|
471
525
|
return __jsx("ul", props, renderTabs);
|
|
472
526
|
}
|
|
473
527
|
}), __jsx("div", {
|
|
474
|
-
className: (0, _clsx["default"])("tab-content", {
|
|
528
|
+
className: (0, _clsx["default"])("tab-content", "wm-tabs-content", {
|
|
475
529
|
"tab-stacked": orientation === "vertical",
|
|
476
|
-
"tab-justified": justified
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
flex: orientation === "vertical" ? 1 : undefined,
|
|
480
|
-
minWidth: orientation === "vertical" ? 0 : undefined
|
|
481
|
-
}
|
|
530
|
+
"tab-justified": justified,
|
|
531
|
+
"wm-tabs-content-vertical": orientation === "vertical"
|
|
532
|
+
})
|
|
482
533
|
}, renderTabPanels()))));
|
|
483
534
|
}, function (prev, next) {
|
|
484
535
|
var keys = ["dataset", "defaultpaneindex", "justified", "tabsposition", "nodatamessage", "statehandler", "autotabactivation", "transition", "type", "iconposition", "render", "selectedindex", "children"];
|
|
@@ -13,6 +13,18 @@ export type TabIconPosition = "top" | "start" | "end" | "bottom" | "left";
|
|
|
13
13
|
* Transition effect when switching tabs.
|
|
14
14
|
*/
|
|
15
15
|
export type TabTransition = "none" | "slide" | "fade";
|
|
16
|
+
export type PaneHeaderProps = {
|
|
17
|
+
name?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
show?: string | boolean;
|
|
21
|
+
paneicon?: string;
|
|
22
|
+
badgevalue?: string | number;
|
|
23
|
+
badgetype?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
onHeaderclick?: (...args: any[]) => void;
|
|
26
|
+
onHeaderClick?: (...args: any[]) => void;
|
|
27
|
+
};
|
|
16
28
|
/**
|
|
17
29
|
* Base props specific to the WmTabs component.
|
|
18
30
|
*/
|
|
@@ -64,6 +64,7 @@ declare const _default: React.ComponentType<{
|
|
|
64
64
|
eventCallback?: (eventName: string, data: any) => void;
|
|
65
65
|
forwardedRef?: React.ForwardedRef<any>;
|
|
66
66
|
viewParent?: any;
|
|
67
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
67
68
|
hint?: string;
|
|
68
69
|
arialabel?: string;
|
|
69
70
|
tabindex?: number;
|
|
@@ -15,8 +15,6 @@ var _ = require("..");
|
|
|
15
15
|
var _widgetInstanceUtils = require("@wavemaker-ai/react-runtime/components/data/list/utils/widget-instance-utils");
|
|
16
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
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
18
|
var WmTabpane = exports.WmTabpane = function WmTabpane(props) {
|
|
21
19
|
var className = props.className,
|
|
22
20
|
disabled = props.disabled,
|
|
@@ -26,12 +24,15 @@ var WmTabpane = exports.WmTabpane = function WmTabpane(props) {
|
|
|
26
24
|
listener = props.listener,
|
|
27
25
|
item = props.item,
|
|
28
26
|
layoutClassName = props.layoutClassName;
|
|
27
|
+
var onHeaderclick = props.onHeaderclick;
|
|
29
28
|
var _useTabsContext = (0, _.useTabsContext)(),
|
|
30
29
|
selectedIndex = _useTabsContext.selectedIndex,
|
|
31
30
|
setSelectedIndex = _useTabsContext.setSelectedIndex,
|
|
32
|
-
tabsContainerName = _useTabsContext.tabsContainerName
|
|
31
|
+
tabsContainerName = _useTabsContext.tabsContainerName,
|
|
32
|
+
updatePaneHeader = _useTabsContext.updatePaneHeader;
|
|
33
33
|
var wasActiveRef = _react["default"].useRef(false);
|
|
34
34
|
var loadedRef = _react["default"].useRef(false);
|
|
35
|
+
var hasReportedHeaderRef = _react["default"].useRef(false);
|
|
35
36
|
(0, _react.useEffect)(function () {
|
|
36
37
|
var _props$listener;
|
|
37
38
|
var isActive = selectedIndex === index;
|
|
@@ -48,7 +49,6 @@ var WmTabpane = exports.WmTabpane = function WmTabpane(props) {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
// Read widgetInstance AFTER registration above so it carries select/deselect/isActive
|
|
51
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
52
|
var widgetInstance = props === null || props === void 0 || (_props$listener = props.listener) === null || _props$listener === void 0 || (_props$listener = _props$listener.Widgets) === null || _props$listener === void 0 ? void 0 : _props$listener[name];
|
|
53
53
|
(0, _widgetInstanceUtils.setWidgetIndexWithContext)(widgetInstance, [item], item);
|
|
54
54
|
if (isActive && tabsContainerName) {
|
|
@@ -72,22 +72,39 @@ var WmTabpane = exports.WmTabpane = function WmTabpane(props) {
|
|
|
72
72
|
props === null || props === void 0 || (_props$onDeselect = props.onDeselect) === null || _props$onDeselect === void 0 || _props$onDeselect.call(props, null, widgetInstance, index);
|
|
73
73
|
wasActiveRef.current = false;
|
|
74
74
|
}
|
|
75
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
75
|
}, [selectedIndex, name]);
|
|
77
76
|
var isHidden = (0, _react.useMemo)(function () {
|
|
78
77
|
return item === undefined ? false : (item === null || item === void 0 ? void 0 : item.show) === false;
|
|
79
78
|
}, [item]);
|
|
79
|
+
var headerProps = (0, _react.useMemo)(function () {
|
|
80
|
+
return {
|
|
81
|
+
name: name,
|
|
82
|
+
title: props.title,
|
|
83
|
+
disabled: disabled,
|
|
84
|
+
show: props.show,
|
|
85
|
+
paneicon: props.paneicon,
|
|
86
|
+
badgevalue: props.badgevalue,
|
|
87
|
+
badgetype: props.badgetype,
|
|
88
|
+
className: className,
|
|
89
|
+
onHeaderclick: onHeaderclick,
|
|
90
|
+
onHeaderClick: props.onHeaderClick
|
|
91
|
+
};
|
|
92
|
+
}, [name, props.title, disabled, props.show, props.paneicon, props.badgevalue, props.badgetype, className, onHeaderclick, props.onHeaderClick]);
|
|
93
|
+
(0, _react.useEffect)(function () {
|
|
94
|
+
if (!hasReportedHeaderRef.current) {
|
|
95
|
+
hasReportedHeaderRef.current = true;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
updatePaneHeader(name, headerProps);
|
|
99
|
+
}, [name, headerProps, updatePaneHeader]);
|
|
80
100
|
return __jsx(_tabs.Tabs.Panel, {
|
|
81
101
|
value: index,
|
|
82
102
|
keepMounted: true,
|
|
83
|
-
className: (0, _clsx2["default"])("tab-pane", layoutClassName, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({
|
|
103
|
+
className: (0, _clsx2["default"])("tab-pane", "wm-tab-pane-root", layoutClassName, (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({
|
|
84
104
|
disabled: disabled
|
|
85
|
-
}, className, !!className), "active", selectedIndex === index), "hidden", isHidden)),
|
|
105
|
+
}, className, !!className), "active", selectedIndex === index), "hidden", isHidden), "wm-tab-pane-active", selectedIndex === index), "wm-tab-pane-inactive", selectedIndex !== index)),
|
|
86
106
|
role: "tabpanel",
|
|
87
|
-
style:
|
|
88
|
-
width: "100%",
|
|
89
|
-
display: selectedIndex === index ? "block" : "none"
|
|
90
|
-
}, props === null || props === void 0 ? void 0 : props.styles),
|
|
107
|
+
style: props === null || props === void 0 ? void 0 : props.styles,
|
|
91
108
|
"data-pane-name": name,
|
|
92
109
|
title: props === null || props === void 0 ? void 0 : props.title,
|
|
93
110
|
name: name
|
|
@@ -53,6 +53,7 @@ declare const WmWizardStandalone: React.ComponentType<{
|
|
|
53
53
|
eventCallback?: (eventName: string, data: any) => void;
|
|
54
54
|
forwardedRef?: React.ForwardedRef<any>;
|
|
55
55
|
viewParent?: any;
|
|
56
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
56
57
|
hint?: string;
|
|
57
58
|
arialabel?: string;
|
|
58
59
|
tabindex?: number;
|
|
@@ -139,6 +140,7 @@ declare const _default: React.ComponentType<{
|
|
|
139
140
|
eventCallback?: (eventName: string, data: any) => void;
|
|
140
141
|
forwardedRef?: React.ForwardedRef<any>;
|
|
141
142
|
viewParent?: any;
|
|
143
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
142
144
|
hint?: string;
|
|
143
145
|
arialabel?: string;
|
|
144
146
|
tabindex?: number;
|
|
@@ -36,6 +36,7 @@ declare const _default: import("react").ComponentType<{
|
|
|
36
36
|
eventCallback?: (eventName: string, data: any) => void;
|
|
37
37
|
forwardedRef?: React.ForwardedRef<any>;
|
|
38
38
|
viewParent?: any;
|
|
39
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
39
40
|
hint?: string;
|
|
40
41
|
arialabel?: string;
|
|
41
42
|
tabindex?: number;
|
|
@@ -62,13 +62,13 @@ var WmWizardstep = exports.WmWizardstep = /*#__PURE__*/(0, _react.memo)(function
|
|
|
62
62
|
enablePrev: !disableprevious,
|
|
63
63
|
enableDone: !disabledone,
|
|
64
64
|
isDone: false,
|
|
65
|
-
render: function
|
|
65
|
+
render: render ? function () {
|
|
66
66
|
var _renderRef$current;
|
|
67
67
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
68
68
|
args[_key] = arguments[_key];
|
|
69
69
|
}
|
|
70
70
|
return (_renderRef$current = renderRef.current) === null || _renderRef$current === void 0 ? void 0 : _renderRef$current.call.apply(_renderRef$current, [renderRef].concat(args));
|
|
71
|
-
},
|
|
71
|
+
} : undefined,
|
|
72
72
|
done: false,
|
|
73
73
|
active: false,
|
|
74
74
|
disabled: false,
|
|
@@ -40,6 +40,7 @@ declare const _default: React.ComponentType<{
|
|
|
40
40
|
eventCallback?: (eventName: string, data: any) => void;
|
|
41
41
|
forwardedRef?: React.ForwardedRef<any>;
|
|
42
42
|
viewParent?: any;
|
|
43
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
43
44
|
hint?: string;
|
|
44
45
|
arialabel?: string;
|
|
45
46
|
tabindex?: number;
|
|
@@ -5,20 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = exports.WmCardActions = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _withBaseWrapper = _interopRequireDefault(require("@wavemaker-ai/react-runtime/higherOrder/withBaseWrapper"));
|
|
11
11
|
var _material = require("@mui/material");
|
|
12
12
|
var __jsx = _react["default"].createElement;
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
13
|
var WmCardActions = exports.WmCardActions = function WmCardActions(props) {
|
|
16
14
|
var children = props.children,
|
|
17
15
|
className = props.className,
|
|
18
16
|
styles = props.styles;
|
|
19
17
|
return __jsx(_material.CardActions, {
|
|
20
|
-
className: "app-card-actions
|
|
21
|
-
style:
|
|
18
|
+
className: (0, _clsx["default"])("app-card-actions", className),
|
|
19
|
+
style: styles
|
|
22
20
|
}, children);
|
|
23
21
|
};
|
|
24
22
|
|
|
@@ -40,6 +40,7 @@ declare const _default: React.ComponentType<{
|
|
|
40
40
|
eventCallback?: (eventName: string, data: any) => void;
|
|
41
41
|
forwardedRef?: React.ForwardedRef<any>;
|
|
42
42
|
viewParent?: any;
|
|
43
|
+
destroy?: ((names: string[]) => void) | ((formName?: string) => void);
|
|
43
44
|
hint?: string;
|
|
44
45
|
arialabel?: string;
|
|
45
46
|
tabindex?: number;
|