@unipin/angular-applet 18.1.0 → 18.2.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.
@@ -622,8 +622,8 @@ function getFormErrorMessage(err, label) {
622
622
  }
623
623
 
624
624
  function generateContrastColor(str) {
625
- if (str.length > 8)
626
- str = str.substring(0, 8);
625
+ if (str.length > 4)
626
+ str = str.substring(0, 4);
627
627
  let res = '';
628
628
  let total = 0;
629
629
  for (let i = 0; i < str.length; i++) {
@@ -2241,20 +2241,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
2241
2241
  }], ctorParameters: () => [{ type: i1$1.Apollo }] });
2242
2242
 
2243
2243
  class FormCurrencyInputComponent {
2244
- constructor(numberPlaceholder, ch, countryService, currencyService) {
2244
+ constructor(placeholder, numberPlaceholder, ch, currencyService) {
2245
+ this.placeholder = placeholder;
2245
2246
  this.numberPlaceholder = numberPlaceholder;
2246
2247
  this.ch = ch;
2247
- this.countryService = countryService;
2248
2248
  this.currencyService = currencyService;
2249
2249
  this.clearable = true;
2250
2250
  this.isInputNumber = false;
2251
- this.label = 'Currency';
2252
2251
  this.numberValue = null;
2253
2252
  this.isNumberDisabled = false;
2254
2253
  this.required = false;
2255
2254
  this.disabled = false;
2256
2255
  this.onChange = new EventEmitter();
2257
- this.items = [{ label: 'Hello', value: 'c', data: 'a' }];
2256
+ this.items = [];
2258
2257
  this.isLoading = true;
2259
2258
  this.isTouched = false;
2260
2259
  this.value = null;
@@ -2263,27 +2262,13 @@ class FormCurrencyInputComponent {
2263
2262
  this.onTouched = () => { };
2264
2263
  }
2265
2264
  ngOnInit() {
2266
- if (this.label === 'Currency') {
2267
- this.sub = this.currencyService.query().subscribe({
2268
- error: () => {
2269
- this.items = [];
2270
- this.setIsLoading(false);
2271
- },
2272
- next: ({ data: { webConfigMsCurrency: { data } } }) => {
2273
- this.items = data.map((d) => ({ label: `[${d.code}] ${d.name}`, value: d.code, data: d }));
2274
- this.setIsLoading(false);
2275
- }
2276
- });
2277
- return;
2278
- }
2279
- this.isInputNumber = false;
2280
- this.sub = this.countryService.query().subscribe({
2265
+ this.sub = this.currencyService.query().subscribe({
2281
2266
  error: () => {
2282
2267
  this.items = [];
2283
2268
  this.setIsLoading(false);
2284
2269
  },
2285
- next: ({ data: { webConfigMsCountry: { data } } }) => {
2286
- this.items = data.map((d) => ({ label: `${d.name}`, value: d.code, data: d }));
2270
+ next: ({ data: { webConfigMsCurrency: { data } } }) => {
2271
+ this.items = data.map((d) => ({ label: `[${d.code}] ${d.name}`, value: d.code, data: d }));
2287
2272
  this.setIsLoading(false);
2288
2273
  }
2289
2274
  });
@@ -2317,7 +2302,7 @@ class FormCurrencyInputComponent {
2317
2302
  this.selectedItem = e?.data;
2318
2303
  this.changed(this.value);
2319
2304
  this.onChange.emit({ selectedItem: e, number: this.numberValue });
2320
- this.errorMsg = getFormErrorMessage(this.formControl.errors, this.label);
2305
+ this.errorMsg = getFormErrorMessage(this.formControl.errors, 'Currency');
2321
2306
  }
2322
2307
  if (e?.magnifyValue === 1)
2323
2308
  this.decimalLimiter = 0;
@@ -2337,8 +2322,8 @@ class FormCurrencyInputComponent {
2337
2322
  this.isLoading = b;
2338
2323
  this.ch.markForCheck();
2339
2324
  }
2340
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: FormCurrencyInputComponent, deps: [{ token: 'numberPlaceholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: CountryService }, { token: CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
2341
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.4", type: FormCurrencyInputComponent, isStandalone: true, selector: "up-currency-input", inputs: { clearable: "clearable", isInputNumber: "isInputNumber", label: "label", numberValue: "numberValue", isNumberDisabled: "isNumberDisabled", required: "required", disabled: "disabled" }, outputs: { onChange: "onChange" }, host: { classAttribute: "d-block" }, providers: [
2325
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: FormCurrencyInputComponent, deps: [{ token: 'placeholder', attribute: true }, { token: 'numberPlaceholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: CurrencyService }], target: i0.ɵɵFactoryTarget.Component }); }
2326
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.4", type: FormCurrencyInputComponent, isStandalone: true, selector: "up-currency-input", inputs: { clearable: "clearable", isInputNumber: "isInputNumber", numberValue: "numberValue", isNumberDisabled: "isNumberDisabled", required: "required", disabled: "disabled" }, outputs: { onChange: "onChange" }, host: { classAttribute: "d-block" }, providers: [
2342
2327
  {
2343
2328
  multi: true,
2344
2329
  provide: NG_VALUE_ACCESSOR,
@@ -2349,7 +2334,7 @@ class FormCurrencyInputComponent {
2349
2334
  provide: NG_VALIDATORS,
2350
2335
  useExisting: FormCurrencyInputComponent
2351
2336
  }
2352
- ], ngImport: i0, template: "<label class=\"form-label\" [class.required]=\"required\">{{ label }}</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ label }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n\n <ng-template ng-label-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i4.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i4.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i4.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2337
+ ], ngImport: i0, template: "<label class=\"form-label\" [class.required]=\"required\">Currency</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n\n <ng-template ng-label-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i4.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i4.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i4.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2353
2338
  }
2354
2339
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: FormCurrencyInputComponent, decorators: [{
2355
2340
  type: Component,
@@ -2370,16 +2355,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
2370
2355
  provide: NG_VALIDATORS,
2371
2356
  useExisting: FormCurrencyInputComponent
2372
2357
  }
2373
- ], template: "<label class=\"form-label\" [class.required]=\"required\">{{ label }}</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ label }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n\n <ng-template ng-label-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"] }]
2358
+ ], template: "<label class=\"form-label\" [class.required]=\"required\">Currency</label>\n\n<ng-template #selectForm>\n <ng-select \n class=\"flex-shrink-0\"\n [class.number]=\"isInputNumber\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n >\n <ng-template ng-option-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n\n <ng-template ng-label-tmp let-i=\"item\">\n <span>{{ isInputNumber? i.value : i.label }}</span>\n </ng-template>\n </ng-select>\n</ng-template>\n\n<ng-template #inputNumber>\n <div class=\"d-flex justify-content-between gap-1 align-items-center\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n\n <input type=\"number\" [placeholder]=\"numberPlaceholder\" class=\"form-control flex-grow-1\" [disabled]=\"isNumberDisabled\" [value]=\"numberValue\" (keypress)=\"limitDecimal($event)\" (input)=\"numberInput($event.target)\">\n </div>\n</ng-template>\n\n<ng-container *ngIf=\"!isInputNumber else inputNumber\">\n <ng-container *ngTemplateOutlet=\"selectForm\" />\n</ng-container>\n\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: ["ng-select.number{min-width:105px;max-width:105px}\n"] }]
2374
2359
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2360
+ type: Attribute,
2361
+ args: ['placeholder']
2362
+ }] }, { type: undefined, decorators: [{
2375
2363
  type: Attribute,
2376
2364
  args: ['numberPlaceholder']
2377
- }] }, { type: i0.ChangeDetectorRef }, { type: CountryService }, { type: CurrencyService }], propDecorators: { clearable: [{
2365
+ }] }, { type: i0.ChangeDetectorRef }, { type: CurrencyService }], propDecorators: { clearable: [{
2378
2366
  type: Input
2379
2367
  }], isInputNumber: [{
2380
2368
  type: Input
2381
- }], label: [{
2382
- type: Input
2383
2369
  }], numberValue: [{
2384
2370
  type: Input
2385
2371
  }], isNumberDisabled: [{
@@ -2392,6 +2378,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
2392
2378
  type: Output
2393
2379
  }] } });
