@smartsoft001-mobilems/angular 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, inject, PLATFORM_ID, signal, effect, computed, Component, Directive, contentChild, HostListener, Inject, APP_INITIALIZER, NgModule } from '@angular/core';
3
+ import { Injectable, inject, PLATFORM_ID, signal, effect, computed, Component, Directive, contentChild, HostListener, Inject, ElementRef, input, APP_INITIALIZER, NgModule } from '@angular/core';
4
4
  import { Meta, Title, DomSanitizer } from '@angular/platform-browser';
5
5
  import { StyleService as StyleService$1, ReduxAction, AppBaseComponent, PageBaseComponent, BaseComponent } from '@smartsoft001/angular';
6
6
  import { HttpClient } from '@angular/common/http';
@@ -1333,6 +1333,161 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
1333
1333
 
1334
1334
  const COMPONENTS = [AppComponent];
1335
1335
 
1336
+ /**
1337
+ * Directive that adds a "hover" CSS class to the host element on mouse enter
1338
+ * and removes it on mouse leave.
1339
+ *
1340
+ * @example
1341
+ * ```html
1342
+ * <div smartHover>Hover me</div>
1343
+ * ```
1344
+ */
1345
+ class HoverDirective {
1346
+ constructor() {
1347
+ this.el = inject(ElementRef);
1348
+ }
1349
+ /**
1350
+ * Adds the "hover" class when the mouse enters the element
1351
+ */
1352
+ onMouseEnter() {
1353
+ this.el.nativeElement.classList.add('hover');
1354
+ }
1355
+ /**
1356
+ * Removes the "hover" class when the mouse leaves the element
1357
+ */
1358
+ onMouseLeave() {
1359
+ this.el.nativeElement.classList.remove('hover');
1360
+ }
1361
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1362
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.0", type: HoverDirective, isStandalone: true, selector: "[smartHover]", host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 }); }
1363
+ }
1364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: HoverDirective, decorators: [{
1365
+ type: Directive,
1366
+ args: [{
1367
+ selector: '[smartHover]',
1368
+ standalone: true,
1369
+ }]
1370
+ }], propDecorators: { onMouseEnter: [{
1371
+ type: HostListener,
1372
+ args: ['mouseenter']
1373
+ }], onMouseLeave: [{
1374
+ type: HostListener,
1375
+ args: ['mouseleave']
1376
+ }] } });
1377
+
1378
+ /**
1379
+ * Directive that provides programmatic scrolling and overflow detection
1380
+ * for horizontally or vertically scrollable containers.
1381
+ *
1382
+ * @example
1383
+ * ```html
1384
+ * <div smartScrollable [scrollUnit]="200" #scroll="smartScrollable">
1385
+ * <!-- scrollable content -->
1386
+ * </div>
1387
+ * <button (click)="scroll.scrollHorizontal(1)" [disabled]="!scroll.canScrollEndHorizontal">
1388
+ * Next →
1389
+ * </button>
1390
+ * ```
1391
+ */
1392
+ class ScrollableDirective {
1393
+ constructor() {
1394
+ this.el = inject(ElementRef);
1395
+ /**
1396
+ * The number of pixels to scroll per unit when using scroll methods.
1397
+ * Can be updated dynamically to change scroll behavior.
1398
+ */
1399
+ this.scrollUnit = input.required(...(ngDevMode ? [{ debugName: "scrollUnit" }] : []));
1400
+ /** Indicates if the container can scroll further to the right */
1401
+ this.canScrollEndHorizontal = signal(false, ...(ngDevMode ? [{ debugName: "canScrollEndHorizontal" }] : []));
1402
+ /** Indicates if the container can scroll further to the left */
1403
+ this.canScrollStartHorizontal = signal(false, ...(ngDevMode ? [{ debugName: "canScrollStartHorizontal" }] : []));
1404
+ /** Indicates if the container can scroll further down */
1405
+ this.canScrollEndVertical = signal(false, ...(ngDevMode ? [{ debugName: "canScrollEndVertical" }] : []));
1406
+ /** Indicates if the container can scroll further up */
1407
+ this.canScrollStartVertical = signal(false, ...(ngDevMode ? [{ debugName: "canScrollStartVertical" }] : []));
1408
+ /** Current horizontal scroll position */
1409
+ this.scrollLeftPosition = signal(0, ...(ngDevMode ? [{ debugName: "scrollLeftPosition" }] : []));
1410
+ /** Current vertical scroll position */
1411
+ this.scrollTopPosition = signal(0, ...(ngDevMode ? [{ debugName: "scrollTopPosition" }] : []));
1412
+ // Update overflow detection when scrollUnit changes
1413
+ effect(() => {
1414
+ this.scrollUnit();
1415
+ this.updateOverflow();
1416
+ });
1417
+ }
1418
+ ngOnInit() {
1419
+ this.updateOverflow();
1420
+ this.addScrollListener();
1421
+ this.addResizeListener();
1422
+ }
1423
+ /**
1424
+ * Scrolls the container horizontally by the specified number of units.
1425
+ * @param units Number of scroll units (can be negative for backward scroll)
1426
+ */
1427
+ scrollHorizontal(units) {
1428
+ const element = this.el.nativeElement;
1429
+ const scrollAmount = units * this.scrollUnit();
1430
+ element.scrollLeft += scrollAmount;
1431
+ this.updateOverflow();
1432
+ }
1433
+ /**
1434
+ * Scrolls the container vertically by the specified number of units.
1435
+ * @param units Number of scroll units (can be negative for upward scroll)
1436
+ */
1437
+ scrollVertical(units) {
1438
+ const element = this.el.nativeElement;
1439
+ const scrollAmount = units * this.scrollUnit();
1440
+ element.scrollTop += scrollAmount;
1441
+ this.updateOverflow();
1442
+ }
1443
+ /**
1444
+ * Updates all overflow detection signals based on current scroll position
1445
+ */
1446
+ updateOverflow() {
1447
+ const element = this.el.nativeElement;
1448
+ // Horizontal overflow detection
1449
+ const scrollLeft = element.scrollLeft;
1450
+ const scrollWidth = element.scrollWidth;
1451
+ const clientWidth = element.clientWidth;
1452
+ this.scrollLeftPosition.set(scrollLeft);
1453
+ this.canScrollStartHorizontal.set(scrollLeft > 0);
1454
+ this.canScrollEndHorizontal.set(scrollLeft + clientWidth < scrollWidth);
1455
+ // Vertical overflow detection
1456
+ const scrollTop = element.scrollTop;
1457
+ const scrollHeight = element.scrollHeight;
1458
+ const clientHeight = element.clientHeight;
1459
+ this.scrollTopPosition.set(scrollTop);
1460
+ this.canScrollStartVertical.set(scrollTop > 0);
1461
+ this.canScrollEndVertical.set(scrollTop + clientHeight < scrollHeight);
1462
+ }
1463
+ /**
1464
+ * Adds scroll event listener to track scroll position changes
1465
+ */
1466
+ addScrollListener() {
1467
+ this.el.nativeElement.addEventListener('scroll', () => {
1468
+ this.updateOverflow();
1469
+ });
1470
+ }
1471
+ /**
1472
+ * Adds window resize listener to recalculate overflow on resize
1473
+ */
1474
+ addResizeListener() {
1475
+ window.addEventListener('resize', () => {
1476
+ this.updateOverflow();
1477
+ });
1478
+ }
1479
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ScrollableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1480
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.0", type: ScrollableDirective, isStandalone: true, selector: "[smartScrollable]", inputs: { scrollUnit: { classPropertyName: "scrollUnit", publicName: "scrollUnit", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["smartScrollable"], ngImport: i0 }); }
1481
+ }
1482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: ScrollableDirective, decorators: [{
1483
+ type: Directive,
1484
+ args: [{
1485
+ selector: '[smartScrollable]',
1486
+ standalone: true,
1487
+ exportAs: 'smartScrollable',
1488
+ }]
1489
+ }], ctorParameters: () => [] });
1490
+
1336
1491
  const DIRECTIVES = [];
