@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.
Files changed (119) hide show
  1. package/components/digi-bar-chart.js +170 -70
  2. package/components/digi-calendar-datepicker.js +6 -5
  3. package/components/digi-chart-line.js +12 -8
  4. package/components/digi-code-block.js +1 -1
  5. package/components/digi-code-example.js +2 -2
  6. package/components/digi-dialog.js +1 -0
  7. package/components/digi-footer.js +1 -0
  8. package/components/digi-form-checkbox.js +1 -1
  9. package/components/digi-form-error-list.js +3 -4
  10. package/components/digi-form-filter.js +1 -1
  11. package/components/digi-form-radiobutton.js +1 -1
  12. package/components/digi-form-receipt.js +1 -0
  13. package/components/digi-form-select-filter.js +1 -0
  14. package/components/digi-header-navigation.js +1 -0
  15. package/components/digi-header.js +1 -0
  16. package/components/digi-navigation-pagination.js +1 -0
  17. package/components/digi-notification-alert.js +1 -1
  18. package/components/digi-notification-error-page.js +1 -0
  19. package/components/digi-progress-circle.js +1 -6
  20. package/components/digi-tablist.js +5 -5
  21. package/components/digi-tag.js +1 -1
  22. package/components/digi-title-logo.js +1 -0
  23. package/components/digi-tools-feedback.js +1 -0
  24. package/components/index.js +1 -0
  25. package/components/{p-57a1c472.js → p-13c09880.js} +2 -2
  26. package/components/{p-4d2d082d.js → p-75c8d67e.js} +1 -0
  27. package/components/{p-b24c2842.js → p-77d8d575.js} +2 -2
  28. package/components/{p-195ca01d.js → p-bc5b7057.js} +1 -0
  29. package/components/p-be4fd246.js +7 -0
  30. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  31. package/dist/cjs/digi-bar-chart.cjs.entry.js +170 -70
  32. package/dist/cjs/digi-button_27.cjs.entry.js +1 -0
  33. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +6 -5
  34. package/dist/cjs/digi-chart-line.cjs.entry.js +12 -8
  35. package/dist/cjs/digi-code-block_3.cjs.entry.js +3 -2
  36. package/dist/cjs/digi-dialog.cjs.entry.js +1 -0
  37. package/dist/cjs/digi-form-checkbox.cjs.entry.js +2 -2
  38. package/dist/cjs/digi-form-error-list.cjs.entry.js +2 -2
  39. package/dist/cjs/digi-form-receipt.cjs.entry.js +1 -0
  40. package/dist/cjs/digi-form-select-filter.cjs.entry.js +1 -0
  41. package/dist/cjs/digi-navigation-pagination.cjs.entry.js +1 -0
  42. package/dist/cjs/digi-notification-alert.cjs.entry.js +1 -0
  43. package/dist/cjs/digi-notification-error-page.cjs.entry.js +1 -0
  44. package/dist/cjs/digi-progress-circle.cjs.entry.js +4 -9
  45. package/dist/cjs/digi-tablist.cjs.entry.js +5 -5
  46. package/dist/cjs/digi-tag.cjs.entry.js +1 -1
  47. package/dist/cjs/digi-tools-feedback.cjs.entry.js +1 -0
  48. package/dist/cjs/index.cjs.js +7 -0
  49. package/dist/cjs/loader.cjs.js +1 -1
  50. package/dist/cjs/progress-circle-role.enum-b7fdcf0c.js +7 -0
  51. package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.js +5 -5
  52. package/dist/collection/components/_chart/bar-chart/bar-chart.js +171 -70
  53. package/dist/collection/components/_chart/chart-line/chart-line.js +12 -8
  54. package/dist/collection/components/_form/form-checkbox/form-checkbox.js +2 -2
  55. package/dist/collection/components/_form/form-error-list/form-error-list.js +1 -7
  56. package/dist/collection/components/_form/form-radiobutton/form-radiobutton.js +2 -2
  57. package/dist/collection/components/_navigation/navigation-tablist/navigation-tablist.js +5 -5
  58. package/dist/collection/components/_tag/tag/tag.js +1 -1
  59. package/dist/collection/enums.js +7 -0
  60. package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +0 -2
  61. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  62. package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
  63. package/dist/digi-arbetsformedlingen/{p-60738889.entry.js → p-01874a31.entry.js} +1 -1
  64. package/dist/digi-arbetsformedlingen/p-18880083.entry.js +1 -0
  65. package/dist/digi-arbetsformedlingen/{p-d71c33d8.entry.js → p-37c0ea9e.entry.js} +1 -1
  66. package/dist/digi-arbetsformedlingen/p-39468f49.entry.js +1 -0
  67. package/dist/digi-arbetsformedlingen/p-501f9b16.entry.js +1 -0
  68. package/dist/digi-arbetsformedlingen/{p-d670e0e0.entry.js → p-54d5aa93.entry.js} +1 -1
  69. package/dist/digi-arbetsformedlingen/p-59073668.entry.js +1 -0
  70. package/dist/digi-arbetsformedlingen/p-8833044b.entry.js +1 -0
  71. package/dist/digi-arbetsformedlingen/p-97f66789.entry.js +1 -0
  72. package/dist/digi-arbetsformedlingen/p-9dae073c.entry.js +1 -0
  73. package/dist/digi-arbetsformedlingen/p-a186888d.entry.js +1 -0
  74. package/dist/digi-arbetsformedlingen/p-be4fd246.js +1 -0
  75. package/dist/digi-arbetsformedlingen/{p-0a6d26f7.entry.js → p-cea5ef63.entry.js} +1 -1
  76. package/dist/digi-arbetsformedlingen/{p-67ba87db.entry.js → p-d3e14568.entry.js} +1 -1
  77. package/dist/digi-arbetsformedlingen/p-ddd659bf.entry.js +1 -0
  78. package/dist/digi-arbetsformedlingen/p-e5bd5a7e.entry.js +1 -0
  79. package/dist/digi-arbetsformedlingen/p-ef689144.entry.js +1 -0
  80. package/dist/digi-arbetsformedlingen/p-f0a405ca.entry.js +1 -0
  81. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  82. package/dist/esm/digi-bar-chart.entry.js +170 -70
  83. package/dist/esm/digi-button_27.entry.js +1 -0
  84. package/dist/esm/digi-calendar-datepicker.entry.js +6 -5
  85. package/dist/esm/digi-chart-line.entry.js +12 -8
  86. package/dist/esm/digi-code-block_3.entry.js +3 -2
  87. package/dist/esm/digi-dialog.entry.js +1 -0
  88. package/dist/esm/digi-form-checkbox.entry.js +2 -2
  89. package/dist/esm/digi-form-error-list.entry.js +2 -2
  90. package/dist/esm/digi-form-receipt.entry.js +1 -0
  91. package/dist/esm/digi-form-select-filter.entry.js +1 -0
  92. package/dist/esm/digi-navigation-pagination.entry.js +1 -0
  93. package/dist/esm/digi-notification-alert.entry.js +1 -0
  94. package/dist/esm/digi-notification-error-page.entry.js +1 -0
  95. package/dist/esm/digi-progress-circle.entry.js +1 -6
  96. package/dist/esm/digi-tablist.entry.js +5 -5
  97. package/dist/esm/digi-tag.entry.js +1 -1
  98. package/dist/esm/digi-tools-feedback.entry.js +1 -0
  99. package/dist/esm/index.js +1 -0
  100. package/dist/esm/loader.js +1 -1
  101. package/dist/esm/progress-circle-role.enum-7737a2c6.js +7 -0
  102. package/dist/types/components/_calendar/calendar-datepicker/calendar-datepicker.d.ts +2 -2
  103. package/dist/types/components/_form/form-error-list/form-error-list.d.ts +0 -1
  104. package/dist/types/enums.d.ts +7 -0
  105. package/hydrate/index.js +204 -102
  106. package/hydrate/index.mjs +204 -102
  107. package/package.json +1 -1
  108. package/dist/digi-arbetsformedlingen/p-20693fa2.entry.js +0 -1
  109. package/dist/digi-arbetsformedlingen/p-3566b732.entry.js +0 -1
  110. package/dist/digi-arbetsformedlingen/p-3cda17e1.entry.js +0 -1
  111. package/dist/digi-arbetsformedlingen/p-4d84c470.entry.js +0 -1
  112. package/dist/digi-arbetsformedlingen/p-50b32151.entry.js +0 -1
  113. package/dist/digi-arbetsformedlingen/p-54b6eb3f.entry.js +0 -1
  114. package/dist/digi-arbetsformedlingen/p-5ad6d46d.entry.js +0 -1
  115. package/dist/digi-arbetsformedlingen/p-6324c9bf.entry.js +0 -1
  116. package/dist/digi-arbetsformedlingen/p-9062da9b.entry.js +0 -1
  117. package/dist/digi-arbetsformedlingen/p-9a456d55.entry.js +0 -1
  118. package/dist/digi-arbetsformedlingen/p-a26333e9.entry.js +0 -1
  119. package/dist/digi-arbetsformedlingen/p-e347aae8.entry.js +0 -1