2394
2380
 
2381
+ class FormCountryInputComponent {
2382
+ constructor(placeholder, ch, countryService) {
2383
+ this.placeholder = placeholder;
2384
+ this.ch = ch;
2385
+ this.countryService = countryService;
2386
+ this.clearable = true;
2387
+ this.required = false;
2388
+ this.disabled = false;
2389
+ this.onChange = new EventEmitter();
2390
+ this.items = [];
2391
+ this.isLoading = true;
2392
+ this.isTouched = false;
2393
+ this.value = null;
2394
+ this.changed = (_val) => { };
2395
+ this.onTouched = () => { };
2396
+ }
2397
+ ngOnInit() {
2398
+ this.sub = this.countryService.query().subscribe({
2399
+ error: () => {
2400
+ this.items = [];
2401
+ this.setIsLoading(false);
2402
+ },
2403
+ next: ({ data: { webConfigMsCountry: { data } } }) => {
2404
+ this.items = data.map((d) => ({ label: d.name, value: d.code, data: d }));
2405
+ this.setIsLoading(false);
2406
+ }
2407
+ });
2408
+ }
2409
+ ngOnDestroy() {
2410
+ this.sub?.unsubscribe();
2411
+ }
2412
+ registerOnChange(fn) { this.changed = fn; }
2413
+ registerOnTouched(fn) { this.onTouched = fn; }
2414
+ writeValue(val) {
2415
+ this.value = val;
2416
+ this.ch.markForCheck();
2417
+ }
2418
+ setDisabledState(d) {
2419
+ this.disabled = d;
2420
+ this.ch.markForCheck();
2421
+ }
2422
+ validate(control) {
2423
+ this.formControl = control;
2424
+ return null;
2425
+ }
2426
+ change(e) {
2427
+ if (!this.isTouched) {
2428
+ this.onTouched();
2429
+ this.isTouched = true;
2430
+ }
2431
+ if (!this.disabled) {
2432
+ this.value = e?.value;
2433
+ this.changed(this.value);
2434
+ this.onChange.emit(e.data);
2435
+ this.errorMsg = getFormErrorMessage(this.formControl.errors, 'Country');
2436
+ }
2437
+ }
2438
+ setIsLoading(b) {
2439
+ this.isLoading = b;
2440
+ this.ch.markForCheck();
2441
+ }
2442
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: FormCountryInputComponent, deps: [{ token: 'placeholder', attribute: true }, { token: i0.ChangeDetectorRef }, { token: CountryService }], target: i0.ɵɵFactoryTarget.Component }); }
2443
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.4", type: FormCountryInputComponent, isStandalone: true, selector: "up-country-input", inputs: { clearable: "clearable", required: "required", disabled: "disabled" }, outputs: { onChange: "onChange" }, host: { classAttribute: "d-block" }, providers: [
2444
+ {
2445
+ multi: true,
2446
+ provide: NG_VALUE_ACCESSOR,
2447
+ useExisting: FormCountryInputComponent
2448
+ },
2449
+ {
2450
+ multi: true,
2451
+ provide: NG_VALIDATORS,
2452
+ useExisting: FormCountryInputComponent
2453
+ }
2454
+ ], ngImport: i0, template: "<label class=\"form-label\" [class.required]=\"required\">Country</label>\n<ng-select \n class=\"flex-shrink-0\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i4.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2455
+ }
2456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: FormCountryInputComponent, decorators: [{
2457
+ type: Component,
2458
+ args: [{ standalone: true, selector: 'up-country-input', changeDetection: ChangeDetectionStrategy.OnPush, host: {
2459
+ class: 'd-block'
2460
+ }, imports: [
2461
+ CommonModule,
2462
+ FormsModule,
2463
+ NgSelectModule
2464
+ ], providers: [
2465
+ {
2466
+ multi: true,
2467
+ provide: NG_VALUE_ACCESSOR,
2468
+ useExisting: FormCountryInputComponent
2469
+ },
2470
+ {
2471
+ multi: true,
2472
+ provide: NG_VALIDATORS,
2473
+ useExisting: FormCountryInputComponent
2474
+ }
2475
+ ], template: "<label class=\"form-label\" [class.required]=\"required\">Country</label>\n<ng-select \n class=\"flex-shrink-0\"\n appendTo=\"body\"\n bindValue=\"value\"\n placeholder=\"{{ placeholder }}\"\n [virtualScroll]=\"true\"\n [items]=\"items\"\n [ngModel]=\"value\"\n [readonly]=\"disabled\" \n [loading]=\"isLoading\"\n [clearable]=\"clearable\"\n (change)=\"change($event);\"\n/>\n<label *ngIf=\"errorMsg\" class=\"is-invalid\">{{ errorMsg }}</label>\n" }]
2476
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2477
+ type: Attribute,
2478
+ args: ['placeholder']
2479
+ }] }, { type: i0.ChangeDetectorRef }, { type: CountryService }], propDecorators: { clearable: [{
2480
+ type: Input
2481
+ }], required: [{
2482
+ type: Input
2483
+ }], disabled: [{
2484
+ type: Input
2485
+ }], onChange: [{
2486
+ type: Output
2487
+ }] } });
2488
+
2395
2489
  class FilterComponent {
2396
2490
  constructor(placeholder, ch, popoverCtrl) {
2397
2491
  this.placeholder = placeholder;
@@ -3460,6 +3554,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
3460
3554
  args: [ApprovalFormComponent]
3461
3555
  }] } });
