@tolle_/tolle-ui 18.2.18 → 18.2.19

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.
@@ -2886,7 +2886,6 @@ class MaskedInputComponent {
2886
2886
  size = 'default';
2887
2887
  returnRaw = false;
2888
2888
  hideHintOnFocus = true;
2889
- externalFocused;
2890
2889
  mergedPosition = 'none';
2891
2890
  inputEl;
2892
2891
  hasPrefix = false;
@@ -2919,34 +2918,30 @@ class MaskedInputComponent {
2919
2918
  return cn('text-sm font-medium text-foreground leading-none transition-opacity duration-200', this.disabled && 'opacity-50');
2920
2919
  }
2921
2920
  get computedContainerClass() {
2922
- const focused = this.externalFocused !== undefined ? this.externalFocused : this.isFocused;
2923
2921
  return cn(
2924
2922
  // Base styles
2925
- 'group relative flex items-center w-full border transition-all duration-200', 'bg-background',
2926
- // Border and shadow
2927
- 'border-input shadow-sm',
2923
+ 'group relative flex items-center w-full border transition-all duration-200', 'bg-background border-input shadow-sm',
2928
2924
  // Sizing
2929
2925
  this.size === 'xs' && 'h-8 px-2 gap-1.5 text-xs', this.size === 'sm' && 'h-9 px-3 gap-2 text-sm', this.size === 'default' && 'h-10 px-3 gap-2 text-sm', this.size === 'lg' && 'h-11 px-4 gap-3 text-base',
2930
2926
  // Merged position - handle border radius
2931
- this.mergedPosition === 'left' && 'rounded-l-md rounded-r-none border-r-0 pr-0', this.mergedPosition === 'right' && 'rounded-r-md rounded-l-none border-l-0 pl-0', this.mergedPosition === 'none' && 'rounded-md',
2927
+ this.mergedPosition === 'left' && 'rounded-l-md rounded-r-none border-r-0 pr-0', this.mergedPosition === 'right' && 'rounded-r-md rounded-l-none border-l-0 pl-0 flex-1', this.mergedPosition === 'none' && 'rounded-md',
2932
2928
  // Focus state
2933
- !(this.readonly || this.disabled) &&
2934
- focused && [
2935
- 'ring-4',
2936
- 'ring-ring/30',
2937
- 'ring-offset-0',
2938
- 'shadow-none',
2939
- this.error ? 'border-destructive/80' : 'border-primary/80',
2929
+ !(this.readonly || this.disabled) && [
2930
+ 'focus-within:ring-4',
2931
+ 'focus-within:ring-ring/30',
2932
+ 'focus-within:ring-offset-0',
2933
+ 'focus-within:shadow-none',
2934
+ this.error ? 'focus-within:border-destructive/80' : 'focus-within:border-primary/80',
2940
2935
  ],
2941
2936
  // Error state
2942
2937
  this.error && [
2943
2938
  'border-destructive',
2944
- !(this.readonly || this.disabled) && focused && 'ring-destructive/30',
2939
+ !(this.readonly || this.disabled) && 'focus-within:ring-destructive/30',
2945
2940
  ],
2946
2941
  // Disabled state
2947
2942
  this.disabled && ['cursor-not-allowed opacity-50', 'border-opacity-50'],
2948
2943
  // Readonly state
2949
- this.readonly && ['cursor-default', 'border-dashed', !this.disabled && !focused && 'ring-0'], this.containerClass);
2944
+ this.readonly && ['cursor-default', 'border-dashed'], this.containerClass);
2950
2945
  }
2951
2946
  get computedInputClass() {
2952
2947
  return cn(
@@ -3031,7 +3026,7 @@ class MaskedInputComponent {
3031
3026
  }
3032
3027
  cn = cn;
3033
3028
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MaskedInputComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3034
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: MaskedInputComponent, isStandalone: true, selector: "tolle-masked-input", inputs: { id: "id", label: "label", hint: "hint", errorMessage: "errorMessage", mask: "mask", placeholder: "placeholder", type: "type", disabled: "disabled", readonly: "readonly", class: "class", containerClass: "containerClass", error: "error", size: "size", returnRaw: "returnRaw", hideHintOnFocus: "hideHintOnFocus", externalFocused: "externalFocused", mergedPosition: "mergedPosition" }, providers: [
3029
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: MaskedInputComponent, isStandalone: true, selector: "tolle-masked-input", inputs: { id: "id", label: "label", hint: "hint", errorMessage: "errorMessage", mask: "mask", placeholder: "placeholder", type: "type", disabled: "disabled", readonly: "readonly", class: "class", containerClass: "containerClass", error: "error", size: "size", returnRaw: "returnRaw", hideHintOnFocus: "hideHintOnFocus", mergedPosition: "mergedPosition" }, providers: [
3035
3030
  {
3036
3031
  provide: NG_VALUE_ACCESSOR,
3037
3032
  useExisting: forwardRef(() => MaskedInputComponent),
@@ -3178,8 +3173,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
3178
3173
  type: Input
3179
3174
  }], hideHintOnFocus: [{
3180
3175
  type: Input
3181
- }], externalFocused: [{
3182
- type: Input
3183
3176
  }], mergedPosition: [{
3184
3177
  type: Input
3185
3178
  }], inputEl: [{
@@ -3412,7 +3405,7 @@ class DatePickerComponent {
3412
3405
  ></tolle-calendar>
3413
3406
  </div>
3414
3407
  </div>
3415
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["id", "label", "hint", "errorMessage", "mask", "placeholder", "type", "disabled", "readonly", "class", "containerClass", "error", "size", "returnRaw", "hideHintOnFocus", "externalFocused", "mergedPosition"] }, { kind: "component", type: CalendarComponent, selector: "tolle-calendar", inputs: ["class", "mode", "disablePastDates", "showQuickActions", "minDate", "maxDate", "formatMonthFn", "formatYearFn", "formatDateFn"], outputs: ["dateSelect"] }] });
3408
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["id", "label", "hint", "errorMessage", "mask", "placeholder", "type", "disabled", "readonly", "class", "containerClass", "error", "size", "returnRaw", "hideHintOnFocus", "mergedPosition"] }, { kind: "component", type: CalendarComponent, selector: "tolle-calendar", inputs: ["class", "mode", "disablePastDates", "showQuickActions", "minDate", "maxDate", "formatMonthFn", "formatYearFn", "formatDateFn"], outputs: ["dateSelect"] }] });
3416
3409
  }
