@itcenteratunihelsinki/huds-lib 0.8.68 → 0.8.70

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 (76) hide show
  1. package/components/hy-dropdown.js +147 -46
  2. package/components/hy-dropdown.js.map +1 -1
  3. package/components/hy-footer-base.js +10 -4
  4. package/components/hy-footer-base.js.map +1 -1
  5. package/components/hy-footer-link-item2.js +1 -1
  6. package/components/hy-footer-link-item2.js.map +1 -1
  7. package/components/hy-hero-carousel.js +1 -1
  8. package/components/hy-hero-carousel.js.map +1 -1
  9. package/components/hy-video.js +1 -1
  10. package/components/hy-video.js.map +1 -1
  11. package/dist/cjs/huds-lib.cjs.js +1 -1
  12. package/dist/cjs/hy-breadcrumbs_15.cjs.entry.js +10 -5
  13. package/dist/cjs/hy-breadcrumbs_15.cjs.entry.js.map +1 -1
  14. package/dist/cjs/hy-dropdown.cjs.entry.js +226 -0
  15. package/dist/cjs/hy-dropdown.cjs.entry.js.map +1 -0
  16. package/dist/cjs/hy-hero-carousel.cjs.entry.js +1 -1
  17. package/dist/cjs/hy-hero-carousel.cjs.entry.js.map +1 -1
  18. package/dist/cjs/hy-video.cjs.entry.js +1 -1
  19. package/dist/cjs/hy-video.cjs.entry.js.map +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +5 -9
  22. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.css +152 -66
  23. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.js +30 -3
  24. package/dist/collection/components/footer/hy-footer-base/hy-footer-base.js.map +1 -1
  25. package/dist/collection/components/footer/hy-footer-link-item/hy-footer-link-item.css +27 -9
  26. package/dist/collection/components/hy-dropdown/hy-dropdown.css +48 -33
  27. package/dist/collection/components/hy-dropdown/hy-dropdown.js +232 -35
  28. package/dist/collection/components/hy-dropdown/hy-dropdown.js.map +1 -1
  29. package/dist/collection/components/hy-hero-carousel/hy-hero-carousel.css +13 -3
  30. package/dist/collection/components/hy-video/hy-video.css +1 -14
  31. package/dist/esm/huds-lib.js +1 -1
  32. package/dist/esm/hy-breadcrumbs_15.entry.js +10 -5
  33. package/dist/esm/hy-breadcrumbs_15.entry.js.map +1 -1
  34. package/dist/esm/hy-dropdown.entry.js +222 -0
  35. package/dist/esm/hy-dropdown.entry.js.map +1 -0
  36. package/dist/esm/hy-hero-carousel.entry.js +1 -1
  37. package/dist/esm/hy-hero-carousel.entry.js.map +1 -1
  38. package/dist/esm/hy-video.entry.js +1 -1
  39. package/dist/esm/hy-video.entry.js.map +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/huds-lib/huds-lib.esm.js +1 -1
  42. package/dist/huds-lib/huds-lib.esm.js.map +1 -1
  43. package/dist/huds-lib/hy-breadcrumbs_15.entry.js +1 -1
  44. package/dist/huds-lib/hy-breadcrumbs_15.entry.js.map +1 -1
  45. package/dist/huds-lib/hy-dropdown.entry.js +2 -0
  46. package/dist/huds-lib/hy-dropdown.entry.js.map +1 -0
  47. package/dist/huds-lib/hy-hero-carousel.entry.js +1 -1
  48. package/dist/huds-lib/hy-hero-carousel.entry.js.map +1 -1
  49. package/dist/huds-lib/hy-video.entry.js +1 -1
  50. package/dist/huds-lib/hy-video.entry.js.map +1 -1
  51. package/dist/types/components/footer/hy-footer-base/hy-footer-base.d.ts +10 -0
  52. package/dist/types/components/hy-dropdown/hy-dropdown.d.ts +17 -3
  53. package/dist/types/components.d.ts +20 -38
  54. package/package.json +2 -2
  55. package/components/hy-dropdown-panel-item.d.ts +0 -11
  56. package/components/hy-dropdown-panel-item.js +0 -8
  57. package/components/hy-dropdown-panel-item.js.map +0 -1
  58. package/components/hy-dropdown-panel.d.ts +0 -11
  59. package/components/hy-dropdown-panel.js +0 -8
  60. package/components/hy-dropdown-panel.js.map +0 -1
  61. package/components/hy-dropdown.panel.item.js +0 -43
  62. package/components/hy-dropdown.panel.item.js.map +0 -1
  63. package/components/hy-dropdown.panel.js +0 -31
  64. package/components/hy-dropdown.panel.js.map +0 -1
  65. package/dist/cjs/hy-dropdown_3.cjs.entry.js +0 -141
  66. package/dist/cjs/hy-dropdown_3.cjs.entry.js.map +0 -1
  67. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.item.js +0 -87
  68. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.item.js.map +0 -1
  69. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.js +0 -32
  70. package/dist/collection/components/hy-dropdown/hy-dropdown.panel.js.map +0 -1
  71. package/dist/esm/hy-dropdown_3.entry.js +0 -135
  72. package/dist/esm/hy-dropdown_3.entry.js.map +0 -1
  73. package/dist/huds-lib/hy-dropdown_3.entry.js +0 -2
  74. package/dist/huds-lib/hy-dropdown_3.entry.js.map +0 -1
  75. package/dist/types/components/hy-dropdown/hy-dropdown.panel.d.ts +0 -4
  76. package/dist/types/components/hy-dropdown/hy-dropdown.panel.item.d.ts +0 -7
@@ -7,10 +7,13 @@ export class HyDropdown {
7
7
  this.dropdownId = "dropdownToggle";
8
8
  this.dropdownOptions = undefined;
9
9
  this.defaultLabel = "All";
10
+ this.type = null;
10
11
  this.defaultOption = null;
11
12
  this.isPanelOpen = false;
12
13
  this.isChecked = false;
13
14
  this.currentSingle = [{ id: 0, label: this.defaultLabel, value: 0 }];
15
+ this.currentMulti = undefined;
16
+ this.focusedOptionIndex = 0;
14
17
  }
