@dnb/eufemia 9.39.0 → 9.40.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 +27 -0
- package/cjs/components/accordion/style/_accordion.scss +2 -2
- package/cjs/components/accordion/style/dnb-accordion.css +3 -3
- package/cjs/components/accordion/style/dnb-accordion.min.css +1 -1
- package/cjs/components/dialog/Dialog.d.ts +1 -1
- package/cjs/components/dialog/parts/DialogAction.d.ts +5 -4
- package/cjs/components/dialog/parts/DialogAction.js +23 -4
- package/cjs/components/dialog/style/_dialog.scss +7 -30
- package/cjs/components/dialog/style/dnb-dialog.css +21 -44
- package/cjs/components/dialog/style/dnb-dialog.min.css +1 -1
- package/cjs/components/dialog/style/themes/dnb-dialog-theme-ui.css +20 -0
- package/cjs/components/dialog/style/themes/dnb-dialog-theme-ui.min.css +1 -1
- package/cjs/components/dialog/style/themes/dnb-dialog-theme-ui.scss +29 -0
- package/cjs/components/drawer/style/_drawer.scss +1 -0
- package/cjs/components/drawer/style/dnb-drawer.css +12 -22
- package/cjs/components/drawer/style/dnb-drawer.min.css +1 -1
- package/cjs/components/height-animation/useHeightAnimation.js +5 -5
- package/cjs/components/lib.d.ts +1 -1
- package/cjs/components/modal/style/dnb-modal.css +11 -22
- package/cjs/components/modal/style/dnb-modal.min.css +1 -1
- package/cjs/components/number-format/NumberFormat.js +1 -1
- package/cjs/components/table/Table.js +1 -1
- package/cjs/components/table/TableContainer.js +3 -1
- package/cjs/components/table/TableStickyHeader.d.ts +4 -1
- package/cjs/components/table/TableStickyHeader.js +112 -83
- package/cjs/components/table/TableTh.d.ts +1 -1
- package/cjs/components/table/TableTh.js +4 -1
- package/cjs/components/table/style/_table-cell.scss +4 -4
- package/cjs/components/table/style/_table-container.scss +7 -17
- package/cjs/components/table/style/_table-deprecated.scss +74 -0
- package/cjs/components/table/style/_table-header-buttons.scss +2 -1
- package/cjs/components/table/style/_table-sticky.scss +24 -23
- package/cjs/components/table/style/_table-td.scss +27 -46
- package/cjs/components/table/style/_table-th.scss +44 -0
- package/cjs/components/table/style/_table.scss +13 -71
- package/cjs/components/table/style/dnb-table.css +181 -132
- package/cjs/components/table/style/dnb-table.min.css +1 -1
- package/cjs/components/table/style/themes/dnb-table-theme-ui.css +78 -63
- 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 +42 -17
- package/cjs/components/visually-hidden/VisuallyHidden.d.ts +2 -11
- package/cjs/components/visually-hidden/VisuallyHidden.js +2 -5
- package/cjs/components/visually-hidden/style/_visually-hidden.scss +0 -8
- package/cjs/components/visually-hidden/style/dnb-visually-hidden.css +10 -42
- package/cjs/components/visually-hidden/style/dnb-visually-hidden.min.css +1 -1
- package/cjs/elements/Table.d.ts +6 -2
- package/cjs/elements/Td.d.ts +6 -2
- package/cjs/elements/Th.d.ts +6 -2
- package/cjs/elements/Tr.d.ts +6 -2
- package/cjs/shared/Eufemia.js +1 -1
- package/cjs/style/core/helper-classes/helper-classes.scss +3 -0
- package/cjs/style/core/utilities.scss +15 -16
- package/cjs/style/dnb-ui-basis.css +20 -13
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-components.css +205 -199
- package/cjs/style/dnb-ui-components.min.css +4 -4
- package/cjs/style/dnb-ui-core.css +20 -13
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.css +98 -63
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +2 -2
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +98 -63
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +2 -2
- package/components/accordion/style/_accordion.scss +2 -2
- package/components/accordion/style/dnb-accordion.css +3 -3
- package/components/accordion/style/dnb-accordion.min.css +1 -1
- package/components/dialog/Dialog.d.ts +1 -1
- package/components/dialog/parts/DialogAction.d.ts +5 -4
- package/components/dialog/parts/DialogAction.js +19 -11
- package/components/dialog/style/_dialog.scss +7 -30
- package/components/dialog/style/dnb-dialog.css +21 -44
- package/components/dialog/style/dnb-dialog.min.css +1 -1
- package/components/dialog/style/themes/dnb-dialog-theme-ui.css +20 -0
- package/components/dialog/style/themes/dnb-dialog-theme-ui.min.css +1 -1
- package/components/dialog/style/themes/dnb-dialog-theme-ui.scss +29 -0
- package/components/drawer/style/_drawer.scss +1 -0
- package/components/drawer/style/dnb-drawer.css +12 -22
- package/components/drawer/style/dnb-drawer.min.css +1 -1
- package/components/height-animation/useHeightAnimation.js +4 -3
- package/components/lib.d.ts +1 -1
- package/components/modal/style/dnb-modal.css +11 -22
- package/components/modal/style/dnb-modal.min.css +1 -1
- package/components/number-format/NumberFormat.js +1 -1
- package/components/table/Table.js +1 -1
- package/components/table/TableContainer.js +3 -1
- package/components/table/TableStickyHeader.d.ts +4 -1
- package/components/table/TableStickyHeader.js +112 -51
- package/components/table/TableTh.d.ts +1 -1
- package/components/table/TableTh.js +4 -1
- package/components/table/style/_table-cell.scss +4 -4
- package/components/table/style/_table-container.scss +7 -17
- package/components/table/style/_table-deprecated.scss +74 -0
- package/components/table/style/_table-header-buttons.scss +2 -1
- package/components/table/style/_table-sticky.scss +24 -23
- package/components/table/style/_table-td.scss +27 -46
- package/components/table/style/_table-th.scss +44 -0
- package/components/table/style/_table.scss +13 -71
- package/components/table/style/dnb-table.css +181 -132
- package/components/table/style/dnb-table.min.css +1 -1
- package/components/table/style/themes/dnb-table-theme-ui.css +78 -63
- package/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/components/table/style/themes/dnb-table-theme-ui.scss +42 -17
- package/components/visually-hidden/VisuallyHidden.d.ts +2 -11
- package/components/visually-hidden/VisuallyHidden.js +2 -5
- package/components/visually-hidden/style/_visually-hidden.scss +0 -8
- package/components/visually-hidden/style/dnb-visually-hidden.css +10 -42
- package/components/visually-hidden/style/dnb-visually-hidden.min.css +1 -1
- package/elements/Table.d.ts +6 -2
- package/elements/Td.d.ts +6 -2
- package/elements/Th.d.ts +6 -2
- package/elements/Tr.d.ts +6 -2
- package/es/components/accordion/style/_accordion.scss +2 -2
- package/es/components/accordion/style/dnb-accordion.css +3 -3
- package/es/components/accordion/style/dnb-accordion.min.css +1 -1
- package/es/components/dialog/Dialog.d.ts +1 -1
- package/es/components/dialog/parts/DialogAction.d.ts +5 -4
- package/es/components/dialog/parts/DialogAction.js +21 -11
- package/es/components/dialog/style/_dialog.scss +7 -30
- package/es/components/dialog/style/dnb-dialog.css +21 -44
- package/es/components/dialog/style/dnb-dialog.min.css +1 -1
- package/es/components/dialog/style/themes/dnb-dialog-theme-ui.css +20 -0
- package/es/components/dialog/style/themes/dnb-dialog-theme-ui.min.css +1 -1
- package/es/components/dialog/style/themes/dnb-dialog-theme-ui.scss +29 -0
- package/es/components/drawer/style/_drawer.scss +1 -0
- package/es/components/drawer/style/dnb-drawer.css +12 -22
- package/es/components/drawer/style/dnb-drawer.min.css +1 -1
- package/es/components/height-animation/useHeightAnimation.js +4 -3
- package/es/components/lib.d.ts +1 -1
- package/es/components/modal/style/dnb-modal.css +11 -22
- package/es/components/modal/style/dnb-modal.min.css +1 -1
- package/es/components/number-format/NumberFormat.js +1 -1
- package/es/components/table/Table.js +1 -1
- package/es/components/table/TableContainer.js +3 -1
- package/es/components/table/TableStickyHeader.d.ts +4 -1
- package/es/components/table/TableStickyHeader.js +112 -48
- package/es/components/table/TableTh.d.ts +1 -1
- package/es/components/table/TableTh.js +4 -1
- package/es/components/table/style/_table-cell.scss +4 -4
- package/es/components/table/style/_table-container.scss +7 -17
- package/es/components/table/style/_table-deprecated.scss +74 -0
- package/es/components/table/style/_table-header-buttons.scss +2 -1
- package/es/components/table/style/_table-sticky.scss +24 -23
- package/es/components/table/style/_table-td.scss +27 -46
- package/es/components/table/style/_table-th.scss +44 -0
- package/es/components/table/style/_table.scss +13 -71
- package/es/components/table/style/dnb-table.css +181 -132
- package/es/components/table/style/dnb-table.min.css +1 -1
- package/es/components/table/style/themes/dnb-table-theme-ui.css +78 -63
- 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 +42 -17
- package/es/components/visually-hidden/VisuallyHidden.d.ts +2 -11
- package/es/components/visually-hidden/VisuallyHidden.js +2 -5
- package/es/components/visually-hidden/style/_visually-hidden.scss +0 -8
- package/es/components/visually-hidden/style/dnb-visually-hidden.css +10 -42
- package/es/components/visually-hidden/style/dnb-visually-hidden.min.css +1 -1
- package/es/elements/Table.d.ts +6 -2
- package/es/elements/Td.d.ts +6 -2
- package/es/elements/Th.d.ts +6 -2
- package/es/elements/Tr.d.ts +6 -2
- package/es/shared/Eufemia.js +1 -1
- package/es/style/core/helper-classes/helper-classes.scss +3 -0
- package/es/style/core/utilities.scss +15 -16
- package/es/style/dnb-ui-basis.css +20 -13
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-components.css +205 -199
- package/es/style/dnb-ui-components.min.css +4 -4
- package/es/style/dnb-ui-core.css +20 -13
- package/es/style/dnb-ui-core.min.css +1 -1
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.css +98 -63
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +2 -2
- package/es/style/themes/theme-ui/dnb-theme-ui.css +98 -63
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +2 -2
- package/esm/dnb-ui-basis.min.mjs +2 -2
- package/esm/dnb-ui-components.min.mjs +4 -4
- package/esm/dnb-ui-elements.min.mjs +4 -4
- package/esm/dnb-ui-extensions.min.mjs +4 -4
- package/esm/dnb-ui-lib.min.mjs +4 -4
- package/esm/dnb-ui-web-components.min.mjs +4 -4
- package/package.json +2 -2
- package/shared/Eufemia.js +1 -1
- package/style/core/helper-classes/helper-classes.scss +3 -0
- package/style/core/utilities.scss +15 -16
- package/style/dnb-ui-basis.css +20 -13
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-components.css +205 -199
- package/style/dnb-ui-components.min.css +4 -4
- package/style/dnb-ui-core.css +20 -13
- package/style/dnb-ui-core.min.css +1 -1
- package/style/themes/theme-eiendom/dnb-theme-eiendom.css +98 -63
- package/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +2 -2
- package/style/themes/theme-ui/dnb-theme-ui.css +98 -63
- package/style/themes/theme-ui/dnb-theme-ui.min.css +2 -2
- package/umd/dnb-ui-basis.min.js +3 -3
- package/umd/dnb-ui-components.min.js +5 -5
- package/umd/dnb-ui-elements.min.js +4 -4
- package/umd/dnb-ui-extensions.min.js +5 -5
- package/umd/dnb-ui-lib.min.js +5 -5
- package/umd/dnb-ui-web-components.min.js +5 -5
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
var _tr;
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { warn } from '../../shared/component-helper';
|
|
4
|
+
import { getPreviousSibling, warn } from '../../shared/component-helper';
|
|
5
|
+
import { getOffsetTop } from '../../shared/helpers';
|
|
5
6
|
export const useStickyHeader = ({
|
|
6
7
|
sticky,
|
|
7
8
|
stickyOffset,
|
|
@@ -12,87 +13,150 @@ export const useStickyHeader = ({
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const elementRef = React.useRef();
|
|
15
|
-
const intersectionObserver = React.useRef(null);
|
|
16
16
|
React.useEffect(() => {
|
|
17
17
|
if (sticky) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!elementRef.current) {
|
|
24
|
-
stickyWarning('No ref element given');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const tableElem = elementRef.current;
|
|
28
|
-
let thHeight = 80;
|
|
18
|
+
let isSticky = false;
|
|
19
|
+
let thHeight = 0;
|
|
29
20
|
let offsetTopPx = 0;
|
|
21
|
+
let tableOffset = 0;
|
|
22
|
+
let tableHeight = 0;
|
|
23
|
+
let totalOffset = 0;
|
|
24
|
+
let hasScrollbar = null;
|
|
25
|
+
let scrollViewElem = null;
|
|
26
|
+
let timeout = null;
|
|
30
27
|
|
|
31
28
|
try {
|
|
29
|
+
const tableElem = elementRef.current;
|
|
32
30
|
const trElem = tableElem.querySelector('thead > tr:first-of-type, thead > .dnb-table__tr:first-of-type');
|
|
33
|
-
|
|
31
|
+
const thElem = getThElement(tableElem);
|
|
32
|
+
const inIframe = window.self !== window.top;
|
|
33
|
+
|
|
34
|
+
const setSizes = () => {
|
|
35
|
+
offsetTopPx = parseFloat(String(stickyOffset)) || 0;
|
|
36
|
+
|
|
37
|
+
if (offsetTopPx > 0) {
|
|
38
|
+
if (String(stickyOffset).includes('rem')) {
|
|
39
|
+
offsetTopPx = Math.round(offsetTopPx * 16);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const modalElem = getPreviousSibling('.dnb-modal__content', tableElem);
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
if (modalElem) {
|
|
46
|
+
scrollViewElem = modalElem.querySelector('.dnb-scroll-view');
|
|
47
|
+
|
|
48
|
+
if (offsetTopPx === 0) {
|
|
49
|
+
offsetTopPx = modalElem.querySelector('.dnb-modal__header__bar').offsetHeight || 0;
|
|
50
|
+
}
|
|
39
51
|
} else {
|
|
52
|
+
const scrollElem = getPreviousSibling('.dnb-scroll-view', tableElem);
|
|
53
|
+
|
|
54
|
+
if (scrollElem) {
|
|
55
|
+
hasScrollbar = scrollElem.scrollHeight - 1 > scrollElem.offsetHeight;
|
|
56
|
+
|
|
57
|
+
if (hasScrollbar) {
|
|
58
|
+
scrollViewElem = scrollElem;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
thHeight = thElem.offsetHeight;
|
|
64
|
+
tableHeight = tableElem.offsetHeight;
|
|
65
|
+
tableOffset = getOffsetTop(tableElem);
|
|
66
|
+
totalOffset = tableOffset - (inIframe ? 0 : offsetTopPx);
|
|
67
|
+
|
|
68
|
+
if (sticky === 'css-position') {
|
|
40
69
|
trElem.style.setProperty('--table-top', `${offsetTopPx / 16}rem`);
|
|
41
70
|
}
|
|
42
|
-
}
|
|
71
|
+
};
|
|
43
72
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
let offset = 0;
|
|
74
|
+
|
|
75
|
+
const onScroll = () => {
|
|
76
|
+
if (scrollViewElem) {
|
|
77
|
+
offset = scrollViewElem.scrollTop;
|
|
78
|
+
} else {
|
|
79
|
+
offset = window.pageYOffset;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
offset -= hasScrollbar ? offsetTopPx : totalOffset;
|
|
83
|
+
|
|
84
|
+
if (offset > 0 && offset < tableHeight - thHeight) {
|
|
85
|
+
if (sticky !== 'css-position') {
|
|
86
|
+
trElem.style.setProperty('--table-offset', String(offset) + 'px');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!isSticky) {
|
|
90
|
+
isSticky = true;
|
|
91
|
+
trElem.classList.add('is-sticky');
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
if (isSticky) {
|
|
95
|
+
isSticky = false;
|
|
96
|
+
|
|
97
|
+
if (offset <= 0) {
|
|
98
|
+
if (sticky !== 'css-position') {
|
|
99
|
+
trElem.style.removeProperty('--table-offset');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
trElem.classList.remove('is-sticky');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const onResize = () => {
|
|
109
|
+
setSizes();
|
|
110
|
+
onScroll();
|
|
111
|
+
};
|
|
48
112
|
|
|
113
|
+
const applyObservers = () => {
|
|
49
114
|
try {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
trElem.classList.add('
|
|
115
|
+
trElem.classList.add('sticky');
|
|
116
|
+
|
|
117
|
+
if (sticky === 'css-position') {
|
|
118
|
+
trElem.classList.add('css-position');
|
|
54
119
|
}
|
|
120
|
+
|
|
121
|
+
setSizes();
|
|
122
|
+
const scrollElem = scrollViewElem || document;
|
|
123
|
+
scrollElem.addEventListener('scroll', onScroll);
|
|
124
|
+
window.addEventListener('resize', onResize);
|
|
55
125
|
} catch (e) {
|
|
56
126
|
stickyWarning(e);
|
|
57
127
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
timeout = setTimeout(applyObservers, 100);
|
|
131
|
+
return () => {
|
|
132
|
+
clearTimeout(timeout);
|
|
133
|
+
document.removeEventListener('scroll', onScroll);
|
|
134
|
+
window.removeEventListener('resize', onResize);
|
|
135
|
+
};
|
|
67
136
|
} catch (e) {
|
|
68
137
|
stickyWarning(e);
|
|
69
138
|
}
|
|
70
139
|
}
|
|
71
|
-
|
|
72
|
-
return () => {
|
|
73
|
-
var _intersectionObserver;
|
|
74
|
-
|
|
75
|
-
(_intersectionObserver = intersectionObserver.current) === null || _intersectionObserver === void 0 ? void 0 : _intersectionObserver.disconnect();
|
|
76
|
-
};
|
|
77
140
|
}, [elementRef, sticky, stickyOffset]);
|
|
78
141
|
return {
|
|
79
142
|
elementRef
|
|
80
143
|
};
|
|
81
144
|
};
|
|
82
145
|
export const StickyHelper = () => {
|
|
146
|
+
warn('Table.StickyHelper is deprecated!');
|
|
83
147
|
return _tr || (_tr = React.createElement("tr", {
|
|
84
|
-
className: "dnb-table__sticky-helper"
|
|
85
|
-
|
|
148
|
+
className: "dnb-table__sticky-helper",
|
|
149
|
+
"aria-hidden": true,
|
|
150
|
+
role: "presentation"
|
|
151
|
+
}, React.createElement("td", {
|
|
152
|
+
colSpan: 100
|
|
153
|
+
})));
|
|
86
154
|
};
|
|
87
155
|
|
|
88
156
|
const stickyWarning = (message = '') => {
|
|
89
157
|
warn('Could not enable Sticky mode in table:', message);
|
|
90
158
|
};
|
|
91
159
|
|
|
92
|
-
const getTdElement = element => {
|
|
93
|
-
return element.querySelector('tbody > tr:not(.dnb-table__sticky-helper):first-of-type > td:first-of-type, tbody > .dnb-table__tr:first-of-type > .dnb-table__td:first-of-type');
|
|
94
|
-
};
|
|
95
|
-
|
|
96
160
|
const getThElement = element => {
|
|
97
161
|
return element.querySelector('thead > tr:first-of-type > th:first-of-type, thead > .dnb-table__tr:first-of-type > .dnb-table__th:first-of-type');
|
|
98
162
|
};
|
|
@@ -26,7 +26,7 @@ export declare type TableThProps = {
|
|
|
26
26
|
/**
|
|
27
27
|
* The content of the table header given as Tr.
|
|
28
28
|
*/
|
|
29
|
-
children
|
|
29
|
+
children?: TableThChildren | Array<TableThChildren>;
|
|
30
30
|
};
|
|
31
31
|
declare function Th(componentProps: TableThProps & React.ThHTMLAttributes<HTMLTableCellElement>): JSX.Element;
|
|
32
32
|
declare namespace Th {
|
|
@@ -17,8 +17,11 @@ export default function Th(componentProps) {
|
|
|
17
17
|
} = componentProps,
|
|
18
18
|
props = _objectWithoutProperties(componentProps, _excluded);
|
|
19
19
|
|
|
20
|
+
const role = props.scope === 'row' ? 'rowheader' : 'columnheader';
|
|
21
|
+
const scope = props.scope === 'row' ? 'row' : 'col';
|
|
20
22
|
return React.createElement("th", _extends({
|
|
21
|
-
role:
|
|
23
|
+
role: role,
|
|
24
|
+
scope: scope,
|
|
22
25
|
className: classnames('dnb-table__th', className, sortable && 'dnb-table--sortable', active && 'dnb-table--active', reversed && 'dnb-table--reversed', noWrap && 'dnb-table--no-wrap')
|
|
23
26
|
}, props), children);
|
|
24
27
|
}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
.dnb-table {
|
|
7
|
-
& > tr > th,
|
|
8
|
-
& > tr > td,
|
|
9
|
-
& > thead > tr > th,
|
|
10
|
-
& > tbody > tr > td,
|
|
7
|
+
& > tr > th, /* should be deprecated */
|
|
8
|
+
& > tr > td, /* should be deprecated */
|
|
9
|
+
& > thead > tr > th, /* should be deprecated */
|
|
10
|
+
& > tbody > tr > td, /* should be deprecated */
|
|
11
11
|
&__th,
|
|
12
12
|
&__td {
|
|
13
13
|
position: relative;
|
|
@@ -3,28 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@mixin tableBorder {
|
|
7
|
-
content: '';
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
z-index: 1;
|
|
14
|
-
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
6
|
.dnb-table__container {
|
|
19
7
|
position: relative;
|
|
20
8
|
|
|
21
|
-
--border: 0.0625rem solid var(--color-black-8);
|
|
22
|
-
background-color: var(--color-white);
|
|
23
|
-
|
|
24
9
|
&::after {
|
|
25
10
|
@include tableBorder();
|
|
26
|
-
|
|
27
|
-
border: var(--
|
|
11
|
+
z-index: 3; // over sticky-header
|
|
12
|
+
border: var(--outline);
|
|
28
13
|
}
|
|
29
14
|
|
|
30
15
|
&,
|
|
@@ -58,4 +43,9 @@
|
|
|
58
43
|
&__foot {
|
|
59
44
|
padding: 0.5rem 1rem 2rem;
|
|
60
45
|
}
|
|
46
|
+
|
|
47
|
+
// When placed inside a Modal/Drawer, let the parent scroll-bar do its job.
|
|
48
|
+
.dnb-modal__content & .dnb-table__scroll-view {
|
|
49
|
+
overflow: visible;
|
|
50
|
+
}
|
|
61
51
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Table deprecated parts
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.dnb-table {
|
|
7
|
+
/* stylelint-disable */
|
|
8
|
+
|
|
9
|
+
// deprecated – can be removed in v10
|
|
10
|
+
&,
|
|
11
|
+
&--left {
|
|
12
|
+
text-align: left;
|
|
13
|
+
}
|
|
14
|
+
&--right {
|
|
15
|
+
text-align: right;
|
|
16
|
+
}
|
|
17
|
+
&--center {
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// deprecated – can be removed in v10
|
|
22
|
+
&--small,
|
|
23
|
+
&--small > tr > th,
|
|
24
|
+
&--small > tr > td,
|
|
25
|
+
&--small > thead > tr > th,
|
|
26
|
+
&--small > tbody > tr > td {
|
|
27
|
+
font-size: var(--font-size-small);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// deprecated – can be removed in v10
|
|
31
|
+
& > tr#{&}--small > th,
|
|
32
|
+
& > tr#{&}--small > td,
|
|
33
|
+
& > thead > tr#{&}--small > th,
|
|
34
|
+
& > tbody > tr#{&}--small > td {
|
|
35
|
+
font-size: var(--font-size-small);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// deprecated – can be removed in v10
|
|
39
|
+
& > tr > th#{&}--small,
|
|
40
|
+
& > tr > td#{&}--small,
|
|
41
|
+
& > thead > tr > th#{&}--small,
|
|
42
|
+
& > tbody > tr > td#{&}--small,
|
|
43
|
+
&__th#{&}--small,
|
|
44
|
+
&__td#{&}--small {
|
|
45
|
+
font-size: var(--font-size-small);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// deprecated – can be removed in v10
|
|
49
|
+
&--x-small,
|
|
50
|
+
&--x-small > tr > th,
|
|
51
|
+
&--x-small > tr > td,
|
|
52
|
+
&--x-small > thead > tr > th,
|
|
53
|
+
&--x-small > tbody > tr > td {
|
|
54
|
+
font-size: var(--font-size-x-small);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// deprecated – can be removed in v10
|
|
58
|
+
& > tr#{&}--x-small > th,
|
|
59
|
+
& > tr#{&}--x-small > td,
|
|
60
|
+
& > thead > tr#{&}--x-small > th,
|
|
61
|
+
& > tbody > tr#{&}--x-small > td {
|
|
62
|
+
font-size: var(--font-size-x-small);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// deprecated – can be removed in v10
|
|
66
|
+
& > tr > th#{&}--x-small,
|
|
67
|
+
& > tr > td#{&}--x-small,
|
|
68
|
+
& > thead > tr > th#{&}--x-small,
|
|
69
|
+
& > tbody > tr > td#{&}--x-small,
|
|
70
|
+
&__th#{&}--x-small,
|
|
71
|
+
&__td#{&}--x-small {
|
|
72
|
+
font-size: var(--font-size-x-small);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
// reset anchor
|
|
34
34
|
box-shadow: none;
|
|
35
35
|
|
|
36
|
-
line-height:
|
|
36
|
+
line-height: inherit;
|
|
37
37
|
|
|
38
38
|
margin: 0;
|
|
39
39
|
padding: 0;
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
.dnb-button__text {
|
|
48
48
|
margin: 0;
|
|
49
49
|
font-size: inherit;
|
|
50
|
+
line-height: inherit;
|
|
50
51
|
|
|
51
52
|
// underline
|
|
52
53
|
&::after {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
.dnb-table {
|
|
7
|
+
// Deprecated in v10
|
|
7
8
|
&__sticky-helper > td {
|
|
8
9
|
display: block;
|
|
9
10
|
overflow: hidden;
|
|
@@ -11,32 +12,32 @@
|
|
|
11
12
|
height: 0;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
// Target th because of Safari transparent issue
|
|
16
|
+
tr.sticky:not(.css-position) th {
|
|
17
|
+
position: relative;
|
|
18
|
+
z-index: 3; // over borders and TDs
|
|
19
|
+
|
|
20
|
+
will-change: transform;
|
|
21
|
+
transform: translate3d(0, var(--table-offset, 0), 0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
tr.sticky.css-position {
|
|
15
25
|
position: sticky;
|
|
26
|
+
z-index: 3; // over borders and TDs
|
|
16
27
|
top: var(--table-top, 0); // is set by "stickyOffset" prop
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
&::before {
|
|
20
|
-
content: '';
|
|
21
|
-
position: absolute;
|
|
22
|
-
opacity: 0;
|
|
23
|
-
left: 0;
|
|
24
|
-
right: 0;
|
|
25
|
-
bottom: 0;
|
|
26
|
-
height: 6px;
|
|
28
|
+
}
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
tr.sticky.is-sticky th::before {
|
|
31
|
+
content: '';
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
height: 6px;
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
tr.sticky.show-shadow th::before {
|
|
40
|
-
opacity: 1;
|
|
38
|
+
// The @mixin defaultDropShadow() does not work in this case
|
|
39
|
+
// because we need only a bottom shadow (with clip-path)
|
|
40
|
+
box-shadow: var(--shadow-default-x) -2px 12px 8px var(--shadow-default-color);
|
|
41
|
+
clip-path: inset(6px 0 -48px 0);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -5,24 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
@import './_table-header-buttons.scss';
|
|
7
7
|
|
|
8
|
-
@mixin tableBorder {
|
|
9
|
-
content: '';
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
right: 0;
|
|
14
|
-
bottom: 0;
|
|
15
|
-
z-index: -1;
|
|
16
|
-
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
8
|
.dnb-table {
|
|
21
9
|
// table border
|
|
22
|
-
--border: 0.0625rem solid var(--color-black-8);
|
|
23
10
|
&--border tbody &__td {
|
|
24
|
-
z-index: 2; // ensure border is behind content
|
|
25
|
-
|
|
26
11
|
&::after {
|
|
27
12
|
@include tableBorder();
|
|
28
13
|
|
|
@@ -40,26 +25,7 @@
|
|
|
40
25
|
}
|
|
41
26
|
|
|
42
27
|
// table outline
|
|
43
|
-
--outline: 0.0625rem solid var(--color-black-8);
|
|
44
|
-
&--outline thead &__th {
|
|
45
|
-
z-index: 2; // ensure border is behind content
|
|
46
|
-
|
|
47
|
-
&::after {
|
|
48
|
-
@include tableBorder();
|
|
49
|
-
|
|
50
|
-
border-top: var(--outline);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&:first-of-type::after {
|
|
54
|
-
border-left: var(--outline);
|
|
55
|
-
}
|
|
56
|
-
&:last-of-type::after {
|
|
57
|
-
border-right: var(--outline);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
28
|
&--outline tbody &__td {
|
|
61
|
-
z-index: 2; // ensure border is behind content
|
|
62
|
-
|
|
63
29
|
&:first-of-type::after,
|
|
64
30
|
&:last-of-type::after {
|
|
65
31
|
@include tableBorder();
|
|
@@ -71,38 +37,53 @@
|
|
|
71
37
|
&:last-of-type::after {
|
|
72
38
|
border-right: var(--outline);
|
|
73
39
|
}
|
|
40
|
+
|
|
41
|
+
/* stylelint-disable */
|
|
42
|
+
&,
|
|
43
|
+
&::before,
|
|
44
|
+
&::after {
|
|
45
|
+
transition: border-radius 400ms var(--easing-default);
|
|
46
|
+
}
|
|
47
|
+
/* stylelint-enable */
|
|
74
48
|
}
|
|
75
49
|
&--outline tbody &__tr:last-of-type &__td {
|
|
76
|
-
z-index: 2; // ensure border is behind content
|
|
77
|
-
|
|
78
50
|
&::after {
|
|
79
51
|
@include tableBorder();
|
|
80
52
|
|
|
81
53
|
border-bottom: var(--outline);
|
|
82
54
|
}
|
|
83
55
|
}
|
|
84
|
-
&--outline
|
|
56
|
+
&--outline tbody &__tr:last-of-type &__td:first-of-type {
|
|
85
57
|
&,
|
|
58
|
+
&::before,
|
|
86
59
|
&::after {
|
|
87
|
-
border-radius: 0
|
|
60
|
+
border-radius: 0 0 0 0.5rem;
|
|
88
61
|
}
|
|
89
62
|
}
|
|
90
|
-
&--outline
|
|
63
|
+
&--outline tbody &__tr:last-of-type &__td:last-of-type {
|
|
91
64
|
&,
|
|
65
|
+
&::before,
|
|
92
66
|
&::after {
|
|
93
|
-
border-radius: 0 0.5rem 0
|
|
67
|
+
border-radius: 0 0 0.5rem 0;
|
|
94
68
|
}
|
|
95
69
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
70
|
+
|
|
71
|
+
// reset parts if a "th" is used before td (row header)
|
|
72
|
+
&--outline tbody &__tr &__th ~ &__td:first-of-type {
|
|
73
|
+
&:first-of-type::after {
|
|
74
|
+
border-left: none;
|
|
100
75
|
}
|
|
101
76
|
}
|
|
102
|
-
&--
|
|
77
|
+
&--border tbody &__tr &__th ~ &__td:first-of-type {
|
|
78
|
+
&:first-of-type::after {
|
|
79
|
+
border-left: var(--border);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&--outline tbody &__tr:last-of-type &__th ~ &__td:first-of-type {
|
|
103
83
|
&,
|
|
84
|
+
&::before,
|
|
104
85
|
&::after {
|
|
105
|
-
border-radius: 0 0 0
|
|
86
|
+
border-radius: 0 0 0 0;
|
|
106
87
|
}
|
|
107
88
|
}
|
|
108
89
|
|
|
@@ -10,4 +10,48 @@
|
|
|
10
10
|
display: flex;
|
|
11
11
|
align-items: flex-end; // bottom align help-button or other additional elements
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
// table border
|
|
15
|
+
&--outline thead &__th {
|
|
16
|
+
&::after {
|
|
17
|
+
@include tableBorder();
|
|
18
|
+
|
|
19
|
+
border-top: var(--outline);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:first-of-type::after {
|
|
23
|
+
border-left: var(--outline);
|
|
24
|
+
}
|
|
25
|
+
&:last-of-type::after {
|
|
26
|
+
border-right: var(--outline);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
&--outline thead &__th:first-of-type {
|
|
30
|
+
&,
|
|
31
|
+
&::after {
|
|
32
|
+
border-radius: 0.5rem 0 0 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&--outline thead &__th:last-of-type {
|
|
36
|
+
&,
|
|
37
|
+
&::after {
|
|
38
|
+
border-radius: 0 0.5rem 0 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
&--outline tbody &__th:first-of-type::after {
|
|
42
|
+
@include tableBorder();
|
|
43
|
+
|
|
44
|
+
border-left: var(--outline);
|
|
45
|
+
}
|
|
46
|
+
&--outline tbody &__tr:last-of-type &__th {
|
|
47
|
+
&::after {
|
|
48
|
+
@include tableBorder();
|
|
49
|
+
|
|
50
|
+
border-bottom: var(--outline);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:first-of-type::after {
|
|
54
|
+
border-radius: 0 0 0 0.5rem;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
13
57
|
}
|