oa-componentbook 1.0.1-stage.441 → 1.0.1-stage.442
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 +46 -31
- package/build/components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter.js +66 -84
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +8 -4
- package/build/dev/oa-widget-document-side-drawer/styles.js +1 -1
- package/build/dev/oa-widget-document-viewer-with-details/DocumentViewerWithDetails.js +8 -7
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
15
15
|
/**
|
|
16
16
|
* Styled container for the details panel
|
|
17
17
|
*/
|
|
18
|
-
const PanelContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: #fff;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n\n .panel-title {\n margin: 0 0 24px 0;\n }\n\n .section-header {\n background: var(--color-
|
|
18
|
+
const PanelContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: var(--color-background, #fff);\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n\n .panel-title {\n margin: 0 0 24px 0;\n }\n\n .table-container {\n border: 1px solid var(--color-border, #e8e8e8);\n border-radius: 4px;\n overflow: hidden;\n margin-bottom: 24px;\n }\n\n .section-header {\n background: var(--color-background-secondary, #f5f5f5);\n padding: 12px 16px;\n margin: 0;\n border-bottom: 1px solid var(--color-border, #e8e8e8);\n }\n\n .details-table {\n width: 100%;\n margin: 0;\n border-collapse: collapse;\n background: var(--color-background, #fff);\n }\n\n .details-row {\n border-bottom: 1px solid var(--color-border-light, #f0f0f0);\n }\n\n .details-row:last-child {\n border-bottom: none;\n }\n\n .details-label {\n width: 140px;\n min-width: 140px;\n padding: 16px;\n padding-right: 16px;\n text-align: left;\n vertical-align: top;\n }\n\n .details-value {\n padding: 16px;\n word-break: break-word;\n font-weight: 500;\n vertical-align: top;\n }\n\n .details-actions {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 16px;\n margin-top: 0;\n padding-top: 0;\n border-top: none;\n }\n\n .details-actions button {\n padding: 0;\n }\n\n .children-container {\n margin-top: 24px;\n }\n"])));
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* DocumentDetailsPanel Component
|
|
@@ -66,39 +66,53 @@ function DocumentDetailsPanel(_ref) {
|
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
67
67
|
typography: "type-t2-700",
|
|
68
68
|
color: "primary-content"
|
|
69
|
-
}, title)), sectionTitle && /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
}, title)), (sectionTitle || details && details.length > 0) && /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "table-container"
|
|
71
|
+
}, sectionTitle && /*#__PURE__*/_react.default.createElement("div", {
|
|
70
72
|
className: "section-header"
|
|
71
73
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
72
74
|
typography: "type-sl1-700",
|
|
73
75
|
color: "secondary-content"
|
|
74
|
-
}, sectionTitle)), details && details.length > 0 && /*#__PURE__*/_react.default.createElement("
|
|
75
|
-
className: "details-table"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
}, sectionTitle)), details && details.length > 0 && /*#__PURE__*/_react.default.createElement("table", {
|
|
77
|
+
className: "details-table",
|
|
78
|
+
role: "table",
|
|
79
|
+
"aria-label": sectionTitle || 'Details'
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, details.map((detail, index) => {
|
|
81
|
+
const rowKey = detail.key || "detail-".concat(detail.label, "-").concat(index);
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
83
|
+
className: "details-row",
|
|
84
|
+
key: rowKey
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("th", {
|
|
86
|
+
className: "details-label",
|
|
87
|
+
scope: "row"
|
|
88
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
89
|
+
typography: "type-b2-400",
|
|
90
|
+
color: "secondary-content"
|
|
91
|
+
}, detail.label)), /*#__PURE__*/_react.default.createElement("td", {
|
|
92
|
+
className: "details-value"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
94
|
+
typography: "type-b2-400",
|
|
95
|
+
color: "primary-content"
|
|
96
|
+
}, detail.value)));
|
|
97
|
+
})))), actions && actions.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: "details-actions",
|
|
99
|
+
role: "group",
|
|
100
|
+
"aria-label": "Document actions"
|
|
101
|
+
}, actions.map((action, index) => {
|
|
102
|
+
const actionKey = action.key || "action-".concat(action.label, "-").concat(index);
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
104
|
+
key: actionKey,
|
|
105
|
+
label: action.label,
|
|
106
|
+
onClick: action.onClick,
|
|
107
|
+
type: "text-only",
|
|
108
|
+
size: "medium",
|
|
109
|
+
"aria-label": action.ariaLabel || action.label,
|
|
110
|
+
iconConfig: {
|
|
111
|
+
icon: action.icon || null,
|
|
112
|
+
position: 'left'
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
})), children && /*#__PURE__*/_react.default.createElement("div", {
|
|
102
116
|
className: "children-container"
|
|
103
117
|
}, children));
|
|
104
118
|
}
|
|
@@ -118,7 +132,8 @@ DocumentDetailsPanel.propTypes = {
|
|
|
118
132
|
key: _propTypes.default.string,
|
|
119
133
|
label: _propTypes.default.string.isRequired,
|
|
120
134
|
onClick: _propTypes.default.func,
|
|
121
|
-
icon: _propTypes.default.node
|
|
135
|
+
icon: _propTypes.default.node,
|
|
136
|
+
ariaLabel: _propTypes.default.string
|
|
122
137
|
})),
|
|
123
138
|
/** Additional content to render below the details */
|
|
124
139
|
children: _propTypes.default.node,
|
package/build/components/oa-component-table-with-search-and-filter/TableWithSearchAndFilter.js
CHANGED
|
@@ -8,9 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
-
require("core-js/modules/es.array.includes.js");
|
|
12
|
-
require("core-js/modules/es.string.includes.js");
|
|
13
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
14
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
12
|
var _Search = _interopRequireDefault(require("@material-ui/icons/Search"));
|
|
16
13
|
var _FilterList = _interopRequireDefault(require("@material-ui/icons/FilterList"));
|
|
@@ -83,8 +80,6 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
83
80
|
const {
|
|
84
81
|
show: showSearch = true,
|
|
85
82
|
placeholder: searchPlaceholder = 'Search...',
|
|
86
|
-
debounceDelay = 500,
|
|
87
|
-
searchKeys = [],
|
|
88
83
|
onSearch
|
|
89
84
|
} = searchProps;
|
|
90
85
|
|
|
@@ -111,42 +106,15 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
111
106
|
onShowSizeChange
|
|
112
107
|
} = paginationProps;
|
|
113
108
|
|
|
109
|
+
// Constants
|
|
110
|
+
const SEARCH_INPUT_WIDTH = '350px';
|
|
111
|
+
|
|
114
112
|
// Search state
|
|
115
113
|
const [searchValue, setSearchValue] = (0, _react.useState)('');
|
|
116
|
-
const [filteredData, setFilteredData] = (0, _react.useState)(dataSource);
|
|
117
|
-
const timerRef = (0, _react.useRef)(null);
|
|
118
114
|
|
|
119
115
|
// Filter drawer state
|
|
120
116
|
const [isFilterDrawerVisible, setIsFilterDrawerVisible] = (0, _react.useState)(false);
|
|
121
117
|
const [filterValues, setFilterValues] = (0, _react.useState)({});
|
|
122
|
-
const [appliedFilters, setAppliedFilters] = (0, _react.useState)({});
|
|
123
|
-
|
|
124
|
-
// Client-side filtering function
|
|
125
|
-
const applyFiltersAndSearch = (data, search, filters) => {
|
|
126
|
-
let result = [...data];
|
|
127
|
-
if (search && searchKeys.length > 0) {
|
|
128
|
-
const searchLower = search.toLowerCase();
|
|
129
|
-
result = result.filter(item => searchKeys.some(key => {
|
|
130
|
-
var _item$key;
|
|
131
|
-
return (_item$key = item[key]) === null || _item$key === void 0 ? void 0 : _item$key.toString().toLowerCase().includes(searchLower);
|
|
132
|
-
}));
|
|
133
|
-
}
|
|
134
|
-
Object.entries(filters).forEach(_ref2 => {
|
|
135
|
-
let [key, value] = _ref2;
|
|
136
|
-
if (value) {
|
|
137
|
-
result = result.filter(item => {
|
|
138
|
-
var _item$key2;
|
|
139
|
-
return ((_item$key2 = item[key]) === null || _item$key2 === void 0 ? void 0 : _item$key2.toString().toLowerCase()) === value.toString().toLowerCase();
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
setFilteredData(result);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// Sync filtered data when dataSource changes
|
|
147
|
-
(0, _react.useEffect)(() => {
|
|
148
|
-
applyFiltersAndSearch(dataSource, searchValue, appliedFilters);
|
|
149
|
-
}, [dataSource]);
|
|
150
118
|
|
|
151
119
|
// Search handlers
|
|
152
120
|
const handleSearchChange = e => {
|
|
@@ -154,75 +122,87 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
154
122
|
value
|
|
155
123
|
} = e.target;
|
|
156
124
|
setSearchValue(value);
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
if (debounceDelay === 0) {
|
|
161
|
-
if (onSearch) {
|
|
162
|
-
onSearch(value);
|
|
163
|
-
} else {
|
|
164
|
-
applyFiltersAndSearch(dataSource, value, appliedFilters);
|
|
165
|
-
}
|
|
166
|
-
return;
|
|
125
|
+
if (onSearch) {
|
|
126
|
+
onSearch(value);
|
|
167
127
|
}
|
|
168
|
-
timerRef.current = setTimeout(() => {
|
|
169
|
-
if (onSearch) {
|
|
170
|
-
onSearch(value);
|
|
171
|
-
} else {
|
|
172
|
-
applyFiltersAndSearch(dataSource, value, appliedFilters);
|
|
173
|
-
}
|
|
174
|
-
}, debounceDelay);
|
|
175
128
|
};
|
|
176
129
|
const handleSearchPressEnter = () => {
|
|
177
|
-
if (timerRef.current) {
|
|
178
|
-
clearTimeout(timerRef.current);
|
|
179
|
-
}
|
|
180
130
|
if (onSearch) {
|
|
181
131
|
onSearch(searchValue);
|
|
182
|
-
} else {
|
|
183
|
-
applyFiltersAndSearch(dataSource, searchValue, appliedFilters);
|
|
184
132
|
}
|
|
185
133
|
};
|
|
186
|
-
(0, _react.useEffect)(() => () => {
|
|
187
|
-
if (timerRef.current) {
|
|
188
|
-
clearTimeout(timerRef.current);
|
|
189
|
-
}
|
|
190
|
-
}, []);
|
|
191
134
|
|
|
192
135
|
// Filter handlers
|
|
193
136
|
const handleOpenFilterDrawer = () => setIsFilterDrawerVisible(true);
|
|
194
137
|
const handleCloseFilterDrawer = () => setIsFilterDrawerVisible(false);
|
|
195
138
|
const handleFilterChange = function handleFilterChange(key, value) {
|
|
196
139
|
let action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'change';
|
|
140
|
+
// Normalize empty values: convert empty string to null for consistency
|
|
141
|
+
const normalizedValue = value === '' ? null : value;
|
|
197
142
|
const updatedFilters = _objectSpread(_objectSpread({}, filterValues), {}, {
|
|
198
|
-
[key]:
|
|
143
|
+
[key]: normalizedValue
|
|
199
144
|
});
|
|
200
145
|
setFilterValues(updatedFilters);
|
|
201
146
|
|
|
202
147
|
// Call onChange callback if provided for real-time filter changes
|
|
203
148
|
if (onFilterChange) {
|
|
204
|
-
onFilterChange(key,
|
|
149
|
+
onFilterChange(key, normalizedValue, updatedFilters, action);
|
|
205
150
|
}
|
|
206
151
|
};
|
|
207
152
|
const handleApplyFilters = () => {
|
|
208
|
-
setAppliedFilters(_objectSpread({}, filterValues));
|
|
209
153
|
setIsFilterDrawerVisible(false);
|
|
210
154
|
if (onFiltersApply) {
|
|
211
155
|
onFiltersApply(filterValues);
|
|
212
|
-
} else {
|
|
213
|
-
applyFiltersAndSearch(dataSource, searchValue, filterValues);
|
|
214
156
|
}
|
|
215
157
|
};
|
|
216
158
|
const handleClearFilters = () => {
|
|
217
159
|
setFilterValues({});
|
|
218
|
-
setAppliedFilters({});
|
|
219
160
|
if (onFiltersClear) {
|
|
220
161
|
onFiltersClear();
|
|
221
|
-
} else {
|
|
222
|
-
applyFiltersAndSearch(dataSource, searchValue, {});
|
|
223
162
|
}
|
|
224
163
|
};
|
|
225
164
|
|
|
165
|
+
// Memoized required keys calculation for better performance
|
|
166
|
+
const requiredKeys = (0, _react.useMemo)(() => {
|
|
167
|
+
const keys = [];
|
|
168
|
+
filterConfig.forEach(filter => {
|
|
169
|
+
const {
|
|
170
|
+
type,
|
|
171
|
+
key,
|
|
172
|
+
required,
|
|
173
|
+
fields = []
|
|
174
|
+
} = filter;
|
|
175
|
+
if (required) {
|
|
176
|
+
if (type === 'dateRange' || type === 'group') {
|
|
177
|
+
fields.forEach(field => {
|
|
178
|
+
keys.push(field.key);
|
|
179
|
+
});
|
|
180
|
+
} else {
|
|
181
|
+
keys.push(key);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
return keys;
|
|
186
|
+
}, [filterConfig]);
|
|
187
|
+
|
|
188
|
+
// Memoized check if all required fields are filled
|
|
189
|
+
const areAllRequiredFieldsFilled = (0, _react.useMemo)(() => requiredKeys.every(requiredKey => {
|
|
190
|
+
const value = filterValues[requiredKey];
|
|
191
|
+
// Check if value exists and is not empty/null/undefined
|
|
192
|
+
return value !== undefined && value !== null && value !== '';
|
|
193
|
+
}), [requiredKeys, filterValues]);
|
|
194
|
+
|
|
195
|
+
// Helper function to determine notFoundContent message
|
|
196
|
+
const getNotFoundContent = (isApiCallInProgress, query) => {
|
|
197
|
+
if (!isApiCallInProgress && (query === null || query === void 0 ? void 0 : query.length) < 3) {
|
|
198
|
+
return 'Start Typing atleast 3 characters';
|
|
199
|
+
}
|
|
200
|
+
if (isApiCallInProgress && (query === null || query === void 0 ? void 0 : query.length) > 0) {
|
|
201
|
+
return 'Loading...';
|
|
202
|
+
}
|
|
203
|
+
return 'No data found';
|
|
204
|
+
};
|
|
205
|
+
|
|
226
206
|
// Helper function to render CustomSelect (DRY principle)
|
|
227
207
|
const renderSelect = (fieldKey, fieldConfig) => {
|
|
228
208
|
const {
|
|
@@ -230,22 +210,27 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
230
210
|
options = [],
|
|
231
211
|
loading = false,
|
|
232
212
|
isApiCallInProgress = false,
|
|
213
|
+
searchValue: query = '',
|
|
233
214
|
showSearch: fieldShowSearch = false,
|
|
234
215
|
filterOption,
|
|
235
216
|
disabled = false
|
|
236
217
|
} = fieldConfig;
|
|
237
218
|
const fieldValue = filterValues[fieldKey];
|
|
238
219
|
const isLoading = filtersLoading || loading || isApiCallInProgress;
|
|
220
|
+
const notFoundContent = getNotFoundContent(isApiCallInProgress, query);
|
|
239
221
|
return /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
240
222
|
placeholder: placeholder || 'Select an option',
|
|
241
223
|
value: fieldValue || undefined,
|
|
242
224
|
options: options,
|
|
243
225
|
onSelectionChange: val => {
|
|
244
|
-
//
|
|
226
|
+
// Normalize: null/undefined means clear action
|
|
245
227
|
const action = val === null || val === undefined ? 'clear' : 'select';
|
|
246
228
|
handleFilterChange(fieldKey, val, action);
|
|
247
229
|
},
|
|
248
|
-
onSearch: searchText =>
|
|
230
|
+
onSearch: searchText => {
|
|
231
|
+
// For search, pass the search text as-is (don't normalize to null)
|
|
232
|
+
handleFilterChange(fieldKey, searchText || null, 'search');
|
|
233
|
+
},
|
|
249
234
|
onChange: val => {
|
|
250
235
|
// Catch clear from Ant Design's onChange (passes through {...props})
|
|
251
236
|
if (val === undefined || val === null) {
|
|
@@ -256,8 +241,8 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
256
241
|
loading: isLoading,
|
|
257
242
|
showSearch: fieldShowSearch,
|
|
258
243
|
filterOption: filterOption,
|
|
259
|
-
disabled: disabled
|
|
260
|
-
|
|
244
|
+
disabled: disabled,
|
|
245
|
+
notFoundContent: notFoundContent
|
|
261
246
|
});
|
|
262
247
|
};
|
|
263
248
|
|
|
@@ -307,16 +292,16 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
307
292
|
case 'dateRange':
|
|
308
293
|
return /*#__PURE__*/_react.default.createElement(_styles.DateRangeContainer, null, fields.map(field => /*#__PURE__*/_react.default.createElement(_styles.FilterSubField, {
|
|
309
294
|
key: field.key
|
|
310
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.FilterSubLabel, null, field.label
|
|
295
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.FilterSubLabel, null, field.label), renderDatePicker(field.key, field))));
|
|
311
296
|
case 'group':
|
|
312
297
|
return /*#__PURE__*/_react.default.createElement(_styles.FilterGroup, null, fields.map(field => /*#__PURE__*/_react.default.createElement(_styles.FilterSubField, {
|
|
313
298
|
key: field.key
|
|
314
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.FilterSubLabel, null, field.label
|
|
299
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.FilterSubLabel, null, field.label), field.type === 'select' && renderSelect(field.key, field), field.type === 'date' && renderDatePicker(field.key, field), field.type === 'radio' && renderRadioGroup(field.key, field))));
|
|
315
300
|
default:
|
|
316
301
|
return null;
|
|
317
302
|
}
|
|
318
303
|
};
|
|
319
|
-
const displayData =
|
|
304
|
+
const displayData = dataSource;
|
|
320
305
|
const totalRecords = total !== null && total !== void 0 ? total : displayData.length;
|
|
321
306
|
return /*#__PURE__*/_react.default.createElement(_styles.TableWithSearchAndFilterContainer, {
|
|
322
307
|
className: className
|
|
@@ -334,7 +319,7 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
334
319
|
onPressEnter: handleSearchPressEnter,
|
|
335
320
|
allowClear: true,
|
|
336
321
|
style: {
|
|
337
|
-
width:
|
|
322
|
+
width: SEARCH_INPUT_WIDTH,
|
|
338
323
|
flexShrink: 0
|
|
339
324
|
}
|
|
340
325
|
}), showFilters && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
@@ -368,7 +353,8 @@ function TableWithSearchAndFilter(_ref) {
|
|
|
368
353
|
label: "Apply Filter",
|
|
369
354
|
onClick: handleApplyFilters,
|
|
370
355
|
type: "primary",
|
|
371
|
-
size: "medium"
|
|
356
|
+
size: "medium",
|
|
357
|
+
disabled: !areAllRequiredFieldsFilled
|
|
372
358
|
})))), /*#__PURE__*/_react.default.createElement(_CustomTable.default, _extends({
|
|
373
359
|
rowKey: rowKey,
|
|
374
360
|
dataSource: displayData,
|
|
@@ -396,8 +382,6 @@ TableWithSearchAndFilter.propTypes = {
|
|
|
396
382
|
searchProps: _propTypes.default.shape({
|
|
397
383
|
show: _propTypes.default.bool,
|
|
398
384
|
placeholder: _propTypes.default.string,
|
|
399
|
-
debounceDelay: _propTypes.default.number,
|
|
400
|
-
searchKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
401
385
|
onSearch: _propTypes.default.func
|
|
402
386
|
}),
|
|
403
387
|
filterProps: _propTypes.default.shape({
|
|
@@ -429,9 +413,7 @@ TableWithSearchAndFilter.defaultProps = {
|
|
|
429
413
|
},
|
|
430
414
|
searchProps: {
|
|
431
415
|
show: true,
|
|
432
|
-
placeholder: 'Search...'
|
|
433
|
-
debounceDelay: 500,
|
|
434
|
-
searchKeys: []
|
|
416
|
+
placeholder: 'Search...'
|
|
435
417
|
},
|
|
436
418
|
filterProps: {
|
|
437
419
|
show: true,
|
|
@@ -19,7 +19,7 @@ var _MaterialIcon = _interopRequireDefault(require("../../components/oa-componen
|
|
|
19
19
|
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
20
20
|
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
21
21
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
22
|
-
const _excluded = ["title", "handleCloseDrawer", "documentConfig", "drawerWidth", "drawerButtonConfig", "drawerTagConfig", "onlyDocumentView"];
|
|
22
|
+
const _excluded = ["title", "handleCloseDrawer", "documentConfig", "drawerWidth", "drawerButtonConfig", "drawerTagConfig", "onlyDocumentView", "containerClassName"];
|
|
23
23
|
/* eslint-disable */
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -50,7 +50,8 @@ function DocumentSideDrawer(_ref) {
|
|
|
50
50
|
drawerWidth,
|
|
51
51
|
drawerButtonConfig,
|
|
52
52
|
drawerTagConfig,
|
|
53
|
-
onlyDocumentView
|
|
53
|
+
onlyDocumentView,
|
|
54
|
+
containerClassName
|
|
54
55
|
} = _ref,
|
|
55
56
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
56
57
|
// Calculate the drawer width based on documentConfig or fallback to 480
|
|
@@ -139,7 +140,9 @@ function DocumentSideDrawer(_ref) {
|
|
|
139
140
|
width: calculatedWidth,
|
|
140
141
|
onClose: handleCloseDrawer,
|
|
141
142
|
title: title
|
|
142
|
-
}, props), /*#__PURE__*/_react.default.createElement(_styles.default,
|
|
143
|
+
}, props), /*#__PURE__*/_react.default.createElement(_styles.default, {
|
|
144
|
+
className: containerClassName
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
143
146
|
className: "viewerContainer"
|
|
144
147
|
}, renderDocumentViewer(), !onlyDocumentView && /*#__PURE__*/_react.default.createElement("div", {
|
|
145
148
|
className: "rightContSection"
|
|
@@ -180,7 +183,8 @@ DocumentSideDrawer.propTypes = {
|
|
|
180
183
|
drawerWidth: _propTypes.default.string,
|
|
181
184
|
drawerButtonConfig: _propTypes.default.object,
|
|
182
185
|
drawerTagConfig: _propTypes.default.object,
|
|
183
|
-
onlyDocumentView: _propTypes.default.bool
|
|
186
|
+
onlyDocumentView: _propTypes.default.bool,
|
|
187
|
+
containerClassName: _propTypes.default.string
|
|
184
188
|
};
|
|
185
189
|
|
|
186
190
|
// Default props to provide fallback values for optional props
|
|
@@ -8,5 +8,5 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const ViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-tabs-nav{\n margin: 0;\n}\n .ant-tabs-top>.ant-tabs-nav::before {\n border: none;\n border-right: 1px solid #E0E0E0;\n }\n .ant-tabs-content-holder .customDocumentViewerOverlayHeader{\n bottom: 60px;\n }\n .ant-tabs-tab{\n border-radius: 0px !important;\n border: none !important;\n border-bottom: 2px solid transparent !important;\n }\n .ant-tabs-tab-active{\n border-bottom: 2px solid var(--color-primary) !important;\n }\n .viewerContainer > div {\n flex: 1;\n box-sizing: border-box;\n }\n .viewerContainer {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n }\n .rightContSection {\n display: flex;\n flex-direction: column;\n padding: 24px;\n min-width: 300px;\n max-width: 450px;\n overflow-x: visible;\n }\n .grayBoxSec {\n border-radius: 8px;\n background: #f6f6f6;\n padding: 12px 16px;\n }\n .statusSec {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .statusSec button {\n margin-left: 8px;\n }\n"])));
|
|
11
|
+
const ViewerContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-tabs-nav{\n margin: 0;\n}\n .ant-tabs-top>.ant-tabs-nav::before {\n border: none;\n border-right: 1px solid #E0E0E0;\n }\n .ant-tabs-content-holder .customDocumentViewerOverlayHeader{\n bottom: 60px;\n }\n .ant-tabs-tab{\n border-radius: 0px !important;\n border: none !important;\n border-bottom: 2px solid transparent !important;\n }\n .ant-tabs-tab-active{\n border-bottom: 2px solid var(--color-primary) !important;\n }\n .viewerContainer > div {\n flex: 1;\n box-sizing: border-box;\n }\n .viewerContainer {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n }\n .rightContSection {\n display: flex;\n flex-direction: column;\n padding: 24px;\n min-width: 300px;\n max-width: 450px;\n overflow-x: visible;\n }\n /* Styles specific to DocumentViewerWithDetails */\n &.documentViewerWithDetails {\n .viewerContainer > div:first-child {\n flex: 1;\n box-sizing: border-box;\n min-width: 0;\n }\n .rightContSection {\n flex: 0 0 auto;\n width: fit-content;\n min-width: auto;\n max-width: none;\n }\n }\n .grayBoxSec {\n border-radius: 8px;\n background: #f6f6f6;\n padding: 12px 16px;\n }\n .statusSec {\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n .statusSec button {\n margin-left: 8px;\n }\n"])));
|
|
12
12
|
var _default = exports.default = ViewerContainer;
|
|
@@ -10,19 +10,18 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _DocumentSideDrawer = _interopRequireDefault(require("../oa-widget-document-side-drawer/DocumentSideDrawer"));
|
|
11
11
|
var _DocumentDetailsPanel = _interopRequireDefault(require("../../components/oa-component-document-details-panel/DocumentDetailsPanel"));
|
|
12
12
|
const _excluded = ["title", "onClose", "drawerWidth", "fileUrl", "fileType", "documentConfig", "detailsTitle", "sectionTitle", "details", "actions", "children"];
|
|
13
|
-
/* eslint-disable */
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
17
|
/**
|
|
19
18
|
* DocumentViewerWithDetails Component
|
|
20
|
-
*
|
|
19
|
+
*
|
|
21
20
|
* A split-view component that displays a document viewer on the left
|
|
22
21
|
* and a details panel with actions on the right.
|
|
23
|
-
*
|
|
22
|
+
*
|
|
24
23
|
* Uses DocumentSideDrawer and DocumentDetailsPanel internally.
|
|
25
|
-
*
|
|
24
|
+
*
|
|
26
25
|
* @example
|
|
27
26
|
* <DocumentViewerWithDetails
|
|
28
27
|
* title="VIEW DOCUMENT"
|
|
@@ -68,7 +67,8 @@ function DocumentViewerWithDetails(_ref) {
|
|
|
68
67
|
title: title,
|
|
69
68
|
handleCloseDrawer: onClose,
|
|
70
69
|
documentConfig: finalDocumentConfig,
|
|
71
|
-
drawerWidth: drawerWidth
|
|
70
|
+
drawerWidth: drawerWidth,
|
|
71
|
+
containerClassName: "documentViewerWithDetails"
|
|
72
72
|
}, restProps), /*#__PURE__*/_react.default.createElement(_DocumentDetailsPanel.default, {
|
|
73
73
|
title: detailsTitle,
|
|
74
74
|
sectionTitle: sectionTitle,
|
|
@@ -80,7 +80,7 @@ DocumentViewerWithDetails.propTypes = {
|
|
|
80
80
|
/** Drawer title displayed in the header */
|
|
81
81
|
title: _propTypes.default.string,
|
|
82
82
|
/** Callback function when drawer is closed */
|
|
83
|
-
onClose: _propTypes.default.func
|
|
83
|
+
onClose: _propTypes.default.func,
|
|
84
84
|
/** Custom drawer width (default: 1200) */
|
|
85
85
|
drawerWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
86
86
|
/** URL of the document to display */
|
|
@@ -109,7 +109,8 @@ DocumentViewerWithDetails.propTypes = {
|
|
|
109
109
|
};
|
|
110
110
|
DocumentViewerWithDetails.defaultProps = {
|
|
111
111
|
title: null,
|
|
112
|
-
|
|
112
|
+
onClose: () => {},
|
|
113
|
+
drawerWidth: '1200',
|
|
113
114
|
fileUrl: null,
|
|
114
115
|
fileType: null,
|
|
115
116
|
documentConfig: null,
|