@@ -372,7 +372,7 @@ export class CalendarDatepicker {
372
372
  return this.afSelectedDates;
373
373
  }
374
374
  render() {
375
- return (h(Host, { key: 'e6dcf21e94a0cf58081b2cc351291a9489eadcb6', tabindex: -1 }, h("div", { key: '4040e430dd3c55e9ed0a0e6ed5aa69dea906e7c3', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '823f9480cb8a77c1e3cecdc1f3982e426ab2e658', class: "digi-calendar-datepicker__input-field" }, h("digi-form-input", { key: '454ca3d0a8d489826891da25bba8d9e0359c1df0', 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()
375
+ 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()
376
376
  ? FormInputValidation.ERROR
377
377
  : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
378
378
  evt.stopImmediatePropagation();
@@ -389,11 +389,11 @@ export class CalendarDatepicker {
389
389
  e.preventDefault();
390
390
  const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
391
391
  focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
392
- } }, h("button", { key: '0ea8d3a9092c41f96a0cf24a2cdc4aa764e40bce', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
392
+ } }, h("button", { key: '04df5ccb789271d7ba2f693b740f316301f9fae0', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
393
393
  ? this.afCloseCalendarAriaLabel
394
- : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '31ceefc7f2be65159840b1ba6d998a71ba0c5543', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: 'f8105569c6065a353300f87d1eabd88a10227081', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: 'b7e3556711de8ddb43a17874dada58193341ffcc', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
394
+ : 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
395
395
  ? `${_t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
396
- : ''), h("digi-calendar", { key: '55286f75c9ff74bb5f11a5098d06aac6f5120017', 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) => {
396
+ : ''), 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) => {
397
397
  evt.stopImmediatePropagation();
398
398
  this.parseCalendar(evt);
399
399
  }, onKeyDown: (e) => {
@@ -404,7 +404,7 @@ export class CalendarDatepicker {
404
404
  return;
405
405
  e.preventDefault();
406
406
  this.focusOnCalendarInput();
407
- } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'f3d56c38d789cb0874ef1510e9ddd3e618255a76', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
407
+ } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'fc150d20f14731e8f67f38c6042e8af4e24eae38', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
408
408
  ? `${_t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
409
409
  : '')))));
410
410
  }
@@ -36,7 +36,13 @@ export class barChart {
36
36
  this.defaultDuration = 400;
37
37
  // Text and formats
38
38
  this.fontSize = '0.875rem';
39
- this.colorPalettes = ['--digi--color--background--brand-primary', '--digi--color--infographic--brand--primary', '--digi--color--background--sentiment--beta--primary', '--digi--color--text--interactive--visited', '--digi--color--icon--validation--error'];
39
+ this.colorPalettes = [
40
+ '--digi--color--background--brand-primary',
41
+ '--digi--color--infographic--brand--primary',
42
+ '--digi--color--background--sentiment--beta--primary',
43
+ '--digi--color--text--interactive--visited',
44
+ '--digi--color--icon--validation--error'
45
+ ];
40
46
  // Observer for watching size changes when in line chart mode
41
47
  this.barChartObserver = new ResizeObserver((entries) => {
42
48
  entries.forEach(() => {
@@ -46,7 +52,8 @@ export class barChart {
46
52
  });
47
53
  });
48
54
  this.highlightBars = (serie) => {
49
- this.barChartContainer.selectAll('.bar')
55
+ this.barChartContainer
56
+ .selectAll('.bar')
50
57
  .attr('fill', (barData) => this.colorFunction(barData.serie))
51
58
  .transition('color')
52
59
  .duration(150)
@@ -55,47 +62,78 @@ export class barChart {
55
62
  if (barData.serie === serie)
56
63
  return this.colorFunction(barData.serie);
57
64
  else {
58
- if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) && this.series.indexOf(barData.serie) > 0) {
65
+ if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
66
+ this.series.indexOf(barData.serie) > 0) {
59
67
  return 'url(#prognosisInactive)';
60
68
  }
61
69
  return this.evalColorVar('--digi--color--background--secondary-accent');
62
70
  }
63
71
  });
64
- d3.select(this.legendDiv).selectAll('.legendChip').transition('colorLegend').duration(150).style('opacity', (title) => title === serie ? 1 : 0.25);
72
+ d3.select(this.legendDiv)
73
+ .selectAll('.legendChip')
74
+ .transition('colorLegend')
75
+ .duration(150)
76
+ .style('opacity', (title) => (title === serie ? 1 : 0.25));
65
77
  };
66
78
  this.resetBarColor = () => {
67
- this.barChartContainer.selectAll('.bar').transition('color').duration(150).attr('fill', (barData) => this.colorFunction(barData.serie));
68
- d3.select(this.legendDiv).selectAll('.legendChip').transition('colorLegend').duration(150).style('opacity', 1);
79
+ this.barChartContainer
80
+ .selectAll('.bar')
81
+ .transition('color')
82
+ .duration(150)
83
+ .attr('fill', (barData) => this.colorFunction(barData.serie));
84
+ d3.select(this.legendDiv)
85
+ .selectAll('.legendChip')
86
+ .transition('colorLegend')
87
+ .duration(150)
88
+ .style('opacity', 1);
69
89
  if (this.chartData.data.averageLine) {
70
- this.barChartContainer.selectAll('.averageLine').transition('avgLine').style('mix-blend-mode', 'plus-lighter')
90
+ this.barChartContainer
91
+ .selectAll('.averageLine')
92
+ .transition('avgLine')
93
+ .style('mix-blend-mode', 'plus-lighter')
71
94
  .style('filter', 'contrast(0.5)');
72
95
  /* this.barChartContainer.selectAll('.averageLineText').transition('avgLine').style('mix-blend-mode', 'plus-lighter')
73
96
  .style('filter', 'contrast(0.5)'); */
74
97
  }
75
98
  };
76
99
  this.highlightAverageLine = (serie) => {
77
- this.barChartContainer.selectAll('.bar')
100
+ this.barChartContainer
101
+ .selectAll('.bar')
78
102
  .transition('color')
79
103
  .duration(150)
80
104
  .attr('fill', (barData) => {
81
105
  var _a;
82
- if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) && this.series.indexOf(barData.serie) > 0) {
106
+ if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
107
+ this.series.indexOf(barData.serie) > 0) {
83
108
  return 'url(#prognosisInactive)';
84
109
  }
85
110
  else
86
111
  return this.evalColorVar('--digi--color--background--secondary-accent');
87
112
  });
