@tolle_/tolle-ui 18.2.18 → 18.2.20
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.
- package/esm2022/lib/date-picker.component.mjs +2 -2
- package/esm2022/lib/masked-input.component.mjs +12 -19
- package/esm2022/lib/phone-number-input.component.mjs +20 -35
- package/fesm2022/tolle-ui.mjs +31 -53
- package/fesm2022/tolle-ui.mjs.map +1 -1
- package/lib/masked-input.component.d.ts +1 -2
- package/lib/phone-number-input.component.d.ts +0 -3
- package/package.json +1 -1
package/fesm2022/tolle-ui.mjs
CHANGED
|
@@ -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
|
-
|
|
2935
|
-
'ring-
|
|
2936
|
-
'ring-
|
|
2937
|
-
'
|
|
2938
|
-
'
|
|
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) &&
|
|
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'
|
|
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",
|
|
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", "
|
|
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.
|
|
13336
|
-
!this.
|
|
13337
|
-
|
|
13338
|
-
'ring-
|
|
13339
|
-
'ring-
|
|
13340
|
-
'
|
|
13341
|
-
'
|
|
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 &&
|
|
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,8 +13420,9 @@ class PhoneNumberInputComponent {
|
|
|
13442
13420
|
{{ label }}
|
|
13443
13421
|
</label>
|
|
13444
13422
|
|
|
13445
|
-
<div [class]="computedMergedClass"
|
|
13423
|
+
<div [class]="computedMergedClass">
|
|
13446
13424
|
<tolle-country-selector
|
|
13425
|
+
class="flex-shrink-0"
|
|
13447
13426
|
[showName]="false"
|
|
13448
13427
|
[size]="size"
|
|
13449
13428
|
[disabled]="disabled || !enableCountrySelector"
|
|
@@ -13453,6 +13432,7 @@ class PhoneNumberInputComponent {
|
|
|
13453
13432
|
(ngModelChange)="onCountryChange($event)"></tolle-country-selector>
|
|
13454
13433
|
|
|
13455
13434
|
<tolle-masked-input
|
|
13435
|
+
class="min-w-0 flex-1"
|
|
13456
13436
|
[id]="id"
|
|
13457
13437
|
[mask]="mask"
|
|
13458
13438
|
[size]="size"
|
|
@@ -13460,7 +13440,6 @@ class PhoneNumberInputComponent {
|
|
|
13460
13440
|
[readonly]="readonly"
|
|
13461
13441
|
[placeholder]="placeholder"
|
|
13462
13442
|
[error]="error"
|
|
13463
|
-
[externalFocused]="isFocused"
|
|
13464
13443
|
[mergedPosition]="'right'"
|
|
13465
13444
|
[(ngModel)]="displayValue"
|
|
13466
13445
|
(ngModelChange)="onMaskInputChange($event)"></tolle-masked-input>
|
|
@@ -13469,8 +13448,7 @@ class PhoneNumberInputComponent {
|
|
|
13469
13448
|
<ng-container *ngIf="!disabled">
|
|
13470
13449
|
<p
|
|
13471
13450
|
*ngIf="hint && !error"
|
|
13472
|
-
class="px-1 text-xs text-muted-foreground transition-opacity duration-200"
|
|
13473
|
-
[class.opacity-0]="isFocused && hideHintOnFocus">
|
|
13451
|
+
class="px-1 text-xs text-muted-foreground transition-opacity duration-200">
|
|
13474
13452
|
{{ hint }}
|
|
13475
13453
|
</p>
|
|
13476
13454
|
<p *ngIf="error && errorMessage" [id]="id + '-error'" class="px-1 text-xs text-destructive">
|
|
@@ -13478,7 +13456,7 @@ class PhoneNumberInputComponent {
|
|
|
13478
13456
|
</p>
|
|
13479
13457
|
</ng-container>
|
|
13480
13458
|
</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", "
|
|
13459
|
+
`, 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
13460
|
}
|
|
13483
13461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PhoneNumberInputComponent, decorators: [{
|
|
13484
13462
|
type: Component,
|
|
@@ -13488,8 +13466,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13488
13466
|
{{ label }}
|
|
13489
13467
|
</label>
|
|
13490
13468
|
|
|
13491
|
-
<div [class]="computedMergedClass"
|
|
13469
|
+
<div [class]="computedMergedClass">
|
|
13492
13470
|
<tolle-country-selector
|
|
13471
|
+
class="flex-shrink-0"
|
|
13493
13472
|
[showName]="false"
|
|
13494
13473
|
[size]="size"
|
|
13495
13474
|
[disabled]="disabled || !enableCountrySelector"
|
|
@@ -13499,6 +13478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13499
13478
|
(ngModelChange)="onCountryChange($event)"></tolle-country-selector>
|
|
13500
13479
|
|
|
13501
13480
|
<tolle-masked-input
|
|
13481
|
+
class="min-w-0 flex-1"
|
|
13502
13482
|
[id]="id"
|
|
13503
13483
|
[mask]="mask"
|
|
13504
13484
|
[size]="size"
|
|
@@ -13506,7 +13486,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13506
13486
|
[readonly]="readonly"
|
|
13507
13487
|
[placeholder]="placeholder"
|
|
13508
13488
|
[error]="error"
|
|
13509
|
-
[externalFocused]="isFocused"
|
|
13510
13489
|
[mergedPosition]="'right'"
|
|
13511
13490
|
[(ngModel)]="displayValue"
|
|
13512
13491
|
(ngModelChange)="onMaskInputChange($event)"></tolle-masked-input>
|
|
@@ -13515,8 +13494,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13515
13494
|
<ng-container *ngIf="!disabled">
|
|
13516
13495
|
<p
|
|
13517
13496
|
*ngIf="hint && !error"
|
|
13518
|
-
class="px-1 text-xs text-muted-foreground transition-opacity duration-200"
|
|
13519
|
-
[class.opacity-0]="isFocused && hideHintOnFocus">
|
|
13497
|
+
class="px-1 text-xs text-muted-foreground transition-opacity duration-200">
|
|
13520
13498
|
{{ hint }}
|
|
13521
13499
|
</p>
|
|
13522
13500
|
<p *ngIf="error && errorMessage" [id]="id + '-error'" class="px-1 text-xs text-destructive">
|