rm-image-slider 17.1.3

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/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # Angular Image Slider with Lightbox
2
+
3
+ An Angular responsive image slider with lightbox popup.
4
+ Also support youtube and mp4 video urls. It is leazy loading and heigly optimized with standalone component.
5
+
6
+ (Compatible with Angular Version: 17)
7
+
8
+ ## Features!
9
+
10
+ - Responsive (support images width and height in both % and px)
11
+ - captures swipes from phones and tablets
12
+ - Compatible with Angular Universal
13
+ - Image lightbox popup
14
+ - captures keyboard next/previous arrow key event for lightbox image move
15
+ - Support Images (jpeg, jpg, gif, png and Base64-String), Youtube url and MP4 video (url and Base64-String)
16
+ - Handling runtime image arraylist changes
17
+
18
+ # Installation
19
+
20
+ `npm install rm-image-slider --save`
21
+
22
+ # Setup :
23
+
24
+ **Import module in your component:**
25
+
26
+ ```typescript
27
+ import { RmImageSliderComponent } from 'rm-image-slider';
28
+ ...
29
+ @Component({
30
+ selector: '',
31
+ standalone: true,
32
+ imports: [RmImageSliderComponent],
33
+ templateUrl: '',
34
+ styleUrl: '',
35
+ })
36
+
37
+ ```
38
+
39
+ **Add component in your template file.**
40
+
41
+ ```html
42
+ <rm-image-slider [images]="imageObject" #nav></rm-image-slider>
43
+ ```
44
+
45
+ **ImageObject format**
46
+
47
+ ```js
48
+ imageObject: Array<ImageObject> = [{
49
+ image: 'assets/img/slider/1.jpg',
50
+ thumbImage: 'assets/img/slider/1_min.jpeg',
51
+ alt: 'alt of image',
52
+ title: 'title of image'
53
+ }, {
54
+ image: '.../iOe/xHHf4nf8AE75h3j1x64ZmZ//Z==', // Support base64 image
55
+ thumbImage: '.../iOe/xHHf4nf8AE75h3j1x64ZmZ//Z==', // Support base64 image
56
+ title: 'Image title', //Optional: You can use this key if want to show image with title
57
+ alt: 'Image alt', //Optional: You can use this key if want to show image with alt
58
+ order: 1 //Optional: if you pass this key then slider images will be arrange according @input: slideOrderType
59
+ }
60
+ ];
61
+ ```
62
+
63
+ **Image, Youtube and MP4 url's object format**
64
+
65
+ ```js
66
+ imageObject: Array<ImageObject> = [{
67
+ video: 'https://youtu.be/....' // Youtube url
68
+ },
69
+ {
70
+ video: 'assets/video/********.mp4', // MP4 Video url
71
+ },
72
+ {
73
+ video: 'assets/video/movie2.mp4',
74
+ posterImage: 'assets/img/slider/2_min.jpeg', //Optional: You can use this key if you want to show video poster image in slider
75
+ title: 'Image title'
76
+ },
77
+ {
78
+ image: 'assets/img/slider/1.jpg',
79
+ thumbImage: 'assets/img/slider/1_min.jpeg',
80
+ alt: 'Image alt'
81
+ }
82
+ ...
83
+ ];
84
+ ```
85
+
86
+ ## API Reference (optional) :
87
+
88
+ | Name | Type | Data Type | Description | Default |
89
+ | ------------------ | ------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
90
+ | infinite | @Input | boolean | Infinite sliding images if value is **true**. | false |
91
+ | imagePopup | @Input | boolean | Enable image lightBox popup option on slider image click. | true |
92
+ | animationSpeed | @Input | number | By this user can set slider animation speed. Minimum value is **0.1 second** and Maximum value is **5 second**. | 1 |
93
+ | slideImage | @Input | number | Set how many images will move on left/right arrow click. | 1 |
94
+ | imageSize | @Input | object | Set slider images width, height and space. space is use for set space between slider images. Pass object like `{width: '400px', height: '300px', space: 4}` or you can pass value in percentage `{width: '20%', height: '20%'}` OR set only space `{space: 4}` | `{width: 205, height: 200, space: 3}` |
95
+ | manageImageRatio | @Input | boolean | Show images with aspect ratio if value is `true` and set imageSize width and height on parent div | false |
96
+ | autoSlide | @Input | number/boolean/object | Auto slide images according provided time interval. Option will work only if **infinite** option is **true**. For number data type minimum value is 1 second and Maximum value is 5 second. By object data type you can prevent auto slide stop behaviour on mouse hover event. `{interval: 2, stopOnHover: false}` | 0 |
97
+ | showArrow | @Input | boolean | Hide/Show slider arrow buttons | true |
98
+ | arrowKeyMove | @Input | boolean | Disable slider and popup image left/right move on arrow key press event, if value is `false` | true |
99
+ | videoAutoPlay | @Input | boolean | Auto play popup video | false |
100
+ | showVideoControls | @Input | boolean | Hide video control if value is `false` | true |
101
+ | direction | @Input | string | Set text direction. You can pass **rtl** / **ltr** / **auto** | ltr |
102
+ | slideOrderType | @Input | string | Arrange slider images in Ascending order by `ASC` and in Descending order by `DESC`. `order` key must be exist with image object. | ASC |
103
+ | lazyLoading | @Input | boolean | Lazy load images and Iframe if true. | false |
104
+ | defaultActiveImage | @Input | number | Set image as selected on load. | null |
105
+ | imageClick | @Output | n/a | Executes when click event on slider image. Return image index. | n/a |
106
+ | arrowClick | @Output | n/a | Executes when click on slider left/right arrow. Returns current event name and next/previous button disabled status. | n/a |
107
+ | lightboxClose | @Output | n/a | Executes when lightbox close. | n/a |
108
+ | lightboxArrowClick | @Output | n/a | Executes when click on lightbox next/previous arrow. | n/a |
109
+
110
+ ## Add custom navigation button
111
+
112
+ ```typescript
113
+ import { RmImageSliderComponent } from 'rm-image-slider';
114
+
115
+ @Component({
116
+ selector: 'sample',
117
+ standalone: true,
118
+ imports: [RmImageSliderComponent],
119
+ template:`
120
+ <rm-image-slider [images]="imageObject" #nav>
121
+ </rm-image-slider>
122
+ <button (click)="prevImageClick()">Prev</button>
123
+ <button (click)="nextImageClick()">Next</button>
124
+ `
125
+ })
126
+ class Sample {
127
+ @ViewChild('nav') slider: RmImageSliderComponent;
128
+ imageObject = [{...}]
129
+
130
+ prevImageClick() {
131
+ this.slider.prev();
132
+ }
133
+
134
+ nextImageClick() {
135
+ this.slider.next();
136
+ }
137
+ }
138
+ ```
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcm0taW1hZ2Utc2xpZGVyL3NyYy9saWIvaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEltYWdlT2JqZWN0IHtcclxuICBpbWFnZT86IHN0cmluZztcclxuICB0aHVtYkltYWdlPzogc3RyaW5nO1xyXG4gIGFsdD86IHN0cmluZztcclxuICB0aXRsZT86IHN0cmluZztcclxuICBvcmRlcj86IG51bWJlcjtcclxuICBpbmRleDogbnVtYmVyO1xyXG4gIHBvc3RlckltYWdlPzogc3RyaW5nO1xyXG4gIHZpZGVvPzogc3RyaW5nO1xyXG59XHJcbiJdfQ==