@progalaxyelabs/ngx-stonescriptphp-client 1.19.0 → 1.21.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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, Injectable, Inject, Optional, EventEmitter, Output, Input, Component } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, Injectable, Inject, Optional, EventEmitter, Output, Input, Component, input, output, signal, computed } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import * as i3 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
@@ -3393,6 +3393,254 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
3393
3393
  type: Input
3394
3394
  }] } });
3395
3395
 
3396
+ class MonthYearPickerComponent {
3397
+ label = input('Select date', ...(ngDevMode ? [{ debugName: "label" }] : []));
3398
+ value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
3399
+ valueChange = output();
3400
+ MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
3401
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
3402
+ today = {
3403
+ month: new Date().getMonth(),
3404
+ year: new Date().getFullYear(),
3405
+ };
3406
+ isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
3407
+ tempMonth = signal(null, ...(ngDevMode ? [{ debugName: "tempMonth" }] : []));
3408
+ tempYear = signal(null, ...(ngDevMode ? [{ debugName: "tempYear" }] : []));
3409
+ yearStart = signal(this.today.year - 4, ...(ngDevMode ? [{ debugName: "yearStart" }] : []));
3410
+ years = computed(() => Array.from({ length: 12 }, (_, i) => this.yearStart() + i), ...(ngDevMode ? [{ debugName: "years" }] : []));
3411
+ displayValue = computed(() => {
3412
+ const v = this.value();
3413
+ return v ? `${this.MONTHS[v.month]} ${v.year}` : '— / —';
3414
+ }, ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
3415
+ preview = computed(() => {
3416
+ const m = this.tempMonth();
3417
+ const y = this.tempYear();
3418
+ if (m !== null && y !== null)
3419
+ return `${this.MONTHS[m]} ${y}`;
3420
+ if (m !== null)
3421
+ return `${this.MONTHS[m]} —`;
3422
+ if (y !== null)
3423
+ return `— ${y}`;
3424
+ return '';
3425
+ }, ...(ngDevMode ? [{ debugName: "preview" }] : []));
3426
+ open() {
3427
+ const v = this.value();
3428
+ this.tempMonth.set(v?.month ?? null);
3429
+ this.tempYear.set(v?.year ?? null);
3430
+ this.isOpen.set(true);
3431
+ }
3432
+ selectMonth(m) { this.tempMonth.set(m); }
3433
+ selectYear(y) { this.tempYear.set(y); }
3434
+ shiftYears(delta) { this.yearStart.update(s => s + delta); }
3435
+ confirm() {
3436
+ const m = this.tempMonth();
3437
+ const y = this.tempYear();
3438
+ if (m === null || y === null)
3439
+ return;
3440
+ this.valueChange.emit({ month: m, year: y });
3441
+ this.isOpen.set(false);
3442
+ }
3443
+ cancel() { this.isOpen.set(false); }
3444
+ isSelectedMonth(m) { return this.tempMonth() === m; }
3445
+ isSelectedYear(y) { return this.tempYear() === y; }
3446
+ isCurrentMonth(m) { return m === this.today.month; }
3447
+ isCurrentYear(y) { return y === this.today.year; }
3448
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MonthYearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3449
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.17", type: MonthYearPickerComponent, isStandalone: true, selector: "nsx-month-year-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
3450
+ <button
3451
+ type="button"
3452
+ class="btn btn-outline-secondary w-100 d-flex justify-content-between align-items-center"
3453
+ (click)="open()">
3454
+ <span class="font-monospace" [class.text-muted]="!value()">
3455
+ {{ displayValue() }}
3456
+ </span>
3457
+ <small class="text-muted">&#9662;</small>
3458
+ </button>
3459
+
3460
+ @if (isOpen()) {
3461
+ <div class="nsx-myp-backdrop" (click)="cancel()"></div>
3462
+ <div class="nsx-myp-popup border rounded shadow">
3463
+
3464
+ <div class="d-flex justify-content-between align-items-center px-3 py-2 bg-body-tertiary border-bottom">
3465
+ <span class="text-uppercase text-muted fw-semibold" style="font-size: 10px; letter-spacing: .08em;">
3466
+ {{ label() }}
3467
+ </span>
3468
+ <span class="font-monospace fw-semibold">{{ preview() }}</span>
3469
+ </div>
3470
+
3471
+ <div class="px-2 pt-2 pb-1">
3472
+ <div class="text-uppercase text-muted px-1 mb-1" style="font-size: 10px; letter-spacing: .08em;">Month</div>
3473
+ <div class="row row-cols-4 g-1">
3474
+ @for (month of MONTHS; track $index) {
3475
+ <div class="col">
3476
+ <button
3477
+ type="button"
3478
+ class="btn btn-sm w-100"
3479
+ [class.btn-success]="isSelectedMonth($index)"
3480
+ [class.btn-outline-success]="isCurrentMonth($index) && !isSelectedMonth($index)"
3481
+ [class.btn-light]="!isSelectedMonth($index) && !isCurrentMonth($index)"
3482
+ (click)="selectMonth($index)">
3483
+ {{ month }}
3484
+ </button>
3485
+ </div>
3486
+ }
3487
+ </div>
3488
+ </div>
3489
+
3490
+ <div class="px-2 pt-1 pb-2">
3491
+ <div class="text-uppercase text-muted px-1 mb-1" style="font-size: 10px; letter-spacing: .08em;">Year</div>
3492
+ <div class="row row-cols-4 g-1">
3493
+ @for (year of years(); track year) {
3494
+ <div class="col">
3495
+ <button
3496
+ type="button"
3497
+ class="btn btn-sm w-100 font-monospace"
3498
+ [class.btn-success]="isSelectedYear(year)"
3499
+ [class.btn-outline-success]="isCurrentYear(year) && !isSelectedYear(year)"
3500
+ [class.btn-light]="!isSelectedYear(year) && !isCurrentYear(year)"
3501
+ (click)="selectYear(year)">
3502
+ {{ year }}
3503
+ </button>
3504
+ </div>
3505
+ }
3506
+ </div>
3507
+
3508
+ <div class="row g-1 mt-1">
3509
+ <div class="col">
3510
+ <button type="button" class="btn btn-sm btn-light w-100" (click)="shiftYears(-12)">
3511
+ &lsaquo; Earlier
3512
+ </button>
3513
+ </div>
3514
+ <div class="col">
3515
+ <button type="button" class="btn btn-sm btn-light w-100" (click)="shiftYears(12)">
3516
+ Later &rsaquo;
3517
+ </button>
3518
+ </div>
3519
+ </div>
3520
+ </div>
3521
+
3522
+ <div class="row g-0 border-top">
3523
+ <div class="col border-end">
3524
+ <button
3525
+ type="button"
3526
+ class="btn w-100 rounded-0 py-2 fw-semibold text-success"
3527
+ (click)="confirm()">
3528
+ OK
3529
+ </button>
3530
+ </div>
3531
+ <div class="col">
3532
+ <button
3533
+ type="button"
3534
+ class="btn btn-light w-100 rounded-0 py-2"
3535
+ (click)="cancel()">
3536
+ Cancel
3537
+ </button>
3538
+ </div>
3539
+ </div>
3540
+
3541
+ </div>
3542
+ }
3543
+ `, isInline: true, styles: [":host{position:relative;display:block}.nsx-myp-backdrop{position:fixed;inset:0;z-index:1050}.nsx-myp-popup{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1051;background:#fff;width:300px;max-width:92vw;overflow:hidden}\n"] });
3544
+ }
3545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: MonthYearPickerComponent, decorators: [{
3546
+ type: Component,
3547
+ args: [{ selector: 'nsx-month-year-picker', standalone: true, template: `
3548
+ <button
3549
+ type="button"
3550
+ class="btn btn-outline-secondary w-100 d-flex justify-content-between align-items-center"
3551
+ (click)="open()">
3552
+ <span class="font-monospace" [class.text-muted]="!value()">
3553
+ {{ displayValue() }}
3554
+ </span>
3555
+ <small class="text-muted">&#9662;</small>
3556
+ </button>
3557
+
3558
+ @if (isOpen()) {
3559
+ <div class="nsx-myp-backdrop" (click)="cancel()"></div>
3560
+ <div class="nsx-myp-popup border rounded shadow">
3561
+
3562
+ <div class="d-flex justify-content-between align-items-center px-3 py-2 bg-body-tertiary border-bottom">
3563
+ <span class="text-uppercase text-muted fw-semibold" style="font-size: 10px; letter-spacing: .08em;">
3564
+ {{ label() }}
3565
+ </span>
3566
+ <span class="font-monospace fw-semibold">{{ preview() }}</span>
3567
+ </div>
3568
+
3569
+ <div class="px-2 pt-2 pb-1">
3570
+ <div class="text-uppercase text-muted px-1 mb-1" style="font-size: 10px; letter-spacing: .08em;">Month</div>
3571
+ <div class="row row-cols-4 g-1">
3572
+ @for (month of MONTHS; track $index) {
3573
+ <div class="col">
3574
+ <button
3575
+ type="button"
3576
+ class="btn btn-sm w-100"
3577
+ [class.btn-success]="isSelectedMonth($index)"
3578
+ [class.btn-outline-success]="isCurrentMonth($index) && !isSelectedMonth($index)"
3579
+ [class.btn-light]="!isSelectedMonth($index) && !isCurrentMonth($index)"
3580
+ (click)="selectMonth($index)">
3581
+ {{ month }}
3582
+ </button>
3583
+ </div>
3584
+ }
3585
+ </div>
3586
+ </div>
3587
+
3588
+ <div class="px-2 pt-1 pb-2">
3589
+ <div class="text-uppercase text-muted px-1 mb-1" style="font-size: 10px; letter-spacing: .08em;">Year</div>
3590
+ <div class="row row-cols-4 g-1">
3591
+ @for (year of years(); track year) {
3592
+ <div class="col">
3593
+ <button
3594
+ type="button"
3595
+ class="btn btn-sm w-100 font-monospace"
3596
+ [class.btn-success]="isSelectedYear(year)"
3597
+ [class.btn-outline-success]="isCurrentYear(year) && !isSelectedYear(year)"
3598
+ [class.btn-light]="!isSelectedYear(year) && !isCurrentYear(year)"
3599
+ (click)="selectYear(year)">
3600
+ {{ year }}
3601
+ </button>
3602
+ </div>
3603
+ }
3604
+ </div>
3605
+
3606
+ <div class="row g-1 mt-1">
3607
+ <div class="col">
3608
+ <button type="button" class="btn btn-sm btn-light w-100" (click)="shiftYears(-12)">
3609
+ &lsaquo; Earlier
3610
+ </button>
3611
+ </div>
3612
+ <div class="col">
3613
+ <button type="button" class="btn btn-sm btn-light w-100" (click)="shiftYears(12)">
3614
+ Later &rsaquo;
3615
+ </button>
3616
+ </div>
3617
+ </div>
3618
+ </div>
3619
+
3620
+ <div class="row g-0 border-top">
3621
+ <div class="col border-end">
3622
+ <button
3623
+ type="button"
3624
+ class="btn w-100 rounded-0 py-2 fw-semibold text-success"
3625
+ (click)="confirm()">
3626
+ OK
3627
+ </button>
3628
+ </div>
3629
+ <div class="col">
3630
+ <button
3631
+ type="button"
3632
+ class="btn btn-light w-100 rounded-0 py-2"
3633
+ (click)="cancel()">
3634
+ Cancel
3635
+ </button>
3636
+ </div>
3637
+ </div>
3638
+
3639
+ </div>
3640
+ }
3641
+ `, styles: [":host{position:relative;display:block}.nsx-myp-backdrop{position:fixed;inset:0;z-index:1050}.nsx-myp-popup{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1051;background:#fff;width:300px;max-width:92vw;overflow:hidden}\n"] }]
3642
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
3643
+
3396
3644
  class TenantRegisterComponent {
3397
3645
  auth;
3398
3646
  providerRegistry;
@@ -4283,5 +4531,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
4283
4531
  * Generated bundle index. Do not edit.
4284
4532
  */
4285
4533
 
4286
- export { AUTH_PLUGIN, ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, FilesService, LogService, LoginDialogComponent, MyEnvironmentModel, ProgalaxyElabsAuth, ProviderRegistryService, RegisterComponent, SigninStatusService, StoneScriptPHPAuth, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus, provideNgxStoneScriptPhpClient };
4534
+ export { AUTH_PLUGIN, ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, FilesService, LogService, LoginDialogComponent, MonthYearPickerComponent, MyEnvironmentModel, ProgalaxyElabsAuth, ProviderRegistryService, RegisterComponent, SigninStatusService, StoneScriptPHPAuth, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus, provideNgxStoneScriptPhpClient };
4287
4535
  //# sourceMappingURL=progalaxyelabs-ngx-stonescriptphp-client.mjs.map