@dso-toolkit/core 45.1.0 → 45.2.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.
Files changed (67) hide show
  1. package/dist/cjs/dso-alert.cjs.entry.js +1 -1
  2. package/dist/cjs/dso-date-picker.cjs.entry.js +1 -1
  3. package/dist/cjs/dso-header.cjs.entry.js +1 -1
  4. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
  5. package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-ozon-content.cjs.entry.js +34 -8
  7. package/dist/cjs/dso-pagination.cjs.entry.js +3 -3
  8. package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
  9. package/dist/cjs/dso-table.cjs.entry.js +89 -0
  10. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  11. package/dist/cjs/dso-viewer-grid.cjs.entry.js +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/collection-manifest.json +1 -0
  14. package/dist/collection/components/alert/alert.css +10 -10
  15. package/dist/collection/components/date-picker/date-picker.css +2 -2
  16. package/dist/collection/components/header/header.css +24 -17
  17. package/dist/collection/components/header/header.template.js +1 -1
  18. package/dist/collection/components/helpcenter-panel/helpcenter-panel.css +18 -2
  19. package/dist/collection/components/helpcenter-panel/helpcenter-panel.js +1 -1
  20. package/dist/collection/components/highlight-box/highlight-box.css +1 -1
  21. package/dist/collection/components/ozon-content/nodes/lijst.node.js +25 -0
  22. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +8 -7
  23. package/dist/collection/components/ozon-content/ozon-content-mapper.js +2 -0
  24. package/dist/collection/components/ozon-content/ozon-content.css +18 -9
  25. package/dist/collection/components/pagination/pagination.js +3 -3
  26. package/dist/collection/components/progress-bar/progress-bar.css +1 -1
  27. package/dist/collection/components/table/table.css +296 -0
  28. package/dist/collection/components/table/table.interfaces.js +1 -0
  29. package/dist/collection/components/table/table.js +146 -0
  30. package/dist/collection/components/table/table.template.js +26 -0
  31. package/dist/collection/components/viewer-grid/viewer-grid.css +0 -80
  32. package/dist/custom-elements/index.d.ts +6 -0
  33. package/dist/custom-elements/index.js +128 -20
  34. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  35. package/dist/dso-toolkit/p-1a19ce42.entry.js +1 -0
  36. package/dist/dso-toolkit/p-383227b9.entry.js +1 -0
  37. package/dist/dso-toolkit/p-662b7663.entry.js +1 -0
  38. package/dist/dso-toolkit/{p-93b53eb7.entry.js → p-6a414479.entry.js} +1 -1
  39. package/dist/dso-toolkit/{p-c339891f.entry.js → p-83de460b.entry.js} +1 -1
  40. package/dist/dso-toolkit/p-9aaadf4f.entry.js +1 -0
  41. package/dist/dso-toolkit/p-a5a5b24b.entry.js +1 -0
  42. package/dist/dso-toolkit/{p-b1a75b67.entry.js → p-a9b0a83e.entry.js} +1 -1
  43. package/dist/dso-toolkit/p-eb326df8.entry.js +1 -0
  44. package/dist/dso-toolkit/{p-8515d157.entry.js → p-f1b5baf9.entry.js} +1 -1
  45. package/dist/esm/dso-alert.entry.js +1 -1
  46. package/dist/esm/dso-date-picker.entry.js +1 -1
  47. package/dist/esm/dso-header.entry.js +1 -1
  48. package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
  49. package/dist/esm/dso-highlight-box.entry.js +1 -1
  50. package/dist/esm/dso-ozon-content.entry.js +34 -8
  51. package/dist/esm/dso-pagination.entry.js +3 -3
  52. package/dist/esm/dso-progress-bar.entry.js +1 -1
  53. package/dist/esm/dso-table.entry.js +85 -0
  54. package/dist/esm/dso-toolkit.js +1 -1
  55. package/dist/esm/dso-viewer-grid.entry.js +1 -1
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/types/components/ozon-content/nodes/lijst.node.d.ts +6 -0
  58. package/dist/types/components/table/table.d.ts +26 -0
  59. package/dist/types/components/table/table.interfaces.d.ts +3 -0
  60. package/dist/types/components/table/table.template.d.ts +2 -0
  61. package/dist/types/components.d.ts +29 -0
  62. package/package.json +1 -1
  63. package/dist/dso-toolkit/p-73bbb9a6.entry.js +0 -1
  64. package/dist/dso-toolkit/p-d6192ab8.entry.js +0 -1
  65. package/dist/dso-toolkit/p-e2e2106e.entry.js +0 -1
  66. package/dist/dso-toolkit/p-efd815dc.entry.js +0 -1
  67. package/dist/dso-toolkit/p-f42d8240.entry.js +0 -1
