carousel.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. "use strict";
  2. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  3. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  5. 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;
  6. return c > 3 && r && Object.defineProperty(target, key, r), r;
  7. };
  8. var __metadata = (this && this.__metadata) || function (k, v) {
  9. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  10. };
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var core_1 = require("@angular/core");
  13. var shared_1 = require("../common/shared");
  14. var common_1 = require("@angular/common");
  15. var uniquecomponentid_1 = require("../utils/uniquecomponentid");
  16. var Carousel = /** @class */ (function () {
  17. function Carousel(el, zone) {
  18. this.el = el;
  19. this.zone = zone;
  20. this.orientation = "horizontal";
  21. this.verticalViewPortHeight = "300px";
  22. this.contentClass = "";
  23. this.dotsContainerClass = "";
  24. this.circular = false;
  25. this.autoplayInterval = 0;
  26. this.onPage = new core_1.EventEmitter();
  27. this._numVisible = 1;
  28. this._numScroll = 1;
  29. this._oldNumScroll = 0;
  30. this.prevState = {
  31. numScroll: 0,
  32. numVisible: 0,
  33. value: []
  34. };
  35. this.defaultNumScroll = 1;
  36. this.defaultNumVisible = 1;
  37. this._page = 0;
  38. this.isRemainingItemsAdded = false;
  39. this.remainingItems = 0;
  40. this.totalShiftedItems = this.page * this.numScroll * -1;
  41. }
  42. Object.defineProperty(Carousel.prototype, "page", {
  43. get: function () {
  44. return this._page;
  45. },
  46. set: function (val) {
  47. if (this.isCreated && val !== this._page) {
  48. if (this.autoplayInterval) {
  49. this.stopAutoplay();
  50. this.allowAutoplay = false;
  51. }
  52. if (val > this._page && val < (this.totalDots() - 1)) {
  53. this.step(-1, val);
  54. }
  55. else if (val < this._page && val !== 0) {
  56. this.step(1, val);
  57. }
  58. }
  59. this._page = val;
  60. },
  61. enumerable: true,
  62. configurable: true
  63. });
  64. Object.defineProperty(Carousel.prototype, "numVisible", {
  65. get: function () {
  66. return this._numVisible;
  67. },
  68. set: function (val) {
  69. this._numVisible = val;
  70. },
  71. enumerable: true,
  72. configurable: true
  73. });
  74. Object.defineProperty(Carousel.prototype, "numScroll", {
  75. get: function () {
  76. return this._numVisible;
  77. },
  78. set: function (val) {
  79. this._numScroll = val;
  80. },
  81. enumerable: true,
  82. configurable: true
  83. });
  84. Object.defineProperty(Carousel.prototype, "value", {
  85. get: function () {
  86. return this._value;
  87. },
  88. set: function (val) {
  89. this._value = val;
  90. if (this.circular && this._value) {
  91. this.setCloneItems();
  92. }
  93. },
  94. enumerable: true,
  95. configurable: true
  96. });
  97. ;
  98. Carousel.prototype.ngAfterContentInit = function () {
  99. var _this = this;
  100. this.id = uniquecomponentid_1.UniqueComponentId();
  101. this.allowAutoplay = !!this.autoplayInterval;
  102. if (this.circular) {
  103. this.setCloneItems();
  104. }
  105. if (this.responsiveOptions) {
  106. this.defaultNumScroll = this._numScroll;
  107. this.defaultNumVisible = this._numVisible;
  108. }
  109. this.createStyle();
  110. this.calculatePosition();
  111. if (this.responsiveOptions) {
  112. this.bindDocumentListeners();
  113. }
  114. this.templates.forEach(function (item) {
  115. switch (item.getType()) {
  116. case 'item':
  117. _this.itemTemplate = item.template;
  118. break;
  119. default:
  120. _this.itemTemplate = item.template;
  121. break;
  122. }
  123. });
  124. };
  125. Carousel.prototype.ngAfterContentChecked = function () {
  126. var isCircular = this.isCircular();
  127. var totalShiftedItems = this.totalShiftedItems;
  128. if (this.value && (this.prevState.numScroll !== this._numScroll || this.prevState.numVisible !== this._numVisible || this.prevState.value.length !== this.value.length)) {
  129. if (this.autoplayInterval) {
  130. this.stopAutoplay();
  131. }
  132. this.remainingItems = (this.value.length - this._numVisible) % this._numScroll;
  133. var page = this._page;
  134. if (this.totalDots() !== 0 && page >= this.totalDots()) {
  135. page = this.totalDots() - 1;
  136. this._page = page;
  137. this.onPage.emit({
  138. page: this.page
  139. });
  140. }
  141. totalShiftedItems = (page * this._numScroll) * -1;
  142. if (isCircular) {
  143. totalShiftedItems -= this._numVisible;
  144. }
  145. if (page === (this.totalDots() - 1) && this.remainingItems > 0) {
  146. totalShiftedItems += (-1 * this.remainingItems) + this._numScroll;
  147. this.isRemainingItemsAdded = true;
  148. }
  149. else {
  150. this.isRemainingItemsAdded = false;
  151. }
  152. if (totalShiftedItems !== this.totalShiftedItems) {
  153. this.totalShiftedItems = totalShiftedItems;
  154. }
  155. this._oldNumScroll = this._numScroll;
  156. this.prevState.numScroll = this._numScroll;
  157. this.prevState.numVisible = this._numVisible;
  158. this.prevState.value = this._value;
  159. this.itemsContainer.nativeElement.style.transform = this.isVertical() ? "translate3d(0, " + totalShiftedItems * (100 / this._numVisible) + "%, 0)" : "translate3d(" + totalShiftedItems * (100 / this._numVisible) + "%, 0, 0)";
  160. this.isCreated = true;
  161. if (this.autoplayInterval && this.isAutoplay()) {
  162. this.startAutoplay();
  163. }
  164. }
  165. if (isCircular) {
  166. if (this.page === 0) {
  167. totalShiftedItems = -1 * this._numVisible;
  168. }
  169. else if (totalShiftedItems === 0) {
  170. totalShiftedItems = -1 * this.value.length;
  171. if (this.remainingItems > 0) {
  172. this.isRemainingItemsAdded = true;
  173. }
  174. }
  175. if (totalShiftedItems !== this.totalShiftedItems) {
  176. this.totalShiftedItems = totalShiftedItems;
  177. }
  178. }
  179. };
  180. Carousel.prototype.createStyle = function () {
  181. if (!this.carouselStyle) {
  182. this.carouselStyle = document.createElement('style');
  183. this.carouselStyle.type = 'text/css';
  184. document.body.appendChild(this.carouselStyle);
  185. }
  186. var innerHTML = "\n #" + this.id + " .ui-carousel-item {\n\t\t\t\tflex: 1 0 " + (100 / this.numVisible) + "%\n\t\t\t}\n ";
  187. if (this.responsiveOptions) {
  188. this.responsiveOptions.sort(function (data1, data2) {
  189. var value1 = data1.breakpoint;
  190. var value2 = data2.breakpoint;
  191. var result = null;
  192. if (value1 == null && value2 != null)
  193. result = -1;
  194. else if (value1 != null && value2 == null)
  195. result = 1;
  196. else if (value1 == null && value2 == null)
  197. result = 0;
  198. else if (typeof value1 === 'string' && typeof value2 === 'string')
  199. result = value1.localeCompare(value2, undefined, { numeric: true });
  200. else
  201. result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;
  202. return -1 * result;
  203. });
  204. for (var i = 0; i < this.responsiveOptions.length; i++) {
  205. var res = this.responsiveOptions[i];
  206. innerHTML += "\n @media screen and (max-width: " + res.breakpoint + ") {\n #" + this.id + " .ui-carousel-item {\n flex: 1 0 " + (100 / res.numVisible) + "%\n }\n }\n ";
  207. }
  208. }
  209. this.carouselStyle.innerHTML = innerHTML;
  210. };
  211. Carousel.prototype.calculatePosition = function () {
  212. if (this.itemsContainer && this.responsiveOptions) {
  213. var windowWidth = window.innerWidth;
  214. var matchedResponsiveData = {
  215. numVisible: this.defaultNumVisible,
  216. numScroll: this.defaultNumScroll
  217. };
  218. for (var i = 0; i < this.responsiveOptions.length; i++) {
  219. var res = this.responsiveOptions[i];
  220. if (parseInt(res.breakpoint, 10) >= windowWidth) {
  221. matchedResponsiveData = res;
  222. }
  223. }
  224. if (this._numScroll !== matchedResponsiveData.numScroll) {
  225. var page = this._page;
  226. page = Math.floor((page * this._numScroll) / matchedResponsiveData.numScroll);
  227. var totalShiftedItems = (matchedResponsiveData.numScroll * this.page) * -1;
  228. if (this.isCircular()) {
  229. totalShiftedItems -= matchedResponsiveData.numVisible;
  230. }
  231. this.totalShiftedItems = totalShiftedItems;
  232. this._numScroll = matchedResponsiveData.numScroll;
  233. this._page = page;
  234. this.onPage.emit({
  235. page: this.page
  236. });
  237. }
  238. if (this._numVisible !== matchedResponsiveData.numVisible) {
  239. this._numVisible = matchedResponsiveData.numVisible;
  240. this.setCloneItems();
  241. }
  242. }
  243. };
  244. Carousel.prototype.setCloneItems = function () {
  245. var _a, _b;
  246. this.clonedItemsForStarting = [];
  247. this.clonedItemsForFinishing = [];
  248. if (this.isCircular()) {
  249. (_a = this.clonedItemsForStarting).push.apply(_a, this.value.slice(-1 * this._numVisible));
  250. (_b = this.clonedItemsForFinishing).push.apply(_b, this.value.slice(0, this._numVisible));
  251. }
  252. };
  253. Carousel.prototype.firstIndex = function () {
  254. return this.isCircular() ? (-1 * (this.totalShiftedItems + this.numVisible)) : (this.totalShiftedItems * -1);
  255. };
  256. Carousel.prototype.lastIndex = function () {
  257. return this.firstIndex() + this.numVisible - 1;
  258. };
  259. Carousel.prototype.totalDots = function () {
  260. return this.value ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0;
  261. };
  262. Carousel.prototype.totalDotsArray = function () {
  263. return Array(this.value ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0).fill(0);
  264. ;
  265. };
  266. Carousel.prototype.containerClass = function () {
  267. return { 'ui-carousel ui-widget': true,
  268. 'ui-carousel-vertical': this.isVertical(),
  269. 'ui-carousel-horizontal': !this.isVertical()
  270. };
  271. };
  272. Carousel.prototype.contentClasses = function () {
  273. return 'ui-carousel-content ' + this.contentClass;
  274. };
  275. Carousel.prototype.dotsContentClasses = function () {
  276. return 'ui-carousel-dots-container ui-helper-reset ' + this.dotsContainerClass;
  277. };
  278. Carousel.prototype.isVertical = function () {
  279. return this.orientation === 'vertical';
  280. };
  281. Carousel.prototype.isCircular = function () {
  282. return this.circular && this.value && this.value.length >= this.numVisible;
  283. };
  284. Carousel.prototype.isAutoplay = function () {
  285. return this.autoplayInterval && this.allowAutoplay;
  286. };
  287. Carousel.prototype.navForward = function (e, index) {
  288. if (this.circular || this._page < (this.totalDots() - 1)) {
  289. this.step(-1, index);
  290. }
  291. if (this.autoplayInterval) {
  292. this.stopAutoplay();
  293. this.allowAutoplay = false;
  294. }
  295. if (e && e.cancelable) {
  296. e.preventDefault();
  297. }
  298. };
  299. Carousel.prototype.navBackward = function (e, index) {
  300. if (this.circular || this._page !== 0) {
  301. this.step(1, index);
  302. }
  303. if (this.autoplayInterval) {
  304. this.stopAutoplay();
  305. this.allowAutoplay = false;
  306. }
  307. if (e && e.cancelable) {
  308. e.preventDefault();
  309. }
  310. };
  311. Carousel.prototype.onDotClick = function (e, index) {
  312. var page = this._page;
  313. if (this.autoplayInterval) {
  314. this.stopAutoplay();
  315. this.allowAutoplay = false;
  316. }
  317. if (index > page) {
  318. this.navForward(e, index);
  319. }
  320. else if (index < page) {
  321. this.navBackward(e, index);
  322. }
  323. };
  324. Carousel.prototype.step = function (dir, page) {
  325. var totalShiftedItems = this.totalShiftedItems;
  326. var isCircular = this.isCircular();
  327. if (page != null) {
  328. totalShiftedItems = (this._numScroll * page) * -1;
  329. if (isCircular) {
  330. totalShiftedItems -= this._numVisible;
  331. }
  332. this.isRemainingItemsAdded = false;
  333. }
  334. else {
  335. totalShiftedItems += (this._numScroll * dir);
  336. if (this.isRemainingItemsAdded) {
  337. totalShiftedItems += this.remainingItems - (this._numScroll * dir);
  338. this.isRemainingItemsAdded = false;
  339. }
  340. var originalShiftedItems = isCircular ? (totalShiftedItems + this._numVisible) : totalShiftedItems;
  341. page = Math.abs(Math.floor((originalShiftedItems / this._numScroll)));
  342. }
  343. if (isCircular && this.page === (this.totalDots() - 1) && dir === -1) {
  344. totalShiftedItems = -1 * (this.value.length + this._numVisible);
  345. page = 0;
  346. }
  347. else if (isCircular && this.page === 0 && dir === 1) {
  348. totalShiftedItems = 0;
  349. page = (this.totalDots() - 1);
  350. }
  351. else if (page === (this.totalDots() - 1) && this.remainingItems > 0) {
  352. totalShiftedItems += ((this.remainingItems * -1) - (this._numScroll * dir));
  353. this.isRemainingItemsAdded = true;
  354. }
  355. if (this.itemsContainer) {
  356. this.itemsContainer.nativeElement.style.transform = this.isVertical() ? "translate3d(0, " + totalShiftedItems * (100 / this._numVisible) + "%, 0)" : "translate3d(" + totalShiftedItems * (100 / this._numVisible) + "%, 0, 0)";
  357. this.itemsContainer.nativeElement.style.transition = 'transform 500ms ease 0s';
  358. }
  359. this.totalShiftedItems = totalShiftedItems;
  360. this._page = page;
  361. this.onPage.emit({
  362. page: this.page
  363. });
  364. };
  365. Carousel.prototype.startAutoplay = function () {
  366. var _this = this;
  367. this.interval = setInterval(function () {
  368. if (_this.page === (_this.totalDots() - 1)) {
  369. _this.step(-1, 0);
  370. }
  371. else {
  372. _this.step(-1, _this.page + 1);
  373. }
  374. }, this.autoplayInterval);
  375. };
  376. Carousel.prototype.stopAutoplay = function () {
  377. if (this.interval) {
  378. clearInterval(this.interval);
  379. }
  380. };
  381. Carousel.prototype.onTransitionEnd = function () {
  382. if (this.itemsContainer) {
  383. this.itemsContainer.nativeElement.style.transition = '';
  384. if ((this.page === 0 || this.page === (this.totalDots() - 1)) && this.isCircular()) {
  385. this.itemsContainer.nativeElement.style.transform = this.isVertical() ? "translate3d(0, " + this.totalShiftedItems * (100 / this._numVisible) + "%, 0)" : "translate3d(" + this.totalShiftedItems * (100 / this._numVisible) + "%, 0, 0)";
  386. }
  387. }
  388. };
  389. Carousel.prototype.onTouchStart = function (e) {
  390. var touchobj = e.changedTouches[0];
  391. this.startPos = {
  392. x: touchobj.pageX,
  393. y: touchobj.pageY
  394. };
  395. };
  396. Carousel.prototype.onTouchMove = function (e) {
  397. if (e.cancelable) {
  398. e.preventDefault();
  399. }
  400. };
  401. Carousel.prototype.onTouchEnd = function (e) {
  402. var touchobj = e.changedTouches[0];
  403. if (this.isVertical()) {
  404. this.changePageOnTouch(e, (touchobj.pageY - this.startPos.y));
  405. }
  406. else {
  407. this.changePageOnTouch(e, (touchobj.pageX - this.startPos.x));
  408. }
  409. };
  410. Carousel.prototype.changePageOnTouch = function (e, diff) {
  411. if (diff < 0) {
  412. this.navForward(e);
  413. }
  414. else {
  415. this.navBackward(e);
  416. }
  417. };
  418. Carousel.prototype.bindDocumentListeners = function () {
  419. var _this = this;
  420. if (!this.documentResizeListener) {
  421. this.documentResizeListener = function (e) {
  422. _this.calculatePosition();
  423. };
  424. window.addEventListener('resize', this.documentResizeListener);
  425. }
  426. };
  427. Carousel.prototype.unbindDocumentListeners = function () {
  428. if (this.documentResizeListener) {
  429. window.removeEventListener('resize', this.documentResizeListener);
  430. this.documentResizeListener = null;
  431. }
  432. };
  433. Carousel.prototype.ngOnDestroy = function () {
  434. if (this.responsiveOptions) {
  435. this.unbindDocumentListeners();
  436. }
  437. if (this.autoplayInterval) {
  438. this.stopAutoplay();
  439. }
  440. };
  441. __decorate([
  442. core_1.Input(),
  443. __metadata("design:type", Number),
  444. __metadata("design:paramtypes", [Number])
  445. ], Carousel.prototype, "page", null);
  446. __decorate([
  447. core_1.Input(),
  448. __metadata("design:type", Number),
  449. __metadata("design:paramtypes", [Number])
  450. ], Carousel.prototype, "numVisible", null);
  451. __decorate([
  452. core_1.Input(),
  453. __metadata("design:type", Number),
  454. __metadata("design:paramtypes", [Number])
  455. ], Carousel.prototype, "numScroll", null);
  456. __decorate([
  457. core_1.Input(),
  458. __metadata("design:type", Array)
  459. ], Carousel.prototype, "responsiveOptions", void 0);
  460. __decorate([
  461. core_1.Input(),
  462. __metadata("design:type", Object)
  463. ], Carousel.prototype, "orientation", void 0);
  464. __decorate([
  465. core_1.Input(),
  466. __metadata("design:type", Object)
  467. ], Carousel.prototype, "verticalViewPortHeight", void 0);
  468. __decorate([
  469. core_1.Input(),
  470. __metadata("design:type", String)
  471. ], Carousel.prototype, "contentClass", void 0);
  472. __decorate([
  473. core_1.Input(),
  474. __metadata("design:type", String)
  475. ], Carousel.prototype, "dotsContainerClass", void 0);
  476. __decorate([
  477. core_1.Input(),
  478. __metadata("design:type", Array),
  479. __metadata("design:paramtypes", [Object])
  480. ], Carousel.prototype, "value", null);
  481. __decorate([
  482. core_1.Input(),
  483. __metadata("design:type", Boolean)
  484. ], Carousel.prototype, "circular", void 0);
  485. __decorate([
  486. core_1.Input(),
  487. __metadata("design:type", Number)
  488. ], Carousel.prototype, "autoplayInterval", void 0);
  489. __decorate([
  490. core_1.Input(),
  491. __metadata("design:type", Object)
  492. ], Carousel.prototype, "style", void 0);
  493. __decorate([
  494. core_1.Input(),
  495. __metadata("design:type", String)
  496. ], Carousel.prototype, "styleClass", void 0);
  497. __decorate([
  498. core_1.Output(),
  499. __metadata("design:type", core_1.EventEmitter)
  500. ], Carousel.prototype, "onPage", void 0);
  501. __decorate([
  502. core_1.ViewChild('itemsContainer', { static: true }),
  503. __metadata("design:type", core_1.ElementRef)
  504. ], Carousel.prototype, "itemsContainer", void 0);
  505. __decorate([
  506. core_1.ContentChild(shared_1.Header, { static: false }),
  507. __metadata("design:type", Object)
  508. ], Carousel.prototype, "headerFacet", void 0);
  509. __decorate([
  510. core_1.ContentChild(shared_1.Footer, { static: false }),
  511. __metadata("design:type", Object)
  512. ], Carousel.prototype, "footerFacet", void 0);
  513. __decorate([
  514. core_1.ContentChildren(shared_1.PrimeTemplate),
  515. __metadata("design:type", core_1.QueryList)
  516. ], Carousel.prototype, "templates", void 0);
  517. Carousel = __decorate([
  518. core_1.Component({
  519. selector: 'p-carousel',
  520. template: "\n\t\t<div [attr.id]=\"id\" [ngClass]=\"containerClass()\" [ngStyle]=\"style\" [class]=\"styleClass\">\n\t\t\t<div class=\"ui-carousel-header\" *ngIf=\"headerFacet\">\n\t\t\t\t<ng-content select=\"p-header\"></ng-content>\n\t\t\t</div>\n\t\t\t<div [class]=\"contentClasses()\">\n\t\t\t\t<div class=\"ui-carousel-container\">\n\t\t\t\t\t<button [ngClass]=\"{'ui-carousel-prev ui-button ui-widget ui-state-default ui-corner-all':true, 'ui-state-disabled': _page === 0 && !circular}\" [disabled]=\"_page === 0 && !circular\" (click)=\"navBackward($event)\">\n\t\t\t\t\t\t<span [ngClass]=\"{'ui-carousel-prev-icon pi': true, 'pi-chevron-left': !isVertical(), 'pi-chevron-up': isVertical()}\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"ui-carousel-items-content\" [ngStyle]=\"{'height': isVertical() ? verticalViewPortHeight : 'auto'}\">\n\t\t\t\t\t\t<div #itemsContainer class=\"ui-carousel-items-container\" (transitionend)=\"onTransitionEnd()\" (touchend)=\"onTouchEnd($event)\" (touchstart)=\"onTouchStart($event)\" (touchmove)=\"onTouchMove($event)\">\n\t\t\t\t\t\t\t<div *ngFor=\"let item of clonedItemsForStarting; let index = index\" [ngClass]= \"{'ui-carousel-item ui-carousel-item-cloned': true,'ui-carousel-item-active': (totalShiftedItems * -1) === (value.length),\n\t\t\t\t\t\t\t'ui-carousel-item-start': 0 === index,\n\t\t\t\t\t\t\t'ui-carousel-item-end': (clonedItemsForStarting.length - 1) === index}\">\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item}\"></ng-container>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div *ngFor=\"let item of value; let index = index\" [ngClass]= \"{'ui-carousel-item': true,'ui-carousel-item-active': (firstIndex() <= index && lastIndex() >= index),\n\t\t\t\t\t\t\t'ui-carousel-item-start': firstIndex() === index,\n\t\t\t\t\t\t\t'ui-carousel-item-end': lastIndex() === index}\">\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item}\"></ng-container>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div *ngFor=\"let item of clonedItemsForFinishing; let index = index\" [ngClass]= \"{'ui-carousel-item ui-carousel-item-cloned': true,'ui-carousel-item-active': ((totalShiftedItems *-1) === numVisible),\n\t\t\t\t\t\t\t'ui-carousel-item-start': 0 === index,\n\t\t\t\t\t\t\t'ui-carousel-item-end': (clonedItemsForFinishing.length - 1) === index}\">\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item}\"></ng-container>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button [ngClass]=\"{'ui-carousel-next ui-button ui-widget ui-state-default ui-corner-all': true, 'ui-state-disabled': (_page === totalDots()-1 && !circular)}\" [disabled]=\"_page === totalDots()-1 && !circular\" (click)=\"navForward($event)\">\n\t\t\t\t\t\t<span [ngClass]=\"{'ui-carousel-next-icon pi': true, 'pi-chevron-right': !isVertical(), 'pi-chevron-down': isVertical()}\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<ul [class]=\"dotsContentClasses()\">\n\t\t\t\t\t<li *ngFor=\"let totalDot of totalDotsArray(); let i = index\" [ngClass]=\"{'ui-carousel-dot-item':true,'ui-state-highlight': _page === i}\">\n\t\t\t\t\t\t<button class=\"ui-button ui-widget ui-state-default ui-corner-all\" (click)=\"onDotClick($event, i)\">\n\t\t\t\t\t\t\t<span [ngClass]=\"{'ui-carousel-dot-icon pi':true, 'pi-circle-on': _page === i, 'pi-circle-off': !(_page === i)}\"></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div class=\"ui-carousel-footer\" *ngIf=\"footerFacet\">\n\t\t\t\t<ng-content select=\"p-footer\"></ng-content>\n\t\t\t</div>\n\t\t</div>\n\t"
  521. }),
  522. __metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone])
  523. ], Carousel);
  524. return Carousel;
  525. }());
  526. exports.Carousel = Carousel;
  527. var CarouselModule = /** @class */ (function () {
  528. function CarouselModule() {
  529. }
  530. CarouselModule = __decorate([
  531. core_1.NgModule({
  532. imports: [common_1.CommonModule, shared_1.SharedModule],
  533. exports: [common_1.CommonModule, Carousel, shared_1.SharedModule],
  534. declarations: [Carousel]
  535. })
  536. ], CarouselModule);
  537. return CarouselModule;
  538. }());
  539. exports.CarouselModule = CarouselModule;
  540. //# sourceMappingURL=carousel.js.map