@gipisistemas/ngx-core 1.0.4 → 1.0.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.
package/README.md CHANGED
@@ -165,5 +165,4 @@ Utilizando tema padrão:
165
165
  ```
166
166
 
167
167
  ## 🚀 Produção
168
-
169
168
  Ainda será implementado
@@ -0,0 +1,21 @@
1
+ import { tIconFontSet, tIconGrade, tIconOptical, tIconVariation, tIconWeight } from '../icon/icon.component';
2
+ import * as i0 from "@angular/core";
3
+ export declare class FieldsetComponent {
4
+ protected readonly _uniqueId: string;
5
+ id: string;
6
+ name: string;
7
+ label: string;
8
+ border: 'solid' | 'dashed';
9
+ icon: string;
10
+ svgIcon: string;
11
+ iconFontSet: tIconFontSet;
12
+ iconSize: number;
13
+ iconVariation: tIconVariation;
14
+ iconWeight: tIconWeight;
15
+ iconGrade: tIconGrade;
16
+ iconOptical: tIconOptical;
17
+ constructor();
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<FieldsetComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetComponent, "gipi-fieldset", ["gFieldset"], { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "border": { "alias": "border"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "svgIcon": { "alias": "svgIcon"; "required": false; }; "iconFontSet": { "alias": "iconFontSet"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "iconVariation": { "alias": "iconVariation"; "required": false; }; "iconWeight": { "alias": "weight"; "required": false; }; "iconGrade": { "alias": "grade"; "required": false; }; "iconOptical": { "alias": "optical"; "required": false; }; }, {}, never, ["*"], true, never>;
20
+ static ngAcceptInputType_iconSize: unknown;
21
+ }
@@ -0,0 +1,58 @@
1
+ @use '../../theming/utils' as utils;
2
+
3
+ @mixin fieldset-theme($theme: ()) {
4
+ $font-family: utils.get-font-family($theme);
5
+ $font-size: utils.get-font-size($theme);
6
+ $font-color: utils.get-font-color($theme);
7
+
8
+ $white-100: utils.get-color($theme, white, 100);
9
+ $secondary-100: utils.get-color($theme, secondary, 100);
10
+
11
+ .g-fieldset-content {
12
+ display: block;
13
+ min-width: 0;
14
+ width: 100%;
15
+ border-radius: 0.4rem;
16
+ position: relative;
17
+
18
+ border-width: 1.8px;
19
+ padding-inline: 1.6rem;
20
+ padding-block: 1.6rem;
21
+ margin-inline: 0;
22
+ border-color: $secondary-100;
23
+
24
+ &.g-fieldset-disabled {
25
+ opacity: 0.6;
26
+ pointer-events: none;
27
+ }
28
+
29
+ &.g-fieldset-border-solid {
30
+ border-style: solid;
31
+ }
32
+
33
+ &.g-fieldset-border-dashed {
34
+ border-style: dashed;
35
+ }
36
+
37
+ .g-fieldset-legend {
38
+ position: absolute;
39
+ top: -0.8rem;
40
+ left: 1rem;
41
+ white-space: nowrap;
42
+ padding: 0 0.6rem;
43
+ background-color: $white-100;
44
+ font-family: $font-family;
45
+ font-size: $font-size;
46
+ line-height: $font-size;
47
+ color: $font-color;
48
+
49
+ .g-fieldset-legend-icon {
50
+ display: inline-block;
51
+ vertical-align: middle;
52
+ margin-right: 0.6rem;
53
+
54
+ @include utils.user-select(none);
55
+ }
56
+ }
57
+ }
58
+ }
@@ -0,0 +1 @@
1
+ export * from './fieldset.component';
@@ -14,12 +14,14 @@ export * from './echarts';
14
14
  export * from './empty';
15
15
  export * from './expansion-panel';
16
16
  export * from './field-error';
17
+ export * from './fieldset';
17
18
  export * from './flex-layout';
18
19
  export * from './form-wrapper';
19
20
  export * from './helpful-tip';
20
21
  export * from './icon';
21
22
  export * from './input';
22
23
  export * from './input-currency';
24
+ export * from './input-file';
23
25
  export * from './input-group';
24
26
  export * from './input-phone';
25
27
  export * from './loading';
@@ -0,0 +1 @@
1
+ export * from './input-file.component';
@@ -0,0 +1,65 @@
1
+ import { ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { AbstractControl, ControlValueAccessor, NgControl, ValidationErrors, Validator } from '@angular/forms';
3
+ import * as i0 from "@angular/core";
4
+ export declare class InputFileComponent implements ControlValueAccessor, Validator, OnChanges {
5
+ ngControl?: NgControl;
6
+ fileInput: ElementRef<HTMLInputElement>;
7
+ protected readonly _matFormFieldUniqueId: string;
8
+ protected readonly _uniqueId: string;
9
+ protected readonly isDragOver: import("@angular/core").WritableSignal<boolean>;
10
+ protected readonly isLoading: import("@angular/core").WritableSignal<boolean>;
11
+ protected readonly errorMessage: import("@angular/core").WritableSignal<string>;
12
+ id: string;
13
+ name: string;
14
+ label: string;
15
+ placeholder: string;
16
+ help: string;
17
+ hintLabel: string;
18
+ disabled: boolean;
19
+ readonly: boolean;
20
+ required: boolean;
21
+ /** Em bytes, ex: `1024` = `1 KB` */
22
+ maxSize: number;
23
+ /** Ex: `['svg', 'png', 'jpg', 'jpeg', 'pdf']` */
24
+ allowedExtensions: string[];
25
+ /** Ex: `['image/png', 'image/jpeg', 'application/pdf']` */
26
+ allowedTypes: string[];
27
+ private _selectedFile;
28
+ get selectedFile(): File | null;
29
+ set selectedFile(value: File | null);
30
+ readonly onFocusEvent: EventEmitter<FocusEvent>;
31
+ readonly onBlurEvent: EventEmitter<FocusEvent>;
32
+ readonly onKeydownEvent: EventEmitter<KeyboardEvent>;
33
+ readonly onFileChangeEvent: EventEmitter<File | null>;
34
+ readonly onFileErrorEvent: EventEmitter<string>;
35
+ protected get maxSizeText(): string;
36
+ protected get acceptAttr(): string;
37
+ constructor();
38
+ ngOnChanges(changes: SimpleChanges): void;
39
+ private _onChange;
40
+ private _onTouched;
41
+ private _validatorChangeFn;
42
+ writeValue(value: File | null): void;
43
+ registerOnChange(fn: (value: File | null) => void): void;
44
+ registerOnTouched(fn: () => void): void;
45
+ setDisabledState?(isDisabled: boolean): void;
46
+ validate(control: AbstractControl<File | null>): ValidationErrors | null;
47
+ registerOnValidatorChange(fn: () => void): void;
48
+ protected onInputKeydown(event: KeyboardEvent): void;
49
+ protected onInputFocus(event: FocusEvent): void;
50
+ protected onInputBlur(event: FocusEvent): void;
51
+ protected onFileSelect(event: Event): void;
52
+ protected onDragOver(event: DragEvent): void;
53
+ protected onDragLeave(event: DragEvent): void;
54
+ protected onDrop(event: DragEvent): void;
55
+ private _handleFile;
56
+ private _validateFile;
57
+ protected removeFile(): void;
58
+ protected triggerFileInput(): void;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputFileComponent, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputFileComponent, "gipi-input-file", ["gInputFile"], { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "help": { "alias": "help"; "required": false; }; "hintLabel": { "alias": "hintLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "allowedExtensions": { "alias": "allowedExtensions"; "required": false; }; "allowedTypes": { "alias": "allowedTypes"; "required": false; }; "selectedFile": { "alias": "value"; "required": false; }; }, { "onFocusEvent": "focus"; "onBlurEvent": "blur"; "onKeydownEvent": "keydown"; "onFileChangeEvent": "fileChange"; "onFileErrorEvent": "fileError"; }, never, never, true, never>;
61
+ static ngAcceptInputType_disabled: unknown;
62
+ static ngAcceptInputType_readonly: unknown;
63
+ static ngAcceptInputType_required: unknown;
64
+ static ngAcceptInputType_maxSize: unknown;
65
+ }
@@ -0,0 +1,165 @@
1
+ @use '../../theming/utils' as utils;
2
+
3
+ @mixin input-file-theme($theme: ()) {
4
+ $font-family: utils.get-font-family($theme);
5
+ $font-size: utils.get-font-size($theme);
6
+ $font-color: utils.get-font-color($theme);
7
+
8
+ $white-100: utils.get-color($theme, white, 100);
9
+
10
+ // Not disabled
11
+ $black-300: utils.get-color($theme, black, 300);
12
+ $black-400: utils.get-color($theme, black, 400);
13
+
14
+ $primary-500: utils.get-color($theme, primary, 500);
15
+ $primary-600: utils.get-color($theme, primary, 600);
16
+
17
+ // Disabled
18
+ $secondary-50: utils.get-color($theme, secondary, 50);
19
+ $secondary-200: utils.get-color($theme, secondary, 200);
20
+ $secondary-300: utils.get-color($theme, secondary, 300);
21
+ $secondary-500: utils.get-color($theme, secondary, 500);
22
+
23
+ .g-input-file-label {
24
+ @include utils.field-label($theme);
25
+ }
26
+
27
+ .g-input-file {
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 4px;
31
+ font-family: $font-family;
32
+ color: $font-color;
33
+ position: relative;
34
+ overflow: visible;
35
+ min-width: 0;
36
+ width: 100%;
37
+ min-height: fit-content;
38
+ height: fit-content;
39
+
40
+ .g-input-file-wrapper {
41
+ display: flex;
42
+ border-radius: 0.4rem;
43
+ height: 3.6rem;
44
+ border: 1px solid $black-400;
45
+ background-color: $white-100;
46
+ position: relative;
47
+ overflow: hidden;
48
+ transition: all 0.3s ease-in-out;
49
+
50
+ &:hover {
51
+ border-color: $black-300;
52
+ }
53
+
54
+ &:focus,
55
+ &:focus-within {
56
+ border-color: $black-300;
57
+ box-shadow:
58
+ inset 0 1px 1px rgba(0, 0, 0, 0.075),
59
+ 0 0 8px rgba(101, 101, 101, 0.6);
60
+ }
61
+
62
+ &.drag-over {
63
+ background-color: $secondary-50;
64
+ border-color: $black-300;
65
+ box-shadow:
66
+ inset 0 1px 1px rgba(0, 0, 0, 0.075),
67
+ 0 0 8px rgba(101, 101, 101, 0.6);
68
+ }
69
+
70
+ &.loading {
71
+ cursor: progress;
72
+ // Você pode adicionar uma animação aqui
73
+ // @include animate-pulse();
74
+ }
75
+
76
+ &.disabled {
77
+ @include utils.user-select(none);
78
+
79
+ cursor: not-allowed;
80
+ color: $secondary-300 !important;
81
+ background-color: $secondary-50 !important;
82
+ border-color: $secondary-200 !important;
83
+ }
84
+ }
85
+
86
+ .g-input-file-input-hidden {
87
+ position: absolute;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ opacity: 0;
93
+ visibility: hidden;
94
+ cursor: pointer;
95
+ }
96
+
97
+ .g-input-file-select-button {
98
+ flex-shrink: 0;
99
+ padding: 1rem;
100
+ height: 100%;
101
+ font-weight: 500;
102
+ color: $white-100;
103
+ background-color: $primary-500;
104
+ border: none;
105
+ border-top-left-radius: 0.4rem;
106
+ border-bottom-left-radius: 0.4rem;
107
+ transition: background-color 0.3s;
108
+ cursor: pointer;
109
+
110
+ &:hover {
111
+ background-color: $primary-600;
112
+ }
113
+
114
+ &:disabled {
115
+ @include utils.user-select(none);
116
+
117
+ cursor: not-allowed;
118
+ background-color: $secondary-50 !important;
119
+ color: $secondary-300 !important;
120
+ }
121
+ }
122
+
123
+ .g-input-file-display-area {
124
+ flex-grow: 1;
125
+ padding: 0.4rem;
126
+ color: $font-color;
127
+ font-size: 1.4rem;
128
+ font-weight: 500;
129
+ white-space: nowrap;
130
+ overflow: hidden;
131
+ text-overflow: ellipsis;
132
+ display: flex;
133
+ align-items: center;
134
+ }
135
+
136
+ .g-input-file-placeholder {
137
+ color: $secondary-500 !important;
138
+ }
139
+
140
+ .g-input-file-name {
141
+ color: $font-color;
142
+ overflow: hidden;
143
+ text-overflow: ellipsis;
144
+ }
145
+
146
+ .g-input-file-error {
147
+ margin-top: 0.5rem;
148
+ padding: 0.5rem 0.75rem;
149
+ border-radius: 0.5rem;
150
+ background-color: #ffebee;
151
+ border: 1px solid #ffcdd2;
152
+ color: #d32f2f;
153
+ font-size: 0.875rem;
154
+ font-weight: 500;
155
+ display: flex;
156
+ align-items: center;
157
+ gap: 0.5rem;
158
+
159
+ &::before {
160
+ content: '⚠';
161
+ font-size: 1rem;
162
+ }
163
+ }
164
+ }
165
+ }