blob: 85b95148da433c02560ccd839ed40b59caf8991f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import { isSome } from "@jet/environment/types/optional";
import * as models from "./index";
/** @public */
export class HeroCarouselItemOverlay extends models.ViewModel {
isValid() {
const hasButtonRequirements = this.callToActionText !== undefined &&
this.callToActionText !== null &&
this.clickAction !== undefined &&
this.clickAction !== null;
const hasTitle = this.titleText !== undefined && this.titleText !== null;
const hasLockupRequirements = this.lockup !== undefined && this.lockup !== null;
const hasCollectionIcons = this.collectionIcons !== undefined && this.collectionIcons !== null;
return hasTitle && (hasLockupRequirements || hasCollectionIcons || hasButtonRequirements);
}
}
/** @public */
export class HeroCarouselItem extends models.ViewModel {
isValid() {
const hasCollectionIcons = isSome(this.collectionIcons) && this.collectionIcons.length > 0;
const hasValidArtwork = isSome(this.artwork) && this.artwork.isValid();
const hasValidVideo = isSome(this.video) && this.video.isValid();
const hasMedia = hasValidArtwork || hasValidVideo || hasCollectionIcons;
const hasOverlay = isSome(this.overlay) && this.overlay.isValid();
return hasMedia && hasOverlay;
}
}
/** @public */
export class HeroCarousel extends models.ViewModel {
constructor() {
super(...arguments);
/// The different items to display in the carousel
this.items = [];
/// The different items to display in the carousel, in RTL
this.rtlItems = [];
}
}
//# sourceMappingURL=hero-carousel.js.map
|