@wavemaker-ai/react-runtime 1.0.0-rc.309 → 1.0.0-rc.647469
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/navigation-action.js +5 -23
- package/components/advanced/carousel/index.d.ts +0 -1
- package/components/advanced/carousel/index.js +1 -2
- package/components/advanced/carousel/template.d.ts +0 -1
- package/components/advanced/carousel/template.js +1 -2
- package/components/advanced/login/index.d.ts +0 -1
- package/components/advanced/marquee/index.d.ts +0 -1
- package/components/advanced/marquee/index.js +1 -2
- package/components/basic/anchor/index.d.ts +0 -1
- package/components/basic/anchor/index.js +3 -4
- package/components/basic/audio/index.d.ts +0 -1
- package/components/basic/audio/index.js +2 -3
- package/components/basic/html/index.d.ts +0 -1
- package/components/basic/icon/index.d.ts +0 -1
- package/components/basic/icon/index.js +7 -4
- package/components/basic/iframe/iframe.utils.d.ts +1 -1
- package/components/basic/iframe/iframe.utils.js +4 -8
- package/components/basic/iframe/index.d.ts +0 -1
- package/components/basic/label/index.d.ts +0 -1
- package/components/basic/label/index.js +2 -3
- package/components/basic/message/index.js +1 -1
- package/components/basic/picture/index.d.ts +0 -1
- package/components/basic/picture/index.js +4 -3
- package/components/basic/progress-bar/index.d.ts +0 -1
- package/components/basic/progress-bar/index.js +1 -2
- package/components/basic/progress-circle/index.d.ts +0 -1
- package/components/basic/richtexteditor/index.d.ts +0 -2
- package/components/basic/search/index.d.ts +0 -3
- package/components/basic/search/index.js +4 -7
- package/components/basic/search/props.d.ts +0 -2
- package/components/basic/spinner/index.d.ts +0 -1
- package/components/basic/tile/index.d.ts +0 -1
- package/components/basic/tile/index.js +1 -2
- package/components/basic/tree/Components/TreeNodeComponent.js +5 -9
- package/components/basic/tree/index.d.ts +0 -1
- package/components/basic/tree/index.js +3 -14
- package/components/basic/tree/utils.d.ts +0 -2
- package/components/basic/tree/utils.js +1 -11
- package/components/basic/video/index.d.ts +0 -1
- package/components/basic/video/index.js +23 -40
- package/components/chart/index.d.ts +0 -1
- package/components/common/AppSpinner.js +5 -2
- package/components/container/accordion/accordion-pane/index.d.ts +0 -1
- package/components/container/accordion/accordion-pane/index.js +4 -1
- package/components/container/accordion/index.d.ts +0 -1
- package/components/container/index.d.ts +0 -3
- package/components/container/index.js +1 -6
- package/components/container/layout-grid/grid-column/index.d.ts +0 -1
- package/components/container/layout-grid/grid-row/index.d.ts +0 -1
- package/components/container/layout-grid/index.d.ts +0 -1
- package/components/container/layout-grid/index.js +8 -4
- package/components/container/linear-layout/index.d.ts +0 -1
- package/components/container/linear-layout/linear-layout-item/index.d.ts +0 -1
- package/components/container/panel/components/panel-header/index.js +6 -11
- package/components/container/panel/components/panel-header/props.d.ts +0 -5
- package/components/container/panel/index.d.ts +0 -1
- package/components/container/panel/index.js +1 -2
- package/components/container/props.d.ts +0 -2
- package/components/container/repeat-template/index.d.ts +1 -22
- package/components/container/repeat-template/index.js +1 -2
- package/components/container/tabs/index.d.ts +1 -3
- package/components/container/tabs/index.js +51 -102
- package/components/container/tabs/props.d.ts +0 -12
- package/components/container/tabs/tab-pane/index.d.ts +0 -1
- package/components/container/tabs/tab-pane/index.js +11 -28
- package/components/container/wizard/index.d.ts +0 -2
- package/components/container/wizard/wizard-step/index.d.ts +0 -1
- package/components/container/wizard/wizard-step/index.js +2 -2
- package/components/data/card/card-actions/index.d.ts +0 -1
- package/components/data/card/card-actions/index.js +5 -3
- package/components/data/card/card-content/index.d.ts +0 -1
- package/components/data/card/card-content/index.js +13 -3
- package/components/data/card/card-footer/index.d.ts +0 -1
- package/components/data/card/card-footer/index.js +5 -3
- package/components/data/card/index.d.ts +0 -1
- package/components/data/card/index.js +14 -3
- package/components/data/form/dynamic-fields/index.js +1 -7
- package/components/data/form/dynamic-fields/props.d.ts +0 -1
- package/components/data/form/form-action/index.d.ts +0 -2
- package/components/data/form/form-body/index.js +1 -2
- package/components/data/form/form-field/base-field.js +3 -4
- package/components/data/form/form-footer/index.js +1 -2
- package/components/data/list/components/ListItemWithTemplate.js +2 -4
- 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 +0 -2
- package/components/data/list/index.js +4 -3
- package/components/data/list/props.d.ts +1 -2
- package/components/data/list/utils/list-widget-methods.d.ts +1 -2
- package/components/data/table/components/RowCells.d.ts +2 -16
- package/components/data/table/components/RowCells.js +24 -38
- package/components/data/table/components/TableBody.js +3 -11
- package/components/data/table/components/TableDataRow.d.ts +0 -3
- package/components/data/table/components/TableDataRow.js +3 -11
- package/components/data/table/components/TableHeader.js +4 -1
- package/components/data/table/hooks/index.d.ts +0 -1
- package/components/data/table/hooks/index.js +0 -12
- package/components/data/table/hooks/useDynamicColumns.js +1 -1
- package/components/data/table/hooks/useResponsiveColumns.d.ts +0 -1
- package/components/data/table/hooks/useRowSelection.d.ts +1 -1
- package/components/data/table/hooks/useRowSelection.js +5 -26
- package/components/data/table/hooks/useTableInitialization.js +1 -2
- package/components/data/table/index.d.ts +0 -4
- package/components/data/table/index.js +12 -77
- package/components/data/table/live-table/index.d.ts +0 -1
- package/components/data/table/props.d.ts +0 -7
- package/components/data/table/table-action/index.d.ts +0 -1
- package/components/data/table/table-column/index.d.ts +0 -1
- package/components/data/table/table-row/index.d.ts +0 -1
- package/components/data/table/table-row-action/index.d.ts +0 -1
- package/components/data/table/utils/buildSelectionColumns.js +1 -7
- 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 +0 -2
- package/components/dialogs/confirm-dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.d.ts +0 -2
- package/components/dialogs/dialog/index.js +4 -2
- package/components/dialogs/dialog-actions/index.d.ts +0 -1
- package/components/dialogs/dialog-body/index.d.ts +0 -1
- package/components/dialogs/dialog-content/index.d.ts +0 -1
- package/components/dialogs/dialog-header/index.d.ts +0 -1
- package/components/dialogs/iframe-dialog/index.d.ts +0 -2
- package/components/dialogs/login-dialog/index.d.ts +0 -2
- package/components/dialogs/page-dialog/index.d.ts +0 -2
- package/components/form/button/index.d.ts +0 -1
- package/components/form/button/index.js +3 -4
- package/components/form/button-group/index.d.ts +0 -1
- package/components/form/button-group/index.js +1 -2
- package/components/input/calendar/index.d.ts +0 -2
- package/components/input/chips/index.d.ts +0 -2
- package/components/input/color-picker/index.d.ts +0 -2
- package/components/input/composite/index.d.ts +0 -1
- package/components/input/currency/index.d.ts +0 -2
- package/components/input/default/checkbox/index.d.ts +0 -2
- package/components/input/default/checkboxset/index.d.ts +0 -2
- package/components/input/default/radioset/index.d.ts +0 -2
- package/components/input/default/switch/index.d.ts +0 -2
- package/components/input/epoch/date/components/DatePickerPopover.js +29 -11
- package/components/input/epoch/date/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.d.ts +0 -1
- package/components/input/epoch/datetime/index.js +25 -10
- package/components/input/epoch/datetime/styled.d.ts +78 -0
- package/components/input/epoch/datetime/styled.js +90 -0
- package/components/input/epoch/time/index.d.ts +0 -1
- package/components/input/epoch/time/index.js +1 -1
- package/components/input/epoch/time/utils.d.ts +17 -0
- package/components/input/epoch/time/utils.js +18 -1
- package/components/input/fileupload/index.d.ts +0 -1
- package/components/input/number/index.d.ts +0 -2
- package/components/input/rating/index.d.ts +0 -2
- package/components/input/rating/index.js +17 -14
- package/components/input/select/index.d.ts +0 -2
- package/components/input/select/index.js +4 -1
- package/components/input/slider/index.d.ts +0 -2
- package/components/input/slider/index.js +12 -13
- package/components/input/text/index.d.ts +0 -2
- package/components/input/text/index.js +14 -3
- package/components/input/textarea/index.d.ts +0 -2
- package/components/input/textarea/index.js +10 -7
- package/components/input/upload/index.d.ts +0 -2
- package/components/input/upload/index.js +5 -3
- package/components/layout/footer/index.js +1 -2
- package/components/layout/footer/props.d.ts +0 -1
- package/components/layout/header/index.js +1 -2
- package/components/layout/header/props.d.ts +0 -1
- package/components/layout/leftnav/index.js +1 -2
- package/components/layout/leftnav/props.d.ts +0 -1
- package/components/layout/rightnav/index.js +1 -2
- package/components/layout/rightnav/props.d.ts +0 -1
- package/components/layout/topnav/index.js +1 -2
- package/components/layout/topnav/props.d.ts +0 -1
- package/components/navbar/index.d.ts +0 -1
- package/components/navbar/index.js +1 -2
- package/components/navbar/nav/index.d.ts +0 -1
- package/components/navbar/nav-item/index.d.ts +0 -1
- package/components/navbar/nav-item/index.js +1 -2
- package/components/navigation/breadcrumb/index.d.ts +0 -1
- package/components/navigation/menu/index.d.ts +0 -1
- package/components/navigation/menu/index.js +4 -5
- package/components/navigation/popover/index.d.ts +1 -2
- package/components/navigation/popover/index.js +1 -1
- package/components/page/error-boundary/index.js +5 -5
- package/components/page/index.js +9 -13
- package/components/page/partial/index.d.ts +0 -1
- package/components/prefab/container/index.js +1 -2
- package/context/WidgetProvider.js +2 -2
- package/core/app.service.js +35 -40
- package/core/constants/events.js +0 -6
- package/core/constants/index.d.ts +1 -9
- package/core/constants/index.js +5 -32
- package/core/formatter/date-formatters.d.ts +1 -1
- package/core/formatter/date-formatters.js +13 -38
- package/core/formatter/types.d.ts +1 -1
- package/core/proxy-service.js +5 -15
- package/core/util/index.js +2 -3
- package/higherOrder/BaseApp.js +2 -2
- package/higherOrder/BasePage.d.ts +17 -0
- package/higherOrder/BasePage.js +104 -53
- package/higherOrder/BasePrefab.js +59 -69
- package/higherOrder/props.d.ts +0 -1
- package/higherOrder/withBaseWrapper.js +4 -3
- package/hooks/useAccess.js +0 -13
- package/mui-config/theme.js +4 -1
- package/package-lock.json +605 -2630
- package/package.json +4 -23
- package/store/middleware/navigationMiddleware.js +1 -1
- package/store/slices/appConfigSlice.js +8 -10
- package/store/slices/authSlice.js +32 -46
- package/tsconfig.declaration.tsbuildinfo +1 -1
- package/types/index.d.ts +0 -1
- package/utils/attr.js +14 -71
- package/utils/lib-error-skipper.d.ts +26 -4
- package/utils/lib-error-skipper.js +165 -41
- package/utils/style-utils.d.ts +0 -6
- package/utils/style-utils.js +1 -10
- package/variables/metadata.service.js +3 -2
- package/variables/model-variable.js +7 -10
- package/variables/service-variable.d.ts +0 -1
- package/variables/service-variable.js +6 -26
- package/actions/base-action.d.ts +0 -7
- package/actions/login-action.d.ts +0 -11
- package/actions/logout-action.d.ts +0 -10
- package/actions/navigation-action.d.ts +0 -35
- package/actions/notification-action.d.ts +0 -20
- package/actions/timer-action.d.ts +0 -27
- package/components/data/table/hooks/useCustomExpressionColumns.d.ts +0 -16
- package/components/data/table/hooks/useCustomExpressionColumns.js +0 -88
- package/core/security.service.d.ts +0 -12
- package/mui-config/theme-provider.d.ts +0 -3
- package/mui-config/theme.d.ts +0 -2
- package/runtime-dynamic/App.d.ts +0 -7
- package/runtime-dynamic/App.js +0 -144
- package/runtime-dynamic/app-initializer.d.ts +0 -15
- package/runtime-dynamic/app-initializer.js +0 -447
- package/runtime-dynamic/components/ErrorBoundary.d.ts +0 -18
- package/runtime-dynamic/components/ErrorBoundary.js +0 -93
- package/runtime-dynamic/components/PageWrapper.d.ts +0 -1
- package/runtime-dynamic/components/PageWrapper.js +0 -43
- package/runtime-dynamic/components/PrefabPreview.d.ts +0 -1
- package/runtime-dynamic/components/PrefabPreview.js +0 -84
- package/runtime-dynamic/components/partial-content.d.ts +0 -15
- package/runtime-dynamic/components/partial-content.js +0 -50
- package/runtime-dynamic/components/prefab-content.d.ts +0 -10
- package/runtime-dynamic/components/prefab-content.js +0 -31
- package/runtime-dynamic/components/use-dynamic-component.d.ts +0 -10
- package/runtime-dynamic/components/use-dynamic-component.js +0 -165
- package/runtime-dynamic/factories/build-base-page-like-component.d.ts +0 -8
- package/runtime-dynamic/factories/build-base-page-like-component.js +0 -59
- package/runtime-dynamic/factories/prefab-factory.d.ts +0 -3
- package/runtime-dynamic/factories/prefab-factory.js +0 -82
- package/runtime-dynamic/factories/startup-info.d.ts +0 -6
- package/runtime-dynamic/factories/startup-info.js +0 -28
- package/runtime-dynamic/factories/utils.d.ts +0 -23
- package/runtime-dynamic/factories/utils.js +0 -131
- package/runtime-dynamic/index.d.ts +0 -14
- package/runtime-dynamic/index.js +0 -191
- package/runtime-dynamic/main.d.ts +0 -2
- package/runtime-dynamic/main.js +0 -84
- package/runtime-dynamic/preview-mode.d.ts +0 -15
- package/runtime-dynamic/preview-mode.js +0 -31
- package/runtime-dynamic/preview-navigation.d.ts +0 -6
- package/runtime-dynamic/preview-navigation.js +0 -38
- package/runtime-dynamic/preview-resource-base.d.ts +0 -12
- package/runtime-dynamic/preview-resource-base.js +0 -65
- package/runtime-dynamic/registry/component-registry.d.ts +0 -3
- package/runtime-dynamic/registry/component-registry.js +0 -353
- package/runtime-dynamic/registry/custom-widget-registry.d.ts +0 -7
- package/runtime-dynamic/registry/custom-widget-registry.js +0 -18
- package/runtime-dynamic/registry/index.d.ts +0 -2
- package/runtime-dynamic/registry/index.js +0 -63
- package/runtime-dynamic/registry/store.d.ts +0 -9
- package/runtime-dynamic/registry/store.js +0 -26
- package/runtime-dynamic/routes.d.ts +0 -2
- package/runtime-dynamic/routes.js +0 -107
- package/runtime-dynamic/services/app-extension-provider.d.ts +0 -1
- package/runtime-dynamic/services/app-extension-provider.js +0 -45
- package/runtime-dynamic/services/cache.d.ts +0 -29
- package/runtime-dynamic/services/cache.js +0 -57
- package/runtime-dynamic/services/component-ref-provider.d.ts +0 -12
- package/runtime-dynamic/services/component-ref-provider.js +0 -149
- package/runtime-dynamic/services/css-scoping.d.ts +0 -2
- package/runtime-dynamic/services/css-scoping.js +0 -53
- package/runtime-dynamic/services/fragment-url.d.ts +0 -16
- package/runtime-dynamic/services/fragment-url.js +0 -74
- package/runtime-dynamic/services/index.d.ts +0 -10
- package/runtime-dynamic/services/index.js +0 -152
- package/runtime-dynamic/services/markup-transpiler.d.ts +0 -12
- package/runtime-dynamic/services/markup-transpiler.js +0 -250
- package/runtime-dynamic/services/prefab-resources.d.ts +0 -18
- package/runtime-dynamic/services/prefab-resources.js +0 -159
- package/runtime-dynamic/services/resource-manager.d.ts +0 -2
- package/runtime-dynamic/services/resource-manager.js +0 -66
- package/runtime-dynamic/services/script-executor.d.ts +0 -8
- package/runtime-dynamic/services/script-executor.js +0 -90
- package/runtime-dynamic/services/variable-factory.d.ts +0 -2
- package/runtime-dynamic/services/variable-factory.js +0 -260
- package/runtime-dynamic/services/variable-registry.d.ts +0 -12
- package/runtime-dynamic/services/variable-registry.js +0 -118
- package/runtime-dynamic/services/variable-transpiler.d.ts +0 -5
- package/runtime-dynamic/services/variable-transpiler.js +0 -159
- package/runtime-dynamic/shims/next-image.d.ts +0 -35
- package/runtime-dynamic/shims/next-image.js +0 -60
- package/runtime-dynamic/shims/next-link.d.ts +0 -25
- package/runtime-dynamic/shims/next-link.js +0 -33
- package/runtime-dynamic/shims/next-navigation.d.ts +0 -16
- package/runtime-dynamic/shims/next-navigation.js +0 -52
- package/runtime-dynamic/utils/index.d.ts +0 -9
- package/runtime-dynamic/utils/index.js +0 -40
- package/utils/custom-expression/index.d.ts +0 -43
- package/utils/custom-expression/index.js +0 -161
- package/utils/custom-expression/parser.d.ts +0 -15
- package/utils/custom-expression/parser.js +0 -208
- package/utils/layoutsize-util.d.ts +0 -1
- package/utils/layoutsize-util.js +0 -57
package/types/index.d.ts
CHANGED
package/utils/attr.js
CHANGED
|
@@ -6,87 +6,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.removeInvalidAttributes = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
-
var INTERNAL_ATTRIBUTES = new Set(["clearSearch", "conditionalclass", "conditionalstyle", "dataset", "destroy", "eventCallback", "formfield", "forwardedRef", "inbound", "iswidget", "listener", "onHeaderclick", "onHeaderClick", "onLoad", "onDestroy", "onNavHeightChange", "onRender", "outbound", "prefab", "ref", "showindevice", "styles", "viewParent"]);
|
|
10
|
-
var SAFE_ATTRIBUTES = new Set(["accessKey", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "capture", "cellPadding", "cellSpacing", "charSet", "className", "cols", "colSpan", "content", "contentEditable", "controls", "coords", "crossOrigin", "dateTime", "default", "defaultChecked", "defaultValue", "dir", "disabled", "download", "draggable", "encType", "form", "height", "hidden", "hint", "href", "hrefLang", "htmlFor", "id", "inputMode", "label", "lang", "list", "max", "maxLength", "media", "method", "min", "minLength", "multiple", "name", "noValidate", "pattern", "placeholder", "readOnly", "rel", "required", "role", "rows", "rowSpan", "selected", "slot", "spellCheck", "src", "step", "style", "tabIndex", "target", "title", "translate", "type", "value", "width"]);
|
|
11
|
-
var VALID_DOM_EVENT_HANDLERS = new Set(["onAbort", "onAnimationEnd", "onAnimationIteration", "onAnimationStart", "onAuxClick", "onBeforeInput", "onBlur", "onCanPlay", "onCanPlayThrough", "onChange", "onClick", "onCompositionEnd", "onCompositionStart", "onCompositionUpdate", "onContextMenu", "onCopy", "onCut", "onDoubleClick", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop", "onDurationChange", "onEmptied", "onEncrypted", "onEnded", "onError", "onFocus", "onGotPointerCapture", "onInput", "onInvalid", "onKeyDown", "onKeyPress", "onKeyUp", "onLoad", "onLoadedData", "onLoadedMetadata", "onLoadStart", "onLostPointerCapture", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onPaste", "onPause", "onPlay", "onPlaying", "onPointerCancel", "onPointerDown", "onPointerEnter", "onPointerLeave", "onPointerMove", "onPointerOut", "onPointerOver", "onPointerUp", "onProgress", "onRateChange", "onReset", "onScroll", "onSeeked", "onSeeking", "onSelect", "onStalled", "onSubmit", "onSuspend", "onTimeUpdate", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onTransitionEnd", "onVolumeChange", "onWaiting", "onWheel"]);
|
|
12
|
-
|
|
13
|
-
// Maps lowercase HTML attribute names to their React camelCase equivalents.
|
|
14
|
-
// Lowercase attributes that appear here are normalized on the way out; those
|
|
15
|
-
// NOT in this map but still all-lowercase are passed through as-is (custom /
|
|
16
|
-
// data-like attributes handled elsewhere).
|
|
17
|
-
var LOWERCASE_TO_REACT_ATTR = {
|
|
18
|
-
autocomplete: "autoComplete",
|
|
19
|
-
autocapitalize: "autoCapitalize",
|
|
20
|
-
autocorrect: "autoCorrect",
|
|
21
|
-
autofocus: "autoFocus",
|
|
22
|
-
accesskey: "accessKey",
|
|
23
|
-
classname: "className",
|
|
24
|
-
colspan: "colSpan",
|
|
25
|
-
contenteditable: "contentEditable",
|
|
26
|
-
crossorigin: "crossOrigin",
|
|
27
|
-
datetime: "dateTime",
|
|
28
|
-
defaultchecked: "defaultChecked",
|
|
29
|
-
defaultvalue: "defaultValue",
|
|
30
|
-
enctype: "encType",
|
|
31
|
-
hreflang: "hrefLang",
|
|
32
|
-
htmlfor: "htmlFor",
|
|
33
|
-
inputmode: "inputMode",
|
|
34
|
-
maxlength: "maxLength",
|
|
35
|
-
minlength: "minLength",
|
|
36
|
-
novalidate: "noValidate",
|
|
37
|
-
readonly: "readOnly",
|
|
38
|
-
rowspan: "rowSpan",
|
|
39
|
-
spellcheck: "spellCheck",
|
|
40
|
-
tabindex: "tabIndex"
|
|
41
|
-
};
|
|
42
|
-
var isLowercaseAttribute = function isLowercaseAttribute(key) {
|
|
43
|
-
return key === key.toLowerCase();
|
|
44
|
-
};
|
|
45
|
-
var isSafeAttributeName = function isSafeAttributeName(key) {
|
|
46
|
-
return SAFE_ATTRIBUTES.has(key) || key.startsWith("aria-") || key.startsWith("data-") || isLowercaseAttribute(key) || VALID_DOM_EVENT_HANDLERS.has(key);
|
|
47
|
-
};
|
|
48
|
-
var isObjectLikeString = function isObjectLikeString(value) {
|
|
49
|
-
var trimmed = value.trim();
|
|
50
|
-
if (/^\[object\s*,?\s*object\]$/i.test(trimmed)) {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
54
|
-
try {
|
|
55
|
-
var parsed = JSON.parse(trimmed);
|
|
56
|
-
return (0, _typeof2["default"])(parsed) === "object" && parsed !== null;
|
|
57
|
-
} catch (e) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
};
|
|
63
|
-
var shouldStringifyBooleanAttribute = function shouldStringifyBooleanAttribute(key, value) {
|
|
64
|
-
return typeof value === "boolean" && isLowercaseAttribute(key) && !SAFE_ATTRIBUTES.has(key) && !key.startsWith("aria-") && !key.startsWith("data-");
|
|
65
|
-
};
|
|
66
9
|
var removeInvalidAttributes = exports.removeInvalidAttributes = function removeInvalidAttributes(attributes, explicitRemoveAttributes) {
|
|
67
10
|
var filteredAttributes = {};
|
|
68
11
|
Object.keys(attributes).forEach(function (key) {
|
|
69
|
-
|
|
70
|
-
if (explicitRemoveAttributes !== null && explicitRemoveAttributes !== void 0 && explicitRemoveAttributes.includes(key) || INTERNAL_ATTRIBUTES.has(key) || !isSafeAttributeName(key)) {
|
|
12
|
+
if (explicitRemoveAttributes !== null && explicitRemoveAttributes !== void 0 && explicitRemoveAttributes.includes(key)) {
|
|
71
13
|
return;
|
|
72
14
|
}
|
|
73
15
|
var value = attributes[key];
|
|
74
16
|
if (Array.isArray(value) || (0, _typeof2["default"])(value) === "object" && value !== null) {
|
|
75
17
|
return;
|
|
76
18
|
}
|
|
77
|
-
if (typeof value === "
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
19
|
+
if (typeof value === "string") {
|
|
20
|
+
var trimmed = value.trim();
|
|
21
|
+
if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
22
|
+
try {
|
|
23
|
+
var parsed = JSON.parse(value);
|
|
24
|
+
if ((0, _typeof2["default"])(parsed) === "object" && parsed !== null) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
// invalid json, ignore
|
|
29
|
+
}
|
|
30
|
+
}
|
|
85
31
|
}
|
|
86
|
-
|
|
87
|
-
// to prevent "Invalid DOM property" warnings (e.g. autocomplete → autoComplete).
|
|
88
|
-
var normalizedKey = (_LOWERCASE_TO_REACT_A = LOWERCASE_TO_REACT_ATTR[key]) !== null && _LOWERCASE_TO_REACT_A !== void 0 ? _LOWERCASE_TO_REACT_A : key;
|
|
89
|
-
filteredAttributes[normalizedKey] = shouldStringifyBooleanAttribute(normalizedKey, value) ? value.toString() : value;
|
|
32
|
+
filteredAttributes[key] = value;
|
|
90
33
|
});
|
|
91
34
|
return filteredAttributes;
|
|
92
35
|
};
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
2
|
+
* Utility to wrap all methods in a script object with jQuery error handling
|
|
3
|
+
* This prevents jQuery usage from breaking the React application
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for unsupported libraries
|
|
7
|
+
*/
|
|
8
|
+
interface LibraryConfig {
|
|
9
|
+
identifiers: string[];
|
|
10
|
+
errorMessage: string;
|
|
11
|
+
notificationMessage: string;
|
|
12
|
+
}
|
|
13
|
+
interface UnsupportedLibraries {
|
|
14
|
+
[key: string]: LibraryConfig;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Checks if an error is related to jQuery usage
|
|
18
|
+
* @param error - The error object to check
|
|
19
|
+
* @returns true if the error is jQuery-related
|
|
5
20
|
*/
|
|
6
21
|
export declare const isJQueryError: (error: any) => boolean;
|
|
7
22
|
interface AppContext {
|
|
8
23
|
notifyApp?: (message: string, type: string) => void;
|
|
9
24
|
}
|
|
10
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Wraps all methods with unsupported library error handling
|
|
27
|
+
* @param pageProxy - The page/prefab proxy object
|
|
28
|
+
* @param appContext - App context for notifications
|
|
29
|
+
* @param componentName - Name of component for logging
|
|
30
|
+
* @param libraryConfig - Optional: specific libraries to check (default: all)
|
|
31
|
+
*/
|
|
32
|
+
export declare const wrapWithThirdPartyErrorGuard: (pageProxy: Record<string, any>, appContext: AppContext | null | undefined, componentName: string, libraryConfig?: UnsupportedLibraries) => void;
|
|
11
33
|
export {};
|
|
@@ -6,70 +6,194 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.wrapWithThirdPartyErrorGuard = exports.isJQueryError = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
+
* Utility to wrap all methods in a script object with jQuery error handling
|
|
14
|
+
* This prevents jQuery usage from breaking the React application
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for unsupported libraries
|
|
13
19
|
*/
|
|
14
20
|
|
|
15
21
|
var UNSUPPORTED_LIBRARIES = {
|
|
16
22
|
jquery: {
|
|
23
|
+
// Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
|
|
17
24
|
identifiers: ["jQuery", "$(", "$."],
|
|
18
25
|
errorMessage: "jQuery is not supported in React App",
|
|
19
26
|
notificationMessage: "jQuery functionality is not supported. Check console for details."
|
|
20
27
|
}
|
|
28
|
+
// Add more libraries here in future
|
|
21
29
|
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Result of unsupported library detection
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Detects if an error is related to any unsupported library
|
|
37
|
+
* @param error - The error object to check
|
|
38
|
+
* @returns Object with isUnsupported flag and library info
|
|
39
|
+
*/
|
|
22
40
|
function detectUnsupportedLibrary(error) {
|
|
23
|
-
if (!
|
|
24
|
-
|
|
41
|
+
if (!error || !error.stack) {
|
|
42
|
+
return {
|
|
43
|
+
isUnsupported: false,
|
|
44
|
+
library: null
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
var errorMessage = error.message || "";
|
|
48
|
+
var stackTrace = String(error.stack);
|
|
49
|
+
|
|
50
|
+
// Check each configured library
|
|
25
51
|
for (var _i = 0, _Object$entries = Object.entries(UNSUPPORTED_LIBRARIES); _i < _Object$entries.length; _i++) {
|
|
26
52
|
var _Object$entries$_i = (0, _slicedToArray2["default"])(_Object$entries[_i], 2),
|
|
27
|
-
|
|
53
|
+
libraryName = _Object$entries$_i[0],
|
|
28
54
|
config = _Object$entries$_i[1];
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
var identifiers = config.identifiers;
|
|
56
|
+
|
|
57
|
+
// Check if error message contains library identifiers
|
|
58
|
+
if (identifiers.some(function (identifier) {
|
|
59
|
+
return errorMessage.includes(identifier);
|
|
31
60
|
})) {
|
|
32
61
|
return {
|
|
33
|
-
|
|
62
|
+
isUnsupported: true,
|
|
63
|
+
library: libraryName,
|
|
34
64
|
config: config
|
|
35
65
|
};
|
|
36
66
|
}
|
|
67
|
+
|
|
68
|
+
// Check if stack trace contains library identifiers
|
|
69
|
+
var stackLines = stackTrace.split("\n");
|
|
70
|
+
var _iterator = _createForOfIteratorHelper(stackLines),
|
|
71
|
+
_step;
|
|
72
|
+
try {
|
|
73
|
+
var _loop = function _loop() {
|
|
74
|
+
var line = _step.value;
|
|
75
|
+
if (identifiers.some(function (identifier) {
|
|
76
|
+
return line.includes(identifier);
|
|
77
|
+
})) {
|
|
78
|
+
return {
|
|
79
|
+
v: {
|
|
80
|
+
isUnsupported: true,
|
|
81
|
+
library: libraryName,
|
|
82
|
+
config: config
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
_ret;
|
|
88
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
89
|
+
_ret = _loop();
|
|
90
|
+
if (_ret) return _ret.v;
|
|
91
|
+
}
|
|
92
|
+
} catch (err) {
|
|
93
|
+
_iterator.e(err);
|
|
94
|
+
} finally {
|
|
95
|
+
_iterator.f();
|
|
96
|
+
}
|
|
37
97
|
}
|
|
38
|
-
return
|
|
98
|
+
return {
|
|
99
|
+
isUnsupported: false,
|
|
100
|
+
library: null
|
|
101
|
+
};
|
|
39
102
|
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Checks if an error is related to jQuery usage
|
|
106
|
+
* @param error - The error object to check
|
|
107
|
+
* @returns true if the error is jQuery-related
|
|
108
|
+
*/
|
|
40
109
|
var isJQueryError = exports.isJQueryError = function isJQueryError(error) {
|
|
41
|
-
|
|
42
|
-
|
|
110
|
+
if (!(error !== null && error !== void 0 && error.stack)) return false;
|
|
111
|
+
|
|
112
|
+
// Use specific jQuery patterns - avoid matching Wavemaker vars like $index, $data
|
|
113
|
+
var UnSupportedFunctionality = ["jQuery", "$(", "$."];
|
|
114
|
+
|
|
115
|
+
// Check if error message contains jQuery references
|
|
116
|
+
if (error.message && UnSupportedFunctionality.some(function (func) {
|
|
117
|
+
return error.message.includes(func);
|
|
118
|
+
})) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Check stack trace for jQuery references
|
|
123
|
+
var stackLines = error.stack.split("\n");
|
|
124
|
+
var _iterator2 = _createForOfIteratorHelper(stackLines),
|
|
125
|
+
_step2;
|
|
126
|
+
try {
|
|
127
|
+
var _loop2 = function _loop2() {
|
|
128
|
+
var line = _step2.value;
|
|
129
|
+
if (UnSupportedFunctionality.some(function (func) {
|
|
130
|
+
return line.includes(func);
|
|
131
|
+
})) {
|
|
132
|
+
return {
|
|
133
|
+
v: true
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
_ret2;
|
|
138
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
139
|
+
_ret2 = _loop2();
|
|
140
|
+
if (_ret2) return _ret2.v;
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_iterator2.e(err);
|
|
144
|
+
} finally {
|
|
145
|
+
_iterator2.f();
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
43
148
|
};
|
|
44
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Wraps all methods with unsupported library error handling
|
|
151
|
+
* @param pageProxy - The page/prefab proxy object
|
|
152
|
+
* @param appContext - App context for notifications
|
|
153
|
+
* @param componentName - Name of component for logging
|
|
154
|
+
* @param libraryConfig - Optional: specific libraries to check (default: all)
|
|
155
|
+
*/
|
|
45
156
|
var wrapWithThirdPartyErrorGuard = exports.wrapWithThirdPartyErrorGuard = function wrapWithThirdPartyErrorGuard(pageProxy, appContext, componentName) {
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
args
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
157
|
+
var libraryConfig = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : UNSUPPORTED_LIBRARIES;
|
|
158
|
+
var skipProperties = ["Variables", "Actions", "Widgets", "App", "pageParams", "serviceDefinitions", "baseUrl", "appConfig", "notification", "toaster", "onContentReady", "onChange", "cleanup", "eval", "appLocale", "executeStartup", "formatters", "type", "componentName", "componentType", "prefabname", "onPropertyChange"];
|
|
159
|
+
Object.keys(pageProxy).forEach(function (methodName) {
|
|
160
|
+
if (typeof pageProxy[methodName] === "function" && !skipProperties.includes(methodName)) {
|
|
161
|
+
var originalMethod = pageProxy[methodName];
|
|
162
|
+
pageProxy[methodName] = function () {
|
|
163
|
+
try {
|
|
164
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
165
|
+
args[_key] = arguments[_key];
|
|
166
|
+
}
|
|
167
|
+
return originalMethod.apply(this, args);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
// Detect which unsupported library caused the error
|
|
170
|
+
var detection = detectUnsupportedLibrary(error);
|
|
171
|
+
if (detection.isUnsupported && detection.library && detection.config) {
|
|
172
|
+
var library = detection.library;
|
|
173
|
+
var config = detection.config;
|
|
174
|
+
|
|
175
|
+
// Log detailed error
|
|
176
|
+
console.error("[".concat(library.toUpperCase(), " ERROR] in ").concat(componentName, ".").concat(methodName, "()"), "\n".concat(config.errorMessage), "\nError:", error);
|
|
177
|
+
|
|
178
|
+
// Show user notification
|
|
179
|
+
if (appContext !== null && appContext !== void 0 && appContext.notifyApp) {
|
|
180
|
+
appContext.notifyApp(config.notificationMessage, "Error");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Return undefined to prevent further errors
|
|
184
|
+
return undefined;
|
|
185
|
+
} else {
|
|
186
|
+
// Not an unsupported library error - log normally
|
|
187
|
+
console.log("Error in ".concat(componentName, ".").concat(methodName, "():"));
|
|
188
|
+
}
|
|
63
189
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (_loop()) continue;
|
|
74
|
-
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// Preserve function name for debugging
|
|
193
|
+
Object.defineProperty(pageProxy[methodName], "name", {
|
|
194
|
+
value: "wrapped_".concat(methodName),
|
|
195
|
+
writable: false
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
75
199
|
};
|
package/utils/style-utils.d.ts
CHANGED
|
@@ -20,9 +20,3 @@ export declare const mergeStyleObjects: (...styleObjects: any[]) => Record<strin
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const isValidStyleObject: (value: any) => boolean;
|
|
22
22
|
export declare const filterAutoLayoutClasses: (layoutClassName: string | undefined, prefixesToGet: string[], mode?: "include" | "exclude") => string;
|
|
23
|
-
/**
|
|
24
|
-
* Normalizes a React style length (width, height, margin, etc.): numbers become pixel
|
|
25
|
-
* values (`${n}px`), matching common React `style` behavior; strings pass through
|
|
26
|
-
* (e.g. `100%`, `2rem`, `10px`).
|
|
27
|
-
*/
|
|
28
|
-
export declare const toCssLength: (value: string | number) => string;
|
package/utils/style-utils.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.sanitizeStyleObject = exports.mergeStyleObjects = exports.isValidStyleObject = exports.filterAutoLayoutClasses = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -80,13 +80,4 @@ var filterAutoLayoutClasses = exports.filterAutoLayoutClasses = function filterA
|
|
|
80
80
|
});
|
|
81
81
|
return mode === "include" ? matches : !matches;
|
|
82
82
|
}).join(" ");
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Normalizes a React style length (width, height, margin, etc.): numbers become pixel
|
|
87
|
-
* values (`${n}px`), matching common React `style` behavior; strings pass through
|
|
88
|
-
* (e.g. `100%`, `2rem`, `10px`).
|
|
89
|
-
*/
|
|
90
|
-
var toCssLength = exports.toCssLength = function toCssLength(value) {
|
|
91
|
-
return typeof value === "number" ? "".concat(value, "px") : String(value);
|
|
92
83
|
};
|
|
@@ -33,7 +33,7 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
|
|
|
33
33
|
_ref,
|
|
34
34
|
_WM_APP_PROPERTIES,
|
|
35
35
|
_this = this;
|
|
36
|
-
var state, appConfig, baseUrl, isPreview, serviceDefSources, url, serviceDefFileName;
|
|
36
|
+
var state, appConfig, baseUrl, isPreview, serviceDefSources, url, serviceDefFileName, previewPath;
|
|
37
37
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
38
38
|
while (1) switch (_context.prev = _context.next) {
|
|
39
39
|
case 0:
|
|
@@ -44,7 +44,8 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
|
|
|
44
44
|
serviceDefSources = ((_WM_APP_PROPERTIES = window._WM_APP_PROPERTIES) === null || _WM_APP_PROPERTIES === void 0 ? void 0 : _WM_APP_PROPERTIES.serviceDefSources) || "DYNAMIC";
|
|
45
45
|
serviceDefFileName = prefabName ? "".concat(prefabName, "-prefab-servicedefs.json") : "app-servicedefs.json";
|
|
46
46
|
if (isPreview || serviceDefSources === "DYNAMIC") {
|
|
47
|
-
|
|
47
|
+
previewPath = prefabName ? "prefabs/".concat(prefabName) : "";
|
|
48
|
+
url = "".concat(baseUrl, "/services/").concat(previewPath, "/servicedefs");
|
|
48
49
|
} else {
|
|
49
50
|
url = "".concat(baseUrl, "/services/servicedefs/").concat(serviceDefFileName);
|
|
50
51
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ModelVariable = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -25,12 +24,13 @@ var ModelVariable = exports.ModelVariable = /*#__PURE__*/function (_ref) {
|
|
|
25
24
|
function ModelVariable(config) {
|
|
26
25
|
var _this;
|
|
27
26
|
(0, _classCallCheck2["default"])(this, ModelVariable);
|
|
28
|
-
|
|
27
|
+
// Initialize with empty dataset first
|
|
29
28
|
var variable = {
|
|
30
29
|
name: config.name,
|
|
31
|
-
dataSet:
|
|
30
|
+
dataSet: config.paramProvider() || {
|
|
32
31
|
dataValue: ""
|
|
33
32
|
},
|
|
33
|
+
// Default empty value
|
|
34
34
|
isList: config.isList,
|
|
35
35
|
twoWayBinding: config.twoWayBinding
|
|
36
36
|
};
|
|
@@ -49,15 +49,12 @@ var ModelVariable = exports.ModelVariable = /*#__PURE__*/function (_ref) {
|
|
|
49
49
|
value: function invoke(params, onSuccess, onError) {
|
|
50
50
|
var result;
|
|
51
51
|
try {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.dataSet = provided;
|
|
55
|
-
} else if (this.dataSet && provided) {
|
|
56
|
-
this.dataSet = Array.isArray(this.dataSet) ? provided : _objectSpread(_objectSpread({}, this.dataSet), provided);
|
|
52
|
+
if (this.dataSet && this.config.paramProvider()) {
|
|
53
|
+
this.dataSet = _objectSpread(_objectSpread({}, this.dataSet), this.config.paramProvider());
|
|
57
54
|
} else if (this.dataSet && Object.keys(this.dataSet).length !== 0) {
|
|
58
|
-
this.dataSet =
|
|
55
|
+
this.dataSet = _objectSpread({}, this.dataSet);
|
|
59
56
|
} else {
|
|
60
|
-
this.dataSet =
|
|
57
|
+
this.dataSet = this.config.paramProvider();
|
|
61
58
|
}
|
|
62
59
|
this.notify(_baseVariable.VariableEvents.BEFORE_INVOKE, [this, this.dataSet]);
|
|
63
60
|
result = _superPropGet(ModelVariable, "execute", this, 3)([params, function () {}]);
|
|
@@ -27,7 +27,6 @@ export declare class ServiceVariable extends ServiceVariable_base {
|
|
|
27
27
|
private dateFormatter;
|
|
28
28
|
private lastParams;
|
|
29
29
|
private lastParamProviderValues;
|
|
30
|
-
private dataBindingRequestBody;
|
|
31
30
|
constructor(config: ServiceVariableConfig);
|
|
32
31
|
private updateFirstAndLastRecord;
|
|
33
32
|
private setupEventHandlers;
|
|
@@ -61,7 +61,6 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
|
|
|
61
61
|
spinnerMessage: config.spinnerMessage,
|
|
62
62
|
spinnerContext: config.spinnerContext,
|
|
63
63
|
onSuccess: function onSuccess(context, args) {
|
|
64
|
-
_this.dataBindingRequestBody(args, _this.lastInvokedParams);
|
|
65
64
|
_this.notify(_baseVariable.VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);
|
|
66
65
|
_this.notify(_baseVariable.VariableEvents.SUCCESS, [args.variable, args.data, args.options]);
|
|
67
66
|
_this.updateFirstAndLastRecord(args.data);
|
|
@@ -114,22 +113,6 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
|
|
|
114
113
|
// Method to update firstRecord and lastRecord from the current dataset
|
|
115
114
|
(0, _inherits2["default"])(ServiceVariable, _ref);
|
|
116
115
|
return (0, _createClass2["default"])(ServiceVariable, [{
|
|
117
|
-
key: "dataBindingRequestBody",
|
|
118
|
-
value: function dataBindingRequestBody(args, invokedParams) {
|
|
119
|
-
var _invokedParams$Reques;
|
|
120
|
-
var v = args === null || args === void 0 ? void 0 : args.variable;
|
|
121
|
-
if (!v) return;
|
|
122
|
-
v.dataBinding = v.dataBinding || {};
|
|
123
|
-
|
|
124
|
-
// Keep both casings for compatibility with app scripts and Angular runtime expectations.
|
|
125
|
-
// Prefer existing values, otherwise fallback to the request payload used for invocation.
|
|
126
|
-
var existingBody = v.dataBinding.RequestBody;
|
|
127
|
-
var payload = (_invokedParams$Reques = invokedParams === null || invokedParams === void 0 ? void 0 : invokedParams.RequestBody) !== null && _invokedParams$Reques !== void 0 ? _invokedParams$Reques : invokedParams;
|
|
128
|
-
if (existingBody === undefined && payload !== undefined) {
|
|
129
|
-
v.dataBinding.RequestBody = payload;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}, {
|
|
133
116
|
key: "updateFirstAndLastRecord",
|
|
134
117
|
value: function updateFirstAndLastRecord(data) {
|
|
135
118
|
try {
|
|
@@ -281,17 +264,14 @@ var ServiceVariable = exports.ServiceVariable = /*#__PURE__*/function (_ref) {
|
|
|
281
264
|
}, {
|
|
282
265
|
key: "invoke",
|
|
283
266
|
value: function invoke(options, onSuccess, onError) {
|
|
284
|
-
|
|
285
|
-
|
|
267
|
+
this.params = (0, _lodashEs.merge)({}, this.config.paramProvider(), this.params);
|
|
268
|
+
this.params = (0, _util.deepCopy)({}, this.params, this.dataBinding);
|
|
286
269
|
if (options) {
|
|
287
|
-
|
|
288
|
-
var overrides = (_options$inputFields = options.inputFields) !== null && _options$inputFields !== void 0 ? _options$inputFields : options;
|
|
289
|
-
inputFields = (0, _lodashEs.merge)({}, inputFields, overrides);
|
|
290
|
-
} else {
|
|
291
|
-
options = {};
|
|
270
|
+
this.params = (0, _util.deepCopy)({}, this.params, options.inputFields ? options.inputFields : options);
|
|
292
271
|
}
|
|
293
|
-
options
|
|
294
|
-
|
|
272
|
+
options = options || {};
|
|
273
|
+
options.inputFields = this.params;
|
|
274
|
+
this.lastInvokedParams = this.params;
|
|
295
275
|
|
|
296
276
|
// Normalize orderBy option
|
|
297
277
|
if (!options.orderBy) {
|
package/actions/base-action.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseVariable, VariableConfig } from "@wavemaker-ai/react-runtime/variables/base-variable";
|
|
2
|
-
export interface ActionConfig extends VariableConfig {
|
|
3
|
-
}
|
|
4
|
-
export declare class BaseAction<T extends ActionConfig> extends BaseVariable<T> {
|
|
5
|
-
constructor(config: T);
|
|
6
|
-
setData(dataSet: any): void;
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionConfig, BaseAction } from "./base-action";
|
|
2
|
-
import { SecurityService } from "@wavemaker-ai/react-runtime/core/security.service";
|
|
3
|
-
export interface LoginActionConfig extends ActionConfig {
|
|
4
|
-
securityService: () => SecurityService;
|
|
5
|
-
baseURL: String;
|
|
6
|
-
useDefaultSuccessHandler: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class LoginAction extends BaseAction<LoginActionConfig> {
|
|
9
|
-
constructor(config: LoginActionConfig);
|
|
10
|
-
invoke(options: any, successcb?: Function, errorcb?: Function): any;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionConfig, BaseAction } from "./base-action";
|
|
2
|
-
import { SecurityService } from "@wavemaker-ai/react-runtime/core/security.service";
|
|
3
|
-
export interface LogoutActionConfig extends ActionConfig {
|
|
4
|
-
securityService: () => SecurityService;
|
|
5
|
-
baseURL: String;
|
|
6
|
-
}
|
|
7
|
-
export declare class LogoutAction extends BaseAction<LogoutActionConfig> {
|
|
8
|
-
constructor(config: LogoutActionConfig);
|
|
9
|
-
invoke(options: any, successcb?: Function, errorcb?: Function): any;
|
|
10
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ActionConfig, BaseAction } from "./base-action";
|
|
2
|
-
export declare const __resetNavigationPageParamHistoryForTests: () => void;
|
|
3
|
-
export declare const __getPageQueryParamHistorySizeForTests: () => number;
|
|
4
|
-
export interface NavigationParams {
|
|
5
|
-
pageName?: string;
|
|
6
|
-
tabName?: string;
|
|
7
|
-
accordionName?: string;
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export interface NavigationActionConfig extends ActionConfig {
|
|
11
|
-
appConfig: any;
|
|
12
|
-
operation: string;
|
|
13
|
-
_context: any;
|
|
14
|
-
}
|
|
15
|
-
export declare class NavigationAction extends BaseAction<NavigationActionConfig> {
|
|
16
|
-
constructor(config: NavigationActionConfig);
|
|
17
|
-
invoke(params?: Record<string, unknown>, onSuccess?: Function, onError?: Function): Promise<NavigationAction>;
|
|
18
|
-
navigate(params?: {}, onSuccess?: Function, onError?: Function): Promise<NavigationAction>;
|
|
19
|
-
private handleGoToPreviousPage;
|
|
20
|
-
private handleGotoTab;
|
|
21
|
-
private findTabWidget;
|
|
22
|
-
private handleGotoAccordion;
|
|
23
|
-
private getAppRelativePath;
|
|
24
|
-
private parseSearch;
|
|
25
|
-
private normalizePageName;
|
|
26
|
-
private getCurrentPageInfo;
|
|
27
|
-
private rememberPageQueryParams;
|
|
28
|
-
private resolveQueryParams;
|
|
29
|
-
/**
|
|
30
|
-
* Returns true if the current URL matches the target path and query params.
|
|
31
|
-
* When true, we skip router.push.
|
|
32
|
-
*/
|
|
33
|
-
private isSamePageAsCurrent;
|
|
34
|
-
private handleGotoPage;
|
|
35
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ActionConfig, BaseAction } from "./base-action";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export interface NotificationActionConfig extends ActionConfig {
|
|
4
|
-
showDialog: Function;
|
|
5
|
-
onOk?: Function;
|
|
6
|
-
onCancel?: Function;
|
|
7
|
-
onClose?: Function;
|
|
8
|
-
operation: string;
|
|
9
|
-
partialContent?: React.ReactNode;
|
|
10
|
-
toasterService?: () => any;
|
|
11
|
-
}
|
|
12
|
-
export declare class NotificationAction extends BaseAction<NotificationActionConfig> {
|
|
13
|
-
constructor(config: NotificationActionConfig);
|
|
14
|
-
notify(event: string, args: any[], emitToParent?: boolean): void;
|
|
15
|
-
notify(params?: any, onSuccess?: Function, onError?: Function): Promise<any>;
|
|
16
|
-
private prepareToastOptions;
|
|
17
|
-
invoke(params?: any, onSuccess?: Function, onError?: Function): Promise<any>;
|
|
18
|
-
private showToast;
|
|
19
|
-
getMessage(): void;
|
|
20
|
-
}
|