@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
|
@@ -122,7 +122,13 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
122
122
|
this.defaultDuration = 400;
|
|
123
123
|
// Text and formats
|
|
124
124
|
this.fontSize = '0.875rem';
|
|
125
|
-
this.colorPalettes = [
|
|
125
|
+
this.colorPalettes = [
|
|
126
|
+
'--digi--color--background--brand-primary',
|
|
127
|
+
'--digi--color--infographic--brand--primary',
|
|
128
|
+
'--digi--color--background--sentiment--beta--primary',
|
|
129
|
+
'--digi--color--text--interactive--visited',
|
|
130
|
+
'--digi--color--icon--validation--error'
|
|
131
|
+
];
|
|
126
132
|
// Observer for watching size changes when in line chart mode
|
|
127
133
|
this.barChartObserver = new ResizeObserver((entries) => {
|
|
128
134
|
entries.forEach(() => {
|
|
@@ -132,7 +138,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
132
138
|
});
|
|
133
139
|
});
|
|
134
140
|
this.highlightBars = (serie) => {
|
|
135
|
-
this.barChartContainer
|
|
141
|
+
this.barChartContainer
|
|
142
|
+
.selectAll('.bar')
|
|
136
143
|
.attr('fill', (barData) => this.colorFunction(barData.serie))
|
|
137
144
|
.transition('color')
|
|
138
145
|
.duration(150)
|
|
@@ -141,47 +148,78 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
141
148
|
if (barData.serie === serie)
|
|
142
149
|
return this.colorFunction(barData.serie);
|
|
143
150
|
else {
|
|
144
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
151
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
152
|
+
this.series.indexOf(barData.serie) > 0) {
|
|
145
153
|
return 'url(#prognosisInactive)';
|
|
146
154
|
}
|
|
147
155
|
return this.evalColorVar('--digi--color--background--secondary-accent');
|
|
148
156
|
}
|
|
149
157
|
});
|
|
150
|
-
select(this.legendDiv)
|
|
158
|
+
select(this.legendDiv)
|
|
159
|
+
.selectAll('.legendChip')
|
|
160
|
+
.transition('colorLegend')
|
|
161
|
+
.duration(150)
|
|
162
|
+
.style('opacity', (title) => (title === serie ? 1 : 0.25));
|
|
151
163
|
};
|
|
152
164
|
this.resetBarColor = () => {
|
|
153
|
-
this.barChartContainer
|
|
154
|
-
|
|
165
|
+
this.barChartContainer
|
|
166
|
+
.selectAll('.bar')
|
|
167
|
+
.transition('color')
|
|
168
|
+
.duration(150)
|
|
169
|
+
.attr('fill', (barData) => this.colorFunction(barData.serie));
|
|
170
|
+
select(this.legendDiv)
|
|
171
|
+
.selectAll('.legendChip')
|
|
172
|
+
.transition('colorLegend')
|
|
173
|
+
.duration(150)
|
|
174
|
+
.style('opacity', 1);
|
|
155
175
|
if (this.chartData.data.averageLine) {
|
|
156
|
-
this.barChartContainer
|
|
176
|
+
this.barChartContainer
|
|
177
|
+
.selectAll('.averageLine')
|
|
178
|
+
.transition('avgLine')
|
|
179
|
+
.style('mix-blend-mode', 'plus-lighter')
|
|
157
180
|
.style('filter', 'contrast(0.5)');
|
|
158
181
|
/* this.barChartContainer.selectAll('.averageLineText').transition('avgLine').style('mix-blend-mode', 'plus-lighter')
|
|
159
182
|
.style('filter', 'contrast(0.5)'); */
|
|
160
183
|
}
|
|
161
184
|
};
|
|
162
185
|
this.highlightAverageLine = (serie) => {
|
|
163
|
-
this.barChartContainer
|
|
186
|
+
this.barChartContainer
|
|
187
|
+
.selectAll('.bar')
|
|
164
188
|
.transition('color')
|
|
165
189
|
.duration(150)
|
|
166
190
|
.attr('fill', (barData) => {
|
|
167
191
|
var _a;
|
|
168
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
192
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
193
|
+
this.series.indexOf(barData.serie) > 0) {
|
|
169
194
|
return 'url(#prognosisInactive)';
|
|
170
195
|
}
|
|
171
196
|
else
|
|
172
197
|
return this.evalColorVar('--digi--color--background--secondary-accent');
|
|
173
198
|
});
|
|
174
|
-
this.barChartContainer
|
|
175
|
-
.
|
|
199
|
+
this.barChartContainer
|
|
200
|
+
.selectAll('.averageLine')
|
|
201
|
+
.transition('avgLine')
|
|
202
|
+
.duration(150)
|
|
203
|
+
.style('mix-blend-mode', null)
|
|
204
|
+
.style('filter', null);
|
|
176
205
|
/* this.barChartContainer.selectAll('.averageLineText').transition('avgLineText')
|
|
177
206
|
.duration(150).style('mix-blend-mode', null).style('filter', null) */
|
|
178
|
-
select(this.legendDiv)
|
|
207
|
+
select(this.legendDiv)
|
|
208
|
+
.selectAll('.legendChip')
|
|
209
|
+
.transition('colorLegend')
|
|
210
|
+
.duration(150)
|
|
211
|
+
.style('opacity', (title) => (title === serie ? 1 : 0.25));
|
|
179
212
|
};
|
|
180
213
|
// Sets and resizespositions the average line
|
|
181
214
|
this.averageLine = () => {
|
|
182
215
|
if (!this.chartData.data.averageLine)
|
|
183
216
|
return;
|
|
184
|
-
const avLineGroup = this.barChartContainer
|
|
217
|
+
const avLineGroup = this.barChartContainer
|
|
218
|
+
.select('.interactiveElements')
|
|
219
|
+
.selectAll('.averageLineGroup')
|
|
220
|
+
.data([this.chartData.data.averageLine])
|
|
221
|
+
.join('g')
|
|
222
|
+
.attr('class', 'averageLineGroup');
|
|
185
223
|
/* avLineGroup.selectAll('.averageLineText')
|
|
186
224
|
.data(d => [d])
|
|
187
225
|
.join('text')
|
|
@@ -194,8 +232,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
194
232
|
.attr('fill', 'var(--digi--color--infographic--lineart)')
|
|
195
233
|
.style('mix-blend-mode', 'plus-lighter')
|
|
196
234
|
.style('filter', 'contrast(0.5)'); */
|
|
197
|
-
avLineGroup
|
|
198
|
-
.
|
|
235
|
+
avLineGroup
|
|
236
|
+
.selectAll('.averageLine')
|
|
237
|
+
.data((d) => [d.value])
|
|
199
238
|
.join('line')
|
|
200
239
|
.attr('class', 'averageLine')
|
|
201
240
|
.attr('x1', this.xScale.range()[0])
|
|
@@ -243,11 +282,15 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
243
282
|
this.highlightBarGroup = (_event, datum) => {
|
|
244
283
|
if (typeof datum === 'string') {
|
|
245
284
|
const barGroupID = '#' + this.barGroupID(datum);
|
|
246
|
-
this.barChartContainer
|
|
285
|
+
this.barChartContainer
|
|
286
|
+
.select(barGroupID)
|
|
287
|
+
.selectAll('.bar')
|
|
288
|
+
.transition('color')
|
|
247
289
|
.duration(20)
|
|
248
290
|
.attr('fill', (d) => {
|
|
249
291
|
var _a;
|
|
250
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
292
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
293
|
+
this.series.indexOf(d.serie) > 0) {
|
|
251
294
|
return 'url(#prognosisHighlight)';
|
|
252
295
|
}
|
|
253
296
|
else
|
|
@@ -256,7 +299,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
256
299
|
}
|
|
257
300
|
};
|
|
258
301
|
this.unHighlightBarGroup = () => {
|
|
259
|
-
this.barSelection
|
|
302
|
+
this.barSelection
|
|
303
|
+
.selectAll('.bar')
|
|
304
|
+
.transition('color')
|
|
260
305
|
.duration(100)
|
|
261
306
|
.attr('fill', (d) => {
|
|
262
307
|
return this.colorFunction(d.serie);
|
|
@@ -349,13 +394,15 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
349
394
|
return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
|
|
350
395
|
};
|
|
351
396
|
this.updateBars = () => {
|
|
352
|
-
this.barSelection = this.barChartContainer
|
|
397
|
+
this.barSelection = this.barChartContainer
|
|
398
|
+
.select('.interactiveElements')
|
|
353
399
|
.selectAll('.barGroup')
|
|
354
400
|
.data(this.mappedData)
|
|
355
401
|
.join('g')
|
|
356
402
|
.attr('class', 'barGroup')
|
|
357
403
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
358
|
-
this.barSelection
|
|
404
|
+
this.barSelection
|
|
405
|
+
.selectAll('.bar')
|
|
359
406
|
.data((d) => {
|
|
360
407
|
return d.series;
|
|
361
408
|
})
|
|
@@ -434,7 +481,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
434
481
|
key: key,
|
|
435
482
|
serie: serie.title,
|
|
436
483
|
value: serie.yValues[index],
|
|
437
|
-
len: serie.yValues[index]
|
|
484
|
+
len: serie.yValues[index]
|
|
485
|
+
? this.getTextSize(serie.yValues[index].toLocaleString())
|
|
486
|
+
: 0
|
|
438
487
|
});
|
|
439
488
|
}
|
|
440
489
|
});
|
|
@@ -450,7 +499,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
450
499
|
key: key.toString(),
|
|
451
500
|
serie: serie.title,
|
|
452
501
|
value: serie.yValues[index],
|
|
453
|
-
len: serie.yValues[index]
|
|
502
|
+
len: serie.yValues[index]
|
|
503
|
+
? this.getTextSize(serie.yValues[index].toLocaleString())
|
|
504
|
+
: 0
|
|
454
505
|
});
|
|
455
506
|
}
|
|
456
507
|
});
|
|
@@ -461,7 +512,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
461
512
|
return toReturn;
|
|
462
513
|
};
|
|
463
514
|
this.adjustBarSize = () => {
|
|
464
|
-
this.barSelection
|
|
515
|
+
this.barSelection
|
|
516
|
+
.selectAll('.bar')
|
|
465
517
|
.attr('x', this.xFunction)
|
|
466
518
|
.attr('y', this.yFunction)
|
|
467
519
|
.attr('width', this.widthFunction)
|
|
@@ -476,30 +528,38 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
476
528
|
// Handling x positioning of bars
|
|
477
529
|
this.xFunction = (d, i) => {
|
|
478
530
|
return this.afVariation === BarChartVariation.Horizontal
|
|
479
|
-
?
|
|
480
|
-
|
|
531
|
+
? d.value > 0
|
|
532
|
+
? this.xScale(0)
|
|
533
|
+
: this.xScale(d.value)
|
|
534
|
+
: this.xScale(d.key) +
|
|
535
|
+
((this.xScale.bandwidth() / this.dataWidth) * i + this.barGap * i);
|
|
481
536
|
};
|
|
482
537
|
// Handling y positioning of bars
|
|
483
538
|
this.yFunction = (d, i) => {
|
|
484
539
|
if (!d.value)
|
|
485
540
|
return 0;
|
|
486
541
|
return this.afVariation === BarChartVariation.Horizontal
|
|
487
|
-
? this.yScale(d.key) +
|
|
488
|
-
|
|
542
|
+
? this.yScale(d.key) +
|
|
543
|
+
((this.yScale.bandwidth() / this.dataWidth) * i + this.barGap * i)
|
|
544
|
+
: d.value < 0
|
|
545
|
+
? this.yScale(0)
|
|
546
|
+
: this.yScale(d.value);
|
|
489
547
|
};
|
|
490
548
|
// Handling height for bars
|
|
491
549
|
this.heightFunction = (d) => {
|
|
492
550
|
if (!d.value)
|
|
493
551
|
return 0;
|
|
494
552
|
return this.afVariation === BarChartVariation.Horizontal
|
|
495
|
-
? this.yScale.bandwidth() / this.dataWidth -
|
|
496
|
-
:
|
|
553
|
+
? this.yScale.bandwidth() / this.dataWidth - this.barGap
|
|
554
|
+
: d.value < 0
|
|
555
|
+
? this.yScale(d.value) - this.yScale(0)
|
|
556
|
+
: this.yScale(0) - this.yScale(d.value);
|
|
497
557
|
};
|
|
498
558
|
// Handling width for bars
|
|
499
559
|
this.widthFunction = (d) => {
|
|
500
560
|
return this.afVariation === BarChartVariation.Horizontal
|
|
501
561
|
? Math.abs(this.xScale(0) - this.xScale(d.value))
|
|
502
|
-
: this.xScale.bandwidth() / this.dataWidth -
|
|
562
|
+
: this.xScale.bandwidth() / this.dataWidth - this.barGap;
|
|
503
563
|
};
|
|
504
564
|
// Setting dimension variable
|
|
505
565
|
this.setDims = (onlyHeight = false) => {
|
|
@@ -742,7 +802,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
742
802
|
.attr('fill', (d) => {
|
|
743
803
|
var _a;
|
|
744
804
|
if (event.target.tagName === 'rect') {
|
|
745
|
-
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
805
|
+
if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
|
|
806
|
+
this.series.indexOf(d.serie) > 0) {
|
|
746
807
|
return 'url(#prognosisHighlight)';
|
|
747
808
|
}
|
|
748
809
|
else
|
|
@@ -758,7 +819,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
758
819
|
select(event.target)
|
|
759
820
|
.transition('color')
|
|
760
821
|
.duration(this.defaultDuration)
|
|
761
|
-
.attr('fill', (d) => event.target.tagName === 'rect'
|
|
822
|
+
.attr('fill', (d) => event.target.tagName === 'rect'
|
|
823
|
+
? this.colorFunction(d.serie)
|
|
824
|
+
: '#333333');
|
|
762
825
|
};
|
|
763
826
|
this.openTooltip = (...[, d]) => {
|
|
764
827
|
// If type is string, the user has clicked on a y-axis tick
|
|
@@ -770,9 +833,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
770
833
|
else
|
|
771
834
|
this.tooltipData = d;
|
|
772
835
|
const tooltipBody = this.tooltip.select('.tooltipBody');
|
|
773
|
-
this.tooltip
|
|
774
|
-
.select('.tooltipHeading')
|
|
775
|
-
.html(this.tooltipData.key);
|
|
836
|
+
this.tooltip.select('.tooltipHeading').html(this.tooltipData.key);
|
|
776
837
|
tooltipBody
|
|
777
838
|
.selectAll('div')
|
|
778
839
|
.data(this.tooltipData.series ? this.tooltipData.series : [this.tooltipData])
|
|
@@ -811,15 +872,25 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
811
872
|
.style('transform', `translate(${diff > 0 ? width / 2 - 10 : this.xScale(data.value) / 2}px,0)`);
|
|
812
873
|
}
|
|
813
874
|
else {
|
|
814
|
-
const index = (_a = this.mappedData
|
|
815
|
-
|
|
875
|
+
const index = (_a = this.mappedData
|
|
876
|
+
.find((xPoint) => xPoint.key === data.key)) === null || _a === void 0 ? void 0 : _a.series.findIndex((serie) => serie.serie === data.serie);
|
|
877
|
+
const barIndex = (this.xScale.bandwidth() / this.dataWidth) * (index ? index + 1 : 1) -
|
|
878
|
+
this.xScale.bandwidth() / this.dataWidth / 2;
|
|
816
879
|
// This should be where the x-axis starts
|
|
817
880
|
const xStart = this.margin.left + this.tickPadding + this.yTickSize;
|
|
818
881
|
// Creating adjustment for tooltip to not appear outside of chart
|
|
819
882
|
const spaceToSVGEdge = 5;
|
|
820
|
-
const inlineAdjustment =
|
|
821
|
-
|
|
822
|
-
|
|
883
|
+
const inlineAdjustment = this.dims.width - spaceToSVGEdge <
|
|
884
|
+
this.xScale(data.key) + xStart + barIndex + width / 2
|
|
885
|
+
? ((this.xScale(data.key) +
|
|
886
|
+
xStart +
|
|
887
|
+
barIndex +
|
|
888
|
+
width / 2 -
|
|
889
|
+
(this.dims.width - spaceToSVGEdge)) /
|
|
890
|
+
width) *
|
|
891
|
+
100
|
|
892
|
+
: 0;
|
|
893
|
+
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) )`);
|
|
823
894
|
this.tooltip
|
|
824
895
|
.select('digi-icon-caret-down')
|
|
825
896
|
.style('position', 'absolute')
|
|
@@ -829,8 +900,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
829
900
|
}
|
|
830
901
|
else {
|
|
831
902
|
if (this.afVariation === BarChartVariation.Horizontal) {
|
|
832
|
-
this.tooltip
|
|
833
|
-
.style('transform', `translate(${this.tickPadding}px, ${this.yScale(data.key) + this.series.length * this.yScale.bandwidth() + 5}px )` // 5 is for half caret size
|
|
903
|
+
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
|
|
834
904
|
);
|
|
835
905
|
this.tooltip
|
|
836
906
|
.select('digi-icon-caret-up')
|
|
@@ -843,12 +913,17 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
843
913
|
else {
|
|
844
914
|
const xStart = this.margin.left + this.tickPadding + this.yTickSize;
|
|
845
915
|
const translatePoint = this.xScale(data.key) + xStart + this.xScale.bandwidth() / 2;
|
|
846
|
-
const yMax = max(data.series.map(elem => elem.value));
|
|
916
|
+
const yMax = max(data.series.map((elem) => elem.value));
|
|
847
917
|
// Creating adjustment for tooltip to not appear outside of chart
|
|
848
918
|
const spaceToSVGEdge = 5;
|
|
849
|
-
const inlineAdjustment =
|
|
850
|
-
|
|
851
|
-
|
|
919
|
+
const inlineAdjustment = this.dims.width - spaceToSVGEdge < translatePoint + width / 2
|
|
920
|
+
? ((translatePoint +
|
|
921
|
+
width / 2 -
|
|
922
|
+
(this.dims.width - spaceToSVGEdge)) /
|
|
923
|
+
width) *
|
|
924
|
+
100
|
|
925
|
+
: 0;
|
|
926
|
+
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) )`);
|
|
852
927
|
this.tooltip
|
|
853
928
|
.select('digi-icon-caret-down')
|
|
854
929
|
.style('position', 'absolute')
|
|
@@ -884,7 +959,10 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
884
959
|
.attr('opacity', 0)
|
|
885
960
|
.on('end', () => {
|
|
886
961
|
this.svg.remove();
|
|
887
|
-
select(this.legendDiv)
|
|
962
|
+
select(this.legendDiv)
|
|
963
|
+
.select('.legend')
|
|
964
|
+
.selectAll('.legendChip')
|
|
965
|
+
.remove();
|
|
888
966
|
this.legendDiv.style['display'] = 'none';
|
|
889
967
|
this.tableDiv.style['display'] = 'block';
|
|
890
968
|
this.setTableContent();
|
|
@@ -938,12 +1016,13 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
938
1016
|
this.afChartData = undefined;
|
|
939
1017
|
}
|
|
940
1018
|
afChartDataUpdate(data) {
|
|
941
|
-
if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 ||
|
|
1019
|
+
if ((typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0) ||
|
|
1020
|
+
(typeof data !== 'string' && Object.keys(data).length > 0)) {
|
|
942
1021
|
if (typeof data != 'string')
|
|
943
1022
|
this.chartData = data;
|
|
944
1023
|
else
|
|
945
1024
|
this.chartData = JSON.parse(data);
|
|
946
|
-
this.series = this.chartData.data.series.map(serie => serie.title);
|
|
1025
|
+
this.series = this.chartData.data.series.map((serie) => serie.title);
|
|
947
1026
|
}
|
|
948
1027
|
this.mappedData = this.reshapeData();
|
|
949
1028
|
// checking for width of each tick
|
|
@@ -986,10 +1065,11 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
986
1065
|
}
|
|
987
1066
|
initLegend() {
|
|
988
1067
|
const rectSize = 18;
|
|
989
|
-
const legendData = this.chartData.data.series.map(serie => serie.title);
|
|
1068
|
+
const legendData = this.chartData.data.series.map((serie) => serie.title);
|
|
990
1069
|
if (this.chartData.data.averageLine)
|
|
991
1070
|
legendData.push(this.chartData.data.averageLine.text);
|
|
992
|
-
const legendChips = select(this.legendDiv)
|
|
1071
|
+
const legendChips = select(this.legendDiv)
|
|
1072
|
+
.select('.legend')
|
|
993
1073
|
.style('margin-left', `${this.margin.left + this.tickPadding + this.yTickSize}px`)
|
|
994
1074
|
.style('margin-top', '0.5rem')
|
|
995
1075
|
.selectAll('.legendChip')
|
|
@@ -1003,7 +1083,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1003
1083
|
.style('cursor', 'default')
|
|
1004
1084
|
.on('mouseenter', (_event, serie) => this.highlightBars(serie))
|
|
1005
1085
|
.on('mouseleave', this.resetBarColor);
|
|
1006
|
-
legendChips
|
|
1086
|
+
legendChips
|
|
1087
|
+
.append('svg')
|
|
1007
1088
|
.attr('width', rectSize + 1)
|
|
1008
1089
|
.attr('height', rectSize + 1)
|
|
1009
1090
|
.append('rect')
|
|
@@ -1014,15 +1095,19 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1014
1095
|
.attr('rx', 4)
|
|
1015
1096
|
.attr('ry', 4)
|
|
1016
1097
|
.attr('fill', (title) => this.colorFunction(title));
|
|
1017
|
-
legendChips
|
|
1098
|
+
legendChips
|
|
1099
|
+
.append('span')
|
|
1100
|
+
.style('text-wrap', 'nowrap')
|
|
1101
|
+
.style('font-size', '0.875rem')
|
|
1102
|
+
.text((d) => d);
|
|
1018
1103
|
if (this.chartData.data.averageLine) {
|
|
1019
|
-
const averageLine = legendChips
|
|
1104
|
+
const averageLine = legendChips
|
|
1105
|
+
.filter(':last-child')
|
|
1020
1106
|
.on('mouseenter', (_event, serie) => this.highlightAverageLine(serie));
|
|
1021
|
-
const miniSVG = averageLine
|
|
1022
|
-
.select('svg')
|
|
1023
|
-
.attr('width', rectSize * 2);
|
|
1107
|
+
const miniSVG = averageLine.select('svg').attr('width', rectSize * 2);
|
|
1024
1108
|
miniSVG.select('rect').remove();
|
|
1025
|
-
miniSVG
|
|
1109
|
+
miniSVG
|
|
1110
|
+
.append('line')
|
|
1026
1111
|
.attr('x1', 1)
|
|
1027
1112
|
.attr('x2', rectSize * 2 - 1)
|
|
1028
1113
|
.attr('y1', rectSize / 2 + 1)
|
|
@@ -1065,7 +1150,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1065
1150
|
.attr('role', 'img')
|
|
1066
1151
|
.attr('aria-label', this.chartData && this.chartData.title
|
|
1067
1152
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1068
|
-
: 'Stapeldiagram')
|
|
1153
|
+
: 'Stapeldiagram')
|
|
1154
|
+
.attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
|
|
1069
1155
|
// Hide unusable components
|
|
1070
1156
|
select(this.titleDiv)
|
|
1071
1157
|
.select(this.afHeadingLevel)
|
|
@@ -1127,7 +1213,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1127
1213
|
.join('g')
|
|
1128
1214
|
.attr('class', 'barGroup')
|
|
1129
1215
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
1130
|
-
this.barSelection
|
|
1216
|
+
this.barSelection
|
|
1217
|
+
.selectAll('bar')
|
|
1131
1218
|
.data((d) => {
|
|
1132
1219
|
return d.series;
|
|
1133
1220
|
})
|
|
@@ -1142,13 +1229,15 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1142
1229
|
.attr('width', this.widthFunction)
|
|
1143
1230
|
.attr('height', () => 0)
|
|
1144
1231
|
.attr('fill', 'gray');
|
|
1145
|
-
this.barChartContainer
|
|
1232
|
+
this.barChartContainer
|
|
1233
|
+
.selectAll('.bar')
|
|
1146
1234
|
.transition('animateBar')
|
|
1147
1235
|
.duration(400)
|
|
1148
1236
|
.delay((...[, i]) => i * 150)
|
|
1149
1237
|
.attr('y', this.yFunction)
|
|
1150
1238
|
.attr('height', this.heightFunction);
|
|
1151
|
-
this.barChartContainer
|
|
1239
|
+
this.barChartContainer
|
|
1240
|
+
.selectAll('.bar')
|
|
1152
1241
|
.transition('animateBar')
|
|
1153
1242
|
.duration(400)
|
|
1154
1243
|
.ease(linear$1)
|
|
@@ -1258,7 +1347,8 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1258
1347
|
.join('g')
|
|
1259
1348
|
.attr('class', 'barGroup')
|
|
1260
1349
|
.attr('id', (d) => this.barGroupID(d.key));
|
|
1261
|
-
this.barSelection
|
|
1350
|
+
this.barSelection
|
|
1351
|
+
.selectAll('.barGroup')
|
|
1262
1352
|
.data((d) => {
|
|
1263
1353
|
return d.series;
|
|
1264
1354
|
})
|
|
@@ -1285,7 +1375,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1285
1375
|
.append('text');
|
|
1286
1376
|
this.textSelection
|
|
1287
1377
|
.text((d) => {
|
|
1288
|
-
return d.value
|
|
1378
|
+
return d.value
|
|
1379
|
+
? d.value.toLocaleString(undefined, this.numberFormat)
|
|
1380
|
+
: undefined;
|
|
1289
1381
|
})
|
|
1290
1382
|
.attr('class', 'barText')
|
|
1291
1383
|
.attr('font-size', this.fontSize)
|
|
@@ -1349,8 +1441,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1349
1441
|
this.setMinMax();
|
|
1350
1442
|
const newHeight = this.setDims();
|
|
1351
1443
|
this.transitionTitle();
|
|
1352
|
-
this.svg
|
|
1353
|
-
.attr('aria-label', this.chartData && this.chartData.title
|
|
1444
|
+
this.svg.attr('aria-label', this.chartData && this.chartData.title
|
|
1354
1445
|
? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
|
|
1355
1446
|
: 'Stapeldiagram');
|
|
1356
1447
|
this.setMargins();
|
|
@@ -1406,7 +1497,9 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1406
1497
|
select(this.titleDiv).select('.loadingHeader').remove();
|
|
1407
1498
|
this.loading = false;
|
|
1408
1499
|
this.barChartContainer.selectAll('.bar').interrupt('animateBar');
|
|
1409
|
-
this.barChartContainer
|
|
1500
|
+
this.barChartContainer
|
|
1501
|
+
.selectAll('.bar')
|
|
1502
|
+
.transition()
|
|
1410
1503
|
.duration(this.defaultDuration)
|
|
1411
1504
|
.attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
|
|
1412
1505
|
? this.yScale(d.key)
|
|
@@ -1494,7 +1587,11 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1494
1587
|
return width;
|
|
1495
1588
|
}
|
|
1496
1589
|
adjustColor(color, amount) {
|
|
1497
|
-
return '#' +
|
|
1590
|
+
return ('#' +
|
|
1591
|
+
color
|
|
1592
|
+
.replace(/^#/, '')
|
|
1593
|
+
.replace(/../g, (color) => ('0' +
|
|
1594
|
+
Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)));
|
|
1498
1595
|
}
|
|
1499
1596
|
componentWillLoad() {
|
|
1500
1597
|
this.afChartDataUpdate(this.afChartData);
|
|
@@ -1557,7 +1654,10 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1557
1654
|
}
|
|
1558
1655
|
setTableDimensions() {
|
|
1559
1656
|
const table = select(this.tableDiv);
|
|
1560
|
-
table
|
|
1657
|
+
table
|
|
1658
|
+
.style('display', 'flex')
|
|
1659
|
+
.style('height', '100%')
|
|
1660
|
+
.style('width', '100%');
|
|
1561
1661
|
}
|
|
1562
1662
|
// Extracting all headings from data and returning a string with <th>-elements with headings
|
|
1563
1663
|
headings() {
|
|
@@ -1596,7 +1696,7 @@ const barChart = /*@__PURE__*/ proxyCustomElement(class barChart extends H {
|
|
|
1596
1696
|
if (this.chartData.infoText)
|
|
1597
1697
|
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>`;
|
|
1598
1698
|
}
|
|
1599
|
-
return (h(Host, { key: '
|
|
1699
|
+
return (h(Host, { key: 'cb70095467051cf1142891bc63694623e707d92f', ref: (el) => (this.host = el) }, h("svg", { key: 'c040fe2f27d9a5e3de1471fe7e4d853757f6a754', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, h("defs", { key: '17fd52f2cac5a3225e097aee80e8dc1a99909840' }, h("pattern", { key: '2940e729359dad1acc4635363cd5a8f3ee4d8ea1', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: '4b47d41ea9f4699a4bcc7b0f04d00b8bbd124946', width: "8", height: "8", fill: "white" }), h("line", { key: 'd5c3a32fb715a5271a784771d9812ea599390fc3', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), h("pattern", { key: '8038bb4d62fd87a118e0bcf4e750165eed48f789', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: 'b1247b7d27e73836c7b5a05fb77a872e89853d3b', width: "8", height: "8", fill: "white" }), h("line", { key: '14265bcba469f08b890654315a86d6278271d64d', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), h("pattern", { key: '4069999fd742795379f093c83c00cca488b6139c', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: 'c525ae39e05acf3e7522f1b92feffdfe5221e528', width: "8", height: "8", fill: "white" }), h("line", { key: 'fa183e0678f6f3794e094b97975fe96955b49e0a', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), h("div", { key: 'b6e46d7f4701775a177b02a98f46ca40308e9938', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, h("digi-typography", { key: '88d49833d43776a2bc23d7f73bb8cc9442350634', class: "chartTitle", innerHTML: heading }), 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() : ''}` }, h("digi-icon-table", { key: '7712b56f991bb5214aa3bebb9e380221156b6bbf', slot: "icon" }), "Visa tabell"), 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() : ''}` }, h("digi-icon-chart", { key: '260c432d04f8ea00216cd485b5ec3a29df4b4db1', slot: "icon" }), "Visa diagram"), h("div", { key: 'a7fd6276b5738e9cf040f0e9b99e983b27ec25cf', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), h("div", { key: '705ec9e3931b91009ff565bbd8f4ba300bd8dbd7', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, h("div", { key: '242fd5b7afba36df00aa7fb256bd8578712d25e7', class: "chartTooltip", id: this.afId }, h("div", { key: '6417cc30962396164fe4840ecfef62c4ef7591d6', class: "tooltipHead" }, h("digi-icon-x", { key: 'dc4edb442bfb342fbdb64b06e70f1e19ccc5ffb1', class: "tooltipClose" })), h("div", { key: 'da625c879d4c0eebffa02193dc36d794c755b768', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (h("digi-icon-caret-up", { class: "caret" })) : (h("digi-icon-caret-down", { class: "caret" })))), h("div", { key: 'a003a616c2ee8b848d402b38009261539ebf0c50', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, h("div", { key: '44a6db8daa836ccf910aafd6fd996f153c337bf4', class: "legend" })), h("div", { key: 'a872281035f2799fe8aa9128a953d0c5d9f6b2cc', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
|
|
1600
1700
|
}
|
|
1601
1701
|
get hostElement() { return this; }
|
|
1602
1702
|
static get watchers() { return {
|
|
@@ -34,6 +34,7 @@ import './p-9dd41cc4.js';
|
|
|
34
34
|
import './p-40657c82.js';
|
|
35
35
|
import './p-f600576a.js';
|
|
36
36
|
import './p-3b20ec86.js';
|
|
37
|
+
import './p-be4fd246.js';
|
|
37
38
|
import './p-9dd5d6c8.js';
|
|
38
39
|
import './p-77a93845.js';
|
|
39
40
|
import './p-06f939ab.js';
|
|
@@ -2559,7 +2560,7 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
|
|
|
2559
2560
|
return this.afSelectedDates;
|
|
2560
2561
|
}
|
|
2561
2562
|
render() {
|
|
2562
|
-
return (h(Host, { key: '
|
|
2563
|
+
return (h(Host, { key: '6b080d933e012fe050aee0181f927c3252b0bb7e', tabindex: -1 }, h("div", { key: 'ec59a7f209f7a5e06c62d4443fbca980b1030d12', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '2bf3bd4f0a82c14c4fb04610dab19767fbba595d', class: "digi-calendar-datepicker__input-field" }, 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()
|
|
2563
2564
|
? FormInputValidation.ERROR
|
|
2564
2565
|
: this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
|
|
2565
2566
|
evt.stopImmediatePropagation();
|
|
@@ -2576,11 +2577,11 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
|
|
|
2576
2577
|
e.preventDefault();
|
|
2577
2578
|
const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
|
|
2578
2579
|
focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
|
|
2579
|
-
} }, h("button", { key: '
|
|
2580
|
+
} }, h("button", { key: '04df5ccb789271d7ba2f693b740f316301f9fae0', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
|
|
2580
2581
|
? this.afCloseCalendarAriaLabel
|
|
2581
|
-
: this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '
|
|
2582
|
+
: this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '65b9a472f629bbaa46a64c8a304f358da76b0830', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: 'd0df89ce680bb2a0ca7f311b2c0ead0f72dc30b6', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: '9796876e15e88b1599d772863c29fc472da24c69', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
|
|
2582
2583
|
? `${_t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
|
|
2583
|
-
: ''), h("digi-calendar", { key: '
|
|
2584
|
+
: ''), 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) => {
|
|
2584
2585
|
evt.stopImmediatePropagation();
|
|
2585
2586
|
this.parseCalendar(evt);
|
|
2586
2587
|
}, onKeyDown: (e) => {
|
|
@@ -2591,7 +2592,7 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
|
|
|
2591
2592
|
return;
|
|
2592
2593
|
e.preventDefault();
|
|
2593
2594
|
this.focusOnCalendarInput();
|
|
2594
|
-
} })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: '
|
|
2595
|
+
} })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'fc150d20f14731e8f67f38c6042e8af4e24eae38', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
|
|
2595
2596
|
? `${_t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
|
|
2596
2597
|
: '')))));
|
|
2597
2598
|
}
|