@dfds-ui/experiences 2.2.0-alpha.9bb1ab0f → 2.2.0-alpha.a1ae8508
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/cjs/dynamic-table/Body/TableBody.js +14 -14
- package/cjs/dynamic-table/Body/TableCell.js +6 -6
- package/cjs/dynamic-table/Body/TableCell.styles.js +3 -5
- package/cjs/dynamic-table/Body/TableRow.js +35 -33
- package/cjs/dynamic-table/Body/TableRow.styles.js +1 -2
- package/cjs/dynamic-table/Body/TableRowGroup.js +29 -29
- package/cjs/dynamic-table/DynamicTable.js +35 -34
- package/cjs/dynamic-table/DynamicTable.styles.js +1 -2
- package/cjs/dynamic-table/DynamicTable.types.d.ts +1 -1
- package/cjs/dynamic-table/Head/TableHead.js +47 -40
- package/cjs/dynamic-table/Skeleton/SkeletonTable.styles.js +2 -3
- package/cjs/dynamic-table/Skeleton/helpers/createSkeletonRows.js +3 -3
- package/cjs/dynamic-table/helpers/getHeaderRow.js +1 -2
- package/cjs/dynamic-table/stories/headerRow.js +1 -2
- package/cjs/dynamic-table/stories/headerRowSortable.js +1 -2
- package/cjs/dynamic-table/stories/tableRows.js +51 -15
- package/cjs/dynamic-table/stories/tableRowsExpandable.js +51 -15
- package/cjs/footer/Footer.js +50 -40
- package/cjs/footer/FooterColumn.js +14 -11
- package/cjs/footer/FooterColumnItem.js +7 -6
- package/cjs/footer/FooterMetaLink.js +7 -6
- package/cjs/internet-explorer-modal/IEModal.d.ts +3 -2
- package/cjs/internet-explorer-modal/IEModal.js +44 -36
- package/cjs/locale-selector/LocaleOption.js +7 -6
- package/cjs/locale-selector/LocaleSelector.d.ts +5 -28
- package/cjs/locale-selector/LocaleSelector.js +41 -37
- package/cjs/swiper/Swiper.d.ts +4 -3
- package/cjs/swiper/Swiper.js +6 -4
- package/cjs/swiper/SwiperCard.d.ts +4 -3
- package/cjs/swiper/SwiperCard.js +6 -4
- package/dynamic-table/Body/TableBody.js +16 -15
- package/dynamic-table/Body/TableCell.js +5 -4
- package/dynamic-table/Body/TableRow.js +37 -34
- package/dynamic-table/Body/TableRowGroup.js +25 -24
- package/dynamic-table/DynamicTable.js +42 -34
- package/dynamic-table/DynamicTable.types.d.ts +1 -1
- package/dynamic-table/Head/TableHead.js +48 -40
- package/dynamic-table/Skeleton/helpers/createSkeletonRows.js +4 -4
- package/dynamic-table/stories/tableRows.js +50 -13
- package/dynamic-table/stories/tableRowsExpandable.js +50 -13
- package/footer/Footer.js +50 -34
- package/footer/FooterColumn.js +20 -11
- package/footer/FooterColumnItem.js +13 -6
- package/footer/FooterMetaLink.js +13 -6
- package/internet-explorer-modal/IEModal.d.ts +3 -2
- package/internet-explorer-modal/IEModal.js +56 -42
- package/locale-selector/LocaleOption.js +6 -5
- package/locale-selector/LocaleSelector.d.ts +5 -28
- package/locale-selector/LocaleSelector.js +55 -51
- package/package.json +12 -12
- package/swiper/Swiper.d.ts +4 -3
- package/swiper/Swiper.js +6 -5
- package/swiper/SwiperCard.d.ts +4 -3
- package/swiper/SwiperCard.js +6 -5
|
@@ -3,7 +3,7 @@ import { ChevronDown } from '@dfds-ui/icons/system';
|
|
|
3
3
|
import { Checkbox } from '@dfds-ui/react-components';
|
|
4
4
|
import { chevronStyles, tableHeadCellCheckboxStyles, tableHeadCellExpanderStyles, tableHeadCellStyles } from './TableHead.styles';
|
|
5
5
|
import { genericTableRowStyles } from '../Body/TableRow.styles';
|
|
6
|
-
import { jsx as
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
7
7
|
var TableHead = /*#__PURE__*/React.memo(function (_ref) {
|
|
8
8
|
var expandable = _ref.expandable,
|
|
9
9
|
headerRow = _ref.headerRow,
|
|
@@ -36,45 +36,53 @@ var TableHead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
36
36
|
setSortDescending(!sortDescending);
|
|
37
37
|
}
|
|
38
38
|
}, [onSort, setSortDescending, setSortByKeyValue, sortDescending]);
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
return _jsx("thead", {
|
|
40
|
+
children: _jsxs("tr", {
|
|
41
|
+
css: genericTableRowStyles,
|
|
42
|
+
children: [expandable && _jsx("th", {
|
|
43
|
+
css: tableHeadCellExpanderStyles({
|
|
44
|
+
stickyHeader: stickyHeader
|
|
45
|
+
})
|
|
46
|
+
}), selectableRows && _jsx("th", {
|
|
47
|
+
css: tableHeadCellCheckboxStyles({
|
|
48
|
+
stickyHeader: stickyHeader
|
|
49
|
+
}),
|
|
50
|
+
children: _jsx(Checkbox, {
|
|
51
|
+
checked: selectedRows.length > 0,
|
|
52
|
+
indeterminate: true,
|
|
53
|
+
name: "all",
|
|
54
|
+
onChange: toggleAll,
|
|
55
|
+
size: "small"
|
|
56
|
+
})
|
|
57
|
+
}), headerRow.map(function (headerCell, i) {
|
|
58
|
+
var sortKey = headerCell.sortKey || headerCell.key;
|
|
59
|
+
var clickHandler = function clickHandler() {
|
|
60
|
+
return headerCell.sortable && sort(sortByKeyValue, sortKey);
|
|
61
|
+
};
|
|
62
|
+
var showChevron = String(sortByKeyValue === sortKey);
|
|
63
|
+
return _jsx("th", {
|
|
64
|
+
align: headerCell.textAlign,
|
|
65
|
+
css: tableHeadCellStyles({
|
|
66
|
+
align: headerCell.textAlign,
|
|
67
|
+
customWidth: headerCell.width,
|
|
68
|
+
sortByKey: onSort,
|
|
69
|
+
sortable: headerCell.sortable,
|
|
70
|
+
stickyHeader: stickyHeader
|
|
71
|
+
}),
|
|
72
|
+
onClick: clickHandler,
|
|
73
|
+
children: _jsxs("div", {
|
|
74
|
+
children: [_jsx("span", {
|
|
75
|
+
children: headerCell.displayName
|
|
76
|
+
}), headerCell.sortable && onSort && _jsx(ChevronDown, {
|
|
77
|
+
css: chevronStyles({
|
|
78
|
+
descending: String(sortDescending),
|
|
79
|
+
show: showChevron
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
}, i);
|
|
84
|
+
})]
|
|
44
85
|
})
|
|
45
|
-
})
|
|
46
|
-
css: tableHeadCellCheckboxStyles({
|
|
47
|
-
stickyHeader: stickyHeader
|
|
48
|
-
})
|
|
49
|
-
}, ___EmotionJSX(Checkbox, {
|
|
50
|
-
checked: selectedRows.length > 0,
|
|
51
|
-
indeterminate: true,
|
|
52
|
-
name: "all",
|
|
53
|
-
onChange: toggleAll,
|
|
54
|
-
size: "small"
|
|
55
|
-
})), headerRow.map(function (headerCell, i) {
|
|
56
|
-
var sortKey = headerCell.sortKey || headerCell.key;
|
|
57
|
-
var clickHandler = function clickHandler() {
|
|
58
|
-
return headerCell.sortable && sort(sortByKeyValue, sortKey);
|
|
59
|
-
};
|
|
60
|
-
var showChevron = String(sortByKeyValue === sortKey);
|
|
61
|
-
return ___EmotionJSX("th", {
|
|
62
|
-
align: headerCell.textAlign,
|
|
63
|
-
css: tableHeadCellStyles({
|
|
64
|
-
align: headerCell.textAlign,
|
|
65
|
-
customWidth: headerCell.width,
|
|
66
|
-
sortByKey: onSort,
|
|
67
|
-
sortable: headerCell.sortable,
|
|
68
|
-
stickyHeader: stickyHeader
|
|
69
|
-
}),
|
|
70
|
-
key: i,
|
|
71
|
-
onClick: clickHandler
|
|
72
|
-
}, ___EmotionJSX("div", null, ___EmotionJSX("span", null, headerCell.displayName), headerCell.sortable && onSort && ___EmotionJSX(ChevronDown, {
|
|
73
|
-
css: chevronStyles({
|
|
74
|
-
descending: String(sortDescending),
|
|
75
|
-
show: showChevron
|
|
76
|
-
})
|
|
77
|
-
})));
|
|
78
|
-
})));
|
|
86
|
+
});
|
|
79
87
|
});
|
|
80
88
|
export default TableHead;
|
|
@@ -3,12 +3,12 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
5
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++)
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
7
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Skeleton } from '@dfds-ui/react-components';
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { jsx as
|
|
11
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
13
|
name: "1m8u2wf",
|
|
14
14
|
styles: "height:12px;width:100%;text-align:left"
|
|
@@ -20,8 +20,8 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
20
20
|
var createSkeletonRows = function createSkeletonRows(headerRow) {
|
|
21
21
|
return _toConsumableArray(Array(7)).map(function (_, index) {
|
|
22
22
|
var row = {};
|
|
23
|
-
headerRow === null || headerRow === void 0
|
|
24
|
-
row[cell.key] =
|
|
23
|
+
headerRow === null || headerRow === void 0 || headerRow.forEach(function (cell) {
|
|
24
|
+
row[cell.key] = _jsx(Skeleton, {
|
|
25
25
|
css: _ref,
|
|
26
26
|
variant: "text"
|
|
27
27
|
});
|
|
@@ -1,65 +1,102 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
3
3
|
var Currency = function Currency() {
|
|
4
|
-
return
|
|
4
|
+
return _jsx("span", {
|
|
5
5
|
style: {
|
|
6
6
|
fontSize: '10px'
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
},
|
|
8
|
+
children: "EUR"
|
|
9
|
+
});
|
|
9
10
|
};
|
|
10
11
|
var tableRows = [{
|
|
11
12
|
id: '1001',
|
|
12
13
|
pallets: 10,
|
|
13
14
|
from: 'Copenhagen',
|
|
14
15
|
to: 'Stockholm',
|
|
15
|
-
price:
|
|
16
|
+
price: _jsxs(_Fragment, {
|
|
17
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
18
|
+
children: "200"
|
|
19
|
+
})]
|
|
20
|
+
})
|
|
16
21
|
}, {
|
|
17
22
|
id: '1002',
|
|
18
23
|
pallets: 41,
|
|
19
24
|
from: 'Istanbul',
|
|
20
25
|
to: 'London',
|
|
21
|
-
price:
|
|
26
|
+
price: _jsxs(_Fragment, {
|
|
27
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
28
|
+
children: "320"
|
|
29
|
+
})]
|
|
30
|
+
})
|
|
22
31
|
}, {
|
|
23
32
|
id: '1003',
|
|
24
33
|
pallets: 9,
|
|
25
34
|
from: 'Delphi',
|
|
26
35
|
to: 'Madrid',
|
|
27
|
-
price:
|
|
36
|
+
price: _jsxs(_Fragment, {
|
|
37
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
38
|
+
children: "1574"
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
28
41
|
}, {
|
|
29
42
|
id: '1004',
|
|
30
43
|
pallets: 52,
|
|
31
44
|
from: 'Stockholm',
|
|
32
45
|
to: 'Amsterdam',
|
|
33
|
-
price:
|
|
46
|
+
price: _jsxs(_Fragment, {
|
|
47
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
48
|
+
children: "945.50"
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
34
51
|
}, {
|
|
35
52
|
id: '1005',
|
|
36
53
|
pallets: 4,
|
|
37
54
|
from: 'London',
|
|
38
55
|
to: 'Paris',
|
|
39
|
-
price:
|
|
56
|
+
price: _jsxs(_Fragment, {
|
|
57
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
58
|
+
children: "850"
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
40
61
|
}, {
|
|
41
62
|
id: '1006',
|
|
42
63
|
pallets: 33,
|
|
43
64
|
from: 'Madrid',
|
|
44
65
|
to: 'Berlin',
|
|
45
|
-
price:
|
|
66
|
+
price: _jsxs(_Fragment, {
|
|
67
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
68
|
+
children: "2000"
|
|
69
|
+
})]
|
|
70
|
+
})
|
|
46
71
|
}, {
|
|
47
72
|
id: '1007',
|
|
48
73
|
pallets: 17,
|
|
49
74
|
from: 'Berlin',
|
|
50
75
|
to: 'Oslo',
|
|
51
|
-
price:
|
|
76
|
+
price: _jsxs(_Fragment, {
|
|
77
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
78
|
+
children: "887"
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
52
81
|
}, {
|
|
53
82
|
id: '1008',
|
|
54
83
|
pallets: 14,
|
|
55
84
|
from: 'Oslo',
|
|
56
85
|
to: 'Cairo',
|
|
57
|
-
price:
|
|
86
|
+
price: _jsxs(_Fragment, {
|
|
87
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
88
|
+
children: "2400"
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
58
91
|
}, {
|
|
59
92
|
id: '1009',
|
|
60
93
|
pallets: 23,
|
|
61
94
|
from: 'Paris',
|
|
62
95
|
to: 'Rome',
|
|
63
|
-
price:
|
|
96
|
+
price: _jsxs(_Fragment, {
|
|
97
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
98
|
+
children: "1280.30"
|
|
99
|
+
})]
|
|
100
|
+
})
|
|
64
101
|
}];
|
|
65
102
|
export default tableRows;
|
|
@@ -1,67 +1,104 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
3
3
|
var Currency = function Currency() {
|
|
4
|
-
return
|
|
4
|
+
return _jsx("span", {
|
|
5
5
|
style: {
|
|
6
6
|
fontSize: '10px'
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
},
|
|
8
|
+
children: "EUR"
|
|
9
|
+
});
|
|
9
10
|
};
|
|
10
11
|
var tableRowsExpandable = [{
|
|
11
12
|
id: '1001',
|
|
12
13
|
pallets: 10,
|
|
13
14
|
from: 'Copenhagen',
|
|
14
15
|
to: 'Stockholm',
|
|
15
|
-
price:
|
|
16
|
+
price: _jsxs(_Fragment, {
|
|
17
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
18
|
+
children: "200"
|
|
19
|
+
})]
|
|
20
|
+
})
|
|
16
21
|
}, {
|
|
17
22
|
id: '1002',
|
|
18
23
|
pallets: 41,
|
|
19
24
|
from: 'Istanbul',
|
|
20
25
|
to: 'London',
|
|
21
|
-
price:
|
|
26
|
+
price: _jsxs(_Fragment, {
|
|
27
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
28
|
+
children: "320"
|
|
29
|
+
})]
|
|
30
|
+
})
|
|
22
31
|
}, {
|
|
23
32
|
id: '1003',
|
|
24
33
|
pallets: 9,
|
|
25
34
|
from: 'Delphi',
|
|
26
35
|
to: 'Madrid',
|
|
27
|
-
price:
|
|
36
|
+
price: _jsxs(_Fragment, {
|
|
37
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
38
|
+
children: "1574"
|
|
39
|
+
})]
|
|
40
|
+
}),
|
|
28
41
|
subRows: [{
|
|
29
42
|
id: '1004',
|
|
30
43
|
pallets: 52,
|
|
31
44
|
from: 'Stockholm',
|
|
32
45
|
to: 'Amsterdam',
|
|
33
|
-
price:
|
|
46
|
+
price: _jsxs(_Fragment, {
|
|
47
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
48
|
+
children: "945.50"
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
34
51
|
}, {
|
|
35
52
|
id: '1005',
|
|
36
53
|
pallets: 4,
|
|
37
54
|
from: 'London',
|
|
38
55
|
to: 'Paris',
|
|
39
|
-
price:
|
|
56
|
+
price: _jsxs(_Fragment, {
|
|
57
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
58
|
+
children: "850"
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
40
61
|
}]
|
|
41
62
|
}, {
|
|
42
63
|
id: '1006',
|
|
43
64
|
pallets: 33,
|
|
44
65
|
from: 'Madrid',
|
|
45
66
|
to: 'Berlin',
|
|
46
|
-
price:
|
|
67
|
+
price: _jsxs(_Fragment, {
|
|
68
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
69
|
+
children: "2000"
|
|
70
|
+
})]
|
|
71
|
+
})
|
|
47
72
|
}, {
|
|
48
73
|
id: '1007',
|
|
49
74
|
pallets: 17,
|
|
50
75
|
from: 'Berlin',
|
|
51
76
|
to: 'Oslo',
|
|
52
|
-
price:
|
|
77
|
+
price: _jsxs(_Fragment, {
|
|
78
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
79
|
+
children: "887"
|
|
80
|
+
})]
|
|
81
|
+
}),
|
|
53
82
|
subRows: [{
|
|
54
83
|
id: '1008',
|
|
55
84
|
pallets: 14,
|
|
56
85
|
from: 'Oslo',
|
|
57
86
|
to: 'Cairo',
|
|
58
|
-
price:
|
|
87
|
+
price: _jsxs(_Fragment, {
|
|
88
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
89
|
+
children: "2400"
|
|
90
|
+
})]
|
|
91
|
+
})
|
|
59
92
|
}]
|
|
60
93
|
}, {
|
|
61
94
|
id: '1009',
|
|
62
95
|
pallets: 23,
|
|
63
96
|
from: 'Paris',
|
|
64
97
|
to: 'Rome',
|
|
65
|
-
price:
|
|
98
|
+
price: _jsxs(_Fragment, {
|
|
99
|
+
children: [_jsx(Currency, {}), " ", _jsx("strong", {
|
|
100
|
+
children: "1280.30"
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
66
103
|
}];
|
|
67
104
|
export default tableRowsExpandable;
|