@dnb/eufemia 9.40.0 → 9.42.0
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/CHANGELOG.md +35 -0
- package/cjs/components/accordion/style/_accordion.scss +1 -1
- package/cjs/components/autocomplete/style/dnb-autocomplete.css +3 -14
- package/cjs/components/autocomplete/style/dnb-autocomplete.min.css +2 -2
- package/cjs/components/checkbox/style/dnb-checkbox.css +0 -7
- package/cjs/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/cjs/components/date-picker/style/dnb-date-picker.css +3 -35
- package/cjs/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/cjs/components/drawer/types.d.ts +5 -5
- package/cjs/components/dropdown/style/dnb-dropdown.css +0 -7
- package/cjs/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/cjs/components/form-label/FormLabel.js +1 -1
- package/cjs/components/form-label/style/_form-label.scss +0 -13
- package/cjs/components/form-label/style/dnb-form-label.css +0 -7
- package/cjs/components/form-label/style/dnb-form-label.min.css +1 -1
- package/cjs/components/form-row/style/dnb-form-row.css +0 -7
- package/cjs/components/form-row/style/dnb-form-row.min.css +1 -1
- package/cjs/components/input/style/_input.scss +4 -0
- package/cjs/components/input/style/dnb-input.css +3 -7
- package/cjs/components/input/style/dnb-input.min.css +1 -1
- package/cjs/components/input-masked/style/dnb-input-masked.css +3 -7
- package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/cjs/components/modal/Modal.d.ts +2 -2
- package/cjs/components/number-format/NumberUtils.d.ts +3 -0
- package/cjs/components/radio/style/dnb-radio.css +0 -7
- package/cjs/components/radio/style/dnb-radio.min.css +1 -1
- package/cjs/components/slider/style/dnb-slider.css +0 -7
- package/cjs/components/slider/style/dnb-slider.min.css +1 -1
- package/cjs/components/switch/style/dnb-switch.css +0 -7
- package/cjs/components/switch/style/dnb-switch.min.css +1 -1
- package/cjs/components/table/Table.d.ts +4 -2
- package/cjs/components/table/Table.js +15 -51
- package/cjs/components/table/TableAccordion.d.ts +10 -0
- package/cjs/components/table/TableAccordion.js +265 -0
- package/cjs/components/table/TableAccordionContent.d.ts +18 -0
- package/cjs/components/table/TableAccordionContent.js +126 -0
- package/cjs/components/table/TableContainer.js +5 -6
- package/cjs/components/table/TableScrollView.js +2 -1
- package/cjs/components/table/TableTd.d.ts +6 -1
- package/cjs/components/table/TableTd.js +5 -1
- package/cjs/components/table/TableTh.d.ts +3 -3
- package/cjs/components/table/TableTh.js +2 -0
- package/cjs/components/table/TableTr.d.ts +27 -0
- package/cjs/components/table/TableTr.js +95 -18
- package/cjs/components/table/index.d.ts +1 -0
- package/cjs/components/table/index.js +11 -1
- package/cjs/components/table/style/_table-accordion.scss +285 -0
- package/cjs/components/table/style/_table-container.scss +13 -1
- package/cjs/components/table/style/_table-header-buttons.scss +20 -1
- package/cjs/components/table/style/_table-td.scss +29 -2
- package/cjs/components/table/style/_table-tr.scss +8 -2
- package/cjs/components/table/style/_table.scss +9 -7
- package/cjs/components/table/style/dnb-table.css +586 -324
- package/cjs/components/table/style/dnb-table.min.css +11 -2
- package/cjs/components/table/style/themes/dnb-table-theme-ui.css +5 -1
- package/cjs/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/cjs/components/table/style/themes/dnb-table-theme-ui.scss +9 -1
- package/cjs/components/table/useHandleSortState.d.ts +34 -0
- package/cjs/components/table/useHandleSortState.js +196 -0
- package/cjs/components/textarea/style/dnb-textarea.css +0 -7
- package/cjs/components/textarea/style/dnb-textarea.min.css +1 -1
- package/cjs/components/toggle-button/style/dnb-toggle-button.css +0 -21
- package/cjs/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/cjs/elements/Element.d.ts +1 -1
- package/cjs/fragments/lib.d.ts +4 -7
- package/cjs/fragments/scroll-view/ScrollView.d.ts +12 -11
- package/cjs/fragments/scroll-view/ScrollView.js +8 -5
- package/cjs/fragments/scroll-view/style/_scroll-view.scss +11 -0
- package/cjs/shared/Eufemia.js +1 -1
- package/cjs/shared/helpers.js +7 -1
- package/cjs/shared/locales/en-GB.d.ts +4 -0
- package/cjs/shared/locales/en-GB.js +4 -0
- package/cjs/shared/locales/en-US.d.ts +4 -0
- package/cjs/shared/locales/index.d.ts +8 -0
- package/cjs/shared/locales/nb-NO.d.ts +4 -0
- package/cjs/shared/locales/nb-NO.js +4 -0
- package/cjs/style/dnb-ui-components.css +594 -320
- package/cjs/style/dnb-ui-components.min.css +13 -4
- package/cjs/style/dnb-ui-fragments.css +17 -1
- package/cjs/style/dnb-ui-fragments.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.css +5 -1
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +5 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/components/accordion/style/_accordion.scss +1 -1
- package/components/autocomplete/style/dnb-autocomplete.css +3 -14
- package/components/autocomplete/style/dnb-autocomplete.min.css +2 -2
- package/components/checkbox/style/dnb-checkbox.css +0 -7
- package/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/components/date-picker/style/dnb-date-picker.css +3 -35
- package/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/components/drawer/types.d.ts +5 -5
- package/components/dropdown/style/dnb-dropdown.css +0 -7
- package/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/components/form-label/FormLabel.js +1 -1
- package/components/form-label/style/_form-label.scss +0 -13
- package/components/form-label/style/dnb-form-label.css +0 -7
- package/components/form-label/style/dnb-form-label.min.css +1 -1
- package/components/form-row/style/dnb-form-row.css +0 -7
- package/components/form-row/style/dnb-form-row.min.css +1 -1
- package/components/input/style/_input.scss +4 -0
- package/components/input/style/dnb-input.css +3 -7
- package/components/input/style/dnb-input.min.css +1 -1
- package/components/input-masked/style/dnb-input-masked.css +3 -7
- package/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/components/modal/Modal.d.ts +2 -2
- package/components/number-format/NumberUtils.d.ts +3 -0
- package/components/radio/style/dnb-radio.css +0 -7
- package/components/radio/style/dnb-radio.min.css +1 -1
- package/components/slider/style/dnb-slider.css +0 -7
- package/components/slider/style/dnb-slider.min.css +1 -1
- package/components/switch/style/dnb-switch.css +0 -7
- package/components/switch/style/dnb-switch.min.css +1 -1
- package/components/table/Table.d.ts +4 -2
- package/components/table/Table.js +13 -21
- package/components/table/TableAccordion.d.ts +10 -0
- package/components/table/TableAccordion.js +192 -0
- package/components/table/TableAccordionContent.d.ts +18 -0
- package/components/table/TableAccordionContent.js +63 -0
- package/components/table/TableContainer.js +5 -6
- package/components/table/TableScrollView.js +2 -1
- package/components/table/TableTd.d.ts +6 -1
- package/components/table/TableTd.js +3 -1
- package/components/table/TableTh.d.ts +3 -3
- package/components/table/TableTh.js +2 -0
- package/components/table/TableTr.d.ts +27 -0
- package/components/table/TableTr.js +59 -16
- package/components/table/index.d.ts +1 -0
- package/components/table/index.js +1 -0
- package/components/table/style/_table-accordion.scss +285 -0
- package/components/table/style/_table-container.scss +13 -1
- package/components/table/style/_table-header-buttons.scss +20 -1
- package/components/table/style/_table-td.scss +29 -2
- package/components/table/style/_table-tr.scss +8 -2
- package/components/table/style/_table.scss +9 -7
- package/components/table/style/dnb-table.css +586 -324
- package/components/table/style/dnb-table.min.css +11 -2
- package/components/table/style/themes/dnb-table-theme-ui.css +5 -1
- package/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/components/table/style/themes/dnb-table-theme-ui.scss +9 -1
- package/components/table/useHandleSortState.d.ts +34 -0
- package/components/table/useHandleSortState.js +141 -0
- package/components/textarea/style/dnb-textarea.css +0 -7
- package/components/textarea/style/dnb-textarea.min.css +1 -1
- package/components/toggle-button/style/dnb-toggle-button.css +0 -21
- package/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/elements/Element.d.ts +1 -1
- package/es/components/accordion/style/_accordion.scss +1 -1
- package/es/components/autocomplete/style/dnb-autocomplete.css +3 -14
- package/es/components/autocomplete/style/dnb-autocomplete.min.css +2 -2
- package/es/components/checkbox/style/dnb-checkbox.css +0 -7
- package/es/components/checkbox/style/dnb-checkbox.min.css +1 -1
- package/es/components/date-picker/style/dnb-date-picker.css +3 -35
- package/es/components/date-picker/style/dnb-date-picker.min.css +2 -2
- package/es/components/drawer/types.d.ts +5 -5
- package/es/components/dropdown/style/dnb-dropdown.css +0 -7
- package/es/components/dropdown/style/dnb-dropdown.min.css +1 -1
- package/es/components/form-label/FormLabel.js +1 -1
- package/es/components/form-label/style/_form-label.scss +0 -13
- package/es/components/form-label/style/dnb-form-label.css +0 -7
- package/es/components/form-label/style/dnb-form-label.min.css +1 -1
- package/es/components/form-row/style/dnb-form-row.css +0 -7
- package/es/components/form-row/style/dnb-form-row.min.css +1 -1
- package/es/components/input/style/_input.scss +4 -0
- package/es/components/input/style/dnb-input.css +3 -7
- package/es/components/input/style/dnb-input.min.css +1 -1
- package/es/components/input-masked/style/dnb-input-masked.css +3 -7
- package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
- package/es/components/modal/Modal.d.ts +2 -2
- package/es/components/number-format/NumberUtils.d.ts +3 -0
- package/es/components/radio/style/dnb-radio.css +0 -7
- package/es/components/radio/style/dnb-radio.min.css +1 -1
- package/es/components/slider/style/dnb-slider.css +0 -7
- package/es/components/slider/style/dnb-slider.min.css +1 -1
- package/es/components/switch/style/dnb-switch.css +0 -7
- package/es/components/switch/style/dnb-switch.min.css +1 -1
- package/es/components/table/Table.d.ts +4 -2
- package/es/components/table/Table.js +14 -15
- package/es/components/table/TableAccordion.d.ts +10 -0
- package/es/components/table/TableAccordion.js +175 -0
- package/es/components/table/TableAccordionContent.d.ts +18 -0
- package/es/components/table/TableAccordionContent.js +54 -0
- package/es/components/table/TableContainer.js +5 -6
- package/es/components/table/TableScrollView.js +2 -1
- package/es/components/table/TableTd.d.ts +6 -1
- package/es/components/table/TableTd.js +3 -1
- package/es/components/table/TableTh.d.ts +3 -3
- package/es/components/table/TableTh.js +2 -0
- package/es/components/table/TableTr.d.ts +27 -0
- package/es/components/table/TableTr.js +51 -15
- package/es/components/table/index.d.ts +1 -0
- package/es/components/table/index.js +1 -0
- package/es/components/table/style/_table-accordion.scss +285 -0
- package/es/components/table/style/_table-container.scss +13 -1
- package/es/components/table/style/_table-header-buttons.scss +20 -1
- package/es/components/table/style/_table-td.scss +29 -2
- package/es/components/table/style/_table-tr.scss +8 -2
- package/es/components/table/style/_table.scss +9 -7
- package/es/components/table/style/dnb-table.css +586 -324
- package/es/components/table/style/dnb-table.min.css +11 -2
- package/es/components/table/style/themes/dnb-table-theme-ui.css +5 -1
- package/es/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/es/components/table/style/themes/dnb-table-theme-ui.scss +9 -1
- package/es/components/table/useHandleSortState.d.ts +34 -0
- package/es/components/table/useHandleSortState.js +111 -0
- package/es/components/textarea/style/dnb-textarea.css +0 -7
- package/es/components/textarea/style/dnb-textarea.min.css +1 -1
- package/es/components/toggle-button/style/dnb-toggle-button.css +0 -21
- package/es/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
- package/es/elements/Element.d.ts +1 -1
- package/es/fragments/lib.d.ts +4 -7
- package/es/fragments/scroll-view/ScrollView.d.ts +12 -11
- package/es/fragments/scroll-view/ScrollView.js +7 -3
- package/es/fragments/scroll-view/style/_scroll-view.scss +11 -0
- package/es/shared/Eufemia.js +1 -1
- package/es/shared/helpers.js +7 -1
- package/es/shared/locales/en-GB.d.ts +4 -0
- package/es/shared/locales/en-GB.js +4 -0
- package/es/shared/locales/en-US.d.ts +4 -0
- package/es/shared/locales/index.d.ts +8 -0
- package/es/shared/locales/nb-NO.d.ts +4 -0
- package/es/shared/locales/nb-NO.js +4 -0
- package/es/style/dnb-ui-components.css +594 -320
- package/es/style/dnb-ui-components.min.css +13 -4
- package/es/style/dnb-ui-fragments.css +17 -1
- package/es/style/dnb-ui-fragments.min.css +1 -1
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.css +5 -1
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.css +5 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +3 -3
- package/esm/dnb-ui-extensions.min.mjs +4 -4
- package/esm/dnb-ui-lib.min.mjs +2 -2
- package/esm/dnb-ui-web-components.min.mjs +2 -2
- package/fragments/lib.d.ts +4 -7
- package/fragments/scroll-view/ScrollView.d.ts +12 -11
- package/fragments/scroll-view/ScrollView.js +8 -4
- package/fragments/scroll-view/style/_scroll-view.scss +11 -0
- package/package.json +1 -1
- package/shared/Eufemia.js +1 -1
- package/shared/helpers.js +7 -1
- package/shared/locales/en-GB.d.ts +4 -0
- package/shared/locales/en-GB.js +4 -0
- package/shared/locales/en-US.d.ts +4 -0
- package/shared/locales/index.d.ts +8 -0
- package/shared/locales/nb-NO.d.ts +4 -0
- package/shared/locales/nb-NO.js +4 -0
- package/style/dnb-ui-components.css +594 -320
- package/style/dnb-ui-components.min.css +13 -4
- package/style/dnb-ui-fragments.css +17 -1
- package/style/dnb-ui-fragments.min.css +1 -1
- package/style/themes/theme-eiendom/dnb-theme-eiendom.css +5 -1
- package/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/style/themes/theme-ui/dnb-theme-ui.css +5 -1
- package/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +3 -3
- package/umd/dnb-ui-extensions.min.js +4 -4
- package/umd/dnb-ui-lib.min.js +2 -2
- package/umd/dnb-ui-web-components.min.js +2 -2
|
@@ -20,7 +20,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
20
20
|
|
|
21
21
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _TableScrollView = _interopRequireDefault(require("./TableScrollView"));
|
|
24
24
|
|
|
25
25
|
var _SpacingUtils = require("../space/SpacingUtils");
|
|
26
26
|
|
|
@@ -46,11 +46,10 @@ function TableContainer(props) {
|
|
|
46
46
|
|
|
47
47
|
var spacingClasses = (0, _SpacingUtils.createSpacingClasses)(props);
|
|
48
48
|
(0, _componentHelper.validateDOMAttributes)(props, rest);
|
|
49
|
+
var ScrollView = _TableScrollView.default;
|
|
49
50
|
return _react.default.createElement("section", _extends({
|
|
50
51
|
className: (0, _classnames.default)('dnb-table__container', className, spacingClasses)
|
|
51
|
-
}, rest), _react.default.createElement(
|
|
52
|
-
className: "dnb-table__scroll-view"
|
|
53
|
-
}, children));
|
|
52
|
+
}, rest), _react.default.createElement(ScrollView, null, children));
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
function TableContainerBody(props) {
|
|
@@ -69,7 +68,7 @@ function TableContainerHead(props) {
|
|
|
69
68
|
rest = _objectWithoutProperties(props, _excluded3);
|
|
70
69
|
|
|
71
70
|
return _react.default.createElement("div", _extends({
|
|
72
|
-
className: (0, _classnames.default)('dnb-table__container__head', className)
|
|
71
|
+
className: (0, _classnames.default)('dnb-table__container__head', className, !children && 'dnb-table__container__head--empty')
|
|
73
72
|
}, rest), children);
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -79,7 +78,7 @@ function TableContainerFoot(props) {
|
|
|
79
78
|
rest = _objectWithoutProperties(props, _excluded4);
|
|
80
79
|
|
|
81
80
|
return _react.default.createElement("div", _extends({
|
|
82
|
-
className: (0, _classnames.default)('dnb-table__container__foot', className)
|
|
81
|
+
className: (0, _classnames.default)('dnb-table__container__foot', className, !children && 'dnb-table__container__foot--empty')
|
|
83
82
|
}, rest), children);
|
|
84
83
|
}
|
|
85
84
|
|
|
@@ -35,6 +35,7 @@ function TableScrollView(props) {
|
|
|
35
35
|
rest = _objectWithoutProperties(props, _excluded);
|
|
36
36
|
|
|
37
37
|
return _react.default.createElement(_ScrollView.default, _extends({
|
|
38
|
-
className: (0, _classnames.default)('dnb-table__scroll-view', className)
|
|
38
|
+
className: (0, _classnames.default)('dnb-table__scroll-view', className),
|
|
39
|
+
interactive: true
|
|
39
40
|
}, rest), children);
|
|
40
41
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import TableAccordionContent from './TableAccordionContent';
|
|
2
3
|
export declare type TableTdProps = {
|
|
3
4
|
/**
|
|
4
5
|
* if set to `true`, no padding will be added
|
|
@@ -16,4 +17,8 @@ export declare type TableTdProps = {
|
|
|
16
17
|
*/
|
|
17
18
|
children?: React.ReactNode;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
declare function Td(componentProps: TableTdProps & React.TdHTMLAttributes<HTMLTableCellElement>): JSX.Element;
|
|
21
|
+
declare namespace Td {
|
|
22
|
+
var AccordionContent: typeof TableAccordionContent;
|
|
23
|
+
}
|
|
24
|
+
export default Td;
|
|
@@ -17,6 +17,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
|
20
|
+
var _TableAccordionContent = _interopRequireDefault(require("./TableAccordionContent"));
|
|
21
|
+
|
|
20
22
|
var _excluded = ["className", "children", "noSpacing", "spacing"];
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -38,4 +40,6 @@ function Td(componentProps) {
|
|
|
38
40
|
role: "cell",
|
|
39
41
|
className: (0, _classnames.default)('dnb-table__td', className, noSpacing && 'dnb-table__td--no-spacing', spacing && "dnb-table__td--spacing-".concat(spacing))
|
|
40
42
|
}, props), children);
|
|
41
|
-
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Td.AccordionContent = _TableAccordionContent.default;
|
|
@@ -4,17 +4,17 @@ import TableHelpButton from './TableHelpButton';
|
|
|
4
4
|
export declare type TableThChildren = React.ReactNode | ReturnType<typeof TableSortButton> | ReturnType<typeof TableHelpButton>;
|
|
5
5
|
export declare type TableThProps = {
|
|
6
6
|
/**
|
|
7
|
-
* Defines the table header as sortable
|
|
7
|
+
* Defines the table header as sortable (ascending)
|
|
8
8
|
* Default: false
|
|
9
9
|
*/
|
|
10
10
|
sortable?: boolean;
|
|
11
11
|
/**
|
|
12
|
-
* Defines the sortable column as the current active
|
|
12
|
+
* Defines the sortable column as the current active (ascending)
|
|
13
13
|
* Default: false
|
|
14
14
|
*/
|
|
15
15
|
active?: boolean;
|
|
16
16
|
/**
|
|
17
|
-
* Defines the sortable column as in reversed order
|
|
17
|
+
* Defines the sortable column as in reversed order (descending)
|
|
18
18
|
* Default: false
|
|
19
19
|
*/
|
|
20
20
|
reversed?: boolean;
|
|
@@ -43,9 +43,11 @@ function Th(componentProps) {
|
|
|
43
43
|
|
|
44
44
|
var role = props.scope === 'row' ? 'rowheader' : 'columnheader';
|
|
45
45
|
var scope = props.scope === 'row' ? 'row' : 'col';
|
|
46
|
+
var ariaSort = sortable ? reversed ? 'descending' : 'ascending' : undefined;
|
|
46
47
|
return _react.default.createElement("th", _extends({
|
|
47
48
|
role: role,
|
|
48
49
|
scope: scope,
|
|
50
|
+
"aria-sort": ariaSort,
|
|
49
51
|
className: (0, _classnames.default)('dnb-table__th', className, sortable && 'dnb-table--sortable', active && 'dnb-table--active', reversed && 'dnb-table--reversed', noWrap && 'dnb-table--no-wrap')
|
|
50
52
|
}, props), children);
|
|
51
53
|
}
|
|
@@ -10,9 +10,36 @@ export declare type TableTrProps = {
|
|
|
10
10
|
* Default: false
|
|
11
11
|
*/
|
|
12
12
|
noWrap?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Set true to render the tr initially as expanded
|
|
15
|
+
* Default: false
|
|
16
|
+
*/
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Set true to disable the tr to be accessible as an interactive element
|
|
20
|
+
* Default: false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Set to true to skip animation
|
|
25
|
+
* Default: false
|
|
26
|
+
*/
|
|
27
|
+
noAnimation?: boolean;
|
|
13
28
|
/**
|
|
14
29
|
* The content of the component.
|
|
15
30
|
*/
|
|
16
31
|
children: React.ReactElement<TableTdProps> | Array<React.ReactElement<TableTdProps>>;
|
|
17
32
|
};
|
|
18
33
|
export default function Tr(componentProps: TableTrProps & React.TableHTMLAttributes<HTMLTableRowElement>): JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Handle odd/even on re-render and React.StrictMode
|
|
36
|
+
*/
|
|
37
|
+
export declare function useHandleOddEven({ children }: {
|
|
38
|
+
children: any;
|
|
39
|
+
}): {
|
|
40
|
+
trCountRef: React.MutableRefObject<{
|
|
41
|
+
count: number;
|
|
42
|
+
}>;
|
|
43
|
+
rerenderAlias: {};
|
|
44
|
+
setRerenderAlias: React.Dispatch<React.SetStateAction<{}>>;
|
|
45
|
+
};
|
|
@@ -8,21 +8,56 @@ require("core-js/modules/es.symbol.js");
|
|
|
8
8
|
|
|
9
9
|
require("core-js/modules/es.object.assign.js");
|
|
10
10
|
|
|
11
|
+
require("core-js/modules/es.symbol.description.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.to-string.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.array.iterator.js");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.string.iterator.js");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/es.array.slice.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.function.name.js");
|
|
26
|
+
|
|
27
|
+
require("core-js/modules/es.array.from.js");
|
|
28
|
+
|
|
29
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
30
|
+
|
|
11
31
|
Object.defineProperty(exports, "__esModule", {
|
|
12
32
|
value: true
|
|
13
33
|
});
|
|
14
34
|
exports.default = Tr;
|
|
35
|
+
exports.useHandleOddEven = useHandleOddEven;
|
|
15
36
|
|
|
16
37
|
var _react = _interopRequireDefault(require("react"));
|
|
17
38
|
|
|
18
39
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
40
|
|
|
41
|
+
var _TableAccordion = require("./TableAccordion");
|
|
42
|
+
|
|
20
43
|
var _TableContext = _interopRequireDefault(require("./TableContext"));
|
|
21
44
|
|
|
22
|
-
var _excluded = ["variant", "noWrap", "children", "className"];
|
|
45
|
+
var _excluded = ["variant", "noWrap", "expanded", "disabled", "noAnimation", "children", "className"];
|
|
23
46
|
|
|
24
47
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
48
|
|
|
49
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
50
|
+
|
|
51
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
52
|
+
|
|
53
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
54
|
+
|
|
55
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
56
|
+
|
|
57
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
58
|
+
|
|
59
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
60
|
+
|
|
26
61
|
function _extends() { _extends = Object.assign || 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); }
|
|
27
62
|
|
|
28
63
|
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; }
|
|
@@ -32,6 +67,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
32
67
|
function Tr(componentProps) {
|
|
33
68
|
var variant = componentProps.variant,
|
|
34
69
|
noWrap = componentProps.noWrap,
|
|
70
|
+
expanded = componentProps.expanded,
|
|
71
|
+
disabled = componentProps.disabled,
|
|
72
|
+
noAnimation = componentProps.noAnimation,
|
|
35
73
|
children = componentProps.children,
|
|
36
74
|
_className = componentProps.className,
|
|
37
75
|
props = _objectWithoutProperties(componentProps, _excluded);
|
|
@@ -42,6 +80,19 @@ function Tr(componentProps) {
|
|
|
42
80
|
currentVariant = _useHandleTrVariant.currentVariant;
|
|
43
81
|
|
|
44
82
|
var className = (0, _classnames.default)('dnb-table__tr', _className, currentVariant && "dnb-table__tr--".concat(currentVariant), noWrap && 'dnb-table--no-wrap');
|
|
83
|
+
var accordionTr = (0, _TableAccordion.useTableAccordion)({
|
|
84
|
+
className: className,
|
|
85
|
+
children: children,
|
|
86
|
+
props: props,
|
|
87
|
+
expanded: expanded,
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
noAnimation: noAnimation
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (accordionTr) {
|
|
93
|
+
return accordionTr;
|
|
94
|
+
}
|
|
95
|
+
|
|
45
96
|
return _react.default.createElement("tr", _extends({
|
|
46
97
|
role: "row",
|
|
47
98
|
className: className
|
|
@@ -67,26 +118,18 @@ function useHandleTrVariant(_ref) {
|
|
|
67
118
|
return countRef.count;
|
|
68
119
|
};
|
|
69
120
|
|
|
70
|
-
var
|
|
71
|
-
if (typeof
|
|
72
|
-
return
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!variant || variant === 'even' && countRef.count % 2 === 1 || variant === 'odd' && countRef.count % 2 === 0) {
|
|
76
|
-
countRef.count--;
|
|
77
|
-
tableContext === null || tableContext === void 0 ? void 0 : tableContext.forceRerender();
|
|
121
|
+
var _React$useState = _react.default.useState(function () {
|
|
122
|
+
if (typeof window === 'undefined') {
|
|
123
|
+
return increment();
|
|
78
124
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_react.default.useEffect(function () {
|
|
84
|
-
return decrement;
|
|
85
|
-
}, [tableContext === null || tableContext === void 0 ? void 0 : tableContext.trCountRef]);
|
|
125
|
+
}),
|
|
126
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
127
|
+
count = _React$useState2[0],
|
|
128
|
+
setCount = _React$useState2[1];
|
|
86
129
|
|
|
87
130
|
_react.default.useEffect(function () {
|
|
88
|
-
|
|
89
|
-
}, [
|
|
131
|
+
setCount(increment());
|
|
132
|
+
}, [tableContext === null || tableContext === void 0 ? void 0 : tableContext.rerenderAlias]);
|
|
90
133
|
|
|
91
134
|
var currentVariant = variant;
|
|
92
135
|
|
|
@@ -97,4 +140,38 @@ function useHandleTrVariant(_ref) {
|
|
|
97
140
|
return {
|
|
98
141
|
currentVariant: currentVariant
|
|
99
142
|
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function useHandleOddEven(_ref2) {
|
|
146
|
+
var children = _ref2.children;
|
|
147
|
+
|
|
148
|
+
var trCountRef = _react.default.useRef({
|
|
149
|
+
count: 0
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
var _React$useState3 = _react.default.useState({}),
|
|
153
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
154
|
+
rerenderAlias = _React$useState4[0],
|
|
155
|
+
setRerenderAlias = _React$useState4[1];
|
|
156
|
+
|
|
157
|
+
var isMounted = _react.default.useRef(false);
|
|
158
|
+
|
|
159
|
+
_react.default.useEffect(function () {
|
|
160
|
+
if (isMounted.current) {
|
|
161
|
+
forceRerender();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
isMounted.current = true;
|
|
165
|
+
}, [children]);
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
trCountRef: trCountRef,
|
|
169
|
+
rerenderAlias: rerenderAlias,
|
|
170
|
+
setRerenderAlias: setRerenderAlias
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
function forceRerender() {
|
|
174
|
+
trCountRef.current.count = 0;
|
|
175
|
+
setRerenderAlias({});
|
|
176
|
+
}
|
|
100
177
|
}
|
|
@@ -27,8 +27,16 @@ require("core-js/modules/es.symbol.iterator.js");
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", {
|
|
28
28
|
value: true
|
|
29
29
|
});
|
|
30
|
-
var _exportNames = {
|
|
30
|
+
var _exportNames = {
|
|
31
|
+
useHandleSortState: true
|
|
32
|
+
};
|
|
31
33
|
exports.default = void 0;
|
|
34
|
+
Object.defineProperty(exports, "useHandleSortState", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function get() {
|
|
37
|
+
return _useHandleSortState.useHandleSortState;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
32
40
|
|
|
33
41
|
var _Table = _interopRequireWildcard(require("./Table"));
|
|
34
42
|
|
|
@@ -44,6 +52,8 @@ Object.keys(_Table).forEach(function (key) {
|
|
|
44
52
|
});
|
|
45
53
|
});
|
|
46
54
|
|
|
55
|
+
var _useHandleSortState = require("./useHandleSortState");
|
|
56
|
+
|
|
47
57
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
48
58
|
|
|
49
59
|
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; }
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Table component
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@mixin tableAccordionActiveColor {
|
|
7
|
+
.dnb-table__td__accordion-icon .dnb-icon {
|
|
8
|
+
color: var(--color-emerald-green);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@mixin tableAccordionDisabledColor {
|
|
12
|
+
.dnb-table__td__accordion-icon .dnb-icon {
|
|
13
|
+
color: var(--color-sea-green-30);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dnb-table {
|
|
18
|
+
--accordion-background: var(--color-white);
|
|
19
|
+
--accordion-border-width: 0.0625rem;
|
|
20
|
+
--accordion-border: var(--accordion-border-width) solid
|
|
21
|
+
var(--color-black-20);
|
|
22
|
+
|
|
23
|
+
&__th#{&}__th__accordion-icon {
|
|
24
|
+
padding: 0;
|
|
25
|
+
|
|
26
|
+
// In case the table-layout is fixed
|
|
27
|
+
&,
|
|
28
|
+
div {
|
|
29
|
+
width: 3.5rem;
|
|
30
|
+
|
|
31
|
+
.dnb-table__size--medium & {
|
|
32
|
+
width: 3rem;
|
|
33
|
+
}
|
|
34
|
+
.dnb-table__size--small & {
|
|
35
|
+
width: 2.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
text-indent: -300vw;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__td#{&}__td__accordion-icon {
|
|
43
|
+
padding: 0;
|
|
44
|
+
user-select: none; // prevent selection on double-click
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__tr--has-accordion-content &__toggle-button {
|
|
48
|
+
display: flex; // to ensure we inherit the correct size from its content
|
|
49
|
+
justify-content: center;
|
|
50
|
+
|
|
51
|
+
.dnb-icon {
|
|
52
|
+
color: var(--color-sea-green);
|
|
53
|
+
transition: transform 500ms var(--accordion-easing);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
&__tr--has-accordion-content#{&}__tr--no-animation
|
|
57
|
+
&__toggle-button
|
|
58
|
+
.dnb-icon,
|
|
59
|
+
html[data-visual-test]
|
|
60
|
+
&__tr--has-accordion-content
|
|
61
|
+
&__toggle-button
|
|
62
|
+
.dnb-icon {
|
|
63
|
+
transition: none !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__tr--has-accordion-content,
|
|
67
|
+
&__tr__accordion_content {
|
|
68
|
+
position: relative;
|
|
69
|
+
z-index: 2;
|
|
70
|
+
}
|
|
71
|
+
&__tr--has-accordion-content:hover,
|
|
72
|
+
&__tr--has-accordion-content:active,
|
|
73
|
+
&__tr--has-accordion-content:focus,
|
|
74
|
+
&__tr--has-accordion-content#{&}__tr--expanded,
|
|
75
|
+
&__tr__accordion_content {
|
|
76
|
+
// ensure borders are visible in certain states
|
|
77
|
+
z-index: 3;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__tr--has-accordion-content#{&}__tr--expanded
|
|
81
|
+
&__toggle-button
|
|
82
|
+
.dnb-icon {
|
|
83
|
+
transform: rotate(180deg);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__tr--has-accordion-content#{&}__tr--expanded {
|
|
87
|
+
.dnb-table--border & td::after {
|
|
88
|
+
border-bottom: none;
|
|
89
|
+
}
|
|
90
|
+
.dnb-table--border & td:not(:first-of-type)::after {
|
|
91
|
+
border-left: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__tr--has-accordion-content#{&}__tr:not(&__tr--disabled) {
|
|
96
|
+
outline: none;
|
|
97
|
+
|
|
98
|
+
td::before {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
z-index: 3; // ensure we are over the "tableBorder"
|
|
102
|
+
|
|
103
|
+
// A negative number will force the table to overflow and a scrollbar will show up
|
|
104
|
+
inset: 0;
|
|
105
|
+
|
|
106
|
+
pointer-events: none;
|
|
107
|
+
|
|
108
|
+
// Here we use border to support Safari v16 on macOS
|
|
109
|
+
// but also to only have a border on specific sides
|
|
110
|
+
border: $focusRingWidth solid transparent;
|
|
111
|
+
}
|
|
112
|
+
td:not(:first-of-type)::before {
|
|
113
|
+
border-left: none;
|
|
114
|
+
}
|
|
115
|
+
td:not(:last-of-type)::before {
|
|
116
|
+
border-right: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@include hover() {
|
|
120
|
+
td::before {
|
|
121
|
+
border-color: var(--color-emerald-green);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@include tableAccordionActiveColor();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__tr--has-accordion-content#{&}__tr--expanded:not(&__tr--disabled):hover
|
|
129
|
+
&__td {
|
|
130
|
+
background-color: var(--color-white);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&__tr--has-accordion-content#{&}__tr:not(&__tr--disabled):not(:active):not(:hover):focus {
|
|
134
|
+
td::before {
|
|
135
|
+
@include whatInput(keyboard) {
|
|
136
|
+
top: 0;
|
|
137
|
+
bottom: 0;
|
|
138
|
+
border-color: var(--color-emerald-green);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
td:first-of-type::before {
|
|
142
|
+
left: 0;
|
|
143
|
+
}
|
|
144
|
+
td:last-of-type::before {
|
|
145
|
+
right: 0;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__tr--has-accordion-content#{&}__tr:not(&__tr--disabled):active {
|
|
150
|
+
html:not([data-whatintent='touch']) &:hover td::before,
|
|
151
|
+
td::before {
|
|
152
|
+
border-color: var(--color-emerald-green);
|
|
153
|
+
border-width: 0.0625rem; // TODO: we should have something like activeRingWidth
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&__tr--has-accordion-content#{&}__tr:not(&__tr--disabled):active &__td {
|
|
158
|
+
background-color: var(--color-pistachio);
|
|
159
|
+
|
|
160
|
+
@include tableAccordionActiveColor();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__tr--has-accordion-content#{&}__tr--expanded:not(&__tr--disabled)#{&}__tr--hover:not(:active):hover
|
|
164
|
+
&__td {
|
|
165
|
+
background-color: var(--accordion-background);
|
|
166
|
+
|
|
167
|
+
&::before {
|
|
168
|
+
border: none;
|
|
169
|
+
border-top: var(--accordion-border);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__tr--has-accordion-content#{&}__tr#{&}__tr--expanded:not(&__tr--disabled):not(:active):not(:hover) {
|
|
174
|
+
@include whatInputNot('keyboard') {
|
|
175
|
+
background-color: var(--accordion-background);
|
|
176
|
+
|
|
177
|
+
td::before {
|
|
178
|
+
border: none;
|
|
179
|
+
border-top: var(--accordion-border);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&__tr--has-accordion-content#{&}__tr--disabled {
|
|
185
|
+
@include tableAccordionDisabledColor();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&__tr__accordion_content {
|
|
189
|
+
@include IS_SAFARI_DESKTOP {
|
|
190
|
+
&[hidden] {
|
|
191
|
+
/**
|
|
192
|
+
* By reverting the display from "none" to "block",
|
|
193
|
+
* we trick VoiceOver to not make this row as the end of the table. We still need "hidden" to get the correct number of rows (childCount).
|
|
194
|
+
*/
|
|
195
|
+
display: block;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
td {
|
|
200
|
+
width: 100%;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
td::before {
|
|
204
|
+
content: '';
|
|
205
|
+
position: absolute;
|
|
206
|
+
top: auto;
|
|
207
|
+
left: 0;
|
|
208
|
+
right: 0;
|
|
209
|
+
bottom: calc(var(--accordion-border-width) * -1);
|
|
210
|
+
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
|
|
213
|
+
border-bottom: var(--accordion-border);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// because, when table has --outline
|
|
217
|
+
.dnb-table--outline &:last-of-type td::before {
|
|
218
|
+
border-bottom: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// because, when table has --border
|
|
222
|
+
.dnb-table--border & td::after {
|
|
223
|
+
border-top: none;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&__inner {
|
|
227
|
+
overflow: hidden;
|
|
228
|
+
will-change: height;
|
|
229
|
+
transition: height 400ms var(--accordion-easing);
|
|
230
|
+
|
|
231
|
+
&__spacing {
|
|
232
|
+
padding: 1rem;
|
|
233
|
+
|
|
234
|
+
transform: translateY(-10px);
|
|
235
|
+
transition: transform 500ms var(--accordion-easing);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
position: relative;
|
|
239
|
+
}
|
|
240
|
+
&--parallax &__inner {
|
|
241
|
+
&__spacing {
|
|
242
|
+
transform: translateY(0);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
> td,
|
|
247
|
+
> td.dnb-table__td {
|
|
248
|
+
padding: 0;
|
|
249
|
+
|
|
250
|
+
.dnb-dl,
|
|
251
|
+
.dnb-dl dt {
|
|
252
|
+
margin: 0;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&--expanded > td,
|
|
257
|
+
&--expanded > td.dnb-table__td {
|
|
258
|
+
background-color: var(--color-white);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&__tr__accordion_content#{&}__tr &__td {
|
|
263
|
+
background-color: var(--accordion-background);
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Safari on iOS and macOS has problems on animating when vertical-align is baseline.
|
|
267
|
+
* What happens is that the td is not 0, even the content inside is 0. With vertical top, we omit that.
|
|
268
|
+
* But we do not need baseline in this tr > td, so we reset it.
|
|
269
|
+
*/
|
|
270
|
+
vertical-align: top;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&__tr--has-accordion-content:not(&__tr--disabled) {
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
276
|
+
// prevent selection while animating – useful when user double-clicks
|
|
277
|
+
// TODO: Our SASS version doe sot support :has – so we may use this in future
|
|
278
|
+
// &__tr--has-accordion-content:has(& + &__tr__accordion_content--animating) {
|
|
279
|
+
// user-select: none;
|
|
280
|
+
// }
|
|
281
|
+
|
|
282
|
+
&__td-wrapper {
|
|
283
|
+
display: flex;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -30,18 +30,30 @@
|
|
|
30
30
|
&:not([class*='space__bottom']) {
|
|
31
31
|
margin-bottom: 0;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
&__size--large .dnb-table__th {
|
|
35
|
+
padding-top: 1.5rem;
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
&__head {
|
|
37
41
|
padding: 2rem 1rem 0;
|
|
38
42
|
|
|
43
|
+
&--empty {
|
|
44
|
+
padding: 0.5rem 0 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
39
47
|
.dnb-spacing & .dnb-h--large:not([class*='space__top']) {
|
|
40
48
|
margin: 0;
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
51
|
&__foot {
|
|
44
|
-
padding:
|
|
52
|
+
padding: 1rem 1rem 1.5rem;
|
|
53
|
+
|
|
54
|
+
&--empty {
|
|
55
|
+
padding: 0 0 1rem;
|
|
56
|
+
}
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
// When placed inside a Modal/Drawer, let the parent scroll-bar do its job.
|