3417
3410
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatePickerComponent, decorators: [{
3418
3411
  type: Component,
@@ -13319,7 +13312,6 @@ class PhoneNumberInputComponent {
13319
13312
  displayValue = '';
13320
13313
  selectedIso = '';
13321
13314
  rawValue = '';
13322
- isFocused = false;
13323
13315
  cn = cn;
13324
13316
  onChange = () => { };
13325
13317
  onTouched = () => { };
@@ -13330,36 +13322,22 @@ class PhoneNumberInputComponent {
13330
13322
  return cn('text-sm font-medium text-foreground leading-none transition-opacity duration-200', this.disabled && 'opacity-50');
13331
13323
  }
13332
13324
  get computedMergedClass() {
13333
- return cn('flex rounded-md border transition-all duration-200', 'bg-background shadow-sm', this.size === 'xs' && 'h-8', this.size === 'sm' && 'h-9', this.size === 'default' && 'h-10', this.size === 'lg' && 'h-11',
13325
+ return cn('group relative flex items-center w-full rounded-md border transition-all duration-200', 'bg-background border-input shadow-sm', this.size === 'xs' && 'h-8', this.size === 'sm' && 'h-9', this.size === 'default' && 'h-10', this.size === 'lg' && 'h-11',
13334
13326
  // Focus state
13335
- !this.disabled &&
13336
- !this.readonly &&
13337
- this.isFocused && [
13338
- 'ring-4',
13339
- 'ring-ring/30',
13340
- 'ring-offset-0',
13341
- 'shadow-none',
13342
- this.error ? 'border-destructive/80' : 'border-primary/80',
13327
+ !this.readonly &&
13328
+ !this.disabled && [
13329
+ 'focus-within:ring-4',
13330
+ 'focus-within:ring-ring/30',
13331
+ 'focus-within:ring-offset-0',
13332
+ 'focus-within:shadow-none',
13333
+ this.error ? 'focus-within:border-destructive/80' : 'focus-within:border-primary/80',
13343
13334
  ],
13344
13335
  // Error state
13345
- this.error && ['border-destructive', this.isFocused && 'ring-destructive/30'],
13336
+ this.error && 'border-destructive', this.error && !this.readonly && !this.disabled && 'focus-within:ring-destructive/30',
13346
13337
  // Disabled state
13347
13338
  this.disabled && ['cursor-not-allowed opacity-50', 'border-opacity-50'],
13348
13339
  // Readonly state
13349
- this.readonly && [
13350
- 'cursor-default',
13351
- 'border-dashed',
13352
- !this.disabled && !this.isFocused && 'ring-0',
13353
- ], this.class);
13354
- }
13355
- onFocusIn() {
13356
- this.isFocused = true;
13357
- this.cdr.markForCheck();
13358
- }
13359
- onFocusOut() {
13360
- this.isFocused = false;
13361
- this.onTouched();
13362
- this.cdr.markForCheck();
13340
+ this.readonly && 'cursor-default border-dashed', this.class);
13363
13341
  }
13364
13342
  writeValue(value) {
13365
13343
  if (value) {
@@ -13442,7 +13420,7 @@ class PhoneNumberInputComponent {
13442
13420
  {{ label }}
13443
13421
  </label>
13444
13422
 
13445
- <div [class]="computedMergedClass" (focusin)="onFocusIn()" (focusout)="onFocusOut()">
13423
+ <div [class]="computedMergedClass">
13446
13424
  <tolle-country-selector
13447
13425
  [showName]="false"
13448
13426
  [size]="size"
@@ -13460,7 +13438,6 @@ class PhoneNumberInputComponent {
13460
13438
  [readonly]="readonly"
13461
13439
  [placeholder]="placeholder"
13462
13440
  [error]="error"
13463
- [externalFocused]="isFocused"
13464
13441
  [mergedPosition]="'right'"
13465
13442
  [(ngModel)]="displayValue"
13466
13443
  (ngModelChange)="onMaskInputChange($event)"></tolle-masked-input>
@@ -13469,8 +13446,7 @@ class PhoneNumberInputComponent {
13469
13446
  <ng-container *ngIf="!disabled">
13470
13447
  <p
13471
13448
  *ngIf="hint && !error"
13472
- class="px-1 text-xs text-muted-foreground transition-opacity duration-200"
13473
- [class.opacity-0]="isFocused && hideHintOnFocus">
13449
+ class="px-1 text-xs text-muted-foreground transition-opacity duration-200">
13474
13450
  {{ hint }}
13475
13451
  </p>
13476
13452
  <p *ngIf="error && errorMessage" [id]="id + '-error'" class="px-1 text-xs text-destructive">
@@ -13478,7 +13454,7 @@ class PhoneNumberInputComponent {
13478
13454
  </p>
13479
13455
  </ng-container>
13480
13456
  </div>
13481
- `, isInline: true, styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CountrySelectorComponent, selector: "tolle-country-selector", inputs: ["id", "label", "hint", "errorMessage", "error", "hideHintOnFocus", "placeholder", "class", "disabled", "readonly", "size", "defaultCountryCode", "returnValue", "showName", "mergedPosition"], outputs: ["onSelect", "onFocusChange", "onBlurChange"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["id", "label", "hint", "errorMessage", "mask", "placeholder", "type", "disabled", "readonly", "class", "containerClass", "error", "size", "returnRaw", "hideHintOnFocus", "externalFocused", "mergedPosition"] }] });
13457
+ `, isInline: true, styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CountrySelectorComponent, selector: "tolle-country-selector", inputs: ["id", "label", "hint", "errorMessage", "error", "hideHintOnFocus", "placeholder", "class", "disabled", "readonly", "size", "defaultCountryCode", "returnValue", "showName", "mergedPosition"], outputs: ["onSelect", "onFocusChange", "onBlurChange"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["id", "label", "hint", "errorMessage", "mask", "placeholder", "type", "disabled", "readonly", "class", "containerClass", "error", "size", "returnRaw", "hideHintOnFocus", "mergedPosition"] }] });
13482
13458
  }
13483
13459
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PhoneNumberInputComponent, decorators: [{
13484
13460
  type: Component,
@@ -13488,7 +13464,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
13488
13464
  {{ label }}
13489
13465
  </label>
13490
13466
 
13491
- <div [class]="computedMergedClass" (focusin)="onFocusIn()" (focusout)="onFocusOut()">
13467
+ <div [class]="computedMergedClass">
13492
13468
  <tolle-country-selector
13493
13469
  [showName]="false"
13494
13470
  [size]="size"
@@ -13506,7 +13482,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
13506
13482
  [readonly]="readonly"
13507
13483
  [placeholder]="placeholder"
13508
13484
  [error]="error"
13509
- [externalFocused]="isFocused"
13510
13485
  [mergedPosition]="'right'"
13511
13486
  [(ngModel)]="displayValue"
13512
13487
  (ngModelChange)="onMaskInputChange($event)"></tolle-masked-input>
@@ -13515,8 +13490,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
13515
13490
  <ng-container *ngIf="!disabled">
13516
13491
  <p
13517
13492
  *ngIf="hint && !error"
13518
- class="px-1 text-xs text-muted-foreground transition-opacity duration-200"
13519
- [class.opacity-0]="isFocused && hideHintOnFocus">
13493
+ class="px-1 text-xs text-muted-foreground transition-opacity duration-200">
13520
13494
  {{ hint }}
13521
13495
  </p>
13522
13496
  <p *ngIf="error && errorMessage" [id]="id + '-error'" class="px-1 text-xs text-destructive">