3462
3556
 
3557
+ class InfiniteScrollDirective {
3558
+ constructor(element) {
3559
+ this.element = element;
3560
+ this.threshold = 0.5;
3561
+ this.rootMargin = '0px';
3562
+ this.onScrollThreshold = new EventEmitter();
3563
+ }
3564
+ ngOnInit() {
3565
+ const options = {
3566
+ root: null,
3567
+ rootMargin: this.rootMargin,
3568
+ threshold: Math.max(0, Math.min(1, this.threshold))
3569
+ };
3570
+ this.observer = new IntersectionObserver((entries) => {
3571
+ if (entries[0].isIntersecting)
3572
+ this.onScrollThreshold.emit(true);
3573
+ }, options);
3574
+ }
3575
+ ngAfterViewInit() {
3576
+ this.observer.observe(this.element.nativeElement);
3577
+ }
3578
+ ngOnDestroy() {
3579
+ this.observer.disconnect();
3580
+ }
3581
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: InfiniteScrollDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
3582
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: InfiniteScrollDirective, isStandalone: true, selector: "[upInfiniteScroll]", inputs: { threshold: "threshold", rootMargin: "rootMargin" }, outputs: { onScrollThreshold: "onScrollThreshold" }, ngImport: i0 }); }
3583
+ }
3584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: InfiniteScrollDirective, decorators: [{
3585
+ type: Directive,
3586
+ args: [{
3587
+ selector: '[upInfiniteScroll]',
3588
+ standalone: true
3589
+ }]
3590
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { threshold: [{
3591
+ type: Input
3592
+ }], rootMargin: [{
3593
+ type: Input
3594
+ }], onScrollThreshold: [{
3595
+ type: Output
3596
+ }] } });
3597
+
3598
+ class InfiniteScrollComponent {
3599
+ constructor() {
3600
+ this.threshold = 0.5;
3601
+ this.rootMargin = '0px';
3602
+ this.loadingIcon = 'dots';
3603
+ this.onScrollThreshold = new EventEmitter();
3604
+ }
3605
+ scroll() {
3606
+ this.onScrollThreshold.emit();
3607
+ }
3608
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: InfiniteScrollComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3609
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.4", type: InfiniteScrollComponent, isStandalone: true, selector: "up-infinite-scroll", inputs: { loadingText: "loadingText", threshold: "threshold", rootMargin: "rootMargin", loadingIcon: "loadingIcon" }, outputs: { onScrollThreshold: "onScrollThreshold" }, ngImport: i0, template: "<div class=\"d-flex flex-column justify-content-center align-items-center p-4\" upInfiniteScroll [threshold]=\"threshold\" [rootMargin]=\"rootMargin\" (onScrollThreshold)=\"scroll()\">\n <ion-spinner [name]=\"loadingIcon\" />\n <div class=\"pt-2\" *ngIf=\"loadingText\">{{ loadingText }}</div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: IonicModule }, { kind: "component", type: i1.IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "directive", type: InfiniteScrollDirective, selector: "[upInfiniteScroll]", inputs: ["threshold", "rootMargin"], outputs: ["onScrollThreshold"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3610
+ }
3611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: InfiniteScrollComponent, decorators: [{
3612
+ type: Component,
3613
+ args: [{ standalone: true, selector: 'up-infinite-scroll', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
3614
+ CommonModule,
3615
+ IonicModule,
3616
+ InfiniteScrollDirective
3617
+ ], template: "<div class=\"d-flex flex-column justify-content-center align-items-center p-4\" upInfiniteScroll [threshold]=\"threshold\" [rootMargin]=\"rootMargin\" (onScrollThreshold)=\"scroll()\">\n <ion-spinner [name]=\"loadingIcon\" />\n <div class=\"pt-2\" *ngIf=\"loadingText\">{{ loadingText }}</div>\n</div>\n" }]
3618
+ }], propDecorators: { loadingText: [{
3619
+ type: Input
3620
+ }], threshold: [{
3621
+ type: Input
3622
+ }], rootMargin: [{
3623
+ type: Input
3624
+ }], loadingIcon: [{
3625
+ type: Input
3626
+ }], onScrollThreshold: [{
3627
+ type: Output
3628
+ }] } });
3629
+
3463
3630
  class AuthResolver {
3464
3631
  isUserLoggedIn() {
3465
3632
  return AuthService.authToken !== '';
@@ -3607,5 +3774,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
3607
3774
  type: Injectable
3608
3775
  }], ctorParameters: () => [{ type: i1$2.Router }, { type: AuthService }] });
