@seniorsistemas/angular-components 18.1.0 → 18.1.2
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/checkbox/lib/checkbox/checkbox.component.d.ts +13 -3
- package/esm2022/checkbox/lib/checkbox/checkbox.component.mjs +21 -12
- package/esm2022/dynamic-form/lib/dynamic-form/components/lookup/lookup.component.mjs +2 -1
- package/esm2022/file-upload/lib/file-upload/file-upload.component.mjs +4 -4
- package/esm2022/file-upload/lib/file-upload/file-upload.module.mjs +13 -30
- package/esm2022/numeric-mask/lib/numeric-mask/numeric-mask.directive.mjs +2 -34
- package/esm2022/select/lib/select/components/select-option/select-option.component.mjs +1 -1
- package/esm2022/select/lib/select/select.component.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs +20 -11
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +1 -0
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-file-upload.mjs +7 -24
- package/fesm2022/seniorsistemas-angular-components-file-upload.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs +1 -33
- package/fesm2022/seniorsistemas-angular-components-numeric-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
- package/file-upload/lib/file-upload/file-upload.module.d.ts +1 -1
- package/numeric-mask/lib/numeric-mask/numeric-mask.directive.d.ts +0 -15
- package/package.json +7 -7
|
@@ -3,17 +3,27 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class CheckboxComponent implements ControlValueAccessor {
|
|
4
4
|
disabled: import("@angular/core").ModelSignal<boolean>;
|
|
5
5
|
checked: import("@angular/core").ModelSignal<boolean>;
|
|
6
|
-
indeterminate: import("@angular/core").
|
|
6
|
+
indeterminate: import("@angular/core").InputSignal<boolean>;
|
|
7
7
|
label: import("@angular/core").InputSignal<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Event emitted when the checkbox value changes through user interaction.
|
|
10
|
+
*/
|
|
11
|
+
readonly checkedChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
8
12
|
private _onChange;
|
|
9
13
|
private _onTouched;
|
|
14
|
+
private _hasUserInteracted;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the checkbox should display the indeterminate state.
|
|
17
|
+
* Computed signal that only recalculates when dependencies change.
|
|
18
|
+
*/
|
|
19
|
+
readonly isIndeterminate: import("@angular/core").Signal<boolean>;
|
|
10
20
|
toggle(): void;
|
|
11
|
-
emit
|
|
21
|
+
private emit;
|
|
12
22
|
writeValue(value: any): void;
|
|
13
23
|
registerOnChange(onChange: (value: boolean) => void): void;
|
|
14
24
|
registerOnTouched(onTouched: () => void): void;
|
|
15
25
|
setDisabledState(disabled: boolean): void;
|
|
16
26
|
onBlur(): void;
|
|
17
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "s-checkbox", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "checked": "checkedChange"; "
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "s-checkbox", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "checked": "checkedChange"; "checkedChange": "checkedChange"; }, never, never, true, never>;
|
|
19
29
|
}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, forwardRef, input, model } from '@angular/core';
|
|
2
|
+
import { Component, computed, forwardRef, input, model, output, signal } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "@angular/common";
|
|
6
6
|
export class CheckboxComponent {
|
|
7
7
|
disabled = model(false);
|
|
8
8
|
checked = model(false);
|
|
9
|
-
indeterminate =
|
|
9
|
+
indeterminate = input(false);
|
|
10
10
|
label = input('');
|
|
11
|
+
/**
|
|
12
|
+
* Event emitted when the checkbox value changes through user interaction.
|
|
13
|
+
*/
|
|
14
|
+
checkedChange = output();
|
|
11
15
|
_onChange = () => { };
|
|
12
16
|
_onTouched = () => { };
|
|
17
|
+
_hasUserInteracted = signal(false);
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the checkbox should display the indeterminate state.
|
|
20
|
+
* Computed signal that only recalculates when dependencies change.
|
|
21
|
+
*/
|
|
22
|
+
isIndeterminate = computed(() => this.indeterminate() && !this._hasUserInteracted());
|
|
13
23
|
toggle() {
|
|
14
24
|
if (this.disabled()) {
|
|
15
25
|
return;
|
|
16
26
|
}
|
|
17
|
-
if (this.indeterminate()) {
|
|
18
|
-
this.
|
|
19
|
-
this.checked.set(
|
|
20
|
-
this.emit(
|
|
27
|
+
if (this.indeterminate() && !this._hasUserInteracted()) {
|
|
28
|
+
this._hasUserInteracted.set(true);
|
|
29
|
+
this.checked.set(true);
|
|
30
|
+
this.emit(true);
|
|
21
31
|
}
|
|
22
32
|
else {
|
|
23
33
|
const newValue = !this.checked();
|
|
@@ -27,8 +37,7 @@ export class CheckboxComponent {
|
|
|
27
37
|
}
|
|
28
38
|
emit(value) {
|
|
29
39
|
this._onChange(value);
|
|
30
|
-
this.
|
|
31
|
-
this.indeterminate.set(value);
|
|
40
|
+
this.checkedChange.emit(value);
|
|
32
41
|
}
|
|
33
42
|
writeValue(value) {
|
|
34
43
|
this.checked.set(!!value);
|
|
@@ -46,13 +55,13 @@ export class CheckboxComponent {
|
|
|
46
55
|
this._onTouched();
|
|
47
56
|
}
|
|
48
57
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CheckboxComponent, isStandalone: true, selector: "s-checkbox", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", checked: "checkedChange",
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: CheckboxComponent, isStandalone: true, selector: "s-checkbox", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", checked: "checkedChange", checkedChange: "checkedChange" }, providers: [
|
|
50
59
|
{
|
|
51
60
|
provide: NG_VALUE_ACCESSOR,
|
|
52
61
|
useExisting: forwardRef(() => CheckboxComponent),
|
|
53
62
|
multi: true,
|
|
54
63
|
},
|
|
55
|
-
], ngImport: i0, template: "<div\n class=\"flex cursor-pointer select-none gap-3\"\n [class.cursor-not-allowed]=\"disabled()\"\n tabindex=\"0\"\n role=\"checkbox\"\n [attr.aria-checked]=\"
|
|
64
|
+
], ngImport: i0, template: "<div\n class=\"flex cursor-pointer select-none gap-3\"\n [class.cursor-not-allowed]=\"disabled()\"\n tabindex=\"0\"\n role=\"checkbox\"\n [attr.aria-checked]=\"isIndeterminate() ? 'mixed' : checked()\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"toggle()\"\n (keydown.space)=\"toggle()\"\n (blur)=\"onBlur()\"\n>\n <div\n class=\"flex h-5 w-5 items-center justify-center rounded border border-grayscale-30 transition-all duration-200 hover:border-grayscale-50\"\n [ngClass]=\"{\n 'bg-primary hover:bg-tarawera-500': checked() || isIndeterminate(),\n 'bg-grayscale-0': !checked() && !isIndeterminate(),\n 'border-primary hover:border-tarawera-500': checked() || isIndeterminate(),\n 'opacity-50': disabled(),\n }\"\n >\n @if (isIndeterminate()) {\n <svg\n class=\"h-3 w-3 text-grayscale-0\"\n fill=\"none\"\n stroke=\"white\"\n stroke-width=\"4\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M6 12h12\" />\n </svg>\n } @else {\n @if (checked()) {\n <svg\n class=\"text-white h-3 w-3\"\n fill=\"none\"\n stroke=\"white\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M4.5 12.75l5.5 5.5 9.5-9.5\" />\n </svg>\n }\n }\n </div>\n <span\n [class.opacity-50]=\"disabled()\"\n class=\"text-grayscale-90\"\n >\n {{ label() }}\n </span>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
56
65
|
}
|
|
57
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
58
67
|
type: Component,
|
|
@@ -62,6 +71,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
62
71
|
useExisting: forwardRef(() => CheckboxComponent),
|
|
63
72
|
multi: true,
|
|
64
73
|
},
|
|
65
|
-
], template: "<div\n class=\"flex cursor-pointer select-none gap-3\"\n [class.cursor-not-allowed]=\"disabled()\"\n tabindex=\"0\"\n role=\"checkbox\"\n [attr.aria-checked]=\"
|
|
74
|
+
], template: "<div\n class=\"flex cursor-pointer select-none gap-3\"\n [class.cursor-not-allowed]=\"disabled()\"\n tabindex=\"0\"\n role=\"checkbox\"\n [attr.aria-checked]=\"isIndeterminate() ? 'mixed' : checked()\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"toggle()\"\n (keydown.space)=\"toggle()\"\n (blur)=\"onBlur()\"\n>\n <div\n class=\"flex h-5 w-5 items-center justify-center rounded border border-grayscale-30 transition-all duration-200 hover:border-grayscale-50\"\n [ngClass]=\"{\n 'bg-primary hover:bg-tarawera-500': checked() || isIndeterminate(),\n 'bg-grayscale-0': !checked() && !isIndeterminate(),\n 'border-primary hover:border-tarawera-500': checked() || isIndeterminate(),\n 'opacity-50': disabled(),\n }\"\n >\n @if (isIndeterminate()) {\n <svg\n class=\"h-3 w-3 text-grayscale-0\"\n fill=\"none\"\n stroke=\"white\"\n stroke-width=\"4\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M6 12h12\" />\n </svg>\n } @else {\n @if (checked()) {\n <svg\n class=\"text-white h-3 w-3\"\n fill=\"none\"\n stroke=\"white\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M4.5 12.75l5.5 5.5 9.5-9.5\" />\n </svg>\n }\n }\n </div>\n <span\n [class.opacity-50]=\"disabled()\"\n class=\"text-grayscale-90\"\n >\n {{ label() }}\n </span>\n</div>\n" }]
|
|
66
75
|
}] });
|
|
67
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
76
|
+
//# sour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AgICAgID5cbiAgICAgICAgICAgICAgICA8cGF0aCBkPVwiTTYgMTJoMTJcIiAvPlxuICAgICAgICAgICAgPC9zdmc+XG4gICAgICAgIH0gQGVsc2Uge1xuICAgICAgICAgICAgQGlmIChjaGVja2VkKCkpIHtcbiAgICAgICAgICAgICAgICA8c3ZnXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzPVwidGV4dC13aGl0ZSBoLTMgdy0zXCJcbiAgICAgICAgICAgICAgICAgICAgZmlsbD1cIm5vbmVcIlxuICAgICAgICAgICAgICAgICAgICBzdHJva2U9XCJ3aGl0ZVwiXG4gICAgICAgICAgICAgICAgICAgIHN0cm9rZS13aWR0aD1cIjRcIlxuICAgICAgICAgICAgICAgICAgICBzdHJva2UtbGluZWNhcD1cInJvdW5kXCJcbiAgICAgICAgICAgICAgICAgICAgc3Ryb2tlLWxpbmVqb2luPVwicm91bmRcIlxuICAgICAgICAgICAgICAgICAgICB2aWV3Qm94PVwiMCAwIDI0IDI0XCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9XCJNNC41IDEyLjc1bDUuNSA1LjUgOS41LTkuNVwiIC8+XG4gICAgICAgICAgICAgICAgPC9zdmc+XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICA8L2Rpdj5cbiAgICA8c3BhblxuICAgICAgICBbY2xhc3Mub3BhY2l0eS01MF09XCJkaXNhYmxlZCgpXCJcbiAgICAgICAgY2xhc3M9XCJ0ZXh0LWdyYXlzY2FsZS05MFwiXG4gICAgPlxuICAgICAgICB7eyBsYWJlbCgpIH19XG4gICAgPC9zcGFuPlxuPC9kaXY+XG4iXX0=
|