15
18
  async componentWillLoad() {
16
19
  this._dropdownOptions = await jsonParserWorker(this.dropdownOptions);
@@ -41,59 +44,164 @@ export class HyDropdown {
41
44
  });
42
45
  }
43
46
  }
44
- handlePanelToggle() {
45
- this.isPanelOpen = !this.isPanelOpen;
46
- }
47
- handleClick(event) {
48
- const dropdownToggleButtonElement = this.el.querySelector(`#${this.dropdownId}`);
49
- const dropdownPanelElement = this.el.querySelector(".hy-dropdown__panel");
50
- const dropdownPanelCheckboxElements = this.el.querySelectorAll(".hy-dropdown__checkbox");
51
- const dropdownToggleButtonIconElement = this.el.querySelector(".hy-dropdown__icon");
52
- const { target } = event;
53
- const allowedElements = [
54
- dropdownToggleButtonElement,
55
- dropdownPanelElement,
56
- dropdownToggleButtonIconElement,
57
- ...dropdownPanelCheckboxElements, // Spread ("copy") items to allowedElement array.
58
- ];
59
- if (this.isPanelOpen && !allowedElements.includes(target)) {
47
+ panelListener(e) {
48
+ if (this.isPanelOpen && e.detail.dropdownId !== this.dropdownId) {
60
49
  this.isPanelOpen = false;
61
50
  }
51
+ }
52
+ handleMultiClick(event, option) {
62
53
  event.stopPropagation();
54
+ const dropdownPanelCheckboxElements = this.el.getElementsByClassName("hy-dropdown__checkbox");
55
+ Array.from(dropdownPanelCheckboxElements).filter((i) => {
56
+ const item = i.closest("li");
57
+ if (item.dataset.id == option.id && !item.hasAttribute("aria-selected")) {
58
+ item.setAttribute("aria-selected", "true");
59
+ this.currentMulti =
60
+ this.currentMulti && this.currentMulti.length > 0 ? [...this.currentMulti, option] : [option];
61
+ return;
62
+ }
63
+ if (item.dataset.id === option.id && item.hasAttribute("aria-selected")) {
64
+ item.removeAttribute("aria-selected");
65
+ if (this.currentMulti.length > 0) {
66
+ const index = this.currentMulti.indexOf(option);
67
+ this.currentMulti = this.currentMulti.splice(index, 1);
68
+ }
69
+ return;
70
+ }
71
+ return null;
72
+ });
63
73
  }
64
- handleSingleClick(event) {
74
+ handleSingleClick(event, option) {
65
75
  if (!this.single || !this.isPanelOpen)
66
76
  return;
67
77
  const dropdownPanelCheckboxElements = this.el.getElementsByClassName("hy-dropdown__checkbox");
68
- const allowedElements = [...dropdownPanelCheckboxElements];
69
- const { target } = event;
70
- if (!allowedElements.includes(target))
71
- return;
72
- Array.from(dropdownPanelCheckboxElements).filter((item) => {
73
- if (item.id == target.id) {
74
- if (!item.checked) {
78
+ event.stopPropagation();
79
+ Array.from(dropdownPanelCheckboxElements).filter((i) => {
80
+ const item = i.closest("li");
81
+ if (item.dataset.id == option.id) {
82
+ if (item.hasAttribute("aria-selected")) {
83
+ item.removeAttribute("aria-selected");
75
84
  this.currentSingle = [{ id: null, label: this.defaultLabel, value: null }];
76
85
  return;
77
86
  }
78
- this.currentSingle = this._dropdownOptions.filter((option) => option.id == target.id);
87
+ item.setAttribute("aria-selected", "true");
88
+ this.currentSingle = this._dropdownOptions.filter((o) => o.id == option.id);
79
89
  return;
80
90
  }
81
- if (item.id !== target.id && item.checked) {
82
- item.checked = false;
91
+ if (item.dataset.id !== option.id && item.hasAttribute("aria-selected")) {
92
+ item.removeAttribute("aria-selected");
83
93
  return;
84
94
  }
85
95
  return null;
86
96
  });
97
+ }
98
+ handleKeyDown(event) {
87
99
  event.stopPropagation();
100
+ switch (event.key) {
101
+ case "ArrowDown":
102
+ event.preventDefault();
103
+ if (!this.isPanelOpen) {
104
+ this.handlePanelToggle(event);
105
+ return;
106
+ }
107
+ this.focusedOptionIndex = (this.focusedOptionIndex + 1) % this._dropdownOptions.length;
108
+ break;
109
+ case "ArrowUp":
110
+ this.focusedOptionIndex =
111
+ (this.focusedOptionIndex - 1 + this._dropdownOptions.length) % this._dropdownOptions.length;
112
+ event.preventDefault();
113
+ break;
114
+ case "Enter":
115
+ case " ":
116
+ if (!this.isPanelOpen) {
117
+ event.preventDefault();
118
+ this.handlePanelToggle(event);
119
+ return;
120
+ }
121
+ if (this.single) {
122
+ this.handleOptionSingleClick(event, this._dropdownOptions[this.focusedOptionIndex]);
123
+ }
124
+ else {
125
+ this.handleMultiOptionClick(event, this._dropdownOptions[this.focusedOptionIndex]);
126
+ }
127
+ const emitDetails = {
128
+ id: this.dropdownId,
129
+ type: this.type,
130
+ data: this._dropdownOptions[this.focusedOptionIndex],
131
+ };
132
+ this.dropdownKeyPress.emit(emitDetails);
133
+ event.preventDefault();
134
+ break;
135
+ case "Escape":
136
+ case "Tab":
137
+ this.isPanelOpen = false;
138
+ break;
139
+ default:
140
+ break;
141
+ }
142
+ }
143
+ handlePanelToggle(e) {
144
+ e.stopPropagation();
145
+ this.isPanelOpen = !this.isPanelOpen;
146
+ const emitDetails = {
147
+ dropdownId: this.dropdownId,
148
+ panelOpen: this.isPanelOpen,
149
+ };
150
+ this.dropdownPanelToggled.emit(emitDetails);
151
+ }
152
+ handlePanelClickOutside(e) {
153
+ e.stopPropagation();
154
+ const dropdownToggleButtonElement = this.el.querySelector(`#${this.dropdownId}`);
155
+ const dropdownPanelElement = this.el.querySelector(".hy-dropdown__panel");
156
+ const dropdownPanelCheckboxElements = this.el.querySelectorAll(".hy-dropdown__panel-item");
157
+ const dropdownPanelCheckboxes = this.el.querySelectorAll(".hy-dropdown__checkbox");
158
+ const dropdownToggleButtonIconElement = this.el.querySelectorAll(".hy-dropdown__icon");
159
+ const { target } = e;
160
+ const allowedElements = [
161
+ this.el,
162
+ dropdownToggleButtonElement,
163
+ dropdownPanelElement,
164
+ ...dropdownPanelCheckboxes,
165
+ dropdownToggleButtonIconElement,
166
+ ...dropdownPanelCheckboxElements, // Spread ("copy") items to allowedElement array.
167
+ ];
168
+ if (this.isPanelOpen && !allowedElements.includes(target)) {
169
+ this.isPanelOpen = false;
170
+ }
171
+ }
172
+ handleOptionSingleClick(event, option) {
173
+ event.stopPropagation();
174
+ this.handleSingleClick(event, option);
175
+ const emitDetails = {
176
+ id: this.dropdownId,
177
+ type: this.type,
178
+ data: option,
179
+ };
180
+ this.dropdropValueChange.emit(emitDetails);
181
+ }
182
+ handleMultiOptionClick(event, option) {
183
+ event.stopPropagation();
184
+ this.handleMultiClick(event, option);
185
+ const emitDetails = {
186
+ id: this.dropdownId,
187
+ type: this.type,
188
+ data: this.currentMulti,
189
+ };
190
+ this.dropdropMultiValueChange.emit(emitDetails);
191
+ }
192
+ handleOptionHover(index) {
193
+ this.focusedOptionIndex = index;
88
194
  }
89
195
  render() {
90
196
  const { label: currentLabel, id: currentId, value: currentValue } = this.currentSingle[0];
91
197
  const classAttributes = ["hy-dropdown", this.single ? "hy-dropdown--single" : ""].join(" ");
92
198
  if (this.single) {
93
- return (h(Host, { class: classAttributes }, this.dropdownLabel && (h("label", { class: "hy-dropdown__button-label", htmlFor: this.dropdownId }, this.dropdownLabel)), h("button", { id: this.dropdownId, class: `hy-dropdown__toggle ${this.isPanelOpen ? "is-open" : ""}`, "aria-expanded": `${this.isPanelOpen || false}`, "aria-controls": "dropdownPanel", onClick: () => this.handlePanelToggle(), "aria-label": this.dropdownLabel, "data-current-id": currentId, "data-current-value": currentValue, value: currentId, type: "button" }, currentLabel, h("hy-icon", { class: "hy-dropdown__icon", icon: "hy-icon-caret-down", size: 14, "aria-hidden": "true" })), h("hy-dropdown-panel", { "checkbox-checked": this.isChecked ? "true" : "false", "is-hidden": !this.isPanelOpen }, this._dropdownOptions.map(({ id, label, value }, index) => (h("hy-dropdown-panel-item", { "dropdown-item-id": id, "dropdown-item-label": label, "dropdown-item-value": value, "is-last": this._dropdownOptions.length - 1 === index }))))));
199
+ return (h(Host, { class: classAttributes }, this.dropdownLabel && (h("label", { class: "hy-dropdown__button-label", htmlFor: this.dropdownId }, this.dropdownLabel)), h("div", { id: this.dropdownId, class: `hy-dropdown__toggle ${this.isPanelOpen ? "is-open" : ""}`, "aria-expanded": `${this.isPanelOpen || false}`, "aria-controls": "dropdownPanel", "aria-haspopup": "listbox", role: "combobox", onClick: (event) => this.handlePanelToggle(event), onKeyDown: (event) => this.handleKeyDown(event), "aria-label": this.dropdownLabel, "data-current-id": currentId, "data-current-value": currentValue, "data-value": currentId, tabIndex: 0 }, h("input", { "aria-hidden": "true", class: "hy-dropdown__hidden-input", type: "hidden", value: currentId }), currentLabel, h("hy-icon", { class: "hy-dropdown__icon", icon: "hy-icon-caret-down", size: 14, "aria-hidden": "true" })), h("ul", { "checkbox-checked": this.isChecked ? "true" : "false", id: "dropdownPanel", class: `hy-dropdown__panel ${!this.isPanelOpen ? "is-hidden" : ""}`, "aria-expanded": `${!this.isPanelOpen || false}`, role: "listbox", "aria-labelledby": "dropdownToggle" }, this._dropdownOptions.map(({ id, label, value }, index, items) => (h("li", { key: id, "data-id": `${id}`, role: "option", class: `hy-dropdown__panel-item ${this._dropdownOptions.length - 1 === index ? "is-last" : ""}
200
+ ${this.focusedOptionIndex === index ? "hy-dropdown__panel-item--focused" : ""}`, onClick: (event) => this.handleOptionSingleClick(event, items[index]), onMouseEnter: () => this.handleOptionHover(index) }, h("span", { "data-id": `${id}`, class: "hy-dropdown__checkbox", "data-value": `${value}` }, label, h("hy-icon", { class: "hy-dropdown__label-icon", icon: "hy-icon-done", size: 14, "aria-hidden": "true" }))))))));
94
201
  }
95
202
  else {
96
- return (h(Host, { class: classAttributes }, h("button", { id: this.dropdownId, class: `hy-dropdown__toggle ${this.isPanelOpen ? "is-open" : ""}`, "aria-expanded": `${this.isPanelOpen || false}`, "aria-controls": "dropdownPanel", onClick: () => this.handlePanelToggle(), "aria-label": this.dropdownLabel, type: "button" }, this.dropdownLabel && this.dropdownLabel, h("hy-icon", { class: "hy-dropdown__icon", icon: "hy-icon-caret-down", size: 14, "aria-hidden": "true" })), h("hy-dropdown-panel", { "checkbox-checked": this.isChecked ? "true" : "false", "is-hidden": !this.isPanelOpen }, this._dropdownOptions.map(({ id, label, value }, index) => (h("hy-dropdown-panel-item", { "dropdown-item-id": id, "dropdown-item-label": label, "dropdown-item-value": value, "is-last": this._dropdownOptions.length - 1 === index }))))));
203
+ return (h(Host, { class: classAttributes }, h("button", { id: this.dropdownId, class: `hy-dropdown__toggle ${this.isPanelOpen ? "is-open" : ""}`, "aria-expanded": `${this.isPanelOpen || false}`, "aria-controls": "dropdownPanel", "aria-haspopup": "listbox", role: "combobox", onClick: (event) => this.handlePanelToggle(event), "aria-label": this.dropdownLabel, type: "button" }, this.dropdownLabel && this.dropdownLabel, h("hy-icon", { class: "hy-dropdown__icon", icon: "hy-icon-caret-down", size: 14, "aria-hidden": "true" })), h("ul", { "checkbox-checked": this.isChecked ? "true" : "false", id: "dropdownPanel", class: `hy-dropdown__panel ${!this.isPanelOpen ? "is-hidden" : ""}`, "aria-expanded": `${!this.isPanelOpen || false}`, role: "listbox", "aria-labelledby": "dropdownToggle" }, this._dropdownOptions.map(({ id, label, value }, index, items) => (h("li", { key: id, "data-id": `${id}`, role: "option", class: `hy-dropdown__panel-item ${this._dropdownOptions.length - 1 === index ? "is-last" : ""}
204
+ ${this.focusedOptionIndex === index ? "hy-dropdown__panel-item--focused" : ""}`, onClick: (event) => this.handleMultiOptionClick(event, items[index]), onMouseEnter: () => this.handleOptionHover(index) }, h("span", { "data-id": `${id}`, class: "hy-dropdown__checkbox", "data-value": `${value}` }, label, h("hy-icon", { class: "hy-dropdown__label-icon", icon: "hy-icon-done", size: 14, "aria-hidden": "true" }))))))));
97
205
  }
98
206
  }
99
207
  static get is() { return "hy-dropdown"; }
@@ -203,6 +311,24 @@ export class HyDropdown {
203
311
  "reflect": false,
204
312
  "defaultValue": "\"All\""
205
313
  },
314
+ "type": {
315
+ "type": "string",
316
+ "mutable": false,
317
+ "complexType": {
318
+ "original": "string",
319
+ "resolved": "string",
320
+ "references": {}
321
+ },
322
+ "required": false,
323
+ "optional": false,
324
+ "docs": {
325
+ "tags": [],
326
+ "text": ""
327
+ },
328
+ "attribute": "type",
329
+ "reflect": false,
330
+ "defaultValue": "null"
331
+ },
206
332
  "defaultOption": {
207
333
  "type": "any",
208
334
  "mutable": true,
@@ -227,9 +353,74 @@ export class HyDropdown {
227
353
  return {
228
354
  "isPanelOpen": {},
229
355
  "isChecked": {},
230
- "currentSingle": {}
356
+ "currentSingle": {},
357
+ "currentMulti": {},
358
+ "focusedOptionIndex": {}
231
359
  };
232
360
  }
361
+ static get events() {
362
+ return [{
363
+ "method": "dropdownPanelToggled",
364
+ "name": "dropdownPanelToggled",
365
+ "bubbles": true,
366
+ "cancelable": true,
367
+ "composed": true,
368
+ "docs": {
369
+ "tags": [],
370
+ "text": ""
371
+ },
372
+ "complexType": {
373
+ "original": "any",
374
+ "resolved": "any",
375
+ "references": {}
376
+ }
377
+ }, {
378
+ "method": "dropdropValueChange",
379
+ "name": "dropdownValueChanged",
380
+ "bubbles": true,
381
+ "cancelable": true,
382
+ "composed": true,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": ""
386
+ },
387
+ "complexType": {
388
+ "original": "any",
389
+ "resolved": "any",
390
+ "references": {}
391
+ }
392
+ }, {
393
+ "method": "dropdropMultiValueChange",
394
+ "name": "dropdownMultiValueChanged",
395
+ "bubbles": true,
396
+ "cancelable": true,
397
+ "composed": true,
398
+ "docs": {
399
+ "tags": [],
400
+ "text": ""
401
+ },
402
+ "complexType": {
403
+ "original": "any",
404
+ "resolved": "any",
405
+ "references": {}
406
+ }
407
+ }, {
408
+ "method": "dropdownKeyPress",
409
+ "name": "dropdownKeyPress",
410
+ "bubbles": true,
411
+ "cancelable": true,
412
+ "composed": true,
413
+ "docs": {
414
+ "tags": [],
415
+ "text": ""
416
+ },
417
+ "complexType": {
418
+ "original": "any",
419
+ "resolved": "any",
420
+ "references": {}
421
+ }
422
+ }];
423
+ }
233
424
  static get elementRef() { return "el"; }
234
425
  static get watchers() {
235
426
  return [{
@@ -239,16 +430,22 @@ export class HyDropdown {
239
430
  }
240
431
  static get listeners() {
241
432
  return [{
242
- "name": "click",
243
- "method": "handleClick",
433
+ "name": "dropdownPanelToggled",
434
+ "method": "panelListener",
244
435
  "target": "window",
245
436
  "capture": false,
246
437
  "passive": false
247
438
  }, {
248
- "name": "click",
249
- "method": "handleSingleClick",
439
+ "name": "keydown",
440
+ "method": "handleKeyDown",
250
441
  "target": undefined,
251
- "capture": true,
442
+ "capture": false,
443
+ "passive": false
444
+ }, {
445
+ "name": "click",
446
+ "method": "handlePanelClickOutside",
447
+ "target": "window",
448
+ "capture": false,
252
449
  "passive": false
253
450
  }];
254
451
  }
@@ -1 +1 @@
1
- {"version":3,"file":"hy-dropdown.js","sourceRoot":"","sources":["../../../src/components/hy-dropdown/hy-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,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ClD,GAAG,IAAI,CAAC,WAAW,IAAI,KAAK,EAAE,mBAC/B,eAAe,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,gBAC3B,IAAI,CAAC,aAAa,EAC9B,IAAI,EAAC,QAAQ;UAEZ,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa;UACzC,eAAS,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,CACvF;QACT,6CAAqC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,eAAa,CAAC,IAAI,CAAC,WAAW,IACjG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CACxD,kDACoB,EAAE,yBACC,KAAK,yBACL,KAAK,aACjB,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK,GACnD,CACH,CAAC,CACgB,CACf,CACR,CAAC;KACH;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Host, h, State, Listen, Prop, Watch} from \"@stencil/core\";\nimport {jsonParserWorker} from \"../../global/globalScript\";\n\nexport interface IDropdownItem {\n id: string | number;\n label: string;\n value: string | number;\n}\n\nexport interface DefaultValue {\n id: string | number;\n label: string;\n value: string | number;\n}\n\n@Component({\n tag: \"hy-dropdown\",\n styleUrl: \"hy-dropdown.scss\",\n shadow: false,\n})\nexport class HyDropdown {\n private _dropdownOptions: IDropdownItem[];\n @Element() el: HTMLElement;\n @Prop() single: boolean = false;\n @Prop() dropdownLabel: string = null;\n @Prop() dropdownId: string = \"dropdownToggle\";\n @Prop() dropdownOptions: IDropdownItem[] | string;\n @Prop() defaultLabel: string = \"All\";\n @Prop({mutable: true}) defaultOption: string | number = null;\n @State() isPanelOpen: boolean = false;\n @State() isChecked: boolean = false;\n @State() currentSingle: DefaultValue[] = [{id: 0, label: this.defaultLabel, value: 0}];\n\n async componentWillLoad() {\n this._dropdownOptions = await jsonParserWorker(this.dropdownOptions);\n }\n\n componentWillUpdate() {\n const items = this.el.querySelectorAll(\".hy-dropdown__checkbox\") as any;\n if (items) {\n if ([...items].some((item) => item.checked == true)) {\n this.isChecked = true;\n } else {\n this.isChecked = false;\n }\n }\n }\n\n @Watch(\"defaultOption\")\n watchPropHandler(newValue: string | number, oldValue: string | number) {\n if (!this.single) return;\n\n if (newValue !== oldValue) {\n const dropdownPanelCheckboxElements = this.el.getElementsByClassName(\"hy-dropdown__checkbox\") as HTMLCollectionOf<\n HTMLInputElement\n >;\n\n Array.from(dropdownPanelCheckboxElements).filter((item) => {\n if (item.id == newValue) {\n item.checked = true;\n this.currentSingle = this._dropdownOptions.filter((option) => option.id == newValue) as any;\n return;\n }\n return null;\n });\n }\n }\n\n handlePanelToggle() {\n this.isPanelOpen = !this.isPanelOpen;\n }\n\n @Listen(\"click\", {target: \"window\"})\n handleClick(event) {\n const dropdownToggleButtonElement = this.el.querySelector(`#${this.dropdownId}`) as HTMLButtonElement;\n const dropdownPanelElement = this.el.querySelector(\".hy-dropdown__panel\") as HTMLElement;\n const dropdownPanelCheckboxElements = this.el.querySelectorAll(\".hy-dropdown__checkbox\");\n const dropdownToggleButtonIconElement = this.el.querySelector(\".hy-dropdown__icon\") as HTMLElement;\n\n const {target} = event;\n\n const allowedElements = [\n dropdownToggleButtonElement,\n dropdownPanelElement,\n dropdownToggleButtonIconElement,\n ...dropdownPanelCheckboxElements, // Spread (\"copy\") items to allowedElement array.\n ];\n\n if (this.isPanelOpen && !allowedElements.includes(target)) {\n this.isPanelOpen = false;\n }\n event.stopPropagation();\n }\n\n @Listen(\"click\", {capture: true})\n handleSingleClick(event) {\n if (!this.single || !this.isPanelOpen) return;\n const dropdownPanelCheckboxElements = this.el.getElementsByClassName(\"hy-dropdown__checkbox\") as HTMLCollectionOf<\n HTMLInputElement\n >;\n const allowedElements = [...dropdownPanelCheckboxElements];\n const {target} = event;\n if (!allowedElements.includes(target)) return;\n Array.from(dropdownPanelCheckboxElements).filter((item) => {\n if (item.id == target.id) {\n if (!item.checked) {\n this.currentSingle = [{id: null, label: this.defaultLabel, value: null}];\n return;\n }\n this.currentSingle = this._dropdownOptions.filter((option) => option.id == target.id) as any;\n return;\n }\n if (item.id !== target.id && item.checked) {\n item.checked = false;\n return;\n }\n return null;\n });\n\n event.stopPropagation();\n }\n\n render() {\n const {label: currentLabel, id: currentId, value: currentValue} = this.currentSingle[0];\n const classAttributes = [\"hy-dropdown\", this.single ? \"hy-dropdown--single\" : \"\"].join(\" \");\n\n if (this.single) {\n return (\n <Host class={classAttributes}>\n {this.dropdownLabel && (\n <label class=\"hy-dropdown__button-label\" htmlFor={this.dropdownId}>\n {this.dropdownLabel}\n </label>\n )}\n <button\n id={this.dropdownId}\n class={`hy-dropdown__toggle ${this.isPanelOpen ? \"is-open\" : \"\"}`}\n aria-expanded={`${this.isPanelOpen || false}`}\n aria-controls=\"dropdownPanel\"\n onClick={() => this.handlePanelToggle()}\n aria-label={this.dropdownLabel}\n data-current-id={currentId}\n data-current-value={currentValue}\n value={currentId}\n type=\"button\"\n >\n {currentLabel}\n <hy-icon class=\"hy-dropdown__icon\" icon={\"hy-icon-caret-down\"} size={14} aria-hidden=\"true\" />\n </button>\n <hy-dropdown-panel checkbox-checked={this.isChecked ? \"true\" : \"false\"} is-hidden={!this.isPanelOpen}>\n {this._dropdownOptions.map(({id, label, value}, index) => (\n <hy-dropdown-panel-item\n dropdown-item-id={id}\n dropdown-item-label={label}\n dropdown-item-value={value}\n is-last={this._dropdownOptions.length - 1 === index}\n />\n ))}\n </hy-dropdown-panel>\n </Host>\n );\n } else {\n return (\n <Host class={classAttributes}>\n <button\n id={this.dropdownId}\n class={`hy-dropdown__toggle ${this.isPanelOpen ? \"is-open\" : \"\"}`}\n aria-expanded={`${this.isPanelOpen || false}`}\n aria-controls=\"dropdownPanel\"\n onClick={() => this.handlePanelToggle()}\n aria-label={this.dropdownLabel}\n type=\"button\"\n >\n {this.dropdownLabel && this.dropdownLabel}\n <hy-icon class=\"hy-dropdown__icon\" icon={\"hy-icon-caret-down\"} size={14} aria-hidden=\"true\" />\n </button>\n <hy-dropdown-panel checkbox-checked={this.isChecked ? \"true\" : \"false\"} is-hidden={!this.isPanelOpen}>\n {this._dropdownOptions.map(({id, label, value}, index) => (\n <hy-dropdown-panel-item\n dropdown-item-id={id}\n dropdown-item-label={label}\n dropdown-item-value={value}\n is-last={this._dropdownOptions.length - 1 === index}\n />\n ))}\n </hy-dropdown-panel>\n </Host>\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"hy-dropdown.js","sourceRoot":"","sources":["../../../src/components/hy-dropdown/hy-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAmB3D,MAAM,OAAO,UAAU;;kBAGK,KAAK;yBACC,IAAI;sBACP,gBAAgB;;wBAEd,KAAK;gBACb,IAAI;yBAC6B,IAAI;uBAC5B,KAAK;qBACP,KAAK;yBACM,CAAC,EAAC,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,CAAC,EAAC,CAAC;;8BAGhD,CAAC;;EA2BvC,KAAK,CAAC,iBAAiB;IACrB,IAAI,CAAC,gBAAgB,GAAG,MAAM,gBAAg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KAAK,EAAC,yBAAyB,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,iBAAc,MAAM,GAAG,CACzF,CACJ,CACN,CAAC,CACC,CACA,CACR,CAAC;KACH;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Host, Listen, Event, EventEmitter, h, State, Prop, Watch} from \"@stencil/core\";\nimport {jsonParserWorker} from \"../../global/globalScript\";\n\nexport interface IDropdownItem {\n id: string | number;\n label: string;\n value: string | number;\n}\n\nexport interface DefaultValue {\n id: string | number;\n label: string;\n value: string | number;\n}\n\n@Component({\n tag: \"hy-dropdown\",\n styleUrl: \"hy-dropdown.scss\",\n shadow: false,\n})\nexport class HyDropdown {\n private _dropdownOptions: IDropdownItem[];\n @Element() el: HTMLElement;\n @Prop() single: boolean = false;\n @Prop() dropdownLabel: string = null;\n @Prop() dropdownId: string = \"dropdownToggle\";\n @Prop() dropdownOptions: IDropdownItem[] | string;\n @Prop() defaultLabel: string = \"All\";\n @Prop() type: string = null;\n @Prop({mutable: true}) defaultOption: string | number = null;\n @State() isPanelOpen: boolean = false;\n @State() isChecked: boolean = false;\n @State() currentSingle: DefaultValue[] = [{id: 0, label: this.defaultLabel, value: 0}];\n @State() currentMulti: IDropdownItem[];\n\n @State() focusedOptionIndex: number = 0;\n\n @Event({\n eventName: `dropdownPanelToggled`,\n composed: true,\n bubbles: true,\n })\n dropdownPanelToggled: EventEmitter;\n\n @Event({\n eventName: `dropdownValueChanged`,\n composed: true,\n })\n dropdropValueChange: EventEmitter;\n\n @Event({\n eventName: `dropdownMultiValueChanged`,\n composed: true,\n })\n dropdropMultiValueChange: EventEmitter;\n\n @Event({\n eventName: `dropdownKeyPress`,\n composed: true,\n })\n dropdownKeyPress: EventEmitter;\n\n async componentWillLoad() {\n this._dropdownOptions = await jsonParserWorker(this.dropdownOptions);\n }\n\n componentWillUpdate() {\n const items = this.el.querySelectorAll(\".hy-dropdown__checkbox\") as any;\n if (items) {\n if ([...items].some((item) => item.checked == true)) {\n this.isChecked = true;\n } else {\n this.isChecked = false;\n }\n }\n }\n\n @Watch(\"defaultOption\")\n watchPropHandler(newValue: string | number, oldValue: string | number) {\n if (!this.single) return;\n\n if (newValue !== oldValue) {\n const dropdownPanelCheckboxElements = this.el.getElementsByClassName(\"hy-dropdown__checkbox\") as HTMLCollectionOf<\n HTMLInputElement\n >;\n\n Array.from(dropdownPanelCheckboxElements).filter((item) => {\n if (item.id == newValue) {\n item.checked = true;\n this.currentSingle = this._dropdownOptions.filter((option) => option.id == newValue) as any;\n return;\n }\n return null;\n });\n }\n }\n\n @Listen(\"dropdownPanelToggled\", {target: \"window\"})\n panelListener(e) {\n if (this.isPanelOpen && e.detail.dropdownId !== this.dropdownId) {\n this.isPanelOpen = false;\n }\n }\n\n private handleMultiClick(event, option) {\n event.stopPropagation();\n const dropdownPanelCheckboxElements = this.el.getElementsByClassName(\"hy-dropdown__checkbox\") as HTMLCollectionOf<\n HTMLInputElement\n >;\n Array.from(dropdownPanelCheckboxElements).filter((i) => {\n const item = i.closest(\"li\");\n if (item.dataset.id == option.id && !item.hasAttribute(\"aria-selected\")) {\n item.setAttribute(\"aria-selected\", \"true\");\n this.currentMulti =\n this.currentMulti && this.currentMulti.length > 0 ? [...this.currentMulti, option] : [option];\n return;\n }\n if (item.dataset.id === option.id && item.hasAttribute(\"aria-selected\")) {\n item.removeAttribute(\"aria-selected\");\n if (this.currentMulti.length > 0) {\n const index = this.currentMulti.indexOf(option);\n this.currentMulti = this.currentMulti.splice(index, 1);\n }\n return;\n }\n return null;\n });\n }\n\n private handleSingleClick(event, option) {\n if (!this.single || !this.isPanelOpen) return;\n const dropdownPanelCheckboxElements = this.el.getElementsByClassName(\"hy-dropdown__checkbox\") as HTMLCollectionOf<\n HTMLInputElement\n >;\n event.stopPropagation();\n\n Array.from(dropdownPanelCheckboxElements).filter((i) => {\n const item = i.closest(\"li\");\n if (item.dataset.id == option.id) {\n if (item.hasAttribute(\"aria-selected\")) {\n item.removeAttribute(\"aria-selected\");\n this.currentSingle = [{id: null, label: this.defaultLabel, value: null}];\n return;\n }\n item.setAttribute(\"aria-selected\", \"true\");\n this.currentSingle = this._dropdownOptions.filter((o) => o.id == option.id) as any;\n return;\n }\n if (item.dataset.id !== option.id && item.hasAttribute(\"aria-selected\")) {\n item.removeAttribute(\"aria-selected\");\n return;\n }\n return null;\n });\n }\n\n @Listen(\"keydown\", {capture: false})\n handleKeyDown(event: KeyboardEvent) {\n event.stopPropagation();\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n if (!this.isPanelOpen) {\n this.handlePanelToggle(event);\n return;\n }\n this.focusedOptionIndex = (this.focusedOptionIndex + 1) % this._dropdownOptions.length;\n break;\n case \"ArrowUp\":\n this.focusedOptionIndex =\n (this.focusedOptionIndex - 1 + this._dropdownOptions.length) % this._dropdownOptions.length;\n event.preventDefault();\n break;\n case \"Enter\":\n case \" \":\n if (!this.isPanelOpen) {\n event.preventDefault();\n this.handlePanelToggle(event);\n return;\n }\n if (this.single) {\n this.handleOptionSingleClick(event, this._dropdownOptions[this.focusedOptionIndex]);\n } else {\n this.handleMultiOptionClick(event, this._dropdownOptions[this.focusedOptionIndex]);\n }\n const emitDetails = {\n id: this.dropdownId,\n type: this.type,\n data: this._dropdownOptions[this.focusedOptionIndex],\n };\n this.dropdownKeyPress.emit(emitDetails);\n event.preventDefault();\n break;\n case \"Escape\":\n case \"Tab\":\n this.isPanelOpen = false;\n break;\n default:\n break;\n }\n }\n\n private handlePanelToggle(e) {\n e.stopPropagation();\n this.isPanelOpen = !this.isPanelOpen;\n\n const emitDetails = {\n dropdownId: this.dropdownId,\n panelOpen: this.isPanelOpen,\n };\n this.dropdownPanelToggled.emit(emitDetails);\n }\n\n @Listen(\"click\", {target: \"window\"})\n handlePanelClickOutside(e) {\n e.stopPropagation();\n const dropdownToggleButtonElement = this.el.querySelector(`#${this.dropdownId}`) as HTMLButtonElement;\n const dropdownPanelElement = this.el.querySelector(\".hy-dropdown__panel\") as HTMLElement;\n const dropdownPanelCheckboxElements = this.el.querySelectorAll(\".hy-dropdown__panel-item\");\n const dropdownPanelCheckboxes = this.el.querySelectorAll(\".hy-dropdown__checkbox\");\n const dropdownToggleButtonIconElement = this.el.querySelectorAll(\".hy-dropdown__icon\");\n\n const {target} = e;\n\n const allowedElements = [\n this.el,\n dropdownToggleButtonElement,\n dropdownPanelElement,\n ...dropdownPanelCheckboxes,\n dropdownToggleButtonIconElement,\n ...dropdownPanelCheckboxElements, // Spread (\"copy\") items to allowedElement array.\n ];\n\n if (this.isPanelOpen && !allowedElements.includes(target)) {\n this.isPanelOpen = false;\n }\n }\n\n private handleOptionSingleClick(event, option) {\n event.stopPropagation();\n this.handleSingleClick(event, option);\n const emitDetails = {\n id: this.dropdownId,\n type: this.type,\n data: option,\n };\n this.dropdropValueChange.emit(emitDetails);\n }\n\n private handleMultiOptionClick(event, option) {\n event.stopPropagation();\n this.handleMultiClick(event, option);\n const emitDetails = {\n id: this.dropdownId,\n type: this.type,\n data: this.currentMulti,\n };\n this.dropdropMultiValueChange.emit(emitDetails);\n }\n\n private handleOptionHover(index) {\n this.focusedOptionIndex = index;\n }\n\n render() {\n const {label: currentLabel, id: currentId, value: currentValue} = this.currentSingle[0];\n const classAttributes = [\"hy-dropdown\", this.single ? \"hy-dropdown--single\" : \"\"].join(\" \");\n if (this.single) {\n return (\n <Host class={classAttributes}>\n {this.dropdownLabel && (\n <label class=\"hy-dropdown__button-label\" htmlFor={this.dropdownId}>\n {this.dropdownLabel}\n </label>\n )}\n <div\n id={this.dropdownId}\n class={`hy-dropdown__toggle ${this.isPanelOpen ? \"is-open\" : \"\"}`}\n aria-expanded={`${this.isPanelOpen || false}`}\n aria-controls=\"dropdownPanel\"\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n onClick={(event) => this.handlePanelToggle(event)}\n onKeyDown={(event) => this.handleKeyDown(event)}\n aria-label={this.dropdownLabel}\n data-current-id={currentId}\n data-current-value={currentValue}\n data-value={currentId}\n tabIndex={0}\n >\n <input aria-hidden=\"true\" class=\"hy-dropdown__hidden-input\" type=\"hidden\" value={currentId}></input>\n {currentLabel}\n <hy-icon class=\"hy-dropdown__icon\" icon={\"hy-icon-caret-down\"} size={14} aria-hidden=\"true\" />\n </div>\n <ul\n checkbox-checked={this.isChecked ? \"true\" : \"false\"}\n id=\"dropdownPanel\"\n class={`hy-dropdown__panel ${!this.isPanelOpen ? \"is-hidden\" : \"\"}`}\n aria-expanded={`${!this.isPanelOpen || false}`}\n role=\"listbox\"\n aria-labelledby=\"dropdownToggle\"\n >\n {this._dropdownOptions.map(({id, label, value}, index, items) => (\n <li\n key={id}\n data-id={`${id}`}\n role=\"option\"\n class={`hy-dropdown__panel-item ${this._dropdownOptions.length - 1 === index ? \"is-last\" : \"\"}\n ${this.focusedOptionIndex === index ? \"hy-dropdown__panel-item--focused\" : \"\"}`}\n onClick={(event) => this.handleOptionSingleClick(event, items[index])}\n onMouseEnter={() => this.handleOptionHover(index)}\n >\n <span data-id={`${id}`} class=\"hy-dropdown__checkbox\" data-value={`${value}`}>\n {label}\n <hy-icon class=\"hy-dropdown__label-icon\" icon={\"hy-icon-done\"} size={14} aria-hidden=\"true\" />\n </span>\n </li>\n ))}\n </ul>\n </Host>\n );\n } else {\n return (\n <Host class={classAttributes}>\n <button\n id={this.dropdownId}\n class={`hy-dropdown__toggle ${this.isPanelOpen ? \"is-open\" : \"\"}`}\n aria-expanded={`${this.isPanelOpen || false}`}\n aria-controls=\"dropdownPanel\"\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n onClick={(event) => this.handlePanelToggle(event)}\n aria-label={this.dropdownLabel}\n type=\"button\"\n >\n {this.dropdownLabel && this.dropdownLabel}\n <hy-icon class=\"hy-dropdown__icon\" icon={\"hy-icon-caret-down\"} size={14} aria-hidden=\"true\" />\n </button>\n <ul\n checkbox-checked={this.isChecked ? \"true\" : \"false\"}\n id=\"dropdownPanel\"\n class={`hy-dropdown__panel ${!this.isPanelOpen ? \"is-hidden\" : \"\"}`}\n aria-expanded={`${!this.isPanelOpen || false}`}\n role=\"listbox\"\n aria-labelledby=\"dropdownToggle\"\n >\n {this._dropdownOptions.map(({id, label, value}, index, items) => (\n <li\n key={id}\n data-id={`${id}`}\n role=\"option\"\n class={`hy-dropdown__panel-item ${this._dropdownOptions.length - 1 === index ? \"is-last\" : \"\"}\n ${this.focusedOptionIndex === index ? \"hy-dropdown__panel-item--focused\" : \"\"}`}\n onClick={(event) => this.handleMultiOptionClick(event, items[index])}\n onMouseEnter={() => this.handleOptionHover(index)}\n >\n <span data-id={`${id}`} class=\"hy-dropdown__checkbox\" data-value={`${value}`}>\n {label}\n <hy-icon class=\"hy-dropdown__label-icon\" icon={\"hy-icon-done\"} size={14} aria-hidden=\"true\" />\n </span>\n </li>\n ))}\n </ul>\n </Host>\n );\n }\n }\n}\n"]}
@@ -931,7 +931,7 @@ swiper-container .swiper-notification {
931
931
 
932
932
  .hero-carousel-container {
933
933
  border-bottom: 1px solid var(--grayscale-medium-dark);
934
- margin: 1.5rem 1rem;
934
+ margin: 1.5rem 0;
935
935
  --button-size: 35px;
936
936
  --button-offset: 0px;
937
937
  }
@@ -1056,6 +1056,7 @@ swiper-container .swiper-notification {
1056
1056
  -ms-flex-pack: justify;
1057
1057
  justify-content: space-between;
1058
1058
  margin: 30px 0;
1059
+ padding: 0 1rem;
1059
1060
  position: relative;
1060
1061
  width: 100%;
1061
1062
  }
@@ -1064,6 +1065,7 @@ swiper-container .swiper-notification {
1064
1065
  .hero-carousel--controls {
1065
1066
  display: block;
1066
1067
  margin: 0;
1068
+ padding: 0;
1067
1069
  position: initial;
1068
1070
  width: auto;
1069
1071
  }
@@ -1175,13 +1177,13 @@ swiper-container .swiper-notification {
1175
1177
  -ms-hyphens: auto;
1176
1178
  hyphens: auto;
1177
1179
  letter-spacing: -0.36px;
1178
- opacity: 0.25;
1180
+ opacity: 0.8;
1179
1181
  text-align: left;
1180
1182
  }
1181
1183
 
1182
1184
  .hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button button:is(:hover, :focus) {
1183
1185
  cursor: pointer;
1184
- opacity: 0.5;
1186
+ opacity: 1;
1185
1187
  }
1186
1188
 
1187
1189
  .hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button button .hero-carousel--item__pagination__button__theme {
@@ -1199,6 +1201,14 @@ swiper-container .swiper-notification {
1199
1201
  opacity: 1;
1200
1202
  }
1201
1203
 
1204
+ .hero-carousel--item__pagination ul li.hero-carousel--item__pagination__button.is-current button:after {
1205
+ border-bottom: 4px solid var(--grayscale-white, #FFF);
1206
+ content: "";
1207
+ display: block;
1208
+ margin-top: 0.45rem;
1209
+ width: 33.3333333333%;
1210
+ }
1211
+
1202
1212
  .hero-carousel--item {
1203
1213
  display: grid;
1204
1214
  -webkit-box-orient: vertical;
@@ -66,6 +66,7 @@ a.hy-video {
66
66
  }
67
67
 
68
68
  .hy-video__video-container {
69
+ aspect-ratio: 16/9;
69
70
  display: inline-block;
70
71
  margin-bottom: 22px;
71
72
  position: relative;
@@ -215,20 +216,6 @@ a.hy-video {
215
216
  }
216
217
  }
217
218
 
218
- .hy-video__video-container > *:not(.hy-video__label, .hy-video__play, .hy-video__play__simple) {
219
- bottom: 0;
220
- left: 0;
221
- position: absolute;
222
- right: 0;
223
- top: 0;
224
- }
225
-
226
- .hy-video__video-container:after {
227
- content: "";
228
- display: block;
229
- padding-top: 56.25%;
230
- }
231
-
232
219
  .hy-video:not(.hy-video--horizontal) {
233
220
  display: -webkit-box;
234
221
  display: -ms-flexbox;