@rangertechnologies/fusion-ui 0.2.5 → 0.2.6

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,12 +1,12 @@
1
1
  import * as i1$4 from "@angular/common";
2
2
  import { CommonModule, DatePipe } from "@angular/common";
3
3
  import * as i0 from "@angular/core";
4
- import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Inject, Injectable, InjectionToken, Input, Optional, Output, Pipe, ViewChild, ViewChildren } from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Inject, Injectable, InjectionToken, Input, Optional, Output, Pipe, ViewChild, ViewChildren, forwardRef } from "@angular/core";
5
5
  import { AngularSvgIconModule } from "angular-svg-icon";
6
6
  import * as i1$5 from "@ngx-translate/core";
7
7
  import { TranslateModule } from "@ngx-translate/core";
8
8
  import * as i3$2 from "@angular/forms";
9
- import { FormControl, FormsModule, ReactiveFormsModule, Validators } from "@angular/forms";
9
+ import { FormControl, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from "@angular/forms";
10
10
  import { BehaviorSubject, Subject, Subscription, catchError, firstValueFrom, shareReplay, throwError } from "rxjs";
11
11
  import * as i1$3 from "@angular/common/http";
12
12
  import * as i3$1 from "@angular/material/checkbox";
@@ -704,6 +704,11 @@ var GlobalValuesService = class GlobalValuesService {
704
704
  return null;
705
705
  }
706
706
  }
707
+ async invalidateSettings() {
708
+ const response = await firstValueFrom(this.apiService.fetchValue("/settings/finance"));
709
+ this.settingsData = response;
710
+ return response;
711
+ }
707
712
  async getPayslipTemplateAPI() {
708
713
  try {
709
714
  if (this.cachedPayslipTemplate !== null && this.cachedPayslipTemplate !== void 0) return this.cachedPayslipTemplate;
@@ -7901,6 +7906,533 @@ i0.ɵɵngDeclareClassMetadata({
7901
7906
  }]
7902
7907
  }
7903
7908
  });