88
- this.barChartContainer.selectAll('.averageLine').transition('avgLine')
89
- .duration(150).style('mix-blend-mode', null).style('filter', null);
113
+ this.barChartContainer
114
+ .selectAll('.averageLine')
115
+ .transition('avgLine')
116
+ .duration(150)
117
+ .style('mix-blend-mode', null)
118
+ .style('filter', null);
90
119
  /* this.barChartContainer.selectAll('.averageLineText').transition('avgLineText')
91
120
  .duration(150).style('mix-blend-mode', null).style('filter', null) */
92
- d3.select(this.legendDiv).selectAll('.legendChip').transition('colorLegend').duration(150).style('opacity', (title) => title === serie ? 1 : 0.25);
121
+ d3.select(this.legendDiv)
122
+ .selectAll('.legendChip')
123
+ .transition('colorLegend')
124
+ .duration(150)
125
+ .style('opacity', (title) => (title === serie ? 1 : 0.25));
93
126
  };
94
127
  // Sets and resizespositions the average line
95
128
  this.averageLine = () => {
96
129
  if (!this.chartData.data.averageLine)
97
130
  return;
98
- const avLineGroup = this.barChartContainer.select('.interactiveElements').selectAll('.averageLineGroup').data([this.chartData.data.averageLine]).join('g').attr('class', 'averageLineGroup');
131
+ const avLineGroup = this.barChartContainer
132
+ .select('.interactiveElements')
133
+ .selectAll('.averageLineGroup')
134
+ .data([this.chartData.data.averageLine])
135
+ .join('g')
136
+ .attr('class', 'averageLineGroup');
99
137
  /* avLineGroup.selectAll('.averageLineText')
100
138
  .data(d => [d])
101
139
  .join('text')
@@ -108,8 +146,9 @@ export class barChart {
108
146
  .attr('fill', 'var(--digi--color--infographic--lineart)')
109
147
  .style('mix-blend-mode', 'plus-lighter')
110
148
  .style('filter', 'contrast(0.5)'); */
111
- avLineGroup.selectAll('.averageLine')
112
- .data(d => [d.value])
149
+ avLineGroup
150
+ .selectAll('.averageLine')
151
+ .data((d) => [d.value])
113
152
  .join('line')
114
153
  .attr('class', 'averageLine')
115
154
  .attr('x1', this.xScale.range()[0])
@@ -157,11 +196,15 @@ export class barChart {
157
196
  this.highlightBarGroup = (_event, datum) => {
158
197
  if (typeof datum === 'string') {
159
198
  const barGroupID = '#' + this.barGroupID(datum);
160
- this.barChartContainer.select(barGroupID).selectAll('.bar').transition('color')
199
+ this.barChartContainer
200
+ .select(barGroupID)
201
+ .selectAll('.bar')
202
+ .transition('color')
161
203
  .duration(20)
162
204
  .attr('fill', (d) => {
163
205
  var _a;
164
- if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) && this.series.indexOf(d.serie) > 0) {
206
+ if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
207
+ this.series.indexOf(d.serie) > 0) {
165
208
  return 'url(#prognosisHighlight)';
166
209
  }
167
210
  else
@@ -170,7 +213,9 @@ export class barChart {
170
213
  }
171
214
  };
172
215
  this.unHighlightBarGroup = () => {
173
- this.barSelection.selectAll('.bar').transition('color')
216
+ this.barSelection
217
+ .selectAll('.bar')
218
+ .transition('color')
174
219
  .duration(100)
175
220
  .attr('fill', (d) => {
176
221
  return this.colorFunction(d.serie);
@@ -267,13 +312,15 @@ export class barChart {
267
312
  return 'barGroup' + key.replace(/[^A-Z0-9]+/gi, '');
268
313
  };
269
314
  this.updateBars = () => {
270
- this.barSelection = this.barChartContainer.select('.interactiveElements')
315
+ this.barSelection = this.barChartContainer
316
+ .select('.interactiveElements')
271
317
  .selectAll('.barGroup')
272
318
  .data(this.mappedData)
273
319
  .join('g')
274
320
  .attr('class', 'barGroup')
275
321
  .attr('id', (d) => this.barGroupID(d.key));
276
- this.barSelection.selectAll('.bar')
322
+ this.barSelection
323
+ .selectAll('.bar')
277
324
  .data((d) => {
278
325
  return d.series;
279
326
  })
@@ -352,7 +399,9 @@ export class barChart {
352
399
  key: key,
353
400
  serie: serie.title,
354
401
  value: serie.yValues[index],
355
- len: serie.yValues[index] ? this.getTextSize(serie.yValues[index].toLocaleString()) : 0
402
+ len: serie.yValues[index]
403
+ ? this.getTextSize(serie.yValues[index].toLocaleString())
404
+ : 0
356
405
  });
357
406
  }
358
407
  });
@@ -368,7 +417,9 @@ export class barChart {
368
417
  key: key.toString(),
369
418
  serie: serie.title,
370
419
  value: serie.yValues[index],
371
- len: serie.yValues[index] ? this.getTextSize(serie.yValues[index].toLocaleString()) : 0
420
+ len: serie.yValues[index]
421
+ ? this.getTextSize(serie.yValues[index].toLocaleString())
422
+ : 0
372
423
  });
373
424
  }
374
425
  });
