@mintplayer/ng-bootstrap 21.0.0 → 21.1.1
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/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +33 -46
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +12 -30
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +6 -18
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +31 -65
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +200 -132
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +14 -17
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +231 -347
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +43 -39
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +7 -35
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +46 -86
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +7 -7
- package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +7 -6
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +32 -74
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs +6 -7
- package/fesm2022/mintplayer-ng-bootstrap-let.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs +18 -18
- package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +20 -22
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs +16 -10
- package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +8 -28
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +208 -265
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs +8 -21
- package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +43 -38
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +59 -120
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +11 -25
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +8 -28
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +67 -103
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +34 -63
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +19 -47
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +35 -41
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +205 -779
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +34 -39
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs +74 -100
- package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +37 -79
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs +78 -45
- package/fesm2022/mintplayer-ng-bootstrap-select2.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +16 -26
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +14 -40
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +8 -32
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +70 -76
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +11 -11
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +53 -99
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +7 -38
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +23 -49
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +33 -38
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs +45 -98
- package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +12 -24
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +21 -43
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +29 -49
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/package.json +5 -5
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +11 -15
- package/types/mintplayer-ng-bootstrap-alert.d.ts +4 -9
- package/types/mintplayer-ng-bootstrap-badge.d.ts +5 -9
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +14 -22
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +41 -35
- package/types/mintplayer-ng-bootstrap-close.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +4 -5
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +70 -97
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +11 -11
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +6 -13
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +14 -20
- package/types/mintplayer-ng-bootstrap-enhanced-paste.d.ts +1 -3
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-grid.d.ts +14 -26
- package/types/mintplayer-ng-bootstrap-let.d.ts +0 -2
- package/types/mintplayer-ng-bootstrap-markdown.d.ts +1 -5
- package/types/mintplayer-ng-bootstrap-modal.d.ts +3 -6
- package/types/mintplayer-ng-bootstrap-multiselect.d.ts +6 -6
- package/types/mintplayer-ng-bootstrap-navbar-toggler.d.ts +5 -11
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +75 -80
- package/types/mintplayer-ng-bootstrap-navigation-lock.d.ts +2 -4
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +12 -14
- package/types/mintplayer-ng-bootstrap-ordinal-number.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +17 -31
- package/types/mintplayer-ng-bootstrap-placeholder.d.ts +3 -8
- package/types/mintplayer-ng-bootstrap-playlist-toggler.d.ts +5 -11
- package/types/mintplayer-ng-bootstrap-popover.d.ts +15 -23
- package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +19 -22
- package/types/mintplayer-ng-bootstrap-range.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-rating.d.ts +8 -14
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +7 -11
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +132 -220
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +14 -15
- package/types/mintplayer-ng-bootstrap-searchbox.d.ts +20 -27
- package/types/mintplayer-ng-bootstrap-select.d.ts +13 -23
- package/types/mintplayer-ng-bootstrap-select2.d.ts +16 -14
- package/types/mintplayer-ng-bootstrap-shell.d.ts +6 -12
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +7 -12
- package/types/mintplayer-ng-bootstrap-spinner.d.ts +8 -16
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +21 -27
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +29 -37
- package/types/mintplayer-ng-bootstrap-table.d.ts +6 -13
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +7 -14
- package/types/mintplayer-ng-bootstrap-toast.d.ts +5 -10
- package/types/mintplayer-ng-bootstrap-toggle-button.d.ts +22 -36
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +4 -7
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +10 -15
- package/types/mintplayer-ng-bootstrap-trust-html.d.ts +0 -2
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +14 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-popover.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/popover/src/providers/popover-content.provider.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/component/popover.component.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/component/popover.component.html","../../../../libs/mintplayer-ng-bootstrap/popover/src/providers/portal-factory.provider.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover/popover.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover-body/popover-body.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover-header/popover-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/popover.module.ts","../../../../libs/mintplayer-ng-bootstrap/popover/mintplayer-ng-bootstrap-popover.ts"],"sourcesContent":["import { InjectionToken, TemplateRef } from \"@angular/core\";\n\nexport const POPOVER_CONTENT = new InjectionToken<TemplateRef<any>>('PopoverContent');","import { Component, HostBinding, Inject, Input, TemplateRef } from '@angular/core';\nimport { FadeInOutAnimation } from '@mintplayer/ng-animations';\nimport { Position } from '@mintplayer/ng-bootstrap';\nimport { BehaviorSubject, map, Observable } from 'rxjs';\nimport { POPOVER_CONTENT } from '../providers/popover-content.provider';\n\n@Component({\n selector: 'bs-popover',\n templateUrl: './popover.component.html',\n styleUrls: ['./popover.component.scss'],\n standalone: false,\n animations: [FadeInOutAnimation],\n})\nexport class BsPopoverComponent {\n constructor(@Inject(POPOVER_CONTENT) content: TemplateRef<any>) {\n this.template = content;\n this.marginClass$ = this.position$.pipe(map((position) => {\n switch (position) {\n case 'top': return 'mb-2';\n case 'start': return 'me-2';\n case 'end': return 'ms-2';\n default: return 'mt-2';\n }\n }));\n this.positionClass$ = this.position$\n .pipe(map(position => `bs-popover-${position}`));\n }\n\n //#region Position\n position$ = new BehaviorSubject<Position>('bottom');\n public get position() {\n return this.position$.value;\n }\n @Input() public set position(value: Position) {\n this.position$.next(value);\n }\n //#endregion\n //#region IsVisible\n isVisible$ = new BehaviorSubject<boolean>(false);\n public get isVisible() {\n return this.isVisible$.value;\n }\n @Input() public set isVisible(value: boolean) {\n this.isVisible$.next(value);\n }\n //#endregion\n\n marginClass$: Observable<string>;\n positionClass$: Observable<string>;\n\n template: TemplateRef<any>;\n\n @HostBinding('class.position-relative') positionRelative = true;\n}\n","@if (isVisible$ | async) {\n <div class=\"popover position-relative fade show\" role=\"tooltip\"\n [class]=\"[marginClass$ | async, positionClass$ | async]\"\n [@fadeInOut]>\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n <div class=\"popover-arrow position-absolute\"></div>\n <bs-has-overlay></bs-has-overlay>\n </div>\n}","import { ComponentPortal } from \"@angular/cdk/portal\";\nimport { InjectionToken, Injector } from \"@angular/core\";\n\nexport const PORTAL_FACTORY = new InjectionToken<(injector: Injector) => ComponentPortal<any>>('PopoverPortalFactory');","import { ConnectedPosition, Overlay, OverlayRef, PositionStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Position } from '@mintplayer/ng-bootstrap';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject, delay, map, Observable, take } from 'rxjs';\nimport { AfterViewInit, ComponentRef, DestroyRef, Directive, ElementRef, Host, Inject, Injector, Input, OnDestroy, SkipSelf, TemplateRef } from '@angular/core';\nimport { BsPopoverComponent } from '../../component/popover.component';\nimport { POPOVER_CONTENT } from '../../providers/popover-content.provider';\nimport { PORTAL_FACTORY } from '../../providers/portal-factory.provider';\n\n@Directive({\n selector: '*[bsPopover]',\n standalone: false,\n})\nexport class BsPopoverDirective implements AfterViewInit, OnDestroy {\n\n constructor(\n private overlay: Overlay,\n private destroy: DestroyRef,\n private templateRef: TemplateRef<any>,\n private parentInjector: Injector,\n @Inject(PORTAL_FACTORY) private portalFactory: (injector: Injector) => ComponentPortal<any>,\n @Host() @SkipSelf() private parent: ElementRef\n ) {\n this.position$.pipe(takeUntilDestroyed()).subscribe((position) => {\n if (this.component) {\n this.component.instance.position = position;\n }\n });\n this.isVisible$.pipe(takeUntilDestroyed()).subscribe((isVisible) => {\n if (this.component) {\n this.component.instance.isVisible = isVisible;\n }\n });\n this.connectedPosition$ = this.position$\n .pipe(delay(20), map((position) => {\n switch (position) {\n case 'top':\n return <ConnectedPosition>{\n originX: \"center\",\n originY: \"top\", //<--\n overlayX: \"center\",\n overlayY: \"bottom\"\n };\n case 'start':\n return <ConnectedPosition>{\n originX: \"start\", //<--\n originY: \"center\",\n overlayX: \"end\",\n overlayY: \"center\",\n };\n case 'end':\n return <ConnectedPosition>{\n originX: \"end\", //<--\n originY: \"center\",\n overlayX: \"start\",\n overlayY: \"center\"\n };\n default:\n return <ConnectedPosition>{\n originX: \"center\",\n originY: \"bottom\", //<--\n overlayX: \"center\",\n overlayY: \"top\"\n };\n }\n }));\n\n this.connectedPosition$\n .pipe(takeUntilDestroyed())\n .subscribe((connectedPosition) => {\n if (this.overlayRef) {\n this.overlayRef.updatePositionStrategy(this.overlay.position()\n .flexibleConnectedTo(this.parent)\n .withPositions([connectedPosition]));\n }\n });\n }\n\n @Input() public set bsPopover(value: Position) {\n this.position$.next(value);\n }\n\n @Input() public updatePosition = false;\n\n private injector: Injector | null = null;\n private portal: ComponentPortal<any> | null = null;\n private overlayRef: OverlayRef | null = null;\n private component: ComponentRef<BsPopoverComponent> | null = null;\n position$ = new BehaviorSubject<Position>('bottom');\n connectedPosition$: Observable<ConnectedPosition>;\n isVisible$ = new BehaviorSubject<boolean>(false);\n\n ngAfterViewInit() {\n this.connectedPosition$.pipe(take(1), takeUntilDestroyed(this.destroy)).subscribe((connectedPosition) => {\n this.injector = Injector.create({\n providers: [{ provide: POPOVER_CONTENT, useValue: this.templateRef }],\n parent: this.parentInjector\n });\n this.portal = this.portalFactory(this.injector);\n this.overlayRef = this.overlay.create({\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .flexibleConnectedTo(this.parent)\n .withPositions([connectedPosition]),\n });\n this.component = this.overlayRef.attach<BsPopoverComponent>(this.portal);\n this.component.instance.position = this.position$.value;\n });\n \n this.parent.nativeElement.onclick = () => {\n if (this.updatePosition) {\n this.overlayRef?.updatePosition();\n }\n this.isVisible$.next(!this.isVisible$.value);\n };\n }\n\n ngOnDestroy() {\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n selector: '[bsPopoverBody]',\n standalone: false,\n})\nexport class BsPopoverBodyDirective {\n @HostBinding('class.popover-body') bodyClass = true;\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n selector: '[bsPopoverHeader]',\n standalone: false,\n})\nexport class BsPopoverHeaderDirective {\n @HostBinding('class.popover-header') headerClass = true;\n}\n","import { Injector, NgModule } from '@angular/core';\nimport { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsPopoverComponent } from './component/popover.component';\nimport { BsPopoverDirective } from './directives/popover/popover.directive';\nimport { BsPopoverHeaderDirective } from './directives/popover-header/popover-header.directive';\nimport { BsPopoverBodyDirective } from './directives/popover-body/popover-body.directive';\nimport { PORTAL_FACTORY } from './providers/portal-factory.provider';\n\n@NgModule({\n declarations: [BsPopoverComponent, BsPopoverDirective, BsPopoverHeaderDirective, BsPopoverBodyDirective],\n imports: [AsyncPipe, NgTemplateOutlet, OverlayModule, BsHasOverlayComponent],\n exports: [BsPopoverDirective, BsPopoverHeaderDirective, BsPopoverBodyDirective],\n providers: [{\n provide: PORTAL_FACTORY,\n useValue: (injector: Injector) => {\n return new ComponentPortal(BsPopoverComponent, null, injector);\n }\n }]\n})\nexport class BsPopoverModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAEO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAmB,gBAAgB,CAAC;;MCWxE,kBAAkB,CAAA;AAC7B,IAAA,WAAA,CAAqC,OAAyB,EAAA;;AAe9D,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,eAAe,CAAW,QAAQ,CAAC;;;AASnD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;QAcR,IAAA,CAAA,gBAAgB,GAAG,IAAI;AArC7D,QA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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,aAPf,CAAC;AACV,gBAAA,OAAO,EAAE,cAAc;AACvB,gBAAA,QAAQ,EAAE,CAAC,QAAkB,KAAI;oBAC/B,OAAO,IAAI,eAAe,CAAC,kBAAkB,EAAE,IAAI,EAAE,QAAQ,CAAC;gBAChE;aACD,CAAC,EAAA,OAAA,EAAA,CAPqC,aAAa,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;;2FAShE,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,CAAC;oBACxG,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,qBAAqB,CAAC;AAC5E,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,CAAC;AAC/E,oBAAA,SAAS,EAAE,CAAC;AACV,4BAAA,OAAO,EAAE,cAAc;AACvB,4BAAA,QAAQ,EAAE,CAAC,QAAkB,KAAI;gCAC/B,OAAO,IAAI,eAAe,CAAC,kBAAkB,EAAE,IAAI,EAAE,QAAQ,CAAC;4BAChE;yBACD;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-popover.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/popover/src/providers/popover-content.provider.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/component/popover.component.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/component/popover.component.html","../../../../libs/mintplayer-ng-bootstrap/popover/src/providers/portal-factory.provider.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover/popover.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover-body/popover-body.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/directives/popover-header/popover-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/popover/src/popover.module.ts","../../../../libs/mintplayer-ng-bootstrap/popover/mintplayer-ng-bootstrap-popover.ts"],"sourcesContent":["import { InjectionToken, TemplateRef } from \"@angular/core\";\n\nexport const POPOVER_CONTENT = new InjectionToken<TemplateRef<any>>('PopoverContent');","import { ChangeDetectionStrategy, Component, computed, HostBinding, Inject, input, TemplateRef } from '@angular/core';\nimport { FadeInOutAnimation } from '@mintplayer/ng-animations';\nimport { Position } from '@mintplayer/ng-bootstrap';\nimport { POPOVER_CONTENT } from '../providers/popover-content.provider';\n\n@Component({\n selector: 'bs-popover',\n templateUrl: './popover.component.html',\n styleUrls: ['./popover.component.scss'],\n standalone: false,\n animations: [FadeInOutAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsPopoverComponent {\n constructor(@Inject(POPOVER_CONTENT) content: TemplateRef<any>) {\n this.template = content;\n }\n\n position = input<Position>('bottom');\n isVisible = input<boolean>(false);\n\n marginClass = computed(() => {\n switch (this.position()) {\n case 'top': return 'mb-2';\n case 'start': return 'me-2';\n case 'end': return 'ms-2';\n default: return 'mt-2';\n }\n });\n\n positionClass = computed(() => `bs-popover-${this.position()}`);\n\n template: TemplateRef<any>;\n\n @HostBinding('class.position-relative') positionRelative = true;\n}\n","@if (isVisible()) {\n <div class=\"popover position-relative fade show\" role=\"tooltip\"\n [class]=\"[marginClass(), positionClass()]\"\n [@fadeInOut]>\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n <div class=\"popover-arrow position-absolute\"></div>\n <bs-has-overlay></bs-has-overlay>\n </div>\n}\n","import { ComponentPortal } from \"@angular/cdk/portal\";\nimport { InjectionToken, Injector } from \"@angular/core\";\n\nexport const PORTAL_FACTORY = new InjectionToken<(injector: Injector) => ComponentPortal<any>>('PopoverPortalFactory');","import { ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Position } from '@mintplayer/ng-bootstrap';\nimport { AfterViewInit, ComponentRef, Directive, ElementRef, Host, inject, Injector, input, OnDestroy, signal, SkipSelf, TemplateRef, computed, effect } from '@angular/core';\nimport { BsPopoverComponent } from '../../component/popover.component';\nimport { POPOVER_CONTENT } from '../../providers/popover-content.provider';\nimport { PORTAL_FACTORY } from '../../providers/portal-factory.provider';\n\n@Directive({\n selector: '*[bsPopover]',\n standalone: false,\n})\nexport class BsPopoverDirective implements AfterViewInit, OnDestroy {\n\n private overlay = inject(Overlay);\n private templateRef = inject(TemplateRef<any>);\n private parentInjector = inject(Injector);\n private portalFactory = inject(PORTAL_FACTORY);\n private parent = inject(ElementRef, { host: true, skipSelf: true });\n\n bsPopover = input<Position>('bottom');\n updatePosition = input(false);\n\n private localInjector: Injector | null = null;\n private portal: ComponentPortal<any> | null = null;\n private overlayRef: OverlayRef | null = null;\n private component: ComponentRef<BsPopoverComponent> | null = null;\n isVisible = signal<boolean>(false);\n\n connectedPosition = computed<ConnectedPosition>(() => {\n const position = this.bsPopover();\n switch (position) {\n case 'top':\n return {\n originX: \"center\",\n originY: \"top\",\n overlayX: \"center\",\n overlayY: \"bottom\"\n };\n case 'start':\n return {\n originX: \"start\",\n originY: \"center\",\n overlayX: \"end\",\n overlayY: \"center\",\n };\n case 'end':\n return {\n originX: \"end\",\n originY: \"center\",\n overlayX: \"start\",\n overlayY: \"center\"\n };\n default:\n return {\n originX: \"center\",\n originY: \"bottom\",\n overlayX: \"center\",\n overlayY: \"top\"\n };\n }\n });\n\n constructor() {\n effect(() => {\n const position = this.bsPopover();\n if (this.component) {\n this.component.setInput('position', position);\n }\n });\n\n effect(() => {\n const isVisible = this.isVisible();\n if (this.component) {\n this.component.setInput('isVisible', isVisible);\n }\n });\n\n effect(() => {\n const connectedPosition = this.connectedPosition();\n if (this.overlayRef) {\n setTimeout(() => {\n this.overlayRef?.updatePositionStrategy(this.overlay.position()\n .flexibleConnectedTo(this.parent)\n .withPositions([connectedPosition]));\n }, 20);\n }\n });\n }\n\n ngAfterViewInit() {\n const connectedPosition = this.connectedPosition();\n this.localInjector = Injector.create({\n providers: [{ provide: POPOVER_CONTENT, useValue: this.templateRef }],\n parent: this.parentInjector\n });\n this.portal = this.portalFactory(this.localInjector);\n this.overlayRef = this.overlay.create({\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .flexibleConnectedTo(this.parent)\n .withPositions([connectedPosition]),\n });\n this.component = this.overlayRef.attach<BsPopoverComponent>(this.portal);\n this.component.setInput('position', this.bsPopover());\n\n this.parent.nativeElement.onclick = () => {\n if (this.updatePosition()) {\n this.overlayRef?.updatePosition();\n }\n this.isVisible.set(!this.isVisible());\n };\n }\n\n ngOnDestroy() {\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n }\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n selector: '[bsPopoverBody]',\n standalone: false,\n})\nexport class BsPopoverBodyDirective {\n @HostBinding('class.popover-body') bodyClass = true;\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n selector: '[bsPopoverHeader]',\n standalone: false,\n})\nexport class BsPopoverHeaderDirective {\n @HostBinding('class.popover-header') headerClass = true;\n}\n","import { Injector, NgModule } from '@angular/core';\nimport { AsyncPipe, NgTemplateOutlet } from '@angular/common';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { BsHasOverlayComponent } from '@mintplayer/ng-bootstrap/has-overlay';\nimport { BsPopoverComponent } from './component/popover.component';\nimport { BsPopoverDirective } from './directives/popover/popover.directive';\nimport { BsPopoverHeaderDirective } from './directives/popover-header/popover-header.directive';\nimport { BsPopoverBodyDirective } from './directives/popover-body/popover-body.directive';\nimport { PORTAL_FACTORY } from './providers/portal-factory.provider';\n\n@NgModule({\n declarations: [BsPopoverComponent, BsPopoverDirective, BsPopoverHeaderDirective, BsPopoverBodyDirective],\n imports: [AsyncPipe, NgTemplateOutlet, OverlayModule, BsHasOverlayComponent],\n exports: [BsPopoverDirective, BsPopoverHeaderDirective, BsPopoverBodyDirective],\n providers: [{\n provide: PORTAL_FACTORY,\n useValue: (injector: Injector) => {\n return new ComponentPortal(BsPopoverComponent, null, injector);\n }\n }]\n})\nexport class BsPopoverModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAmB,gBAAgB,CAAC;;MCWxE,kBAAkB,CAAA;AAC7B,IAAA,WAAA,CAAqC,OAAyB,EAAA;AAI9D,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAW,QAAQ,oDAAC;AACpC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,KAAK,qDAAC;AAEjC,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;AAC1B,YAAA,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACrB,gBAAA,KAAK,KAAK,EAAE,OAAO,MAAM;AACzB,gBAAA,KAAK,OAAO,EAAE,OAAO,MAAM;AAC3B,gBAAA,KAAK,KAAK,EAAE,OAAO,MAAM;AACzB,gBAAA,SAAS,OAAO,MAAM;;AAE1B,QAAA,CAAC,uDAAC;AAEF,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAA,WAAA,EAAc,IAAI,CAAC,QAAQ,EAAE,CAAA,CAAE,yDAAC;QAIvB,IAAA,CAAA,gBAAgB,GAAG,IAAI;AAnB7D,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;IACzB;AAHW,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA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gBAAgB,EAAE,aAAa,EAAE,qBAAqB,aACjE,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAQnE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,aAPf,CAAC;AACV,gBAAA,OAAO,EAAE,cAAc;AACvB,gBAAA,QAAQ,EAAE,CAAC,QAAkB,KAAI;oBAC/B,OAAO,IAAI,eAAe,CAAC,kBAAkB,EAAE,IAAI,EAAE,QAAQ,CAAC;gBAChE;aACD,CAAC,EAAA,OAAA,EAAA,CAPqC,aAAa,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;;2FAShE,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,CAAC;oBACxG,OAAO,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,qBAAqB,CAAC;AAC5E,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,CAAC;AAC/E,oBAAA,SAAS,EAAE,CAAC;AACV,4BAAA,OAAO,EAAE,cAAc;AACvB,4BAAA,QAAQ,EAAE,CAAC,QAAkB,KAAI;gCAC/B,OAAO,IAAI,eAAe,CAAC,kBAAkB,EAAE,IAAI,EAAE,QAAQ,CAAC;4BAChE;yBACD;AACF,iBAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostBinding, Input, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { HostBinding, Input, Component, input, computed, effect, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
4
|
import { Color } from '@mintplayer/ng-bootstrap';
|
|
6
|
-
import { BehaviorSubject, combineLatest, map } from 'rxjs';
|
|
7
5
|
|
|
8
6
|
class BsProgressComponent {
|
|
9
7
|
constructor() {
|
|
@@ -35,12 +33,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
35
33
|
|
|
36
34
|
class BsProgressBarComponent {
|
|
37
35
|
constructor() {
|
|
38
|
-
this.minimum
|
|
39
|
-
this.maximum
|
|
40
|
-
this.value
|
|
41
|
-
this.color
|
|
42
|
-
this.striped = false;
|
|
43
|
-
this.animated = false;
|
|
36
|
+
this.minimum = input(0, ...(ngDevMode ? [{ debugName: "minimum" }] : []));
|
|
37
|
+
this.maximum = input(100, ...(ngDevMode ? [{ debugName: "maximum" }] : []));
|
|
38
|
+
this.value = input(50, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
39
|
+
this.color = input(Color.primary, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
40
|
+
this.striped = input(false, ...(ngDevMode ? [{ debugName: "striped" }] : []));
|
|
41
|
+
this.animated = input(false, ...(ngDevMode ? [{ debugName: "animated" }] : []));
|
|
42
|
+
this.percentage = computed(() => {
|
|
43
|
+
const min = this.minimum();
|
|
44
|
+
const max = this.maximum();
|
|
45
|
+
const val = this.value();
|
|
46
|
+
return (val - min) / (max - min) * 100;
|
|
47
|
+
}, ...(ngDevMode ? [{ debugName: "percentage" }] : []));
|
|
48
|
+
this.width = computed(() => `${this.percentage()}%`, ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
49
|
+
this.colorClassComputed = computed(() => {
|
|
50
|
+
const name = Color[this.color()];
|
|
51
|
+
return `bg-${name}`;
|
|
52
|
+
}, ...(ngDevMode ? [{ debugName: "colorClassComputed" }] : []));
|
|
44
53
|
this.progressBar = true;
|
|
45
54
|
this.colorClass = 'bg-primary';
|
|
46
55
|
this.widthStyle = '0';
|
|
@@ -48,69 +57,31 @@ class BsProgressBarComponent {
|
|
|
48
57
|
this.valueNow = 50;
|
|
49
58
|
this.valueMin = 0;
|
|
50
59
|
this.valueMax = 100;
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
}));
|
|
59
|
-
this.colorClass$ = this.color$
|
|
60
|
-
.pipe(map((color) => {
|
|
61
|
-
const name = Color[color];
|
|
62
|
-
return `bg-${name}`;
|
|
63
|
-
}));
|
|
64
|
-
this.colorClass$.pipe(takeUntilDestroyed())
|
|
65
|
-
.subscribe(color => this.colorClass = color);
|
|
66
|
-
this.width$.pipe(takeUntilDestroyed())
|
|
67
|
-
.subscribe(width => this.widthStyle = width);
|
|
68
|
-
this.value$.pipe(takeUntilDestroyed())
|
|
69
|
-
.subscribe(value => this.valueNow = value);
|
|
70
|
-
this.minimum$.pipe(takeUntilDestroyed())
|
|
71
|
-
.subscribe(value => this.valueMin = value);
|
|
72
|
-
this.maximum$.pipe(takeUntilDestroyed())
|
|
73
|
-
.subscribe(value => this.valueMax = value);
|
|
74
|
-
}
|
|
75
|
-
set minimum(value) {
|
|
76
|
-
this.minimum$.next(value);
|
|
77
|
-
}
|
|
78
|
-
set maximum(value) {
|
|
79
|
-
this.maximum$.next(value);
|
|
80
|
-
}
|
|
81
|
-
set value(value) {
|
|
82
|
-
this.value$.next(value);
|
|
83
|
-
}
|
|
84
|
-
set color(value) {
|
|
85
|
-
this.color$.next(value);
|
|
60
|
+
effect(() => {
|
|
61
|
+
this.colorClass = this.colorClassComputed();
|
|
62
|
+
this.widthStyle = this.width();
|
|
63
|
+
this.valueNow = this.value();
|
|
64
|
+
this.valueMin = this.minimum();
|
|
65
|
+
this.valueMax = this.maximum();
|
|
66
|
+
});
|
|
86
67
|
}
|
|
68
|
+
get stripedClass() { return this.striped(); }
|
|
69
|
+
get animatedClass() { return this.animated(); }
|
|
87
70
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
88
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
71
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: BsProgressBarComponent, isStandalone: false, selector: "bs-progress-bar", inputs: { minimum: { classPropertyName: "minimum", publicName: "minimum", isSignal: true, isRequired: false, transformFunction: null }, maximum: { classPropertyName: "maximum", publicName: "maximum", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.progress-bar": "this.progressBar", "class.progress-bar-striped": "this.stripedClass", "class.progress-bar-animated": "this.animatedClass", "class": "this.colorClass", "style.width": "this.widthStyle", "attr.role": "this.role", "attr.aria-valuenow": "this.valueNow", "attr.aria-valuemin": "this.valueMin", "attr.aria-valuemax": "this.valueMax" } }, ngImport: i0, template: "", styles: ["@keyframes progress-bar-stripes{0%{background-position-x:var(--bs-progress-height)}}:host ::ng-deep .progress,:host ::ng-deep .progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size: .75rem;--bs-progress-bg: var(--bs-secondary-bg);--bs-progress-border-radius: var(--bs-border-radius);--bs-progress-box-shadow: var(--bs-box-shadow-inset);--bs-progress-bar-color: #fff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width .6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}:host ::ng-deep .progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar{transition:none}}:host ::ng-deep .progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}:host ::ng-deep .progress-stacked>.progress{overflow:visible}:host ::ng-deep .progress-stacked>.progress>.progress-bar{width:100%}:host ::ng-deep .progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar-animated{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
89
72
|
}
|
|
90
73
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsProgressBarComponent, decorators: [{
|
|
91
74
|
type: Component,
|
|
92
|
-
args: [{ selector: 'bs-progress-bar', standalone: false, template: "", styles: ["@keyframes progress-bar-stripes{0%{background-position-x:var(--bs-progress-height)}}:host ::ng-deep .progress,:host ::ng-deep .progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size: .75rem;--bs-progress-bg: var(--bs-secondary-bg);--bs-progress-border-radius: var(--bs-border-radius);--bs-progress-box-shadow: var(--bs-box-shadow-inset);--bs-progress-bar-color: #fff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width .6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}:host ::ng-deep .progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar{transition:none}}:host ::ng-deep .progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}:host ::ng-deep .progress-stacked>.progress{overflow:visible}:host ::ng-deep .progress-stacked>.progress>.progress-bar{width:100%}:host ::ng-deep .progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar-animated{animation:none}}\n"] }]
|
|
93
|
-
}], ctorParameters: () => [], propDecorators: { minimum: [{
|
|
94
|
-
type:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}], value: [{
|
|
98
|
-
type: Input
|
|
99
|
-
}], color: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], striped: [{
|
|
102
|
-
type: Input
|
|
103
|
-
}, {
|
|
75
|
+
args: [{ selector: 'bs-progress-bar', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "", styles: ["@keyframes progress-bar-stripes{0%{background-position-x:var(--bs-progress-height)}}:host ::ng-deep .progress,:host ::ng-deep .progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size: .75rem;--bs-progress-bg: var(--bs-secondary-bg);--bs-progress-border-radius: var(--bs-border-radius);--bs-progress-box-shadow: var(--bs-box-shadow-inset);--bs-progress-bar-color: #fff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width .6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}:host ::ng-deep .progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar{transition:none}}:host ::ng-deep .progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}:host ::ng-deep .progress-stacked>.progress{overflow:visible}:host ::ng-deep .progress-stacked>.progress>.progress-bar{width:100%}:host ::ng-deep .progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion:reduce){:host ::ng-deep .progress-bar-animated{animation:none}}\n"] }]
|
|
76
|
+
}], ctorParameters: () => [], propDecorators: { minimum: [{ type: i0.Input, args: [{ isSignal: true, alias: "minimum", required: false }] }], maximum: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximum", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], progressBar: [{
|
|
77
|
+
type: HostBinding,
|
|
78
|
+
args: ['class.progress-bar']
|
|
79
|
+
}], stripedClass: [{
|
|
104
80
|
type: HostBinding,
|
|
105
81
|
args: ['class.progress-bar-striped']
|
|
106
|
-
}],
|
|
107
|
-
type: Input
|
|
108
|
-
}, {
|
|
82
|
+
}], animatedClass: [{
|
|
109
83
|
type: HostBinding,
|
|
110
84
|
args: ['class.progress-bar-animated']
|
|
111
|
-
}], progressBar: [{
|
|
112
|
-
type: HostBinding,
|
|
113
|
-
args: ['class.progress-bar']
|
|
114
85
|
}], colorClass: [{
|
|
115
86
|
type: HostBinding,
|
|
116
87
|
args: ['class']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-progress-bar.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress/progress.component.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress/progress.component.html","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar/progress-bar.component.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar/progress-bar.component.html","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar.module.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/mintplayer-ng-bootstrap-progress-bar.ts"],"sourcesContent":["import { Component, HostBinding, Input } from '@angular/core';\n\n@Component({\n selector: 'bs-progress',\n templateUrl: './progress.component.html',\n styleUrls: ['./progress.component.scss'],\n standalone: false,\n})\nexport class BsProgressComponent {\n // @HostBinding('class.progress') private progressClass = true;\n @Input() @HostBinding('style.height.px') public height: number | null = null;\n @Input() public isIndeterminate = false;\n\n @HostBinding('class.d-block')\n @HostBinding('class.overflow-hidden')\n progressClass = true;\n\n}\n","<div class=\"progress\">\n @if (isIndeterminate) {\n <div class=\"progress-bar progress-bar-infinite bg-primary\" role=\"progressbar\" aria-valuenow=\"infinite\"></div>\n } @else {\n <ng-content></ng-content>\n }\n</div>","import { Component,
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-progress-bar.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress/progress.component.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress/progress.component.html","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar/progress-bar.component.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar/progress-bar.component.html","../../../../libs/mintplayer-ng-bootstrap/progress-bar/src/progress-bar.module.ts","../../../../libs/mintplayer-ng-bootstrap/progress-bar/mintplayer-ng-bootstrap-progress-bar.ts"],"sourcesContent":["import { Component, HostBinding, Input } from '@angular/core';\n\n@Component({\n selector: 'bs-progress',\n templateUrl: './progress.component.html',\n styleUrls: ['./progress.component.scss'],\n standalone: false,\n})\nexport class BsProgressComponent {\n // @HostBinding('class.progress') private progressClass = true;\n @Input() @HostBinding('style.height.px') public height: number | null = null;\n @Input() public isIndeterminate = false;\n\n @HostBinding('class.d-block')\n @HostBinding('class.overflow-hidden')\n progressClass = true;\n\n}\n","<div class=\"progress\">\n @if (isIndeterminate) {\n <div class=\"progress-bar progress-bar-infinite bg-primary\" role=\"progressbar\" aria-valuenow=\"infinite\"></div>\n } @else {\n <ng-content></ng-content>\n }\n</div>","import { ChangeDetectionStrategy, Component, computed, effect, HostBinding, input } from '@angular/core';\nimport { Color } from '@mintplayer/ng-bootstrap';\n\n@Component({\n selector: 'bs-progress-bar',\n templateUrl: './progress-bar.component.html',\n styleUrls: ['./progress-bar.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsProgressBarComponent {\n\n constructor() {\n effect(() => {\n this.colorClass = this.colorClassComputed();\n this.widthStyle = this.width();\n this.valueNow = this.value();\n this.valueMin = this.minimum();\n this.valueMax = this.maximum();\n });\n }\n\n minimum = input<number>(0);\n maximum = input<number>(100);\n value = input<number>(50);\n color = input<Color>(Color.primary);\n striped = input(false);\n animated = input(false);\n\n percentage = computed(() => {\n const min = this.minimum();\n const max = this.maximum();\n const val = this.value();\n return (val - min) / (max - min) * 100;\n });\n\n width = computed(() => `${this.percentage()}%`);\n\n colorClassComputed = computed(() => {\n const name = Color[this.color()];\n return `bg-${name}`;\n });\n\n @HostBinding('class.progress-bar') progressBar = true;\n @HostBinding('class.progress-bar-striped') get stripedClass() { return this.striped(); }\n @HostBinding('class.progress-bar-animated') get animatedClass() { return this.animated(); }\n @HostBinding('class') colorClass = 'bg-primary';\n @HostBinding('style.width') widthStyle = '0';\n @HostBinding('attr.role') role = 'progressbar';\n @HostBinding('attr.aria-valuenow') valueNow = 50;\n @HostBinding('attr.aria-valuemin') valueMin = 0;\n @HostBinding('attr.aria-valuemax') valueMax = 100;\n}\n","","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsProgressComponent } from './progress/progress.component';\nimport { BsProgressBarComponent } from './progress-bar/progress-bar.component';\n\n\n\n@NgModule({\n declarations: [\n BsProgressBarComponent,\n BsProgressComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n BsProgressBarComponent,\n BsProgressComponent\n ]\n})\nexport class BsProgressBarModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAQa,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;;QAQkD,IAAA,CAAA,MAAM,GAAkB,IAAI;QAC5D,IAAA,CAAA,eAAe,GAAG,KAAK;QAIvC,IAAA,CAAA,aAAa,GAAG,IAAI;AAErB,IAAA;8GATY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,4RCRhC,qPAMM,EAAA,MAAA,EAAA,CAAA,otDAAA,CAAA,EAAA,CAAA,CAAA;;2FDEO,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,cAGX,KAAK,EAAA,QAAA,EAAA,qPAAA,EAAA,MAAA,EAAA,CAAA,otDAAA,CAAA,EAAA;;sBAIhB;;sBAAS,WAAW;uBAAC,iBAAiB;;sBACtC;;sBAEA,WAAW;uBAAC,eAAe;;sBAC3B,WAAW;uBAAC,uBAAuB;;;MEJzB,sBAAsB,CAAA;AAEjC,IAAA,WAAA,GAAA;AAUA,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,CAAC,mDAAC;AAC1B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK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uBAAC,WAAW;;sBACvB,WAAW;uBAAC,oBAAoB;;sBAChC,WAAW;uBAAC,oBAAoB;;sBAChC,WAAW;uBAAC,oBAAoB;;;ME/BtB,mBAAmB,CAAA;8GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,iBAX5B,sBAAsB;YACtB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAGnB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,sBAAsB;YACtB,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAGV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAP5B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAOH,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAb/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,sBAAsB;wBACtB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,sBAAsB;wBACtB;AACD;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, ViewChild, Component, forwardRef, Directive, NgModule } from '@angular/core';
|
|
2
|
+
import { Input, ViewChild, Component, inject, DestroyRef, forwardRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -29,9 +29,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
29
29
|
}] } });
|
|
30
30
|
|
|
31
31
|
class BsRangeValueAccessor {
|
|
32
|
-
constructor(
|
|
33
|
-
this.host =
|
|
34
|
-
this.destroy =
|
|
32
|
+
constructor() {
|
|
33
|
+
this.host = inject(BsRangeComponent);
|
|
34
|
+
this.destroy = inject(DestroyRef);
|
|
35
35
|
}
|
|
36
36
|
ngAfterViewInit() {
|
|
37
37
|
fromEvent(this.host.slider.nativeElement, 'input')
|
|
@@ -60,7 +60,7 @@ class BsRangeValueAccessor {
|
|
|
60
60
|
this.host.slider.nativeElement.disabled = isDisabled;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsRangeValueAccessor, deps: [
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsRangeValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
64
64
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsRangeValueAccessor, isStandalone: false, selector: "bs-range", providers: [{
|
|
65
65
|
provide: NG_VALUE_ACCESSOR,
|
|
66
66
|
useExisting: forwardRef(() => BsRangeValueAccessor),
|
|
@@ -78,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
78
78
|
multi: true,
|
|
79
79
|
}],
|
|
80
80
|
}]
|
|
81
|
-
}]
|
|
81
|
+
}] });
|
|
82
82
|
|
|
83
83
|
class BsRangeModule {
|
|
84
84
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsRangeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-range.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/range/src/component/range.component.ts","../../../../libs/mintplayer-ng-bootstrap/range/src/component/range.component.html","../../../../libs/mintplayer-ng-bootstrap/range/src/value-accessor/range-value-accessor.ts","../../../../libs/mintplayer-ng-bootstrap/range/src/range.module.ts","../../../../libs/mintplayer-ng-bootstrap/range/mintplayer-ng-bootstrap-range.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild } from '@angular/core';\n\n@Component({\n selector: 'bs-range',\n templateUrl: './range.component.html',\n styleUrls: ['./range.component.scss'],\n standalone: false,\n})\nexport class BsRangeComponent {\n @ViewChild('slider') slider!: ElementRef<HTMLInputElement>;\n \n @Input() min = 0;\n @Input() max = 10;\n @Input() step = 1;\n}\n","<input #slider type=\"range\" [min]=\"min\" [max]=\"max\" [step]=\"step\" class=\"form-range\">\n","import { AfterViewInit, DestroyRef, Directive, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\nimport { BsRangeComponent } from '../component/range.component';\n\n@Directive({\n selector: 'bs-range',\n standalone: false,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BsRangeValueAccessor),\n multi: true,\n }],\n})\nexport class BsRangeValueAccessor implements ControlValueAccessor, AfterViewInit {\n
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-range.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/range/src/component/range.component.ts","../../../../libs/mintplayer-ng-bootstrap/range/src/component/range.component.html","../../../../libs/mintplayer-ng-bootstrap/range/src/value-accessor/range-value-accessor.ts","../../../../libs/mintplayer-ng-bootstrap/range/src/range.module.ts","../../../../libs/mintplayer-ng-bootstrap/range/mintplayer-ng-bootstrap-range.ts"],"sourcesContent":["import { Component, ElementRef, Input, ViewChild } from '@angular/core';\n\n@Component({\n selector: 'bs-range',\n templateUrl: './range.component.html',\n styleUrls: ['./range.component.scss'],\n standalone: false,\n})\nexport class BsRangeComponent {\n @ViewChild('slider') slider!: ElementRef<HTMLInputElement>;\n \n @Input() min = 0;\n @Input() max = 10;\n @Input() step = 1;\n}\n","<input #slider type=\"range\" [min]=\"min\" [max]=\"max\" [step]=\"step\" class=\"form-range\">\n","import { AfterViewInit, DestroyRef, Directive, forwardRef, inject } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\nimport { BsRangeComponent } from '../component/range.component';\n\n@Directive({\n selector: 'bs-range',\n standalone: false,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => BsRangeValueAccessor),\n multi: true,\n }],\n})\nexport class BsRangeValueAccessor implements ControlValueAccessor, AfterViewInit {\n private host = inject(BsRangeComponent);\n private destroy = inject(DestroyRef);\n\n onValueChange?: (value: number) => void;\n onTouched?: () => void;\n\n ngAfterViewInit() {\n fromEvent(this.host.slider.nativeElement, 'input')\n .pipe(takeUntilDestroyed(this.destroy))\n .subscribe((ev) => {\n if (this.onValueChange) {\n const val = parseFloat((<HTMLInputElement>ev.target).value);\n this.onValueChange(val);\n }\n });\n }\n\n //#region ControlValueAccessor implementation\n registerOnChange(fn: (_: any) => void) {\n this.onValueChange = fn;\n }\n \n registerOnTouched(fn: () => void) {\n this.onTouched = fn;\n }\n\n writeValue(value?: number) {\n if (this.host.slider && (typeof value === 'number')) {\n this.host.slider.nativeElement.value = value.toString();\n }\n }\n\n setDisabledState(isDisabled: boolean) {\n if (this.host.slider) {\n this.host.slider.nativeElement.disabled = isDisabled;\n }\n }\n //#endregion\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsRangeComponent } from './component/range.component';\nimport { BsRangeValueAccessor } from './value-accessor/range-value-accessor';\n\n@NgModule({\n declarations: [BsRangeComponent, BsRangeValueAccessor],\n imports: [CommonModule],\n exports: [BsRangeComponent, BsRangeValueAccessor],\n})\nexport class BsRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAQa,gBAAgB,CAAA;AAN7B,IAAA,WAAA,GAAA;QASW,IAAA,CAAA,GAAG,GAAG,CAAC;QACP,IAAA,CAAA,GAAG,GAAG,EAAE;QACR,IAAA,CAAA,IAAI,GAAG,CAAC;AAClB,IAAA;8GANY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,yNCR7B,mGACA,EAAA,MAAA,EAAA,CAAA,44DAAA,CAAA,EAAA,CAAA,CAAA;;2FDOa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,cAGR,KAAK,EAAA,QAAA,EAAA,mGAAA,EAAA,MAAA,EAAA,CAAA,44DAAA,CAAA,EAAA;;sBAGhB,SAAS;uBAAC,QAAQ;;sBAElB;;sBACA;;sBACA;;;MEEU,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;AAUU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC/B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAsCrC,IAAA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,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,69 +1,41 @@
|
|
|
1
|
-
import { AsyncPipe } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { BehaviorSubject, combineLatest, map } from 'rxjs';
|
|
2
|
+
import { input, model, signal, output, computed, effect, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
3
|
|
|
7
4
|
class BsRatingComponent {
|
|
8
5
|
constructor() {
|
|
9
|
-
this.maximum
|
|
10
|
-
this.value
|
|
11
|
-
this.previewValue
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.stars$ = combineLatest([this.maximum$, this.previewValue$, this.value$])
|
|
17
|
-
.pipe(map(([maximum, previewValue, value]) => {
|
|
18
|
-
const v = previewValue ?? value;
|
|
6
|
+
this.maximum = input(5, ...(ngDevMode ? [{ debugName: "maximum" }] : []));
|
|
7
|
+
this.value = model(3, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
8
|
+
this.previewValue = signal(null, ...(ngDevMode ? [{ debugName: "previewValue" }] : []));
|
|
9
|
+
this.starsChange = output();
|
|
10
|
+
this.stars = computed(() => {
|
|
11
|
+
const v = this.previewValue() ?? this.value();
|
|
12
|
+
const max = this.maximum();
|
|
19
13
|
return [
|
|
20
|
-
...[...Array(v).keys()].map(
|
|
21
|
-
...[...Array(
|
|
14
|
+
...[...Array(v).keys()].map(() => true),
|
|
15
|
+
...[...Array(max - v).keys()].map(() => false)
|
|
22
16
|
];
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
.subscribe(([previewValue, value]) => {
|
|
27
|
-
const v = previewValue ?? value;
|
|
17
|
+
}, ...(ngDevMode ? [{ debugName: "stars" }] : []));
|
|
18
|
+
effect(() => {
|
|
19
|
+
const v = this.previewValue() ?? this.value();
|
|
28
20
|
this.starsChange.emit(v);
|
|
29
21
|
});
|
|
30
22
|
}
|
|
31
|
-
//#region Maximum
|
|
32
|
-
set maximum(value) {
|
|
33
|
-
this.maximum$.next(value);
|
|
34
|
-
}
|
|
35
|
-
get value() {
|
|
36
|
-
return this.value$.value;
|
|
37
|
-
}
|
|
38
|
-
set value(value) {
|
|
39
|
-
this.value$.next(value);
|
|
40
|
-
this.valueChange.emit(value);
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
23
|
hoverValue(index) {
|
|
44
|
-
this.previewValue
|
|
24
|
+
this.previewValue.set(index + 1);
|
|
45
25
|
}
|
|
46
26
|
selectValue(index) {
|
|
47
|
-
this.value
|
|
27
|
+
this.value.set(index + 1);
|
|
48
28
|
}
|
|
49
29
|
onMouseLeave() {
|
|
50
|
-
this.previewValue
|
|
30
|
+
this.previewValue.set(null);
|
|
51
31
|
}
|
|
52
32
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsRatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
53
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsRatingComponent, isStandalone: true, selector: "bs-rating", inputs: { maximum: "maximum", value: "value" }, outputs: {
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsRatingComponent, isStandalone: true, selector: "bs-rating", inputs: { maximum: { classPropertyName: "maximum", publicName: "maximum", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", starsChange: "starsChange" }, host: { listeners: { "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "@for (star of stars(); let i = $index; track i) {\n <span class=\"cursor-pointer\" (mouseenter)=\"hoverValue(i)\" (click)=\"selectValue(i)\">\n {{ star ? '★' : '☆' }}\n </span>\n}\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
54
34
|
}
|
|
55
35
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsRatingComponent, decorators: [{
|
|
56
36
|
type: Component,
|
|
57
|
-
args: [{ selector: 'bs-rating', standalone: true,
|
|
58
|
-
}], ctorParameters: () => [], propDecorators: { maximum: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], valueChange: [{
|
|
61
|
-
type: Output
|
|
62
|
-
}], starsChange: [{
|
|
63
|
-
type: Output
|
|
64
|
-
}], value: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}], onMouseLeave: [{
|
|
37
|
+
args: [{ selector: 'bs-rating', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (star of stars(); let i = $index; track i) {\n <span class=\"cursor-pointer\" (mouseenter)=\"hoverValue(i)\" (click)=\"selectValue(i)\">\n {{ star ? '★' : '☆' }}\n </span>\n}\n" }]
|
|
38
|
+
}], ctorParameters: () => [], propDecorators: { maximum: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximum", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], starsChange: [{ type: i0.Output, args: ["starsChange"] }], onMouseLeave: [{
|
|
67
39
|
type: HostListener,
|
|
68
40
|
args: ['mouseleave']
|
|
69
41
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-rating.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/rating/src/component/rating.component.ts","../../../../libs/mintplayer-ng-bootstrap/rating/src/component/rating.component.html","../../../../libs/mintplayer-ng-bootstrap/rating/mintplayer-ng-bootstrap-rating.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-rating.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/rating/src/component/rating.component.ts","../../../../libs/mintplayer-ng-bootstrap/rating/src/component/rating.component.html","../../../../libs/mintplayer-ng-bootstrap/rating/mintplayer-ng-bootstrap-rating.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, HostListener, input, model, output, signal } from '@angular/core';\n\n@Component({\n selector: 'bs-rating',\n standalone: true,\n templateUrl: './rating.component.html',\n styleUrls: ['./rating.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsRatingComponent {\n\n constructor() {\n effect(() => {\n const v = this.previewValue() ?? this.value();\n this.starsChange.emit(v);\n });\n }\n\n maximum = input<number>(5);\n value = model<number>(3);\n previewValue = signal<number | null>(null);\n starsChange = output<number>();\n\n stars = computed(() => {\n const v = this.previewValue() ?? this.value();\n const max = this.maximum();\n return [\n ...[...Array(v).keys()].map(() => true),\n ...[...Array(max - v).keys()].map(() => false)\n ];\n });\n\n hoverValue(index: number) {\n this.previewValue.set(index + 1);\n }\n\n selectValue(index: number) {\n this.value.set(index + 1);\n }\n\n @HostListener('mouseleave') onMouseLeave() {\n this.previewValue.set(null);\n }\n}\n","@for (star of stars(); let i = $index; track i) {\n <span class=\"cursor-pointer\" (mouseenter)=\"hoverValue(i)\" (click)=\"selectValue(i)\">\n {{ star ? '★' : '☆' }}\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MASa,iBAAiB,CAAA;AAE5B,IAAA,WAAA,GAAA;AAOA,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,CAAC,mDAAC;AAC1B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,CAAC,iDAAC;AACxB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAgB,IAAI,wDAAC;QAC1C,IAAA,CAAA,WAAW,GAAG,MAAM,EAAU;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAK;YACpB,MAAM,CAAC,GAAG,IAAI,CAAC,Y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