@coorpacademy/components 11.13.3 → 11.13.4
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/es/atom/avatar/style.css +1 -1
- package/es/atom/button-link/index.d.ts +23 -24
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +10 -30
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +10 -1
- package/es/atom/button-link/types.d.ts +50 -0
- package/es/atom/button-link/types.d.ts.map +1 -0
- package/es/atom/button-link/types.js +25 -0
- package/es/atom/button-link/types.js.map +1 -0
- package/es/atom/button-link-icon-only/style.css +16 -1
- package/es/atom/button-menu/index.d.ts +14 -13
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +5 -13
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/types.d.ts +35 -0
- package/es/atom/button-menu/types.d.ts.map +1 -0
- package/es/atom/button-menu/types.js +14 -0
- package/es/atom/button-menu/types.js.map +1 -0
- package/es/atom/difficulty-level/style.css +1 -1
- package/es/atom/link/index.d.ts +1 -0
- package/es/atom/link/index.js +1 -0
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/status-item/style.css +3 -0
- package/es/molecule/brand-form-group/index.d.ts +0 -2
- package/es/molecule/bullet-point-menu-button/index.d.ts +20 -17
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/index.js +9 -11
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/bullet-point-menu-button/style.css +20 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts +31 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -0
- package/es/molecule/bullet-point-menu-button/types.js +13 -0
- package/es/molecule/bullet-point-menu-button/types.js.map +1 -0
- package/es/molecule/empty-state-dashboard/index.d.ts +1 -1
- package/es/molecule/empty-state-dashboard/index.d.ts.map +1 -1
- package/es/molecule/empty-state-dashboard/index.js +2 -2
- package/es/molecule/empty-state-dashboard/index.js.map +1 -1
- package/es/molecule/empty-state-dashboard/types.d.ts +8 -0
- package/es/molecule/empty-state-dashboard/types.d.ts.map +1 -1
- package/es/molecule/empty-state-dashboard/types.js.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +103 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -0
- package/es/molecule/expandible-actionable-table/index.js +193 -0
- package/es/molecule/expandible-actionable-table/index.js.map +1 -0
- package/es/molecule/expandible-actionable-table/style.css +134 -0
- package/es/molecule/expandible-actionable-table/types.d.ts +116 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -0
- package/es/molecule/expandible-actionable-table/types.js +33 -0
- package/es/molecule/expandible-actionable-table/types.js.map +1 -0
- package/es/molecule/uploading-file-progress/index.d.ts +1 -1
- package/es/molecule/uploading-file-progress/index.d.ts.map +1 -1
- package/es/molecule/uploading-file-progress/index.js.map +1 -1
- package/es/molecule/uploading-file-progress/types.d.ts +10 -1
- package/es/molecule/uploading-file-progress/types.d.ts.map +1 -1
- package/es/molecule/uploading-file-progress/types.js.map +1 -1
- package/es/organism/brand-form/index.d.ts +0 -2
- package/es/organism/list-items/index.d.ts +109 -6
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +44 -15
- package/es/organism/list-items/index.js.map +1 -1
- package/es/organism/setup-header/index.d.ts +0 -8
- package/es/organism/wizard-contents/index.d.ts +71 -2
- package/es/organism/wizard-contents/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.js +6 -0
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +0 -8
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +0 -8
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +288 -802
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +14 -2
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/dashboard-preview/index.d.ts +0 -8
- package/es/template/back-office/layout/index.d.ts +0 -8
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/atom/avatar/style.css +1 -1
- package/lib/atom/button-link/index.d.ts +23 -24
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +10 -32
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +10 -1
- package/lib/atom/button-link/types.d.ts +50 -0
- package/lib/atom/button-link/types.d.ts.map +1 -0
- package/lib/atom/button-link/types.js +36 -0
- package/lib/atom/button-link/types.js.map +1 -0
- package/lib/atom/button-link-icon-only/style.css +16 -1
- package/lib/atom/button-menu/index.d.ts +14 -13
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +6 -14
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/types.d.ts +35 -0
- package/lib/atom/button-menu/types.d.ts.map +1 -0
- package/lib/atom/button-menu/types.js +24 -0
- package/lib/atom/button-menu/types.js.map +1 -0
- package/lib/atom/difficulty-level/style.css +1 -1
- package/lib/atom/link/index.d.ts +1 -0
- package/lib/atom/link/index.js +1 -0
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/status-item/style.css +3 -0
- package/lib/molecule/brand-form-group/index.d.ts +0 -2
- package/lib/molecule/bullet-point-menu-button/index.d.ts +20 -17
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/index.js +10 -11
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/bullet-point-menu-button/style.css +20 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts +31 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -0
- package/lib/molecule/bullet-point-menu-button/types.js +23 -0
- package/lib/molecule/bullet-point-menu-button/types.js.map +1 -0
- package/lib/molecule/empty-state-dashboard/index.d.ts +1 -1
- package/lib/molecule/empty-state-dashboard/index.d.ts.map +1 -1
- package/lib/molecule/empty-state-dashboard/index.js +2 -2
- package/lib/molecule/empty-state-dashboard/index.js.map +1 -1
- package/lib/molecule/empty-state-dashboard/types.d.ts +8 -0
- package/lib/molecule/empty-state-dashboard/types.d.ts.map +1 -1
- package/lib/molecule/empty-state-dashboard/types.js.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +103 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -0
- package/lib/molecule/expandible-actionable-table/index.js +215 -0
- package/lib/molecule/expandible-actionable-table/index.js.map +1 -0
- package/lib/molecule/expandible-actionable-table/style.css +134 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts +116 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -0
- package/lib/molecule/expandible-actionable-table/types.js +47 -0
- package/lib/molecule/expandible-actionable-table/types.js.map +1 -0
- package/lib/molecule/uploading-file-progress/index.d.ts +1 -1
- package/lib/molecule/uploading-file-progress/index.d.ts.map +1 -1
- package/lib/molecule/uploading-file-progress/index.js.map +1 -1
- package/lib/molecule/uploading-file-progress/types.d.ts +10 -1
- package/lib/molecule/uploading-file-progress/types.d.ts.map +1 -1
- package/lib/molecule/uploading-file-progress/types.js.map +1 -1
- package/lib/organism/brand-form/index.d.ts +0 -2
- package/lib/organism/list-items/index.d.ts +109 -6
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +45 -15
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/organism/setup-header/index.d.ts +0 -8
- package/lib/organism/wizard-contents/index.d.ts +71 -2
- package/lib/organism/wizard-contents/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.js +7 -0
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +0 -8
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +0 -8
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +288 -802
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +15 -2
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/dashboard-preview/index.d.ts +0 -8
- package/lib/template/back-office/layout/index.d.ts +0 -8
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/locales/en/global.json +2 -1
- package/package.json +3 -3
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebContextValues } from '../../atom/provider/web-context';
|
|
3
|
+
import { Props } from './types';
|
|
4
|
+
declare const ActionableExpandableErrorsTable: {
|
|
5
|
+
(props: Props, legacyContext: WebContextValues): JSX.Element;
|
|
6
|
+
contextTypes: {
|
|
7
|
+
skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
8
|
+
common: import("prop-types").Requireable<{
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
}>;
|
|
11
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
12
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
13
|
+
logo: import("prop-types").Requireable<any>;
|
|
14
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
15
|
+
login: import("prop-types").Requireable<any>;
|
|
16
|
+
}>>;
|
|
17
|
+
icons: import("prop-types").Requireable<{
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
}>;
|
|
20
|
+
mod: import("prop-types").Requireable<{
|
|
21
|
+
[x: string]: any;
|
|
22
|
+
}>;
|
|
23
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
24
|
+
texts: import("prop-types").Requireable<{
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
}>;
|
|
27
|
+
}>>;
|
|
28
|
+
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
29
|
+
};
|
|
30
|
+
propTypes: {
|
|
31
|
+
columns: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
32
|
+
title: import("prop-types").Validator<string>;
|
|
33
|
+
}> | null | undefined)[]>;
|
|
34
|
+
rows: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
35
|
+
fields: import("prop-types").Requireable<(NonNullable<string | import("prop-types").InferProps<{
|
|
36
|
+
type: import("prop-types").Requireable<string>;
|
|
37
|
+
current: import("prop-types").Requireable<boolean>;
|
|
38
|
+
icon: import("prop-types").Requireable<string>;
|
|
39
|
+
value: import("prop-types").Requireable<string>;
|
|
40
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
41
|
+
isRowExpandible: import("prop-types").Requireable<boolean>;
|
|
42
|
+
lastField: import("prop-types").Requireable<NonNullable<string | import("prop-types").InferProps<{
|
|
43
|
+
type: import("prop-types").Requireable<string>;
|
|
44
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
45
|
+
buttonAriaLabel: import("prop-types").Requireable<string>;
|
|
46
|
+
menuAriaLabel: import("prop-types").Requireable<string>;
|
|
47
|
+
buttons: import("prop-types").Validator<(import("prop-types").InferProps<{
|
|
48
|
+
'data-name': import("prop-types").Requireable<string>;
|
|
49
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
50
|
+
label: import("prop-types").Validator<string>;
|
|
51
|
+
onClick: import("prop-types").Validator<(...args: any[]) => any>;
|
|
52
|
+
type: import("prop-types").Requireable<string>;
|
|
53
|
+
}> | null | undefined)[]>;
|
|
54
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
55
|
+
menuButtonClassName: import("prop-types").Requireable<string>;
|
|
56
|
+
isBulkMenu: import("prop-types").Requireable<boolean>;
|
|
57
|
+
}> | null | undefined>>;
|
|
58
|
+
}> | null | undefined)[]>;
|
|
59
|
+
stickyFirstColumn: import("prop-types").Requireable<boolean>;
|
|
60
|
+
stickyLastColumn: import("prop-types").Requireable<boolean>;
|
|
61
|
+
columnWidth: import("prop-types").Requireable<string>;
|
|
62
|
+
ariaDescribedby: import("prop-types").Requireable<string>;
|
|
63
|
+
lastField: import("prop-types").Requireable<NonNullable<import("prop-types").InferProps<{
|
|
64
|
+
componentType: import("prop-types").Requireable<string>;
|
|
65
|
+
type: import("prop-types").Requireable<string>;
|
|
66
|
+
label: import("prop-types").Requireable<string>;
|
|
67
|
+
'aria-label': import("prop-types").Requireable<string>;
|
|
68
|
+
'data-name': import("prop-types").Requireable<string>;
|
|
69
|
+
'data-testid': import("prop-types").Requireable<string>;
|
|
70
|
+
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
71
|
+
position: import("prop-types").Requireable<string>;
|
|
72
|
+
type: import("prop-types").Requireable<string>;
|
|
73
|
+
}>>;
|
|
74
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
75
|
+
link: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
76
|
+
href: import("prop-types").Requireable<string>;
|
|
77
|
+
download: import("prop-types").Requireable<boolean>;
|
|
78
|
+
target: import("prop-types").Requireable<string>;
|
|
79
|
+
}>>;
|
|
80
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
81
|
+
className: import("prop-types").Requireable<string>;
|
|
82
|
+
customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{}>>;
|
|
83
|
+
}> | import("prop-types").InferProps<{
|
|
84
|
+
componentType: import("prop-types").Requireable<string>;
|
|
85
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
86
|
+
buttonAriaLabel: import("prop-types").Requireable<string>;
|
|
87
|
+
menuAriaLabel: import("prop-types").Requireable<string>;
|
|
88
|
+
buttons: import("prop-types").Validator<(import("prop-types").InferProps<{
|
|
89
|
+
'data-name': import("prop-types").Requireable<string>;
|
|
90
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
91
|
+
label: import("prop-types").Validator<string>;
|
|
92
|
+
onClick: import("prop-types").Validator<(...args: any[]) => any>;
|
|
93
|
+
type: import("prop-types").Requireable<string>;
|
|
94
|
+
}> | null | undefined)[]>;
|
|
95
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
96
|
+
menuButtonClassName: import("prop-types").Requireable<string>;
|
|
97
|
+
isBulkMenu: import("prop-types").Requireable<boolean>;
|
|
98
|
+
}> | null | undefined>>;
|
|
99
|
+
isNestedTable: import("prop-types").Requireable<boolean>;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export default ActionableExpandableErrorsTable;
|
|
103
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAMjE,OAAO,EAA2C,KAAK,EAAY,MAAM,SAAS,CAAC;AAiCnF,QAAA,MAAM,+BAA+B;YAAW,KAAK,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKrF,CAAC;AASF,eAAe,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _includes2 = _interopRequireDefault(require("lodash/fp/includes"));
|
|
7
|
+
|
|
8
|
+
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
9
|
+
|
|
10
|
+
var _isString2 = _interopRequireDefault(require("lodash/fp/isString"));
|
|
11
|
+
|
|
12
|
+
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
|
|
19
|
+
|
|
20
|
+
var _statusItem = _interopRequireDefault(require("../../atom/status-item"));
|
|
21
|
+
|
|
22
|
+
var _bulkProgressBar = _interopRequireDefault(require("../bulk-progress-bar"));
|
|
23
|
+
|
|
24
|
+
var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
25
|
+
|
|
26
|
+
var _bulletPointMenuButton = _interopRequireDefault(require("../bullet-point-menu-button"));
|
|
27
|
+
|
|
28
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
29
|
+
|
|
30
|
+
var _errorsTable = _interopRequireDefault(require("../errors-table"));
|
|
31
|
+
|
|
32
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
33
|
+
|
|
34
|
+
var _types = require("./types");
|
|
35
|
+
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
40
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
+
|
|
42
|
+
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); }
|
|
43
|
+
|
|
44
|
+
const buildField = field => {
|
|
45
|
+
if ((0, _isString2.default)(field)) return field;
|
|
46
|
+
const {
|
|
47
|
+
componentType
|
|
48
|
+
} = field;
|
|
49
|
+
|
|
50
|
+
switch (componentType) {
|
|
51
|
+
case 'status':
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_statusItem.default, field);
|
|
53
|
+
|
|
54
|
+
case 'progress-bar':
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_bulkProgressBar.default, field);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const buildLastField = lastField => {
|
|
60
|
+
const {
|
|
61
|
+
componentType
|
|
62
|
+
} = lastField;
|
|
63
|
+
|
|
64
|
+
switch (componentType) {
|
|
65
|
+
case 'menu':
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_bulletPointMenuButton.default, lastField);
|
|
67
|
+
|
|
68
|
+
case 'button-link':
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, lastField);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const buildNestedRow = row => {
|
|
74
|
+
const {
|
|
75
|
+
componentType
|
|
76
|
+
} = row;
|
|
77
|
+
|
|
78
|
+
switch (componentType) {
|
|
79
|
+
case 'errors-table':
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_errorsTable.default, row);
|
|
81
|
+
|
|
82
|
+
case 'expandible-errors-table':
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(ActionableExpandableErrorsTable, row);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const ActionableExpandableErrorsTable = (props, legacyContext) => {
|
|
88
|
+
const {
|
|
89
|
+
columns,
|
|
90
|
+
rows = [],
|
|
91
|
+
lastField,
|
|
92
|
+
stickyFirstColumn = false,
|
|
93
|
+
stickyLastColumn = false,
|
|
94
|
+
ariaDescribedby,
|
|
95
|
+
columnWidth = `${100 / (0, _size2.default)(columns)}%`,
|
|
96
|
+
isNestedTable = false
|
|
97
|
+
} = props;
|
|
98
|
+
const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
|
|
99
|
+
/**
|
|
100
|
+
* State variable to keep track of all the expanded rows
|
|
101
|
+
* By default, nothing expanded. Hence initialized with empty array.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
const [expandedRows, setExpandedRows] = (0, _react.useState)([]);
|
|
105
|
+
/**
|
|
106
|
+
* State variable to keep track which row is currently expanded.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
const [expandState, setExpandState] = (0, _react.useState)({});
|
|
110
|
+
/**
|
|
111
|
+
* This function gets called when show/hide link is clicked.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
const handleExpandRow = index => () => {
|
|
115
|
+
const isRowExpanded = (0, _includes2.default)(index, expandedRows);
|
|
116
|
+
/**
|
|
117
|
+
* If the row is expanded, we are here to hide it. Hence remove
|
|
118
|
+
* it from the state variable. Otherwise add to it.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
const newExpandedRows = isRowExpanded ? expandedRows.filter(id => id !== index) : expandedRows.concat(index);
|
|
122
|
+
setExpandedRows(newExpandedRows);
|
|
123
|
+
/**
|
|
124
|
+
* Create a new object to update the expanded state of all rows
|
|
125
|
+
* Use the newExpandedRows array to set the state of all rows that are currently expanded
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
const expandedState = {};
|
|
129
|
+
newExpandedRows.forEach(id => {
|
|
130
|
+
expandedState[id] = true;
|
|
131
|
+
});
|
|
132
|
+
setExpandState(expandedState);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const headerRow = columns.map((column, cIndex) => {
|
|
136
|
+
const {
|
|
137
|
+
title
|
|
138
|
+
} = column;
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement("th", {
|
|
140
|
+
className: cIndex === 0 ? (0, _classnames.default)(stickyFirstColumn ? _style.default.headerFirstSticky : _style.default.headerFirst, _style.default.header) : _style.default.header,
|
|
141
|
+
key: `${title}-${cIndex}`,
|
|
142
|
+
role: "columnheader"
|
|
143
|
+
}, title);
|
|
144
|
+
});
|
|
145
|
+
headerRow.push( /*#__PURE__*/_react.default.createElement("th", {
|
|
146
|
+
className: stickyLastColumn ? _style.default.headerLastSticky : _style.default.headerLast,
|
|
147
|
+
key: "action-header"
|
|
148
|
+
}));
|
|
149
|
+
const headerView = [...headerRow];
|
|
150
|
+
const bodyView = rows.map((row, index) => {
|
|
151
|
+
const {
|
|
152
|
+
fields,
|
|
153
|
+
isRowExpandible = false
|
|
154
|
+
} = row;
|
|
155
|
+
const bodyRow = fields.map((field, fIndex) => {
|
|
156
|
+
const cellContent = fIndex === 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
+
className: _style.default.columFirstWrapper
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
159
|
+
className: _style.default.expandButtonWrapper
|
|
160
|
+
}, isRowExpandible ? /*#__PURE__*/_react.default.createElement(_buttonLinkIconOnly.default, {
|
|
161
|
+
onClick: handleExpandRow(index),
|
|
162
|
+
"data-name": `arrowUp-button-${index}`,
|
|
163
|
+
icon: "down",
|
|
164
|
+
className: expandState[index] ? 'bulkArrowUp' : 'bulkArrowDown',
|
|
165
|
+
"aria-label": translate('bulk_import.show_errors')
|
|
166
|
+
}) : null), buildField(field)) : buildField(field);
|
|
167
|
+
return /*#__PURE__*/_react.default.createElement("td", {
|
|
168
|
+
className: fIndex === 0 ? (0, _classnames.default)(stickyFirstColumn ? _style.default.columnFirstSticky : _style.default.columnFirst, _style.default.col) : _style.default.col,
|
|
169
|
+
style: {
|
|
170
|
+
width: columnWidth
|
|
171
|
+
},
|
|
172
|
+
key: `${field}-${fIndex}`
|
|
173
|
+
}, cellContent);
|
|
174
|
+
});
|
|
175
|
+
bodyRow.push( /*#__PURE__*/_react.default.createElement("td", {
|
|
176
|
+
className: stickyLastColumn ? _style.default.columnLastSticky : _style.default.columnLast,
|
|
177
|
+
key: "actionHeader"
|
|
178
|
+
}, lastField ? /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
+
className: (0, _classnames.default)({
|
|
180
|
+
[_style.default.inspectButton]: (0, _get2.default)('className', lastField) === 'bulkInspectButton'
|
|
181
|
+
})
|
|
182
|
+
}, buildLastField(lastField)) : null));
|
|
183
|
+
const nestedRow = (0, _get2.default)('nestedRow', row);
|
|
184
|
+
const nestedRowCellule = nestedRow && expandedRows.includes(index) ? /*#__PURE__*/_react.default.createElement("tr", {
|
|
185
|
+
key: `line-${index}-error`
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement("td", {
|
|
187
|
+
className: _style.default.nestedRowCellule,
|
|
188
|
+
colSpan: fields.length + 2
|
|
189
|
+
}, buildNestedRow(nestedRow))) : null;
|
|
190
|
+
return nestedRowCellule ? [/*#__PURE__*/_react.default.createElement("tr", {
|
|
191
|
+
key: `line-${index}`
|
|
192
|
+
}, bodyRow), nestedRowCellule] : [/*#__PURE__*/_react.default.createElement("tr", {
|
|
193
|
+
key: `line-${index}`
|
|
194
|
+
}, bodyRow)];
|
|
195
|
+
});
|
|
196
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
197
|
+
className: _style.default.wrapper
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement("table", _extends({}, ariaDescribedby ? {
|
|
199
|
+
'aria-describedby': ariaDescribedby
|
|
200
|
+
} : {}, {
|
|
201
|
+
className: _style.default.table,
|
|
202
|
+
"data-name": "expandible-actionable-table"
|
|
203
|
+
}), /*#__PURE__*/_react.default.createElement("thead", {
|
|
204
|
+
className: isNestedTable ? _style.default.theadNested : _style.default.thead
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement("tr", null, headerView)), /*#__PURE__*/_react.default.createElement("tbody", null, bodyView)));
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
ActionableExpandableErrorsTable.contextTypes = {
|
|
209
|
+
skin: _provider.default.childContextTypes.skin,
|
|
210
|
+
translate: _provider.default.childContextTypes.translate
|
|
211
|
+
};
|
|
212
|
+
ActionableExpandableErrorsTable.propTypes = process.env.NODE_ENV !== "production" ? _types.propTypes : {};
|
|
213
|
+
var _default = ActionableExpandableErrorsTable;
|
|
214
|
+
exports.default = _default;
|
|
215
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildField","field","componentType","buildLastField","lastField","buildNestedRow","row","ActionableExpandableErrorsTable","props","legacyContext","columns","rows","stickyFirstColumn","stickyLastColumn","ariaDescribedby","columnWidth","isNestedTable","translate","GetTranslateFromContext","expandedRows","setExpandedRows","useState","expandState","setExpandState","handleExpandRow","index","isRowExpanded","newExpandedRows","filter","id","concat","expandedState","forEach","headerRow","map","column","cIndex","title","classnames","style","headerFirstSticky","headerFirst","header","push","headerLastSticky","headerLast","headerView","bodyView","fields","isRowExpandible","bodyRow","fIndex","cellContent","columFirstWrapper","expandButtonWrapper","columnFirstSticky","columnFirst","col","width","columnLastSticky","columnLast","inspectButton","nestedRow","nestedRowCellule","includes","length","wrapper","table","theadNested","thead","contextTypes","skin","Provider","childContextTypes","propTypes"],"sources":["../../../src/molecule/expandible-actionable-table/index.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport classnames from 'classnames';\nimport {get, isString, size, includes} from 'lodash/fp';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport StatusItem from '../../atom/status-item';\nimport BulkProgressBar from '../bulk-progress-bar';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport BulletPointMenuButton from '../bullet-point-menu-button';\nimport ButtonLink from '../../atom/button-link';\nimport ErrorsTable from '../errors-table';\nimport style from './style.css';\nimport {ExpandState, Field, LastField, NestedRow, Props, propTypes} from './types';\n\nconst buildField = (field: Field) => {\n if (isString(field)) return field;\n const {componentType} = field;\n switch (componentType) {\n case 'status':\n return <StatusItem {...field} />;\n case 'progress-bar':\n return <BulkProgressBar {...field} />;\n }\n};\n\nconst buildLastField = (lastField: LastField) => {\n const {componentType} = lastField;\n switch (componentType) {\n case 'menu':\n return <BulletPointMenuButton {...lastField} />;\n case 'button-link':\n return <ButtonLink {...lastField} />;\n }\n};\n\nconst buildNestedRow = (row: NestedRow) => {\n const {componentType} = row;\n switch (componentType) {\n case 'errors-table':\n return <ErrorsTable {...row} />;\n case 'expandible-errors-table':\n return <ActionableExpandableErrorsTable {...row} />;\n }\n};\n\nconst ActionableExpandableErrorsTable = (props: Props, legacyContext: WebContextValues) => {\n const {\n columns,\n rows = [],\n lastField,\n stickyFirstColumn = false,\n stickyLastColumn = false,\n ariaDescribedby,\n columnWidth = `${100 / size(columns)}%`,\n isNestedTable = false\n } = props;\n const translate = GetTranslateFromContext(legacyContext);\n\n /**\n * State variable to keep track of all the expanded rows\n * By default, nothing expanded. Hence initialized with empty array.\n */\n const [expandedRows, setExpandedRows] = useState<number[]>([]);\n\n /**\n * State variable to keep track which row is currently expanded.\n */\n const [expandState, setExpandState] = useState<ExpandState>({});\n\n /**\n * This function gets called when show/hide link is clicked.\n */\n const handleExpandRow = (index: number) => () => {\n const isRowExpanded = includes(index, expandedRows);\n\n /**\n * If the row is expanded, we are here to hide it. Hence remove\n * it from the state variable. Otherwise add to it.\n */\n const newExpandedRows = isRowExpanded\n ? expandedRows.filter(id => id !== index)\n : expandedRows.concat(index);\n\n setExpandedRows(newExpandedRows);\n\n /**\n * Create a new object to update the expanded state of all rows\n * Use the newExpandedRows array to set the state of all rows that are currently expanded\n */\n const expandedState: ExpandState = {};\n newExpandedRows.forEach(id => {\n expandedState[id] = true;\n });\n\n setExpandState(expandedState);\n };\n\n const headerRow = columns.map((column, cIndex) => {\n const {title} = column;\n return (\n <th\n className={\n cIndex === 0\n ? classnames(\n stickyFirstColumn ? style.headerFirstSticky : style.headerFirst,\n style.header\n )\n : style.header\n }\n key={`${title}-${cIndex}`}\n role=\"columnheader\"\n >\n {title}\n </th>\n );\n });\n\n headerRow.push(\n <th\n className={stickyLastColumn ? style.headerLastSticky : style.headerLast}\n key=\"action-header\"\n />\n );\n const headerView = [...headerRow];\n\n const bodyView = rows.map((row, index) => {\n const {fields, isRowExpandible = false} = row;\n const bodyRow = fields.map((field, fIndex) => {\n const cellContent =\n fIndex === 0 ? (\n <div className={style.columFirstWrapper}>\n <div className={style.expandButtonWrapper}>\n {isRowExpandible ? (\n <ButtonLinkIconOnly\n onClick={handleExpandRow(index)}\n data-name={`arrowUp-button-${index}`}\n icon=\"down\"\n className={expandState[index] ? 'bulkArrowUp' : 'bulkArrowDown'}\n aria-label={translate('bulk_import.show_errors')}\n />\n ) : null}\n </div>\n {buildField(field)}\n </div>\n ) : (\n buildField(field)\n );\n return (\n <td\n className={\n fIndex === 0\n ? classnames(\n stickyFirstColumn ? style.columnFirstSticky : style.columnFirst,\n style.col\n )\n : style.col\n }\n style={{width: columnWidth}}\n key={`${field}-${fIndex}`}\n >\n {cellContent}\n </td>\n );\n });\n\n bodyRow.push(\n <td\n className={stickyLastColumn ? style.columnLastSticky : style.columnLast}\n key=\"actionHeader\"\n >\n {lastField ? (\n <div\n className={classnames({\n [style.inspectButton]: get('className', lastField) === 'bulkInspectButton'\n })}\n >\n {buildLastField(lastField)}\n </div>\n ) : null}\n </td>\n );\n const nestedRow = get('nestedRow', row);\n const nestedRowCellule =\n nestedRow && expandedRows.includes(index) ? (\n <tr key={`line-${index}-error`}>\n <td className={style.nestedRowCellule} colSpan={fields.length + 2}>\n {buildNestedRow(nestedRow)}\n </td>\n </tr>\n ) : null;\n\n return nestedRowCellule\n ? [<tr key={`line-${index}`}>{bodyRow}</tr>, nestedRowCellule]\n : [<tr key={`line-${index}`}>{bodyRow}</tr>];\n });\n\n return (\n <div className={style.wrapper}>\n <table\n {...(ariaDescribedby ? {'aria-describedby': ariaDescribedby} : {})}\n className={style.table}\n data-name=\"expandible-actionable-table\"\n >\n <thead className={isNestedTable ? style.theadNested : style.thead}>\n <tr>{headerView}</tr>\n </thead>\n <tbody>{bodyView}</tbody>\n </table>\n </div>\n );\n};\n\nActionableExpandableErrorsTable.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nActionableExpandableErrorsTable.propTypes = propTypes;\n\nexport default ActionableExpandableErrorsTable;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,UAAU,GAAIC,KAAD,IAAkB;EACnC,IAAI,wBAASA,KAAT,CAAJ,EAAqB,OAAOA,KAAP;EACrB,MAAM;IAACC;EAAD,IAAkBD,KAAxB;;EACA,QAAQC,aAAR;IACE,KAAK,QAAL;MACE,oBAAO,6BAAC,mBAAD,EAAgBD,KAAhB,CAAP;;IACF,KAAK,cAAL;MACE,oBAAO,6BAAC,wBAAD,EAAqBA,KAArB,CAAP;EAJJ;AAMD,CATD;;AAWA,MAAME,cAAc,GAAIC,SAAD,IAA0B;EAC/C,MAAM;IAACF;EAAD,IAAkBE,SAAxB;;EACA,QAAQF,aAAR;IACE,KAAK,MAAL;MACE,oBAAO,6BAAC,8BAAD,EAA2BE,SAA3B,CAAP;;IACF,KAAK,aAAL;MACE,oBAAO,6BAAC,mBAAD,EAAgBA,SAAhB,CAAP;EAJJ;AAMD,CARD;;AAUA,MAAMC,cAAc,GAAIC,GAAD,IAAoB;EACzC,MAAM;IAACJ;EAAD,IAAkBI,GAAxB;;EACA,QAAQJ,aAAR;IACE,KAAK,cAAL;MACE,oBAAO,6BAAC,oBAAD,EAAiBI,GA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mB,GAEnB,cAAC;MAAI,GAAG,EAAG,QAAOtC,KAAM;IAAvB,GAA2ByB,OAA3B,CAAD,CAFJ;EAGD,CArEgB,CAAjB;EAuEA,oBACE;IAAK,SAAS,EAAEX,cAAA,CAAM2B;EAAtB,gBACE,mDACOpD,eAAe,GAAG;IAAC,oBAAoBA;EAArB,CAAH,GAA2C,EADjE;IAEE,SAAS,EAAEyB,cAAA,CAAM4B,KAFnB;IAGE,aAAU;EAHZ,iBAKE;IAAO,SAAS,EAAEnD,aAAa,GAAGuB,cAAA,CAAM6B,WAAT,GAAuB7B,cAAA,CAAM8B;EAA5D,gBACE,yCAAKvB,UAAL,CADF,CALF,eAQE,4CAAQC,QAAR,CARF,CADF,CADF;AAcD,CArKD;;AAuKAxC,+BAA+B,CAAC+D,YAAhC,GAA+C;EAC7CC,IAAI,EAAEC,iBAAA,CAASC,iBAAT,CAA2BF,IADY;EAE7CtD,SAAS,EAAEuD,iBAAA,CAASC,iBAAT,CAA2BxD;AAFO,CAA/C;AAKAV,+BAA+B,CAACmE,SAAhC,2CAA4CA,gBAA5C;eAEenE,+B"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value xtraLightGrey from colors;
|
|
3
|
+
@value cm_grey_400 from colors;
|
|
4
|
+
@value cm_grey_700 from colors;
|
|
5
|
+
@value cm_negative_red_200 from colors;
|
|
6
|
+
@value light from colors;
|
|
7
|
+
|
|
8
|
+
.wrapper {
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.table {
|
|
13
|
+
table-layout: fixed;
|
|
14
|
+
border: 1px solid light;
|
|
15
|
+
font-family: 'Gilroy';
|
|
16
|
+
font-style: normal;
|
|
17
|
+
border-spacing: 0;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
max-width: 1089px;
|
|
20
|
+
min-width: 1089px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.thead {
|
|
24
|
+
background-color: xtraLightGrey;
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
line-height: 24px;
|
|
28
|
+
color: cm_grey_400;
|
|
29
|
+
height: 56px;
|
|
30
|
+
text-align: left;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.theadNested {
|
|
34
|
+
background-color: xtraLightGrey;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
color: cm_grey_400;
|
|
39
|
+
height: 40px;
|
|
40
|
+
text-align: left;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.header {
|
|
44
|
+
width: 276px;
|
|
45
|
+
padding-left: 56px;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
background-color: xtraLightGrey;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.headerFirstSticky {
|
|
51
|
+
position: sticky;
|
|
52
|
+
left: 0;
|
|
53
|
+
background-color: xtraLightGrey;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.headerFirst {
|
|
57
|
+
background-color: xtraLightGrey;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.headerLastSticky {
|
|
61
|
+
position: sticky;
|
|
62
|
+
right: 0;
|
|
63
|
+
background-color: xtraLightGrey;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.headerLast {
|
|
67
|
+
background-color: xtraLightGrey;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.col {
|
|
71
|
+
text-align: left;
|
|
72
|
+
padding-top: 8px;
|
|
73
|
+
padding-bottom: 8px;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
line-height: 20px;
|
|
77
|
+
color: cm_grey_700;
|
|
78
|
+
border-top: 1px solid light;
|
|
79
|
+
padding-left: 56px;
|
|
80
|
+
max-width: 364px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.columnFirst {
|
|
84
|
+
padding-left: 16px;
|
|
85
|
+
background-color: white;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.columnFirst .columFirstWrapper,
|
|
89
|
+
.columnFirstSticky .columFirstWrapper {
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: start;
|
|
92
|
+
gap: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.columnFirst .columFirstWrapper .expandButtonWrapper,
|
|
96
|
+
.columnFirstSticky .columFirstWrapper .expandButtonWrapper {
|
|
97
|
+
min-width: 24px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.columnFirstSticky {
|
|
101
|
+
position: sticky;
|
|
102
|
+
left: 0;
|
|
103
|
+
padding-left: 16px;
|
|
104
|
+
background-color: white;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.columnLast {
|
|
108
|
+
text-align: left;
|
|
109
|
+
padding-top: 8px;
|
|
110
|
+
padding-bottom: 8px;
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
font-size: 14px;
|
|
113
|
+
line-height: 20px;
|
|
114
|
+
color: cm_grey_700;
|
|
115
|
+
border-top: 1px solid light;
|
|
116
|
+
display: flex;
|
|
117
|
+
justify-content: end;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.columnLastSticky {
|
|
121
|
+
composes: columnLast;
|
|
122
|
+
position: sticky;
|
|
123
|
+
right: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.inspectButton{
|
|
127
|
+
padding-right: 20px;
|
|
128
|
+
background-color: white;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.nestedRowCellule{
|
|
132
|
+
padding: 10px;
|
|
133
|
+
border-top: 1px solid light;
|
|
134
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { BulletPointMenuButtonProps } from '../bullet-point-menu-button/types';
|
|
3
|
+
import { ButtonLinkProps } from '../../atom/button-link/types';
|
|
4
|
+
import { StatusItemProps } from '../../atom/status-item/types';
|
|
5
|
+
import { Props as ErrorsTableProps } from '../errors-table/types';
|
|
6
|
+
import { Props as BulkProgressBarProps } from '../bulk-progress-bar/types';
|
|
7
|
+
export declare const propTypes: {
|
|
8
|
+
columns: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
9
|
+
title: PropTypes.Validator<string>;
|
|
10
|
+
}> | null | undefined)[]>;
|
|
11
|
+
rows: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
12
|
+
fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
|
|
13
|
+
type: PropTypes.Requireable<string>;
|
|
14
|
+
current: PropTypes.Requireable<boolean>;
|
|
15
|
+
icon: PropTypes.Requireable<string>;
|
|
16
|
+
value: PropTypes.Requireable<string>;
|
|
17
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
18
|
+
isRowExpandible: PropTypes.Requireable<boolean>;
|
|
19
|
+
lastField: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
20
|
+
type: PropTypes.Requireable<string>;
|
|
21
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
22
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
23
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
24
|
+
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
25
|
+
'data-name': PropTypes.Requireable<string>;
|
|
26
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
+
label: PropTypes.Validator<string>;
|
|
28
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
29
|
+
type: PropTypes.Requireable<string>;
|
|
30
|
+
}> | null | undefined)[]>;
|
|
31
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
menuButtonClassName: PropTypes.Requireable<string>;
|
|
33
|
+
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
34
|
+
}> | null | undefined>>;
|
|
35
|
+
}> | null | undefined)[]>;
|
|
36
|
+
stickyFirstColumn: PropTypes.Requireable<boolean>;
|
|
37
|
+
stickyLastColumn: PropTypes.Requireable<boolean>;
|
|
38
|
+
columnWidth: PropTypes.Requireable<string>;
|
|
39
|
+
ariaDescribedby: PropTypes.Requireable<string>;
|
|
40
|
+
lastField: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
41
|
+
componentType: PropTypes.Requireable<string>;
|
|
42
|
+
type: PropTypes.Requireable<string>;
|
|
43
|
+
label: PropTypes.Requireable<string>;
|
|
44
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
45
|
+
'data-name': PropTypes.Requireable<string>;
|
|
46
|
+
'data-testid': PropTypes.Requireable<string>;
|
|
47
|
+
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
48
|
+
position: PropTypes.Requireable<string>;
|
|
49
|
+
type: PropTypes.Requireable<string>;
|
|
50
|
+
}>>;
|
|
51
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
|
+
link: PropTypes.Requireable<PropTypes.InferProps<{
|
|
53
|
+
href: PropTypes.Requireable<string>;
|
|
54
|
+
download: PropTypes.Requireable<boolean>;
|
|
55
|
+
target: PropTypes.Requireable<string>;
|
|
56
|
+
}>>;
|
|
57
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
58
|
+
className: PropTypes.Requireable<string>;
|
|
59
|
+
customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
60
|
+
}> | PropTypes.InferProps<{
|
|
61
|
+
componentType: PropTypes.Requireable<string>;
|
|
62
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
63
|
+
buttonAriaLabel: PropTypes.Requireable<string>;
|
|
64
|
+
menuAriaLabel: PropTypes.Requireable<string>;
|
|
65
|
+
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
66
|
+
'data-name': PropTypes.Requireable<string>;
|
|
67
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
68
|
+
label: PropTypes.Validator<string>;
|
|
69
|
+
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
70
|
+
type: PropTypes.Requireable<string>;
|
|
71
|
+
}> | null | undefined)[]>;
|
|
72
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
|
+
menuButtonClassName: PropTypes.Requireable<string>;
|
|
74
|
+
isBulkMenu: PropTypes.Requireable<boolean>;
|
|
75
|
+
}> | null | undefined>>;
|
|
76
|
+
isNestedTable: PropTypes.Requireable<boolean>;
|
|
77
|
+
};
|
|
78
|
+
export declare type Field = string | (StatusItemProps & {
|
|
79
|
+
componentType: 'status';
|
|
80
|
+
}) | (BulkProgressBarProps & {
|
|
81
|
+
componentType: 'progress-bar';
|
|
82
|
+
});
|
|
83
|
+
export declare type LastField = (ButtonLinkProps & {
|
|
84
|
+
componentType: 'button-link';
|
|
85
|
+
}) | (BulletPointMenuButtonProps & {
|
|
86
|
+
componentType: 'menu';
|
|
87
|
+
});
|
|
88
|
+
export declare type NestedRow = (ErrorsTableProps & {
|
|
89
|
+
componentType: 'errors-table';
|
|
90
|
+
}) | (Props & {
|
|
91
|
+
componentType: 'expandible-errors-table';
|
|
92
|
+
});
|
|
93
|
+
export declare type Column = {
|
|
94
|
+
title: string;
|
|
95
|
+
};
|
|
96
|
+
export declare type Row = {
|
|
97
|
+
fields: Field[];
|
|
98
|
+
nestedRow?: NestedRow;
|
|
99
|
+
isRowExpandible?: boolean;
|
|
100
|
+
};
|
|
101
|
+
export declare type Columns = Column[];
|
|
102
|
+
export declare type Rows = Row[];
|
|
103
|
+
export declare type Props = {
|
|
104
|
+
columns: Columns;
|
|
105
|
+
rows?: Rows;
|
|
106
|
+
stickyFirstColumn?: boolean;
|
|
107
|
+
stickyLastColumn?: boolean;
|
|
108
|
+
columnWidth?: `${number}${'px' | '%'}`;
|
|
109
|
+
ariaDescribedby?: string;
|
|
110
|
+
lastField?: LastField;
|
|
111
|
+
isNestedTable?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export declare type ExpandState = {
|
|
114
|
+
[key: number]: boolean;
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandible-actionable-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,0BAA0B,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,KAAK,IAAI,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAC,KAAK,IAAI,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AA0BzE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBrB,CAAC;AAEF,oBAAY,KAAK,GACb,MAAM,GACN,CAAC,eAAe,GAAG;IACjB,aAAa,EAAE,QAAQ,CAAC;CACzB,CAAC,GACF,CAAC,oBAAoB,GAAG;IACtB,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC,CAAC;AAEP,oBAAY,SAAS,GACjB,CAAC,eAAe,GAAG;IACjB,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC,GACF,CAAC,0BAA0B,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC;AAEP,oBAAY,SAAS,GACjB,CAAC,gBAAgB,GAAG;IAClB,aAAa,EAAE,cAAc,CAAC;CAC/B,CAAC,GACF,CAAC,KAAK,GAAG;IACP,aAAa,EAAE,yBAAyB,CAAC;CAC1C,CAAC,CAAC;AAEP,oBAAY,MAAM,GAAG;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC;AACrC,oBAAY,GAAG,GAAG;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AACF,oBAAY,OAAO,GAAG,MAAM,EAAE,CAAC;AAC/B,oBAAY,IAAI,GAAG,GAAG,EAAE,CAAC;AAEzB,oBAAY,KAAK,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.propTypes = void 0;
|
|
5
|
+
|
|
6
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
|
+
|
|
8
|
+
var _statusItem = _interopRequireDefault(require("../../atom/status-item"));
|
|
9
|
+
|
|
10
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
11
|
+
|
|
12
|
+
var _bulletPointMenuButton = _interopRequireDefault(require("../bullet-point-menu-button"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
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
|
+
|
|
18
|
+
const columnProptypes = _propTypes.default.shape({
|
|
19
|
+
title: _propTypes.default.string.isRequired
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const rowProptypes = _propTypes.default.shape({
|
|
23
|
+
fields: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape(_extends({}, _statusItem.default.propTypes, {
|
|
24
|
+
type: _propTypes.default.oneOf(['status'])
|
|
25
|
+
}))])),
|
|
26
|
+
isRowExpandible: _propTypes.default.bool,
|
|
27
|
+
lastField: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape(_extends({}, _bulletPointMenuButton.default.propTypes, {
|
|
28
|
+
type: _propTypes.default.oneOf(['menu'])
|
|
29
|
+
}))])
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const propTypes = {
|
|
33
|
+
columns: _propTypes.default.arrayOf(columnProptypes),
|
|
34
|
+
rows: _propTypes.default.arrayOf(rowProptypes),
|
|
35
|
+
stickyFirstColumn: _propTypes.default.bool,
|
|
36
|
+
stickyLastColumn: _propTypes.default.bool,
|
|
37
|
+
columnWidth: _propTypes.default.string,
|
|
38
|
+
ariaDescribedby: _propTypes.default.string,
|
|
39
|
+
lastField: _propTypes.default.oneOfType([_propTypes.default.shape(_extends({}, _buttonLink.default.propTypes, {
|
|
40
|
+
componentType: _propTypes.default.oneOf(['button-link'])
|
|
41
|
+
})), _propTypes.default.shape(_extends({}, _bulletPointMenuButton.default.propTypes, {
|
|
42
|
+
componentType: _propTypes.default.oneOf(['menu'])
|
|
43
|
+
}))]),
|
|
44
|
+
isNestedTable: _propTypes.default.bool
|
|
45
|
+
};
|
|
46
|
+
exports.propTypes = propTypes;
|
|
47
|
+
//# sourceMappingURL=types.js.map
|