oa-componentbook 1.0.1-stage.438 → 1.0.1-stage.439
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/build/components/oa-component-document-details-panel/DocumentDetailsPanel.js +139 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +4 -8
- package/build/components/oa-component-select/CustomSelect.js +1 -1
- package/build/components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter.js +450 -0
- package/build/components/oa-component-table-with-search-and-filter/styles.js +24 -0
- package/build/components/oa-component-textarea/CustomTextArea.js +8 -95
- package/build/components/oa-component-textarea/styles.js +3 -12
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +2 -2
- package/build/dev/oa-widget-document-side-drawer/styles.js +1 -1
- package/build/dev/oa-widget-document-viewer-with-details/DocumentViewerWithDetails.js +122 -0
- package/build/index.js +21 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +4 -145
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +1 -18
- package/build/widgets/oa-form-widget/FormWidget.js +1 -2
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +8 -58
- package/package.json +1 -1
- package/build/components/oa-component-textarea/constants.js +0 -39
|
@@ -5,12 +5,9 @@ require("core-js/modules/es.weak-map.js");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = UserManagementWidget;
|
|
9
9
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
10
|
require("core-js/modules/es.promise.js");
|
|
11
|
-
require("core-js/modules/es.regexp.constructor.js");
|
|
12
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
13
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
14
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
12
|
var _antd = require("antd");
|
|
16
13
|
var _EditOutlined = _interopRequireDefault(require("@material-ui/icons/EditOutlined"));
|
|
@@ -31,8 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
31
28
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
32
29
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
33
30
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
|
|
34
|
-
function
|
|
35
|
-
var _drawer$data, _activeDrawerData$mis;
|
|
31
|
+
function UserManagementWidget(_ref) {
|
|
36
32
|
let {
|
|
37
33
|
form,
|
|
38
34
|
fieldName = "users",
|
|
@@ -43,8 +39,7 @@ function _default(_ref) {
|
|
|
43
39
|
addUserClick,
|
|
44
40
|
deleteUserClick,
|
|
45
41
|
editUserClick,
|
|
46
|
-
misc
|
|
47
|
-
drawer
|
|
42
|
+
misc
|
|
48
43
|
} = _ref;
|
|
49
44
|
const finalFields = fields || [];
|
|
50
45
|
const [editingUserId, setEditingUserId] = (0, _react.useState)(null);
|
|
@@ -93,28 +88,6 @@ function _default(_ref) {
|
|
|
93
88
|
[fieldName]: defaultUsers
|
|
94
89
|
});
|
|
95
90
|
}, [initialData, fieldName, form]);
|
|
96
|
-
|
|
97
|
-
// Reset form state when drawer closes or opens to ensure fresh context
|
|
98
|
-
(0, _react.useEffect)(() => {
|
|
99
|
-
if (drawer && drawer.visible === false) {
|
|
100
|
-
// Reset adding/editing state when drawer closes
|
|
101
|
-
setAddingUser(false);
|
|
102
|
-
setEditingUserId(null);
|
|
103
|
-
setDeleteModalVisible(false);
|
|
104
|
-
setUserToDelete(null);
|
|
105
|
-
|
|
106
|
-
// Clear form fields
|
|
107
|
-
const clearData = {};
|
|
108
|
-
finalFields.forEach(field => {
|
|
109
|
-
clearData["".concat(fieldName, "_").concat(field.key)] = "";
|
|
110
|
-
});
|
|
111
|
-
form.setFieldsValue(clearData);
|
|
112
|
-
}
|
|
113
|
-
}, [drawer === null || drawer === void 0 ? void 0 : drawer.visible, form, fieldName, finalFields]);
|
|
114
|
-
|
|
115
|
-
// Access branchId dynamically from drawer data using active drawer key
|
|
116
|
-
const activeDrawerData = drawer === null || drawer === void 0 || (_drawer$data = drawer.data) === null || _drawer$data === void 0 ? void 0 : _drawer$data[drawer === null || drawer === void 0 ? void 0 : drawer.active];
|
|
117
|
-
const branchId = activeDrawerData === null || activeDrawerData === void 0 || (_activeDrawerData$mis = activeDrawerData.misc) === null || _activeDrawerData$mis === void 0 ? void 0 : _activeDrawerData$mis.branchId;
|
|
118
91
|
const handleEdit = user => {
|
|
119
92
|
setEditingUserId(user.id);
|
|
120
93
|
setAddingUser(false);
|
|
@@ -154,7 +127,7 @@ function _default(_ref) {
|
|
|
154
127
|
const {
|
|
155
128
|
error,
|
|
156
129
|
data
|
|
157
|
-
} = await editUserClick(editingUserId, userData
|
|
130
|
+
} = await editUserClick(editingUserId, userData);
|
|
158
131
|
if (error) {
|
|
159
132
|
showErrorNotification(error);
|
|
160
133
|
} else {
|
|
@@ -176,7 +149,7 @@ function _default(_ref) {
|
|
|
176
149
|
const {
|
|
177
150
|
error,
|
|
178
151
|
data
|
|
179
|
-
} = await addUserClick(userData, misc
|
|
152
|
+
} = await addUserClick(userData, misc);
|
|
180
153
|
if (error) {
|
|
181
154
|
showErrorNotification(error);
|
|
182
155
|
} else {
|
|
@@ -242,38 +215,15 @@ function _default(_ref) {
|
|
|
242
215
|
};
|
|
243
216
|
const canDelete = users.length > 1;
|
|
244
217
|
const isEditing = editingUserId !== null || addingUser;
|
|
245
|
-
|
|
246
|
-
// Process rules to handle checkValidator structure (similar to FormWidget)
|
|
247
|
-
const processRules = rules => {
|
|
248
|
-
if (!rules || !Array.isArray(rules)) {
|
|
249
|
-
return rules;
|
|
250
|
-
}
|
|
251
|
-
return rules.map(r => {
|
|
252
|
-
// If rule has checkValidator, extract the nested rule object
|
|
253
|
-
if (r !== null && r !== void 0 && r.checkValidator && r !== null && r !== void 0 && r.rule) {
|
|
254
|
-
let processedRule = _objectSpread({}, r.rule);
|
|
255
|
-
|
|
256
|
-
// Handle pattern conversion if it's a string
|
|
257
|
-
if (processedRule.pattern && typeof processedRule.pattern === "string") {
|
|
258
|
-
processedRule.pattern = new RegExp(processedRule.pattern);
|
|
259
|
-
}
|
|
260
|
-
return processedRule;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// Return rule as-is if it doesn't have checkValidator structure
|
|
264
|
-
return r;
|
|
265
|
-
});
|
|
266
|
-
};
|
|
267
218
|
const renderFormField = field => {
|
|
268
219
|
var _field$options;
|
|
269
220
|
const fieldNameWithPrefix = "".concat(fieldName, "_").concat(field.key);
|
|
270
|
-
const processedRules = processRules(field.rules);
|
|
271
221
|
switch (field.widget || field.type) {
|
|
272
222
|
case "input":
|
|
273
223
|
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
274
224
|
name: fieldNameWithPrefix,
|
|
275
225
|
label: field.label,
|
|
276
|
-
rules:
|
|
226
|
+
rules: field.rules,
|
|
277
227
|
style: {
|
|
278
228
|
marginBottom: 16
|
|
279
229
|
}
|
|
@@ -284,7 +234,7 @@ function _default(_ref) {
|
|
|
284
234
|
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
285
235
|
name: fieldNameWithPrefix,
|
|
286
236
|
label: field.label,
|
|
287
|
-
rules:
|
|
237
|
+
rules: field.rules,
|
|
288
238
|
style: {
|
|
289
239
|
marginBottom: 16
|
|
290
240
|
}
|
|
@@ -299,7 +249,7 @@ function _default(_ref) {
|
|
|
299
249
|
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
300
250
|
name: fieldNameWithPrefix,
|
|
301
251
|
label: field.label,
|
|
302
|
-
rules:
|
|
252
|
+
rules: field.rules,
|
|
303
253
|
style: {
|
|
304
254
|
marginBottom: 16
|
|
305
255
|
}
|
package/package.json
CHANGED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TEXTAREA_SHADOW = exports.TEXTAREA_BORDER_RADIUS = exports.SEND_ICON_SIZE = exports.GRADIENT_BORDER_COLORS = exports.DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_ROWS = exports.DEFAULT_MIN_ROWS = exports.DEFAULT_MAX_ROWS = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Constants for CustomTextArea component
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// Default values for textarea configuration
|
|
12
|
-
const DEFAULT_MIN_ROWS = exports.DEFAULT_MIN_ROWS = 1;
|
|
13
|
-
const DEFAULT_MAX_ROWS = exports.DEFAULT_MAX_ROWS = null; // null means unlimited growth
|
|
14
|
-
const DEFAULT_ROWS = exports.DEFAULT_ROWS = 2;
|
|
15
|
-
|
|
16
|
-
// Gradient border colors
|
|
17
|
-
const GRADIENT_BORDER_COLORS = exports.GRADIENT_BORDER_COLORS = {
|
|
18
|
-
top: '#0098FF',
|
|
19
|
-
// Blue
|
|
20
|
-
middle: '#9A6CFF',
|
|
21
|
-
// Purple
|
|
22
|
-
bottom: '#FB6252' // Coral/Orange-Red
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Shadow styles
|
|
26
|
-
const TEXTAREA_SHADOW = exports.TEXTAREA_SHADOW = '0px 2px 10px rgba(0, 0, 0, 0.14)';
|
|
27
|
-
|
|
28
|
-
// Border radius
|
|
29
|
-
const TEXTAREA_BORDER_RADIUS = exports.TEXTAREA_BORDER_RADIUS = '12px';
|
|
30
|
-
|
|
31
|
-
// Icon sizes
|
|
32
|
-
const SEND_ICON_SIZE = exports.SEND_ICON_SIZE = 24;
|
|
33
|
-
|
|
34
|
-
// Default send icon configuration
|
|
35
|
-
const DEFAULT_SEND_ICON_CONFIG = exports.DEFAULT_SEND_ICON_CONFIG = {
|
|
36
|
-
show: false,
|
|
37
|
-
// Hidden by default - only show when explicitly requested
|
|
38
|
-
disabled: false
|
|
39
|
-
};
|