@registrucentras/rc-ses-angular-components 0.2.0
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/.editorconfig +17 -0
- package/.gitattributes +1 -0
- package/.github/workflows/build-and-publish.yml +50 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +31 -0
- package/RELEASE_NOTES.md +29 -0
- package/angular.json +173 -0
- package/karma.conf.js +53 -0
- package/package.json +48 -0
- package/projects/app/public/favicon.ico +0 -0
- package/projects/app/src/app/app.component.html +3 -0
- package/projects/app/src/app/app.component.scss +0 -0
- package/projects/app/src/app/app.component.ts +20 -0
- package/projects/app/src/app/app.config.ts +33 -0
- package/projects/app/src/app/app.routes.ts +16 -0
- package/projects/app/src/app/landing-page/landing-page.html +20 -0
- package/projects/app/src/app/landing-page/landing-page.scss +0 -0
- package/projects/app/src/app/landing-page/landing-page.ts +37 -0
- package/projects/app/src/app/sample-form-multiple-steps/sample-form-multiple-steps.html +283 -0
- package/projects/app/src/app/sample-form-multiple-steps/sample-form-multiple-steps.scss +0 -0
- package/projects/app/src/app/sample-form-multiple-steps/sample-form-multiple-steps.ts +223 -0
- package/projects/app/src/app/sample-form-single-step/sample-form-single-step.html +271 -0
- package/projects/app/src/app/sample-form-single-step/sample-form-single-step.scss +0 -0
- package/projects/app/src/app/sample-form-single-step/sample-form-single-step.ts +142 -0
- package/projects/app/src/index.html +18 -0
- package/projects/app/src/main.ts +6 -0
- package/projects/app/tsconfig.app.json +15 -0
- package/projects/app/tsconfig.spec.json +15 -0
- package/projects/rc-ses/angular-components/README.md +31 -0
- package/projects/rc-ses/angular-components/ng-package.json +13 -0
- package/projects/rc-ses/angular-components/package-lock.json +224 -0
- package/projects/rc-ses/angular-components/package.json +40 -0
- package/projects/rc-ses/angular-components/src/lib/components/accordion/accordion.scss +71 -0
- package/projects/rc-ses/angular-components/src/lib/components/accordion/accordion.ts +31 -0
- package/projects/rc-ses/angular-components/src/lib/components/breadcrumbs/breadcrumbs.html +7 -0
- package/projects/rc-ses/angular-components/src/lib/components/breadcrumbs/breadcrumbs.scss +54 -0
- package/projects/rc-ses/angular-components/src/lib/components/breadcrumbs/breadcrumbs.ts +40 -0
- package/projects/rc-ses/angular-components/src/lib/components/button/button.scss +248 -0
- package/projects/rc-ses/angular-components/src/lib/components/button/button.spec.ts +46 -0
- package/projects/rc-ses/angular-components/src/lib/components/button/button.ts +34 -0
- package/projects/rc-ses/angular-components/src/lib/components/divider/divider.scss +18 -0
- package/projects/rc-ses/angular-components/src/lib/components/divider/divider.ts +16 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/form-field/form-field.html +11 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/form-field/form-field.scss +149 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/form-field/form-field.ts +87 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/agreement-checkbox/agreement-checkbox.html +10 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/agreement-checkbox/agreement-checkbox.scss +36 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/agreement-checkbox/agreement-checkbox.ts +89 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/checkbox/checkbox.scss +132 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/datepicker/datepicker.scss +18 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/input/input.scss +66 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/input/input.ts +31 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/number-stepper/number-stepper.html +30 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/number-stepper/number-stepper.scss +88 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/number-stepper/number-stepper.ts +103 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/radio/radio.scss +85 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/radio-button-group/radio-button-group.html +7 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/radio-button-group/radio-button-group.scss +87 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/radio-button-group/radio-button-group.ts +101 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/select/select.html +40 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/select/select.scss +153 -0
- package/projects/rc-ses/angular-components/src/lib/components/form/input/select/select.ts +155 -0
- package/projects/rc-ses/angular-components/src/lib/components/icons/icons.module.ts +61 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-actions/service-form-actions.html +19 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-actions/service-form-actions.scss +64 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-actions/service-form-actions.ts +45 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-container/service-form-container.html +16 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-container/service-form-container.scss +32 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-form-container/service-form-container.ts +43 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-header/service-header.html +5 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-header/service-header.scss +35 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-header/service-header.ts +48 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-page/service-page.html +14 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-page/service-page.scss +38 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-page/service-page.ts +37 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-wizard-steps/service-wizard-steps.html +18 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-wizard-steps/service-wizard-steps.scss +93 -0
- package/projects/rc-ses/angular-components/src/lib/components/layout/service-wizard-steps/service-wizard-steps.ts +41 -0
- package/projects/rc-ses/angular-components/src/lib/components/message/message.html +39 -0
- package/projects/rc-ses/angular-components/src/lib/components/message/message.scss +141 -0
- package/projects/rc-ses/angular-components/src/lib/components/message/message.ts +52 -0
- package/projects/rc-ses/angular-components/src/lib/theme/index.scss +65 -0
- package/projects/rc-ses/angular-components/src/lib/theme/palette.scss +183 -0
- package/projects/rc-ses/angular-components/src/lib/theme/theme.scss +24 -0
- package/projects/rc-ses/angular-components/src/lib/theme/typography.scss +63 -0
- package/projects/rc-ses/angular-components/src/public-api.ts +22 -0
- package/projects/rc-ses/angular-components/src/styles.scss +40 -0
- package/projects/rc-ses/angular-components/src/test.ts +14 -0
- package/projects/rc-ses/angular-components/tsconfig.lib.json +15 -0
- package/projects/rc-ses/angular-components/tsconfig.lib.prod.json +11 -0
- package/tsconfig.json +37 -0
- package/tsconfig.spec.json +18 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CommonModule, DOCUMENT } from "@angular/common";
|
|
2
|
+
import { Component, AfterViewInit, OnDestroy, ElementRef, Inject, Renderer2, Input, OnChanges, SimpleChanges, OnInit, forwardRef, ViewChild, Injector, booleanAttribute } from "@angular/core";
|
|
3
|
+
import { ControlContainer, ControlValueAccessor, FormControl, FormControlDirective, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
|
|
4
|
+
import { MatCheckboxModule } from "@angular/material/checkbox";
|
|
5
|
+
import { MatCommonModule } from "@angular/material/core";
|
|
6
|
+
import { MatExpansionModule } from "@angular/material/expansion";
|
|
7
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
8
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
9
|
+
import { MatInputModule } from "@angular/material/input";
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'rc-ses-agreement-checkbox',
|
|
13
|
+
standalone: true,
|
|
14
|
+
templateUrl: 'agreement-checkbox.html',
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
|
|
20
|
+
MatCheckboxModule,
|
|
21
|
+
MatCommonModule,
|
|
22
|
+
MatExpansionModule,
|
|
23
|
+
MatFormFieldModule,
|
|
24
|
+
MatIconModule,
|
|
25
|
+
MatInputModule,
|
|
26
|
+
],
|
|
27
|
+
host: {
|
|
28
|
+
class: 'rc-ses-element rc-ses-agreement-checkbox'
|
|
29
|
+
},
|
|
30
|
+
providers: [
|
|
31
|
+
{
|
|
32
|
+
provide: NG_VALUE_ACCESSOR,
|
|
33
|
+
useExisting: forwardRef(() => RcSesAgreementCheckboxComponent),
|
|
34
|
+
multi: true
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
export class RcSesAgreementCheckboxComponent implements ControlValueAccessor, AfterViewInit, OnChanges, OnInit, OnDestroy {
|
|
39
|
+
@ViewChild(FormControlDirective, {static: true})
|
|
40
|
+
formControlDirective: FormControlDirective | undefined;
|
|
41
|
+
|
|
42
|
+
@Input() formControl!: FormControl;
|
|
43
|
+
@Input() formControlName: string | undefined;
|
|
44
|
+
|
|
45
|
+
@Input() description: string = '';
|
|
46
|
+
@Input({ transform: booleanAttribute }) flat: boolean = false;
|
|
47
|
+
|
|
48
|
+
initialized: boolean = false;
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
@Inject(DOCUMENT) private _document: Document,
|
|
52
|
+
public _element: ElementRef,
|
|
53
|
+
private _renderer: Renderer2,
|
|
54
|
+
private injector: Injector,
|
|
55
|
+
) {}
|
|
56
|
+
|
|
57
|
+
get controlContainer() {
|
|
58
|
+
return this.injector.get(ControlContainer);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get control() {
|
|
62
|
+
return this.formControl ||
|
|
63
|
+
(this.formControlName && this.controlContainer.control?.get(this.formControlName));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
writeValue(obj: any): void {
|
|
67
|
+
this.formControlDirective?.valueAccessor?.writeValue(obj);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
registerOnChange(fn: any): void {
|
|
71
|
+
this.formControlDirective?.valueAccessor?.registerOnChange(fn);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
registerOnTouched(fn: any): void {
|
|
75
|
+
this.formControlDirective?.valueAccessor?.registerOnTouched(fn);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
ngOnChanges(_changes: SimpleChanges): void {}
|
|
79
|
+
|
|
80
|
+
ngOnInit() {}
|
|
81
|
+
|
|
82
|
+
ngAfterViewInit() {
|
|
83
|
+
this.initialized = true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
ngOnDestroy() {
|
|
87
|
+
this.initialized = false;
|
|
88
|
+
}
|
|
89
|
+
}
|
package/projects/rc-ses/angular-components/src/lib/components/form/input/checkbox/checkbox.scss
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin bootstrap($theme, $typography) {
|
|
5
|
+
@layer rc-ses {
|
|
6
|
+
|
|
7
|
+
.mat-mdc-checkbox {
|
|
8
|
+
--mdc-checkbox-selected-focus-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
9
|
+
--mdc-checkbox-selected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
10
|
+
--mdc-checkbox-selected-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
11
|
+
--mdc-checkbox-unselected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
12
|
+
|
|
13
|
+
&:not(.mat-mdc-checkbox-checked) {
|
|
14
|
+
|
|
15
|
+
.mdc-checkbox__background {
|
|
16
|
+
background-color: white !important;
|
|
17
|
+
|
|
18
|
+
&:after {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.mdc-checkbox {
|
|
26
|
+
|
|
27
|
+
&:hover:not(.disabled) {
|
|
28
|
+
|
|
29
|
+
.mdc-checkbox__background {
|
|
30
|
+
|
|
31
|
+
&::before {
|
|
32
|
+
box-shadow: 0px 0px 0px 5px #{color.adjust(mat.get-theme-color($theme, primary, 60), $alpha: -0.8)};
|
|
33
|
+
border-radius: var(--mdc-outlined-text-field-container-shape);
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
height: 100%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:active {
|
|
42
|
+
|
|
43
|
+
.mdc-checkbox__background {
|
|
44
|
+
background-color: mat.get-theme-color($theme, primary, 98) !important;
|
|
45
|
+
|
|
46
|
+
&::after {
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:focus:not(:hover) {
|
|
54
|
+
--mdc-checkbox-unselected-focus-icon-color: #{mat.get-theme-color($theme, neutral, 50)} !important;
|
|
55
|
+
|
|
56
|
+
.mdc-checkbox__background {
|
|
57
|
+
outline: 2px solid #{mat.get-theme-color($theme, neutral, 0)} !important;
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__background {
|
|
63
|
+
border-radius: .25rem !important;
|
|
64
|
+
bottom: .5rem !important;
|
|
65
|
+
height: 1.5rem !important;
|
|
66
|
+
left: .5rem !important;
|
|
67
|
+
right: .5rem !important;
|
|
68
|
+
top: .5rem !important;
|
|
69
|
+
width: 1.5rem !important;
|
|
70
|
+
|
|
71
|
+
&::after {
|
|
72
|
+
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="%23fff" d="m14.533 5.031-8 8a.751.751 0 0 1-1.063 0l-3.5-3.5A.751.751 0 0 1 3.033 8.47l2.969 2.97 7.47-7.469a.751.751 0 0 1 1.062 1.063l-.001-.002Z"/></svg>') !important;
|
|
73
|
+
border: unset !important;
|
|
74
|
+
height: 1rem !important;
|
|
75
|
+
position: absolute;
|
|
76
|
+
transform: none !important;
|
|
77
|
+
width: 1rem !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
svg {
|
|
81
|
+
display: none;
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__ripple {
|
|
87
|
+
display: none !important;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.mat-pseudo-checkbox {
|
|
92
|
+
border-radius: .25rem !important;
|
|
93
|
+
height: 1.5rem !important;
|
|
94
|
+
width: 1.5rem !important;
|
|
95
|
+
|
|
96
|
+
&-full {
|
|
97
|
+
border-width: 2px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&-checked {
|
|
101
|
+
|
|
102
|
+
&::after {
|
|
103
|
+
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="%23fff" d="m14.533 5.031-8 8a.751.751 0 0 1-1.063 0l-3.5-3.5A.751.751 0 0 1 3.033 8.47l2.969 2.97 7.47-7.469a.751.751 0 0 1 1.062 1.063l-.001-.002Z"/></svg>') !important;
|
|
104
|
+
border: unset !important;
|
|
105
|
+
bottom: .125rem !important;
|
|
106
|
+
height: 1rem !important;
|
|
107
|
+
left: .125rem !important;
|
|
108
|
+
right: .125rem !important;
|
|
109
|
+
transform: none !important;
|
|
110
|
+
top: .125rem !important;
|
|
111
|
+
width: 1rem !important;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@layer rc-ses-variables {
|
|
118
|
+
:root,
|
|
119
|
+
.cdk-overlay-container {
|
|
120
|
+
--mdc-checkbox-selected-focus-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
121
|
+
--mdc-checkbox-selected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
122
|
+
--mdc-checkbox-selected-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
123
|
+
|
|
124
|
+
--mdc-checkbox-unselected-focus-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
125
|
+
--mdc-checkbox-unselected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
126
|
+
--mdc-checkbox-unselected-icon-color: #{mat.get-theme-color($theme, neutral, 50)};
|
|
127
|
+
|
|
128
|
+
--mat-full-pseudo-checkbox-selected-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
129
|
+
--mat-full-pseudo-checkbox-unselected-icon-color: #{mat.get-theme-color($theme, neutral, 50)};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
package/projects/rc-ses/angular-components/src/lib/components/form/input/datepicker/datepicker.scss
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin bootstrap($theme, $typography) {
|
|
5
|
+
@layer rc-ses {
|
|
6
|
+
.mat-datepicker-popup {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer rc-ses-variables {
|
|
12
|
+
:root {
|
|
13
|
+
--mat-datepicker-calendar-container-background-color: white;
|
|
14
|
+
--mat-datepicker-calendar-container-elevation-shadow: 0px 4px 16px 0px #091e423d, 0px 8px 16px 0px #091e421a;
|
|
15
|
+
;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin bootstrap($theme, $typography) {
|
|
5
|
+
@layer rc-ses {
|
|
6
|
+
.rc-ses-input {
|
|
7
|
+
background-color: white;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mdc-text-field--outlined {
|
|
11
|
+
padding-right: max(.75rem, var(--mdc-outlined-text-field-container-shape)) !important;
|
|
12
|
+
padding-left: max(.75rem, var(--mdc-outlined-text-field-container-shape) + 4px) !important;
|
|
13
|
+
|
|
14
|
+
&:not(.mdc-text-field--disabled):not(.mat-form-field--readonly) {
|
|
15
|
+
|
|
16
|
+
&.mdc-text-field--focused {
|
|
17
|
+
|
|
18
|
+
.mdc-notched-outline {
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
box-shadow: 0px 0px 0px 3px #{color.adjust(mat.get-theme-color($theme, neutral, 20), $alpha: -0.8)};
|
|
22
|
+
border-radius: var(--mdc-outlined-text-field-container-shape);
|
|
23
|
+
content: "";
|
|
24
|
+
position: absolute;
|
|
25
|
+
height: 100%;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.mdc-text-field--invalid {
|
|
31
|
+
|
|
32
|
+
.mdc-notched-outline::before {
|
|
33
|
+
box-shadow: 0px 0px 0px 3px #{color.adjust(mat.get-theme-color($theme, error, 40), $alpha: -0.8)};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:not(.mdc-text-field--focused) {
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
|
|
42
|
+
&.mdc-text-field--invalid {
|
|
43
|
+
|
|
44
|
+
.mdc-notched-outline .mat-mdc-notch-piece {
|
|
45
|
+
border-color: mat.get-theme-color($theme, error, 40) !important;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@layer rc-ses-variables {
|
|
55
|
+
:root {
|
|
56
|
+
--mdc-outlined-text-field-caret-color: #{mat.get-theme-color($theme, neutral, 20)};
|
|
57
|
+
--mdc-outlined-text-field-disabled-input-text-color: #{mat.get-theme-color($theme, neutral, 40)};
|
|
58
|
+
--mdc-outlined-text-field-disabled-outline-color: #{mat.get-theme-color($theme, neutral, 40)};
|
|
59
|
+
--mdc-outlined-text-field-focus-outline-color: #{mat.get-theme-color($theme, neutral, 20)};
|
|
60
|
+
--mdc-outlined-text-field-focus-outline-width: 2px;
|
|
61
|
+
--mdc-outlined-text-field-input-text-color: #{mat.get-theme-color($theme, neutral, 20)};
|
|
62
|
+
--mdc-outlined-text-field-input-text-placeholder-color: #{mat.get-theme-color($theme, neutral, 40)};
|
|
63
|
+
--mdc-outlined-text-field-outline-color: #{mat.get-theme-color($theme, neutral, 40)};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DOCUMENT } from "@angular/common";
|
|
2
|
+
import { Directive, AfterViewInit, OnDestroy, ElementRef, Inject, OnInit, Renderer2 } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[rc-ses-input]',
|
|
6
|
+
standalone: true,
|
|
7
|
+
host: {
|
|
8
|
+
class: 'rc-ses-element rc-ses-input'
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
export class RcSesInputDirective implements AfterViewInit, OnDestroy, OnInit {
|
|
12
|
+
public initialized: boolean | undefined;
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
@Inject(DOCUMENT) private _document: Document,
|
|
16
|
+
public _el: ElementRef,
|
|
17
|
+
private _renderer: Renderer2,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
ngAfterViewInit() {
|
|
25
|
+
this.initialized = true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ngOnDestroy() {
|
|
29
|
+
this.initialized = false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<mat-form-field>
|
|
2
|
+
<button
|
|
3
|
+
mat-icon-button
|
|
4
|
+
matSuffix
|
|
5
|
+
(click)="add()"
|
|
6
|
+
[disabled]="control.disabled || !canAdd()"
|
|
7
|
+
>
|
|
8
|
+
<mat-icon>add</mat-icon>
|
|
9
|
+
</button>
|
|
10
|
+
|
|
11
|
+
<button
|
|
12
|
+
mat-icon-button
|
|
13
|
+
matSuffix
|
|
14
|
+
(click)="subtract()"
|
|
15
|
+
[disabled]="control.disabled || !canSubtract()"
|
|
16
|
+
>
|
|
17
|
+
<mat-icon>remove</mat-icon>
|
|
18
|
+
</button>
|
|
19
|
+
|
|
20
|
+
<input
|
|
21
|
+
rc-ses-input
|
|
22
|
+
matInput
|
|
23
|
+
type="number"
|
|
24
|
+
[formControl]="control"
|
|
25
|
+
[placeholder]="placeholder"
|
|
26
|
+
[min]="min"
|
|
27
|
+
[max]="max"
|
|
28
|
+
[step]="step"
|
|
29
|
+
/>
|
|
30
|
+
</mat-form-field>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin bootstrap($theme, $typography) {
|
|
5
|
+
@layer rc-ses {
|
|
6
|
+
.rc-ses-number-stepper {
|
|
7
|
+
--mat-icon-button-hover-state-layer-opacity: 0;
|
|
8
|
+
--mat-icon-button-state-layer-color: transparent;
|
|
9
|
+
--mdc-icon-button-state-layer-size: 42px;
|
|
10
|
+
|
|
11
|
+
input[type="number"] {
|
|
12
|
+
appearance: textfield;
|
|
13
|
+
-moz-appearance: textfield;
|
|
14
|
+
|
|
15
|
+
&::-webkit-outer-spin-button,
|
|
16
|
+
&::-webkit-inner-spin-button {
|
|
17
|
+
-webkit-appearance: none;
|
|
18
|
+
margin: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mat-mdc-form-field {
|
|
23
|
+
max-width: 300px;
|
|
24
|
+
|
|
25
|
+
&-has-icon-suffix {
|
|
26
|
+
|
|
27
|
+
.mat-mdc-text-field-wrapper {
|
|
28
|
+
padding-right: 0 !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-icon-suffix {
|
|
33
|
+
|
|
34
|
+
.mat-mdc-icon-button {
|
|
35
|
+
width: 44px !important
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.mdc-icon-button {
|
|
39
|
+
background-color: mat.get-theme-color($theme, neutral, 98) !important;
|
|
40
|
+
border-left: 1px solid var(--mdc-outlined-text-field-outline-color) !important;
|
|
41
|
+
border-radius: 0 !important;
|
|
42
|
+
|
|
43
|
+
&:last-of-type {
|
|
44
|
+
border-bottom-right-radius: .25rem !important;
|
|
45
|
+
border-top-right-radius: .25rem !important;
|
|
46
|
+
margin-right: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:not(:disabled) {
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: mat.get-theme-color($theme, neutral, 95) !important;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mat-mdc-button-persistent-ripple {
|
|
57
|
+
border-radius: 0 !important;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@at-root .rc-ses-number-stepper :hover {
|
|
64
|
+
// .mdc-icon-button {
|
|
65
|
+
// border-bottom-color: mat.get-theme-color($theme, neutral, 20) !important;
|
|
66
|
+
// border-top-color: mat.get-theme-color($theme, neutral, 20) !important;
|
|
67
|
+
// }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@at-root .mat-focused .mat-mdc-form-field-icon-suffix {
|
|
71
|
+
--mdc-icon-button-state-layer-size: 40px;
|
|
72
|
+
|
|
73
|
+
.mdc-icon-button {
|
|
74
|
+
|
|
75
|
+
&:last-of-type {
|
|
76
|
+
margin-right: 2px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@layer rc-ses-variables {
|
|
84
|
+
:root {
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { CommonModule, DOCUMENT } from "@angular/common";
|
|
2
|
+
import { Component, AfterViewInit, OnDestroy, ElementRef, Inject, Renderer2, Input, OnChanges, SimpleChanges, OnInit, forwardRef, ViewChild, Injector, booleanAttribute } from "@angular/core";
|
|
3
|
+
import { ControlContainer, ControlValueAccessor, FormControl, FormControlDirective, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
|
|
4
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
5
|
+
import { MatCommonModule } from "@angular/material/core";
|
|
6
|
+
import { MatExpansionModule } from "@angular/material/expansion";
|
|
7
|
+
import { MatFormFieldModule } from "@angular/material/form-field";
|
|
8
|
+
import { MatIconModule } from "@angular/material/icon";
|
|
9
|
+
import { MatInputModule } from "@angular/material/input";
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'rc-ses-number-stepper',
|
|
13
|
+
standalone: true,
|
|
14
|
+
templateUrl: 'number-stepper.html',
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
|
|
20
|
+
MatButtonModule,
|
|
21
|
+
MatCommonModule,
|
|
22
|
+
MatExpansionModule,
|
|
23
|
+
MatFormFieldModule,
|
|
24
|
+
MatIconModule,
|
|
25
|
+
MatInputModule,
|
|
26
|
+
],
|
|
27
|
+
host: {
|
|
28
|
+
class: 'rc-ses-element rc-ses-number-stepper'
|
|
29
|
+
},
|
|
30
|
+
providers: [
|
|
31
|
+
{
|
|
32
|
+
provide: NG_VALUE_ACCESSOR,
|
|
33
|
+
useExisting: forwardRef(() => RcSesNumberStepperComponent),
|
|
34
|
+
multi: true
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
export class RcSesNumberStepperComponent implements ControlValueAccessor, AfterViewInit, OnChanges, OnInit, OnDestroy {
|
|
39
|
+
@ViewChild(FormControlDirective, {static: true})
|
|
40
|
+
formControlDirective: FormControlDirective | undefined;
|
|
41
|
+
|
|
42
|
+
@Input() formControl!: FormControl;
|
|
43
|
+
@Input() formControlName: string | undefined;
|
|
44
|
+
|
|
45
|
+
@Input() max: number = Number.MAX_SAFE_INTEGER;
|
|
46
|
+
@Input() min: number = 0;
|
|
47
|
+
@Input() placeholder: string = '';
|
|
48
|
+
@Input() step: number = 1;
|
|
49
|
+
|
|
50
|
+
initialized: boolean = false;
|
|
51
|
+
|
|
52
|
+
constructor(
|
|
53
|
+
@Inject(DOCUMENT) private _document: Document,
|
|
54
|
+
public _element: ElementRef,
|
|
55
|
+
private _renderer: Renderer2,
|
|
56
|
+
private injector: Injector,
|
|
57
|
+
) {}
|
|
58
|
+
|
|
59
|
+
get controlContainer() {
|
|
60
|
+
return this.injector.get(ControlContainer);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get control() {
|
|
64
|
+
return this.formControl ||
|
|
65
|
+
(this.formControlName && this.controlContainer.control?.get(this.formControlName));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
writeValue(obj: any): void {
|
|
69
|
+
this.formControlDirective?.valueAccessor?.writeValue(obj);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
registerOnChange(fn: any): void {
|
|
73
|
+
this.formControlDirective?.valueAccessor?.registerOnChange(fn);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
registerOnTouched(fn: any): void {
|
|
77
|
+
this.formControlDirective?.valueAccessor?.registerOnTouched(fn);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ngOnChanges(_changes: SimpleChanges): void {}
|
|
81
|
+
|
|
82
|
+
ngOnInit() {}
|
|
83
|
+
|
|
84
|
+
ngAfterViewInit() {
|
|
85
|
+
this.initialized = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
ngOnDestroy() {
|
|
89
|
+
this.initialized = false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
add = () => this.control.setValue(
|
|
93
|
+
Math.min(this.max, (Math.max(this.min, Math.min(this.max, this.control.value)) ?? 0) + this.step)
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
subtract = () => this.control.setValue(
|
|
97
|
+
Math.max(this.min, (Math.min(this.max, Math.max(this.min, this.control.value)) ?? 0) - this.step)
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
canAdd = () => !this.control.value || (this.max > this.control.value);
|
|
101
|
+
|
|
102
|
+
canSubtract = () => !this.control.value || (this.control.value > this.min);
|
|
103
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '@angular/material' as mat;
|
|
3
|
+
|
|
4
|
+
@mixin bootstrap($theme, $typography) {
|
|
5
|
+
@layer rc-ses {
|
|
6
|
+
.mat-mdc-radio {
|
|
7
|
+
|
|
8
|
+
&-button {
|
|
9
|
+
--mat-radio-checked-ripple-color: #{color.adjust(mat.get-theme-color($theme, primary, 60), $alpha: -0.8)};
|
|
10
|
+
--mat-radio-ripple-color: #{color.adjust(mat.get-theme-color($theme, primary, 60), $alpha: -0.8)};
|
|
11
|
+
|
|
12
|
+
--mdc-radio-selected-focus-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
13
|
+
--mdc-radio-selected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
14
|
+
--mdc-radio-selected-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
15
|
+
--mdc-radio-selected-pressed-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
16
|
+
|
|
17
|
+
--mdc-radio-unselected-hover-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
18
|
+
--mdc-radio-unselected-focus-icon-color: #{mat.get-theme-color($theme, neutral, 50)};
|
|
19
|
+
--mdc-radio-unselected-icon-color: #{mat.get-theme-color($theme, neutral, 50)};
|
|
20
|
+
--mdc-radio-unselected-pressed-icon-color: #{mat.get-theme-color($theme, primary, 50)};
|
|
21
|
+
|
|
22
|
+
.mdc-radio {
|
|
23
|
+
|
|
24
|
+
&__outer-circle {
|
|
25
|
+
background-color: white;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__inner-circle {
|
|
29
|
+
// border-width: 5px !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__background {
|
|
33
|
+
|
|
34
|
+
&::before {
|
|
35
|
+
height: 28px !important;
|
|
36
|
+
left: -.25rem !important;
|
|
37
|
+
top: -.25rem !important;
|
|
38
|
+
opacity: 1 !important;
|
|
39
|
+
width: 28px !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__native-control {
|
|
44
|
+
|
|
45
|
+
&:focus:not(:hover):not(:checked) + .mdc-radio__background::before {
|
|
46
|
+
opacity: 0 !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:checked {
|
|
50
|
+
|
|
51
|
+
& + .mdc-radio__background {
|
|
52
|
+
|
|
53
|
+
.mdc-radio__inner-circle {
|
|
54
|
+
border-width: 5px !important;
|
|
55
|
+
transform: scale(1) !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:active {
|
|
61
|
+
|
|
62
|
+
& + .mdc-radio__background {
|
|
63
|
+
|
|
64
|
+
.mdc-radio__outer-circle {
|
|
65
|
+
background-color: mat.get-theme-color($theme, neutral, 98);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.mdc-label {
|
|
73
|
+
margin-left: -.125rem !important;
|
|
74
|
+
padding-left: 0 !important;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@layer rc-ses-variables {
|
|
81
|
+
:root {
|
|
82
|
+
--mdc-radio-state-layer-size: 40px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|