igniteui-webcomponents 6.1.1 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/LICENSE +1 -1
- package/README.md +13 -1
- package/animations/player.d.ts +1 -1
- package/animations/player.js.map +1 -1
- package/components/calendar/calendar.d.ts +1 -0
- package/components/calendar/calendar.js +5 -8
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.material.css.js +1 -1
- package/components/calendar/themes/light/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/material/calendar.material.css.js +1 -1
- package/components/calendar/themes/shared/material/calendar.material.css.js.map +1 -1
- package/components/card/themes/content.js +7 -0
- package/components/card/themes/content.js.map +1 -1
- package/components/card/themes/shared/content/card.content.indigo.css.d.ts +1 -0
- package/components/card/themes/shared/content/card.content.indigo.css.js +3 -0
- package/components/card/themes/shared/content/card.content.indigo.css.js.map +1 -0
- package/components/carousel/carousel-indicator.d.ts +1 -1
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +3 -3
- package/components/carousel/carousel-slide.js +7 -13
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +41 -42
- package/components/carousel/carousel.js +173 -187
- package/components/carousel/carousel.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +3 -5
- package/components/checkbox/checkbox-base.js +15 -21
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.d.ts +3 -4
- package/components/checkbox/checkbox.js +18 -17
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.d.ts +0 -1
- package/components/checkbox/switch.js +7 -10
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.common.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.common.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.indigo.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.material.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.material.css.js.map +1 -1
- package/components/chip/chip.d.ts +11 -11
- package/components/chip/chip.js +61 -65
- package/components/chip/chip.js.map +1 -1
- package/components/combo/combo.d.ts +3 -3
- package/components/combo/combo.js +12 -6
- package/components/combo/combo.js.map +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.shared.css.js +1 -1
- package/components/combo/themes/light/combo.shared.css.js.map +1 -1
- package/components/combo/themes/shared/combo.common.css.js +1 -1
- package/components/combo/themes/shared/combo.common.css.js.map +1 -1
- package/components/combo/themes/shared/combo.indigo.css.js +1 -1
- package/components/combo/themes/shared/combo.indigo.css.js.map +1 -1
- package/components/combo/themes/shared/combo.material.css.js +1 -1
- package/components/combo/themes/shared/combo.material.css.js.map +1 -1
- package/components/common/controllers/internals.d.ts +66 -2
- package/components/common/controllers/internals.js +21 -0
- package/components/common/controllers/internals.js.map +1 -1
- package/components/common/controllers/slot.d.ts +87 -0
- package/components/common/controllers/slot.js +75 -0
- package/components/common/controllers/slot.js.map +1 -0
- package/components/common/mixins/alert.d.ts +7 -8
- package/components/common/mixins/alert.js +23 -34
- package/components/common/mixins/alert.js.map +1 -1
- package/components/common/mixins/forms/associated.d.ts +1 -1
- package/components/common/mixins/forms/associated.js +91 -36
- package/components/common/mixins/forms/associated.js.map +1 -1
- package/components/common/mixins/forms/form-transformers.d.ts +21 -0
- package/components/common/mixins/forms/form-transformers.js +64 -0
- package/components/common/mixins/forms/form-transformers.js.map +1 -0
- package/components/common/mixins/forms/form-value.d.ts +7 -36
- package/components/common/mixins/forms/form-value.js +2 -64
- package/components/common/mixins/forms/form-value.js.map +1 -1
- package/components/common/mixins/forms/types.d.ts +19 -10
- package/components/common/mixins/forms/types.js +2 -1
- package/components/common/mixins/forms/types.js.map +1 -1
- package/components/common/util.d.ts +1 -0
- package/components/common/util.js +3 -0
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -3
- package/components/date-picker/date-picker.js +11 -13
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.material.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.material.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.indigo.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.material.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.material.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.indigo.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.material.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.material.css.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +1 -3
- package/components/date-range-picker/date-range-picker.js +19 -26
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.bootstrap.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.bootstrap.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.fluent.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.fluent.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.material.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.material.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.bootstrap.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.bootstrap.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.common.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.common.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.fluent.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.fluent.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.indigo.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.indigo.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.material.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.material.css.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +1 -2
- package/components/date-time-input/date-time-input.js +7 -7
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/dialog/dialog.d.ts +23 -25
- package/components/dialog/dialog.js +108 -115
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/dark/dialog.bootstrap.css.js +1 -1
- package/components/dialog/themes/dark/dialog.bootstrap.css.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +12 -14
- package/components/expansion-panel/expansion-panel.js +43 -56
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/file-input/file-input.d.ts +1 -3
- package/components/file-input/file-input.js +6 -11
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/dark/file-input.bootstrap.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.bootstrap.css.js +3 -0
- package/components/file-input/themes/dark/file-input.bootstrap.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.fluent.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.fluent.css.js +3 -0
- package/components/file-input/themes/dark/file-input.fluent.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.indigo.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.indigo.css.js +3 -0
- package/components/file-input/themes/dark/file-input.indigo.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.material.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.material.css.js +3 -0
- package/components/file-input/themes/dark/file-input.material.css.js.map +1 -0
- package/components/file-input/themes/file-input.base.css.js +1 -1
- package/components/file-input/themes/file-input.base.css.js.map +1 -1
- package/components/file-input/themes/light/file-input.bootstrap.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.bootstrap.css.js +3 -0
- package/components/file-input/themes/light/file-input.bootstrap.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.fluent.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.fluent.css.js +3 -0
- package/components/file-input/themes/light/file-input.fluent.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.indigo.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.indigo.css.js +3 -0
- package/components/file-input/themes/light/file-input.indigo.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.material.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.material.css.js +3 -0
- package/components/file-input/themes/light/file-input.material.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.shared.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.shared.css.js +3 -0
- package/components/file-input/themes/light/file-input.shared.css.js.map +1 -0
- package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.indigo.css.js +1 -1
- package/components/file-input/themes/shared/file-input.indigo.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.material.css.js +1 -1
- package/components/file-input/themes/shared/file-input.material.css.js.map +1 -1
- package/components/file-input/themes/themes.js +19 -0
- package/components/file-input/themes/themes.js.map +1 -1
- package/components/input/input.d.ts +1 -4
- package/components/input/input.js +7 -12
- package/components/input/input.js.map +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.common.css.js +1 -1
- package/components/input/themes/shared/input.common.css.js.map +1 -1
- package/components/input/themes/shared/input.fluent.css.js +1 -1
- package/components/input/themes/shared/input.fluent.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/mask-input/mask-input-base.js +1 -0
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +2 -3
- package/components/mask-input/mask-input.js +5 -8
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.d.ts +3 -4
- package/components/nav-drawer/nav-drawer-item.js +15 -18
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +1 -2
- package/components/nav-drawer/nav-drawer.js +9 -11
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.common.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.common.css.js.map +1 -1
- package/components/popover/popover.d.ts +17 -16
- package/components/popover/popover.js +81 -91
- package/components/popover/popover.js.map +1 -1
- package/components/progress/base.d.ts +8 -8
- package/components/progress/base.js +19 -23
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.d.ts +3 -4
- package/components/progress/circular-progress.js +15 -18
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.d.ts +1 -0
- package/components/progress/linear-progress.js +5 -1
- package/components/progress/linear-progress.js.map +1 -1
- package/components/radio/radio.d.ts +3 -5
- package/components/radio/radio.js +33 -31
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/dark/radio.fluent.css.js +1 -1
- package/components/radio/themes/dark/radio.fluent.css.js.map +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
- package/components/radio/themes/shared/radio.common.css.js +1 -1
- package/components/radio/themes/shared/radio.common.css.js.map +1 -1
- package/components/radio/themes/shared/radio.fluent.css.js +1 -1
- package/components/radio/themes/shared/radio.fluent.css.js.map +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
- package/components/radio/themes/shared/radio.material.css.js +1 -1
- package/components/radio/themes/shared/radio.material.css.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +4 -4
- package/components/radio-group/radio-group.js +24 -21
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +1 -2
- package/components/rating/rating.js +4 -3
- package/components/rating/rating.js.map +1 -1
- package/components/select/select.d.ts +35 -38
- package/components/select/select.js +138 -146
- package/components/select/select.js.map +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
- package/components/select/themes/shared/select.common.css.js +1 -1
- package/components/select/themes/shared/select.common.css.js.map +1 -1
- package/components/select/themes/shared/select.fluent.css.js +1 -1
- package/components/select/themes/shared/select.fluent.css.js.map +1 -1
- package/components/select/themes/shared/select.indigo.css.js +1 -1
- package/components/select/themes/shared/select.indigo.css.js.map +1 -1
- package/components/select/themes/shared/select.material.css.js +1 -1
- package/components/select/themes/shared/select.material.css.js.map +1 -1
- package/components/slider/slider-label.js.map +1 -1
- package/components/slider/slider.d.ts +1 -2
- package/components/slider/slider.js +5 -2
- package/components/slider/slider.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +3 -5
- package/components/snackbar/snackbar.js +5 -5
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/stepper/stepper.d.ts +1 -0
- package/components/stepper/stepper.js +9 -0
- package/components/stepper/stepper.js.map +1 -1
- package/components/textarea/textarea.d.ts +13 -20
- package/components/textarea/textarea.js +66 -90
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
- package/components/tile-manager/position.js +2 -1
- package/components/tile-manager/position.js.map +1 -1
- package/components/tile-manager/tile.d.ts +8 -12
- package/components/tile-manager/tile.js +16 -37
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/toast.d.ts +1 -2
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +9 -6
- package/components/validation-container/validation-container.js +56 -38
- package/components/validation-container/validation-container.js.map +1 -1
- package/custom-elements.json +9595 -6648
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/package.json +1 -1
- package/web-types.json +2 -2
|
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { ContextProvider } from '@lit/context';
|
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
|
9
|
-
import { property, queryAll,
|
|
9
|
+
import { property, queryAll, state } from 'lit/decorators.js';
|
|
10
|
+
import { cache } from 'lit/directives/cache.js';
|
|
10
11
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
11
12
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
13
|
import { addThemingController } from '../../theming/theming-controller.js';
|
|
@@ -16,11 +17,12 @@ import { addGesturesController, } from '../common/controllers/gestures.js';
|
|
|
16
17
|
import { addInternalsController } from '../common/controllers/internals.js';
|
|
17
18
|
import { addKeybindings, arrowLeft, arrowRight, endKey, homeKey, } from '../common/controllers/key-bindings.js';
|
|
18
19
|
import { createMutationController, } from '../common/controllers/mutation-observer.js';
|
|
20
|
+
import { addSlotController, setSlots, } from '../common/controllers/slot.js';
|
|
19
21
|
import { watch } from '../common/decorators/watch.js';
|
|
20
22
|
import { registerComponent } from '../common/definitions/register.js';
|
|
21
23
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
22
24
|
import { partMap } from '../common/part-map.js';
|
|
23
|
-
import { addSafeEventListener, asNumber,
|
|
25
|
+
import { addSafeEventListener, asNumber, findElementFromEventPath, first, formatString, isEmpty, isLTR, last, wrap, } from '../common/util.js';
|
|
24
26
|
import IgcIconComponent from '../icon/icon.js';
|
|
25
27
|
import IgcCarouselIndicatorComponent from './carousel-indicator.js';
|
|
26
28
|
import IgcCarouselIndicatorContainerComponent from './carousel-indicator-container.js';
|
|
@@ -28,40 +30,32 @@ import IgcCarouselSlideComponent from './carousel-slide.js';
|
|
|
28
30
|
import { styles } from './themes/carousel.base.css.js';
|
|
29
31
|
import { all } from './themes/container.js';
|
|
30
32
|
import { styles as shared } from './themes/shared/carousel.common.css.js';
|
|
33
|
+
let nextId = 1;
|
|
34
|
+
const Slots = setSlots('indicator', 'previous-button', 'next-button');
|
|
31
35
|
class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
32
36
|
static register() {
|
|
33
37
|
registerComponent(IgcCarouselComponent, IgcCarouselIndicatorComponent, IgcCarouselIndicatorContainerComponent, IgcCarouselSlideComponent, IgcIconComponent, IgcButtonComponent);
|
|
34
38
|
}
|
|
35
|
-
get
|
|
36
|
-
return this._projectedIndicators
|
|
39
|
+
get _hasProjectedIndicators() {
|
|
40
|
+
return !isEmpty(this._projectedIndicators);
|
|
37
41
|
}
|
|
38
|
-
get
|
|
42
|
+
get _showIndicatorsLabel() {
|
|
39
43
|
return this.total > this.maximumIndicatorsCount;
|
|
40
44
|
}
|
|
41
|
-
get
|
|
45
|
+
get _nextIndex() {
|
|
42
46
|
return wrap(0, this.total - 1, this.current + 1);
|
|
43
47
|
}
|
|
44
|
-
get
|
|
48
|
+
get _previousIndex() {
|
|
45
49
|
return wrap(0, this.total - 1, this.current - 1);
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (activeSlides.length <= 1) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const idx = this.slides.indexOf(added.length ? last(added).node : last(attributes).node);
|
|
53
|
-
for (const [i, slide] of this.slides.entries()) {
|
|
54
|
-
if (slide.active && i !== idx) {
|
|
55
|
-
slide.active = false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
this.activateSlide(this.slides[idx]);
|
|
51
|
+
get slides() {
|
|
52
|
+
return Array.from(this._slides);
|
|
59
53
|
}
|
|
60
54
|
get total() {
|
|
61
|
-
return this.
|
|
55
|
+
return this._slides.length;
|
|
62
56
|
}
|
|
63
57
|
get current() {
|
|
64
|
-
return Math.max(0, this.
|
|
58
|
+
return Math.max(0, this._slides.indexOf(this._activeSlide));
|
|
65
59
|
}
|
|
66
60
|
get isPlaying() {
|
|
67
61
|
return this._playing;
|
|
@@ -69,21 +63,30 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
69
63
|
get isPaused() {
|
|
70
64
|
return this._paused;
|
|
71
65
|
}
|
|
72
|
-
|
|
66
|
+
_contextChanged() {
|
|
73
67
|
this._context.setValue(this, true);
|
|
74
68
|
}
|
|
75
|
-
|
|
69
|
+
_intervalChange() {
|
|
76
70
|
if (!this.isPlaying) {
|
|
77
71
|
this._playing = true;
|
|
78
72
|
}
|
|
79
|
-
this.
|
|
73
|
+
this._restartInterval();
|
|
80
74
|
}
|
|
81
75
|
constructor() {
|
|
82
76
|
super();
|
|
83
|
-
this._carouselId = `igc-carousel-${
|
|
77
|
+
this._carouselId = `igc-carousel-${nextId++}`;
|
|
78
|
+
this._paused = false;
|
|
84
79
|
this._hasKeyboardInteractionOnIndicators = false;
|
|
85
|
-
this.
|
|
80
|
+
this._hasPointerInteraction = false;
|
|
86
81
|
this._hasInnerFocus = false;
|
|
82
|
+
this._slides = [];
|
|
83
|
+
this._projectedIndicators = [];
|
|
84
|
+
this._playing = false;
|
|
85
|
+
this._slots = addSlotController(this, {
|
|
86
|
+
slots: Slots,
|
|
87
|
+
onChange: this._handleSlotChange,
|
|
88
|
+
initial: true,
|
|
89
|
+
});
|
|
87
90
|
this._context = new ContextProvider(this, {
|
|
88
91
|
context: carouselContext,
|
|
89
92
|
initialValue: this,
|
|
@@ -92,8 +95,6 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
92
95
|
this._indicatorsContainerRef = createRef();
|
|
93
96
|
this._prevButtonRef = createRef();
|
|
94
97
|
this._nextButtonRef = createRef();
|
|
95
|
-
this._playing = false;
|
|
96
|
-
this._paused = false;
|
|
97
98
|
this.disableLoop = false;
|
|
98
99
|
this.disablePauseOnInteraction = false;
|
|
99
100
|
this.hideNavigation = false;
|
|
@@ -111,38 +112,34 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
111
112
|
},
|
|
112
113
|
});
|
|
113
114
|
addThemingController(this, all);
|
|
114
|
-
addSafeEventListener(this, 'pointerenter', this.
|
|
115
|
-
addSafeEventListener(this, 'pointerleave', this.
|
|
116
|
-
addSafeEventListener(this, '
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
-
addSafeEventListener(this, 'keyup', () => {
|
|
120
|
-
this._hasInnerFocus = true;
|
|
121
|
-
});
|
|
115
|
+
addSafeEventListener(this, 'pointerenter', this._handlePointerInteraction);
|
|
116
|
+
addSafeEventListener(this, 'pointerleave', this._handlePointerInteraction);
|
|
117
|
+
addSafeEventListener(this, 'focusin', this._handleFocusInteraction);
|
|
118
|
+
addSafeEventListener(this, 'focusout', this._handleFocusInteraction);
|
|
122
119
|
addGesturesController(this, {
|
|
123
120
|
ref: this._carouselSlidesContainerRef,
|
|
124
121
|
touchOnly: true,
|
|
125
122
|
})
|
|
126
|
-
.set('swipe-left', this.
|
|
127
|
-
.set('swipe-right', this.
|
|
128
|
-
.set('swipe-up', this.
|
|
129
|
-
.set('swipe-down', this.
|
|
123
|
+
.set('swipe-left', this._handleHorizontalSwipe)
|
|
124
|
+
.set('swipe-right', this._handleHorizontalSwipe)
|
|
125
|
+
.set('swipe-up', this._handleVerticalSwipe)
|
|
126
|
+
.set('swipe-down', this._handleVerticalSwipe);
|
|
130
127
|
addKeybindings(this, {
|
|
131
128
|
ref: this._indicatorsContainerRef,
|
|
132
129
|
bindingDefaults: { preventDefault: true },
|
|
133
130
|
})
|
|
134
|
-
.set(arrowLeft, this.
|
|
135
|
-
.set(arrowRight, this.
|
|
136
|
-
.set(homeKey, this.
|
|
137
|
-
.set(endKey, this.
|
|
131
|
+
.set(arrowLeft, this._handleArrowLeft)
|
|
132
|
+
.set(arrowRight, this._handleArrowRight)
|
|
133
|
+
.set(homeKey, this._handleHomeKey)
|
|
134
|
+
.set(endKey, this._handleEndKey);
|
|
138
135
|
addKeybindings(this, {
|
|
139
136
|
ref: this._prevButtonRef,
|
|
140
137
|
bindingDefaults: { preventDefault: true },
|
|
141
|
-
}).setActivateHandler(this.
|
|
138
|
+
}).setActivateHandler(this._handleNavigationInteractionPrevious);
|
|
142
139
|
addKeybindings(this, {
|
|
143
140
|
ref: this._nextButtonRef,
|
|
144
141
|
bindingDefaults: { preventDefault: true },
|
|
145
|
-
}).setActivateHandler(this.
|
|
142
|
+
}).setActivateHandler(this._handleNavigationInteractionNext);
|
|
146
143
|
createMutationController(this, {
|
|
147
144
|
callback: this._observerCallback,
|
|
148
145
|
filter: [IgcCarouselSlideComponent.tagName],
|
|
@@ -153,147 +150,158 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
153
150
|
},
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
async firstUpdated() {
|
|
154
|
+
await this.updateComplete;
|
|
155
|
+
if (!isEmpty(this._slides)) {
|
|
156
|
+
this._activateSlide(this._slides.findLast((slide) => slide.active) ?? first(this._slides));
|
|
159
157
|
}
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
handlePointerEnter() {
|
|
165
|
-
this._hasMouseStop = true;
|
|
166
|
-
if (this._hasInnerFocus) {
|
|
159
|
+
_observerCallback({ changes: { added, attributes }, }) {
|
|
160
|
+
const activeSlides = this._slides.filter((slide) => slide.active);
|
|
161
|
+
if (activeSlides.length <= 1) {
|
|
167
162
|
return;
|
|
168
163
|
}
|
|
169
|
-
this.
|
|
164
|
+
const idx = this._slides.indexOf(added.length ? last(added).node : last(attributes).node);
|
|
165
|
+
for (const [i, slide] of this._slides.entries()) {
|
|
166
|
+
if (slide.active && i !== idx) {
|
|
167
|
+
slide.active = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
this._activateSlide(this._slides[idx]);
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
_handleSlotChange(params) {
|
|
173
|
+
if (params.isDefault || params.isInitial) {
|
|
174
|
+
this._slides = this._slots.getAssignedElements('[default]', {
|
|
175
|
+
selector: IgcCarouselSlideComponent.tagName,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (params.slot === 'indicator') {
|
|
179
|
+
this._projectedIndicators = this._slots.getAssignedElements('indicator', {
|
|
180
|
+
selector: IgcCarouselIndicatorComponent.tagName,
|
|
181
|
+
});
|
|
175
182
|
}
|
|
176
|
-
this.handlePauseOnInteraction();
|
|
177
183
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
_handlePointerInteraction(event) {
|
|
185
|
+
this._hasPointerInteraction = event.type === 'pointerenter';
|
|
186
|
+
if (!this._hasInnerFocus) {
|
|
187
|
+
this._handlePauseOnInteraction();
|
|
181
188
|
}
|
|
182
|
-
this.handlePauseOnInteraction();
|
|
183
189
|
}
|
|
184
|
-
|
|
190
|
+
_handleFocusInteraction(event) {
|
|
185
191
|
const node = event.relatedTarget;
|
|
186
|
-
if (this.contains(node)
|
|
192
|
+
if (this.contains(node)) {
|
|
187
193
|
return;
|
|
188
194
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.handlePauseOnInteraction();
|
|
193
|
-
}
|
|
195
|
+
this._hasInnerFocus = event.type === 'focusin';
|
|
196
|
+
if (!this._hasPointerInteraction) {
|
|
197
|
+
this._handlePauseOnInteraction();
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
this.
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
this.play();
|
|
205
|
-
this.emitEvent('igcPlaying');
|
|
206
|
-
}
|
|
200
|
+
async _handleIndicatorClick(event) {
|
|
201
|
+
const indicator = findElementFromEventPath(IgcCarouselIndicatorComponent.tagName, event);
|
|
202
|
+
const index = this._hasProjectedIndicators
|
|
203
|
+
? this._projectedIndicators.indexOf(indicator)
|
|
204
|
+
: Array.from(this._defaultIndicators).indexOf(indicator);
|
|
205
|
+
this._handleInteraction(() => this.select(this._slides[index], index > this.current ? 'next' : 'prev'));
|
|
207
206
|
}
|
|
208
|
-
async
|
|
207
|
+
async _handleArrowLeft() {
|
|
209
208
|
this._hasKeyboardInteractionOnIndicators = true;
|
|
210
|
-
this.
|
|
209
|
+
this._handleInteraction(isLTR(this) ? this.prev : this.next);
|
|
211
210
|
}
|
|
212
|
-
async
|
|
211
|
+
async _handleArrowRight() {
|
|
213
212
|
this._hasKeyboardInteractionOnIndicators = true;
|
|
214
|
-
this.
|
|
213
|
+
this._handleInteraction(isLTR(this) ? this.next : this.prev);
|
|
215
214
|
}
|
|
216
|
-
async
|
|
215
|
+
async _handleHomeKey() {
|
|
217
216
|
this._hasKeyboardInteractionOnIndicators = true;
|
|
218
|
-
this.
|
|
217
|
+
this._handleInteraction(() => this.select(isLTR(this) ? first(this._slides) : last(this._slides)));
|
|
219
218
|
}
|
|
220
|
-
async
|
|
219
|
+
async _handleEndKey() {
|
|
221
220
|
this._hasKeyboardInteractionOnIndicators = true;
|
|
222
|
-
this.
|
|
221
|
+
this._handleInteraction(() => this.select(isLTR(this) ? last(this._slides) : first(this._slides)));
|
|
223
222
|
}
|
|
224
|
-
|
|
223
|
+
_handleVerticalSwipe({ data: { direction } }) {
|
|
225
224
|
if (this.vertical) {
|
|
226
|
-
this.
|
|
225
|
+
this._handleInteraction(direction === 'up' ? this.next : this.prev);
|
|
227
226
|
}
|
|
228
227
|
}
|
|
229
|
-
|
|
228
|
+
_handleHorizontalSwipe({ data: { direction } }) {
|
|
230
229
|
if (!this.vertical) {
|
|
231
|
-
|
|
230
|
+
const callback = () => {
|
|
232
231
|
if (isLTR(this)) {
|
|
233
|
-
direction === 'left' ?
|
|
232
|
+
return direction === 'left' ? this.next : this.prev;
|
|
234
233
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
});
|
|
234
|
+
return direction === 'left' ? this.prev : this.next;
|
|
235
|
+
};
|
|
236
|
+
this._handleInteraction(callback());
|
|
239
237
|
}
|
|
240
238
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const index = this.hasProjectedIndicators
|
|
244
|
-
? this._projectedIndicators.indexOf(indicator)
|
|
245
|
-
: Array.from(this._defaultIndicators).indexOf(indicator);
|
|
246
|
-
this.handleInteraction(() => this.select(this.slides[index], index > this.current ? 'next' : 'prev'));
|
|
247
|
-
}
|
|
248
|
-
handleNavigationInteractionNext() {
|
|
249
|
-
this.handleInteraction(this.next);
|
|
239
|
+
_handleNavigationInteractionNext() {
|
|
240
|
+
this._handleInteraction(this.next);
|
|
250
241
|
}
|
|
251
|
-
|
|
252
|
-
this.
|
|
242
|
+
_handleNavigationInteractionPrevious() {
|
|
243
|
+
this._handleInteraction(this.prev);
|
|
253
244
|
}
|
|
254
|
-
async
|
|
245
|
+
async _handleInteraction(callback) {
|
|
255
246
|
if (this.interval) {
|
|
256
|
-
this.
|
|
247
|
+
this._resetInterval();
|
|
248
|
+
}
|
|
249
|
+
if (await callback.call(this)) {
|
|
250
|
+
this.emitEvent('igcSlideChanged', { detail: this.current });
|
|
257
251
|
}
|
|
258
|
-
await callback.call(this);
|
|
259
|
-
this.emitEvent('igcSlideChanged', { detail: this.current });
|
|
260
252
|
if (this.interval) {
|
|
261
|
-
this.
|
|
253
|
+
this._restartInterval();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
_handlePauseOnInteraction() {
|
|
257
|
+
if (!this.interval || this.disablePauseOnInteraction)
|
|
258
|
+
return;
|
|
259
|
+
if (this.isPlaying) {
|
|
260
|
+
this.pause();
|
|
261
|
+
this.emitEvent('igcPaused');
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
this.play();
|
|
265
|
+
this.emitEvent('igcPlaying');
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
|
-
|
|
268
|
+
_activateSlide(slide) {
|
|
265
269
|
if (this._activeSlide) {
|
|
266
270
|
this._activeSlide.active = false;
|
|
267
271
|
}
|
|
268
272
|
this._activeSlide = slide;
|
|
269
273
|
this._activeSlide.active = true;
|
|
270
274
|
if (this._hasKeyboardInteractionOnIndicators) {
|
|
271
|
-
this.
|
|
275
|
+
this._hasProjectedIndicators
|
|
272
276
|
? this._projectedIndicators[this.current].focus()
|
|
273
277
|
: this._defaultIndicators[this.current].focus();
|
|
274
278
|
this._hasKeyboardInteractionOnIndicators = false;
|
|
275
279
|
}
|
|
276
280
|
}
|
|
277
|
-
|
|
278
|
-
for (const [idx, slide] of this.
|
|
281
|
+
_updateProjectedIndicators() {
|
|
282
|
+
for (const [idx, slide] of this._slides.entries()) {
|
|
279
283
|
const indicator = this._projectedIndicators[idx];
|
|
280
284
|
indicator.active = slide.active;
|
|
281
285
|
indicator.index = idx;
|
|
282
|
-
|
|
286
|
+
}
|
|
287
|
+
if (this._activeSlide) {
|
|
288
|
+
this.setAttribute('aria-controls', this._activeSlide.id);
|
|
283
289
|
}
|
|
284
290
|
}
|
|
285
|
-
|
|
291
|
+
_resetInterval() {
|
|
286
292
|
if (this._lastInterval) {
|
|
287
293
|
clearInterval(this._lastInterval);
|
|
288
294
|
this._lastInterval = null;
|
|
289
295
|
}
|
|
290
296
|
}
|
|
291
|
-
|
|
292
|
-
this.
|
|
297
|
+
_restartInterval() {
|
|
298
|
+
this._resetInterval();
|
|
293
299
|
if (asNumber(this.interval) > 0) {
|
|
294
300
|
this._lastInterval = setInterval(() => {
|
|
295
|
-
if (this.isPlaying &&
|
|
296
|
-
this.
|
|
301
|
+
if (this.isPlaying &&
|
|
302
|
+
this.total &&
|
|
303
|
+
!(this.disableLoop && this._nextIndex === 0)) {
|
|
304
|
+
this.select(this.slides[this._nextIndex], 'next');
|
|
297
305
|
this.emitEvent('igcSlideChanged', { detail: this.current });
|
|
298
306
|
}
|
|
299
307
|
else {
|
|
@@ -302,18 +310,18 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
302
310
|
}, this.interval);
|
|
303
311
|
}
|
|
304
312
|
}
|
|
305
|
-
async
|
|
313
|
+
async _animateSlides(nextSlide, currentSlide, dir) {
|
|
306
314
|
if (dir === 'next') {
|
|
307
315
|
currentSlide.previous = true;
|
|
308
316
|
currentSlide.toggleAnimation('out');
|
|
309
|
-
this.
|
|
317
|
+
this._activateSlide(nextSlide);
|
|
310
318
|
await nextSlide.toggleAnimation('in');
|
|
311
319
|
currentSlide.previous = false;
|
|
312
320
|
}
|
|
313
321
|
else {
|
|
314
322
|
currentSlide.previous = true;
|
|
315
323
|
currentSlide.toggleAnimation('in', 'reverse');
|
|
316
|
-
this.
|
|
324
|
+
this._activateSlide(nextSlide);
|
|
317
325
|
await nextSlide.toggleAnimation('out', 'reverse');
|
|
318
326
|
currentSlide.previous = false;
|
|
319
327
|
}
|
|
@@ -322,49 +330,49 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
322
330
|
if (!this.isPlaying) {
|
|
323
331
|
this._paused = false;
|
|
324
332
|
this._playing = true;
|
|
325
|
-
this.
|
|
333
|
+
this._restartInterval();
|
|
326
334
|
}
|
|
327
335
|
}
|
|
328
336
|
pause() {
|
|
329
337
|
if (this.isPlaying) {
|
|
330
338
|
this._playing = false;
|
|
331
339
|
this._paused = true;
|
|
332
|
-
this.
|
|
340
|
+
this._resetInterval();
|
|
333
341
|
}
|
|
334
342
|
}
|
|
335
343
|
async next() {
|
|
336
|
-
if (this.disableLoop && this.
|
|
344
|
+
if (this.disableLoop && this._nextIndex === 0) {
|
|
337
345
|
this.pause();
|
|
338
346
|
return false;
|
|
339
347
|
}
|
|
340
|
-
return await this.select(this.
|
|
348
|
+
return await this.select(this._slides[this._nextIndex], 'next');
|
|
341
349
|
}
|
|
342
350
|
async prev() {
|
|
343
|
-
if (this.disableLoop && this.
|
|
351
|
+
if (this.disableLoop && this._previousIndex === this.total - 1) {
|
|
344
352
|
this.pause();
|
|
345
353
|
return false;
|
|
346
354
|
}
|
|
347
|
-
return await this.select(this.
|
|
355
|
+
return await this.select(this._slides[this._previousIndex], 'prev');
|
|
348
356
|
}
|
|
349
357
|
async select(slideOrIndex, animationDirection) {
|
|
350
358
|
let index;
|
|
351
359
|
let slide;
|
|
352
360
|
if (typeof slideOrIndex === 'number') {
|
|
353
361
|
index = slideOrIndex;
|
|
354
|
-
slide = this.
|
|
362
|
+
slide = this._slides.at(index);
|
|
355
363
|
}
|
|
356
364
|
else {
|
|
357
365
|
slide = slideOrIndex;
|
|
358
|
-
index = this.
|
|
366
|
+
index = this._slides.indexOf(slide);
|
|
359
367
|
}
|
|
360
368
|
if (index === this.current || index === -1 || !slide) {
|
|
361
369
|
return false;
|
|
362
370
|
}
|
|
363
371
|
const dir = animationDirection ?? (index > this.current ? 'next' : 'prev');
|
|
364
|
-
await this.
|
|
372
|
+
await this._animateSlides(slide, this._activeSlide, dir);
|
|
365
373
|
return true;
|
|
366
374
|
}
|
|
367
|
-
|
|
375
|
+
_renderNavigation() {
|
|
368
376
|
return html `
|
|
369
377
|
<igc-button
|
|
370
378
|
${ref(this._prevButtonRef)}
|
|
@@ -373,7 +381,7 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
373
381
|
aria-label="Previous slide"
|
|
374
382
|
aria-controls=${this._carouselId}
|
|
375
383
|
?disabled=${this.disableLoop && this.current === 0}
|
|
376
|
-
@click=${this.
|
|
384
|
+
@click=${this._handleNavigationInteractionPrevious}
|
|
377
385
|
>
|
|
378
386
|
<slot name="previous-button">
|
|
379
387
|
<igc-icon
|
|
@@ -383,6 +391,7 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
383
391
|
></igc-icon>
|
|
384
392
|
</slot>
|
|
385
393
|
</igc-button>
|
|
394
|
+
|
|
386
395
|
<igc-button
|
|
387
396
|
${ref(this._nextButtonRef)}
|
|
388
397
|
type="button"
|
|
@@ -390,7 +399,7 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
390
399
|
aria-label="Next slide"
|
|
391
400
|
aria-controls=${this._carouselId}
|
|
392
401
|
?disabled=${this.disableLoop && this.current === this.total - 1}
|
|
393
|
-
@click=${this.
|
|
402
|
+
@click=${this._handleNavigationInteractionNext}
|
|
394
403
|
>
|
|
395
404
|
<slot name="next-button">
|
|
396
405
|
<igc-icon
|
|
@@ -402,8 +411,8 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
402
411
|
</igc-button>
|
|
403
412
|
`;
|
|
404
413
|
}
|
|
405
|
-
*
|
|
406
|
-
for (const [i, slide] of this.
|
|
414
|
+
*_renderIndicators() {
|
|
415
|
+
for (const [i, slide] of this._slides.entries()) {
|
|
407
416
|
const forward = slide.active ? 'visible' : 'hidden';
|
|
408
417
|
const backward = slide.active ? 'hidden' : 'visible';
|
|
409
418
|
yield html `
|
|
@@ -425,7 +434,7 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
425
434
|
`;
|
|
426
435
|
}
|
|
427
436
|
}
|
|
428
|
-
|
|
437
|
+
_renderIndicatorContainer() {
|
|
429
438
|
const parts = {
|
|
430
439
|
indicators: true,
|
|
431
440
|
start: this.indicatorsOrientation === 'start',
|
|
@@ -437,20 +446,16 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
437
446
|
role="tablist"
|
|
438
447
|
part=${partMap(parts)}
|
|
439
448
|
>
|
|
440
|
-
<slot
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
>
|
|
445
|
-
${this.hasProjectedIndicators
|
|
446
|
-
? this.updateProjectedIndicators()
|
|
447
|
-
: this.renderIndicators()}
|
|
449
|
+
<slot name="indicator" @click=${this._handleIndicatorClick}>
|
|
450
|
+
${cache(this._hasProjectedIndicators
|
|
451
|
+
? this._updateProjectedIndicators()
|
|
452
|
+
: this._renderIndicators())}
|
|
448
453
|
</slot>
|
|
449
454
|
</div>
|
|
450
455
|
</igc-carousel-indicator-container>
|
|
451
456
|
`;
|
|
452
457
|
}
|
|
453
|
-
|
|
458
|
+
_renderLabel() {
|
|
454
459
|
const parts = {
|
|
455
460
|
label: true,
|
|
456
461
|
indicators: true,
|
|
@@ -464,21 +469,19 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
464
469
|
`;
|
|
465
470
|
}
|
|
466
471
|
render() {
|
|
472
|
+
const hasNoIndicators = this.hideIndicators || this._showIndicatorsLabel;
|
|
473
|
+
const hasLabel = !this.hideIndicators && this._showIndicatorsLabel;
|
|
467
474
|
return html `
|
|
468
|
-
<section
|
|
469
|
-
${this.hideNavigation ? nothing : this.
|
|
470
|
-
${
|
|
471
|
-
|
|
472
|
-
: this.indicatorTemplate()}
|
|
473
|
-
${!this.hideIndicators && this.showIndicatorsLabel
|
|
474
|
-
? this.labelTemplate()
|
|
475
|
-
: nothing}
|
|
475
|
+
<section>
|
|
476
|
+
${cache(this.hideNavigation ? nothing : this._renderNavigation())}
|
|
477
|
+
${hasNoIndicators ? nothing : this._renderIndicatorContainer()}
|
|
478
|
+
${hasLabel ? this._renderLabel() : nothing}
|
|
476
479
|
<div
|
|
477
480
|
${ref(this._carouselSlidesContainerRef)}
|
|
478
481
|
id=${this._carouselId}
|
|
479
|
-
aria-live=${this.interval && this.
|
|
482
|
+
aria-live=${this.interval && this._playing ? 'off' : 'polite'}
|
|
480
483
|
>
|
|
481
|
-
<slot
|
|
484
|
+
<slot></slot>
|
|
482
485
|
</div>
|
|
483
486
|
</section>
|
|
484
487
|
`;
|
|
@@ -486,17 +489,7 @@ class IgcCarouselComponent extends EventEmitterMixin(LitElement) {
|
|
|
486
489
|
}
|
|
487
490
|
IgcCarouselComponent.styles = [styles, shared];
|
|
488
491
|
IgcCarouselComponent.tagName = 'igc-carousel';
|
|
489
|
-
IgcCarouselComponent.increment = createCounter();
|
|
490
492
|
export default IgcCarouselComponent;
|
|
491
|
-
__decorate([
|
|
492
|
-
queryAll(IgcCarouselIndicatorComponent.tagName)
|
|
493
|
-
], IgcCarouselComponent.prototype, "_defaultIndicators", void 0);
|
|
494
|
-
__decorate([
|
|
495
|
-
queryAssignedElements({
|
|
496
|
-
selector: IgcCarouselIndicatorComponent.tagName,
|
|
497
|
-
slot: 'indicator',
|
|
498
|
-
})
|
|
499
|
-
], IgcCarouselComponent.prototype, "_projectedIndicators", void 0);
|
|
500
493
|
__decorate([
|
|
501
494
|
state()
|
|
502
495
|
], IgcCarouselComponent.prototype, "_activeSlide", void 0);
|
|
@@ -504,8 +497,8 @@ __decorate([
|
|
|
504
497
|
state()
|
|
505
498
|
], IgcCarouselComponent.prototype, "_playing", void 0);
|
|
506
499
|
__decorate([
|
|
507
|
-
|
|
508
|
-
], IgcCarouselComponent.prototype, "
|
|
500
|
+
queryAll(IgcCarouselIndicatorComponent.tagName)
|
|
501
|
+
], IgcCarouselComponent.prototype, "_defaultIndicators", void 0);
|
|
509
502
|
__decorate([
|
|
510
503
|
property({ type: Boolean, reflect: true, attribute: 'disable-loop' })
|
|
511
504
|
], IgcCarouselComponent.prototype, "disableLoop", void 0);
|
|
@@ -526,7 +519,7 @@ __decorate([
|
|
|
526
519
|
property({ type: Boolean, reflect: true })
|
|
527
520
|
], IgcCarouselComponent.prototype, "vertical", void 0);
|
|
528
521
|
__decorate([
|
|
529
|
-
property({
|
|
522
|
+
property({ attribute: 'indicators-orientation' })
|
|
530
523
|
], IgcCarouselComponent.prototype, "indicatorsOrientation", void 0);
|
|
531
524
|
__decorate([
|
|
532
525
|
property({ attribute: 'indicators-label-format' })
|
|
@@ -535,27 +528,20 @@ __decorate([
|
|
|
535
528
|
property({ attribute: 'slides-label-format' })
|
|
536
529
|
], IgcCarouselComponent.prototype, "slidesLabelFormat", void 0);
|
|
537
530
|
__decorate([
|
|
538
|
-
property({ type: Number
|
|
531
|
+
property({ type: Number })
|
|
539
532
|
], IgcCarouselComponent.prototype, "interval", void 0);
|
|
540
533
|
__decorate([
|
|
541
|
-
property({
|
|
542
|
-
type: Number,
|
|
543
|
-
reflect: false,
|
|
544
|
-
attribute: 'maximum-indicators-count',
|
|
545
|
-
})
|
|
534
|
+
property({ type: Number, attribute: 'maximum-indicators-count' })
|
|
546
535
|
], IgcCarouselComponent.prototype, "maximumIndicatorsCount", void 0);
|
|
547
536
|
__decorate([
|
|
548
537
|
property({ attribute: 'animation-type' })
|
|
549
538
|
], IgcCarouselComponent.prototype, "animationType", void 0);
|
|
550
|
-
__decorate([
|
|
551
|
-
queryAssignedElements({ selector: IgcCarouselSlideComponent.tagName })
|
|
552
|
-
], IgcCarouselComponent.prototype, "slides", void 0);
|
|
553
539
|
__decorate([
|
|
554
540
|
watch('animationType'),
|
|
555
541
|
watch('slidesLabelFormat'),
|
|
556
542
|
watch('indicatorsLabelFormat')
|
|
557
|
-
], IgcCarouselComponent.prototype, "
|
|
543
|
+
], IgcCarouselComponent.prototype, "_contextChanged", null);
|
|
558
544
|
__decorate([
|
|
559
545
|
watch('interval')
|
|
560
|
-
], IgcCarouselComponent.prototype, "
|
|
546
|
+
], IgcCarouselComponent.prototype, "_intervalChange", null);
|
|
561
547
|
//# sourceMappingURL=carousel.js.map
|