1337
1492
 
1338
1493
  function initializeApp(configsFacade) {
@@ -1401,9 +1556,29 @@ var GameType;
1401
1556
  class ImageBox {
1402
1557
  }
1403
1558
 
1559
+ const authenticationGuard = () => {
1560
+ const router = inject(Router);
1561
+ const authStorageService = inject(AuthStorageService);
1562
+ if (authStorageService.hasUser()) {
1563
+ return true;
1564
+ }
1565
+ router.navigate(['/logowanie']);
1566
+ return false;
1567
+ };
1568
+
1569
+ const unauthorizedGuard = () => {
1570
+ const router = inject(Router);
1571
+ const authStorageService = inject(AuthStorageService);
1572
+ if (!authStorageService.hasUser()) {
1573
+ return true;
1574
+ }
1575
+ router.navigate(['/strona-glowna']);
1576
+ return false;
1577
+ };
1578
+
1404
1579
  /**
1405
1580
  * Generated bundle index. Do not edit.
1406
1581
  */
1407
1582
 
1408
- export { AppComponent, AuthStorageService, COMPONENTS, ConfigsFacade, ConfigsService, ContrastService, CrudBaseService, DictionaryService, FileUrlService, FiltersBaseComponent, FiltersContext, GameType, GlobalService, ImageBox, ListMode, MetaService, PageComponent, SERVICES, ScrollTopComponent, SeoService, SettingsService, SharedConfig, SharedModule, StyleService, TRANSLATE_DATA_PL, TranslationService, WcagService, environment, setTranslationsAndLang };
1583
+ export { AppComponent, AuthStorageService, COMPONENTS, ConfigsFacade, ConfigsService, ContrastService, CrudBaseService, DIRECTIVES, DictionaryService, FileUrlService, FiltersBaseComponent, FiltersContext, GameType, GlobalService, HoverDirective, ImageBox, ListMode, MetaService, PageComponent, SERVICES, ScrollTopComponent, ScrollableDirective, SeoService, SettingsService, SharedConfig, SharedModule, StyleService, TRANSLATE_DATA_PL, TranslationService, WcagService, authenticationGuard, environment, setTranslationsAndLang, unauthorizedGuard };
1409
1584
  //# sourceMappingURL=smartsoft001-mobilems-angular.mjs.map