3609
3776
 
3610
- export { AppletContainerComponent, ApprovalDetailComponent, ApprovalListComponent, AuditDetailComponent, AuditListComponent, AuthGuard, AuthResolver, AuthService, ButtonGroupComponent, ButtonLoadingComponent, ColumnContainerComponent, ColumnHeaderContainerComponent, CountryService, CurrencyService, FilterComponent, FormCurrencyInputComponent, FormDateComponent, FormImagePickerComponent, FormInputComponent, FormNumberComponent, FormPasswordComponent, FormSearchableSelectComponent, FormSelectComponent, FormTextareaComponent, GridPaginationComponent, GridService, GridSnapshotComponent, HeaderInterceptor, ListPaginationContainerComponent, ListSnapshotContainerComponent, LoadingPage, ModalContainerComponent, PermissionDirective, PermissionGuard, PermissionModule, PermissionService, ProfileService, RefreshTokenInterceptor, TabContentComponent, TabGroupComponent, TabsComponentModule, UnauthorizedPage, bootstrap, formatCapitalize, generateContrastColor, getFormErrorMessage };
3777
+ export { AppletContainerComponent, ApprovalDetailComponent, ApprovalListComponent, AuditDetailComponent, AuditListComponent, AuthGuard, AuthResolver, AuthService, ButtonGroupComponent, ButtonLoadingComponent, ColumnContainerComponent, ColumnHeaderContainerComponent, CountryService, CurrencyService, FilterComponent, FormCountryInputComponent, FormCurrencyInputComponent, FormDateComponent, FormImagePickerComponent, FormInputComponent, FormNumberComponent, FormPasswordComponent, FormSearchableSelectComponent, FormSelectComponent, FormTextareaComponent, GridPaginationComponent, GridService, GridSnapshotComponent, HeaderInterceptor, InfiniteScrollComponent, InfiniteScrollDirective, ListPaginationContainerComponent, ListSnapshotContainerComponent, LoadingPage, ModalContainerComponent, PermissionDirective, PermissionGuard, PermissionModule, PermissionService, ProfileService, RefreshTokenInterceptor, TabContentComponent, TabGroupComponent, TabsComponentModule, UnauthorizedPage, bootstrap, formatCapitalize, generateContrastColor, getFormErrorMessage };
3611
3778
  //# sourceMappingURL=unipin-angular-applet.mjs.map