@designsystem-se/af 38.0.1-beta.0 → 38.0.1-beta.2
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/components/digi-bar-chart.js +170 -70
- package/components/digi-calendar-datepicker.js +6 -5
- package/components/digi-chart-line.js +12 -8
- package/components/digi-code-block.js +1 -1
- package/components/digi-code-example.js +2 -2
- package/components/digi-dialog.js +1 -0
- package/components/digi-footer.js +1 -0
- package/components/digi-form-checkbox.js +1 -1
- package/components/digi-form-error-list.js +3 -4
- package/components/digi-form-filter.js +1 -1
- package/components/digi-form-radiobutton.js +1 -1
- package/components/digi-form-receipt.js +1 -0
- package/components/digi-form-select-filter.js +1 -0
- package/components/digi-header-navigation.js +1 -0
- package/components/digi-header.js +1 -0
- package/components/digi-navigation-pagination.js +1 -0
- package/components/digi-notification-alert.js +1 -1
- package/components/digi-notification-error-page.js +1 -0
- package/components/digi-progress-circle.js +1 -6
- package/components/digi-tablist.js +5 -5
- package/components/digi-tag.js +1 -1
- package/components/digi-title-logo.js +1 -0
- package/components/digi-tools-feedback.js +1 -0
- package/components/index.js +1 -0
- package/components/{p-57a1c472.js → p-13c09880.js} +2 -2
- package/components/{p-4d2d082d.js → p-75c8d67e.js} +1 -0
- package/components/{p-b24c2842.js → p-77d8d575.js} +2 -2
- package/components/{p-195ca01d.js → p-bc5b7057.js} +1 -0
- package/components/p-be4fd246.js +7 -0
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-bar-chart.cjs.entry.js +170 -70
- package/dist/cjs/digi-button_27.cjs.entry.js +1 -0
- package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +6 -5
- package/dist/cjs/digi-chart-line.cjs.entry.js +12 -8
- package/dist/cjs/digi-code-block_3.cjs.entry.js +3 -2
- package/dist/cjs/digi-dialog.cjs.entry.js +1 -0
- package/dist/cjs/digi-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/digi-form-error-list.cjs.entry.js +2 -2
- package/dist/cjs/digi-form-receipt.cjs.entry.js +1 -0
- package/dist/cjs/digi-form-select-filter.cjs.entry.js +1 -0
- package/dist/cjs/digi-navigation-pagination.cjs.entry.js +1 -0
- package/dist/cjs/digi-notification-alert.cjs.entry.js +1 -0
- package/dist/cjs/digi-notification-error-page.cjs.entry.js +1 -0
- package/dist/cjs/digi-progress-circle.cjs.entry.js +4 -9
- package/dist/cjs/digi-tablist.cjs.entry.js +5 -5
- package/dist/cjs/digi-tag.cjs.entry.js +1 -1
- package/dist/cjs/digi-tools-feedback.cjs.entry.js +1 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/progress-circle-role.enum-b7fdcf0c.js +7 -0
- package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.js +5 -5
- package/dist/collection/components/_chart/bar-chart/bar-chart.js +171 -70
- package/dist/collection/components/_chart/chart-line/chart-line.js +12 -8
- package/dist/collection/components/_form/form-checkbox/form-checkbox.js +2 -2
- package/dist/collection/components/_form/form-error-list/form-error-list.js +1 -7
- package/dist/collection/components/_form/form-radiobutton/form-radiobutton.js +2 -2
- package/dist/collection/components/_navigation/navigation-tablist/navigation-tablist.js +5 -5
- package/dist/collection/components/_tag/tag/tag.js +1 -1
- package/dist/collection/enums.js +7 -0
- package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +0 -2
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/{p-60738889.entry.js → p-01874a31.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-18880083.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/{p-d71c33d8.entry.js → p-37c0ea9e.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-39468f49.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-501f9b16.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/{p-d670e0e0.entry.js → p-54d5aa93.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-59073668.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-8833044b.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-97f66789.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9dae073c.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-a186888d.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-be4fd246.js +1 -0
- package/dist/digi-arbetsformedlingen/{p-0a6d26f7.entry.js → p-cea5ef63.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/{p-67ba87db.entry.js → p-d3e14568.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-ddd659bf.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e5bd5a7e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ef689144.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f0a405ca.entry.js +1 -0
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-bar-chart.entry.js +170 -70
- package/dist/esm/digi-button_27.entry.js +1 -0
- package/dist/esm/digi-calendar-datepicker.entry.js +6 -5
- package/dist/esm/digi-chart-line.entry.js +12 -8
- package/dist/esm/digi-code-block_3.entry.js +3 -2
- package/dist/esm/digi-dialog.entry.js +1 -0
- package/dist/esm/digi-form-checkbox.entry.js +2 -2
- package/dist/esm/digi-form-error-list.entry.js +2 -2
- package/dist/esm/digi-form-receipt.entry.js +1 -0
- package/dist/esm/digi-form-select-filter.entry.js +1 -0
- package/dist/esm/digi-navigation-pagination.entry.js +1 -0
- package/dist/esm/digi-notification-alert.entry.js +1 -0
- package/dist/esm/digi-notification-error-page.entry.js +1 -0
- package/dist/esm/digi-progress-circle.entry.js +1 -6
- package/dist/esm/digi-tablist.entry.js +5 -5
- package/dist/esm/digi-tag.entry.js +1 -1
- package/dist/esm/digi-tools-feedback.entry.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/progress-circle-role.enum-7737a2c6.js +7 -0
- package/dist/types/components/_calendar/calendar-datepicker/calendar-datepicker.d.ts +2 -2
- package/dist/types/components/_form/form-error-list/form-error-list.d.ts +0 -1
- package/dist/types/enums.d.ts +7 -0
- package/hydrate/index.js +204 -102
- package/hydrate/index.mjs +204 -102
- package/package.json +1 -1
- package/dist/digi-arbetsformedlingen/p-20693fa2.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3566b732.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-3cda17e1.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-4d84c470.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-50b32151.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-54b6eb3f.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-5ad6d46d.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-6324c9bf.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9062da9b.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9a456d55.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a26333e9.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-e347aae8.entry.js +0 -1
|
@@ -118,7 +118,13 @@ const barChart = class {
|
|
|
118
118
|
this.defaultDuration = 400;
|
|
119
119
|
// Text and formats
|
|
120
120
|
this.fontSize = '0.875rem';
|
|
121
|
-
this.colorPalettes = [
|
|
121
|
+
this.colorPalettes = [
|
|
122
|
+
'--digi--color--background--brand-primary',
|
|
123
|
+
'--digi--color--infographic--brand--primary',
|
|
124
|
+
'--digi--color--background--sentiment--beta--primary',
|
|
125
|
+
'--digi--color--text--interactive--visited',
|
|
126
|
+
'--digi--color--icon--validation--error'
|
|
127
|
+
];
|
|
122
128
|
// Observer for watching size changes when in line chart mode
|
|
123
129
|
this.barChartObserver = new ResizeObserver((entries) => {
|
|
124
130
|
entries.forEach(() => {
|
|
@@ -128,7 +134,8 @@ const barChart = class {
|
|
|
128
134
|
});
|
|
129
135
|
});
|
|
130
136
|
this.highlightBars = (serie) => {
|
|
131
|
-
this.barChartContainer
|
|
137
|
+
this.barChartContainer
|
|
138
|
+
.selectAll('.bar')
|
|
132
139
|
.attr('fill', (barData) => this.colorFunction(barData.serie))
|
|
133
140
|
.transition('color')
|
|
134
141
|
.duration(150)
|
|
@@ -137,47 +144,78 @@ const barChart = class {
|
|
|
137
144
|
if (barData.serie === serie)
|
|
138
145
|
return this.colorFunction(barData.serie);
|
|
139
146
|
else {
|
|
140
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
147
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
148
|
+
this.series.indexOf(barData.serie) > 0) {
|
|
141
149
|
return 'url(#prognosisInactive)';
|
|
142
150
|
}
|
|
143
151
|
return this.evalColorVar('--digi--color--background--secondary-accent');
|
|
144
152
|
}
|
|
145
153
|
});
|
|
146
|
-
linear.select(this.legendDiv)
|
|
154
|
+
linear.select(this.legendDiv)
|
|
155
|
+
.selectAll('.legendChip')
|
|
156
|
+
.transition('colorLegend')
|
|
157
|
+
.duration(150)
|
|
158
|
+
.style('opacity', (title) => (title === serie ? 1 : 0.25));
|
|
147
159
|
};
|
|
148
160
|
this.resetBarColor = () => {
|
|
149
|
-
this.barChartContainer
|
|
150
|
-
|
|
161
|
+
this.barChartContainer
|
|
162
|
+
.selectAll('.bar')
|
|
163
|
+
.transition('color')
|
|
164
|
+
.duration(150)
|
|
165
|
+
.attr('fill', (barData) => this.colorFunction(barData.serie));
|
|
166
|
+
linear.select(this.legendDiv)
|
|
167
|
+
.selectAll('.legendChip')
|
|
168
|
+
.transition('colorLegend')
|
|
169
|
+
.duration(150)
|
|
170
|
+
.style('opacity', 1);
|
|
151
171
|
if (this.chartData.data.averageLine) {
|
|
152
|
-
this.barChartContainer
|
|
172
|
+
this.barChartContainer
|
|
173
|
+
.selectAll('.averageLine')
|
|
174
|
+
.transition('avgLine')
|
|
175
|
+
.style('mix-blend-mode', 'plus-lighter')
|
|
153
176
|
.style('filter', 'contrast(0.5)');
|
|
154
177
|
/* this.barChartContainer.selectAll('.averageLineText').transition('avgLine').style('mix-blend-mode', 'plus-lighter')
|
|
155
178
|
.style('filter', 'contrast(0.5)'); */
|
|
156
179
|
}
|
|
157
180
|
};
|
|
158
181
|
this.highlightAverageLine = (serie) => {
|
|
159
|
-
this.barChartContainer
|
|
182
|
+
this.barChartContainer
|
|
183
|
+
.selectAll('.bar')
|
|
160
184
|
.transition('color')
|
|
161
185
|
.duration(150)
|
|
162
186
|
.attr('fill', (barData) => {
|
|
163
187
|
var _a;
|
|
164
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
188
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
189
|
+
this.series.indexOf(barData.serie) > 0) {
|
|
165
190
|
return 'url(#prognosisInactive)';
|
|
166
191
|
}
|
|
167
192
|
else
|
|
168
193
|
return this.evalColorVar('--digi--color--background--secondary-accent');
|
|
169
194
|
});
|
|
170
|
-
this.barChartContainer
|
|
171
|
-
.
|
|
195
|
+
this.barChartContainer
|
|
196
|
+
.selectAll('.averageLine')
|
|
197
|
+
.transition('avgLine')
|
|
198
|
+
.duration(150)
|
|
199
|
+
.style('mix-blend-mode', null)
|
|
200
|
+
.style('filter', null);
|
|
172
201
|
/* this.barChartContainer.selectAll('.averageLineText').transition('avgLineText')
|
|
173
202
|
.duration(150).style('mix-blend-mode', null).style('filter', null) */
|
|
174
|
-
linear.select(this.legendDiv)
|
|
203
|
+
linear.select(this.legendDiv)
|
|
204
|
+
.selectAll('.legendChip')
|
|
205
|
+
.transition('colorLegend')
|
|
206
|
+
.duration(150)
|
|
207
|
+
.style('opacity', (title) => (title === serie ? 1 : 0.25));
|
|
175
208
|
};
|
|
176
209
|
// Sets and resizespositions the average line
|
|
177
210
|
this.averageLine = () => {
|
|
178
211
|
if (!this.chartData.data.averageLine)
|
|
179
212
|
return;
|
|
180
|
-
const avLineGroup = this.barChartContainer
|
|
213
|
+
const avLineGroup = this.barChartContainer
|
|
214
|
+
.select('.interactiveElements')
|
|
215
|
+
.selectAll('.averageLineGroup')
|
|
216
|
+
.data([this.chartData.data.averageLine])
|
|
217
|
+
.join('g')
|
|
218
|
+
.attr('class', 'averageLineGroup');
|
|
181
219
|
/* avLineGroup.selectAll('.averageLineText')
|
|
182
220
|
.data(d => [d])
|
|
183
221
|
.join('text')
|
|
@@ -190,8 +228,9 @@ const barChart = class {
|
|
|
190
228
|
.attr('fill', 'var(--digi--color--infographic--lineart)')
|
|
191
229
|
.style('mix-blend-mode', 'plus-lighter')
|
|
192
230
|
.style('filter', 'contrast(0.5)'); */
|
|
193
|
-
avLineGroup
|
|
194
|
-
.
|
|
231
|
+
avLineGroup
|
|
232
|
+
.selectAll('.averageLine')
|
|
233
|
+
.data((d) => [d.value])
|
|
195
234
|
.join('line')
|
|
196
235
|
.attr('class', 'averageLine')
|
|
197
236
|
.attr('x1', this.xScale.range()[0])
|
|
@@ -239,11 +278,15 @@ const barChart = class {
|
|
|
239
278
|
this.highlightBarGroup = (_event, datum) => {
|
|
240
279
|
if (typeof datum === 'string') {
|
|
241
280
|
const barGroupID = '#' + this.barGroupID(datum);
|
|
242
|
-
this.barChartContainer
|
|
281
|
+
this.barChartContainer
|
|
282
|
+
.select(barGroupID)
|
|
283
|
+
.selectAll('.bar')
|
|
284
|
+
.transition('color')
|
|
243
285
|
.duration(20)
|
|
244
286
|
.attr('fill', (d) => {
|
|
245
287
|
var _a;
|
|
246
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
288
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
289
|
+
this.series.indexOf(d.serie) > 0) {
|
|
247
290
|
return 'url(#prognosisHighlight)';
|
|
248
291
|
}
|
|
249
292
|
else
|
|
@@ -252,7 +295,9 @@ const barChart = class {
|
|
|
252
295
|
}
|
|
253
296
|
};
|
|
254
297
|
this.unHighlightBarGroup = () => {
|
|
255
|
-
this.barSelection
|
|
298
|
+
this.barSelection
|
|
299
|
+
.selectAll('.bar')
|
|
300
|
+
.transition('color')
|
|
256
301
|
.duration(100)
|
|
257
302
|
.attr('fill', (d) => {
|
|
258
303
|
return this.colorFunction(d.serie);
|
|
@@ -345,13 +390,15 @@ const barChart = class {
|
|
|
345
390
|
return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
|
|
346
391
|
};
|
|
347
392
|
this.updateBars = () => {
|
|
348
|
-
this.barSelection = this.barChartContainer
|
|
393
|
+
this.barSelection = this.barChartContainer
|
|
394
|
+
.select('.interactiveElements')
|
|
349
395
|
.selectAll('.barGroup')
|
|
350
396
|
.data(this.mappedData)
|
|
351
397
|
.join('g')
|
|
352
398
|
.attr('class', 'barGroup')
|
|
353
399
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
354
|
-
this.barSelection
|
|
400
|
+
this.barSelection
|
|
401
|
+
.selectAll('.bar')
|
|
355
402
|
.data((d) => {
|
|
356
403
|
return d.series;
|
|
357
404
|
})
|
|
@@ -430,7 +477,9 @@ const barChart = class {
|
|
|
430
477
|
key: key,
|
|
431
478
|
serie: serie.title,
|
|
432
479
|
value: serie.yValues[index],
|
|
433
|
-
len: serie.yValues[index]
|
|
480
|
+
len: serie.yValues[index]
|
|
481
|
+
? this.getTextSize(serie.yValues[index].toLocaleString())
|
|
482
|
+
: 0
|
|
434
483
|
});
|
|
435
484
|
}
|
|
436
485
|
});
|
|
@@ -446,7 +495,9 @@ const barChart = class {
|
|
|
446
495
|
key: key.toString(),
|
|
447
496
|
serie: serie.title,
|
|
448
497
|
value: serie.yValues[index],
|
|
449
|
-
len: serie.yValues[index]
|
|
498
|
+
len: serie.yValues[index]
|
|
499
|
+
? this.getTextSize(serie.yValues[index].toLocaleString())
|
|
500
|
+
: 0
|
|
450
501
|
});
|
|
451
502
|
}
|
|
452
503
|
});
|
|
@@ -457,7 +508,8 @@ const barChart = class {
|
|
|
457
508
|
return toReturn;
|
|
458
509
|
};
|
|
459
510
|
this.adjustBarSize = () => {
|
|
460
|
-
this.barSelection
|
|
511
|
+
this.barSelection
|
|
512
|
+
.selectAll('.bar')
|
|
461
513
|
.attr('x', this.xFunction)
|
|
462
514
|
.attr('y', this.yFunction)
|
|
463
515
|
.attr('width', this.widthFunction)
|
|
@@ -472,30 +524,38 @@ const barChart = class {
|
|
|
472
524
|
// Handling x positioning of bars
|
|
473
525
|
this.xFunction = (d, i) => {
|
|
474
526
|
return this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal
|
|
475
|
-
?
|
|
476
|
-
|
|
527
|
+
? d.value > 0
|
|
528
|
+
? this.xScale(0)
|
|
529
|
+
: this.xScale(d.value)
|
|
530
|
+
: this.xScale(d.key) +
|
|
531
|
+
((this.xScale.bandwidth() / this.dataWidth) * i + this.barGap * i);
|
|
477
532
|
};
|
|
478
533
|
// Handling y positioning of bars
|
|
479
534
|
this.yFunction = (d, i) => {
|
|
480
535
|
if (!d.value)
|
|
481
536
|
return 0;
|
|
482
537
|
return this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal
|
|
483
|
-
? this.yScale(d.key) +
|
|
484
|
-
|
|
538
|
+
? this.yScale(d.key) +
|
|
539
|
+
((this.yScale.bandwidth() / this.dataWidth) * i + this.barGap * i)
|
|
540
|
+
: d.value < 0
|
|
541
|
+
? this.yScale(0)
|
|
542
|
+
: this.yScale(d.value);
|
|
485
543
|
};
|
|
486
544
|
// Handling height for bars
|
|
487
545
|
this.heightFunction = (d) => {
|
|
488
546
|
if (!d.value)
|
|
489
547
|
return 0;
|
|
490
548
|
return this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal
|
|
491
|
-
? this.yScale.bandwidth() / this.dataWidth -
|
|
492
|
-
:
|
|
549
|
+
? this.yScale.bandwidth() / this.dataWidth - this.barGap
|
|
550
|
+
: d.value < 0
|
|
551
|
+
? this.yScale(d.value) - this.yScale(0)
|
|
552
|
+
: this.yScale(0) - this.yScale(d.value);
|
|
493
553
|
};
|
|
494
554
|
// Handling width for bars
|
|
495
555
|
this.widthFunction = (d) => {
|
|
496
556
|
return this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal
|
|
497
557
|
? Math.abs(this.xScale(0) - this.xScale(d.value))
|
|
498
|
-
: this.xScale.bandwidth() / this.dataWidth -
|
|
558
|
+
: this.xScale.bandwidth() / this.dataWidth - this.barGap;
|
|
499
559
|
};
|
|
500
560
|
// Setting dimension variable
|
|
501
561
|
this.setDims = (onlyHeight = false) => {
|
|
@@ -738,7 +798,8 @@ const barChart = class {
|
|
|
738
798
|
.attr('fill', (d) => {
|
|
739
799
|
var _a;
|
|
740
800
|
if (event.target.tagName === 'rect') {
|
|
741
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
801
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
802
|
+
this.series.indexOf(d.serie) > 0) {
|
|
742
803
|
return 'url(#prognosisHighlight)';
|
|
743
804
|
}
|
|
744
805
|
else
|
|
@@ -754,7 +815,9 @@ const barChart = class {
|
|
|
754
815
|
linear.select(event.target)
|
|
755
816
|
.transition('color')
|
|
756
817
|
.duration(this.defaultDuration)
|
|
757
|
-
.attr('fill', (d) => event.target.tagName === 'rect'
|
|
818
|
+
.attr('fill', (d) => event.target.tagName === 'rect'
|
|
819
|
+
? this.colorFunction(d.serie)
|
|
820
|
+
: '#333333');
|
|
758
821
|
};
|
|
759
822
|
this.openTooltip = (...[, d]) => {
|
|
760
823
|
// If type is string, the user has clicked on a y-axis tick
|
|
@@ -766,9 +829,7 @@ const barChart = class {
|
|
|
766
829
|
else
|
|
767
830
|
this.tooltipData = d;
|
|
768
831
|
const tooltipBody = this.tooltip.select('.tooltipBody');
|
|
769
|
-
this.tooltip
|
|
770
|
-
.select('.tooltipHeading')
|
|
771
|
-
.html(this.tooltipData.key);
|
|
832
|
+
this.tooltip.select('.tooltipHeading').html(this.tooltipData.key);
|
|
772
833
|
tooltipBody
|
|
773
834
|
.selectAll('div')
|
|
774
835
|
.data(this.tooltipData.series ? this.tooltipData.series : [this.tooltipData])
|
|
@@ -807,15 +868,25 @@ const barChart = class {
|
|
|
807
868
|
.style('transform', `translate(${diff > 0 ? width / 2 - 10 : this.xScale(data.value) / 2}px,0)`);
|
|
808
869
|
}
|
|
809
870
|
else {
|
|
810
|
-
const index = (_a = this.mappedData
|
|
811
|
-
|
|
871
|
+
const index = (_a = this.mappedData
|
|
872
|
+
.find((xPoint) => xPoint.key === data.key)) === null || _a === void 0 ? void 0 : _a.series.findIndex((serie) => serie.serie === data.serie);
|
|
873
|
+
const barIndex = (this.xScale.bandwidth() / this.dataWidth) * (index ? index + 1 : 1) -
|
|
874
|
+
this.xScale.bandwidth() / this.dataWidth / 2;
|
|
812
875
|
// This should be where the x-axis starts
|
|
813
876
|
const xStart = this.margin.left + this.tickPadding + this.yTickSize;
|
|
814
877
|
// Creating adjustment for tooltip to not appear outside of chart
|
|
815
878
|
const spaceToSVGEdge = 5;
|
|
816
|
-
const inlineAdjustment =
|
|
817
|
-
|
|
818
|
-
|
|
879
|
+
const inlineAdjustment = this.dims.width - spaceToSVGEdge <
|
|
880
|
+
this.xScale(data.key) + xStart + barIndex + width / 2
|
|
881
|
+
? ((this.xScale(data.key) +
|
|
882
|
+
xStart +
|
|
883
|
+
barIndex +
|
|
884
|
+
width / 2 -
|
|
885
|
+
(this.dims.width - spaceToSVGEdge)) /
|
|
886
|
+
width) *
|
|
887
|
+
100
|
|
888
|
+
: 0;
|
|
889
|
+
this.tooltip.style('transform', `translate( calc(${this.xScale(data.key) + xStart + barIndex}px - ${50 + inlineAdjustment}%), calc(-100% + ${(data.value > 0 ? this.yScale(data.value) : this.yScale(0)) - 2}px) )`);
|
|
819
890
|
this.tooltip
|
|
820
891
|
.select('digi-icon-caret-down')
|
|
821
892
|
.style('position', 'absolute')
|
|
@@ -825,8 +896,7 @@ const barChart = class {
|
|
|
825
896
|
}
|
|
826
897
|
else {
|
|
827
898
|
if (this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal) {
|
|
828
|
-
this.tooltip
|
|
829
|
-
.style('transform', `translate(${this.tickPadding}px, ${this.yScale(data.key) + this.series.length * this.yScale.bandwidth() + 5}px )` // 5 is for half caret size
|
|
899
|
+
this.tooltip.style('transform', `translate(${this.tickPadding}px, ${this.yScale(data.key) + this.series.length * this.yScale.bandwidth() + 5}px )` // 5 is for half caret size
|
|
830
900
|
);
|
|
831
901
|
this.tooltip
|
|
832
902
|
.select('digi-icon-caret-up')
|
|
@@ -839,12 +909,17 @@ const barChart = class {
|
|
|
839
909
|
else {
|
|
840
910
|
const xStart = this.margin.left + this.tickPadding + this.yTickSize;
|
|
841
911
|
const translatePoint = this.xScale(data.key) + xStart + this.xScale.bandwidth() / 2;
|
|
842
|
-
const yMax = linear.max(data.series.map(elem => elem.value));
|
|
912
|
+
const yMax = linear.max(data.series.map((elem) => elem.value));
|
|
843
913
|
// Creating adjustment for tooltip to not appear outside of chart
|
|
844
914
|
const spaceToSVGEdge = 5;
|
|
845
|
-
const inlineAdjustment =
|
|
846
|
-
|
|
847
|
-
|
|
915
|
+
const inlineAdjustment = this.dims.width - spaceToSVGEdge < translatePoint + width / 2
|
|
916
|
+
? ((translatePoint +
|
|
917
|
+
width / 2 -
|
|
918
|
+
(this.dims.width - spaceToSVGEdge)) /
|
|
919
|
+
width) *
|
|
920
|
+
100
|
|
921
|
+
: 0;
|
|
922
|
+
this.tooltip.style('transform', `translate( calc(${this.xScale(data.key) + xStart + this.xScale.bandwidth() / 2}px - ${50 + inlineAdjustment}%), calc(-100% + ${this.yScale(yMax && yMax > 0 ? yMax : 0) - 1}px) )`);
|
|
848
923
|
this.tooltip
|
|
849
924
|
.select('digi-icon-caret-down')
|
|
850
925
|
.style('position', 'absolute')
|
|
@@ -880,7 +955,10 @@ const barChart = class {
|
|
|
880
955
|
.attr('opacity', 0)
|
|
881
956
|
.on('end', () => {
|
|
882
957
|
this.svg.remove();
|
|
883
|
-
linear.select(this.legendDiv)
|
|
958
|
+
linear.select(this.legendDiv)
|
|
959
|
+
.select('.legend')
|
|
960
|
+
.selectAll('.legendChip')
|
|
961
|
+
.remove();
|
|
884
962
|
this.legendDiv.style['display'] = 'none';
|
|
885
963
|
this.tableDiv.style['display'] = 'block';
|
|
886
964
|
this.setTableContent();
|
|
@@ -934,12 +1012,13 @@ const barChart = class {
|
|
|
934
1012
|
this.afChartData = undefined;
|
|
935
1013
|
}
|
|
936
1014
|
afChartDataUpdate(data) {
|
|
937
|
-
if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 ||
|
|
1015
|
+
if ((typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0) ||
|
|
1016
|
+
(typeof data !== 'string' && Object.keys(data).length > 0)) {
|
|
938
1017
|
if (typeof data != 'string')
|
|
939
1018
|
this.chartData = data;
|
|
940
1019
|
else
|
|
941
1020
|
this.chartData = JSON.parse(data);
|
|
942
|
-
this.series = this.chartData.data.series.map(serie => serie.title);
|
|
1021
|
+
this.series = this.chartData.data.series.map((serie) => serie.title);
|
|
943
1022
|
}
|
|
944
1023
|
this.mappedData = this.reshapeData();
|
|
945
1024
|
// checking for width of each tick
|
|
@@ -982,10 +1061,11 @@ const barChart = class {
|
|
|
982
1061
|
}
|
|
983
1062
|
initLegend() {
|
|
984
1063
|
const rectSize = 18;
|
|
985
|
-
const legendData = this.chartData.data.series.map(serie => serie.title);
|
|
1064
|
+
const legendData = this.chartData.data.series.map((serie) => serie.title);
|
|
986
1065
|
if (this.chartData.data.averageLine)
|
|
987
1066
|
legendData.push(this.chartData.data.averageLine.text);
|
|
988
|
-
const legendChips = linear.select(this.legendDiv)
|
|
1067
|
+
const legendChips = linear.select(this.legendDiv)
|
|
1068
|
+
.select('.legend')
|
|
989
1069
|
.style('margin-left', `${this.margin.left + this.tickPadding + this.yTickSize}px`)
|
|
990
1070
|
.style('margin-top', '0.5rem')
|
|
991
1071
|
.selectAll('.legendChip')
|
|
@@ -999,7 +1079,8 @@ const barChart = class {
|
|
|
999
1079
|
.style('cursor', 'default')
|
|
1000
1080
|
.on('mouseenter', (_event, serie) => this.highlightBars(serie))
|
|
1001
1081
|
.on('mouseleave', this.resetBarColor);
|
|
1002
|
-
legendChips
|
|
1082
|
+
legendChips
|
|
1083
|
+
.append('svg')
|
|
1003
1084
|
.attr('width', rectSize + 1)
|
|
1004
1085
|
.attr('height', rectSize + 1)
|
|
1005
1086
|
.append('rect')
|
|
@@ -1010,15 +1091,19 @@ const barChart = class {
|
|
|
1010
1091
|
.attr('rx', 4)
|
|
1011
1092
|
.attr('ry', 4)
|
|
1012
1093
|
.attr('fill', (title) => this.colorFunction(title));
|
|
1013
|
-
legendChips
|
|
1094
|
+
legendChips
|
|
1095
|
+
.append('span')
|
|
1096
|
+
.style('text-wrap', 'nowrap')
|
|
1097
|
+
.style('font-size', '0.875rem')
|
|
1098
|
+
.text((d) => d);
|
|
1014
1099
|
if (this.chartData.data.averageLine) {
|
|
1015
|
-
const averageLine = legendChips
|
|
1100
|
+
const averageLine = legendChips
|
|
1101
|
+
.filter(':last-child')
|
|
1016
1102
|
.on('mouseenter', (_event, serie) => this.highlightAverageLine(serie));
|
|
1017
|
-
const miniSVG = averageLine
|
|
1018
|
-
.select('svg')
|
|
1019
|
-
.attr('width', rectSize * 2);
|
|
1103
|
+
const miniSVG = averageLine.select('svg').attr('width', rectSize * 2);
|
|
1020
1104
|
miniSVG.select('rect').remove();
|
|
1021
|
-
miniSVG
|
|
1105
|
+
miniSVG
|
|
1106
|
+
.append('line')
|
|
1022
1107
|
.attr('x1', 1)
|
|
1023
1108
|
.attr('x2', rectSize * 2 - 1)
|
|
1024
1109
|
.attr('y1', rectSize / 2 + 1)
|
|
@@ -1061,7 +1146,8 @@ const barChart = class {
|
|
|
1061
1146
|
.attr('role', 'img')
|
|
1062
1147
|
.attr('aria-label', this.chartData && this.chartData.title
|
|
1063
1148
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1064
|
-
: 'Stapeldiagram')
|
|
1149
|
+
: 'Stapeldiagram')
|
|
1150
|
+
.attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
|
|
1065
1151
|
// Hide unusable components
|
|
1066
1152
|
linear.select(this.titleDiv)
|
|
1067
1153
|
.select(this.afHeadingLevel)
|
|
@@ -1123,7 +1209,8 @@ const barChart = class {
|
|
|
1123
1209
|
.join('g')
|
|
1124
1210
|
.attr('class', 'barGroup')
|
|
1125
1211
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
1126
|
-
this.barSelection
|
|
1212
|
+
this.barSelection
|
|
1213
|
+
.selectAll('bar')
|
|
1127
1214
|
.data((d) => {
|
|
1128
1215
|
return d.series;
|
|
1129
1216
|
})
|
|
@@ -1138,13 +1225,15 @@ const barChart = class {
|
|
|
1138
1225
|
.attr('width', this.widthFunction)
|
|
1139
1226
|
.attr('height', () => 0)
|
|
1140
1227
|
.attr('fill', 'gray');
|
|
1141
|
-
this.barChartContainer
|
|
1228
|
+
this.barChartContainer
|
|
1229
|
+
.selectAll('.bar')
|
|
1142
1230
|
.transition('animateBar')
|
|
1143
1231
|
.duration(400)
|
|
1144
1232
|
.delay((...[, i]) => i * 150)
|
|
1145
1233
|
.attr('y', this.yFunction)
|
|
1146
1234
|
.attr('height', this.heightFunction);
|
|
1147
|
-
this.barChartContainer
|
|
1235
|
+
this.barChartContainer
|
|
1236
|
+
.selectAll('.bar')
|
|
1148
1237
|
.transition('animateBar')
|
|
1149
1238
|
.duration(400)
|
|
1150
1239
|
.ease(linear.linear$1)
|
|
@@ -1254,7 +1343,8 @@ const barChart = class {
|
|
|
1254
1343
|
.join('g')
|
|
1255
1344
|
.attr('class', 'barGroup')
|
|
1256
1345
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
1257
|
-
this.barSelection
|
|
1346
|
+
this.barSelection
|
|
1347
|
+
.selectAll('.barGroup')
|
|
1258
1348
|
.data((d) => {
|
|
1259
1349
|
return d.series;
|
|
1260
1350
|
})
|
|
@@ -1281,7 +1371,9 @@ const barChart = class {
|
|
|
1281
1371
|
.append('text');
|
|
1282
1372
|
this.textSelection
|
|
1283
1373
|
.text((d) => {
|
|
1284
|
-
return d.value
|
|
1374
|
+
return d.value
|
|
1375
|
+
? d.value.toLocaleString(undefined, this.numberFormat)
|
|
1376
|
+
: undefined;
|
|
1285
1377
|
})
|
|
1286
1378
|
.attr('class', 'barText')
|
|
1287
1379
|
.attr('font-size', this.fontSize)
|
|
@@ -1345,8 +1437,7 @@ const barChart = class {
|
|
|
1345
1437
|
this.setMinMax();
|
|
1346
1438
|
const newHeight = this.setDims();
|
|
1347
1439
|
this.transitionTitle();
|
|
1348
|
-
this.svg
|
|
1349
|
-
.attr('aria-label', this.chartData && this.chartData.title
|
|
1440
|
+
this.svg.attr('aria-label', this.chartData && this.chartData.title
|
|
1350
1441
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1351
1442
|
: 'Stapeldiagram');
|
|
1352
1443
|
this.setMargins();
|
|
@@ -1402,7 +1493,9 @@ const barChart = class {
|
|
|
1402
1493
|
linear.select(this.titleDiv).select('.loadingHeader').remove();
|
|
1403
1494
|
this.loading = false;
|
|
1404
1495
|
this.barChartContainer.selectAll('.bar').interrupt('animateBar');
|
|
1405
|
-
this.barChartContainer
|
|
1496
|
+
this.barChartContainer
|
|
1497
|
+
.selectAll('.bar')
|
|
1498
|
+
.transition()
|
|
1406
1499
|
.duration(this.defaultDuration)
|
|
1407
1500
|
.attr('y', (d) => this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal
|
|
1408
1501
|
? this.yScale(d.key)
|
|
@@ -1490,7 +1583,11 @@ const barChart = class {
|
|
|
1490
1583
|
return width;
|
|
1491
1584
|
}
|
|
1492
1585
|
adjustColor(color, amount) {
|
|
1493
|
-
return '#' +
|
|
1586
|
+
return ('#' +
|
|
1587
|
+
color
|
|
1588
|
+
.replace(/^#/, '')
|
|
1589
|
+
.replace(/../g, (color) => ('0' +
|
|
1590
|
+
Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)));
|
|
1494
1591
|
}
|
|
1495
1592
|
componentWillLoad() {
|
|
1496
1593
|
this.afChartDataUpdate(this.afChartData);
|
|
@@ -1553,7 +1650,10 @@ const barChart = class {
|
|
|
1553
1650
|
}
|
|
1554
1651
|
setTableDimensions() {
|
|
1555
1652
|
const table = linear.select(this.tableDiv);
|
|
1556
|
-
table
|
|
1653
|
+
table
|
|
1654
|
+
.style('display', 'flex')
|
|
1655
|
+
.style('height', '100%')
|
|
1656
|
+
.style('width', '100%');
|
|
1557
1657
|
}
|
|
1558
1658
|
// Extracting all headings from data and returning a string with <th>-elements with headings
|
|
1559
1659
|
headings() {
|
|
@@ -1592,7 +1692,7 @@ const barChart = class {
|
|
|
1592
1692
|
if (this.chartData.infoText)
|
|
1593
1693
|
heading = `${heading}<span style="display:block;margin-top:0.25rem;font-size:0.875rem;color:var(--digi--global--color--neutral--grayscale--darkest-3)">${this.chartData.infoText}</span>`;
|
|
1594
1694
|
}
|
|
1595
|
-
return (index.h(index.Host, { key: '
|
|
1695
|
+
return (index.h(index.Host, { key: 'cb70095467051cf1142891bc63694623e707d92f', ref: (el) => (this.host = el) }, index.h("svg", { key: 'c040fe2f27d9a5e3de1471fe7e4d853757f6a754', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, index.h("defs", { key: '17fd52f2cac5a3225e097aee80e8dc1a99909840' }, index.h("pattern", { key: '2940e729359dad1acc4635363cd5a8f3ee4d8ea1', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, index.h("rect", { key: '4b47d41ea9f4699a4bcc7b0f04d00b8bbd124946', width: "8", height: "8", fill: "white" }), index.h("line", { key: 'd5c3a32fb715a5271a784771d9812ea599390fc3', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), index.h("pattern", { key: '8038bb4d62fd87a118e0bcf4e750165eed48f789', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, index.h("rect", { key: 'b1247b7d27e73836c7b5a05fb77a872e89853d3b', width: "8", height: "8", fill: "white" }), index.h("line", { key: '14265bcba469f08b890654315a86d6278271d64d', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), index.h("pattern", { key: '4069999fd742795379f093c83c00cca488b6139c', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, index.h("rect", { key: 'c525ae39e05acf3e7522f1b92feffdfe5221e528', width: "8", height: "8", fill: "white" }), index.h("line", { key: 'fa183e0678f6f3794e094b97975fe96955b49e0a', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), index.h("div", { key: 'b6e46d7f4701775a177b02a98f46ca40308e9938', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, index.h("digi-typography", { key: '88d49833d43776a2bc23d7f73bb8cc9442350634', class: "chartTitle", innerHTML: heading }), index.h("digi-button", { key: '75e2ef09c3f9f91a08b3596d02ad308b244586bb', class: "buttonWrapper tableButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.activateTable, afAriaLabel: `Visa tabell ${((_a = this.chartData) === null || _a === void 0 ? void 0 : _a.title) ? (_b = this.chartData) === null || _b === void 0 ? void 0 : _b.title.toLowerCase() : ''}` }, index.h("digi-icon-table", { key: '7712b56f991bb5214aa3bebb9e380221156b6bbf', slot: "icon" }), "Visa tabell"), index.h("digi-button", { key: 'b9d442ea0b62303c2bf1018651ce3206063f3b35', style: { display: 'none' }, class: "buttonWrapper chartButton", "af-size": "medium", "af-variation": "function", "af-full-width": "false", onAfOnClick: this.reInitChart, afAriaLabel: `Visa diagram ${((_c = this.chartData) === null || _c === void 0 ? void 0 : _c.title) ? (_d = this.chartData) === null || _d === void 0 ? void 0 : _d.title.toLowerCase() : ''}` }, index.h("digi-icon-chart", { key: '260c432d04f8ea00216cd485b5ec3a29df4b4db1', slot: "icon" }), "Visa diagram"), index.h("div", { key: 'a7fd6276b5738e9cf040f0e9b99e983b27ec25cf', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), index.h("div", { key: '705ec9e3931b91009ff565bbd8f4ba300bd8dbd7', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, index.h("div", { key: '242fd5b7afba36df00aa7fb256bd8578712d25e7', class: "chartTooltip", id: this.afId }, index.h("div", { key: '6417cc30962396164fe4840ecfef62c4ef7591d6', class: "tooltipHead" }, index.h("digi-icon-x", { key: 'dc4edb442bfb342fbdb64b06e70f1e19ccc5ffb1', class: "tooltipClose" })), index.h("div", { key: 'da625c879d4c0eebffa02193dc36d794c755b768', class: "tooltipBody" }), this.afVariation === barChartVariation_enum.BarChartVariation.Horizontal ? (index.h("digi-icon-caret-up", { class: "caret" })) : (index.h("digi-icon-caret-down", { class: "caret" })))), index.h("div", { key: 'a003a616c2ee8b848d402b38009261539ebf0c50', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, index.h("div", { key: '44a6db8daa836ccf910aafd6fd996f153c337bf4', class: "legend" })), index.h("div", { key: 'a872281035f2799fe8aa9128a953d0c5d9f6b2cc', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
|
|
1596
1696
|
}
|
|
1597
1697
|
get hostElement() { return index.getElement(this); }
|
|
1598
1698
|
static get watchers() { return {
|
|
@@ -35,6 +35,7 @@ require('./loader-spinner-size.enum-db2973f0.js');
|
|
|
35
35
|
require('./media-figure-alignment.enum-3885aba5.js');
|
|
36
36
|
require('./navigation-sidebar-variation.enum-1c0c3064.js');
|
|
37
37
|
require('./navigation-vertical-menu-variation.enum-c237edd3.js');
|
|
38
|
+
require('./progress-circle-role.enum-b7fdcf0c.js');
|
|
38
39
|
require('./progress-indicator-variation.enum-7cf8e0e4.js');
|
|
39
40
|
require('./progress-list-item-variation.enum-90e4c874.js');
|
|
40
41
|
require('./progress-list-variation.enum-06d5ce27.js');
|
|
@@ -35,6 +35,7 @@ require('./loader-spinner-size.enum-db2973f0.js');
|
|
|
35
35
|
require('./media-figure-alignment.enum-3885aba5.js');
|
|
36
36
|
require('./navigation-sidebar-variation.enum-1c0c3064.js');
|
|
37
37
|
require('./navigation-vertical-menu-variation.enum-c237edd3.js');
|
|
38
|
+
require('./progress-circle-role.enum-b7fdcf0c.js');
|
|
38
39
|
require('./progress-indicator-variation.enum-7cf8e0e4.js');
|
|
39
40
|
require('./progress-list-item-variation.enum-90e4c874.js');
|
|
40
41
|
require('./progress-list-variation.enum-06d5ce27.js');
|
|
@@ -2547,7 +2548,7 @@ const CalendarDatepicker = class {
|
|
|
2547
2548
|
return this.afSelectedDates;
|
|
2548
2549
|
}
|
|
2549
2550
|
render() {
|
|
2550
|
-
return (index$2.h(index$2.Host, { key: '
|
|
2551
|
+
return (index$2.h(index$2.Host, { key: '6b080d933e012fe050aee0181f927c3252b0bb7e', tabindex: -1 }, index$2.h("div", { key: 'ec59a7f209f7a5e06c62d4443fbca980b1030d12', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, index$2.h("div", { key: '2bf3bd4f0a82c14c4fb04610dab19767fbba595d', class: "digi-calendar-datepicker__input-field" }, index$2.h("digi-form-input", { key: 'ebde8123611c021b60104f75c2e4085e35fb4697', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
|
|
2551
2552
|
? formInputVariation_enum.FormInputValidation.ERROR
|
|
2552
2553
|
: this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
|
|
2553
2554
|
evt.stopImmediatePropagation();
|
|
@@ -2564,11 +2565,11 @@ const CalendarDatepicker = class {
|
|
|
2564
2565
|
e.preventDefault();
|
|
2565
2566
|
const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
|
|
2566
2567
|
focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
|
|
2567
|
-
} }, index$2.h("button", { key: '
|
|
2568
|
+
} }, index$2.h("button", { key: '04df5ccb789271d7ba2f693b740f316301f9fae0', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
|
|
2568
2569
|
? this.afCloseCalendarAriaLabel
|
|
2569
|
-
: this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, index$2.h("digi-icon-calendar-alt", { key: '
|
|
2570
|
+
: this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, index$2.h("digi-icon-calendar-alt", { key: '65b9a472f629bbaa46a64c8a304f358da76b0830', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), index$2.h("div", { key: 'd0df89ce680bb2a0ca7f311b2c0ead0f72dc30b6', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, index$2.h("p", { key: '9796876e15e88b1599d772863c29fc472da24c69', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
|
|
2570
2571
|
? `${text._t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
|
|
2571
|
-
: ''), index$2.h("digi-calendar", { key: '
|
|
2572
|
+
: ''), index$2.h("digi-calendar", { key: 'bd5f34bcdbcb2276b5080c43479337c514861ba9', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
|
|
2572
2573
|
evt.stopImmediatePropagation();
|
|
2573
2574
|
this.parseCalendar(evt);
|
|
2574
2575
|
}, onKeyDown: (e) => {
|
|
@@ -2579,7 +2580,7 @@ const CalendarDatepicker = class {
|
|
|
2579
2580
|
return;
|
|
2580
2581
|
e.preventDefault();
|
|
2581
2582
|
this.focusOnCalendarInput();
|
|
2582
|
-
} })), this.afCloseOnSelect && !this.afMultipleDates && (index$2.h("div", { key: '
|
|
2583
|
+
} })), this.afCloseOnSelect && !this.afMultipleDates && (index$2.h("div", { key: 'fc150d20f14731e8f67f38c6042e8af4e24eae38', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
|
|
2583
2584
|
? `${text._t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
|
|
2584
2585
|
: '')))));
|
|
2585
2586
|
}
|