luxen-ui 0.1.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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/css/elements/avatar.css +20 -0
- package/dist/css/elements/badge.css +159 -0
- package/dist/css/elements/button.css +171 -0
- package/dist/css/elements/close-button/circle.css +66 -0
- package/dist/css/elements/close-button/ring.css +71 -0
- package/dist/css/elements/close-button/square.css +70 -0
- package/dist/css/elements/disclosure.css +137 -0
- package/dist/css/elements/divider.css +75 -0
- package/dist/css/elements/input-otp.css +164 -0
- package/dist/css/elements/input-stepper/default.css +245 -0
- package/dist/css/elements/input-stepper/rounded.css +238 -0
- package/dist/css/elements/kbd.css +21 -0
- package/dist/css/elements/progress.css +114 -0
- package/dist/css/elements/select.css +71 -0
- package/dist/css/elements/skeleton.css +89 -0
- package/dist/css/elements/tabs/enclosed.css +148 -0
- package/dist/css/elements/tabs/line.css +138 -0
- package/dist/css/elements/toast.css +260 -0
- package/dist/css/index.css +885 -0
- package/dist/custom-elements.json +14424 -0
- package/dist/define.d.ts +9 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +16 -0
- package/dist/elements/avatar/avatar.css +128 -0
- package/dist/elements/avatar/avatar.d.ts +21 -0
- package/dist/elements/avatar/avatar.d.ts.map +1 -0
- package/dist/elements/avatar/avatar.js +106 -0
- package/dist/elements/avatar/index.d.ts +8 -0
- package/dist/elements/avatar/index.d.ts.map +1 -0
- package/dist/elements/avatar/index.js +4 -0
- package/dist/elements/badge/badge.d.ts +17 -0
- package/dist/elements/badge/badge.d.ts.map +1 -0
- package/dist/elements/badge/badge.js +34 -0
- package/dist/elements/badge/index.d.ts +8 -0
- package/dist/elements/badge/index.d.ts.map +1 -0
- package/dist/elements/badge/index.js +4 -0
- package/dist/elements/carousel/carousel.css +205 -0
- package/dist/elements/carousel/carousel.d.ts +148 -0
- package/dist/elements/carousel/carousel.d.ts.map +1 -0
- package/dist/elements/carousel/carousel.js +473 -0
- package/dist/elements/carousel/index.d.ts +8 -0
- package/dist/elements/carousel/index.d.ts.map +1 -0
- package/dist/elements/carousel/index.js +4 -0
- package/dist/elements/carousel-item/carousel-item.css +11 -0
- package/dist/elements/carousel-item/carousel-item.d.ts +13 -0
- package/dist/elements/carousel-item/carousel-item.d.ts.map +1 -0
- package/dist/elements/carousel-item/carousel-item.js +20 -0
- package/dist/elements/carousel-item/index.d.ts +8 -0
- package/dist/elements/carousel-item/index.d.ts.map +1 -0
- package/dist/elements/carousel-item/index.js +4 -0
- package/dist/elements/dialog/dialog.css +92 -0
- package/dist/elements/dialog/dialog.d.ts +56 -0
- package/dist/elements/dialog/dialog.d.ts.map +1 -0
- package/dist/elements/dialog/dialog.js +204 -0
- package/dist/elements/dialog/dialog.styles.d.ts +8 -0
- package/dist/elements/dialog/dialog.styles.d.ts.map +1 -0
- package/dist/elements/dialog/dialog.styles.js +8 -0
- package/dist/elements/dialog/index.d.ts +8 -0
- package/dist/elements/dialog/index.d.ts.map +1 -0
- package/dist/elements/dialog/index.js +4 -0
- package/dist/elements/divider/divider.d.ts +23 -0
- package/dist/elements/divider/divider.d.ts.map +1 -0
- package/dist/elements/divider/divider.js +49 -0
- package/dist/elements/divider/index.d.ts +8 -0
- package/dist/elements/divider/index.d.ts.map +1 -0
- package/dist/elements/divider/index.js +4 -0
- package/dist/elements/drawer/drawer.css +66 -0
- package/dist/elements/drawer/drawer.d.ts +34 -0
- package/dist/elements/drawer/drawer.d.ts.map +1 -0
- package/dist/elements/drawer/drawer.js +46 -0
- package/dist/elements/drawer/index.d.ts +8 -0
- package/dist/elements/drawer/index.d.ts.map +1 -0
- package/dist/elements/drawer/index.js +4 -0
- package/dist/elements/dropdown/dropdown.css +31 -0
- package/dist/elements/dropdown/dropdown.d.ts +64 -0
- package/dist/elements/dropdown/dropdown.d.ts.map +1 -0
- package/dist/elements/dropdown/dropdown.js +322 -0
- package/dist/elements/dropdown/index.d.ts +8 -0
- package/dist/elements/dropdown/index.d.ts.map +1 -0
- package/dist/elements/dropdown/index.js +4 -0
- package/dist/elements/dropdown-item/dropdown-item.css +51 -0
- package/dist/elements/dropdown-item/dropdown-item.d.ts +25 -0
- package/dist/elements/dropdown-item/dropdown-item.d.ts.map +1 -0
- package/dist/elements/dropdown-item/dropdown-item.js +110 -0
- package/dist/elements/dropdown-item/index.d.ts +8 -0
- package/dist/elements/dropdown-item/index.d.ts.map +1 -0
- package/dist/elements/dropdown-item/index.js +4 -0
- package/dist/elements/icon/icon.css +10 -0
- package/dist/elements/icon/icon.d.ts +19 -0
- package/dist/elements/icon/icon.d.ts.map +1 -0
- package/dist/elements/icon/icon.js +53 -0
- package/dist/elements/icon/index.d.ts +8 -0
- package/dist/elements/icon/index.d.ts.map +1 -0
- package/dist/elements/icon/index.js +4 -0
- package/dist/elements/input-otp/index.d.ts +8 -0
- package/dist/elements/input-otp/index.d.ts.map +1 -0
- package/dist/elements/input-otp/index.js +4 -0
- package/dist/elements/input-otp/input-otp.d.ts +31 -0
- package/dist/elements/input-otp/input-otp.d.ts.map +1 -0
- package/dist/elements/input-otp/input-otp.js +139 -0
- package/dist/elements/input-stepper/index.d.ts +8 -0
- package/dist/elements/input-stepper/index.d.ts.map +1 -0
- package/dist/elements/input-stepper/index.js +4 -0
- package/dist/elements/input-stepper/input-stepper.d.ts +63 -0
- package/dist/elements/input-stepper/input-stepper.d.ts.map +1 -0
- package/dist/elements/input-stepper/input-stepper.js +249 -0
- package/dist/elements/popover/index.d.ts +8 -0
- package/dist/elements/popover/index.d.ts.map +1 -0
- package/dist/elements/popover/index.js +4 -0
- package/dist/elements/popover/popover.css +61 -0
- package/dist/elements/popover/popover.d.ts +62 -0
- package/dist/elements/popover/popover.d.ts.map +1 -0
- package/dist/elements/popover/popover.js +244 -0
- package/dist/elements/rating/index.d.ts +8 -0
- package/dist/elements/rating/index.d.ts.map +1 -0
- package/dist/elements/rating/index.js +4 -0
- package/dist/elements/rating/rating.css +102 -0
- package/dist/elements/rating/rating.d.ts +38 -0
- package/dist/elements/rating/rating.d.ts.map +1 -0
- package/dist/elements/rating/rating.js +193 -0
- package/dist/elements/skeleton/index.d.ts +8 -0
- package/dist/elements/skeleton/index.d.ts.map +1 -0
- package/dist/elements/skeleton/index.js +4 -0
- package/dist/elements/skeleton/skeleton.d.ts +12 -0
- package/dist/elements/skeleton/skeleton.d.ts.map +1 -0
- package/dist/elements/skeleton/skeleton.js +13 -0
- package/dist/elements/spinner/index.d.ts +8 -0
- package/dist/elements/spinner/index.d.ts.map +1 -0
- package/dist/elements/spinner/index.js +4 -0
- package/dist/elements/spinner/spinner.css +28 -0
- package/dist/elements/spinner/spinner.d.ts +16 -0
- package/dist/elements/spinner/spinner.d.ts.map +1 -0
- package/dist/elements/spinner/spinner.js +37 -0
- package/dist/elements/tabs/index.d.ts +8 -0
- package/dist/elements/tabs/index.d.ts.map +1 -0
- package/dist/elements/tabs/index.js +4 -0
- package/dist/elements/tabs/tabs.d.ts +48 -0
- package/dist/elements/tabs/tabs.d.ts.map +1 -0
- package/dist/elements/tabs/tabs.js +210 -0
- package/dist/elements/toast/index.d.ts +9 -0
- package/dist/elements/toast/index.d.ts.map +1 -0
- package/dist/elements/toast/index.js +5 -0
- package/dist/elements/toast/toast.d.ts +72 -0
- package/dist/elements/toast/toast.d.ts.map +1 -0
- package/dist/elements/toast/toast.js +375 -0
- package/dist/elements/tooltip/index.d.ts +8 -0
- package/dist/elements/tooltip/index.d.ts.map +1 -0
- package/dist/elements/tooltip/index.js +4 -0
- package/dist/elements/tooltip/tooltip.css +37 -0
- package/dist/elements/tooltip/tooltip.d.ts +59 -0
- package/dist/elements/tooltip/tooltip.d.ts.map +1 -0
- package/dist/elements/tooltip/tooltip.js +231 -0
- package/dist/elements/tree/index.d.ts +8 -0
- package/dist/elements/tree/index.d.ts.map +1 -0
- package/dist/elements/tree/index.js +4 -0
- package/dist/elements/tree/tree.css +26 -0
- package/dist/elements/tree/tree.d.ts +76 -0
- package/dist/elements/tree/tree.d.ts.map +1 -0
- package/dist/elements/tree/tree.js +432 -0
- package/dist/elements/tree-item/index.d.ts +8 -0
- package/dist/elements/tree-item/index.d.ts.map +1 -0
- package/dist/elements/tree-item/index.js +4 -0
- package/dist/elements/tree-item/tree-item.css +172 -0
- package/dist/elements/tree-item/tree-item.d.ts +74 -0
- package/dist/elements/tree-item/tree-item.d.ts.map +1 -0
- package/dist/elements/tree-item/tree-item.js +301 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/registry.d.ts +22 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +33 -0
- package/dist/shared/controllers/popover.d.ts +44 -0
- package/dist/shared/controllers/popover.d.ts.map +1 -0
- package/dist/shared/controllers/popover.js +359 -0
- package/dist/shared/luxen-element.d.ts +20 -0
- package/dist/shared/luxen-element.d.ts.map +1 -0
- package/dist/shared/luxen-element.js +23 -0
- package/dist/shared/luxen-form-associated-element.d.ts +49 -0
- package/dist/shared/luxen-form-associated-element.d.ts.map +1 -0
- package/dist/shared/luxen-form-associated-element.js +123 -0
- package/dist/shared/styles/host.css +13 -0
- package/dist/shared/styles/host.styles.d.ts +9 -0
- package/dist/shared/styles/host.styles.d.ts.map +1 -0
- package/dist/shared/styles/host.styles.js +9 -0
- package/dist/skills/luxen-ui/SKILL.md +82 -0
- package/dist/skills/luxen-ui/references/avatar.md +259 -0
- package/dist/skills/luxen-ui/references/badge.md +289 -0
- package/dist/skills/luxen-ui/references/button.md +309 -0
- package/dist/skills/luxen-ui/references/close-button.md +104 -0
- package/dist/skills/luxen-ui/references/dialog.md +435 -0
- package/dist/skills/luxen-ui/references/drawer.md +400 -0
- package/dist/skills/luxen-ui/references/progress.md +133 -0
- package/dist/skills/luxen-ui/references/select.md +100 -0
- package/dist/skills/luxen-ui/references/toast.md +396 -0
- package/dist/skills/luxen-ui/references/tree.md +359 -0
- package/package.json +116 -0
- package/postcss-plugin-prefix.js +63 -0
- package/vite-plugin.ts +29 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { EmblaCarouselType, EmblaOptionsType } from 'embla-carousel';
|
|
2
|
+
type AxisOptionType = 'x' | 'y';
|
|
3
|
+
type AlignmentOptionType = 'start' | 'center' | 'end' | ((viewSize: number, snapSize: number, index: number) => number);
|
|
4
|
+
type SlidesToScrollOptionType = 'auto' | number;
|
|
5
|
+
type ScrollContainOptionType = 'trimSnaps' | 'keepSnaps' | false;
|
|
6
|
+
import { type PropertyValues, type CSSResultGroup } from 'lit';
|
|
7
|
+
import { LuxenElement } from '../../shared/luxen-element';
|
|
8
|
+
/**
|
|
9
|
+
* Carousel custom element based on Embla Carousel.
|
|
10
|
+
*
|
|
11
|
+
* @csspart viewport - The carousel viewport container.
|
|
12
|
+
* @csspart container - The slides container slot.
|
|
13
|
+
* @csspart scroll-buttons - The scroll buttons wrapper.
|
|
14
|
+
* @csspart button - Any navigation button.
|
|
15
|
+
* @csspart button-previous - The previous slide navigation button.
|
|
16
|
+
* @csspart button-next - The next slide navigation button.
|
|
17
|
+
* @csspart button-dot - Any dot navigation button.
|
|
18
|
+
* @csspart dots - The dots navigation wrapper.
|
|
19
|
+
* @csspart button-fullscreen - The fullscreen button.
|
|
20
|
+
* @csspart button-icon - Any button icon SVG.
|
|
21
|
+
*
|
|
22
|
+
* @cssproperty --slide-height - Height of slides in vertical axis mode.
|
|
23
|
+
* @cssproperty --slide-size - Width of each slide (e.g. `100%`, `calc(100% / 3)`).
|
|
24
|
+
* @cssproperty --slide-gap - Gap between slides.
|
|
25
|
+
* @cssproperty --button-size - Size of navigation buttons.
|
|
26
|
+
* @cssproperty --button-arrow-size - Size of arrow icons inside buttons.
|
|
27
|
+
* @cssproperty --button-arrow-color - Color of arrow icons.
|
|
28
|
+
* @cssproperty --button-offset - Offset of inside-positioned buttons from edges.
|
|
29
|
+
* @cssproperty --button-border-color - Border color of buttons.
|
|
30
|
+
* @cssproperty --button-border-radius - Border radius of buttons.
|
|
31
|
+
* @cssproperty --button-bg - Background color of buttons.
|
|
32
|
+
* @cssproperty --button-color - Text/icon color of buttons.
|
|
33
|
+
* @cssproperty --dot-color - Color of inactive dots.
|
|
34
|
+
* @cssproperty --dot-color-active - Color of active dot.
|
|
35
|
+
* @cssproperty --dot-margin - Margin around dots container.
|
|
36
|
+
*/
|
|
37
|
+
export declare class LuxenCarousel extends LuxenElement {
|
|
38
|
+
static styles: CSSResultGroup;
|
|
39
|
+
embla: EmblaCarouselType;
|
|
40
|
+
/**
|
|
41
|
+
* Choose a delay between transitions in milliseconds (default: 4000).
|
|
42
|
+
*/
|
|
43
|
+
accessor autoplay: number;
|
|
44
|
+
/**
|
|
45
|
+
* Configure autoplay options.
|
|
46
|
+
*
|
|
47
|
+
* @link https://www.embla-carousel.com/plugins/autoplay/#options
|
|
48
|
+
*/
|
|
49
|
+
accessor autoplayOptions: any;
|
|
50
|
+
/**
|
|
51
|
+
* Choose scroll axis between x and y.
|
|
52
|
+
*
|
|
53
|
+
* @link https://www.embla-carousel.com/api/options/#axis
|
|
54
|
+
*/
|
|
55
|
+
accessor axis: AxisOptionType;
|
|
56
|
+
/**
|
|
57
|
+
* Align the slides relative to the carousel viewport.
|
|
58
|
+
*
|
|
59
|
+
* @link https://www.embla-carousel.com/api/options/#align
|
|
60
|
+
*/
|
|
61
|
+
accessor align: AlignmentOptionType;
|
|
62
|
+
/**
|
|
63
|
+
* Breakpoint overrides for options.
|
|
64
|
+
*/
|
|
65
|
+
accessor breakpoints: any;
|
|
66
|
+
/**
|
|
67
|
+
* Enables infinite looping.
|
|
68
|
+
*
|
|
69
|
+
* @link https://www.embla-carousel.com/api/options/#loop
|
|
70
|
+
*/
|
|
71
|
+
accessor loop: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Enables momentum scrolling (drag free).
|
|
74
|
+
*
|
|
75
|
+
* @link https://www.embla-carousel.com/api/options/#dragfree
|
|
76
|
+
*/
|
|
77
|
+
accessor dragFree: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Set scroll duration when triggered by API methods.
|
|
80
|
+
*
|
|
81
|
+
* @link https://www.embla-carousel.com/api/options/#duration
|
|
82
|
+
*/
|
|
83
|
+
accessor duration: number;
|
|
84
|
+
/**
|
|
85
|
+
* Allow skipping scroll snaps on vigorous drag.
|
|
86
|
+
*
|
|
87
|
+
* @link https://www.embla-carousel.com/api/options/#skipsnaps
|
|
88
|
+
*/
|
|
89
|
+
accessor skipSnaps: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Group slides together for navigation.
|
|
92
|
+
*
|
|
93
|
+
* @link https://www.embla-carousel.com/api/options/#slidestoscroll
|
|
94
|
+
*/
|
|
95
|
+
accessor slidesToScroll: SlidesToScrollOptionType;
|
|
96
|
+
/**
|
|
97
|
+
* Set the initial scroll snap index.
|
|
98
|
+
*
|
|
99
|
+
* @link https://www.embla-carousel.com/api/options/#startindex
|
|
100
|
+
*/
|
|
101
|
+
accessor startIndex: number;
|
|
102
|
+
/**
|
|
103
|
+
* Clear leading and trailing empty space.
|
|
104
|
+
*
|
|
105
|
+
* @link https://www.embla-carousel.com/api/options/#containscroll
|
|
106
|
+
*/
|
|
107
|
+
accessor containScroll: ScrollContainOptionType;
|
|
108
|
+
accessor single: boolean;
|
|
109
|
+
accessor withDots: boolean;
|
|
110
|
+
accessor withScrollbar: boolean;
|
|
111
|
+
accessor withFullscreen: boolean;
|
|
112
|
+
accessor dotAppearance: 'circle' | 'bar';
|
|
113
|
+
accessor scrollButtonsPosition: 'inside' | 'outside';
|
|
114
|
+
scrollButtons: HTMLElement;
|
|
115
|
+
previousBtn: HTMLButtonElement;
|
|
116
|
+
nextBtn: HTMLButtonElement;
|
|
117
|
+
container: HTMLSlotElement;
|
|
118
|
+
dotNodes: HTMLButtonElement[];
|
|
119
|
+
constructor();
|
|
120
|
+
connectedCallback(): void;
|
|
121
|
+
disconnectedCallback(): void;
|
|
122
|
+
protected firstUpdated(): void;
|
|
123
|
+
protected createEmbla(): void;
|
|
124
|
+
protected onSlidesInView(): void;
|
|
125
|
+
protected onInit(): void;
|
|
126
|
+
protected onReInit(): void;
|
|
127
|
+
protected onSelect(): void;
|
|
128
|
+
protected onResize(): void;
|
|
129
|
+
protected attachEventListeners(): void;
|
|
130
|
+
protected detachEventListeners(): void;
|
|
131
|
+
protected updateNavigation(): void;
|
|
132
|
+
updated(changedProperties: PropertyValues<this>): Promise<void>;
|
|
133
|
+
private initAutoplay;
|
|
134
|
+
private handleSlotChange;
|
|
135
|
+
private handleDotClick;
|
|
136
|
+
options(): EmblaOptionsType;
|
|
137
|
+
next(): void;
|
|
138
|
+
previous(): void;
|
|
139
|
+
goToSlide(index: number, jump?: boolean): void;
|
|
140
|
+
slideNodes(): void;
|
|
141
|
+
slidesInView(): void;
|
|
142
|
+
isActive(): boolean;
|
|
143
|
+
renderFullscreenButton(): import("lit").TemplateResult<1>;
|
|
144
|
+
renderNextPreviousButtons(): import("lit").TemplateResult<1>;
|
|
145
|
+
render(): import("lit").TemplateResult<1>;
|
|
146
|
+
}
|
|
147
|
+
export {};
|
|
148
|
+
//# sourceMappingURL=carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/html/elements/carousel/carousel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG1E,KAAK,cAAc,GAAG,GAAG,GAAG,GAAG,CAAC;AAChC,KAAK,mBAAmB,GACpB,OAAO,GACP,QAAQ,GACR,KAAK,GACL,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;AACpE,KAAK,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAChD,KAAK,uBAAuB,GAAG,WAAW,GAAG,WAAW,GAAG,KAAK,CAAC;AAEjE,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGhF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAgB,MAAM,EAAE,cAAc,CAAwB;IAE9D,KAAK,EAAG,iBAAiB,CAAC;IAE1B;;OAEG;IAEH,QAAQ,CAAC,QAAQ,SAAK;IAEtB;;;;OAIG;IAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC;IAE9B;;;;OAIG;IAEH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAO;IAEpC;;;;OAIG;IAEH,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAW;IAE9C;;OAEG;IAEH,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAM;IAE/B;;;;OAIG;IAEH,QAAQ,CAAC,IAAI,UAAS;IAEtB;;;;OAIG;IAEH,QAAQ,CAAC,QAAQ,UAAS;IAE1B;;;;OAIG;IAEH,QAAQ,CAAC,QAAQ,SAAM;IAEvB;;;;OAIG;IAEH,QAAQ,CAAC,SAAS,UAAS;IAE3B;;;;OAIG;IAEH,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAK;IAEtD;;;;OAIG;IAEH,QAAQ,CAAC,UAAU,SAAK;IAExB;;;;OAIG;IAEH,QAAQ,CAAC,aAAa,EAAE,uBAAuB,CAAe;IAG9D,QAAQ,CAAC,MAAM,UAAS;IAGxB,QAAQ,CAAC,QAAQ,UAAS;IAG1B,QAAQ,CAAC,aAAa,UAAS;IAG/B,QAAQ,CAAC,cAAc,UAAS;IAGhC,QAAQ,CAAC,aAAa,EAAE,QAAQ,GAAG,KAAK,CAAS;IAGjD,QAAQ,CAAC,qBAAqB,EAAE,QAAQ,GAAG,SAAS,CAAY;IAEtC,aAAa,EAAG,WAAW,CAAC;IAC3B,WAAW,EAAG,iBAAiB,CAAC;IACpC,OAAO,EAAG,iBAAiB,CAAC;IAC9B,SAAS,EAAG,eAAe,CAAC;IAC/B,QAAQ,EAAG,iBAAiB,EAAE,CAAC;;IAcxC,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB;cAOV,YAAY,IAAI,IAAI;IAIvC,SAAS,CAAC,WAAW;IAWrB,SAAS,CAAC,cAAc;IAMxB,SAAS,CAAC,MAAM;IAIhB,SAAS,CAAC,QAAQ;IAKlB,SAAS,CAAC,QAAQ;IAOlB,SAAS,CAAC,QAAQ;IAIlB,SAAS,CAAC,oBAAoB;IAK9B,SAAS,CAAC,oBAAoB;IAK9B,SAAS,CAAC,gBAAgB;IAiBX,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAM9D,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,cAAc;IAKtB,OAAO,IAAI,gBAAgB;IA0B3B,IAAI;IAIJ,QAAQ;IAIR,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO;IAIvC,UAAU;IAIV,YAAY;IAIZ,QAAQ;IAIR,sBAAsB;IAoBtB,yBAAyB;IAyChB,MAAM;CAuChB"}
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
+
};
|
|
18
|
+
var _LuxenCarousel_autoplay_accessor_storage, _LuxenCarousel_autoplayOptions_accessor_storage, _LuxenCarousel_axis_accessor_storage, _LuxenCarousel_align_accessor_storage, _LuxenCarousel_breakpoints_accessor_storage, _LuxenCarousel_loop_accessor_storage, _LuxenCarousel_dragFree_accessor_storage, _LuxenCarousel_duration_accessor_storage, _LuxenCarousel_skipSnaps_accessor_storage, _LuxenCarousel_slidesToScroll_accessor_storage, _LuxenCarousel_startIndex_accessor_storage, _LuxenCarousel_containScroll_accessor_storage, _LuxenCarousel_single_accessor_storage, _LuxenCarousel_withDots_accessor_storage, _LuxenCarousel_withScrollbar_accessor_storage, _LuxenCarousel_withFullscreen_accessor_storage, _LuxenCarousel_dotAppearance_accessor_storage, _LuxenCarousel_scrollButtonsPosition_accessor_storage;
|
|
19
|
+
import EmblaCarousel from 'embla-carousel';
|
|
20
|
+
import Autoplay from 'embla-carousel-autoplay';
|
|
21
|
+
import { html, unsafeCSS } from 'lit';
|
|
22
|
+
import { property, query, queryAll } from 'lit/decorators.js';
|
|
23
|
+
import { map } from 'lit/directives/map.js';
|
|
24
|
+
import { LuxenElement } from '../../shared/luxen-element';
|
|
25
|
+
import hostStyles from '../../shared/styles/host.styles';
|
|
26
|
+
import rawStyles from './carousel.css?inline';
|
|
27
|
+
const styles = unsafeCSS(rawStyles);
|
|
28
|
+
/**
|
|
29
|
+
* Carousel custom element based on Embla Carousel.
|
|
30
|
+
*
|
|
31
|
+
* @csspart viewport - The carousel viewport container.
|
|
32
|
+
* @csspart container - The slides container slot.
|
|
33
|
+
* @csspart scroll-buttons - The scroll buttons wrapper.
|
|
34
|
+
* @csspart button - Any navigation button.
|
|
35
|
+
* @csspart button-previous - The previous slide navigation button.
|
|
36
|
+
* @csspart button-next - The next slide navigation button.
|
|
37
|
+
* @csspart button-dot - Any dot navigation button.
|
|
38
|
+
* @csspart dots - The dots navigation wrapper.
|
|
39
|
+
* @csspart button-fullscreen - The fullscreen button.
|
|
40
|
+
* @csspart button-icon - Any button icon SVG.
|
|
41
|
+
*
|
|
42
|
+
* @cssproperty --slide-height - Height of slides in vertical axis mode.
|
|
43
|
+
* @cssproperty --slide-size - Width of each slide (e.g. `100%`, `calc(100% / 3)`).
|
|
44
|
+
* @cssproperty --slide-gap - Gap between slides.
|
|
45
|
+
* @cssproperty --button-size - Size of navigation buttons.
|
|
46
|
+
* @cssproperty --button-arrow-size - Size of arrow icons inside buttons.
|
|
47
|
+
* @cssproperty --button-arrow-color - Color of arrow icons.
|
|
48
|
+
* @cssproperty --button-offset - Offset of inside-positioned buttons from edges.
|
|
49
|
+
* @cssproperty --button-border-color - Border color of buttons.
|
|
50
|
+
* @cssproperty --button-border-radius - Border radius of buttons.
|
|
51
|
+
* @cssproperty --button-bg - Background color of buttons.
|
|
52
|
+
* @cssproperty --button-color - Text/icon color of buttons.
|
|
53
|
+
* @cssproperty --dot-color - Color of inactive dots.
|
|
54
|
+
* @cssproperty --dot-color-active - Color of active dot.
|
|
55
|
+
* @cssproperty --dot-margin - Margin around dots container.
|
|
56
|
+
*/
|
|
57
|
+
export class LuxenCarousel extends LuxenElement {
|
|
58
|
+
/**
|
|
59
|
+
* Choose a delay between transitions in milliseconds (default: 4000).
|
|
60
|
+
*/
|
|
61
|
+
get autoplay() { return __classPrivateFieldGet(this, _LuxenCarousel_autoplay_accessor_storage, "f"); }
|
|
62
|
+
set autoplay(value) { __classPrivateFieldSet(this, _LuxenCarousel_autoplay_accessor_storage, value, "f"); }
|
|
63
|
+
/**
|
|
64
|
+
* Configure autoplay options.
|
|
65
|
+
*
|
|
66
|
+
* @link https://www.embla-carousel.com/plugins/autoplay/#options
|
|
67
|
+
*/
|
|
68
|
+
get autoplayOptions() { return __classPrivateFieldGet(this, _LuxenCarousel_autoplayOptions_accessor_storage, "f"); }
|
|
69
|
+
set autoplayOptions(value) { __classPrivateFieldSet(this, _LuxenCarousel_autoplayOptions_accessor_storage, value, "f"); }
|
|
70
|
+
/**
|
|
71
|
+
* Choose scroll axis between x and y.
|
|
72
|
+
*
|
|
73
|
+
* @link https://www.embla-carousel.com/api/options/#axis
|
|
74
|
+
*/
|
|
75
|
+
get axis() { return __classPrivateFieldGet(this, _LuxenCarousel_axis_accessor_storage, "f"); }
|
|
76
|
+
set axis(value) { __classPrivateFieldSet(this, _LuxenCarousel_axis_accessor_storage, value, "f"); }
|
|
77
|
+
/**
|
|
78
|
+
* Align the slides relative to the carousel viewport.
|
|
79
|
+
*
|
|
80
|
+
* @link https://www.embla-carousel.com/api/options/#align
|
|
81
|
+
*/
|
|
82
|
+
get align() { return __classPrivateFieldGet(this, _LuxenCarousel_align_accessor_storage, "f"); }
|
|
83
|
+
set align(value) { __classPrivateFieldSet(this, _LuxenCarousel_align_accessor_storage, value, "f"); }
|
|
84
|
+
/**
|
|
85
|
+
* Breakpoint overrides for options.
|
|
86
|
+
*/
|
|
87
|
+
get breakpoints() { return __classPrivateFieldGet(this, _LuxenCarousel_breakpoints_accessor_storage, "f"); }
|
|
88
|
+
set breakpoints(value) { __classPrivateFieldSet(this, _LuxenCarousel_breakpoints_accessor_storage, value, "f"); }
|
|
89
|
+
/**
|
|
90
|
+
* Enables infinite looping.
|
|
91
|
+
*
|
|
92
|
+
* @link https://www.embla-carousel.com/api/options/#loop
|
|
93
|
+
*/
|
|
94
|
+
get loop() { return __classPrivateFieldGet(this, _LuxenCarousel_loop_accessor_storage, "f"); }
|
|
95
|
+
set loop(value) { __classPrivateFieldSet(this, _LuxenCarousel_loop_accessor_storage, value, "f"); }
|
|
96
|
+
/**
|
|
97
|
+
* Enables momentum scrolling (drag free).
|
|
98
|
+
*
|
|
99
|
+
* @link https://www.embla-carousel.com/api/options/#dragfree
|
|
100
|
+
*/
|
|
101
|
+
get dragFree() { return __classPrivateFieldGet(this, _LuxenCarousel_dragFree_accessor_storage, "f"); }
|
|
102
|
+
set dragFree(value) { __classPrivateFieldSet(this, _LuxenCarousel_dragFree_accessor_storage, value, "f"); }
|
|
103
|
+
/**
|
|
104
|
+
* Set scroll duration when triggered by API methods.
|
|
105
|
+
*
|
|
106
|
+
* @link https://www.embla-carousel.com/api/options/#duration
|
|
107
|
+
*/
|
|
108
|
+
get duration() { return __classPrivateFieldGet(this, _LuxenCarousel_duration_accessor_storage, "f"); }
|
|
109
|
+
set duration(value) { __classPrivateFieldSet(this, _LuxenCarousel_duration_accessor_storage, value, "f"); }
|
|
110
|
+
/**
|
|
111
|
+
* Allow skipping scroll snaps on vigorous drag.
|
|
112
|
+
*
|
|
113
|
+
* @link https://www.embla-carousel.com/api/options/#skipsnaps
|
|
114
|
+
*/
|
|
115
|
+
get skipSnaps() { return __classPrivateFieldGet(this, _LuxenCarousel_skipSnaps_accessor_storage, "f"); }
|
|
116
|
+
set skipSnaps(value) { __classPrivateFieldSet(this, _LuxenCarousel_skipSnaps_accessor_storage, value, "f"); }
|
|
117
|
+
/**
|
|
118
|
+
* Group slides together for navigation.
|
|
119
|
+
*
|
|
120
|
+
* @link https://www.embla-carousel.com/api/options/#slidestoscroll
|
|
121
|
+
*/
|
|
122
|
+
get slidesToScroll() { return __classPrivateFieldGet(this, _LuxenCarousel_slidesToScroll_accessor_storage, "f"); }
|
|
123
|
+
set slidesToScroll(value) { __classPrivateFieldSet(this, _LuxenCarousel_slidesToScroll_accessor_storage, value, "f"); }
|
|
124
|
+
/**
|
|
125
|
+
* Set the initial scroll snap index.
|
|
126
|
+
*
|
|
127
|
+
* @link https://www.embla-carousel.com/api/options/#startindex
|
|
128
|
+
*/
|
|
129
|
+
get startIndex() { return __classPrivateFieldGet(this, _LuxenCarousel_startIndex_accessor_storage, "f"); }
|
|
130
|
+
set startIndex(value) { __classPrivateFieldSet(this, _LuxenCarousel_startIndex_accessor_storage, value, "f"); }
|
|
131
|
+
/**
|
|
132
|
+
* Clear leading and trailing empty space.
|
|
133
|
+
*
|
|
134
|
+
* @link https://www.embla-carousel.com/api/options/#containscroll
|
|
135
|
+
*/
|
|
136
|
+
get containScroll() { return __classPrivateFieldGet(this, _LuxenCarousel_containScroll_accessor_storage, "f"); }
|
|
137
|
+
set containScroll(value) { __classPrivateFieldSet(this, _LuxenCarousel_containScroll_accessor_storage, value, "f"); }
|
|
138
|
+
get single() { return __classPrivateFieldGet(this, _LuxenCarousel_single_accessor_storage, "f"); }
|
|
139
|
+
set single(value) { __classPrivateFieldSet(this, _LuxenCarousel_single_accessor_storage, value, "f"); }
|
|
140
|
+
get withDots() { return __classPrivateFieldGet(this, _LuxenCarousel_withDots_accessor_storage, "f"); }
|
|
141
|
+
set withDots(value) { __classPrivateFieldSet(this, _LuxenCarousel_withDots_accessor_storage, value, "f"); }
|
|
142
|
+
get withScrollbar() { return __classPrivateFieldGet(this, _LuxenCarousel_withScrollbar_accessor_storage, "f"); }
|
|
143
|
+
set withScrollbar(value) { __classPrivateFieldSet(this, _LuxenCarousel_withScrollbar_accessor_storage, value, "f"); }
|
|
144
|
+
get withFullscreen() { return __classPrivateFieldGet(this, _LuxenCarousel_withFullscreen_accessor_storage, "f"); }
|
|
145
|
+
set withFullscreen(value) { __classPrivateFieldSet(this, _LuxenCarousel_withFullscreen_accessor_storage, value, "f"); }
|
|
146
|
+
get dotAppearance() { return __classPrivateFieldGet(this, _LuxenCarousel_dotAppearance_accessor_storage, "f"); }
|
|
147
|
+
set dotAppearance(value) { __classPrivateFieldSet(this, _LuxenCarousel_dotAppearance_accessor_storage, value, "f"); }
|
|
148
|
+
get scrollButtonsPosition() { return __classPrivateFieldGet(this, _LuxenCarousel_scrollButtonsPosition_accessor_storage, "f"); }
|
|
149
|
+
set scrollButtonsPosition(value) { __classPrivateFieldSet(this, _LuxenCarousel_scrollButtonsPosition_accessor_storage, value, "f"); }
|
|
150
|
+
constructor() {
|
|
151
|
+
super();
|
|
152
|
+
_LuxenCarousel_autoplay_accessor_storage.set(this, 0);
|
|
153
|
+
_LuxenCarousel_autoplayOptions_accessor_storage.set(this, void 0);
|
|
154
|
+
_LuxenCarousel_axis_accessor_storage.set(this, 'x');
|
|
155
|
+
_LuxenCarousel_align_accessor_storage.set(this, 'start');
|
|
156
|
+
_LuxenCarousel_breakpoints_accessor_storage.set(this, {});
|
|
157
|
+
_LuxenCarousel_loop_accessor_storage.set(this, false);
|
|
158
|
+
_LuxenCarousel_dragFree_accessor_storage.set(this, false);
|
|
159
|
+
_LuxenCarousel_duration_accessor_storage.set(this, 20);
|
|
160
|
+
_LuxenCarousel_skipSnaps_accessor_storage.set(this, false);
|
|
161
|
+
_LuxenCarousel_slidesToScroll_accessor_storage.set(this, 1);
|
|
162
|
+
_LuxenCarousel_startIndex_accessor_storage.set(this, 0);
|
|
163
|
+
_LuxenCarousel_containScroll_accessor_storage.set(this, 'trimSnaps');
|
|
164
|
+
_LuxenCarousel_single_accessor_storage.set(this, false);
|
|
165
|
+
_LuxenCarousel_withDots_accessor_storage.set(this, false);
|
|
166
|
+
_LuxenCarousel_withScrollbar_accessor_storage.set(this, false);
|
|
167
|
+
_LuxenCarousel_withFullscreen_accessor_storage.set(this, false);
|
|
168
|
+
_LuxenCarousel_dotAppearance_accessor_storage.set(this, 'bar');
|
|
169
|
+
_LuxenCarousel_scrollButtonsPosition_accessor_storage.set(this, 'inside');
|
|
170
|
+
this.next = this.next.bind(this);
|
|
171
|
+
this.previous = this.previous.bind(this);
|
|
172
|
+
this.onInit = this.onInit.bind(this);
|
|
173
|
+
this.onReInit = this.onReInit.bind(this);
|
|
174
|
+
this.onResize = this.onResize.bind(this);
|
|
175
|
+
this.onSelect = this.onSelect.bind(this);
|
|
176
|
+
this.onSlidesInView = this.onSlidesInView.bind(this);
|
|
177
|
+
this.detachEventListeners = this.detachEventListeners.bind(this);
|
|
178
|
+
}
|
|
179
|
+
connectedCallback() {
|
|
180
|
+
super.connectedCallback();
|
|
181
|
+
this.createEmbla();
|
|
182
|
+
}
|
|
183
|
+
disconnectedCallback() {
|
|
184
|
+
super.disconnectedCallback();
|
|
185
|
+
if (this.embla) {
|
|
186
|
+
this.embla.destroy();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
firstUpdated() {
|
|
190
|
+
this.attachEventListeners();
|
|
191
|
+
}
|
|
192
|
+
createEmbla() {
|
|
193
|
+
this.embla = EmblaCarousel(this, this.options());
|
|
194
|
+
this.embla
|
|
195
|
+
.on('init', this.onInit)
|
|
196
|
+
.on('reInit', this.onReInit)
|
|
197
|
+
.on('resize', this.onResize)
|
|
198
|
+
.on('slidesInView', this.onSlidesInView)
|
|
199
|
+
.on('select', this.onSelect)
|
|
200
|
+
.on('destroy', this.detachEventListeners);
|
|
201
|
+
}
|
|
202
|
+
onSlidesInView() {
|
|
203
|
+
this.emit('slides-in-view', {
|
|
204
|
+
detail: { indexes: this.embla.slidesInView() },
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
onInit() {
|
|
208
|
+
this.updateNavigation();
|
|
209
|
+
}
|
|
210
|
+
onReInit() {
|
|
211
|
+
this.updateNavigation();
|
|
212
|
+
this.requestUpdate();
|
|
213
|
+
}
|
|
214
|
+
onSelect() {
|
|
215
|
+
this.emit('select', {
|
|
216
|
+
detail: { index: this.embla.selectedScrollSnap() },
|
|
217
|
+
});
|
|
218
|
+
this.updateNavigation();
|
|
219
|
+
}
|
|
220
|
+
onResize() {
|
|
221
|
+
this.requestUpdate();
|
|
222
|
+
}
|
|
223
|
+
attachEventListeners() {
|
|
224
|
+
this.previousBtn.addEventListener('click', this.previous);
|
|
225
|
+
this.nextBtn.addEventListener('click', this.next);
|
|
226
|
+
}
|
|
227
|
+
detachEventListeners() {
|
|
228
|
+
this.previousBtn.removeEventListener('click', this.previous);
|
|
229
|
+
this.nextBtn.removeEventListener('click', this.next);
|
|
230
|
+
}
|
|
231
|
+
updateNavigation() {
|
|
232
|
+
const canScroll = this.embla.canScrollPrev() || this.embla.canScrollNext();
|
|
233
|
+
this.previousBtn.toggleAttribute('disabled', !this.embla.canScrollPrev());
|
|
234
|
+
this.nextBtn.toggleAttribute('disabled', !this.embla.canScrollNext());
|
|
235
|
+
this.scrollButtons.classList.toggle('scroll-buttons--disabled', !canScroll);
|
|
236
|
+
if (this.withDots) {
|
|
237
|
+
const previous = this.embla.previousScrollSnap();
|
|
238
|
+
const selected = this.embla.selectedScrollSnap();
|
|
239
|
+
this.dotNodes[previous]?.classList.remove('dot--selected');
|
|
240
|
+
this.dotNodes[previous]?.removeAttribute('aria-selected');
|
|
241
|
+
this.dotNodes[selected]?.classList.add('dot--selected');
|
|
242
|
+
this.dotNodes[selected]?.setAttribute('aria-selected', 'true');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
async updated(changedProperties) {
|
|
246
|
+
if (changedProperties.has('autoplay') && this.autoplay) {
|
|
247
|
+
this.initAutoplay();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
initAutoplay() {
|
|
251
|
+
this.embla.reInit(this.options(), [Autoplay(this.autoplayOptions || { delay: this.autoplay })]);
|
|
252
|
+
}
|
|
253
|
+
handleSlotChange(event) {
|
|
254
|
+
const slot = event.target;
|
|
255
|
+
if (slot.assignedElements().length > 0) {
|
|
256
|
+
this.embla.reInit(this.options());
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
handleDotClick(event) {
|
|
260
|
+
const button = event.currentTarget;
|
|
261
|
+
this.goToSlide(Number(button.dataset.index));
|
|
262
|
+
}
|
|
263
|
+
options() {
|
|
264
|
+
const container = this.shadowRoot.querySelector('slot');
|
|
265
|
+
if (!container) {
|
|
266
|
+
return {
|
|
267
|
+
container: this,
|
|
268
|
+
slides: [],
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
container: container,
|
|
273
|
+
slides: container.assignedElements(),
|
|
274
|
+
containScroll: this.containScroll,
|
|
275
|
+
breakpoints: this.breakpoints,
|
|
276
|
+
axis: this.axis,
|
|
277
|
+
align: this.align,
|
|
278
|
+
dragFree: this.dragFree,
|
|
279
|
+
duration: this.duration,
|
|
280
|
+
loop: this.loop,
|
|
281
|
+
slidesToScroll: this.slidesToScroll,
|
|
282
|
+
skipSnaps: this.skipSnaps,
|
|
283
|
+
startIndex: this.startIndex,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
next() {
|
|
287
|
+
this.embla.scrollNext();
|
|
288
|
+
}
|
|
289
|
+
previous() {
|
|
290
|
+
this.embla.scrollPrev();
|
|
291
|
+
}
|
|
292
|
+
goToSlide(index, jump) {
|
|
293
|
+
this.embla.scrollTo(index, jump);
|
|
294
|
+
}
|
|
295
|
+
slideNodes() {
|
|
296
|
+
this.embla.slideNodes();
|
|
297
|
+
}
|
|
298
|
+
slidesInView() {
|
|
299
|
+
this.embla.slidesInView();
|
|
300
|
+
}
|
|
301
|
+
isActive() {
|
|
302
|
+
return this.embla?.internalEngine().options.active;
|
|
303
|
+
}
|
|
304
|
+
renderFullscreenButton() {
|
|
305
|
+
return html `<button
|
|
306
|
+
type="button"
|
|
307
|
+
part="button button-fullscreen"
|
|
308
|
+
class="button button-fullscreen"
|
|
309
|
+
@click=${() => this.emit('fullscreen')}
|
|
310
|
+
>
|
|
311
|
+
<svg
|
|
312
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
313
|
+
viewBox="0 0 512 512"
|
|
314
|
+
fill="currentColor"
|
|
315
|
+
part="button-icon button-icon-fullscreen"
|
|
316
|
+
>
|
|
317
|
+
<path
|
|
318
|
+
d="M295 183c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l135-135 0 86.1c0 13.3 10.7 24 24 24s24-10.7 24-24l0-144c0-13.3-10.7-24-24-24L344 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l86.1 0-135 135zM217 329c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L48 430.1 48 344c0-13.3-10.7-24-24-24S0 330.7 0 344L0 488c0 13.3 10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-86.1 0 135-135z"
|
|
319
|
+
/>
|
|
320
|
+
</svg>
|
|
321
|
+
</button>`;
|
|
322
|
+
}
|
|
323
|
+
renderNextPreviousButtons() {
|
|
324
|
+
return html `<div
|
|
325
|
+
class="scroll-buttons scroll-buttons--${this.scrollButtonsPosition}"
|
|
326
|
+
part="scroll-buttons"
|
|
327
|
+
>
|
|
328
|
+
<button
|
|
329
|
+
part="button button-previous"
|
|
330
|
+
class="button button-previous"
|
|
331
|
+
type="button"
|
|
332
|
+
>
|
|
333
|
+
<svg
|
|
334
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
335
|
+
viewBox="0 0 512 512"
|
|
336
|
+
fill="currentColor"
|
|
337
|
+
part="button-icon button-icon-previous"
|
|
338
|
+
>
|
|
339
|
+
<path
|
|
340
|
+
d="M7 239c-9.4 9.4-9.4 24.6 0 33.9L175 441c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L81.9 280 488 280c13.3 0 24-10.7 24-24s-10.7-24-24-24L81.9 232 209 105c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L7 239z"
|
|
341
|
+
/>
|
|
342
|
+
</svg>
|
|
343
|
+
</button>
|
|
344
|
+
|
|
345
|
+
<button
|
|
346
|
+
part="button button-next"
|
|
347
|
+
class="button button-next"
|
|
348
|
+
type="button"
|
|
349
|
+
>
|
|
350
|
+
<svg
|
|
351
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
352
|
+
viewBox="0 0 512 512"
|
|
353
|
+
fill="currentColor"
|
|
354
|
+
part="button-icon button-icon-next"
|
|
355
|
+
>
|
|
356
|
+
<path
|
|
357
|
+
d="M505 273c9.4-9.4 9.4-24.6 0-33.9L337 71c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l127 127-406.1 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l406.1 0-127 127c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0L505 273z"
|
|
358
|
+
/>
|
|
359
|
+
</svg>
|
|
360
|
+
</button>
|
|
361
|
+
</div>`;
|
|
362
|
+
}
|
|
363
|
+
render() {
|
|
364
|
+
return html `
|
|
365
|
+
<div class="wrapper ${this.isActive() ? '' : 'inactive'}">
|
|
366
|
+
<div
|
|
367
|
+
part="viewport"
|
|
368
|
+
class="viewport"
|
|
369
|
+
>
|
|
370
|
+
<slot
|
|
371
|
+
part="container"
|
|
372
|
+
class="container"
|
|
373
|
+
@slotchange=${this.handleSlotChange}
|
|
374
|
+
></slot>
|
|
375
|
+
</div>
|
|
376
|
+
${this.withFullscreen ? this.renderFullscreenButton() : ''}
|
|
377
|
+
${this.renderNextPreviousButtons()}
|
|
378
|
+
${this.withDots
|
|
379
|
+
? html `<div
|
|
380
|
+
class="dots"
|
|
381
|
+
part="dots"
|
|
382
|
+
role="tablist"
|
|
383
|
+
>
|
|
384
|
+
${map(this.embla.scrollSnapList(), (_, index) => {
|
|
385
|
+
return html `<button
|
|
386
|
+
part="button-dot"
|
|
387
|
+
type="button"
|
|
388
|
+
role="tab"
|
|
389
|
+
class="dot dot--${this.dotAppearance}"
|
|
390
|
+
aria-label="Go to slide ${index + 1}"
|
|
391
|
+
data-index="${index}"
|
|
392
|
+
@click=${this.handleDotClick}
|
|
393
|
+
>
|
|
394
|
+
<i></i>
|
|
395
|
+
</button>`;
|
|
396
|
+
})}
|
|
397
|
+
</div> `
|
|
398
|
+
: ''}
|
|
399
|
+
</div>
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
_LuxenCarousel_autoplay_accessor_storage = new WeakMap(), _LuxenCarousel_autoplayOptions_accessor_storage = new WeakMap(), _LuxenCarousel_axis_accessor_storage = new WeakMap(), _LuxenCarousel_align_accessor_storage = new WeakMap(), _LuxenCarousel_breakpoints_accessor_storage = new WeakMap(), _LuxenCarousel_loop_accessor_storage = new WeakMap(), _LuxenCarousel_dragFree_accessor_storage = new WeakMap(), _LuxenCarousel_duration_accessor_storage = new WeakMap(), _LuxenCarousel_skipSnaps_accessor_storage = new WeakMap(), _LuxenCarousel_slidesToScroll_accessor_storage = new WeakMap(), _LuxenCarousel_startIndex_accessor_storage = new WeakMap(), _LuxenCarousel_containScroll_accessor_storage = new WeakMap(), _LuxenCarousel_single_accessor_storage = new WeakMap(), _LuxenCarousel_withDots_accessor_storage = new WeakMap(), _LuxenCarousel_withScrollbar_accessor_storage = new WeakMap(), _LuxenCarousel_withFullscreen_accessor_storage = new WeakMap(), _LuxenCarousel_dotAppearance_accessor_storage = new WeakMap(), _LuxenCarousel_scrollButtonsPosition_accessor_storage = new WeakMap();
|
|
404
|
+
LuxenCarousel.styles = [hostStyles, styles];
|
|
405
|
+
__decorate([
|
|
406
|
+
property({ type: Number, reflect: true })
|
|
407
|
+
], LuxenCarousel.prototype, "autoplay", null);
|
|
408
|
+
__decorate([
|
|
409
|
+
property({ type: Object, attribute: 'autoplay-options' })
|
|
410
|
+
], LuxenCarousel.prototype, "autoplayOptions", null);
|
|
411
|
+
__decorate([
|
|
412
|
+
property()
|
|
413
|
+
], LuxenCarousel.prototype, "axis", null);
|
|
414
|
+
__decorate([
|
|
415
|
+
property()
|
|
416
|
+
], LuxenCarousel.prototype, "align", null);
|
|
417
|
+
__decorate([
|
|
418
|
+
property({ type: Object, reflect: true })
|
|
419
|
+
], LuxenCarousel.prototype, "breakpoints", null);
|
|
420
|
+
__decorate([
|
|
421
|
+
property({ type: Boolean })
|
|
422
|
+
], LuxenCarousel.prototype, "loop", null);
|
|
423
|
+
__decorate([
|
|
424
|
+
property({ type: Boolean, attribute: 'drag-free' })
|
|
425
|
+
], LuxenCarousel.prototype, "dragFree", null);
|
|
426
|
+
__decorate([
|
|
427
|
+
property({ type: Number })
|
|
428
|
+
], LuxenCarousel.prototype, "duration", null);
|
|
429
|
+
__decorate([
|
|
430
|
+
property({ type: Boolean, attribute: 'skip-snaps' })
|
|
431
|
+
], LuxenCarousel.prototype, "skipSnaps", null);
|
|
432
|
+
__decorate([
|
|
433
|
+
property({ attribute: 'slides-to-scroll' })
|
|
434
|
+
], LuxenCarousel.prototype, "slidesToScroll", null);
|
|
435
|
+
__decorate([
|
|
436
|
+
property({ type: Number, attribute: 'start-index' })
|
|
437
|
+
], LuxenCarousel.prototype, "startIndex", null);
|
|
438
|
+
__decorate([
|
|
439
|
+
property({ attribute: 'contain-scroll' })
|
|
440
|
+
], LuxenCarousel.prototype, "containScroll", null);
|
|
441
|
+
__decorate([
|
|
442
|
+
property({ type: Boolean })
|
|
443
|
+
], LuxenCarousel.prototype, "single", null);
|
|
444
|
+
__decorate([
|
|
445
|
+
property({ type: Boolean, attribute: 'with-dots' })
|
|
446
|
+
], LuxenCarousel.prototype, "withDots", null);
|
|
447
|
+
__decorate([
|
|
448
|
+
property({ type: Boolean, attribute: 'with-scrollbar' })
|
|
449
|
+
], LuxenCarousel.prototype, "withScrollbar", null);
|
|
450
|
+
__decorate([
|
|
451
|
+
property({ type: Boolean, attribute: 'with-fullscreen' })
|
|
452
|
+
], LuxenCarousel.prototype, "withFullscreen", null);
|
|
453
|
+
__decorate([
|
|
454
|
+
property({ type: String, attribute: 'dot-appearance' })
|
|
455
|
+
], LuxenCarousel.prototype, "dotAppearance", null);
|
|
456
|
+
__decorate([
|
|
457
|
+
property({ type: String, attribute: 'scroll-buttons-position' })
|
|
458
|
+
], LuxenCarousel.prototype, "scrollButtonsPosition", null);
|
|
459
|
+
__decorate([
|
|
460
|
+
query('.scroll-buttons')
|
|
461
|
+
], LuxenCarousel.prototype, "scrollButtons", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
query('.button-previous')
|
|
464
|
+
], LuxenCarousel.prototype, "previousBtn", void 0);
|
|
465
|
+
__decorate([
|
|
466
|
+
query('.button-next')
|
|
467
|
+
], LuxenCarousel.prototype, "nextBtn", void 0);
|
|
468
|
+
__decorate([
|
|
469
|
+
query('.container')
|
|
470
|
+
], LuxenCarousel.prototype, "container", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
queryAll('.dot')
|
|
473
|
+
], LuxenCarousel.prototype, "dotNodes", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/html/elements/carousel/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,cAAc,YAAY,CAAC;AAG3B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,aAAa,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CSSResultGroup } from 'lit';
|
|
2
|
+
import { LuxenElement } from '../../shared/luxen-element';
|
|
3
|
+
/**
|
|
4
|
+
* A single slide inside an `<l-carousel>`.
|
|
5
|
+
*
|
|
6
|
+
* @cssproperty --aspect-ratio - Aspect ratio of the slide.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LuxenCarouselItem extends LuxenElement {
|
|
9
|
+
static styles: CSSResultGroup;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
render(): import("lit").TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=carousel-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-item.d.ts","sourceRoot":"","sources":["../../../src/html/elements/carousel-item/carousel-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAgB,MAAM,EAAE,cAAc,CAAwB;IAErD,iBAAiB;IAKjB,MAAM;CAGhB"}
|