7909
+ const VALID_TONES = /* @__PURE__ */ new Set([
7910
+ "neutral",
7911
+ "info",
7912
+ "success",
7913
+ "warning",
7914
+ "danger"
7915
+ ]);
7916
+ var FusionStatusBadgeComponent = class FusionStatusBadgeComponent {
7917
+ label = "";
7918
+ tone = "neutral";
7919
+ size = "md";
7920
+ showDot = false;
7921
+ ariaLabel;
7922
+ get resolvedTone() {
7923
+ return VALID_TONES.has(this.tone) ? this.tone : "neutral";
7924
+ }
7925
+ get resolvedSize() {
7926
+ return this.size === "sm" ? "sm" : "md";
7927
+ }
7928
+ static ɵfac = i0.ɵɵngDeclareFactory({
7929
+ minVersion: "12.0.0",
7930
+ version: "22.2.5",
7931
+ ngImport: i0,
7932
+ type: FusionStatusBadgeComponent,
7933
+ deps: [],
7934
+ target: i0.ɵɵFactoryTarget.Component
7935
+ });
7936
+ static ɵcmp = i0.ɵɵngDeclareComponent({
7937
+ minVersion: "14.0.0",
7938
+ version: "22.2.5",
7939
+ type: FusionStatusBadgeComponent,
7940
+ isStandalone: true,
7941
+ selector: "fusion-status-badge",
7942
+ inputs: {
7943
+ label: "label",
7944
+ tone: "tone",
7945
+ size: "size",
7946
+ showDot: "showDot",
7947
+ ariaLabel: "ariaLabel"
7948
+ },
7949
+ ngImport: i0,
7950
+ template: "<span\n class=\"fusion-status-badge\"\n [ngClass]=\"['tone-' + resolvedTone, 'size-' + resolvedSize]\"\n [attr.aria-label]=\"ariaLabel || null\">\n <span *ngIf=\"showDot\" class=\"badge-dot\" aria-hidden=\"true\"></span>\n <span class=\"badge-label\">{{ label }}</span>\n</span>\n",
7951
+ styles: [":host{display:inline-flex;vertical-align:middle}.fusion-status-badge{display:inline-flex;align-items:center;gap:6px;border-radius:9999px;border:1px solid var(--fb-border-default, #e2e8f0);font-weight:var(--fw-600, 600);line-height:1.2;white-space:nowrap;box-sizing:border-box}.fusion-status-badge.size-sm{padding:2px 8px;font-size:11px}.fusion-status-badge.size-md{padding:4px 10px;font-size:12px}.badge-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor;flex-shrink:0}.fusion-status-badge.tone-neutral{background-color:var(--fb-surface-tertiary, #f1f5f9);border-color:var(--fb-border-default, #e2e8f0);color:var(--fb-text-secondary, #475569)}.fusion-status-badge.tone-info{background-color:var(--fb-info-surface, #f1f5f9);border-color:var(--fb-info-border, #e2e8f0);color:var(--fb-info-text, #1e293b)}.fusion-status-badge.tone-success{background-color:var(--fb-success-surface, #e6f4ea);border-color:var(--fb-success-border, #a8dab5);color:var(--fb-success-text, #137333)}.fusion-status-badge.tone-warning{background-color:var(--fb-warning-surface, #fef3c7);border-color:var(--fb-warning-border, #fde68a);color:var(--fb-warning-text, #92400e)}.fusion-status-badge.tone-danger{background-color:var(--fb-error-surface, #fee2e2);border-color:var(--fb-error-border, #fecaca);color:var(--fb-error-text, #991b1b)}\n"],
7952
+ dependencies: [
7953
+ {
7954
+ kind: "ngmodule",
7955
+ type: CommonModule
7956
+ },
7957
+ {
7958
+ kind: "directive",
7959
+ type: i1$4.NgClass,
7960
+ selector: "[ngClass]",
7961
+ inputs: ["class", "ngClass"]
7962
+ },
7963
+ {
7964
+ kind: "directive",
7965
+ type: i1$4.NgIf,
7966
+ selector: "[ngIf]",
7967
+ inputs: [
7968
+ "ngIf",
7969
+ "ngIfThen",
7970
+ "ngIfElse"
7971
+ ]
7972
+ }
7973
+ ],
7974
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
7975
+ });
7976
+ };
7977
+ i0.ɵɵngDeclareClassMetadata({
7978
+ minVersion: "12.0.0",
7979
+ version: "22.2.5",
7980
+ ngImport: i0,
7981
+ type: FusionStatusBadgeComponent,
7982
+ decorators: [{
7983
+ type: Component,
7984
+ args: [{
7985
+ selector: "fusion-status-badge",
7986
+ standalone: true,
7987
+ imports: [CommonModule],
7988
+ changeDetection: ChangeDetectionStrategy.OnPush,
7989
+ template: "<span\n class=\"fusion-status-badge\"\n [ngClass]=\"['tone-' + resolvedTone, 'size-' + resolvedSize]\"\n [attr.aria-label]=\"ariaLabel || null\">\n <span *ngIf=\"showDot\" class=\"badge-dot\" aria-hidden=\"true\"></span>\n <span class=\"badge-label\">{{ label }}</span>\n</span>\n",
7990
+ styles: [":host{display:inline-flex;vertical-align:middle}.fusion-status-badge{display:inline-flex;align-items:center;gap:6px;border-radius:9999px;border:1px solid var(--fb-border-default, #e2e8f0);font-weight:var(--fw-600, 600);line-height:1.2;white-space:nowrap;box-sizing:border-box}.fusion-status-badge.size-sm{padding:2px 8px;font-size:11px}.fusion-status-badge.size-md{padding:4px 10px;font-size:12px}.badge-dot{width:6px;height:6px;border-radius:50%;background-color:currentColor;flex-shrink:0}.fusion-status-badge.tone-neutral{background-color:var(--fb-surface-tertiary, #f1f5f9);border-color:var(--fb-border-default, #e2e8f0);color:var(--fb-text-secondary, #475569)}.fusion-status-badge.tone-info{background-color:var(--fb-info-surface, #f1f5f9);border-color:var(--fb-info-border, #e2e8f0);color:var(--fb-info-text, #1e293b)}.fusion-status-badge.tone-success{background-color:var(--fb-success-surface, #e6f4ea);border-color:var(--fb-success-border, #a8dab5);color:var(--fb-success-text, #137333)}.fusion-status-badge.tone-warning{background-color:var(--fb-warning-surface, #fef3c7);border-color:var(--fb-warning-border, #fde68a);color:var(--fb-warning-text, #92400e)}.fusion-status-badge.tone-danger{background-color:var(--fb-error-surface, #fee2e2);border-color:var(--fb-error-border, #fecaca);color:var(--fb-error-text, #991b1b)}\n"]
7991
+ }]
7992
+ }],
7993
+ propDecorators: {
7994
+ label: [{ type: Input }],
7995
+ tone: [{ type: Input }],
7996
+ size: [{ type: Input }],
7997
+ showDot: [{ type: Input }],
7998
+ ariaLabel: [{ type: Input }]
7999
+ }
8000
+ });
8001
+ let nextCardHeadingId = 0;
8002
+ var FusionSectionCardComponent = class FusionSectionCardComponent {
8003
+ title;
8004
+ subtitle;
8005
+ padded = true;
8006
+ elevated = false;
8007
+ headingId = `fusion-section-card-title-${++nextCardHeadingId}`;
8008
+ static ɵfac = i0.ɵɵngDeclareFactory({
8009
+ minVersion: "12.0.0",
8010
+ version: "22.2.5",
8011
+ ngImport: i0,
8012
+ type: FusionSectionCardComponent,
8013
+ deps: [],
8014
+ target: i0.ɵɵFactoryTarget.Component
8015
+ });
8016
+ static ɵcmp = i0.ɵɵngDeclareComponent({
8017
+ minVersion: "14.0.0",
8018
+ version: "22.2.5",
8019
+ type: FusionSectionCardComponent,
8020
+ isStandalone: true,
8021
+ selector: "fusion-section-card",
8022
+ inputs: {
8023
+ title: "title",
8024
+ subtitle: "subtitle",
8025
+ padded: "padded",
8026
+ elevated: "elevated"
8027
+ },
8028
+ ngImport: i0,
8029
+ template: "<section\n class=\"fsc-card\"\n [class.elevated]=\"elevated\"\n [attr.aria-labelledby]=\"title ? headingId : null\">\n <header class=\"fsc-header\"><div class=\"fsc-heading-group\" *ngIf=\"title || subtitle\"><h3 *ngIf=\"title\" [id]=\"headingId\" class=\"fsc-title\">{{ title }}</h3><p *ngIf=\"subtitle\" class=\"fsc-subtitle\">{{ subtitle }}</p></div><div class=\"fsc-header-extra\"><ng-content select=\"[card-header-extra]\"></ng-content></div><div class=\"fsc-header-actions\"><ng-content select=\"[card-actions]\"></ng-content></div></header>\n <div class=\"fsc-body\" [class.fsc-body-padded]=\"padded\">\n <ng-content></ng-content>\n </div>\n <footer class=\"fsc-footer\"><ng-content select=\"[card-footer]\"></ng-content></footer>\n</section>\n",
8030
+ styles: [":host{display:block}.fsc-card{background-color:var(--comp-bg-color, #ffffff);border:1px solid var(--fb-border-default, #e2e8f0);border-radius:var(--radius-medium, 8px);color:var(--fb-text-primary, #0f172a);box-sizing:border-box;overflow:hidden}.fsc-card.elevated{background-color:var(--fb-surface-elevated, #ffffff);box-shadow:0 4px 12px var(--fb-backdrop, rgba(0, 0, 0, .08))}.fsc-header{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:14px 18px;border-bottom:1px solid var(--fb-border-subtle, #f1f5f9)}.fsc-header:empty{display:none}.fsc-heading-group{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1 1 auto}.fsc-title{margin:0;font-size:var(--fs-medium, 15px);font-weight:var(--fw-600, 600);color:var(--fb-text-primary, #0f172a);line-height:1.35}.fsc-subtitle{margin:0;font-size:var(--fs-small, 13px);color:var(--fb-text-secondary, #475569);line-height:1.4}.fsc-header-extra,.fsc-header-actions{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}.fsc-header-extra:empty,.fsc-header-actions:empty{display:none}.fsc-body-padded{padding:16px 18px}.fsc-footer{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 18px;background-color:var(--fb-surface-secondary, #f8fafc);border-top:1px solid var(--fb-border-subtle, #f1f5f9)}.fsc-footer:empty{display:none}\n"],
8031
+ dependencies: [{
8032
+ kind: "ngmodule",
8033
+ type: CommonModule
8034
+ }, {
8035
+ kind: "directive",
8036
+ type: i1$4.NgIf,
8037
+ selector: "[ngIf]",
8038
+ inputs: [
8039
+ "ngIf",
8040
+ "ngIfThen",
8041
+ "ngIfElse"
8042
+ ]
8043
+ }],
8044
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
8045
+ });
8046
+ };
8047
+ i0.ɵɵngDeclareClassMetadata({
8048
+ minVersion: "12.0.0",
8049
+ version: "22.2.5",
8050
+ ngImport: i0,
8051
+ type: FusionSectionCardComponent,
8052
+ decorators: [{
8053
+ type: Component,
8054
+ args: [{
8055
+ selector: "fusion-section-card",
8056
+ standalone: true,
8057
+ imports: [CommonModule],
8058
+ changeDetection: ChangeDetectionStrategy.OnPush,
8059
+ template: "<section\n class=\"fsc-card\"\n [class.elevated]=\"elevated\"\n [attr.aria-labelledby]=\"title ? headingId : null\">\n <header class=\"fsc-header\"><div class=\"fsc-heading-group\" *ngIf=\"title || subtitle\"><h3 *ngIf=\"title\" [id]=\"headingId\" class=\"fsc-title\">{{ title }}</h3><p *ngIf=\"subtitle\" class=\"fsc-subtitle\">{{ subtitle }}</p></div><div class=\"fsc-header-extra\"><ng-content select=\"[card-header-extra]\"></ng-content></div><div class=\"fsc-header-actions\"><ng-content select=\"[card-actions]\"></ng-content></div></header>\n <div class=\"fsc-body\" [class.fsc-body-padded]=\"padded\">\n <ng-content></ng-content>\n </div>\n <footer class=\"fsc-footer\"><ng-content select=\"[card-footer]\"></ng-content></footer>\n</section>\n",
8060
+ styles: [":host{display:block}.fsc-card{background-color:var(--comp-bg-color, #ffffff);border:1px solid var(--fb-border-default, #e2e8f0);border-radius:var(--radius-medium, 8px);color:var(--fb-text-primary, #0f172a);box-sizing:border-box;overflow:hidden}.fsc-card.elevated{background-color:var(--fb-surface-elevated, #ffffff);box-shadow:0 4px 12px var(--fb-backdrop, rgba(0, 0, 0, .08))}.fsc-header{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:14px 18px;border-bottom:1px solid var(--fb-border-subtle, #f1f5f9)}.fsc-header:empty{display:none}.fsc-heading-group{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1 1 auto}.fsc-title{margin:0;font-size:var(--fs-medium, 15px);font-weight:var(--fw-600, 600);color:var(--fb-text-primary, #0f172a);line-height:1.35}.fsc-subtitle{margin:0;font-size:var(--fs-small, 13px);color:var(--fb-text-secondary, #475569);line-height:1.4}.fsc-header-extra,.fsc-header-actions{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}.fsc-header-extra:empty,.fsc-header-actions:empty{display:none}.fsc-body-padded{padding:16px 18px}.fsc-footer{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:12px 18px;background-color:var(--fb-surface-secondary, #f8fafc);border-top:1px solid var(--fb-border-subtle, #f1f5f9)}.fsc-footer:empty{display:none}\n"]
8061
+ }]
8062
+ }],
8063
+ propDecorators: {
8064
+ title: [{ type: Input }],
8065
+ subtitle: [{ type: Input }],
8066
+ padded: [{ type: Input }],
8067
+ elevated: [{ type: Input }]
8068
+ }
8069
+ });
8070
+ var FusionTabStripComponent = class FusionTabStripComponent {
8071
+ tabs = [];
8072
+ activeTabId = "";
8073
+ variant = "sub-nav";
8074
+ ariaLabel = "Tabs";
8075
+ activeTabIdChange = new EventEmitter();
8076
+ tabChange = new EventEmitter();
8077
+ tabButtons;
8078
+ get effectiveTabId() {
8079
+ const activeEnabled = this.tabs.find((tab) => tab.id === this.activeTabId && !tab.disabled);
8080
+ if (activeEnabled) return activeEnabled.id;
8081
+ const firstEnabled = this.tabs.find((tab) => !tab.disabled);
8082
+ return firstEnabled ? firstEnabled.id : "";
8083
+ }
8084
+ getTabIndex(tab) {
8085
+ if (tab.disabled) return -1;
8086
+ return tab.id === this.effectiveTabId ? 0 : -1;
8087
+ }
8088
+ selectTab(tab) {
8089
+ if (tab.disabled || tab.id === this.activeTabId) return;
8090
+ this.activeTabId = tab.id;
8091
+ this.activeTabIdChange.emit(tab.id);
8092
+ this.tabChange.emit(tab);
8093
+ }
8094
+ onKeyDown(event, currentIndex) {
8095
+ const enabledIndices = this.tabs.map((tab, index) => tab.disabled ? -1 : index).filter((index) => index !== -1);
8096
+ if (enabledIndices.length === 0) return;
8097
+ const currentPos = enabledIndices.indexOf(currentIndex);
8098
+ let targetIndex = null;
8099
+ switch (event.key) {
8100
+ case "ArrowRight":
8101
+ targetIndex = enabledIndices[(currentPos + 1) % enabledIndices.length];
8102
+ break;
8103
+ case "ArrowLeft":
8104
+ targetIndex = enabledIndices[(currentPos - 1 + enabledIndices.length) % enabledIndices.length];
8105
+ break;
8106
+ case "Home":
8107
+ targetIndex = enabledIndices[0];
8108
+ break;
8109
+ case "End":
8110
+ targetIndex = enabledIndices[enabledIndices.length - 1];
8111
+ break;
8112
+ default: return;
8113
+ }
8114
+ event.preventDefault();
8115
+ if (targetIndex !== null) this.focusTabAt(targetIndex);
8116
+ }
8117
+ trackByTabId(_index, tab) {
8118
+ return tab.id;
8119
+ }
8120
+ focusTabAt(index) {
8121
+ const target = (this.tabButtons?.toArray())?.[index]?.nativeElement;
8122
+ if (target) target.focus();
8123
+ }
8124
+ static ɵfac = i0.ɵɵngDeclareFactory({
8125
+ minVersion: "12.0.0",
8126
+ version: "22.2.5",
8127
+ ngImport: i0,
8128
+ type: FusionTabStripComponent,
8129
+ deps: [],
8130
+ target: i0.ɵɵFactoryTarget.Component
8131
+ });
8132
+ static ɵcmp = i0.ɵɵngDeclareComponent({
8133
+ minVersion: "14.0.0",
8134
+ version: "22.2.5",
8135
+ type: FusionTabStripComponent,
8136
+ isStandalone: true,
8137
+ selector: "fusion-tab-strip",
8138
+ inputs: {
8139
+ tabs: "tabs",
8140
+ activeTabId: "activeTabId",
8141
+ variant: "variant",
8142
+ ariaLabel: "ariaLabel"
8143
+ },
8144
+ outputs: {
8145
+ activeTabIdChange: "activeTabIdChange",
8146
+ tabChange: "tabChange"
8147
+ },
8148
+ viewQueries: [{
8149
+ propertyName: "tabButtons",
8150
+ predicate: ["tabButton"],
8151
+ descendants: true
8152
+ }],
8153
+ ngImport: i0,
8154
+ template: "<div\n class=\"fusion-tab-strip\"\n [ngClass]=\"variant === 'tabs' ? 'fc-tabs' : 'sub-nav-head'\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\">\n <button\n *ngFor=\"let tab of tabs; let i = index; trackBy: trackByTabId\"\n #tabButton\n type=\"button\"\n role=\"tab\"\n [ngClass]=\"variant === 'tabs' ? 'nav-link' : 'sub-nav'\"\n [class.active]=\"tab.id === activeTabId\"\n [class.disabled]=\"tab.disabled\"\n [disabled]=\"tab.disabled\"\n [attr.tabindex]=\"getTabIndex(tab)\"\n [attr.aria-selected]=\"tab.id === activeTabId\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n [attr.aria-controls]=\"tab.panelId || null\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeyDown($event, i)\">\n <span class=\"tab-label\">{{ tab.label }}</span>\n <fusion-status-badge\n *ngIf=\"tab.badge\"\n [label]=\"tab.badge\"\n [tone]=\"tab.badgeTone || 'neutral'\"\n size=\"sm\">\n </fusion-status-badge>\n </button>\n</div>\n",
8155
+ styles: [":host{display:block}.fusion-tab-strip{display:flex;flex-wrap:nowrap;overflow-x:auto;border-bottom:1px solid var(--fb-border-default, #e2e8f0);gap:4px;padding:0;margin:0}.fusion-tab-strip .sub-nav,.fusion-tab-strip .nav-link{background:transparent;border:none;border-bottom:3.5px solid transparent;margin-bottom:-1px;font-size:var(--fs-normal, 14px);font-weight:var(--fw-500, 500);color:var(--fb-nav-text, #475569);cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:color .15s ease-in-out,border-color .15s ease-in-out}.fusion-tab-strip .sub-nav{padding:8px 16px}.fusion-tab-strip .nav-link{padding:10px 18px}.fusion-tab-strip .sub-nav:hover:not(:disabled),.fusion-tab-strip .nav-link:hover:not(:disabled){color:var(--fb-nav-hover, #0f172a)}.fusion-tab-strip .sub-nav.active,.fusion-tab-strip .nav-link.active{color:var(--fc-primary-color, #0140c1);font-weight:var(--fw-600, 600);border-bottom:3.5px solid var(--fc-primary-color, #0140c1)}.fusion-tab-strip .sub-nav:disabled,.fusion-tab-strip .nav-link:disabled{color:var(--fb-text-disabled, #94a3b8);cursor:not-allowed}.fusion-tab-strip .sub-nav:focus-visible,.fusion-tab-strip .nav-link:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--fb-focus-ring, #003566);border-radius:4px 4px 0 0}\n"],
8156
+ dependencies: [
8157
+ {
8158
+ kind: "ngmodule",
8159
+ type: CommonModule
8160
+ },
8161
+ {
8162
+ kind: "directive",
8163
+ type: i1$4.NgClass,
8164
+ selector: "[ngClass]",
8165
+ inputs: ["class", "ngClass"]
8166
+ },
8167
+ {
8168
+ kind: "directive",
8169
+ type: i1$4.NgForOf,
8170
+ selector: "[ngFor][ngForOf]",
8171
+ inputs: [
8172
+ "ngForOf",
8173
+ "ngForTrackBy",
8174
+ "ngForTemplate"
8175
+ ]
8176
+ },
8177
+ {
8178
+ kind: "directive",
8179
+ type: i1$4.NgIf,
8180
+ selector: "[ngIf]",
8181
+ inputs: [
8182
+ "ngIf",
8183
+ "ngIfThen",
8184
+ "ngIfElse"
8185
+ ]
8186
+ },
8187
+ {
8188
+ kind: "component",
8189
+ type: FusionStatusBadgeComponent,
8190
+ selector: "fusion-status-badge",
8191
+ inputs: [
8192
+ "label",
8193
+ "tone",
8194
+ "size",
8195
+ "showDot",
8196
+ "ariaLabel"
8197
+ ]
8198
+ }
8199
+ ],
8200
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
8201
+ });
8202
+ };
8203
+ i0.ɵɵngDeclareClassMetadata({
8204
+ minVersion: "12.0.0",
8205
+ version: "22.2.5",
8206
+ ngImport: i0,
8207
+ type: FusionTabStripComponent,
8208
+ decorators: [{
8209
+ type: Component,
8210
+ args: [{
8211
+ selector: "fusion-tab-strip",
8212
+ standalone: true,
8213
+ imports: [CommonModule, FusionStatusBadgeComponent],
8214
+ changeDetection: ChangeDetectionStrategy.OnPush,
8215
+ template: "<div\n class=\"fusion-tab-strip\"\n [ngClass]=\"variant === 'tabs' ? 'fc-tabs' : 'sub-nav-head'\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\">\n <button\n *ngFor=\"let tab of tabs; let i = index; trackBy: trackByTabId\"\n #tabButton\n type=\"button\"\n role=\"tab\"\n [ngClass]=\"variant === 'tabs' ? 'nav-link' : 'sub-nav'\"\n [class.active]=\"tab.id === activeTabId\"\n [class.disabled]=\"tab.disabled\"\n [disabled]=\"tab.disabled\"\n [attr.tabindex]=\"getTabIndex(tab)\"\n [attr.aria-selected]=\"tab.id === activeTabId\"\n [attr.aria-disabled]=\"tab.disabled || null\"\n [attr.aria-controls]=\"tab.panelId || null\"\n (click)=\"selectTab(tab)\"\n (keydown)=\"onKeyDown($event, i)\">\n <span class=\"tab-label\">{{ tab.label }}</span>\n <fusion-status-badge\n *ngIf=\"tab.badge\"\n [label]=\"tab.badge\"\n [tone]=\"tab.badgeTone || 'neutral'\"\n size=\"sm\">\n </fusion-status-badge>\n </button>\n</div>\n",
8216
+ styles: [":host{display:block}.fusion-tab-strip{display:flex;flex-wrap:nowrap;overflow-x:auto;border-bottom:1px solid var(--fb-border-default, #e2e8f0);gap:4px;padding:0;margin:0}.fusion-tab-strip .sub-nav,.fusion-tab-strip .nav-link{background:transparent;border:none;border-bottom:3.5px solid transparent;margin-bottom:-1px;font-size:var(--fs-normal, 14px);font-weight:var(--fw-500, 500);color:var(--fb-nav-text, #475569);cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:color .15s ease-in-out,border-color .15s ease-in-out}.fusion-tab-strip .sub-nav{padding:8px 16px}.fusion-tab-strip .nav-link{padding:10px 18px}.fusion-tab-strip .sub-nav:hover:not(:disabled),.fusion-tab-strip .nav-link:hover:not(:disabled){color:var(--fb-nav-hover, #0f172a)}.fusion-tab-strip .sub-nav.active,.fusion-tab-strip .nav-link.active{color:var(--fc-primary-color, #0140c1);font-weight:var(--fw-600, 600);border-bottom:3.5px solid var(--fc-primary-color, #0140c1)}.fusion-tab-strip .sub-nav:disabled,.fusion-tab-strip .nav-link:disabled{color:var(--fb-text-disabled, #94a3b8);cursor:not-allowed}.fusion-tab-strip .sub-nav:focus-visible,.fusion-tab-strip .nav-link:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--fb-focus-ring, #003566);border-radius:4px 4px 0 0}\n"]
8217
+ }]
8218
+ }],
8219
+ propDecorators: {
8220
+ tabs: [{ type: Input }],
8221
+ activeTabId: [{ type: Input }],
8222
+ variant: [{ type: Input }],
8223
+ ariaLabel: [{ type: Input }],
8224
+ activeTabIdChange: [{ type: Output }],
8225
+ tabChange: [{ type: Output }],
8226
+ tabButtons: [{
8227
+ type: ViewChildren,
8228
+ args: ["tabButton"]
8229
+ }]
8230
+ }
8231
+ });
8232
+ let nextDatePickerId = 0;
8233
+ function pad2(value) {
8234
+ return String(value).padStart(2, "0");
8235
+ }
8236
+ function isValidIsoDate(value) {
8237
+ const match = value.trim().match(/^(\d{4})-(\d{2})-(\d{2})$/);
8238
+ if (!match) return false;
8239
+ const year = Number(match[1]);
8240
+ const month = Number(match[2]);
8241
+ const day = Number(match[3]);
8242
+ const probe = new Date(year, month - 1, day);
8243
+ return probe.getFullYear() === year && probe.getMonth() === month - 1 && probe.getDate() === day;
8244
+ }
8245
+ function toIsoDateString(val) {
8246
+ if (val === null || val === void 0 || val === "") return null;
8247
+ if (val instanceof Date) {
8248
+ if (isNaN(val.getTime())) return null;
8249
+ return `${val.getFullYear()}-${pad2(val.getMonth() + 1)}-${pad2(val.getDate())}`;
8250
+ }
8251
+ if (typeof val === "string") {
8252
+ const trimmed = val.trim();
8253
+ return isValidIsoDate(trimmed) ? trimmed : null;
8254
+ }
8255
+ return null;
8256
+ }
8257
+ var FusionDatePickerComponent = class FusionDatePickerComponent {
8258
+ cdr;
8259
+ set value(val) {
8260
+ this.normalizedValue = toIsoDateString(val) ?? "";
8261
+ this.hasInvalidInput = false;
8262
+ }
8263
+ get value() {
8264
+ return this.normalizedValue;
8265
+ }
8266
+ set min(val) {
8267
+ this.normalizedMin = toIsoDateString(val);
8268
+ }
8269
+ get min() {
8270
+ return this.normalizedMin;
8271
+ }
8272
+ set max(val) {
8273
+ this.normalizedMax = toIsoDateString(val);
8274
+ }
8275
+ get max() {
8276
+ return this.normalizedMax;
8277
+ }
8278
+ disabled = false;
8279
+ readonly = false;
8280
+ required = false;
8281
+ label;
8282
+ inputId;
8283
+ ariaLabel;
8284
+ valueChange = new EventEmitter();
8285
+ normalizedValue = "";
8286
+ normalizedMin = null;
8287
+ normalizedMax = null;
8288
+ hasInvalidInput = false;
8289
+ defaultId = `fusion-date-picker-${++nextDatePickerId}`;
8290
+ onChange = () => {};
8291
+ onTouched = () => {};
8292
+ onValidatorChange = () => {};
8293
+ constructor(cdr) {
8294
+ this.cdr = cdr;
8295
+ }
8296
+ get resolvedId() {
8297
+ return this.inputId || this.defaultId;
8298
+ }
8299
+ writeValue(val) {
8300
+ this.normalizedValue = toIsoDateString(val) ?? "";
8301
+ this.hasInvalidInput = false;
8302
+ this.cdr.markForCheck();
8303
+ }
8304
+ registerOnChange(fn) {
8305
+ this.onChange = fn;
8306
+ }
8307
+ registerOnTouched(fn) {
8308
+ this.onTouched = fn;
8309
+ }
8310
+ setDisabledState(isDisabled) {
8311
+ this.disabled = isDisabled;
8312
+ this.cdr.markForCheck();
8313
+ }
8314
+ registerOnValidatorChange(fn) {
8315
+ this.onValidatorChange = fn;
8316
+ }
8317
+ validate(_control) {
8318
+ return this.hasInvalidInput ? { invalidDate: true } : null;
8319
+ }
8320
+ onNativeInput(event) {
8321
+ if (this.readonly || this.disabled) return;
8322
+ const input = event.target;
8323
+ if (!input) return;
8324
+ const raw = input.value;
8325
+ if (Boolean(input.validity?.badInput) || raw !== "" && !isValidIsoDate(raw)) {
8326
+ this.hasInvalidInput = true;
8327
+ this.normalizedValue = "";
8328
+ this.onChange(null);
8329
+ this.valueChange.emit(null);
8330
+ this.onValidatorChange();
8331
+ return;
8332
+ }
8333
+ this.hasInvalidInput = false;
8334
+ this.normalizedValue = raw;
8335
+ const emitted = raw === "" ? null : raw;
8336
+ this.onChange(emitted);
8337
+ this.valueChange.emit(emitted);
8338
+ this.onValidatorChange();
8339
+ }
8340
+ onNativeBlur() {
8341
+ this.onTouched();
8342
+ }
8343
+ static ɵfac = i0.ɵɵngDeclareFactory({
8344
+ minVersion: "12.0.0",
8345
+ version: "22.2.5",
8346
+ ngImport: i0,
8347
+ type: FusionDatePickerComponent,
8348
+ deps: [{ token: i0.ChangeDetectorRef }],
8349
+ target: i0.ɵɵFactoryTarget.Component
8350
+ });
8351
+ static ɵcmp = i0.ɵɵngDeclareComponent({
8352
+ minVersion: "14.0.0",
8353
+ version: "22.2.5",
8354
+ type: FusionDatePickerComponent,
8355
+ isStandalone: true,
8356
+ selector: "fusion-date-picker",
8357
+ inputs: {
8358
+ value: "value",
8359
+ min: "min",
8360
+ max: "max",
8361
+ disabled: "disabled",
8362
+ readonly: "readonly",
8363
+ required: "required",
8364
+ label: "label",
8365
+ inputId: "inputId",
8366
+ ariaLabel: "ariaLabel"
8367
+ },
8368
+ outputs: { valueChange: "valueChange" },
8369
+ providers: [{
8370
+ provide: NG_VALUE_ACCESSOR,
8371
+ useExisting: forwardRef(() => FusionDatePickerComponent),
8372
+ multi: true
8373
+ }, {
8374
+ provide: NG_VALIDATORS,
8375
+ useExisting: forwardRef(() => FusionDatePickerComponent),
8376
+ multi: true
8377
+ }],
8378
+ ngImport: i0,
8379
+ template: "<div class=\"fdp-wrapper\">\n <label *ngIf=\"label\" class=\"fdp-label\" [for]=\"resolvedId\">\n {{ label }}\n <span *ngIf=\"required\" class=\"fdp-required\" aria-hidden=\"true\">*</span>\n </label>\n <input\n type=\"date\"\n class=\"fdp-input\"\n [class.is-invalid]=\"hasInvalidInput\"\n [id]=\"resolvedId\"\n [value]=\"normalizedValue\"\n [attr.min]=\"normalizedMin\"\n [attr.max]=\"normalizedMax\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"!label && ariaLabel ? ariaLabel : null\"\n [attr.aria-required]=\"required || null\"\n [attr.aria-invalid]=\"hasInvalidInput || null\"\n (input)=\"onNativeInput($event)\"\n (change)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n</div>\n",
8380
+ styles: [":host{display:inline-block;width:100%}.fdp-wrapper{display:flex;flex-direction:column;gap:6px}.fdp-label{font-size:var(--fs-small, 13px);font-weight:var(--fw-500, 500);color:var(--fb-text-secondary, #475569);margin:0}.fdp-required{color:var(--fb-error-text, #991b1b);margin-left:2px}.fdp-input{width:100%;min-height:36px;padding:6px 10px;font-size:var(--fs-normal, 14px);font-family:inherit;color:var(--fb-text-primary, #0f172a);background-color:var(--fb-input-bg, #ffffff);border:1px solid var(--fb-input-border, #cbd5e1);border-radius:var(--radius-medium, 8px);box-sizing:border-box;color-scheme:inherit;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.fdp-input:hover:not(:disabled):not(:read-only){border-color:var(--fb-input-hover, #94a3b8)}.fdp-input:focus-visible{outline:none;border-color:var(--fb-input-focus, #0140c1);box-shadow:0 0 0 2px var(--fb-focus-ring, #003566)}.fdp-input:disabled{background-color:var(--fb-input-disabled, #f1f5f9);color:var(--fb-text-disabled, #94a3b8);cursor:not-allowed}.fdp-input:read-only:not(:disabled){background-color:var(--fb-input-readonly, #f8fafc)}.fdp-input.is-invalid{border-color:var(--fb-error-border, #fecaca)}\n"],
8381
+ dependencies: [{
8382
+ kind: "ngmodule",
8383
+ type: CommonModule
8384
+ }, {
8385
+ kind: "directive",
8386
+ type: i1$4.NgIf,
8387
+ selector: "[ngIf]",
8388
+ inputs: [
8389
+ "ngIf",
8390
+ "ngIfThen",
8391
+ "ngIfElse"
8392
+ ]
8393
+ }],
8394
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
8395
+ });
8396
+ };
8397
+ i0.ɵɵngDeclareClassMetadata({
8398
+ minVersion: "12.0.0",
8399
+ version: "22.2.5",
8400
+ ngImport: i0,
8401
+ type: FusionDatePickerComponent,
8402
+ decorators: [{
8403
+ type: Component,
8404
+ args: [{
8405
+ selector: "fusion-date-picker",
8406
+ standalone: true,
8407
+ imports: [CommonModule],
8408
+ changeDetection: ChangeDetectionStrategy.OnPush,
8409
+ providers: [{
8410
+ provide: NG_VALUE_ACCESSOR,
8411
+ useExisting: forwardRef(() => FusionDatePickerComponent),
8412
+ multi: true
8413
+ }, {
8414
+ provide: NG_VALIDATORS,
8415
+ useExisting: forwardRef(() => FusionDatePickerComponent),
8416
+ multi: true
8417
+ }],
8418
+ template: "<div class=\"fdp-wrapper\">\n <label *ngIf=\"label\" class=\"fdp-label\" [for]=\"resolvedId\">\n {{ label }}\n <span *ngIf=\"required\" class=\"fdp-required\" aria-hidden=\"true\">*</span>\n </label>\n <input\n type=\"date\"\n class=\"fdp-input\"\n [class.is-invalid]=\"hasInvalidInput\"\n [id]=\"resolvedId\"\n [value]=\"normalizedValue\"\n [attr.min]=\"normalizedMin\"\n [attr.max]=\"normalizedMax\"\n [disabled]=\"disabled\"\n [readOnly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"!label && ariaLabel ? ariaLabel : null\"\n [attr.aria-required]=\"required || null\"\n [attr.aria-invalid]=\"hasInvalidInput || null\"\n (input)=\"onNativeInput($event)\"\n (change)=\"onNativeInput($event)\"\n (blur)=\"onNativeBlur()\" />\n</div>\n",
8419
+ styles: [":host{display:inline-block;width:100%}.fdp-wrapper{display:flex;flex-direction:column;gap:6px}.fdp-label{font-size:var(--fs-small, 13px);font-weight:var(--fw-500, 500);color:var(--fb-text-secondary, #475569);margin:0}.fdp-required{color:var(--fb-error-text, #991b1b);margin-left:2px}.fdp-input{width:100%;min-height:36px;padding:6px 10px;font-size:var(--fs-normal, 14px);font-family:inherit;color:var(--fb-text-primary, #0f172a);background-color:var(--fb-input-bg, #ffffff);border:1px solid var(--fb-input-border, #cbd5e1);border-radius:var(--radius-medium, 8px);box-sizing:border-box;color-scheme:inherit;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.fdp-input:hover:not(:disabled):not(:read-only){border-color:var(--fb-input-hover, #94a3b8)}.fdp-input:focus-visible{outline:none;border-color:var(--fb-input-focus, #0140c1);box-shadow:0 0 0 2px var(--fb-focus-ring, #003566)}.fdp-input:disabled{background-color:var(--fb-input-disabled, #f1f5f9);color:var(--fb-text-disabled, #94a3b8);cursor:not-allowed}.fdp-input:read-only:not(:disabled){background-color:var(--fb-input-readonly, #f8fafc)}.fdp-input.is-invalid{border-color:var(--fb-error-border, #fecaca)}\n"]
8420
+ }]
8421
+ }],
8422
+ ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
8423
+ propDecorators: {
8424
+ value: [{ type: Input }],
8425
+ min: [{ type: Input }],
8426
+ max: [{ type: Input }],
8427
+ disabled: [{ type: Input }],
8428
+ readonly: [{ type: Input }],
8429
+ required: [{ type: Input }],
8430
+ label: [{ type: Input }],
8431
+ inputId: [{ type: Input }],
8432
+ ariaLabel: [{ type: Input }],
8433
+ valueChange: [{ type: Output }]
8434
+ }
8435
+ });
7904
8436
  var FusionCardComponent = class FusionCardComponent {
7905
8437
  sanitizer;
7906
8438
  renderer;
@@ -9213,6 +9745,6 @@ i0.ɵɵngDeclareClassMetadata({
9213
9745
  }]
9214
9746
  }]