@@ -0,0 +1,296 @@
1
+ @keyframes slideInFromTop {
2
+ 0% {
3
+ opacity: 0;
4
+ }
5
+ 100% {
6
+ opacity: 1;
7
+ }
8
+ }
9
+ .dso-modal .dso-dialog {
10
+ background-color: #fff;
11
+ box-shadow: 0 8px 24px 0 rgba(25, 25, 25, 0.4);
12
+ }
13
+ .dso-modal .dso-header {
14
+ border-bottom: 1px solid #ccc;
15
+ min-height: 32px;
16
+ padding: 16px;
17
+ position: relative;
18
+ }
19
+ .dso-modal .dso-header h2 {
20
+ margin: 0;
21
+ max-width: calc(100% - 24px);
22
+ }
23
+ .dso-modal .dso-header .dso-close {
24
+ background-color: transparent;
25
+ border: 0;
26
+ cursor: pointer;
27
+ color: #39870c;
28
+ height: 32px;
29
+ padding: 0;
30
+ position: absolute;
31
+ right: 13px;
32
+ text-align: center;
33
+ top: 16px;
34
+ width: 32px;
35
+ }
36
+ .dso-modal .dso-body {
37
+ height: calc(100% - 96px - 1.5rem);
38
+ max-height: calc(70vh - 144px - 1.5em);
39
+ min-height: 1.5rem;
40
+ overflow-x: auto;
41
+ padding: 32px;
42
+ }
43
+ .dso-modal .dso-body p {
44
+ margin: 0 0 16px;
45
+ }
46
+ .dso-modal .dso-body ul,
47
+ .dso-modal .dso-body ol {
48
+ margin-bottom: 16px;
49
+ }
50
+ .dso-modal .dso-body ul:not(.list-group):not(.dso-link-list):not(.dso-columns-list),
51
+ .dso-modal .dso-body ol:not(.list-group):not(.dso-link-list):not(.dso-columns-list) {
52
+ padding-inline-start: 24px;
53
+ }
54
+ .dso-modal .dso-body pre {
55
+ margin: 0 0 16px;
56
+ }
57
+ .dso-modal .dso-body blockquote {
58
+ padding: 16px 24px;
59
+ }
60
+ .dso-modal .dso-body dso-highlight-box,
61
+ .dso-modal .dso-body .dso-highlight-box {
62
+ margin-bottom: 24px;
63
+ }
64
+ .dso-modal .dso-body img {
65
+ height: auto;
66
+ max-width: 100%;
67
+ }
68
+ .dso-modal .dso-footer {
69
+ min-height: 80px;
70
+ padding: 0 32px 32px;
71
+ text-align: right;
72
+ }
73
+ .dso-modal .dso-footer .dso-tertiary,
74
+ .dso-modal .dso-footer .btn-link {
75
+ float: left;
76
+ line-height: calc(1.5em - 1px);
77
+ padding: 11px 0;
78
+ position: relative;
79
+ }
80
+ .dso-modal.dso-confirm .dso-footer button:first-child {
81
+ float: left;
82
+ }
83
+ @media screen and (min-width: 768px) {
84
+ .dso-modal {
85
+ bottom: 0;
86
+ height: 100%;
87
+ left: 0;
88
+ position: fixed;
89
+ right: 0;
90
+ top: 0;
91
+ z-index: 530;
92
+ }
93
+ .dso-modal .dso-dialog {
94
+ animation: 1s ease-out 0s 1 slideInFromTop;
95
+ margin: auto;
96
+ margin-top: 15vh;
97
+ max-width: 640px;
98
+ opacity: 1;
99
+ }
100
+ .dso-modal .dso-footer .btn + .dso-secondary, .dso-modal .dso-footer .btn + .btn-default, .dso-modal .dso-footer .dso-primary + .dso-secondary, .dso-modal .dso-footer .dso-primary + .btn-default, .dso-modal .dso-footer .dso-secondary + .dso-secondary, .dso-modal .dso-footer .dso-secondary + .btn-default, .dso-modal .dso-footer .dso-tertiary + .dso-secondary, .dso-modal .dso-footer .dso-tertiary + .btn-default {
101
+ margin-left: 16px;
102
+ }
103
+ .dso-modal .dso-footer .btn + .dso-tertiary, .dso-modal .dso-footer .btn + .btn-link, .dso-modal .dso-footer .dso-primary + .dso-tertiary, .dso-modal .dso-footer .dso-primary + .btn-link, .dso-modal .dso-footer .dso-secondary + .dso-tertiary, .dso-modal .dso-footer .dso-secondary + .btn-link, .dso-modal .dso-footer .dso-tertiary + .dso-tertiary, .dso-modal .dso-footer .dso-tertiary + .btn-link {
104
+ margin-left: 0;
105
+ }
106
+ }
107
+ @media screen and (max-width: 767px) {
108
+ .dso-modal {
109
+ max-width: 100%;
110
+ }
111
+ .dso-modal .dso-footer .btn + .btn, .dso-modal .dso-footer .btn + .dso-primary, .dso-modal .dso-footer .btn + .dso-secondary, .dso-modal .dso-footer .btn + .dso-tertiary, .dso-modal .dso-footer .dso-primary + .btn, .dso-modal .dso-footer .dso-primary + .dso-primary, .dso-modal .dso-footer .dso-primary + .dso-secondary, .dso-modal .dso-footer .dso-primary + .dso-tertiary, .dso-modal .dso-footer .dso-secondary + .btn, .dso-modal .dso-footer .dso-secondary + .dso-primary, .dso-modal .dso-footer .dso-secondary + .dso-secondary, .dso-modal .dso-footer .dso-secondary + .dso-tertiary, .dso-modal .dso-footer .dso-tertiary + .btn, .dso-modal .dso-footer .dso-tertiary + .dso-primary, .dso-modal .dso-footer .dso-tertiary + .dso-secondary, .dso-modal .dso-footer .dso-tertiary + .dso-tertiary {
112
+ margin-left: 0;
113
+ }
114
+ .dso-modal .dso-footer button {
115
+ text-align: center;
116
+ width: 100%;
117
+ }
118
+ .dso-modal .dso-footer button + button {
119
+ margin-top: 8px;
120
+ }
121
+ .dso-modal .dso-footer button.dso-tertiary,
122
+ .dso-modal .dso-footer button.dso-tertiary span, .dso-modal .dso-footer button.btn-link,
123
+ .dso-modal .dso-footer button.btn-link span {
124
+ float: none;
125
+ }
126
+ }
127
+
128
+ :host {
129
+ display: block;
130
+ margin-bottom: 24px;
131
+ }
132
+
133
+ .dso-header h2 {
134
+ color: #275937;
135
+ font-size: 1.5rem;
136
+ font-weight: 700;
137
+ }
138
+ .dso-header .dso-close {
139
+ color: #275937;
140
+ }
141
+
142
+ :host .dso-modal {
143
+ inset: 0px;
144
+ height: 100%;
145
+ position: fixed;
146
+ z-index: 530;
147
+ }
148
+
149
+ .dso-modal .dso-dialog.dso-table-dialog {
150
+ max-width: calc(100% - 2rem);
151
+ }
152
+ @media screen and (max-width: 767px) {
153
+ .dso-modal .dso-dialog.dso-table-dialog {
154
+ max-width: 100%;
155
+ }
156
+ }
157
+
158
+ :host([is-responsive]) .dso-table-body {
159
+ border: 1px solid #ccc;
160
+ margin-bottom: 0;
161
+ overflow-y: hidden;
162
+ width: 100%;
163
+ }
164
+ :host([is-responsive]) .dso-table-body.dso-body {
165
+ width: calc(100% - 64px);
166
+ }
167
+
168
+ .dso-table-utilities {
169
+ align-items: center;
170
+ display: flex;
171
+ justify-content: space-between;
172
+ margin-bottom: 8px;
173
+ }
174
+ .dso-table-utilities .dso-responsive-message {
175
+ margin-bottom: 0;
176
+ }
177
+ .dso-table-utilities .dso-responsive-message:only-child {
178
+ width: 100%;
179
+ }
180
+ .dso-table-utilities .open-modal-button:only-child {
181
+ margin-left: auto;
182
+ }
183
+
184
+ .dso-responsive-message {
185
+ font-size: 0.8em;
186
+ margin-bottom: 8px;
187
+ position: relative;
188
+ text-align: center;
189
+ }
190
+
191
+ .dso-tertiary {
192
+ display: inline-block;
193
+ font-size: 1em;
194
+ font-weight: 500;
195
+ margin-bottom: 0;
196
+ text-decoration: none;
197
+ touch-action: manipulation;
198
+ text-align: left;
199
+ user-select: none;
200
+ vertical-align: middle;
201
+ border: 0;
202
+ color: #39870c;
203
+ line-height: 1;
204
+ padding: 0;
205
+ background-color: transparent;
206
+ cursor: pointer;
207
+ }
208
+ .dso-tertiary:focus, .dso-tertiary:focus-visible {
209
+ outline-offset: 2px;
210
+ }
211
+ .dso-tertiary:active {
212
+ outline: 0;
213
+ }
214
+ .dso-tertiary[disabled] {
215
+ color: #afcf9d;
216
+ }
217
+ .dso-tertiary[disabled].dso-spinner-left, .dso-tertiary[disabled].dso-spinner-right {
218
+ color: #39870c;
219
+ }
220
+ .dso-tertiary:not([disabled]):hover {
221
+ color: #676cb0;
222
+ text-decoration: underline;
223
+ text-underline-position: under;
224
+ }
225
+ .dso-tertiary:not([disabled]):active {
226
+ color: #676cb0;
227
+ }
228
+ .dso-tertiary.btn-align {
229
+ line-height: calc(1.5em - 1px);
230
+ padding: 11px 0;
231
+ position: relative;
232
+ }
233
+ .dso-tertiary.dso-spinner-left::before {
234
+ background-image: url("data:image/svg+xml,%3Csvg class='spinner' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E .spinner %7B animation: rotator 8s linear infinite; transform-origin: center; %7D @keyframes rotator %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D .path %7B stroke-dasharray: 265; stroke-dashoffset: 0; transform-origin: center; stroke: %2339870c; animation: dash 2s ease-in-out infinite; %7D @keyframes dash %7B 0%25 %7B stroke-dashoffset: 265; %7D 50%25 %7B stroke-dashoffset: 65; transform:rotate(90deg); %7D 100%25 %7B stroke-dashoffset: 265; transform:rotate(360deg); %7D %3C/style%3E%3Ccircle class='path' fill='none' stroke-width='10' stroke-linecap='butt' cx='50' cy='50' r='45'%3E%3C/circle%3E%3C/svg%3E");
235
+ background-repeat: no-repeat;
236
+ content: "";
237
+ display: inline-block;
238
+ height: 24px;
239
+ vertical-align: middle;
240
+ width: 24px;
241
+ margin-right: 8px;
242
+ }
243
+ .dso-tertiary.dso-spinner-right::after {
244
+ background-image: url("data:image/svg+xml,%3Csvg class='spinner' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E .spinner %7B animation: rotator 8s linear infinite; transform-origin: center; %7D @keyframes rotator %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D .path %7B stroke-dasharray: 265; stroke-dashoffset: 0; transform-origin: center; stroke: %2339870c; animation: dash 2s ease-in-out infinite; %7D @keyframes dash %7B 0%25 %7B stroke-dashoffset: 265; %7D 50%25 %7B stroke-dashoffset: 65; transform:rotate(90deg); %7D 100%25 %7B stroke-dashoffset: 265; transform:rotate(360deg); %7D %3C/style%3E%3Ccircle class='path' fill='none' stroke-width='10' stroke-linecap='butt' cx='50' cy='50' r='45'%3E%3C/circle%3E%3C/svg%3E");
245
+ background-repeat: no-repeat;
246
+ content: "";
247
+ display: inline-block;
248
+ height: 24px;
249
+ vertical-align: middle;
250
+ width: 24px;
251
+ margin-left: 8px;
252
+ }
253
+ .dso-tertiary dso-icon + span:not(.sr-only),
254
+ .dso-tertiary svg.di + span:not(.sr-only),
255
+ .dso-tertiary span:not(.sr-only) + dso-icon,
256
+ .dso-tertiary span:not(.sr-only) + svg.di {
257
+ margin-left: 8px;
258
+ }
259
+ .dso-tertiary svg.di.di-chevron-down + span:not(.sr-only),
260
+ .dso-tertiary svg.di.di-chevron-up + span:not(.sr-only),
261
+ .dso-tertiary span:not(.sr-only) + svg.di.di-chevron-down,
262
+ .dso-tertiary span:not(.sr-only) + svg.di.di-chevron-up {
263
+ margin-left: 4px;
264
+ }
265
+ .dso-tertiary dso-icon[icon=chevron-left] + span:not(.sr-only),
266
+ .dso-tertiary dso-icon[icon=chevron-right] + span:not(.sr-only),
267
+ .dso-tertiary svg.di.di-angle-down + span:not(.sr-only),
268
+ .dso-tertiary svg.di.di-angle-up + span:not(.sr-only),
269
+ .dso-tertiary span:not(.sr-only) + svg.di.di-angle-down,
270
+ .dso-tertiary span:not(.sr-only) + svg.di.di-angle-up,
271
+ .dso-tertiary span:not(.sr-only) + dso-icon[icon=chevron-left],
272
+ .dso-tertiary span:not(.sr-only) + dso-icon[icon=chevron-right] {
273
+ margin-left: 0;
274
+ }
275
+ .dso-tertiary dso-icon,
276
+ .dso-tertiary svg.di,
277
+ .dso-tertiary span {
278
+ vertical-align: middle;
279
+ }
280
+
281
+ .sr-only {
282
+ position: absolute;
283
+ width: 1px;
284
+ height: 1px;
285
+ padding: 0;
286
+ margin: -1px;
287
+ overflow: hidden;
288
+ clip: rect(0, 0, 0, 0);
289
+ border: 0;
290
+ }
291
+
292
+ .dso-table-placeholder {
293
+ box-shadow: inset 0 0 0 1px #ccc;
294
+ display: grid;
295
+ place-content: center;
296
+ }
@@ -0,0 +1,146 @@
1
+ import { h, Component, Element, Host, Prop, State } from '@stencil/core';
2
+ import debounce from 'debounce';
3
+ import { createFocusTrap } from 'focus-trap';
4
+ import { v4 } from 'uuid';
5
+ export class Table {
6
+ constructor() {
7
+ this.labelledbyId = v4();
8
+ /** Prevents the table being opened in a modal. */
9
+ this.noModal = false;
10
+ /** Indicates whether the table is currently horizontally scrollable */
11
+ this.isResponsive = false;
12
+ this.modalActive = false;
13
+ }
14
+ startResponsiveBehavior() {
15
+ var _a;
16
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.host);
17
+ }
18
+ componentWillLoad() {
19
+ this.resizeObserver = new ResizeObserver(debounce(entries => this.setResponsiveTable(entries), 200));
20
+ }
21
+ componentDidLoad() {
22
+ this.startResponsiveBehavior();
23
+ }
24
+ componentDidRender() {
25
+ this.setFocusTrap();
26
+ }
27
+ disconnectedCallback() {
28
+ var _a;
29
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
30
+ }
31
+ render() {
32
+ var _a;
33
+ const caption = (_a = this.host.querySelector(':scope > table > caption')) === null || _a === void 0 ? void 0 : _a.textContent;
34
+ return (h(Host, null,
35
+ this.modalActive && this.placeholderHeight && (h("div", { class: "dso-table-placeholder", style: { height: `${this.placeholderHeight}px` } })),
36
+ h("div", { class: { 'dso-modal': this.modalActive } },
37
+ h("div", Object.assign({ class: { 'dso-dialog': this.modalActive, 'dso-table-dialog': true }, ref: element => this.focusTrapElement = element }, this.modalActive ? { ['aria-labelledby']: this.labelledbyId, role: 'dialog' } : {}),
38
+ (this.isResponsive || !this.noModal) && (h("div", { class: "dso-table-utilities", style: this.modalActive ? { display: 'none' } : undefined },
39
+ this.isResponsive && (h("div", { class: "dso-responsive-message" },
40
+ h("span", null, "beweeg de tabel van links naar rechts"))),
41
+ !this.noModal && (h("button", { type: "button", class: "dso-tertiary open-modal-button", ref: element => this.buttonElement = element, onClick: () => this.openModal() },
42
+ h("span", { class: "sr-only" },
43
+ "tabel ", caption !== null && caption !== void 0 ? caption : '',
44
+ " "),
45
+ h("span", null, "vergroten"),
46
+ h("dso-icon", { icon: "external-link" }))))),
47
+ this.modalActive && (h("div", { class: "dso-header" },
48
+ h("h2", { id: this.labelledbyId, class: { 'sr-only': !caption } }, caption || 'Uitvergrote tabel dialoog'),
49
+ h("button", { type: "button", class: "dso-close", onClick: () => this.closeModal() },
50
+ h("dso-icon", { icon: "times" }),
51
+ h("span", { class: "sr-only" }, "Sluiten")))),
52
+ h("div", { class: { 'dso-body': this.modalActive, 'dso-table-body': true } },
53
+ h("slot", null))))));
54
+ }
55
+ openModal() {
56
+ this.placeholderHeight = this.host.clientHeight;
57
+ document.body.classList.add('dso-modal-open');
58
+ this.modalActive = true;
59
+ }
60
+ closeModal() {
61
+ this.placeholderHeight = undefined;
62
+ document.body.classList.remove('dso-modal-open', 'dso-modal-open');
63
+ this.modalActive = false;
64
+ }
65
+ setFocusTrap() {
66
+ var _a, _b;
67
+ if (this.modalActive && this.focusTrapElement && !this.trap) {
68
+ this.trap = createFocusTrap([this.host, this.focusTrapElement], {
69
+ escapeDeactivates: true,
70
+ clickOutsideDeactivates: (e) => {
71
+ if (e instanceof MouseEvent && e.composedPath()[0] === this.focusTrapElement) {
72
+ this.closeModal();
73
+ return false;
74
+ }
75
+ return true;
76
+ },
77
+ setReturnFocus: (_a = this.buttonElement) !== null && _a !== void 0 ? _a : false,
78
+ onDeactivate: () => this.closeModal(),
79
+ tabbableOptions: {
80
+ getShadowRoot: true,
81
+ }
82
+ }).activate();
83
+ }
84
+ else if (!this.modalActive && this.trap) {
85
+ (_b = this.trap) === null || _b === void 0 ? void 0 : _b.deactivate();
86
+ delete this.trap;
87
+ }
88
+ }
89
+ setResponsiveTable([dsoTable]) {
90
+ const tableElement = dsoTable.target.querySelector('table');
91
+ if (dsoTable && tableElement instanceof HTMLTableElement) {
92
+ this.isResponsive = Math.floor(tableElement.getBoundingClientRect().width) > Math.floor(dsoTable.contentRect.width);
93
+ }
94
+ }
95
+ static get is() { return "dso-table"; }
96
+ static get encapsulation() { return "shadow"; }
97
+ static get originalStyleUrls() { return {
98
+ "$": ["table.scss"]
99
+ }; }
100
+ static get styleUrls() { return {
101
+ "$": ["table.css"]
102
+ }; }
103
+ static get properties() { return {
104
+ "noModal": {
105
+ "type": "boolean",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "boolean",
109
+ "resolved": "boolean",
110
+ "references": {}
111
+ },
112
+ "required": false,
113
+ "optional": false,
114
+ "docs": {
115
+ "tags": [],
116
+ "text": "Prevents the table being opened in a modal."
117
+ },
118
+ "attribute": "no-modal",
119
+ "reflect": true,
120
+ "defaultValue": "false"
121
+ },
122
+ "isResponsive": {
123
+ "type": "boolean",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "boolean",
127
+ "resolved": "boolean",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "Indicates whether the table is currently horizontally scrollable"
135
+ },
136
+ "attribute": "is-responsive",
137
+ "reflect": true,
138
+ "defaultValue": "false"
139
+ }
140
+ }; }
141
+ static get states() { return {
142
+ "modalActive": {},
143
+ "placeholderHeight": {}
144
+ }; }
145
+ static get elementRef() { return "host"; }
146
+ }
@@ -0,0 +1,26 @@
1
+ import { html } from 'lit-html';
2
+ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
3
+ export function tableTemplate({ noModal, content, }) {
4
+ return html `
5
+ <dso-table
6
+ ?no-modal=${noModal}
7
+ >
8
+ <table class="table">
9
+ <caption>${content.caption}</caption>
10
+
11
+ <thead>
12
+ <tr>
13
+ ${content.head.map(col => html `<th scope="col">${col}</th>`)}
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ ${content.rows.map(row => html `
18
+ <tr>
19
+ ${row.map((col, index) => index === 0 ? html `<th scope="row">${unsafeHTML(col)}</th>` : html `<td>${unsafeHTML(col)}</td>`)}
20
+ </tr>
21
+ `)}
22
+ </tbody>
23
+ </table>
24
+ </dso-table>
25
+ `;
26
+ }
@@ -1,83 +1,3 @@
1
- h1,
2
- .h1,
3
- h2,
4
- .h2,
5
- h3,
6
- .h3 {
7
- margin-bottom: 16px;
8
- margin-top: 24px;
9
- }
10
-
11
- h1,
12
- .h1 {
13
- line-height: 1.25;
14
- }
15
-
16
- h1 {
17
- color: #275937;
18
- font-size: 2rem;
19
- font-weight: 700;
20
- }
21
-
22
- h2,
23
- .h2 {
24
- line-height: 1.33;
25
- }
26
-
27
- h2 {
28
- color: #275937;
29
- font-size: 1.5rem;
30
- font-weight: 700;
31
- }
32
-
33
- h3,
34
- .h3 {
35
- line-height: 1.2;
36
- }
37
-
38
- h3 {
39
- color: #275937;
40
- font-size: 1.25rem;
41
- font-weight: 600;
42
- }
43
-
44
- h4,
45
- .h4,
46
- h5,
47
- .h5,
48
- h6,
49
- .h6 {
50
- margin-bottom: 16px;
51
- margin-top: 12px;
52
- }
53
-
54
- h4,
55
- .h4 {
56
- line-height: 1.5;
57
- }
58
-
59
- h4 {
60
- color: #275937;
61
- font-size: 1rem;
62
- font-weight: 600;
63
- }
64
-
65
- h5,
66
- .h5 {
67
- line-height: 1.5;
68
- }
69
-
70
- h5 {
71
- color: #191919;
72
- font-size: 1rem;
73
- font-weight: 600;
74
- }
75
-
76
- h6,
77
- .h6 {
78
- line-height: 1.5;
79
- }
80
-
81
1
  *,
82
2
  *::after,
83
3
  *::before {
@@ -158,6 +158,12 @@ export const DsoSelectable: {
158
158
  new (): DsoSelectable;
159
159
  };
160
160
 
161
+ interface DsoTable extends Components.DsoTable, HTMLElement {}
162
+ export const DsoTable: {
163
+ prototype: DsoTable;
164
+ new (): DsoTable;
165
+ };
166
+
161
167
  interface DsoToggletip extends Components.DsoToggletip, HTMLElement {}
162
168
  export const DsoToggletip: {
163
169
  prototype: DsoToggletip;