oa-componentbook 0.18.341 → 0.18.342
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-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +0 -1
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-select/CustomSelect.js +0 -1
- package/build/components/oa-component-table/CustomTableV1.js +121 -86
- package/build/components/oa-component-tag/CustomTag.js +1 -1
- package/build/components/oa-component-tag/styles.js +8 -1
- package/build/index.js +7 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +555 -74
- package/build/layout/GenricLayOut/components/AppliedFilters.js +100 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +56 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +41 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +142 -8
- package/build/layout/GenricLayOut/styles.js +2 -2
- package/build/widgets/oa-form-widget/FormWidget.js +88 -15
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +7 -2
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +3 -1
- package/package.json +1 -1
|
@@ -9,4 +9,4 @@ 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
11
|
var _default = exports.default = {};
|
|
12
|
-
const StyleContainer = exports.StyleContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-checkbox-wrapper .ant-checkbox {\n align-self: start;\n margin: 2px 0 0 0
|
|
12
|
+
const StyleContainer = exports.StyleContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-checkbox-wrapper .ant-checkbox {\n align-self: start;\n margin: 2px 0 0 0; \n}\n"])));
|
|
@@ -42,7 +42,6 @@ function CustomDatePicker(_ref) {
|
|
|
42
42
|
disabledDateFunction
|
|
43
43
|
} = _ref,
|
|
44
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
-
console.log(disabledDateFunction, "dosabled");
|
|
46
45
|
return /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
47
46
|
theme: {
|
|
48
47
|
components: {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorVariablesMap"));
|
|
12
|
+
var _TypographiesMap = _interopRequireDefault(require("../../global-css/TypographiesMap"));
|
|
13
|
+
var _styles = require("./styles");
|
|
14
|
+
const _excluded = ["current", "total", "pageSize", "onChange", "onShowSizeChange", "pageSizeOptions", "showSizeChanger", "showQuickJumper", "showTotal", "size", "style"];
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
/**
|
|
20
|
+
* @description A custom wrapper for Ant Design Pagination component with consistent theming.
|
|
21
|
+
* @param {number} current - The current page number (1-based).
|
|
22
|
+
* @param {number} total - The total number of items.
|
|
23
|
+
* @param {number} pageSize - The number of items per page.
|
|
24
|
+
* @param {function} onChange - Callback function when page changes.
|
|
25
|
+
* @param {function} onShowSizeChange - Callback function when page size changes.
|
|
26
|
+
* @param {array} pageSizeOptions - Array of page size options.
|
|
27
|
+
* @param {boolean} showSizeChanger - Whether to show the page size selector.
|
|
28
|
+
* @param {boolean} showQuickJumper - Whether to show the quick jumper input.
|
|
29
|
+
* @param {boolean} showTotal - Whether to show the total items count.
|
|
30
|
+
* @param {string} size - The size of the pagination component.
|
|
31
|
+
* @param {object} style - Custom styles for the component.
|
|
32
|
+
* @param {object} antDesignProps - Additional props to pass to Ant Design Pagination.
|
|
33
|
+
* @returns {JSX.Element} The rendered pagination component.
|
|
34
|
+
*/
|
|
35
|
+
function CustomPagination(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
current = 1,
|
|
38
|
+
total = 0,
|
|
39
|
+
pageSize = 10,
|
|
40
|
+
onChange,
|
|
41
|
+
onShowSizeChange,
|
|
42
|
+
pageSizeOptions = [10, 20, 50, 100],
|
|
43
|
+
showSizeChanger = true,
|
|
44
|
+
showQuickJumper = false,
|
|
45
|
+
showTotal = true,
|
|
46
|
+
size = 'default',
|
|
47
|
+
style
|
|
48
|
+
} = _ref,
|
|
49
|
+
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
const renderTotal = (totalItems, range) => {
|
|
51
|
+
if (!showTotal) return null;
|
|
52
|
+
return "Showing ".concat(range[0], "-").concat(range[1], " of ").concat(totalItems, " items");
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_styles.MainContainer, {
|
|
55
|
+
style: style
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
57
|
+
theme: {
|
|
58
|
+
components: {
|
|
59
|
+
Pagination: {}
|
|
60
|
+
},
|
|
61
|
+
token: {
|
|
62
|
+
colorPrimary: '#014FC5',
|
|
63
|
+
colorPrimaryBorder: '#014FC5',
|
|
64
|
+
colorPrimaryHover: '#82A9E2',
|
|
65
|
+
colorText: '#212121',
|
|
66
|
+
colorTextDisabled: '#BFBFBF',
|
|
67
|
+
colorTextPlaceholder: '#959595',
|
|
68
|
+
borderRadius: 2,
|
|
69
|
+
colorBorder: '#E0E0E0'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Pagination, _extends({
|
|
73
|
+
current: current,
|
|
74
|
+
total: total,
|
|
75
|
+
pageSize: pageSize,
|
|
76
|
+
onChange: onChange,
|
|
77
|
+
onShowSizeChange: onShowSizeChange,
|
|
78
|
+
showSizeChanger: showSizeChanger,
|
|
79
|
+
showQuickJumper: showQuickJumper,
|
|
80
|
+
showTotal: renderTotal,
|
|
81
|
+
pageSizeOptions: pageSizeOptions,
|
|
82
|
+
size: size
|
|
83
|
+
}, antDesignProps))));
|
|
84
|
+
}
|
|
85
|
+
CustomPagination.propTypes = {
|
|
86
|
+
current: _propTypes.default.number,
|
|
87
|
+
total: _propTypes.default.number,
|
|
88
|
+
pageSize: _propTypes.default.number,
|
|
89
|
+
onChange: _propTypes.default.func,
|
|
90
|
+
onShowSizeChange: _propTypes.default.func,
|
|
91
|
+
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
92
|
+
showSizeChanger: _propTypes.default.bool,
|
|
93
|
+
showQuickJumper: _propTypes.default.bool,
|
|
94
|
+
showTotal: _propTypes.default.bool,
|
|
95
|
+
size: _propTypes.default.oneOf(['default', 'small']),
|
|
96
|
+
style: _propTypes.default.object
|
|
97
|
+
};
|
|
98
|
+
CustomPagination.defaultProps = {
|
|
99
|
+
current: 1,
|
|
100
|
+
total: 0,
|
|
101
|
+
pageSize: 10,
|
|
102
|
+
onChange: undefined,
|
|
103
|
+
onShowSizeChange: undefined,
|
|
104
|
+
pageSizeOptions: [10, 20, 50, 100],
|
|
105
|
+
showSizeChanger: true,
|
|
106
|
+
showQuickJumper: false,
|
|
107
|
+
showTotal: true,
|
|
108
|
+
size: 'default',
|
|
109
|
+
style: undefined
|
|
110
|
+
};
|
|
111
|
+
var _default = exports.default = CustomPagination;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.MainContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const MainContainer = exports.MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-pagination-item {\n border: 1px solid #E0E0E0;\n }\n .ant-pagination-item-active {\n border: 1px solid #014FC5;\n }\n .mobile-pagination{margin: 0;padding:0;}\n .ant-pagination-total-text,.ant-pagination-options{display: none;}\n"])));
|
|
12
|
+
var _default = exports.default = {};
|
|
@@ -86,7 +86,6 @@ function CustomSelect(_ref) {
|
|
|
86
86
|
} = _ref,
|
|
87
87
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
88
88
|
// If allText is present in default values, we select all the options manually.
|
|
89
|
-
console.log(options, "options");
|
|
90
89
|
const actualDefaultValue = mode === "multiple" ? [...defaultValue] : defaultValue;
|
|
91
90
|
if (mode === "multiple" && allText && defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(allText)) {
|
|
92
91
|
var _options$filter$map, _options$filter;
|
|
@@ -67,7 +67,8 @@ function CustomTableV1(_ref) {
|
|
|
67
67
|
const [cardShow, setCardShow] = (0, _react.useState)(false);
|
|
68
68
|
const threshold = 10;
|
|
69
69
|
function getByPath(obj, path) {
|
|
70
|
-
|
|
70
|
+
var _path$split;
|
|
71
|
+
return path === null || path === void 0 || (_path$split = path.split(".")) === null || _path$split === void 0 ? void 0 : _path$split.reduce((acc, part) => acc === null || acc === void 0 ? void 0 : acc[part], obj);
|
|
71
72
|
}
|
|
72
73
|
// Determine card view on initial load if on mobile
|
|
73
74
|
(0, _react.useEffect)(() => {
|
|
@@ -84,6 +85,7 @@ function CustomTableV1(_ref) {
|
|
|
84
85
|
return isSelected;
|
|
85
86
|
};
|
|
86
87
|
|
|
88
|
+
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
87
89
|
// Process columns: wrap titles in Typography, handle jsxConfig and custom renderers
|
|
88
90
|
const finalColumns = (0, _react.useMemo)(() => {
|
|
89
91
|
// Process each column while preserving the original order
|
|
@@ -101,108 +103,136 @@ function CustomTableV1(_ref) {
|
|
|
101
103
|
typography: "type-sl1-700"
|
|
102
104
|
}, title) : title;
|
|
103
105
|
|
|
104
|
-
// Handle jsxConfig for columns
|
|
106
|
+
// Handle jsxConfig for columns - now supports array
|
|
105
107
|
if (jsxConfig) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
108
|
+
var _jsxConfigs$;
|
|
109
|
+
// Check if jsxConfig is an array or single object
|
|
110
|
+
const jsxConfigs = Array.isArray(jsxConfig) ? jsxConfig : [jsxConfig];
|
|
111
|
+
|
|
112
|
+
// Determine position from first config or default
|
|
113
|
+
const position = ((_jsxConfigs$ = jsxConfigs[0]) === null || _jsxConfigs$ === void 0 ? void 0 : _jsxConfigs$.position) || "end";
|
|
114
|
+
|
|
115
|
+
// Check if any config has customRenderers type
|
|
116
|
+
const hasCustomRenderers = jsxConfigs.some(config => config && config.type === "customRenderers");
|
|
117
|
+
let ctaRender = (_, record) => /*#__PURE__*/_react.default.createElement("div", {
|
|
118
|
+
style: {
|
|
119
|
+
display: "flex",
|
|
120
|
+
gap: "8px",
|
|
121
|
+
alignItems: "center"
|
|
122
|
+
}
|
|
123
|
+
}, jsxConfigs.map((config, index) => {
|
|
124
|
+
var _config$options, _record$config$styleK;
|
|
125
|
+
// Add safety check for undefined config
|
|
126
|
+
if (!config) return null;
|
|
127
|
+
const {
|
|
128
|
+
type,
|
|
129
|
+
subType,
|
|
130
|
+
label,
|
|
131
|
+
onClickHandler,
|
|
132
|
+
options,
|
|
133
|
+
disabled = false,
|
|
134
|
+
icon
|
|
135
|
+
} = config;
|
|
136
|
+
|
|
137
|
+
// Handle different CTA types
|
|
138
|
+
switch (type) {
|
|
139
|
+
case "icon":
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
141
|
+
key: index,
|
|
142
|
+
size: 24,
|
|
143
|
+
icon: icon,
|
|
144
|
+
color: "secondary-content",
|
|
145
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config)
|
|
146
|
+
});
|
|
147
|
+
case "customRenderers":
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
key: index
|
|
150
|
+
}, (config === null || config === void 0 ? void 0 : config.mainLink) && /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
151
|
+
role: "button",
|
|
152
|
+
onClick: () => {
|
|
153
|
+
!isRowSelected(record) && customTableChange(record, config.mainLink);
|
|
154
|
+
},
|
|
155
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config.mainLink),
|
|
156
|
+
label: label || _,
|
|
157
|
+
type: "text-only",
|
|
158
|
+
disabled: disabled || isRowSelected(record)
|
|
159
|
+
}), config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.map((option, idx) => {
|
|
130
160
|
var _record$option$styleK, _record$option$styleK2;
|
|
131
|
-
return /*#__PURE__*/_react.default.createElement("div",
|
|
161
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
key: idx
|
|
163
|
+
}, (option === null || option === void 0 ? void 0 : option.type) === "button" ? /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
132
164
|
type: (option === null || option === void 0 ? void 0 : option.subType) || "primary",
|
|
133
|
-
label: (option === null || option === void 0 ? void 0 : option.label) ||
|
|
134
|
-
onClick: () => customTableChange(record,
|
|
165
|
+
label: (option === null || option === void 0 ? void 0 : option.label) || _,
|
|
166
|
+
onClick: () => customTableChange(record, config)
|
|
167
|
+
}) : (option === null || option === void 0 ? void 0 : option.type) === "tag" ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
168
|
+
label: getByPath(record, option === null || option === void 0 ? void 0 : option.key) || "",
|
|
169
|
+
type: (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
|
|
170
|
+
visible: true
|
|
135
171
|
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
136
172
|
typography: (option === null || option === void 0 ? void 0 : option.typography) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK === void 0 ? void 0 : _record$option$styleK.typography) || "type-b2-400",
|
|
137
173
|
color: (option === null || option === void 0 ? void 0 : option.color) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK2 = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK2 === void 0 ? void 0 : _record$option$styleK2.color)
|
|
138
174
|
}, getByPath(record, option === null || option === void 0 ? void 0 : option.key)));
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
break;
|
|
142
|
-
case "tag":
|
|
143
|
-
ctaRender = (_, record) => {
|
|
175
|
+
}));
|
|
176
|
+
case "tag":
|
|
144
177
|
const tagType = typeof subType === "function" ? subType(_, record) : subType;
|
|
145
178
|
return /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
179
|
+
key: index,
|
|
146
180
|
label: label || _,
|
|
147
181
|
type: tagType,
|
|
148
182
|
visible: true
|
|
149
183
|
});
|
|
150
|
-
|
|
151
|
-
break;
|
|
152
|
-
case "link":
|
|
153
|
-
ctaRender = (_, record) => /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
154
|
-
role: "button",
|
|
155
|
-
onClick: () => {
|
|
156
|
-
!isRowSelected(record) && customTableChange(record, jsxConfig);
|
|
157
|
-
},
|
|
158
|
-
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, jsxConfig),
|
|
159
|
-
label: label || _,
|
|
160
|
-
type: "text-only",
|
|
161
|
-
disabled: disabled || isRowSelected(record)
|
|
162
|
-
});
|
|
163
|
-
break;
|
|
164
|
-
case "button":
|
|
165
|
-
ctaRender = (_, record) => {
|
|
166
|
-
var _record$jsxConfig$sty;
|
|
184
|
+
case "link":
|
|
167
185
|
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
186
|
+
key: index,
|
|
187
|
+
role: "button",
|
|
188
|
+
onClick: () => {
|
|
189
|
+
!isRowSelected(record) && customTableChange(record, config);
|
|
190
|
+
},
|
|
191
|
+
onKeyDown: e => !isRowSelected(record) && (e.key === "Enter" || e.key === " ") && customTableChange(record, config),
|
|
192
|
+
label: label || _,
|
|
193
|
+
type: "text-only",
|
|
194
|
+
disabled: disabled || isRowSelected(record)
|
|
195
|
+
});
|
|
196
|
+
case "button":
|
|
197
|
+
return /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
198
|
+
key: index,
|
|
168
199
|
type: subType || "primary",
|
|
169
200
|
label: label || _,
|
|
170
|
-
onClick: () => !isRowSelected(record) && customTableChange(record,
|
|
171
|
-
disabled: disabled || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$
|
|
201
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config),
|
|
202
|
+
disabled: disabled || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$config$styleK = record[config === null || config === void 0 ? void 0 : config.styleKey]) === null || _record$config$styleK === void 0 ? void 0 : _record$config$styleK.disabled) || isRowSelected(record)
|
|
172
203
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
onChange: val => !isRowSelected(record) && onClickHandler(record, val, setConfig),
|
|
179
|
-
disabled: isRowSelected(record)
|
|
180
|
-
});
|
|
181
|
-
break;
|
|
182
|
-
case "popover":
|
|
183
|
-
ctaRender = (_, record) => /*#__PURE__*/_react.default.createElement(_CustomDropdown.default, {
|
|
184
|
-
type: "primary",
|
|
185
|
-
disabled: isRowSelected(record),
|
|
186
|
-
items: options.map(opt => ({
|
|
187
|
-
label: opt.label,
|
|
188
|
-
key: opt.key,
|
|
189
|
-
danger: opt.danger || false,
|
|
190
|
-
onClick: () => !isRowSelected(record) && customTableChange(record, jsxConfig, opt.key),
|
|
204
|
+
case "dropdown":
|
|
205
|
+
return /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
206
|
+
key: index,
|
|
207
|
+
options: options,
|
|
208
|
+
onChange: val => !isRowSelected(record) && onClickHandler(record, val, setConfig),
|
|
191
209
|
disabled: isRowSelected(record)
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
});
|
|
211
|
+
case "popover":
|
|
212
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDropdown.default, {
|
|
213
|
+
key: index,
|
|
214
|
+
type: "primary",
|
|
215
|
+
disabled: isRowSelected(record),
|
|
216
|
+
items: options.map(opt => ({
|
|
217
|
+
label: opt.label,
|
|
218
|
+
key: opt.key,
|
|
219
|
+
danger: opt.danger || false,
|
|
220
|
+
onClick: () => !isRowSelected(record) && customTableChange(record, config, opt.key),
|
|
221
|
+
disabled: isRowSelected(record)
|
|
222
|
+
}))
|
|
223
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
224
|
+
size: 24,
|
|
225
|
+
icon: _MoreVert.default,
|
|
226
|
+
color: isRowSelected(record) ? "disabled" : "secondary-content"
|
|
227
|
+
}));
|
|
228
|
+
default:
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}));
|
|
202
232
|
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
203
233
|
dataIndex,
|
|
204
234
|
title: titleNode,
|
|
205
|
-
isCTA:
|
|
235
|
+
isCTA: !hasCustomRenderers,
|
|
206
236
|
position,
|
|
207
237
|
render: ctaRender
|
|
208
238
|
});
|
|
@@ -403,10 +433,15 @@ function CustomTableV1(_ref) {
|
|
|
403
433
|
})), ctaColumnsSorted.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
404
434
|
className: "footerCta"
|
|
405
435
|
}, ctaColumnsSorted.filter((col, index) => {
|
|
406
|
-
if (index === 0) return false;
|
|
407
|
-
return col.isCTA;
|
|
408
|
-
}).map(col => /*#__PURE__*/_react.default.createElement(
|
|
409
|
-
key: col.key || col.dataIndex
|
|
436
|
+
if (index === 0) return false;
|
|
437
|
+
return col.isCTA;
|
|
438
|
+
}).map(col => /*#__PURE__*/_react.default.createElement("div", {
|
|
439
|
+
key: col.key || col.dataIndex,
|
|
440
|
+
style: {
|
|
441
|
+
display: "flex",
|
|
442
|
+
gap: "8px",
|
|
443
|
+
flexWrap: "wrap"
|
|
444
|
+
}
|
|
410
445
|
}, getContentToBeRender(col, row)))));
|
|
411
446
|
})), cardShow && dataSource && (pagination === null || pagination === void 0 ? void 0 : pagination.showPaginationOnMobile) && /*#__PURE__*/_react.default.createElement("div", {
|
|
412
447
|
className: "fullWidthBtn"
|
|
@@ -43,7 +43,7 @@ function CustomTag(_ref) {
|
|
|
43
43
|
CustomTag.propTypes = {
|
|
44
44
|
'data-test': _propTypes.default.string,
|
|
45
45
|
label: _propTypes.default.string.isRequired,
|
|
46
|
-
type: _propTypes.default.oneOf(['success', 'pending', 'failed', 'recommended']),
|
|
46
|
+
type: _propTypes.default.oneOf(['success', 'pending', 'failed', 'recommended', 'primary']),
|
|
47
47
|
visible: _propTypes.default.bool,
|
|
48
48
|
bgColor: _propTypes.default.string,
|
|
49
49
|
borderColor: _propTypes.default.string,
|
|
@@ -22,6 +22,13 @@ const getColorStyles = props => {
|
|
|
22
22
|
textColor: 'var(--color-positive)'
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
if (type === 'primary') {
|
|
26
|
+
return {
|
|
27
|
+
backgroundColor: 'var(--color-divider)',
|
|
28
|
+
borderColor: 'var(--color-placeholder-text)',
|
|
29
|
+
textColor: 'var(--color-primary-content)'
|
|
30
|
+
};
|
|
31
|
+
}
|
|
25
32
|
if (type === 'pending') {
|
|
26
33
|
return {
|
|
27
34
|
backgroundColor: 'var(--color-background-warning)',
|
|
@@ -58,4 +65,4 @@ const getColorStyles = props => {
|
|
|
58
65
|
};
|
|
59
66
|
var _default = exports.default = {};
|
|
60
67
|
const StyledTag = exports.StyledTag = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n padding: 1px 12px;\n\n color: ", ";\n\n background-color: ", ";\n\n border: 1px solid ", ";\n border-radius: 4px;\n\n visibility: ", ";\n"])), props => getColorStyles(props).textColor, props => getColorStyles(props).backgroundColor, props => getColorStyles(props).borderColor, props => props.visible ? 'visible' : 'hidden');
|
|
61
|
-
const CenteredTextContainer = exports.CenteredTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
68
|
+
const CenteredTextContainer = exports.CenteredTextContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex; white-space: nowrap;\n"])));
|
package/build/index.js
CHANGED
|
@@ -197,6 +197,12 @@ Object.defineProperty(exports, "CustomNotification", {
|
|
|
197
197
|
return _CustomNotification.default;
|
|
198
198
|
}
|
|
199
199
|
});
|
|
200
|
+
Object.defineProperty(exports, "CustomPagination", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function get() {
|
|
203
|
+
return _CustomPagination.default;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
200
206
|
Object.defineProperty(exports, "CustomPinPatternCaptureWidget", {
|
|
201
207
|
enumerable: true,
|
|
202
208
|
get: function get() {
|
|
@@ -646,6 +652,7 @@ var _CustomInputNumber = _interopRequireDefault(require("./components/oa-compone
|
|
|
646
652
|
var _CustomLoader = _interopRequireDefault(require("./components/oa-component-loader/CustomLoader"));
|
|
647
653
|
var _CustomModal = _interopRequireDefault(require("./components/oa-component-modal/CustomModal"));
|
|
648
654
|
var _CustomNotification = _interopRequireDefault(require("./components/oa-component-notification/CustomNotification"));
|
|
655
|
+
var _CustomPagination = _interopRequireDefault(require("./components/oa-component-pagination/CustomPagination"));
|
|
649
656
|
var _CustomUpload = _interopRequireDefault(require("./components/oa-component-upload/CustomUpload"));
|
|
650
657
|
var _CustomRadio = _interopRequireWildcard(require("./components/oa-component-radio/CustomRadio"));
|
|
651
658
|
var _CustomSelect = _interopRequireDefault(require("./components/oa-component-select/CustomSelect"));
|