@wavemaker/react-runtime 11.14.2-rc.6311 → 12.0.0-next.28533
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/base-action.js +5 -7
- package/actions/login-action.js +7 -8
- package/actions/logout-action.js +5 -7
- package/actions/navigation-action.js +32 -10
- package/actions/notification-action.js +22 -8
- package/actions/timer-action.js +13 -15
- package/actions/toast.js +4 -2
- package/actions/toast.service.js +1 -2
- package/components/advanced/carousel/index.js +1 -1
- package/components/advanced/carousel/template.js +1 -1
- package/components/basic/anchor/index.js +26 -9
- package/components/basic/html/index.js +115 -24
- package/components/basic/icon/index.js +2 -1
- package/components/basic/iframe/index.js +2 -1
- package/components/basic/label/index.js +12 -9
- package/components/basic/message/index.js +12 -3
- package/components/basic/picture/index.js +11 -4
- package/components/basic/progress-bar/index.js +1 -1
- package/components/basic/progress-circle/index.js +34 -28
- package/components/basic/progress-circle/props.js +10 -2
- package/components/basic/richtexteditor/index.js +95 -94
- package/components/basic/search/index.js +401 -156
- package/components/basic/search/providers.js +126 -61
- package/components/basic/spinner/index.js +2 -1
- package/components/basic/tree/index.js +34 -34
- package/components/basic/tree/utils.js +10 -4
- package/components/chart/components/barColumnChart/index.js +36 -33
- package/components/chart/components/bubbleChart/index.js +35 -25
- package/components/chart/components/chartLegend/utils.js +2 -1
- package/components/chart/components/cumulativeLineChart/index.js +30 -26
- package/components/chart/components/lineAreaChart/index.js +50 -32
- package/components/chart/components/pieDonutChart/index.js +13 -4
- package/components/chart/hooks/useXAxisConfig.js +15 -8
- package/components/chart/index.js +223 -53
- package/components/chart/utils.js +12 -1
- package/components/constants.js +5 -2
- package/components/container/accordion/accordion-pane/index.js +17 -12
- package/components/container/accordion/index.js +9 -4
- package/components/container/alignment-utils.js +56 -1
- package/components/container/index.js +49 -20
- package/components/container/panel/components/panel-header/index.js +3 -4
- package/components/container/panel/index.js +15 -10
- package/components/container/tabs/index.js +92 -14
- package/components/container/tabs/tab-pane/index.js +15 -8
- package/components/container/tabs/utils.js +51 -0
- package/components/container/wizard/components/StepComponents.js +2 -1
- package/components/container/wizard/components/WizardStep.js +2 -1
- package/components/container/wizard/index.js +64 -35
- package/components/container/wizard/utils.js +46 -1
- package/components/container/wizard/wizard-step/index.js +11 -1
- package/components/data/card/card-content/index.js +1 -1
- package/components/data/form/base-form/index.js +991 -180
- package/components/data/form/base-form/props.js +3 -1
- package/components/data/form/base-form/utils.js +159 -1
- package/components/data/form/dynamic-fields/constant.js +53 -0
- package/components/data/form/dynamic-fields/index.js +10 -45
- package/components/data/form/dynamic-fields/utils.js +37 -2
- package/components/data/form/form-action/index.js +5 -4
- package/components/data/form/form-context.js +5 -1
- package/components/data/form/form-controller/utils.js +84 -0
- package/components/data/form/form-controller/validation-contrustor.js +402 -189
- package/components/data/form/form-controller/withFormController.js +191 -52
- package/components/data/form/form-field/base-field.js +54 -33
- package/components/data/form/form-field/index.js +28 -5
- package/components/data/form/form-header/index.js +3 -4
- package/components/data/form/index.js +20 -1
- package/components/data/list/components/ListDND.js +2 -1
- package/components/data/list/components/ListItem.js +6 -2
- package/components/data/list/components/ListItemWithTemplate.js +46 -2
- package/components/data/list/components/ListItems.js +17 -26
- package/components/data/list/components/ListPagination.js +3 -3
- package/components/data/list/components/StandardListItems.js +3 -4
- package/components/data/list/hooks/useListEffects.js +55 -14
- package/components/data/list/hooks/useListEventHandlers.js +3 -1
- package/components/data/list/hooks/useListState.js +3 -1
- package/components/data/list/hooks/usePaginatedGroupedData.js +18 -5
- package/components/data/list/index.js +74 -55
- package/components/data/list/utils/list-helpers.js +73 -35
- package/components/data/list/utils/list-widget-methods.js +138 -95
- package/components/data/live-filter/index.js +26 -15
- package/components/data/live-form/index.js +23 -7
- package/components/data/live-form/props.js +1 -1
- package/components/data/pagination/components/BasicPagination.js +71 -16
- package/components/data/pagination/components/PageSizeSelector.js +8 -3
- package/components/data/pagination/components/TotalRecords.js +1 -5
- package/components/data/pagination/hooks/usePagination.js +349 -66
- package/components/data/pagination/index.js +137 -19
- package/components/data/table/components/AddNewRow.js +5 -1
- package/components/data/table/components/EditableCell.js +2 -2
- package/components/data/table/components/RowCells.js +64 -0
- package/components/data/table/components/RowExpansionButton.js +2 -2
- package/components/data/table/components/SummaryCell.js +111 -0
- package/components/data/table/components/SummaryRow.js +54 -0
- package/components/data/table/components/SummaryRowFooter.js +46 -0
- package/components/data/table/components/TableBody.js +61 -59
- package/components/data/table/components/TableDataRow.js +109 -0
- package/components/data/table/components/TableFilters.js +225 -121
- package/components/data/table/components/TableHeader.js +291 -23
- package/components/data/table/components/TablePanelHeading.js +139 -8
- package/components/data/table/components/index.js +22 -1
- package/components/data/table/hooks/use-edited-rows.js +141 -0
- package/components/data/table/hooks/useCellState.js +5 -12
- package/components/data/table/hooks/useFormWidget.js +58 -51
- package/components/data/table/hooks/usePaginationState.js +45 -24
- package/components/data/table/hooks/usePanelStructure.js +4 -4
- package/components/data/table/hooks/useRowHandlers.js +39 -5
- package/components/data/table/hooks/useRowSelection.js +244 -50
- package/components/data/table/hooks/useServerSideSorting.js +81 -37
- package/components/data/table/hooks/useTableColumns.js +211 -118
- package/components/data/table/hooks/useTableData.js +54 -9
- package/components/data/table/hooks/useTableEdit.js +272 -97
- package/components/data/table/hooks/useTableEffects.js +31 -13
- package/components/data/table/hooks/useTableFilter.js +1 -1
- package/components/data/table/hooks/useTableInitialization.js +23 -22
- package/components/data/table/hooks/useTableState.js +11 -5
- package/components/data/table/hooks/useTableStateManager.js +140 -65
- package/components/data/table/index.js +637 -274
- package/components/data/table/live-table/index.js +54 -22
- package/components/data/table/table-action/index.js +1 -1
- package/components/data/table/table-group/index.js +26 -0
- package/components/data/table/table-row-action/index.js +32 -18
- package/components/data/table/utils/buildSelectionColumns.js +12 -21
- package/components/data/table/utils/columnBuilder.js +29 -14
- package/components/data/table/utils/columnProxy.js +68 -1
- package/components/data/table/utils/constants.js +6 -2
- package/components/data/table/utils/crud-handlers.js +68 -63
- package/components/data/table/utils/groupHeaderUtils.js +102 -0
- package/components/data/table/utils/index.js +210 -21
- package/components/data/table/utils/renderDisplayCell.js +6 -6
- package/components/data/table/utils/selectionUtils.js +25 -26
- package/components/data/table/utils/validation.js +1 -0
- package/components/data/utils/filter-field-util.js +3 -3
- package/components/dialogs/alert-dialog/index.js +1 -1
- package/components/dialogs/confirm-dialog/index.js +1 -1
- package/components/dialogs/dialog/index.js +4 -1
- package/components/dialogs/dialog-content/index.js +3 -1
- package/components/dialogs/dialog-header/index.js +2 -2
- package/components/dialogs/iframe-dialog/index.js +11 -5
- package/components/dialogs/index.js +1 -1
- package/components/dialogs/login-dialog/index.js +1 -1
- package/components/dialogs/page-dialog/index.js +1 -1
- package/components/form/button/index.js +33 -7
- package/components/input/calendar/index.js +18 -6
- package/components/input/chips/index.js +99 -28
- package/components/input/chips/utils.js +34 -4
- package/components/input/color-picker/index.js +74 -25
- package/components/input/composite/index.js +3 -3
- package/components/input/currency/index.js +35 -49
- package/components/input/default/checkbox/index.js +23 -28
- package/components/input/default/checkboxset/index.js +38 -18
- package/components/input/default/checkboxset/utils.js +30 -0
- package/components/input/default/radioset/index.js +36 -39
- package/components/input/default/switch/index.js +30 -13
- package/components/input/epoch/date/index.js +130 -69
- package/components/input/epoch/date/utils.js +94 -1
- package/components/input/epoch/datetime/index.js +72 -22
- package/components/input/epoch/datetime/utils.js +49 -10
- package/components/input/epoch/time/index.js +68 -19
- package/components/input/epoch/time/utils.js +62 -14
- package/components/input/fileupload/Utils.js +12 -7
- package/components/input/fileupload/components/MultiUpload.js +2 -6
- package/components/input/fileupload/components/SingleUpload.js +3 -7
- package/components/input/fileupload/index.js +6 -10
- package/components/input/fileupload/useFileUpload.js +16 -5
- package/components/input/number/index.js +158 -43
- package/components/input/rating/index.js +90 -7
- package/components/input/select/index.js +147 -70
- package/components/input/slider/index.js +84 -26
- package/components/input/text/index.js +38 -18
- package/components/input/text/util.js +283 -130
- package/components/input/textarea/index.js +13 -10
- package/components/input/upload/index.js +124 -0
- package/components/input/upload/props.js +5 -0
- package/components/input/util/index.js +11 -0
- package/components/navbar/index.js +51 -3
- package/components/navbar/nav/index.js +46 -16
- package/components/navbar/nav-item/index.js +11 -5
- package/components/navigation/menu/components/ListItems.js +3 -0
- package/components/navigation/menu/constants.js +2 -1
- package/components/navigation/menu/hooks/useHoverState.hook.js +48 -0
- package/components/navigation/menu/hooks/useKeyboardMovements.hook.js +37 -0
- package/components/navigation/menu/hooks/useTransformedDataset.hook.js +15 -0
- package/components/navigation/menu/index.js +326 -188
- package/components/navigation/menu/utils/action-task.js +14 -0
- package/components/navigation/menu/utils/role-filter.js +76 -0
- package/components/navigation/popover/index.js +99 -26
- package/components/page/partial-container/index.js +34 -5
- package/components/prefab/index.js +2 -4
- package/context/PrefabContext.js +10 -6
- package/context/WidgetProvider.js +30 -31
- package/core/app.service.js +1 -1
- package/core/constants/events.js +57 -1
- package/core/dialog.service.js +1 -2
- package/core/event-notifier.js +1 -2
- package/core/formatter/array-formatters.js +33 -0
- package/core/formatter/date-formatters.js +2 -4
- package/core/formatter/index.js +2 -1
- package/core/formatter/number-formatters.js +5 -10
- package/core/formatter/security-formatters.js +2 -4
- package/core/formatter/string-formatters.js +3 -6
- package/core/proxy-service.js +84 -13
- package/core/script-registry.js +108 -48
- package/core/util/common.js +4 -4
- package/core/util/compare.js +30 -0
- package/core/util/dom.js +8 -8
- package/core/util/index.js +16 -6
- package/core/util/safe-is-equal.js +156 -0
- package/core/util/security.js +1 -2
- package/core/util/utils.js +16 -7
- package/higherOrder/BaseApp.js +108 -65
- package/higherOrder/BaseDateTime.js +31 -13
- package/higherOrder/BasePage.js +268 -144
- package/higherOrder/BasePartial.js +1 -1
- package/higherOrder/BasePrefab.js +33 -15
- package/higherOrder/DataNav.js +99 -16
- package/higherOrder/helper.js +5 -0
- package/higherOrder/withBaseWrapper.js +41 -28
- package/hooks/useAuth.js +11 -5
- package/hooks/useHttp.js +280 -94
- package/mui-config/theme-provider.js +1 -1
- package/mui-config/theme.js +1 -1
- package/package-lock.json +824 -724
- package/package.json +8 -8
- package/store/bindActions/i18nActions.js +18 -0
- package/store/index.js +3 -1
- package/store/slices/appConfigSlice.js +2 -2
- package/store/slices/authSlice.js +31 -28
- package/store/slices/i18nSlice.js +2 -2
- package/store/slices/navigationSlice.js +35 -0
- package/store/viewport.service.js +255 -0
- package/utils/attr.js +35 -0
- package/utils/dataset-util.js +1 -2
- package/utils/form-state.util.js +43 -12
- package/utils/form-utils.js +47 -2
- package/utils/format-util.js +28 -13
- package/utils/page-params-util.js +33 -1
- package/utils/state-persistance.js +72 -13
- package/utils/transformedDataset-utils.js +35 -24
- package/variables/base-variable.js +12 -14
- package/variables/crud-variable.js +225 -0
- package/variables/live-variable.js +56 -20
- package/variables/metadata.service.js +123 -0
- package/variables/model-variable.js +21 -15
- package/variables/service-variable.js +88 -83
|
@@ -10,6 +10,9 @@ var _exportNames = {
|
|
|
10
10
|
getBooleanDataset: true,
|
|
11
11
|
isColumnVisibleForViewport: true,
|
|
12
12
|
parseTableColumns: true,
|
|
13
|
+
getAggregateFunctions: true,
|
|
14
|
+
parseTableStructureWithGroups: true,
|
|
15
|
+
flattenTableStructure: true,
|
|
13
16
|
parseTableRowActions: true,
|
|
14
17
|
parseTableActions: true,
|
|
15
18
|
parseTableRowExpansion: true,
|
|
@@ -26,10 +29,12 @@ var _exportNames = {
|
|
|
26
29
|
handleNewRowNavigation: true,
|
|
27
30
|
INTERNAL_PROPERTIES: true,
|
|
28
31
|
cleanRowData: true,
|
|
29
|
-
parseWidth: true
|
|
32
|
+
parseWidth: true,
|
|
33
|
+
getColClass: true
|
|
30
34
|
};
|
|
31
|
-
exports.validateEditingFields = exports.shouldShowPanelHeading = exports.shouldShowPagination = exports.parseWidth = exports.parseTableRowExpansion = exports.parseTableRowActions = exports.parseTableColumns = exports.parseTableActions = exports.isEditAction = exports.isDeleteAction = exports.isColumnVisibleForViewport = exports.isAddNewAction = exports.handleNewRowNavigation = exports.getWidgetMappingForType = exports.getTableActionButtonClass = exports.getSpacingClasses = exports.getButtonClasses = exports.getBooleanDataset = exports.getActionButtonClass = exports.cleanRowData = exports.addUniqueRowIds = exports.INTERNAL_PROPERTIES = void 0;
|
|
35
|
+
exports.validateEditingFields = exports.shouldShowPanelHeading = exports.shouldShowPagination = exports.parseWidth = exports.parseTableStructureWithGroups = exports.parseTableRowExpansion = exports.parseTableRowActions = exports.parseTableColumns = exports.parseTableActions = exports.isEditAction = exports.isDeleteAction = exports.isColumnVisibleForViewport = exports.isAddNewAction = exports.handleNewRowNavigation = exports.getWidgetMappingForType = exports.getTableActionButtonClass = exports.getSpacingClasses = exports.getColClass = exports.getButtonClasses = exports.getBooleanDataset = exports.getAggregateFunctions = exports.getActionButtonClass = exports.flattenTableStructure = exports.cleanRowData = exports.addUniqueRowIds = exports.INTERNAL_PROPERTIES = void 0;
|
|
32
36
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
37
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
33
38
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
34
39
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
35
40
|
var _lodashEs = require("lodash-es");
|
|
@@ -174,17 +179,22 @@ var addUniqueRowIds = exports.addUniqueRowIds = function addUniqueRowIds(dataset
|
|
|
174
179
|
if ((0, _typeof2["default"])(item) !== "object" || item === null || (0, _lodashEs.isArray)(item)) {
|
|
175
180
|
return item;
|
|
176
181
|
}
|
|
182
|
+
var getProperty = function getProperty(propName) {
|
|
183
|
+
return (0, _lodashEs.get)(item, propName);
|
|
184
|
+
};
|
|
177
185
|
|
|
178
186
|
// Skip if the item already has a unique row ID
|
|
179
187
|
if (item[idProperty]) {
|
|
180
|
-
return item
|
|
188
|
+
return item.getProperty ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
189
|
+
getProperty: getProperty
|
|
190
|
+
});
|
|
181
191
|
}
|
|
182
192
|
|
|
183
193
|
// Generate a unique ID based on existing id field or create a deterministic hash
|
|
184
194
|
var rowId = item.id || item.ID || item.Id || generateDeterministicHash(item, index);
|
|
185
195
|
|
|
186
|
-
// Use spread operator for objects to add the ID property
|
|
187
|
-
return _objectSpread(_objectSpread({}, item), {}, (0, _defineProperty2["default"])({}, idProperty, rowId));
|
|
196
|
+
// Use spread operator for objects to add the ID property and getProperty helper
|
|
197
|
+
return _objectSpread(_objectSpread({}, item), {}, (0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, idProperty, rowId), "getProperty", getProperty));
|
|
188
198
|
});
|
|
189
199
|
};
|
|
190
200
|
|
|
@@ -266,14 +276,48 @@ var isColumnVisibleForViewport = exports.isColumnVisibleForViewport = function i
|
|
|
266
276
|
}
|
|
267
277
|
return true;
|
|
268
278
|
};
|
|
279
|
+
function transformExpression(exp) {
|
|
280
|
+
if (typeof exp === "string") {
|
|
281
|
+
// First replacing generic getProperty calls with rowData
|
|
282
|
+
// Matches patterns like: fragment.row?.getProperty?.("key") -> rowData['key']
|
|
283
|
+
var transformedExp = exp.replace(/(?:[\w$]+(?:\?\.|\.))*getProperty(?:\?\.)?\(\s*(['"])(.*?)\1\s*\)/g, function (_, quote, key) {
|
|
284
|
+
return "rowData['".concat(key, "']");
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// Regex to split by string literals (double or single quoted)
|
|
288
|
+
var parts = transformedExp.split(/(".*?"|'.*?')/);
|
|
289
|
+
return parts.map(function (part) {
|
|
290
|
+
// If part is a string literal, return as is
|
|
291
|
+
if (part.startsWith('"') || part.startsWith("'")) {
|
|
292
|
+
return part;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Replace identifiers that are not keywords
|
|
296
|
+
// Identifiers start with letter, _, or $
|
|
297
|
+
return part.replace(/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g, function (match) {
|
|
298
|
+
var keywords = ["true", "false", "null", "undefined", "NaN", "Infinity", "in", "instanceof", "typeof", "void", "new", "delete", "rowData" // Don't replace rowData if it's already there
|
|
299
|
+
];
|
|
300
|
+
if (keywords.includes(match)) {
|
|
301
|
+
return match;
|
|
302
|
+
}
|
|
303
|
+
return "rowData['".concat(match, "']");
|
|
304
|
+
});
|
|
305
|
+
}).join("");
|
|
306
|
+
}
|
|
307
|
+
return exp;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Table structure types for grouping
|
|
269
311
|
|
|
270
312
|
// Children parsing utilities
|
|
271
|
-
var parseTableColumns = exports.parseTableColumns = function parseTableColumns(children) {
|
|
313
|
+
var parseTableColumns = exports.parseTableColumns = function parseTableColumns(children, dataset) {
|
|
272
314
|
var columns = [];
|
|
273
315
|
_react["default"].Children.forEach(children, function (child) {
|
|
274
316
|
if (child && child.props && child.props.name && child.props.name.includes("wm_table_column")) {
|
|
275
317
|
var props = (0, _lodashEs.get)(child, "props", {});
|
|
276
|
-
|
|
318
|
+
var binding = (0, _lodashEs.get)(props, "binding");
|
|
319
|
+
var aggregate = getAggregateFunctions(dataset, binding);
|
|
320
|
+
columns.push(_objectSpread(_objectSpread({}, props), {}, {
|
|
277
321
|
field: (0, _lodashEs.get)(props, "binding"),
|
|
278
322
|
caption: (0, _lodashEs.get)(props, "caption"),
|
|
279
323
|
displayName: (0, _lodashEs.get)(props, "caption"),
|
|
@@ -287,10 +331,105 @@ var parseTableColumns = exports.parseTableColumns = function parseTableColumns(c
|
|
|
287
331
|
widgetType: (0, _lodashEs.get)(props, "widgetType", "label"),
|
|
288
332
|
required: (0, _lodashEs.get)(props, "required") === true || (0, _lodashEs.get)(props, "required") === "true",
|
|
289
333
|
defaultvalue: (0, _lodashEs.get)(props, "defaultvalue"),
|
|
290
|
-
disabled: (0, _lodashEs.get)(props, "disabled")
|
|
334
|
+
disabled: transformExpression((0, _lodashEs.get)(props, "disabled")),
|
|
335
|
+
readonly: (0, _lodashEs.get)(props, "readonly") || (0, _lodashEs.get)(props, "readonly") === "true",
|
|
291
336
|
placeholder: (0, _lodashEs.get)(props, "placeholder"),
|
|
292
|
-
sortby: (0, _lodashEs.get)(props, "sortby")
|
|
293
|
-
|
|
337
|
+
sortby: (0, _lodashEs.get)(props, "sortby"),
|
|
338
|
+
aggregate: aggregate,
|
|
339
|
+
colClass: (0, _lodashEs.get)(props, "colClass")
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return columns;
|
|
344
|
+
};
|
|
345
|
+
var getAggregateFunctions = exports.getAggregateFunctions = function getAggregateFunctions(dataset, binding) {
|
|
346
|
+
function _getColumnData() {
|
|
347
|
+
return (0, _lodashEs.map)(dataset, binding);
|
|
348
|
+
}
|
|
349
|
+
var aggregate = {
|
|
350
|
+
sum: function sum() {
|
|
351
|
+
return (0, _lodashEs.sum)(_getColumnData());
|
|
352
|
+
},
|
|
353
|
+
average: function average() {
|
|
354
|
+
var precision = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2;
|
|
355
|
+
return (0, _lodashEs.round)((0, _lodashEs.mean)(_getColumnData()), precision);
|
|
356
|
+
},
|
|
357
|
+
count: function count() {
|
|
358
|
+
return _getColumnData().length;
|
|
359
|
+
},
|
|
360
|
+
minimum: function minimum() {
|
|
361
|
+
return (0, _lodashEs.min)(_getColumnData());
|
|
362
|
+
},
|
|
363
|
+
maximum: function maximum() {
|
|
364
|
+
return (0, _lodashEs.max)(_getColumnData());
|
|
365
|
+
},
|
|
366
|
+
percent: function percent(value) {
|
|
367
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
368
|
+
return (0, _lodashEs.round)((0, _lodashEs.sum)(_getColumnData()) / value * 100, precision);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
return aggregate;
|
|
372
|
+
};
|
|
373
|
+
// Parse table structure with groups support
|
|
374
|
+
var _parseTableStructureWithGroups = exports.parseTableStructureWithGroups = function parseTableStructureWithGroups(children) {
|
|
375
|
+
var structure = [];
|
|
376
|
+
_react["default"].Children.forEach(children, function (child) {
|
|
377
|
+
if (!child || !child.props) return;
|
|
378
|
+
var childName = (0, _lodashEs.get)(child, "props.name", "");
|
|
379
|
+
|
|
380
|
+
// Handle WmTableGroup
|
|
381
|
+
if (childName.includes("group")) {
|
|
382
|
+
var props = (0, _lodashEs.get)(child, "props", {});
|
|
383
|
+
var group = {
|
|
384
|
+
isGroup: true,
|
|
385
|
+
field: (0, _lodashEs.get)(props, "name", ""),
|
|
386
|
+
displayName: (0, _lodashEs.get)(props, "caption", ""),
|
|
387
|
+
textAlignment: (0, _lodashEs.get)(props, "textalignment"),
|
|
388
|
+
backgroundColor: (0, _lodashEs.get)(props, "backgroundcolor"),
|
|
389
|
+
"class": (0, _lodashEs.get)(props, "class"),
|
|
390
|
+
colClass: (0, _lodashEs.get)(props, "col-class"),
|
|
391
|
+
styles: (0, _lodashEs.get)(props, "styles"),
|
|
392
|
+
columns: _parseTableStructureWithGroups(child.props.children) // Recursive for nested groups
|
|
393
|
+
};
|
|
394
|
+
structure.push(group);
|
|
395
|
+
}
|
|
396
|
+
// Handle WmTableColumn
|
|
397
|
+
else if (childName.includes("wm_table_column")) {
|
|
398
|
+
var _props = (0, _lodashEs.get)(child, "props", {});
|
|
399
|
+
var column = _objectSpread({
|
|
400
|
+
field: (0, _lodashEs.get)(_props, "binding"),
|
|
401
|
+
caption: (0, _lodashEs.get)(_props, "caption"),
|
|
402
|
+
displayName: (0, _lodashEs.get)(_props, "caption"),
|
|
403
|
+
show: (0, _lodashEs.get)(_props, "show", true) !== false,
|
|
404
|
+
sortable: (0, _lodashEs.get)(_props, "sortable", true) !== false,
|
|
405
|
+
textalignment: (0, _lodashEs.get)(_props, "textalignment", "left"),
|
|
406
|
+
backgroundcolor: (0, _lodashEs.get)(_props, "backgroundcolor"),
|
|
407
|
+
textcolor: (0, _lodashEs.get)(_props, "textcolor"),
|
|
408
|
+
width: (0, _lodashEs.get)(_props, "width"),
|
|
409
|
+
editWidgetType: (0, _lodashEs.get)(_props, "editWidgetType", "WmText"),
|
|
410
|
+
widgetType: (0, _lodashEs.get)(_props, "widgetType", "label"),
|
|
411
|
+
required: (0, _lodashEs.get)(_props, "required") === true || (0, _lodashEs.get)(_props, "required") === "true",
|
|
412
|
+
defaultvalue: (0, _lodashEs.get)(_props, "defaultvalue"),
|
|
413
|
+
disabled: (0, _lodashEs.get)(_props, "disabled") === true || (0, _lodashEs.get)(_props, "disabled") === "true",
|
|
414
|
+
placeholder: (0, _lodashEs.get)(_props, "placeholder"),
|
|
415
|
+
sortby: (0, _lodashEs.get)(_props, "sortby")
|
|
416
|
+
}, _props);
|
|
417
|
+
structure.push(column);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
return structure;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// Flatten hierarchical structure to get all columns
|
|
424
|
+
var _flattenTableStructure = exports.flattenTableStructure = function flattenTableStructure(structure) {
|
|
425
|
+
var columns = [];
|
|
426
|
+
structure.forEach(function (item) {
|
|
427
|
+
if ("isGroup" in item && item.isGroup) {
|
|
428
|
+
// Recursively flatten groups
|
|
429
|
+
columns.push.apply(columns, (0, _toConsumableArray2["default"])(_flattenTableStructure(item.columns)));
|
|
430
|
+
} else {
|
|
431
|
+
// It's a column
|
|
432
|
+
columns.push(item);
|
|
294
433
|
}
|
|
295
434
|
});
|
|
296
435
|
return columns;
|
|
@@ -337,8 +476,8 @@ var parseTableRowExpansion = exports.parseTableRowExpansion = function parseTabl
|
|
|
337
476
|
var name = child.props.name;
|
|
338
477
|
// Match names that start with "wm_table_row_" followed by a hash/id, but not "wm_table_row_action"
|
|
339
478
|
if (name.startsWith("wm_table_row_") && !name.includes("_action")) {
|
|
340
|
-
var
|
|
341
|
-
rowExpansionConfig =
|
|
479
|
+
var _props2 = (0, _lodashEs.get)(child, "props", {});
|
|
480
|
+
rowExpansionConfig = _props2;
|
|
342
481
|
}
|
|
343
482
|
}
|
|
344
483
|
});
|
|
@@ -360,10 +499,12 @@ var isAddNewAction = exports.isAddNewAction = function isAddNewAction(actionKey)
|
|
|
360
499
|
var getActionButtonClass = exports.getActionButtonClass = function getActionButtonClass(action) {
|
|
361
500
|
var actionKey = (0, _lodashEs.get)(action, "key") || (0, _lodashEs.get)(action, "name") || (0, _lodashEs.get)(action, "action");
|
|
362
501
|
if (isEditAction(actionKey)) {
|
|
363
|
-
|
|
502
|
+
var updateRowClasses = (0, _lodashEs.get)(action, "className", "");
|
|
503
|
+
return "row-action row-action-button btn-transparent edit edit-row-button ".concat(updateRowClasses);
|
|
364
504
|
}
|
|
365
505
|
if (isDeleteAction(actionKey) || actionKey === "delete") {
|
|
366
|
-
|
|
506
|
+
var deleteRowClasses = (0, _lodashEs.get)(action, "className", "");
|
|
507
|
+
return "row-action row-action-button btn-transparent delete delete-row-button ".concat(_constants.TABLE_CSS_CLASSES.deleteRow, " ").concat(deleteRowClasses);
|
|
367
508
|
}
|
|
368
509
|
return "row-action row-action-button ".concat((0, _lodashEs.get)(action, "className", "btn-transparent"));
|
|
369
510
|
};
|
|
@@ -406,7 +547,7 @@ var validateEditingFields = exports.validateEditingFields = function validateEdi
|
|
|
406
547
|
var inputs = fieldElement.querySelectorAll("input, select, textarea");
|
|
407
548
|
(0, _lodashEs.forEach)(inputs, function (input) {
|
|
408
549
|
// Check HTML5 validation
|
|
409
|
-
if (input && !input.validity.valid) {
|
|
550
|
+
if (input && !input.validity.valid && input.hasAttribute("required")) {
|
|
410
551
|
invalidElements.push(input);
|
|
411
552
|
isInvalid = true;
|
|
412
553
|
}
|
|
@@ -515,9 +656,9 @@ var shouldShowPagination = exports.shouldShowPagination = function shouldShowPag
|
|
|
515
656
|
|
|
516
657
|
// Panel structure utilities
|
|
517
658
|
var shouldShowPanelHeading = exports.shouldShowPanelHeading = function shouldShowPanelHeading(title, subheading, iconclass) {
|
|
518
|
-
var
|
|
659
|
+
var exportformat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
519
660
|
var headerActions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
520
|
-
return !(0, _lodashEs.isEmpty)(title) || !(0, _lodashEs.isEmpty)(subheading) || !(0, _lodashEs.isEmpty)(iconclass) || (0, _lodashEs.size)(
|
|
661
|
+
return !(0, _lodashEs.isEmpty)(title) || !(0, _lodashEs.isEmpty)(subheading) || !(0, _lodashEs.isEmpty)(iconclass) || (0, _lodashEs.size)(exportformat) > 0 || (0, _lodashEs.size)(headerActions) > 0;
|
|
521
662
|
};
|
|
522
663
|
|
|
523
664
|
/**
|
|
@@ -554,9 +695,15 @@ var handleNewRowNavigation = exports.handleNewRowNavigation = function handleNew
|
|
|
554
695
|
|
|
555
696
|
/**
|
|
556
697
|
* List of internal properties that should be removed from row data
|
|
557
|
-
* before passing to external handlers
|
|
698
|
+
* before passing to external handlers or form data
|
|
558
699
|
*/
|
|
559
|
-
var INTERNAL_PROPERTIES = exports.INTERNAL_PROPERTIES = ["_wmTableRowId"
|
|
700
|
+
var INTERNAL_PROPERTIES = exports.INTERNAL_PROPERTIES = ["_wmTableRowId",
|
|
701
|
+
// Internal row identifier
|
|
702
|
+
"getProperty",
|
|
703
|
+
// Helper function to get property values
|
|
704
|
+
"rowOperations",
|
|
705
|
+
// Internal column for row action buttons
|
|
706
|
+
"rowActions" // Internal row actions property
|
|
560
707
|
];
|
|
561
708
|
|
|
562
709
|
/**
|
|
@@ -565,13 +712,13 @@ var INTERNAL_PROPERTIES = exports.INTERNAL_PROPERTIES = ["_wmTableRowId" // Inte
|
|
|
565
712
|
* @param data The raw data - can be a single object, array of objects, or primitive
|
|
566
713
|
* @returns The cleaned data without internal properties
|
|
567
714
|
*/
|
|
568
|
-
var
|
|
715
|
+
var _cleanRowData = exports.cleanRowData = function cleanRowData(data) {
|
|
569
716
|
if (!data) return data;
|
|
570
717
|
|
|
571
718
|
// For arrays, clean each item
|
|
572
719
|
if ((0, _lodashEs.isArray)(data)) {
|
|
573
720
|
return data.map(function (item) {
|
|
574
|
-
return
|
|
721
|
+
return _cleanRowData(item);
|
|
575
722
|
});
|
|
576
723
|
}
|
|
577
724
|
|
|
@@ -603,5 +750,47 @@ var parseWidth = exports.parseWidth = function parseWidth(width) {
|
|
|
603
750
|
}
|
|
604
751
|
return columnSize;
|
|
605
752
|
};
|
|
753
|
+
var getColClass = exports.getColClass = function getColClass(colClass, rowData, columnName) {
|
|
754
|
+
// Return empty string if colClass is not provided or not a string
|
|
755
|
+
if (!colClass || typeof colClass !== "string") {
|
|
756
|
+
return "";
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// Trim whitespace
|
|
760
|
+
var trimmedClass = (0, _lodashEs.trim)(colClass);
|
|
761
|
+
if (!trimmedClass) {
|
|
762
|
+
return "";
|
|
763
|
+
}
|
|
764
|
+
var hasExpressionOperators = /[?&|<>!=]/.test(trimmedClass) || trimmedClass.includes("(") || trimmedClass.includes("&&") || trimmedClass.includes("||") || trimmedClass.includes("===") || trimmedClass.includes("!==");
|
|
765
|
+
var hasRowDataReference = trimmedClass.includes("rowData");
|
|
766
|
+
var hasColumnNameReference = trimmedClass.includes("columnName");
|
|
767
|
+
var isExpression = hasExpressionOperators || hasRowDataReference || hasColumnNameReference;
|
|
768
|
+
|
|
769
|
+
// If it's not an expression, return as-is
|
|
770
|
+
if (!isExpression) {
|
|
771
|
+
return trimmedClass;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// Evaluate the expression using Function constructor
|
|
775
|
+
try {
|
|
776
|
+
var expressionToEvaluate = trimmedClass;
|
|
777
|
+
var evaluated = new Function("rowData", "columnName", "return ".concat(expressionToEvaluate))(rowData, columnName);
|
|
778
|
+
|
|
779
|
+
// Convert result to string (handles boolean, number, null, undefined)
|
|
780
|
+
if (evaluated === null || evaluated === undefined) {
|
|
781
|
+
return "";
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// If it's a boolean, return empty string (falsy) or convert to string
|
|
785
|
+
if (typeof evaluated === "boolean") {
|
|
786
|
+
return evaluated ? String(evaluated) : "";
|
|
787
|
+
}
|
|
788
|
+
return String(evaluated);
|
|
789
|
+
} catch (error) {
|
|
790
|
+
console.warn("Failed to evaluate colClass expression:", trimmedClass, error);
|
|
791
|
+
// Return empty string on error to prevent breaking the UI
|
|
792
|
+
return "";
|
|
793
|
+
}
|
|
794
|
+
};
|
|
606
795
|
|
|
607
796
|
// Export utilities
|
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.renderDisplayCell = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _button = require("
|
|
11
|
-
var _index = require("
|
|
12
|
-
var _label = require("
|
|
10
|
+
var _button = require("@wavemaker/react-runtime/components/form/button");
|
|
11
|
+
var _index = require("@wavemaker/react-runtime/components/input/default/checkbox/index");
|
|
12
|
+
var _label = require("@wavemaker/react-runtime/components/basic/label");
|
|
13
13
|
var _index2 = require("./index");
|
|
14
|
-
var _anchor = require("
|
|
15
|
-
var _icon = require("
|
|
16
|
-
var _picture = require("
|
|
14
|
+
var _anchor = require("@wavemaker/react-runtime/components/basic/anchor");
|
|
15
|
+
var _icon = require("@wavemaker/react-runtime/components/basic/icon");
|
|
16
|
+
var _picture = require("@wavemaker/react-runtime/components/basic/picture");
|
|
17
17
|
var _lodashEs = require("lodash-es");
|
|
18
18
|
var _hooks = require("../hooks");
|
|
19
19
|
var __jsx = _react["default"].createElement;
|
|
@@ -111,56 +111,55 @@ var rowExistsInDataset = exports.rowExistsInDataset = function rowExistsInDatase
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Unified selection state management functions
|
|
115
|
+
* Uses a single selectedRowIds array for both radio and multiselect modes:
|
|
116
|
+
* - Radio select: array contains at most 1 item (replaces on new selection)
|
|
117
|
+
* - Multiselect: array can contain multiple items (add/remove on selection)
|
|
115
118
|
*/
|
|
116
119
|
var selectionStateHelpers = exports.selectionStateHelpers = {
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
(0, _hooks.
|
|
120
|
+
// Get current selection (works for both modes)
|
|
121
|
+
getSelection: function getSelection(cellState) {
|
|
122
|
+
return (0, _hooks.getSelectedRowIds)(cellState);
|
|
120
123
|
},
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
// Set selection - replaces entire selection (for radio select)
|
|
125
|
+
setSelection: function setSelection(cellState, rowId) {
|
|
126
|
+
(0, _hooks.setSelectedRowIds)(cellState, [rowId]);
|
|
123
127
|
},
|
|
124
|
-
//
|
|
125
|
-
|
|
128
|
+
// Add to selection (for multiselect)
|
|
129
|
+
addToSelection: function addToSelection(cellState, rowId) {
|
|
126
130
|
var current = (0, _hooks.getSelectedRowIds)(cellState);
|
|
127
131
|
if (!current.includes(rowId)) {
|
|
128
132
|
(0, _hooks.setSelectedRowIds)(cellState, [].concat((0, _toConsumableArray2["default"])(current), [rowId]));
|
|
129
133
|
}
|
|
130
134
|
},
|
|
131
|
-
|
|
135
|
+
// Remove from selection (for multiselect)
|
|
136
|
+
removeFromSelection: function removeFromSelection(cellState, rowId) {
|
|
132
137
|
var current = (0, _hooks.getSelectedRowIds)(cellState);
|
|
133
138
|
(0, _hooks.setSelectedRowIds)(cellState, current.filter(function (id) {
|
|
134
139
|
return id !== rowId;
|
|
135
140
|
}));
|
|
136
141
|
},
|
|
137
|
-
|
|
142
|
+
// Toggle selection (for multiselect - adds if not present, removes if present)
|
|
143
|
+
toggleSelection: function toggleSelection(cellState, rowId) {
|
|
138
144
|
var current = (0, _hooks.getSelectedRowIds)(cellState);
|
|
139
145
|
var isSelected = current.includes(rowId);
|
|
140
146
|
if (isSelected) {
|
|
141
|
-
selectionStateHelpers.
|
|
147
|
+
selectionStateHelpers.removeFromSelection(cellState, rowId);
|
|
142
148
|
} else {
|
|
143
|
-
selectionStateHelpers.
|
|
149
|
+
selectionStateHelpers.addToSelection(cellState, rowId);
|
|
144
150
|
}
|
|
145
151
|
return !isSelected;
|
|
146
152
|
},
|
|
147
|
-
|
|
153
|
+
// Set all selections (for select all in multiselect)
|
|
154
|
+
setAllSelection: function setAllSelection(cellState, rowIds) {
|
|
148
155
|
(0, _hooks.setSelectedRowIds)(cellState, rowIds);
|
|
149
156
|
},
|
|
150
|
-
|
|
157
|
+
// Clear all selections
|
|
158
|
+
clearSelection: function clearSelection(cellState) {
|
|
151
159
|
(0, _hooks.setSelectedRowIds)(cellState, []);
|
|
152
160
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
// Check selection
|
|
157
|
-
isRowSelected: function isRowSelected(cellState, rowId, useMultiSelect, useRadioSelect) {
|
|
158
|
-
if (useMultiSelect) {
|
|
159
|
-
return (0, _hooks.getSelectedRowIds)(cellState).includes(rowId);
|
|
160
|
-
} else {
|
|
161
|
-
// For radio select or default mode (when neither is explicitly enabled),
|
|
162
|
-
// check radio selection
|
|
163
|
-
return (0, _hooks.getSelectedRowId)(cellState) === rowId;
|
|
164
|
-
}
|
|
161
|
+
// Check if a row is selected
|
|
162
|
+
isRowSelected: function isRowSelected(cellState, rowId) {
|
|
163
|
+
return (0, _hooks.getSelectedRowIds)(cellState).includes(rowId);
|
|
165
164
|
}
|
|
166
165
|
};
|
|
@@ -16,6 +16,7 @@ var validateField = exports.validateField = function validateField(rowId, fieldN
|
|
|
16
16
|
var fieldRefs = validationState.fieldRefs,
|
|
17
17
|
fieldValidationErrors = validationState.fieldValidationErrors,
|
|
18
18
|
cellUpdateCallbacks = validationState.cellUpdateCallbacks;
|
|
19
|
+
if (!(column !== null && column !== void 0 && column.required)) return true;
|
|
19
20
|
|
|
20
21
|
// Check required validation
|
|
21
22
|
if (column !== null && column !== void 0 && column.required && (value === undefined || value === null || value === "")) {
|
|
@@ -43,16 +43,16 @@ function interpolateBindExpressions(context, filterexpressions, callbackFn) {
|
|
|
43
43
|
// No need for subscription since changes happen in-place
|
|
44
44
|
}
|
|
45
45
|
var processFilterExpBindNode = exports.processFilterExpBindNode = function processFilterExpBindNode(context, filterExpressions, variable) {
|
|
46
|
-
var
|
|
46
|
+
var _traverseFilterExpressions = function traverseFilterExpressions(expressions) {
|
|
47
47
|
if (expressions.rules) {
|
|
48
48
|
(0, _lodashEs.forEach)(expressions.rules, function (filExpObj, i) {
|
|
49
49
|
if (filExpObj.rules) {
|
|
50
|
-
|
|
50
|
+
_traverseFilterExpressions(filExpObj);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
_traverseFilterExpressions(filterExpressions);
|
|
56
56
|
|
|
57
57
|
// Return the mutated filterExpressions or nothing
|
|
58
58
|
return filterExpressions;
|
|
@@ -18,7 +18,7 @@ var _dialogs = require("@wavemaker/react-runtime/components/dialogs");
|
|
|
18
18
|
var _withDialogWrapper = _interopRequireDefault(require("../withDialogWrapper"));
|
|
19
19
|
var _dialogBody = require("../dialog-body");
|
|
20
20
|
var __jsx = _react["default"].createElement; // components
|
|
21
|
-
var DEFAULT_CLASS = "";
|
|
21
|
+
var DEFAULT_CLASS = "dialog-view";
|
|
22
22
|
var WmConfirmDialog = function WmConfirmDialog(props) {
|
|
23
23
|
var isopen = props.isopen,
|
|
24
24
|
onClose = props.onClose,
|
|
@@ -18,7 +18,7 @@ var _button = require("@wavemaker/react-runtime/components/form/button");
|
|
|
18
18
|
var _dialogBody = require("@wavemaker/react-runtime/components/dialogs/dialog-body");
|
|
19
19
|
var _withDialogWrapper = _interopRequireDefault(require("@wavemaker/react-runtime/components/dialogs/withDialogWrapper"));
|
|
20
20
|
var __jsx = _react["default"].createElement; // components
|
|
21
|
-
var DEFAULT_CLASS = "app-dialog modal-dialog app-confirm-dialog";
|
|
21
|
+
var DEFAULT_CLASS = "app-dialog modal-dialog app-confirm-dialog dialog-view";
|
|
22
22
|
var WmConfirmDialog = function WmConfirmDialog(props) {
|
|
23
23
|
var _props$oktext = props.oktext,
|
|
24
24
|
oktext = _props$oktext === void 0 ? "OK" : _props$oktext,
|
|
@@ -17,6 +17,8 @@ var _dialogContent = _interopRequireDefault(require("@wavemaker/react-runtime/co
|
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
18
18
|
var __jsx = _react["default"].createElement;
|
|
19
19
|
var WmDialog = exports.WmDialog = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
20
|
+
var _props$modal = props.modal,
|
|
21
|
+
modal = _props$modal === void 0 ? true : _props$modal;
|
|
20
22
|
var handleClose = function handleClose(event) {
|
|
21
23
|
if (props.onClose) {
|
|
22
24
|
props.onClose(event);
|
|
@@ -29,9 +31,10 @@ var WmDialog = exports.WmDialog = /*#__PURE__*/(0, _react.memo)(function (props)
|
|
|
29
31
|
return null;
|
|
30
32
|
}
|
|
31
33
|
return __jsx(_dialogs["default"], (0, _extends2["default"])({}, props, {
|
|
34
|
+
modal: modal,
|
|
32
35
|
open: props.isopen,
|
|
33
36
|
onClose: handleClose,
|
|
34
|
-
className: (0, _clsx["default"])("app-dialog modal-dialog", props.className)
|
|
37
|
+
className: (0, _clsx["default"])("app-dialog modal-dialog dialog-view", props.className)
|
|
35
38
|
}), __jsx(_dialogContent["default"], props, props.dialogtype === "design-dialog" && props.showheader !== false && __jsx(_dialogHeader.WmDialogHeader, {
|
|
36
39
|
name: "",
|
|
37
40
|
listener: {},
|
|
@@ -20,10 +20,12 @@ var WmDialogContent = exports.WmDialogContent = function WmDialogContent(_ref) {
|
|
|
20
20
|
styles = _ref.styles;
|
|
21
21
|
return __jsx(_DialogContent["default"], {
|
|
22
22
|
className: DEFAULT_CLASS,
|
|
23
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styles), sheet && {
|
|
23
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, styles), sheet && {
|
|
24
24
|
borderRadius: 0
|
|
25
25
|
}), (sheetposition === "top" || sheetposition === "bottom") && {
|
|
26
26
|
width: "var(--wm-modal-full-screen-width)"
|
|
27
|
+
}), {}, {
|
|
28
|
+
flex: "none"
|
|
27
29
|
})
|
|
28
30
|
}, children);
|
|
29
31
|
};
|
|
@@ -83,9 +83,9 @@ var WmDialogHeader = exports.WmDialogHeader = function WmDialogHeader(props) {
|
|
|
83
83
|
"aria-label": "Close ".concat(title ? title : "", " dialog"),
|
|
84
84
|
onClick: onClose,
|
|
85
85
|
title: dialogLocale.LABEL_CLOSE,
|
|
86
|
-
className: "app-dialog-close close"
|
|
86
|
+
className: "app-dialog-close close btn-text"
|
|
87
87
|
}, isDialog ? __jsx(_material.Box, {
|
|
88
|
-
component: "
|
|
88
|
+
component: "span",
|
|
89
89
|
className: "app-icon wi wi-clear",
|
|
90
90
|
"aria-hidden": "true"
|
|
91
91
|
}) : __jsx(_react["default"].Fragment, null)));
|
|
@@ -20,7 +20,7 @@ var _withDialogWrapper = _interopRequireDefault(require("@wavemaker/react-runtim
|
|
|
20
20
|
var _dialogBody = require("../dialog-body");
|
|
21
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); }
|
|
22
22
|
var __jsx = _react["default"].createElement;
|
|
23
|
-
var DEFAULT_CLASS = "app-dialog modal-dialog";
|
|
23
|
+
var DEFAULT_CLASS = "app-dialog modal-dialog dialog-view";
|
|
24
24
|
var WmIframeDialog = function WmIframeDialog(props) {
|
|
25
25
|
var _props$closable = props.closable,
|
|
26
26
|
closable = _props$closable === void 0 ? true : _props$closable,
|
|
@@ -45,6 +45,10 @@ var WmIframeDialog = function WmIframeDialog(props) {
|
|
|
45
45
|
_props$encodeurl = props.encodeurl,
|
|
46
46
|
encodeurl = _props$encodeurl === void 0 ? false : _props$encodeurl,
|
|
47
47
|
hint = props.hint,
|
|
48
|
+
_props$width = props.width,
|
|
49
|
+
width = _props$width === void 0 ? "100%" : _props$width,
|
|
50
|
+
_props$height = props.height,
|
|
51
|
+
height = _props$height === void 0 ? "400px" : _props$height,
|
|
48
52
|
onClose = props.onClose,
|
|
49
53
|
onOk = props.onOk;
|
|
50
54
|
var handleClose = (0, _react.useCallback)(function (event) {
|
|
@@ -70,7 +74,9 @@ var WmIframeDialog = function WmIframeDialog(props) {
|
|
|
70
74
|
"data-role": "iframe-dialog",
|
|
71
75
|
"aria-labelledby": "iframe-dialog-".concat(title),
|
|
72
76
|
"aria-describedby": "iframe-dialog-".concat(title, "-description")
|
|
73
|
-
}), __jsx(
|
|
77
|
+
}), __jsx("div", {
|
|
78
|
+
className: "app-alert-dialog app-dialog modal-dialog"
|
|
79
|
+
}, __jsx(_dialogContent.WmDialogContent, {
|
|
74
80
|
name: "",
|
|
75
81
|
listener: {}
|
|
76
82
|
}, showheader && __jsx(_dialogHeader.WmDialogHeader, {
|
|
@@ -95,8 +101,8 @@ var WmIframeDialog = function WmIframeDialog(props) {
|
|
|
95
101
|
listener: {},
|
|
96
102
|
iframesrc: url,
|
|
97
103
|
encodeurl: encodeurl,
|
|
98
|
-
width:
|
|
99
|
-
height:
|
|
104
|
+
width: width,
|
|
105
|
+
height: height,
|
|
100
106
|
hint: hint
|
|
101
107
|
})), showactions && __jsx(_dialogActions.WmDialogFooter, {
|
|
102
108
|
name: "",
|
|
@@ -108,7 +114,7 @@ var WmIframeDialog = function WmIframeDialog(props) {
|
|
|
108
114
|
className: "btn-primary ok-action",
|
|
109
115
|
name: "",
|
|
110
116
|
listener: {}
|
|
111
|
-
}))));
|
|
117
|
+
})))));
|
|
112
118
|
};
|
|
113
119
|
WmIframeDialog.displayName = "WmIframeDialog";
|
|
114
120
|
var _default = exports["default"] = (0, _withDialogWrapper["default"])((0, _withBaseWrapper.withBaseWrapper)(WmIframeDialog));
|
|
@@ -53,6 +53,7 @@ var WmDialog = exports.WmDialog = /*#__PURE__*/(0, _react.memo)(function (props)
|
|
|
53
53
|
_props$modal = props.modal,
|
|
54
54
|
modal = _props$modal === void 0 ? false : _props$modal,
|
|
55
55
|
onTransitionEntered = props.onTransitionEntered;
|
|
56
|
+
useBodyScrollLock(open);
|
|
56
57
|
var transitionType = FadeTransition;
|
|
57
58
|
var pageRef = document.getElementsByClassName("app-page")[0] || null;
|
|
58
59
|
var handleClose = function handleClose(event, reason) {
|
|
@@ -69,7 +70,6 @@ var WmDialog = exports.WmDialog = /*#__PURE__*/(0, _react.memo)(function (props)
|
|
|
69
70
|
if (!open) {
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
72
|
-
useBodyScrollLock(open);
|
|
73
73
|
var sheetPositionStyles = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.sheetposition === "top" && {
|
|
74
74
|
position: "absolute",
|
|
75
75
|
top: 0
|
|
@@ -26,7 +26,7 @@ var __jsx = _react["default"].createElement;
|
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
28
|
// Constants
|
|
29
|
-
var DEFAULT_CLASS = "app-dialog modal-dialog app-login-dialog";
|
|
29
|
+
var DEFAULT_CLASS = "app-dialog modal-dialog app-login-dialog dialog-view";
|
|
30
30
|
var FORM_SETUP_TIMEOUT = 100;
|
|
31
31
|
var WmLoginDialog = function WmLoginDialog(props) {
|
|
32
32
|
var _listener$Widgets;
|
|
@@ -17,7 +17,7 @@ var _button = require("@wavemaker/react-runtime/components/form/button");
|
|
|
17
17
|
var _dialogActions = require("@wavemaker/react-runtime/components/dialogs/dialog-actions");
|
|
18
18
|
var _partialContainer = _interopRequireDefault(require("@wavemaker/react-runtime/components/page/partial-container"));
|
|
19
19
|
var __jsx = _react["default"].createElement;
|
|
20
|
-
var DEFAULT_CLASS = "app-dialog modal-dialog app-page-dialog";
|
|
20
|
+
var DEFAULT_CLASS = "app-dialog modal-dialog app-page-dialog dialog-view";
|
|
21
21
|
var WmPageDialog = function WmPageDialog(props) {
|
|
22
22
|
var _props$showactions = props.showactions,
|
|
23
23
|
showactions = _props$showactions === void 0 ? true : _props$showactions,
|