@dnb/eufemia 9.46.2 → 9.47.1
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 +22 -0
- package/cjs/components/input-masked/InputMasked.js +13 -1
- package/cjs/components/input-masked/InputMaskedHooks.js +1 -1
- package/cjs/components/input-masked/InputMaskedUtils.js +3 -3
- package/cjs/components/table/TableContainer.d.ts +3 -3
- package/cjs/components/table/TableContainer.js +20 -1
- package/cjs/components/table/TableTh.js +2 -2
- package/cjs/components/table/style/_table-accordion.scss +52 -8
- package/cjs/components/table/style/_table-container.scss +20 -2
- package/cjs/components/table/style/_table-td.scss +35 -67
- package/cjs/components/table/style/_table-th.scss +41 -34
- package/cjs/components/table/style/_table.scss +12 -13
- package/cjs/components/table/style/dnb-table-mixins.css +0 -0
- package/cjs/components/table/style/dnb-table-mixins.min.css +0 -0
- package/cjs/components/table/style/dnb-table-mixins.scss +11 -0
- package/cjs/components/table/style/dnb-table.css +124 -137
- package/cjs/components/table/style/dnb-table.min.css +8 -7
- package/cjs/components/table/style/themes/dnb-table-theme-ui.css +7 -3
- 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 +6 -12
- package/cjs/components/upload/Upload.js +0 -1
- package/cjs/components/upload/UploadFileInput.js +2 -10
- package/cjs/components/upload/UploadFileList.js +0 -1
- package/cjs/components/upload/UploadFileListCell.js +22 -23
- package/cjs/components/upload/UploadInfo.js +1 -9
- package/cjs/components/upload/UploadVerify.d.ts +3 -0
- package/cjs/components/upload/UploadVerify.js +27 -3
- package/cjs/shared/Eufemia.js +1 -1
- package/cjs/style/dnb-ui-components.css +124 -137
- package/cjs/style/dnb-ui-components.min.css +8 -7
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.css +7 -3
- package/cjs/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +7 -3
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/components/input-masked/InputMasked.js +13 -1
- package/components/input-masked/InputMaskedHooks.js +1 -1
- package/components/input-masked/InputMaskedUtils.js +3 -3
- package/components/table/TableContainer.d.ts +3 -3
- package/components/table/TableContainer.js +21 -1
- package/components/table/TableTh.js +2 -2
- package/components/table/style/_table-accordion.scss +52 -8
- package/components/table/style/_table-container.scss +20 -2
- package/components/table/style/_table-td.scss +35 -67
- package/components/table/style/_table-th.scss +41 -34
- package/components/table/style/_table.scss +12 -13
- package/components/table/style/dnb-table-mixins.css +0 -0
- package/components/table/style/dnb-table-mixins.min.css +0 -0
- package/components/table/style/dnb-table-mixins.scss +11 -0
- package/components/table/style/dnb-table.css +124 -137
- package/components/table/style/dnb-table.min.css +8 -7
- package/components/table/style/themes/dnb-table-theme-ui.css +7 -3
- package/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
- package/components/table/style/themes/dnb-table-theme-ui.scss +6 -12
- package/components/upload/Upload.js +0 -1
- package/components/upload/UploadFileInput.js +3 -10
- package/components/upload/UploadFileList.js +0 -1
- package/components/upload/UploadFileListCell.js +17 -19
- package/components/upload/UploadInfo.js +1 -9
- package/components/upload/UploadVerify.d.ts +3 -0
- package/components/upload/UploadVerify.js +18 -1
- package/es/components/input-masked/InputMasked.js +12 -1
- package/es/components/input-masked/InputMaskedHooks.js +1 -1
- package/es/components/input-masked/InputMaskedUtils.js +3 -3
- package/es/components/table/TableContainer.d.ts +3 -3
- package/es/components/table/TableContainer.js +21 -1
- package/es/components/table/TableTh.js +2 -2
- package/es/components/table/style/_table-accordion.scss +52 -8
- package/es/components/table/style/_table-container.scss +20 -2
- package/es/components/table/style/_table-td.scss +35 -67
- package/es/components/table/style/_table-th.scss +41 -34
- package/es/components/table/style/_table.scss +12 -13
- package/es/components/table/style/dnb-table-mixins.css +0 -0
- package/es/components/table/style/dnb-table-mixins.min.css +0 -0
- package/es/components/table/style/dnb-table-mixins.scss +11 -0
- package/es/components/table/style/dnb-table.css +124 -137
- package/es/components/table/style/dnb-table.min.css +8 -7
- package/es/components/table/style/themes/dnb-table-theme-ui.css +7 -3
- 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 +6 -12
- package/es/components/upload/Upload.js +0 -1
- package/es/components/upload/UploadFileInput.js +3 -7
- package/es/components/upload/UploadFileList.js +0 -1
- package/es/components/upload/UploadFileListCell.js +14 -18
- package/es/components/upload/UploadInfo.js +1 -9
- package/es/components/upload/UploadVerify.d.ts +3 -0
- package/es/components/upload/UploadVerify.js +11 -1
- package/es/shared/Eufemia.js +1 -1
- package/es/style/dnb-ui-components.css +124 -137
- package/es/style/dnb-ui-components.min.css +8 -7
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.css +7 -3
- package/es/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.css +7 -3
- 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 +2 -2
- package/esm/dnb-ui-extensions.min.mjs +1 -1
- package/esm/dnb-ui-lib.min.mjs +2 -2
- package/esm/dnb-ui-web-components.min.mjs +2 -2
- package/package.json +1 -1
- package/shared/Eufemia.js +1 -1
- package/style/dnb-ui-components.css +124 -137
- package/style/dnb-ui-components.min.css +8 -7
- package/style/themes/theme-eiendom/dnb-theme-eiendom.css +7 -3
- package/style/themes/theme-eiendom/dnb-theme-eiendom.min.css +1 -1
- package/style/themes/theme-ui/dnb-theme-ui.css +7 -3
- 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 +2 -2
- package/umd/dnb-ui-extensions.min.js +1 -1
- package/umd/dnb-ui-lib.min.js +2 -2
- package/umd/dnb-ui-web-components.min.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to @dnb/eufemia will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.47.1](https://github.com/dnbexperience/eufemia/compare/v9.47.0...v9.47.1) (2023-02-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **InputMasked:** avoid inherit mask options and types when custom mask is used ([#1988](https://github.com/dnbexperience/eufemia/issues/1988)) ([8937bcc](https://github.com/dnbexperience/eufemia/commit/8937bcc7842ba079318215c23d5e47c38fc91aeb))
|
|
12
|
+
* **InputMasked:** fix negative value updates (number mask) ([#1792](https://github.com/dnbexperience/eufemia/issues/1792)) ([e2b9482](https://github.com/dnbexperience/eufemia/commit/e2b94826d08572cb3008cb837658186644b8d0ba))
|
|
13
|
+
* **Upload:** fix handling of file types in combination with file extension ([#1986](https://github.com/dnbexperience/eufemia/issues/1986)) ([3fd9bfa](https://github.com/dnbexperience/eufemia/commit/3fd9bfab541dba28980edb1ef00c403723d8b4e7))
|
|
14
|
+
|
|
15
|
+
# [9.47.0](https://github.com/dnbexperience/eufemia/compare/v9.46.2...v9.47.0) (2023-02-05)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **TableContainer:** enhance handling of empty head and foot area ([#1970](https://github.com/dnbexperience/eufemia/issues/1970)) ([762c667](https://github.com/dnbexperience/eufemia/commit/762c667f48c3039d23dd9c66901fe0776bd77f57))
|
|
21
|
+
* **TableContainer:** ensure bottom border on all tables ([#1969](https://github.com/dnbexperience/eufemia/issues/1969)) ([4583ba8](https://github.com/dnbexperience/eufemia/commit/4583ba83f1ff8144851770219333a74d535efbce))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **Table:** add support for row scope only header ([#1971](https://github.com/dnbexperience/eufemia/issues/1971)) ([aff2e40](https://github.com/dnbexperience/eufemia/commit/aff2e403b991c8ec53d4eccfbed9a92234c47e13))
|
|
27
|
+
|
|
6
28
|
## [9.46.2](https://github.com/dnbexperience/eufemia/compare/v9.46.1...v9.46.2) (2023-01-29)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -33,6 +33,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
33
33
|
});
|
|
34
34
|
exports.default = void 0;
|
|
35
35
|
|
|
36
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
37
|
+
|
|
36
38
|
var _react = _interopRequireDefault(require("react"));
|
|
37
39
|
|
|
38
40
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -64,6 +66,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
64
66
|
var InputMasked = _react.default.forwardRef(function (props, ref) {
|
|
65
67
|
var context = _react.default.useContext(_Context.default);
|
|
66
68
|
|
|
69
|
+
if (props !== null && props !== void 0 && props.mask) {
|
|
70
|
+
var alias = context === null || context === void 0 ? void 0 : context.InputMasked;
|
|
71
|
+
|
|
72
|
+
for (var key in alias) {
|
|
73
|
+
if (/^as[_A-Z]|number_mask|currency_mask/.test(key)) {
|
|
74
|
+
delete alias[key];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
67
79
|
var contextAndProps = _react.default.useCallback((0, _componentHelper.extendPropsWithContext)(props, InputMasked.defaultProps, context === null || context === void 0 ? void 0 : context.InputMasked), [props, InputMasked.defaultProps, context === null || context === void 0 ? void 0 : context.InputMasked]);
|
|
68
80
|
|
|
69
81
|
return _react.default.createElement(_InputMaskedContext.default.Provider, {
|
|
@@ -107,7 +119,7 @@ process.env.NODE_ENV !== "production" ? InputMasked.propTypes = _objectSpread({
|
|
|
107
119
|
on_submit_blur: _propTypes.default.func
|
|
108
120
|
}, _Input.inputPropTypes) : void 0;
|
|
109
121
|
InputMasked.defaultProps = _objectSpread(_objectSpread({}, _Input.default.defaultProps), {}, {
|
|
110
|
-
mask:
|
|
122
|
+
mask: null,
|
|
111
123
|
number_mask: null,
|
|
112
124
|
currency_mask: null,
|
|
113
125
|
mask_options: null,
|
|
@@ -286,7 +286,7 @@ var useInputElement = function useInputElement() {
|
|
|
286
286
|
inputRef: ref,
|
|
287
287
|
inputElement: inputElementRef.current,
|
|
288
288
|
pipe: pipe,
|
|
289
|
-
mask: mask,
|
|
289
|
+
mask: mask || [],
|
|
290
290
|
showMask: showMask,
|
|
291
291
|
guide: showGuide,
|
|
292
292
|
keepCharPositions: keepCharPositions,
|
|
@@ -163,8 +163,8 @@ var correctNumberValue = function correctNumberValue(_ref5) {
|
|
|
163
163
|
value = value.replace('.', decimalSymbol);
|
|
164
164
|
|
|
165
165
|
if (localValue !== null) {
|
|
166
|
-
var localNumberValue = localValue.replace(/[^\d
|
|
167
|
-
var numberValue = value.replace(/[^\d
|
|
166
|
+
var localNumberValue = localValue.replace(/[^\d,.-]/g, '');
|
|
167
|
+
var numberValue = value.replace(/[^\d,.-]/g, '');
|
|
168
168
|
var endsWithDecimal = localNumberValue.endsWith(decimalSymbol);
|
|
169
169
|
var endsWithZeroAndDecimal = localNumberValue.endsWith("".concat(decimalSymbol, "0"));
|
|
170
170
|
|
|
@@ -178,7 +178,7 @@ var correctNumberValue = function correctNumberValue(_ref5) {
|
|
|
178
178
|
value = localValue;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
if (
|
|
181
|
+
if (/^(-|-0)$/.test(localValue.replace(/[^\d-0]/g, ''))) {
|
|
182
182
|
value = localValue;
|
|
183
183
|
} else if (localNumberValue === '' && numberValue === '0') {
|
|
184
184
|
value = '';
|
|
@@ -9,7 +9,7 @@ export declare type TableContainerProps = {
|
|
|
9
9
|
React.ReactElement<TableContainerHeadProps>,
|
|
10
10
|
React.ReactElement<TableContainerBodyProps>,
|
|
11
11
|
React.ReactElement<TableContainerFootProps>
|
|
12
|
-
]
|
|
12
|
+
] | React.ReactElement<TableContainerBodyProps>;
|
|
13
13
|
};
|
|
14
14
|
export declare type TableContainerAllProps = TableContainerProps & React.TableHTMLAttributes<HTMLTableRowElement> & SpacingProps;
|
|
15
15
|
declare function TableContainer(props: TableContainerAllProps): JSX.Element;
|
|
@@ -30,13 +30,13 @@ export declare type TableContainerHeadProps = {
|
|
|
30
30
|
/**
|
|
31
31
|
* The content of the component.
|
|
32
32
|
*/
|
|
33
|
-
children
|
|
33
|
+
children?: React.ReactNode;
|
|
34
34
|
};
|
|
35
35
|
export declare function TableContainerHead(props: TableContainerHeadProps & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
36
36
|
export declare type TableContainerFootProps = {
|
|
37
37
|
/**
|
|
38
38
|
* The content of the component.
|
|
39
39
|
*/
|
|
40
|
-
children
|
|
40
|
+
children?: React.ReactNode;
|
|
41
41
|
};
|
|
42
42
|
export declare function TableContainerFoot(props: TableContainerFootProps & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
@@ -26,6 +26,8 @@ var _SpacingUtils = require("../space/SpacingUtils");
|
|
|
26
26
|
|
|
27
27
|
var _componentHelper = require("../../shared/component-helper");
|
|
28
28
|
|
|
29
|
+
var _TableContainer$Head, _TableContainer$Foot;
|
|
30
|
+
|
|
29
31
|
var _excluded = ["children", "className"],
|
|
30
32
|
_excluded2 = ["children", "className"],
|
|
31
33
|
_excluded3 = ["children", "className"],
|
|
@@ -40,6 +42,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
40
42
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
43
|
|
|
42
44
|
function TableContainer(props) {
|
|
45
|
+
var _content$, _content$2;
|
|
46
|
+
|
|
43
47
|
var children = props.children,
|
|
44
48
|
className = props.className,
|
|
45
49
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -47,9 +51,24 @@ function TableContainer(props) {
|
|
|
47
51
|
var spacingClasses = (0, _SpacingUtils.createSpacingClasses)(props);
|
|
48
52
|
(0, _componentHelper.validateDOMAttributes)(props, rest);
|
|
49
53
|
var ScrollView = _TableScrollView.default;
|
|
54
|
+
var isArray = Array.isArray(children);
|
|
55
|
+
var content = isArray ? children : [children];
|
|
56
|
+
|
|
57
|
+
if (((_content$ = content[0]) === null || _content$ === void 0 ? void 0 : _content$.type) !== TableContainer.Head) {
|
|
58
|
+
content.unshift(_TableContainer$Head || (_TableContainer$Head = _react.default.createElement(TableContainer.Head, {
|
|
59
|
+
key: "head"
|
|
60
|
+
})));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (((_content$2 = content[2]) === null || _content$2 === void 0 ? void 0 : _content$2.type) !== TableContainer.Foot) {
|
|
64
|
+
content.push(_TableContainer$Foot || (_TableContainer$Foot = _react.default.createElement(TableContainer.Foot, {
|
|
65
|
+
key: "foot"
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
68
|
+
|
|
50
69
|
return _react.default.createElement("section", _extends({
|
|
51
70
|
className: (0, _classnames.default)('dnb-table__container', className, spacingClasses)
|
|
52
|
-
}, rest), _react.default.createElement(ScrollView, null,
|
|
71
|
+
}, rest), _react.default.createElement(ScrollView, null, content));
|
|
53
72
|
}
|
|
54
73
|
|
|
55
74
|
function TableContainerBody(props) {
|
|
@@ -41,8 +41,8 @@ function Th(componentProps) {
|
|
|
41
41
|
noWrap = componentProps.noWrap,
|
|
42
42
|
props = _objectWithoutProperties(componentProps, _excluded);
|
|
43
43
|
|
|
44
|
-
var role = props.scope === 'row' ? 'rowheader' : 'columnheader';
|
|
45
|
-
var scope = props.scope === 'row' ? 'row' : 'col';
|
|
44
|
+
var role = props.scope === 'row' || props.scope === 'rowgroup' ? 'rowheader' : 'columnheader';
|
|
45
|
+
var scope = props.scope === 'row' ? 'row' : props.scope || 'col';
|
|
46
46
|
var ariaSort = sortable ? reversed ? 'descending' : 'ascending' : undefined;
|
|
47
47
|
return _react.default.createElement("th", _extends({
|
|
48
48
|
role: role,
|
|
@@ -72,13 +72,17 @@
|
|
|
72
72
|
position: relative;
|
|
73
73
|
z-index: 2;
|
|
74
74
|
}
|
|
75
|
-
&__tr--has-accordion-content:hover,
|
|
76
|
-
&__tr--has-accordion-content:active,
|
|
77
|
-
&__tr--has-accordion-content:focus,
|
|
78
75
|
&__tr--has-accordion-content#{&}__tr--expanded,
|
|
79
76
|
&__tr__accordion_content {
|
|
80
|
-
// ensure borders are visible in certain states
|
|
81
|
-
|
|
77
|
+
z-index: 3; // ensure borders are visible in certain states
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__tr--has-accordion-content {
|
|
81
|
+
&:hover,
|
|
82
|
+
&:active,
|
|
83
|
+
html[data-whatinput='keyboard'] &:focus {
|
|
84
|
+
z-index: 5; // over table outline border
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
&__tr--has-accordion-content#{&}__tr--expanded
|
|
@@ -129,6 +133,13 @@
|
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
|
|
136
|
+
&--outline
|
|
137
|
+
tbody
|
|
138
|
+
&__tr--has-accordion-content:not(#{&}__tr--expanded):not(:nth-last-child(2))
|
|
139
|
+
&__td::before {
|
|
140
|
+
bottom: -0.0625rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
132
143
|
&__tr--has-accordion-content#{&}__tr--expanded:not(&__tr--disabled):hover
|
|
133
144
|
&__td {
|
|
134
145
|
background-color: var(--color-white);
|
|
@@ -193,14 +204,16 @@
|
|
|
193
204
|
@include IS_SAFARI_DESKTOP {
|
|
194
205
|
&[hidden] {
|
|
195
206
|
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
207
|
+
* By reverting the display from "none" to "block",
|
|
208
|
+
* 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).
|
|
209
|
+
*/
|
|
199
210
|
display: block;
|
|
200
211
|
}
|
|
201
212
|
}
|
|
202
213
|
|
|
203
214
|
td {
|
|
215
|
+
padding: 0 !important; // medium and small size sets padding – but we never want a padding on this td
|
|
216
|
+
|
|
204
217
|
width: calc(100% - 3.5rem);
|
|
205
218
|
|
|
206
219
|
.dnb-table__size--medium & {
|
|
@@ -279,9 +292,40 @@
|
|
|
279
292
|
vertical-align: top;
|
|
280
293
|
}
|
|
281
294
|
|
|
295
|
+
&--outline
|
|
296
|
+
tbody
|
|
297
|
+
&__tr#{&}__tr--has-accordion-content:not(#{&}__tr--expanded):nth-last-child(2)
|
|
298
|
+
&__td:first-of-type {
|
|
299
|
+
&,
|
|
300
|
+
&::before,
|
|
301
|
+
&::after {
|
|
302
|
+
border-radius: 0 0 0 0.5rem;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
&--outline tbody &__tr:last-of-type &__td:last-of-type,
|
|
306
|
+
&--outline
|
|
307
|
+
tbody
|
|
308
|
+
&__tr#{&}__tr--has-accordion-content:not(#{&}__tr--expanded):nth-last-child(2)
|
|
309
|
+
&__td:last-of-type {
|
|
310
|
+
&,
|
|
311
|
+
&::before,
|
|
312
|
+
&::after {
|
|
313
|
+
border-radius: 0 0 0.5rem 0;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
&--outline tbody &__tr#{&}__tr__accordion_content:last-of-type &__td {
|
|
317
|
+
&,
|
|
318
|
+
&::before,
|
|
319
|
+
&::after {
|
|
320
|
+
border-radius: 0 0 0.5rem 0.5rem;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// stylelint-disable-next-line
|
|
282
325
|
&__tr--has-accordion-content:not(&__tr--disabled) {
|
|
283
326
|
cursor: pointer;
|
|
284
327
|
}
|
|
328
|
+
|
|
285
329
|
// prevent selection while animating – useful when user double-clicks
|
|
286
330
|
// TODO: Our SASS version does not support :has – so we may use this in future
|
|
287
331
|
// &__tr--has-accordion-content:has(& + &__tr__accordion_content--animating) {
|
|
@@ -34,6 +34,22 @@
|
|
|
34
34
|
&__size--large .dnb-table__th {
|
|
35
35
|
padding-top: 1.5rem;
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
position: relative; // because of bottom border
|
|
39
|
+
&::after {
|
|
40
|
+
@include tableBorder();
|
|
41
|
+
border-bottom: var(--border);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* stylelint-disable */
|
|
45
|
+
& tbody:first-child,
|
|
46
|
+
& > :not(thead) + tbody {
|
|
47
|
+
.dnb-table__tr:first-of-type .dnb-table__th::after,
|
|
48
|
+
.dnb-table__tr:first-of-type .dnb-table__td::after {
|
|
49
|
+
border-top: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/* stylelint-enable */
|
|
37
53
|
}
|
|
38
54
|
}
|
|
39
55
|
|
|
@@ -41,7 +57,8 @@
|
|
|
41
57
|
padding: 2rem 1rem 0;
|
|
42
58
|
|
|
43
59
|
&--empty {
|
|
44
|
-
padding: 0
|
|
60
|
+
padding: 0;
|
|
61
|
+
min-height: 1.5rem;
|
|
45
62
|
}
|
|
46
63
|
|
|
47
64
|
.dnb-spacing & .dnb-h--large:not([class*='space__top']) {
|
|
@@ -53,7 +70,8 @@
|
|
|
53
70
|
padding-bottom: 1.25rem; // because of 8px scrollbar
|
|
54
71
|
|
|
55
72
|
&--empty {
|
|
56
|
-
padding
|
|
73
|
+
padding: 0;
|
|
74
|
+
min-height: 1rem;
|
|
57
75
|
}
|
|
58
76
|
}
|
|
59
77
|
|
|
@@ -16,80 +16,18 @@
|
|
|
16
16
|
border-bottom: none;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
&:not(#{&}--outline) tbody &__tr:last-of-type &__td::after,
|
|
20
|
-
&:not(#{&}--outline) tbody &__tr &__td[rowspan]::after {
|
|
21
|
-
bottom: -0.0625rem;
|
|
22
|
-
border-bottom: var(--border);
|
|
23
|
-
}
|
|
24
19
|
|
|
25
20
|
// table outline
|
|
26
|
-
&--outline
|
|
27
|
-
|
|
28
|
-
&:last-of-type::after {
|
|
29
|
-
@include tableBorder();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:first-of-type::after {
|
|
33
|
-
border-left: var(--outline);
|
|
34
|
-
}
|
|
35
|
-
&:last-of-type::after {
|
|
36
|
-
border-right: var(--outline);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* stylelint-disable */
|
|
21
|
+
&--outline {
|
|
22
|
+
position: relative;
|
|
40
23
|
&,
|
|
41
|
-
&::before,
|
|
42
24
|
&::after {
|
|
43
|
-
|
|
25
|
+
border-radius: 0.5rem;
|
|
44
26
|
}
|
|
45
|
-
/* stylelint-enable */
|
|
46
|
-
}
|
|
47
|
-
&--outline tbody &__tr:last-of-type &__td {
|
|
48
27
|
&::after {
|
|
49
28
|
@include tableBorder();
|
|
50
|
-
|
|
51
|
-
border
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
&--outline thead &__th:first-of-type {
|
|
55
|
-
&,
|
|
56
|
-
&::after {
|
|
57
|
-
border-radius: 0.5rem 0 0 0;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
&--outline thead &__th:last-of-type {
|
|
61
|
-
&,
|
|
62
|
-
&::after {
|
|
63
|
-
border-radius: 0 0.5rem 0 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
&--outline tbody &__tr:last-of-type &__td:first-of-type,
|
|
67
|
-
&--outline
|
|
68
|
-
tbody
|
|
69
|
-
&__tr#{&}__tr--has-accordion-content:not(#{&}__tr--expanded):nth-last-child(2)
|
|
70
|
-
&__td:first-of-type {
|
|
71
|
-
&,
|
|
72
|
-
&::before,
|
|
73
|
-
&::after {
|
|
74
|
-
border-radius: 0 0 0 0.5rem;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
&--outline tbody &__tr:last-of-type &__td:last-of-type,
|
|
78
|
-
&--outline
|
|
79
|
-
tbody
|
|
80
|
-
&__tr#{&}__tr--has-accordion-content:not(#{&}__tr--expanded):nth-last-child(2)
|
|
81
|
-
&__td:last-of-type {
|
|
82
|
-
&,
|
|
83
|
-
&::before,
|
|
84
|
-
&::after {
|
|
85
|
-
border-radius: 0 0 0.5rem 0;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
&--outline tbody &__tr#{&}__tr__accordion_content:last-of-type &__td {
|
|
89
|
-
&,
|
|
90
|
-
&::before,
|
|
91
|
-
&::after {
|
|
92
|
-
border-radius: 0 0 0.5rem 0.5rem;
|
|
29
|
+
z-index: 3;
|
|
30
|
+
border: var(--outline);
|
|
93
31
|
}
|
|
94
32
|
}
|
|
95
33
|
|
|
@@ -112,6 +50,36 @@
|
|
|
112
50
|
}
|
|
113
51
|
}
|
|
114
52
|
|
|
53
|
+
// no thead, should have th in body
|
|
54
|
+
/* stylelint-disable */
|
|
55
|
+
&--outline tbody:first-child &__tr:first-of-type &__th,
|
|
56
|
+
&--outline > :not(thead) + tbody &__tr:first-of-type &__th {
|
|
57
|
+
&::after {
|
|
58
|
+
border-top: var(--outline);
|
|
59
|
+
}
|
|
60
|
+
&:first-of-type,
|
|
61
|
+
&:first-of-type::after {
|
|
62
|
+
border-radius: 0.5rem 0 0 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&--outline > tbody:first-child &__tr:first-of-type &__td,
|
|
66
|
+
&--outline > :not(thead) + tbody &__tr:first-of-type &__td {
|
|
67
|
+
&::after {
|
|
68
|
+
border-top: var(--outline);
|
|
69
|
+
}
|
|
70
|
+
&:last-of-type,
|
|
71
|
+
&:last-of-type::after {
|
|
72
|
+
border-radius: 0 0.5rem 0 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
&:not(&--outline)#{&}--border > tbody:first-child &__td:last-of-type,
|
|
76
|
+
&:not(&--outline)#{&}--border > :not(thead) + tbody &__td:last-of-type {
|
|
77
|
+
&::after {
|
|
78
|
+
border-right: var(--border);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/* stylelint-enable */
|
|
82
|
+
|
|
115
83
|
// spacing
|
|
116
84
|
&__td--no-spacing,
|
|
117
85
|
td#{&}__td--no-spacing {
|
|
@@ -12,46 +12,53 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// table border
|
|
15
|
-
&--
|
|
15
|
+
&--border tbody &__th {
|
|
16
16
|
&::after {
|
|
17
17
|
@include tableBorder();
|
|
18
18
|
|
|
19
|
-
border-top: var(--
|
|
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;
|
|
19
|
+
border-top: var(--border);
|
|
39
20
|
}
|
|
40
21
|
}
|
|
41
|
-
&--outline
|
|
42
|
-
|
|
22
|
+
// &--outline thead &__th {
|
|
23
|
+
// &::after {
|
|
24
|
+
// @include tableBorder();
|
|
43
25
|
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
&--outline tbody &__tr:last-of-type &__th {
|
|
47
|
-
&::after {
|
|
48
|
-
@include tableBorder();
|
|
26
|
+
// border-top: var(--outline);
|
|
27
|
+
// }
|
|
49
28
|
|
|
50
|
-
|
|
51
|
-
|
|
29
|
+
// &:first-of-type::after {
|
|
30
|
+
// border-left: var(--outline);
|
|
31
|
+
// }
|
|
32
|
+
// &:last-of-type::after {
|
|
33
|
+
// border-right: var(--outline);
|
|
34
|
+
// }
|
|
35
|
+
// }
|
|
36
|
+
// &--outline thead &__th:first-of-type {
|
|
37
|
+
// &,
|
|
38
|
+
// &::after {
|
|
39
|
+
// border-radius: 0.5rem 0 0 0;
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
// &--outline thead &__th:last-of-type {
|
|
43
|
+
// &,
|
|
44
|
+
// &::after {
|
|
45
|
+
// border-radius: 0 0.5rem 0 0;
|
|
46
|
+
// }
|
|
47
|
+
// }
|
|
48
|
+
// &--outline tbody &__th:first-of-type::after {
|
|
49
|
+
// @include tableBorder();
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
// border-left: var(--outline);
|
|
52
|
+
// }
|
|
53
|
+
// &--outline tbody &__tr:last-of-type &__th {
|
|
54
|
+
// &::after {
|
|
55
|
+
// @include tableBorder();
|
|
56
|
+
|
|
57
|
+
// border-bottom: var(--outline);
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
// &:first-of-type::after {
|
|
61
|
+
// border-radius: 0 0 0 0.5rem;
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
57
64
|
}
|
|
@@ -3,18 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
@
|
|
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
|
-
|
|
6
|
+
@import './dnb-table-mixins.scss';
|
|
18
7
|
@import './_table-header-buttons.scss';
|
|
19
8
|
|
|
20
9
|
.dnb-table {
|
|
@@ -39,9 +28,19 @@
|
|
|
39
28
|
|
|
40
29
|
& > caption {
|
|
41
30
|
caption-side: bottom;
|
|
42
|
-
|
|
31
|
+
padding: 0.5rem 0 0.5rem 1rem;
|
|
43
32
|
|
|
44
33
|
font-size: var(--font-size-basis);
|
|
34
|
+
background-color: var(--color-white);
|
|
35
|
+
text-align: left;
|
|
36
|
+
}
|
|
37
|
+
&--border > caption:not(.dnb-sr-only) {
|
|
38
|
+
position: relative;
|
|
39
|
+
&::after {
|
|
40
|
+
@include tableBorder();
|
|
41
|
+
top: -0.0625rem; // so we are behind the border-bottom (end of table)
|
|
42
|
+
border-top: var(--border);
|
|
43
|
+
}
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
&.dnb-skeleton {
|
|
File without changes
|
|
File without changes
|