@sapphire-ion/framework 0.30.20 → 1.0.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/esm2022/lib/components/default/default-list/list.mjs +1 -1
- package/esm2022/lib/components/default/default-table/default-table.component.mjs +6 -5
- package/esm2022/lib/components/default/default-table/th-filter/th-filter.component.mjs +10 -9
- package/esm2022/lib/components/default/default-view/default-view.component.mjs +10 -10
- package/esm2022/lib/components/default/default.module.mjs +12 -4
- package/esm2022/lib/components/filter/filter.component.mjs +2 -2
- package/esm2022/lib/components/inputs/custom-input.mjs +57 -49
- package/esm2022/lib/components/inputs/input-bool/input-bool.component.mjs +31 -34
- package/esm2022/lib/components/inputs/input-bool/input-bool.configuration.mjs +4 -4
- package/esm2022/lib/components/inputs/input-cpf-cnpj/input-cpf-cnpj.component.mjs +33 -46
- package/esm2022/lib/components/inputs/input-cpf-cnpj/input-cpf-cnpj.configuration.mjs +2 -2
- package/esm2022/lib/components/inputs/input-date/input-date.component.mjs +86 -97
- package/esm2022/lib/components/inputs/input-decimal/input-decimal.component.mjs +158 -190
- package/esm2022/lib/components/inputs/input-decimal/input-decimal.configuration.mjs +6 -1
- package/esm2022/lib/components/inputs/input-file/download-button/download-button.component.mjs +12 -10
- package/esm2022/lib/components/inputs/input-file/input-file.component.mjs +60 -98
- package/esm2022/lib/components/inputs/input-file/input-file.configuration.mjs +18 -5
- package/esm2022/lib/components/inputs/input-provider-factory.mjs +4 -7
- package/esm2022/lib/components/inputs/input-select/directives/sion-label-template.directive.mjs +16 -0
- package/esm2022/lib/components/inputs/input-select/directives/sion-option-template.directive.mjs +18 -0
- package/esm2022/lib/components/inputs/input-select/directives/sion-placeholder-template.directive.mjs +16 -0
- package/esm2022/lib/components/inputs/input-select/input-select.component.mjs +235 -264
- package/esm2022/lib/components/inputs/input-select/input.select.configuration.mjs +50 -29
- package/esm2022/lib/components/inputs/input-string/input-string.component.mjs +27 -42
- package/esm2022/lib/components/inputs/input-string/input-string.configuration.mjs +1 -1
- package/esm2022/lib/components/inputs/input-textarea/input-textarea.component.mjs +26 -38
- package/esm2022/lib/components/inputs/input-textarea/input-textarea.configuration.mjs +7 -0
- package/esm2022/lib/components/inputs/inputs.module.mjs +72 -81
- package/esm2022/lib/components/login/login-admin/login-admin.component.mjs +1 -1
- package/esm2022/lib/components/popover/sion-popover/sion-popover.component.mjs +171 -0
- package/esm2022/lib/components/popover/sion-popover.module.mjs +23 -0
- package/esm2022/lib/components/stepper/step/step.component.mjs +3 -3
- package/esm2022/lib/components/stepper/stepper.component.mjs +13 -13
- package/esm2022/lib/index.mjs +10 -6
- package/esm2022/lib/services/utils.service.mjs +3 -3
- package/esm2022/lib/services/web/http.ativo.service.mjs +2 -2
- package/esm2022/lib/services/web/http.service.mjs +4 -7
- package/fesm2022/sapphire-ion-framework.mjs +1226 -1737
- package/fesm2022/sapphire-ion-framework.mjs.map +1 -1
- package/lib/components/default/default.module.d.ts +3 -1
- package/lib/components/inputs/custom-input.d.ts +26 -22
- package/lib/components/inputs/input-bool/input-bool.component.d.ts +13 -16
- package/lib/components/inputs/input-bool/input-bool.configuration.d.ts +2 -2
- package/lib/components/inputs/input-cpf-cnpj/input-cpf-cnpj.component.d.ts +13 -18
- package/lib/components/inputs/input-cpf-cnpj/input-cpf-cnpj.configuration.d.ts +1 -1
- package/lib/components/inputs/input-date/input-date.component.d.ts +21 -24
- package/lib/components/inputs/input-decimal/input-decimal.component.d.ts +21 -36
- package/lib/components/inputs/input-decimal/input-decimal.configuration.d.ts +3 -0
- package/lib/components/inputs/input-file/download-button/download-button.component.d.ts +2 -1
- package/lib/components/inputs/input-file/input-file.component.d.ts +20 -32
- package/lib/components/inputs/input-file/input-file.configuration.d.ts +2 -5
- package/lib/components/inputs/input-provider-factory.d.ts +1 -1
- package/lib/components/inputs/input-select/directives/sion-label-template.directive.d.ts +12 -0
- package/lib/components/inputs/input-select/directives/sion-option-template.directive.d.ts +11 -0
- package/lib/components/inputs/input-select/directives/sion-placeholder-template.directive.d.ts +12 -0
- package/lib/components/inputs/input-select/input-select.component.d.ts +60 -58
- package/lib/components/inputs/input-select/input.select.configuration.d.ts +11 -9
- package/lib/components/inputs/input-string/input-string.component.d.ts +11 -16
- package/lib/components/inputs/input-textarea/input-textarea.component.d.ts +11 -15
- package/lib/components/inputs/input-textarea/input-textarea.configuration.d.ts +4 -0
- package/lib/components/inputs/inputs.module.d.ts +18 -21
- package/lib/components/popover/sion-popover/sion-popover.component.d.ts +36 -0
- package/lib/components/popover/sion-popover.module.d.ts +8 -0
- package/lib/components/stepper/stepper.component.d.ts +3 -6
- package/lib/index.d.ts +5 -4
- package/lib/services/utils.service.d.ts +1 -1
- package/package.json +5 -4
- package/themes/compiled-styles.scss +157 -4
- package/themes/components/default/default-table/default-table.component.scss +0 -13
- package/themes/components/default/default-table/th-filter/th-filter.component.scss +0 -3
- package/themes/components/inputs/input-bool/input-bool.component.scss +2 -13
- package/themes/components/inputs/input-date/input-date.component.scss +33 -34
- package/themes/components/inputs/input-decimal/input-decimal.component.scss +8 -42
- package/themes/components/inputs/input-file/input-file.component.scss +16 -2
- package/themes/components/inputs/input-select/input-select.component.scss +47 -24
- package/themes/components/inputs/input-textarea/input-textarea.component.scss +7 -0
- package/themes/components/inputs/inputs.scss +103 -49
- package/themes/components/inputs_old/inputs.scss +67 -0
- package/themes/components/popover/sion-popover/sion-popover.component.scss +46 -0
- package/themes/styles/components.scss +34 -0
- package/themes/styles/ionic/ion-datetime.scss +3 -2
- package/esm2022/lib/components/inputs/custom-signal-input.mjs +0 -74
- package/esm2022/lib/components/inputs/input-color/input-color.component.mjs +0 -487
- package/esm2022/lib/components/inputs/input-loading/input-loading.component.mjs +0 -16
- package/esm2022/lib/components/inputs/input-select/ISelect.mjs +0 -11
- package/esm2022/lib/components/inputs/input-select/input-select-internal-option/input-select-internal-option.component.mjs +0 -42
- package/esm2022/lib/components/inputs/input-select/input-select-option/input-select-option.component.mjs +0 -46
- package/esm2022/lib/components/inputs/input-select/input-select-template.directive.mjs +0 -16
- package/lib/components/inputs/custom-signal-input.d.ts +0 -38
- package/lib/components/inputs/input-color/input-color.component.d.ts +0 -80
- package/lib/components/inputs/input-loading/input-loading.component.d.ts +0 -7
- package/lib/components/inputs/input-select/ISelect.d.ts +0 -21
- package/lib/components/inputs/input-select/input-select-internal-option/input-select-internal-option.component.d.ts +0 -18
- package/lib/components/inputs/input-select/input-select-option/input-select-option.component.d.ts +0 -24
- package/lib/components/inputs/input-select/input-select-template.directive.d.ts +0 -8
- package/themes/components/inputs/input-loading/input-loading.component.scss +0 -0
- package/themes/components/inputs/input-select/input-select-internal-option/input-select-internal-option.component.scss +0 -0
- package/themes/components/inputs/input-select/input-select-option/input-select-option.component.scss +0 -0
- /package/themes/components/{inputs → inputs_old}/input-color/input-color.component.scss +0 -0
|
@@ -1,67 +1,121 @@
|
|
|
1
|
-
$
|
|
2
|
-
$
|
|
3
|
-
|
|
1
|
+
@mixin property($variable: variable, $syntax: "<color>", $inherits: true, $initial-value: #FF){
|
|
2
|
+
@property --#{$variable} {
|
|
3
|
+
syntax: $syntax;
|
|
4
|
+
initial-value: $initial-value;
|
|
5
|
+
inherits: $inherits;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@include property(
|
|
10
|
+
$variable: input-color,
|
|
11
|
+
$syntax: "<color>",
|
|
12
|
+
$inherits: false,
|
|
13
|
+
$initial-value: transparent
|
|
14
|
+
);
|
|
4
15
|
|
|
5
|
-
$input-height: 58px;
|
|
6
16
|
|
|
7
|
-
.
|
|
8
|
-
|
|
17
|
+
.input-container{
|
|
18
|
+
// --border: 1px solid color-mix(in srgb, var(--input-color) 66%, transparent);
|
|
19
|
+
// border-left: var(--border);
|
|
20
|
+
// border-right: var(--border);
|
|
21
|
+
// border-bottom: var(--border);
|
|
22
|
+
// background-color: color-mix(in srgb, var(--ion-color-dark) 3%, transparent);
|
|
23
|
+
//radial-gradient(ellipse at -20px top, hsl(from white h s l / 0.05), hsl(from white h s l / 0)), hsl(from var(--input-color-bg-light) h s l / .8)
|
|
24
|
+
@apply px-3 rounded-xl py-1 relative cursor-text scale-100 shadow-md;
|
|
9
25
|
&:hover{
|
|
10
|
-
@apply
|
|
11
|
-
background: color-mix(in srgb, var(--ion-color-dark) 15%, transparent 93%);
|
|
26
|
+
@apply brightness-90;
|
|
12
27
|
}
|
|
13
|
-
|
|
28
|
+
transition:
|
|
29
|
+
--input-color .2s ease-in-out,
|
|
30
|
+
box-shadow .2s ease-in-out,
|
|
31
|
+
opacity .2s ease-in-out,
|
|
32
|
+
filter .2s ease-in-out;
|
|
14
33
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
|
|
35
|
+
--color: var(--ion-color-dark);
|
|
36
|
+
--input-color: var(--input-background, var(--ion-color-step-250));
|
|
37
|
+
--shadow: 0 3px 4px -1px rgb(0 0 0 / 0.1);
|
|
38
|
+
--inset-shadow: var(--input-color) 0px 1.75px 1px 0px inset;
|
|
39
|
+
--focused-shadow: 0 0 1px 2px color-mix(in srgb, var(--ion-color-medium) 35%, transparent);
|
|
40
|
+
|
|
41
|
+
box-shadow: var(--inset-shadow), var(--shadow);
|
|
42
|
+
will-change: box-shadow, filter opacity;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: flex-start;
|
|
47
|
+
background: radial-gradient(ellipse at 0px top,
|
|
48
|
+
hsl(from var(--input-color) h s l / 0.5),
|
|
49
|
+
hsl(from var(--input-color) h s l / 0.4)),
|
|
50
|
+
hsl(from var(--ion-color-light) h s l / 0.8);
|
|
51
|
+
|
|
52
|
+
&:focus-within, &:focus, &.manual-focus{
|
|
53
|
+
box-shadow: var(--inset-shadow), var(--shadow), var(--focused-shadow);
|
|
54
|
+
@apply brightness-90;
|
|
55
|
+
}
|
|
56
|
+
.input-label{
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
@apply text-[--color] text-xs flex items-center justify-start gap-1 w-full max-w-full truncate min-w-0 h-4;
|
|
59
|
+
}
|
|
60
|
+
input, textarea{
|
|
61
|
+
@apply outline-none text-sm rounded-md bg-transparent w-full text-[--ion-color-dark] h-6;
|
|
62
|
+
}
|
|
63
|
+
&.loading{
|
|
64
|
+
cursor: wait !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.required .input-label::after{
|
|
68
|
+
content: "*";
|
|
69
|
+
color: var(--ion-color-danger);
|
|
70
|
+
vertical-align: bottom;
|
|
20
71
|
}
|
|
21
|
-
border-bottom-color: $ion-border-contrast;
|
|
22
|
-
border-right-color : $ion-border-base;
|
|
23
|
-
border-top-color : $ion-border-base;
|
|
24
|
-
border-left-color : $ion-border-base;
|
|
25
|
-
|
|
26
|
-
border-width: 1px 1px 2px 1px;
|
|
27
72
|
&.submitted.invalid{
|
|
28
|
-
|
|
73
|
+
--input-color: color-mix(in srgb, var(--ion-color-danger) 50%, transparent);
|
|
29
74
|
}
|
|
30
75
|
&.disabled{
|
|
31
|
-
|
|
76
|
+
@apply cursor-not-allowed opacity-50 brightness-100;
|
|
77
|
+
* {
|
|
78
|
+
@apply pointer-events-none;
|
|
79
|
+
}
|
|
32
80
|
}
|
|
33
|
-
ion-card-content{ @apply size-full bg-transparent p-0; }
|
|
34
|
-
|
|
35
|
-
min-height: $input-height;
|
|
36
|
-
max-height: $input-height;
|
|
37
|
-
height: $input-height;
|
|
38
|
-
}
|
|
39
|
-
ion-item{
|
|
40
|
-
--background: transparent;
|
|
41
81
|
}
|
|
42
82
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
83
|
+
.loading-container{
|
|
84
|
+
position: absolute;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: end;
|
|
93
|
+
align-items: center;
|
|
94
|
+
padding-right: .5rem;
|
|
95
|
+
|
|
96
|
+
will-change: opacity;
|
|
97
|
+
transition: opacity .2s ease-in-out;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
|
|
100
|
+
ion-spinner{
|
|
101
|
+
will-change: transform;
|
|
102
|
+
transition: transform .2s ease-in-out;
|
|
103
|
+
transform: translateY(-100%);
|
|
51
104
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
105
|
+
opacity: 0;
|
|
106
|
+
z-index: 10;
|
|
107
|
+
|
|
108
|
+
&.loading{
|
|
109
|
+
ion-spinner{
|
|
110
|
+
transform: translateY(0);
|
|
111
|
+
}
|
|
112
|
+
opacity: 1;
|
|
57
113
|
}
|
|
58
114
|
}
|
|
59
115
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
&:focus-within{
|
|
65
|
-
border-bottom-color: var(--ion-color-primary);
|
|
116
|
+
ion-modal{
|
|
117
|
+
&::part(content){
|
|
118
|
+
@apply rounded-xl;
|
|
119
|
+
border: 1px solid var(--ion-color-step-250);
|
|
66
120
|
}
|
|
67
121
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
$ion-border-base : color-mix(in srgb, var(--ion-color-medium) 30%, transparent 70%);
|
|
2
|
+
$ion-border-contrast : var(--ion-color-medium);
|
|
3
|
+
$ion-border-invalid : color-mix(in srgb, var(--ion-color-danger) 75%, transparent 25%);
|
|
4
|
+
|
|
5
|
+
$input-height: 58px;
|
|
6
|
+
|
|
7
|
+
.on-hover{
|
|
8
|
+
background: color-mix(in srgb, var(--ion-color-light) 97%, transparent 3%);
|
|
9
|
+
&:hover{
|
|
10
|
+
@apply transition-all ease-in-out duration-300;
|
|
11
|
+
background: color-mix(in srgb, var(--ion-color-dark) 15%, transparent 93%);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
ion-card.ion-card-input{
|
|
16
|
+
@apply rounded-2xl w-full h-full flex justify-center items-center transition-all ease-in-out duration-300 m-0 overflow-hidden shadow-none;
|
|
17
|
+
background: color-mix(in srgb, var(--ion-color-light) 97%, transparent 3%);
|
|
18
|
+
&:hover{
|
|
19
|
+
background: color-mix(in srgb, var(--ion-color-dark) 15%, transparent 93%);
|
|
20
|
+
}
|
|
21
|
+
border-bottom-color: $ion-border-contrast;
|
|
22
|
+
border-right-color : $ion-border-base;
|
|
23
|
+
border-top-color : $ion-border-base;
|
|
24
|
+
border-left-color : $ion-border-base;
|
|
25
|
+
|
|
26
|
+
border-width: 1px 1px 2px 1px;
|
|
27
|
+
&.submitted.invalid{
|
|
28
|
+
border-color: $ion-border-invalid !important;
|
|
29
|
+
}
|
|
30
|
+
&.disabled{
|
|
31
|
+
background-color: color-mix(in srgb, var(--ion-color-medium) 30%, transparent 70%) !important;
|
|
32
|
+
}
|
|
33
|
+
ion-card-content{ @apply size-full bg-transparent p-0; }
|
|
34
|
+
|
|
35
|
+
min-height: $input-height;
|
|
36
|
+
max-height: $input-height;
|
|
37
|
+
height: $input-height;
|
|
38
|
+
}
|
|
39
|
+
ion-item{
|
|
40
|
+
--background: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ion-text#label{
|
|
44
|
+
&.required{
|
|
45
|
+
&::after {
|
|
46
|
+
content: "*";
|
|
47
|
+
color: var(--ion-color-danger);
|
|
48
|
+
vertical-align: text-bottom;
|
|
49
|
+
font-size: small;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
&:not(.required)::after{
|
|
53
|
+
content: var(--input-opcional-label, "(Opcional)");
|
|
54
|
+
color: var(--ion-color-medium);
|
|
55
|
+
vertical-align: text-bottom;
|
|
56
|
+
font-size: small;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.on-focus{
|
|
61
|
+
border-bottom-color: var(--ion-color-primary);
|
|
62
|
+
}
|
|
63
|
+
.focus-within\:on-focus{
|
|
64
|
+
&:focus-within{
|
|
65
|
+
border-bottom-color: var(--ion-color-primary);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.popover-wrapper {
|
|
2
|
+
@apply absolute z-50 rounded-xl;
|
|
3
|
+
width: max-content;
|
|
4
|
+
position: absolute;
|
|
5
|
+
will-change: left, top, bottom, right, transform, opacity, filter;
|
|
6
|
+
transition: opacity, transform, filter 0.2s ease-in-out;
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
.popover-arrow{
|
|
10
|
+
@apply rounded-sm;
|
|
11
|
+
position: absolute;
|
|
12
|
+
transform: scale(1) rotate(var(--rotation)) !important;
|
|
13
|
+
clip-path: var(--clip-path-triangle, polygon(0% 0%,0% 100%,100% 100%));
|
|
14
|
+
}
|
|
15
|
+
.visible-anim {
|
|
16
|
+
animation: visible 0.2s ease-in-out forwards;
|
|
17
|
+
}
|
|
18
|
+
.invisible-anim {
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
animation: invisible 0.2s ease-in-out forwards;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
@keyframes visible {
|
|
24
|
+
from {
|
|
25
|
+
opacity: 0 !important;
|
|
26
|
+
filter: grayscale(0.9);
|
|
27
|
+
transform: scale(0.95);
|
|
28
|
+
}
|
|
29
|
+
to {
|
|
30
|
+
opacity: 1 !important;
|
|
31
|
+
filter: grayscale(0);
|
|
32
|
+
transform: scale(1);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@keyframes invisible {
|
|
36
|
+
from {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
filter: grayscale(0);
|
|
39
|
+
transform: scale(1);
|
|
40
|
+
}
|
|
41
|
+
to {
|
|
42
|
+
opacity: 0 !important;
|
|
43
|
+
filter: grayscale(0.9);
|
|
44
|
+
transform: scale(0.95);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -49,4 +49,38 @@ image{
|
|
|
49
49
|
|
|
50
50
|
tabs{
|
|
51
51
|
@apply block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
input-bool,
|
|
55
|
+
input-date,
|
|
56
|
+
input-datetime,
|
|
57
|
+
input-time,
|
|
58
|
+
input-decimal,
|
|
59
|
+
input-number,
|
|
60
|
+
input-currency,
|
|
61
|
+
input-percentage,
|
|
62
|
+
input-file,
|
|
63
|
+
input-select,
|
|
64
|
+
// input-color,
|
|
65
|
+
input-string,
|
|
66
|
+
input-textarea {
|
|
67
|
+
display: block;
|
|
68
|
+
@apply box-border;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
app-input-bool,
|
|
72
|
+
app-input-date,
|
|
73
|
+
app-input-datetime,
|
|
74
|
+
app-input-time,
|
|
75
|
+
app-input-decimal,
|
|
76
|
+
app-input-number,
|
|
77
|
+
app-input-currency,
|
|
78
|
+
app-input-percentage,
|
|
79
|
+
app-input-file,
|
|
80
|
+
app-input-select,
|
|
81
|
+
// input-color,
|
|
82
|
+
input-string,
|
|
83
|
+
input-textarea {
|
|
84
|
+
@apply box-border;
|
|
85
|
+
display: block;
|
|
52
86
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
ion-datetime{
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// border: 1px solid $translucid-border-color;
|
|
3
4
|
@apply rounded-2xl;
|
|
4
|
-
--wheel-fade-background-rgb: transparent;
|
|
5
5
|
//--ion-color-step-300: var(--ion-color-step-150);
|
|
6
|
+
// --wheel-fade-background-rgb: transparent;
|
|
6
7
|
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Component, Input, effect, model, output } from "@angular/core";
|
|
2
|
-
import { AbstractControl, Validators } from "@angular/forms";
|
|
3
|
-
import { InputProviderFactory } from "./input-provider-factory";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export class CustomSignalInput {
|
|
6
|
-
writeValue(obj) { console.error("[ Component writeValue isnt implemented ]"); }
|
|
7
|
-
get model() { return this._model; }
|
|
8
|
-
set model(value) { this._model = value; }
|
|
9
|
-
constructor() {
|
|
10
|
-
//[ Basic ]
|
|
11
|
-
/** Exibe o spinner de carregamento */
|
|
12
|
-
this.loading = false;
|
|
13
|
-
/** Se ativo desabilita o Input */
|
|
14
|
-
this.disabled = false;
|
|
15
|
-
/** Indica se o formulário foi enviado */
|
|
16
|
-
this.submitted = false;
|
|
17
|
-
/** Titulo do Input */
|
|
18
|
-
this.label = "Label";
|
|
19
|
-
/** Torna o input obrigatorio */
|
|
20
|
-
this.required = model(false);
|
|
21
|
-
//[ Value ]
|
|
22
|
-
this._model = null;
|
|
23
|
-
this.invalid = false;
|
|
24
|
-
//[ ControlValueAccessor ]
|
|
25
|
-
/** Acionado quando um elemento perde o foco. */
|
|
26
|
-
this.blur = output();
|
|
27
|
-
/** Emitido quando o valor é alterado. */
|
|
28
|
-
this.change = output();
|
|
29
|
-
this.onChange = (v) => { return; };
|
|
30
|
-
this.onTouch = (v) => { return; };
|
|
31
|
-
effect(() => {
|
|
32
|
-
if (this.control) {
|
|
33
|
-
this.invalid = this.control.invalid;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
ngOnInit() {
|
|
38
|
-
if (!this.control && this.controlContainer && this.formControlName) {
|
|
39
|
-
this.control = this.controlContainer.control.get(this.formControlName);
|
|
40
|
-
}
|
|
41
|
-
if (this.control) {
|
|
42
|
-
this.required.set(this.control.hasValidator(Validators.required));
|
|
43
|
-
this.invalid = this.control.invalid;
|
|
44
|
-
this.control.events.subscribe({ next: (event) => { this.RunValidation(); } });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
RunValidation() {
|
|
48
|
-
this.required.set(this.control.hasValidator(Validators.required));
|
|
49
|
-
this.invalid = this.control.invalid;
|
|
50
|
-
}
|
|
51
|
-
propagateChange(obj) { this.onChange(obj); this.change.emit(obj); ; }
|
|
52
|
-
registerOnChange(fn) { this.onChange = fn; }
|
|
53
|
-
registerOnTouched(fn) { this.onTouch = fn; }
|
|
54
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CustomSignalInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: CustomSignalInput, selector: "ng-component", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, submitted: { classPropertyName: "submitted", publicName: "submitted", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: false, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "formControl", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { required: "requiredChange", blur: "blur", change: "change" }, providers: InputProviderFactory.GetProvider(CustomSignalInput), ngImport: i0, template: '', isInline: true }); }
|
|
56
|
-
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CustomSignalInput, decorators: [{
|
|
58
|
-
type: Component,
|
|
59
|
-
args: [{ template: '', providers: InputProviderFactory.GetProvider(CustomSignalInput) }]
|
|
60
|
-
}], ctorParameters: () => [], propDecorators: { loading: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}], disabled: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], submitted: [{
|
|
65
|
-
type: Input
|
|
66
|
-
}], label: [{
|
|
67
|
-
type: Input
|
|
68
|
-
}], formControlName: [{
|
|
69
|
-
type: Input
|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