@@ -379,7 +430,8 @@ export class barChart {
379
430
  return toReturn;
380
431
  };
381
432
  this.adjustBarSize = () => {
382
- this.barSelection.selectAll('.bar')
433
+ this.barSelection
434
+ .selectAll('.bar')
383
435
  .attr('x', this.xFunction)
384
436
  .attr('y', this.yFunction)
385
437
  .attr('width', this.widthFunction)
@@ -394,30 +446,38 @@ export class barChart {
394
446
  // Handling x positioning of bars
395
447
  this.xFunction = (d, i) => {
396
448
  return this.afVariation === BarChartVariation.Horizontal
397
- ? (d.value > 0 ? this.xScale(0) : this.xScale(d.value))
398
- : this.xScale(d.key) + ((this.xScale.bandwidth() / this.dataWidth) * i + (this.barGap * i));
449
+ ? d.value > 0
450
+ ? this.xScale(0)
451
+ : this.xScale(d.value)
452
+ : this.xScale(d.key) +
453
+ ((this.xScale.bandwidth() / this.dataWidth) * i + this.barGap * i);
399
454
  };
400
455
  // Handling y positioning of bars
401
456
  this.yFunction = (d, i) => {
402
457
  if (!d.value)
403
458
  return 0;
404
459
  return this.afVariation === BarChartVariation.Horizontal
405
- ? this.yScale(d.key) + ((this.yScale.bandwidth() / this.dataWidth) * i + (this.barGap * i))
406
- : (d.value < 0 ? this.yScale(0) : this.yScale(d.value));
460
+ ? this.yScale(d.key) +
461
+ ((this.yScale.bandwidth() / this.dataWidth) * i + this.barGap * i)
462
+ : d.value < 0
463
+ ? this.yScale(0)
464
+ : this.yScale(d.value);
407
465
  };
408
466
  // Handling height for bars
409
467
  this.heightFunction = (d) => {
410
468
  if (!d.value)
411
469
  return 0;
412
470
  return this.afVariation === BarChartVariation.Horizontal
413
- ? this.yScale.bandwidth() / this.dataWidth - (this.barGap)
414
- : (d.value < 0 ? this.yScale(d.value) - this.yScale(0) : this.yScale(0) - this.yScale(d.value));
471
+ ? this.yScale.bandwidth() / this.dataWidth - this.barGap
472
+ : d.value < 0
473
+ ? this.yScale(d.value) - this.yScale(0)
474
+ : this.yScale(0) - this.yScale(d.value);
415
475
  };
416
476
  // Handling width for bars
417
477
  this.widthFunction = (d) => {
418
478
  return this.afVariation === BarChartVariation.Horizontal
419
479
  ? Math.abs(this.xScale(0) - this.xScale(d.value))
420
- : this.xScale.bandwidth() / this.dataWidth - (this.barGap);
480
+ : this.xScale.bandwidth() / this.dataWidth - this.barGap;
421
481
  };
422
482
  // Setting dimension variable
423
483
  this.setDims = (onlyHeight = false) => {
@@ -660,7 +720,8 @@ export class barChart {
660
720
  .attr('fill', (d) => {
661
721
  var _a;
662
722
  if (event.target.tagName === 'rect') {
663
- if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) && this.series.indexOf(d.serie) > 0) {
723
+ if (((_a = this.chartData.meta) === null || _a === void 0 ? void 0 : _a.prognosisPattern) &&
724
+ this.series.indexOf(d.serie) > 0) {
664
725
  return 'url(#prognosisHighlight)';
665
726
  }
666
727
  else
@@ -676,7 +737,9 @@ export class barChart {
676
737
  d3.select(event.target)
677
738
  .transition('color')
678
739
  .duration(this.defaultDuration)
679
- .attr('fill', (d) => event.target.tagName === 'rect' ? this.colorFunction(d.serie) : '#333333');
740
+ .attr('fill', (d) => event.target.tagName === 'rect'
741
+ ? this.colorFunction(d.serie)
742
+ : '#333333');
680
743
  };
681
744
  this.openTooltip = (...[, d]) => {
682
745
  // If type is string, the user has clicked on a y-axis tick
@@ -688,9 +751,7 @@ export class barChart {
688
751
  else
689
752
  this.tooltipData = d;
690
753
  const tooltipBody = this.tooltip.select('.tooltipBody');
691
- this.tooltip
692
- .select('.tooltipHeading')
693
- .html(this.tooltipData.key);
754
+ this.tooltip.select('.tooltipHeading').html(this.tooltipData.key);
694
755
  tooltipBody
695
756
  .selectAll('div')
696
757
  .data(this.tooltipData.series ? this.tooltipData.series : [this.tooltipData])
@@ -729,15 +790,25 @@ export class barChart {
729
790
  .style('transform', `translate(${diff > 0 ? width / 2 - 10 : this.xScale(data.value) / 2}px,0)`);
730
791
  }
731
792
  else {
732
- const index = (_a = this.mappedData.find(xPoint => xPoint.key === data.key)) === null || _a === void 0 ? void 0 : _a.series.findIndex(serie => serie.serie === data.serie);
733
- const barIndex = ((this.xScale.bandwidth() / this.dataWidth) * (index ? index + 1 : 1)) - (this.xScale.bandwidth() / this.dataWidth) / 2;
793
+ const index = (_a = this.mappedData
794
+ .find((xPoint) => xPoint.key === data.key)) === null || _a === void 0 ? void 0 : _a.series.findIndex((serie) => serie.serie === data.serie);
795
+ const barIndex = (this.xScale.bandwidth() / this.dataWidth) * (index ? index + 1 : 1) -
796
+ this.xScale.bandwidth() / this.dataWidth / 2;
734
797
  // This should be where the x-axis starts
735
798
  const xStart = this.margin.left + this.tickPadding + this.yTickSize;
736
799
  // Creating adjustment for tooltip to not appear outside of chart
737
800
  const spaceToSVGEdge = 5;
738
- const inlineAdjustment = (this.dims.width - spaceToSVGEdge) < (this.xScale(data.key) + xStart + barIndex + width / 2) ? (((this.xScale(data.key) + xStart + barIndex + width / 2) - (this.dims.width - spaceToSVGEdge)) / width) * 100 : 0;
739
- this.tooltip
740
- .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) )`);
801
+ const inlineAdjustment = this.dims.width - spaceToSVGEdge <
802
+ this.xScale(data.key) + xStart + barIndex + width / 2
803
+ ? ((this.xScale(data.key) +
804
+ xStart +
805
+ barIndex +
806
+ width / 2 -
807
+ (this.dims.width - spaceToSVGEdge)) /
808
+ width) *
809
+ 100
810
+ : 0;
811
+ 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) )`);
741
812
  this.tooltip
742
813
  .select('digi-icon-caret-down')
743
814
  .style('position', 'absolute')
@@ -747,8 +818,7 @@ export class barChart {
747
818
  }
748
819
  else {
749
820
  if (this.afVariation === BarChartVariation.Horizontal) {
750
- this.tooltip
751
- .style('transform', `translate(${this.tickPadding}px, ${this.yScale(data.key) + this.series.length * this.yScale.bandwidth() + 5}px )` // 5 is for half caret size
821
+ 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
752
822
  );
753
823
  this.tooltip
754
824
  .select('digi-icon-caret-up')
@@ -761,12 +831,17 @@ export class barChart {
761
831
  else {
762
832
  const xStart = this.margin.left + this.tickPadding + this.yTickSize;
763
833
  const translatePoint = this.xScale(data.key) + xStart + this.xScale.bandwidth() / 2;
764
- const yMax = d3.max(data.series.map(elem => elem.value));
834
+ const yMax = d3.max(data.series.map((elem) => elem.value));
765
835
  // Creating adjustment for tooltip to not appear outside of chart
766
836
  const spaceToSVGEdge = 5;
767
- const inlineAdjustment = (this.dims.width - spaceToSVGEdge) < (translatePoint + width / 2) ? (((translatePoint + width / 2) - (this.dims.width - spaceToSVGEdge)) / width) * 100 : 0;
768
- this.tooltip
769
- .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) )`);
837
+ const inlineAdjustment = this.dims.width - spaceToSVGEdge < translatePoint + width / 2
838
+ ? ((translatePoint +
839
+ width / 2 -
840
+ (this.dims.width - spaceToSVGEdge)) /
841
+ width) *
842
+ 100
843
+ : 0;
844
+ 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) )`);
770
845
  this.tooltip
771
846
  .select('digi-icon-caret-down')
772
847
  .style('position', 'absolute')
@@ -802,7 +877,10 @@ export class barChart {
802
877
  .attr('opacity', 0)
803
878
  .on('end', () => {
804
879
  this.svg.remove();
805
- d3.select(this.legendDiv).select('.legend').selectAll('.legendChip').remove();
880
+ d3.select(this.legendDiv)
881
+ .select('.legend')
882
+ .selectAll('.legendChip')
883
+ .remove();
806
884
  this.legendDiv.style['display'] = 'none';
807
885
  this.tableDiv.style['display'] = 'block';
808
886
  this.setTableContent();
@@ -856,12 +934,13 @@ export class barChart {
856
934
  this.afChartData = undefined;
857
935
  }
858
936
  afChartDataUpdate(data) {
859
- if (typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0 || typeof data !== 'string' && Object.keys(data).length > 0) {
937
+ if ((typeof data === 'string' && Object.keys(JSON.parse(data)).length > 0) ||
938
+ (typeof data !== 'string' && Object.keys(data).length > 0)) {
860
939
  if (typeof data != 'string')
861
940
  this.chartData = data;
862
941
  else
863
942
  this.chartData = JSON.parse(data);
864
- this.series = this.chartData.data.series.map(serie => serie.title);
943
+ this.series = this.chartData.data.series.map((serie) => serie.title);
865
944
  }
866
945
  this.mappedData = this.reshapeData();
867
946
  // checking for width of each tick
@@ -906,10 +985,12 @@ export class barChart {
906
985
  }
907
986
  initLegend() {
908
987
  const rectSize = 18;
909
- const legendData = this.chartData.data.series.map(serie => serie.title);
988
+ const legendData = this.chartData.data.series.map((serie) => serie.title);
910
989
  if (this.chartData.data.averageLine)
911
990
  legendData.push(this.chartData.data.averageLine.text);
912
- const legendChips = d3.select(this.legendDiv).select('.legend')
991
+ const legendChips = d3
992
+ .select(this.legendDiv)
993
+ .select('.legend')
913
994
  .style('margin-left', `${this.margin.left + this.tickPadding + this.yTickSize}px`)
914
995
  .style('margin-top', '0.5rem')
915
996
  .selectAll('.legendChip')
@@ -923,7 +1004,8 @@ export class barChart {
923
1004
  .style('cursor', 'default')
924
1005
  .on('mouseenter', (_event, serie) => this.highlightBars(serie))
925
1006
  .on('mouseleave', this.resetBarColor);
926
- legendChips.append('svg')
1007
+ legendChips
1008
+ .append('svg')
927
1009
  .attr('width', rectSize + 1)
928
1010
  .attr('height', rectSize + 1)
929
1011
  .append('rect')
@@ -934,15 +1016,19 @@ export class barChart {
934
1016
  .attr('rx', 4)
935
1017
  .attr('ry', 4)
936
1018
  .attr('fill', (title) => this.colorFunction(title));
937
- legendChips.append('span').style('text-wrap', 'nowrap').style('font-size', '0.875rem').text((d) => d);
1019
+ legendChips
1020
+ .append('span')
1021
+ .style('text-wrap', 'nowrap')
1022
+ .style('font-size', '0.875rem')
1023
+ .text((d) => d);
938
1024
  if (this.chartData.data.averageLine) {
939
- const averageLine = legendChips.filter(':last-child')
1025
+ const averageLine = legendChips
1026
+ .filter(':last-child')
940
1027
  .on('mouseenter', (_event, serie) => this.highlightAverageLine(serie));
941
- const miniSVG = averageLine
942
- .select('svg')
943
- .attr('width', rectSize * 2);
1028
+ const miniSVG = averageLine.select('svg').attr('width', rectSize * 2);
944
1029
  miniSVG.select('rect').remove();
945
- miniSVG.append('line')
1030
+ miniSVG
1031
+ .append('line')
946
1032
  .attr('x1', 1)
947
1033
  .attr('x2', rectSize * 2 - 1)
948
1034
  .attr('y1', rectSize / 2 + 1)
@@ -987,7 +1073,8 @@ export class barChart {
987
1073
  .attr('role', 'img')
988
1074
  .attr('aria-label', this.chartData && this.chartData.title
989
1075
  ? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
990
- : 'Stapeldiagram').attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
1076
+ : 'Stapeldiagram')
1077
+ .attr('style', 'display: flex;min-width: 0;width: 100%;height: auto;');
991
1078
  // Hide unusable components
992
1079
  d3.select(this.titleDiv)
993
1080
  .select(this.afHeadingLevel)
@@ -1049,7 +1136,8 @@ export class barChart {
1049
1136
  .join('g')
1050
1137
  .attr('class', 'barGroup')
1051
1138
  .attr('id', (d) => this.barGroupID(d.key));
1052
- this.barSelection.selectAll('bar')
1139
+ this.barSelection
1140
+ .selectAll('bar')
1053
1141
  .data((d) => {
1054
1142
  return d.series;
1055
1143
  })
@@ -1064,13 +1152,15 @@ export class barChart {
1064
1152
  .attr('width', this.widthFunction)
1065
1153
  .attr('height', () => 0)
1066
1154
  .attr('fill', 'gray');
1067
- this.barChartContainer.selectAll('.bar')
1155
+ this.barChartContainer
1156
+ .selectAll('.bar')
1068
1157
  .transition('animateBar')
1069
1158
  .duration(400)
1070
1159
  .delay((...[, i]) => i * 150)
1071
1160
  .attr('y', this.yFunction)
1072
1161
  .attr('height', this.heightFunction);
1073
- this.barChartContainer.selectAll('.bar')
1162
+ this.barChartContainer
1163
+ .selectAll('.bar')
1074
1164
  .transition('animateBar')
1075
1165
  .duration(400)
1076
1166
  .ease(d3.easeLinear)
@@ -1181,7 +1271,8 @@ export class barChart {
1181
1271
  .join('g')
1182
1272
  .attr('class', 'barGroup')
1183
1273
  .attr('id', (d) => this.barGroupID(d.key));
1184
- this.barSelection.selectAll('.barGroup')
1274
+ this.barSelection
1275
+ .selectAll('.barGroup')
1185
1276
  .data((d) => {
1186
1277
  return d.series;
1187
1278
  })
@@ -1208,7 +1299,9 @@ export class barChart {
1208
1299
  .append('text');
1209
1300
  this.textSelection
1210
1301
  .text((d) => {
1211
- return d.value ? d.value.toLocaleString(undefined, this.numberFormat) : undefined;
1302
+ return d.value
1303
+ ? d.value.toLocaleString(undefined, this.numberFormat)
1304
+ : undefined;
1212
1305
  })
1213
1306
  .attr('class', 'barText')
1214
1307
  .attr('font-size', this.fontSize)
@@ -1272,8 +1365,7 @@ export class barChart {
1272
1365
  this.setMinMax();
1273
1366
  const newHeight = this.setDims();
1274
1367
  this.transitionTitle();
1275
- this.svg
1276
- .attr('aria-label', this.chartData && this.chartData.title
1368
+ this.svg.attr('aria-label', this.chartData && this.chartData.title
1277
1369
  ? 'Stapeldiagram om ' + this.chartData.title.toLowerCase()
1278
1370
  : 'Stapeldiagram');
1279
1371
  this.setMargins();
@@ -1329,7 +1421,9 @@ export class barChart {
1329
1421
  d3.select(this.titleDiv).select('.loadingHeader').remove();
1330
1422
  this.loading = false;
1331
1423
  this.barChartContainer.selectAll('.bar').interrupt('animateBar');
1332
- this.barChartContainer.selectAll('.bar').transition()
1424
+ this.barChartContainer
1425
+ .selectAll('.bar')
1426
+ .transition()
1333
1427
  .duration(this.defaultDuration)
1334
1428
  .attr('y', (d) => this.afVariation === BarChartVariation.Horizontal
1335
1429
  ? this.yScale(d.key)
@@ -1417,7 +1511,11 @@ export class barChart {
1417
1511
  return width;
1418
1512
  }
1419
1513
  adjustColor(color, amount) {
1420
- return '#' + color.replace(/^#/, '').replace(/../g, color => ('0' + Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2));
1514
+ return ('#' +
1515
+ color
1516
+ .replace(/^#/, '')
1517
+ .replace(/../g, (color) => ('0' +
1518
+ Math.min(255, Math.max(0, parseInt(color, 16) + amount)).toString(16)).substr(-2)));
1421
1519
  }
1422
1520
  componentWillLoad() {
1423
1521
  this.afChartDataUpdate(this.afChartData);
@@ -1480,7 +1578,10 @@ export class barChart {
1480
1578
  }
1481
1579
  setTableDimensions() {
1482
1580
  const table = d3.select(this.tableDiv);
1483
- table.style('display', 'flex').style('height', '100%').style('width', '100%');
1581
+ table
1582
+ .style('display', 'flex')
1583
+ .style('height', '100%')
1584
+ .style('width', '100%');
1484
1585
  }
1485
1586
  // Extracting all headings from data and returning a string with <th>-elements with headings
1486
1587
  headings() {
@@ -1519,7 +1620,7 @@ export class barChart {
1519
1620
  if (this.chartData.infoText)
1520
1621
  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>`;
1521
1622
  }
1522
- return (h(Host, { key: 'd39019eecd4013769648a7cdb1e5dc48712de934', ref: (el) => (this.host = el) }, h("svg", { key: '9e4dbfcd19038c6b9c8cfe26b4e8b3c5ef624896', xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0" }, h("defs", { key: '9ed2bc8b3064642d01e9028fa91c55577ed2da1c' }, h("pattern", { key: 'ca867a03dac364d29de422bc074c7ff3a8bac858', id: "prognosis", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: '2f2169ba84fcbb198a8f109bc57971beb3c3ca09', width: "8", height: "8", fill: 'white' }), h("line", { key: 'ad51412cb272233eb58a82a293643c4e865e34e9', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar(this.colorPalettes[0]), "stroke-width": "8" })), h("pattern", { key: 'ecc0ffeb0eda0d84102678c17163d0afc472cde5', id: "prognosisInactive", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: 'ca9a51785850ea8e26f4ca3b84dc28401325af63', width: "8", height: "8", fill: 'white' }), h("line", { key: 'd7dd225c20b588f74bff91d44ff5abc8839bc445', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.evalColorVar('--digi--color--background--secondary-accent'), "stroke-width": "8" })), h("pattern", { key: '654a002d89f6ce33fc4958afe3997829511b867e', id: "prognosisHighlight", patternUnits: "userSpaceOnUse", width: "8", height: "8", patternTransform: "rotate(45)" }, h("rect", { key: '6d0286f1d11de92c88083618d4acb3300f36857d', width: "8", height: "8", fill: 'white' }), h("line", { key: '4acd94253dbdb1fc85090d677d246028a6e595d6', x1: "0", y: "0", x2: "0", y2: "12", stroke: this.adjustColor(this.colorFunction(0), 50), "stroke-width": "8" })))), h("div", { key: '9022c75fa8077b2c025aac91b8c1a565b50ad8f0', class: "topWrapper", ref: (el) => (this.titleDiv = el) }, h("digi-typography", { key: '4a28b8506806ca2418fd21512460baebe84614d5', class: "chartTitle", innerHTML: heading }), h("digi-button", { key: '69f4603b0fde842906e17abee241c6e3b4de1059', 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: '803f63ac1912c5979c43e7c58d28591a1d6ce461', slot: "icon" }), "Visa tabell"), h("digi-button", { key: '7d87badd6ae3df65127bdfe4c4308c0d38d5ccb7', 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: 'f92c2eb9f08bf7f13a7eaea287b80a233efd95ef', slot: "icon" }), "Visa diagram"), h("div", { key: 'ee5b3ad8cdcfcf00891f56f7a7e738adf76f36c1', class: "scChartStatus", role: "status", ref: (el) => (this.status = el) })), h("div", { key: 'cbc0c8724ac73a07a4f2d01044d4928214e63f43', class: "svgWrap", ref: (el) => (this.chartDiv = el) }, h("div", { key: '52cb24ae1a29f5381860031513b7b9e835044935', class: "chartTooltip", id: this.afId }, h("div", { key: '17c4c08dcf63cd263db4f32fecae7ec5216e3014', class: "tooltipHead" }, h("digi-icon-x", { key: 'f44a9a534ae02fe674fc0f9161e5c4b5a3eecb30', class: "tooltipClose" })), h("div", { key: 'ffbe44f6a8db4dc67d6980bd69ca2209e4a75745', class: "tooltipBody" }), this.afVariation === BarChartVariation.Horizontal ? (h("digi-icon-caret-up", { class: "caret" })) : (h("digi-icon-caret-down", { class: "caret" })))), h("div", { key: '5d9cce591ea02a7b8ebdb42af55f378ee064a48a', class: "legendWrap", ref: (el) => (this.legendDiv = el) }, h("div", { key: '8b8b7cd614e5d6202bfce04e57c98ee040f15dab', class: "legend" })), h("div", { key: '64a35d431e28638ffece4dd12bdf04678ed13768', class: "table", ref: (el) => (this.tableDiv = el) }, ' ')));
1623
+ 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) }, ' ')));
1523
1624
  }
1524
1625
  static get is() { return "digi-bar-chart"; }
1525
1626
  static get encapsulation() { return "scoped"; }