9215
9747
  });
9216
- export { AlertMessageComponent, AlertService, AmountToWordsPipe, ApiService, ApprovalScreenComponent, AttendanceTableComponent, CommonScreenComponent, ConfigService, Constants, CustomDatePipe, CustomPaginatorIntl, CustomTimePipe, CustomTranslatePipe, DataTableComponent, DropDownComponent, EditColumnCheckPipe, EditColumnDropdownPipe, EditColumnTypePipe, ErrorHandlerService, FileUploadComponent, FusionButtonComponent, FusionCardComponent, FusionMonthPickerComponent, GetValuePipe, GlobalValuesService, LoaderService, ModalComponent, MultiCheckboxComponent, MultiSelectDropdownComponent, MultipleFilterComponent, PaginationComponent, PdfFontService, PopoverComponent, ScrollService, SearchFilterComponent, SearchFilterPipe, SideScreenComponent, TOAST_GLOBAL_CONFIG, TabDataService, ToastComponent, ToastService, TotalColumSumPipe, UserChipComponent, configureUserTableDataSource, formatUserDisplayName, getColumnConfig, getUserColumnMaxVisible, getUserInitials, isUserColumnType, isValidAvatarUrl, provideToastConfig, resolveUserChipItems, resolveUserColumnText };
9748
+ export { AlertMessageComponent, AlertService, AmountToWordsPipe, ApiService, ApprovalScreenComponent, AttendanceTableComponent, CommonScreenComponent, ConfigService, Constants, CustomDatePipe, CustomPaginatorIntl, CustomTimePipe, CustomTranslatePipe, DataTableComponent, DropDownComponent, EditColumnCheckPipe, EditColumnDropdownPipe, EditColumnTypePipe, ErrorHandlerService, FileUploadComponent, FusionButtonComponent, FusionCardComponent, FusionDatePickerComponent, FusionMonthPickerComponent, FusionSectionCardComponent, FusionStatusBadgeComponent, FusionTabStripComponent, GetValuePipe, GlobalValuesService, LoaderService, ModalComponent, MultiCheckboxComponent, MultiSelectDropdownComponent, MultipleFilterComponent, PaginationComponent, PdfFontService, PopoverComponent, ScrollService, SearchFilterComponent, SearchFilterPipe, SideScreenComponent, TOAST_GLOBAL_CONFIG, TabDataService, ToastComponent, ToastService, TotalColumSumPipe, UserChipComponent, configureUserTableDataSource, formatUserDisplayName, getColumnConfig, getUserColumnMaxVisible, getUserInitials, isUserColumnType, isValidAvatarUrl, isValidIsoDate, provideToastConfig, resolveUserChipItems, resolveUserColumnText, toIsoDateString };
9217
9749
 
9218
9750
  //# sourceMappingURL=rangertechnologies-fusion-ui.mjs.map