@klippa/ngx-enhancy-forms 1.0.0 → 2.1.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/README.md +179 -23
- package/bundles/klippa-ngx-enhancy-forms.umd.js +1206 -0
- package/bundles/klippa-ngx-enhancy-forms.umd.js.map +1 -0
- package/bundles/klippa-ngx-enhancy-forms.umd.min.js +17 -0
- package/bundles/klippa-ngx-enhancy-forms.umd.min.js.map +1 -0
- package/esm2015/klippa-ngx-enhancy-forms.js +6 -0
- package/esm2015/lib/elements/button/button.component.js +38 -0
- package/esm2015/lib/elements/checkbox/checkbox.component.js +18 -0
- package/esm2015/lib/elements/datepicker/datepicker.component.js +111 -0
- package/esm2015/lib/elements/email/email-input.component.js +21 -0
- package/esm2015/lib/elements/loading-indicator/loading-indicator.component.js +19 -0
- package/esm2015/lib/elements/number-input/number-input.component.js +17 -0
- package/esm2015/lib/elements/password-field/password-field.component.js +21 -0
- package/esm2015/lib/elements/select/select.component.js +35 -0
- package/esm2015/lib/elements/sortable-items/sortable-items.component.js +25 -0
- package/esm2015/lib/elements/text-input/text-input.component.js +22 -0
- package/esm2015/lib/elements/toggle/toggle.component.js +14 -0
- package/esm2015/lib/elements/value-accessor-base/value-accessor-base.component.js +88 -0
- package/esm2015/lib/form/form-caption/form-caption.component.js +35 -0
- package/esm2015/lib/form/form-element/form-element.component.js +100 -0
- package/esm2015/lib/form/form-error/form-error.component.js +37 -0
- package/esm2015/lib/form/form-submit-button/form-submit-button.component.js +53 -0
- package/esm2015/lib/form/form.component.js +72 -0
- package/esm2015/lib/material.module.js +17 -0
- package/esm2015/lib/ngx-enhancy-forms.module.js +75 -0
- package/esm2015/lib/types.js +2 -0
- package/esm2015/lib/util/values.js +38 -0
- package/esm2015/lib/validators/dateValidator.js +6 -0
- package/esm2015/public-api.js +24 -0
- package/fesm2015/klippa-ngx-enhancy-forms.js +804 -0
- package/fesm2015/klippa-ngx-enhancy-forms.js.map +1 -0
- package/klippa-ngx-enhancy-forms.d.ts +5 -0
- package/klippa-ngx-enhancy-forms.metadata.json +1 -0
- package/lib/elements/button/button.component.d.ts +11 -0
- package/lib/elements/checkbox/checkbox.component.d.ts +5 -0
- package/lib/elements/datepicker/datepicker.component.d.ts +26 -0
- package/lib/elements/email/email-input.component.d.ts +4 -0
- package/lib/elements/loading-indicator/loading-indicator.component.d.ts +4 -0
- package/lib/elements/number-input/number-input.component.d.ts +4 -0
- package/lib/elements/password-field/password-field.component.d.ts +4 -0
- package/lib/elements/select/select.component.d.ts +24 -0
- package/lib/elements/sortable-items/sortable-items.component.d.ts +6 -0
- package/lib/elements/text-input/text-input.component.d.ts +5 -0
- package/lib/elements/toggle/toggle.component.d.ts +3 -0
- package/lib/elements/value-accessor-base/value-accessor-base.component.d.ts +32 -0
- package/lib/form/form-caption/form-caption.component.d.ts +8 -0
- package/lib/form/form-element/form-element.component.d.ts +38 -0
- package/lib/form/form-error/form-error.component.d.ts +11 -0
- package/lib/form/form-submit-button/form-submit-button.component.d.ts +11 -0
- package/lib/form/form.component.d.ts +13 -0
- package/lib/material.module.d.ts +2 -0
- package/lib/ngx-enhancy-forms.module.d.ts +2 -0
- package/lib/types.d.ts +15 -0
- package/lib/util/values.d.ts +9 -0
- package/lib/validators/dateValidator.d.ts +3 -0
- package/package.json +16 -41
- package/public-api.d.ts +20 -0
- package/.editorconfig +0 -17
- package/.github/workflows/ci.yml +0 -18
- package/.github/workflows/release.yml +0 -22
- package/angular.json +0 -28
- package/ng-package.json +0 -7
- package/src/lib/elements/button/button.component.html +0 -18
- package/src/lib/elements/button/button.component.scss +0 -203
- package/src/lib/elements/button/button.component.ts +0 -34
- package/src/lib/elements/checkbox/checkbox.component.html +0 -15
- package/src/lib/elements/checkbox/checkbox.component.scss +0 -55
- package/src/lib/elements/checkbox/checkbox.component.ts +0 -14
- package/src/lib/elements/datepicker/datepicker.component.html +0 -20
- package/src/lib/elements/datepicker/datepicker.component.scss +0 -47
- package/src/lib/elements/datepicker/datepicker.component.ts +0 -142
- package/src/lib/elements/email/email-input.component.html +0 -8
- package/src/lib/elements/email/email-input.component.scss +0 -15
- package/src/lib/elements/email/email-input.component.ts +0 -13
- package/src/lib/elements/loading-indicator/loading-indicator.component.html +0 -40
- package/src/lib/elements/loading-indicator/loading-indicator.component.scss +0 -179
- package/src/lib/elements/loading-indicator/loading-indicator.component.ts +0 -11
- package/src/lib/elements/number-input/number-input.component.html +0 -7
- package/src/lib/elements/number-input/number-input.component.scss +0 -15
- package/src/lib/elements/number-input/number-input.component.ts +0 -13
- package/src/lib/elements/password-field/password-field.component.html +0 -10
- package/src/lib/elements/password-field/password-field.component.scss +0 -15
- package/src/lib/elements/password-field/password-field.component.ts +0 -11
- package/src/lib/elements/select/select.component.html +0 -22
- package/src/lib/elements/select/select.component.scss +0 -289
- package/src/lib/elements/select/select.component.ts +0 -44
- package/src/lib/elements/sortable-items/sortable-items.component.html +0 -23
- package/src/lib/elements/sortable-items/sortable-items.component.scss +0 -34
- package/src/lib/elements/sortable-items/sortable-items.component.ts +0 -18
- package/src/lib/elements/text-input/text-input.component.html +0 -10
- package/src/lib/elements/text-input/text-input.component.scss +0 -15
- package/src/lib/elements/text-input/text-input.component.ts +0 -14
- package/src/lib/elements/toggle/toggle.component.html +0 -9
- package/src/lib/elements/toggle/toggle.component.scss +0 -78
- package/src/lib/elements/toggle/toggle.component.ts +0 -11
- package/src/lib/elements/value-accessor-base/value-accessor-base.component.ts +0 -89
- package/src/lib/form/form-caption/form-caption.component.html +0 -3
- package/src/lib/form/form-caption/form-caption.component.scss +0 -3
- package/src/lib/form/form-caption/form-caption.component.ts +0 -28
- package/src/lib/form/form-element/form-element.component.html +0 -25
- package/src/lib/form/form-element/form-element.component.scss +0 -44
- package/src/lib/form/form-element/form-element.component.ts +0 -76
- package/src/lib/form/form-error/form-error.component.html +0 -3
- package/src/lib/form/form-error/form-error.component.scss +0 -4
- package/src/lib/form/form-error/form-error.component.ts +0 -29
- package/src/lib/form/form-submit-button/form-submit-button.component.html +0 -11
- package/src/lib/form/form-submit-button/form-submit-button.component.scss +0 -10
- package/src/lib/form/form-submit-button/form-submit-button.component.ts +0 -32
- package/src/lib/form/form.component.html +0 -5
- package/src/lib/form/form.component.scss +0 -6
- package/src/lib/form/form.component.ts +0 -67
- package/src/lib/ngx-enhancy-forms.module.ts +0 -68
- package/src/lib/util/values.ts +0 -46
- package/src/lib/validators/dateValidator.ts +0 -8
- package/src/public-api.ts +0 -5
- package/src/style/_form.scss +0 -502
- package/src/style/_klippa.scss +0 -1006
- package/src/style/_mixins.scss +0 -66
- package/src/style/_widgets.scss +0 -251
- package/src/style/app.scss +0 -1
- package/src/style/themes/default/_variables.scss +0 -156
- package/tsconfig.json +0 -37
- package/tsconfig.lib.json +0 -26
- package/tsconfig.lib.prod.json +0 -10
- package/tslint.json +0 -140
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, Input, SimpleChanges, ViewChild } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
|
|
4
|
-
import { _ } from '~/app/util/i18n';
|
|
5
|
-
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
6
|
-
import { NgxDateFnsDateAdapter } from 'ngx-mat-datefns-date-adapter';
|
|
7
|
-
import { isMatch } from 'date-fns';
|
|
8
|
-
import { getSupportedFormatsAsDateFns } from '~/app/shared/ui/forms/composed/date-format-picker/date-format-picker.component';
|
|
9
|
-
import { isNullOrUndefined, stringIsSetAndNotEmpty } from '~/app/util/values';
|
|
10
|
-
import { invalidDateKey } from '~/app/shared/ui/forms/validators/dateValidator';
|
|
11
|
-
import { MatDatepicker } from '@angular/material/datepicker';
|
|
12
|
-
|
|
13
|
-
class MultiParseDateFnsDateAdapter extends NgxDateFnsDateAdapter {
|
|
14
|
-
// override the parse function to take arrays of parseFormats and try each in turn.
|
|
15
|
-
parse(value: any, parseFormat: any) {
|
|
16
|
-
if (typeof value === 'string') {
|
|
17
|
-
if (value.length === 0) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
// replace all '/' and '.' with '-' for locales that use '/' or '.' seperated dates.
|
|
21
|
-
value = value.replace(/[\/.]/g, '-');
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(parseFormat)) {
|
|
24
|
-
for (const format of parseFormat) {
|
|
25
|
-
if (isMatch(value, format)) {
|
|
26
|
-
return super.parse(value, format);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@Component({
|
|
35
|
-
selector: 'klp-datepicker',
|
|
36
|
-
templateUrl: './datepicker.component.html',
|
|
37
|
-
styleUrls: ['./datepicker.component.scss'],
|
|
38
|
-
providers: [
|
|
39
|
-
{ provide: NG_VALUE_ACCESSOR, useExisting: DatepickerComponent, multi: true },
|
|
40
|
-
{ provide: DateAdapter, useClass: MultiParseDateFnsDateAdapter, deps: [MAT_DATE_LOCALE] },
|
|
41
|
-
{
|
|
42
|
-
provide: MAT_DATE_FORMATS,
|
|
43
|
-
useFactory: (component) => {
|
|
44
|
-
return {
|
|
45
|
-
parse: {
|
|
46
|
-
// if the selected format fails to parse try all supported and all long locale formats.
|
|
47
|
-
dateInput: [component.format, ...getSupportedFormatsAsDateFns(), 'PP', 'PPP', 'PPPP'],
|
|
48
|
-
},
|
|
49
|
-
display: {
|
|
50
|
-
dateInput: component.format, // Display as selected format.
|
|
51
|
-
monthLabel: 'MMM',
|
|
52
|
-
monthYearLabel: 'MMM yyyy',
|
|
53
|
-
dateA11yLabel: 'MMM dd, yyyy',
|
|
54
|
-
monthYearA11yLabel: 'MMMM yyyy',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
deps: [DatepickerComponent],
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
})
|
|
62
|
-
export class DatepickerComponent extends ValueAccessorBase<Date | typeof invalidDateKey> {
|
|
63
|
-
@Input() public minDate: Date = undefined;
|
|
64
|
-
@Input() public maxDate: Date = undefined;
|
|
65
|
-
@Input() public format = 'dd-MM-yyyy';
|
|
66
|
-
@Input() public placeholder = _('Select date');
|
|
67
|
-
|
|
68
|
-
@ViewChild('nativeInput') nativeInputRef: ElementRef;
|
|
69
|
-
@ViewChild('picker') datePickerRef: MatDatepicker<Date>;
|
|
70
|
-
|
|
71
|
-
minDateStartOfDay: Date = undefined;
|
|
72
|
-
maxDateEndOfDay: Date = undefined;
|
|
73
|
-
|
|
74
|
-
// this is passed as ngmodel and is used to set the inital date. But we also
|
|
75
|
-
// use input and nativeInput callbacks to extend the validation logic so we
|
|
76
|
-
// can destinguish between empty and invalid dates.
|
|
77
|
-
valueForMaterialDatePicker: Date;
|
|
78
|
-
|
|
79
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
80
|
-
if (changes.minDate) {
|
|
81
|
-
this.setMinDate(changes.minDate.currentValue);
|
|
82
|
-
}
|
|
83
|
-
if (changes.maxDate) {
|
|
84
|
-
this.setMaxDate(changes.maxDate.currentValue);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
setMinDate(minDate: Date) {
|
|
89
|
-
if (minDate) {
|
|
90
|
-
this.minDateStartOfDay = new Date(minDate);
|
|
91
|
-
this.minDateStartOfDay.setHours(0, 0, 0, 0);
|
|
92
|
-
} else {
|
|
93
|
-
this.minDateStartOfDay = undefined;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
setMaxDate(maxDate: Date) {
|
|
98
|
-
if (maxDate) {
|
|
99
|
-
this.maxDateEndOfDay = new Date(maxDate);
|
|
100
|
-
this.maxDateEndOfDay.setHours(23, 59, 59, 999);
|
|
101
|
-
} else {
|
|
102
|
-
this.maxDateEndOfDay = undefined;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// dateChanged is called when the output of the datepicker is changed and
|
|
107
|
-
// parsed correctly. If the date is invalid, it will be called the first time
|
|
108
|
-
// with null but never again until a valid input is provided.
|
|
109
|
-
dateChanged(event: any) {
|
|
110
|
-
const nativeInputValue = this.nativeInputRef.nativeElement.value;
|
|
111
|
-
const date = event.value;
|
|
112
|
-
if (isNullOrUndefined(date) && stringIsSetAndNotEmpty(nativeInputValue)) {
|
|
113
|
-
this.setInnerValueAndNotify(invalidDateKey);
|
|
114
|
-
} else {
|
|
115
|
-
this.setInnerValueAndNotify(date);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
writeValue(value: Date | typeof invalidDateKey) {
|
|
120
|
-
super.writeValue(value);
|
|
121
|
-
this.valueForMaterialDatePicker = value === invalidDateKey ? null : value;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// nativeValueChanged is called when the internal text value changes, but not
|
|
125
|
-
// when the date is changed via the date picker. We need this so that we can
|
|
126
|
-
// determine if the datepicker is empty or invalid.
|
|
127
|
-
nativeValueChanged(event: any) {
|
|
128
|
-
const nativeInputValue = event.target.value;
|
|
129
|
-
const date = this.valueForMaterialDatePicker;
|
|
130
|
-
|
|
131
|
-
if (this.datePickerRef.opened) {
|
|
132
|
-
// if the user is typing instead of using the picker, close it.
|
|
133
|
-
this.datePickerRef.close();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (isNullOrUndefined(date) && stringIsSetAndNotEmpty(nativeInputValue)) {
|
|
137
|
-
this.setInnerValueAndNotify(invalidDateKey);
|
|
138
|
-
} else {
|
|
139
|
-
this.setInnerValueAndNotify(date);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import {ValueAccessorBase} from "../value-accessor-base/value-accessor-base.component";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'klp-form-email-input',
|
|
7
|
-
templateUrl: './email-input.component.html',
|
|
8
|
-
styleUrls: ['./email-input.component.scss'],
|
|
9
|
-
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: EmailInputComponent, multi: true }],
|
|
10
|
-
})
|
|
11
|
-
export class EmailInputComponent extends ValueAccessorBase<string> {
|
|
12
|
-
@Input() placeholder: string;
|
|
13
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<div class="threeDots" [class]="size" *ngIf="variant === '3dots'">
|
|
2
|
-
<div></div>
|
|
3
|
-
<div></div>
|
|
4
|
-
<div></div>
|
|
5
|
-
<div></div>
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<div class="spinner" [class]="size" *ngIf="variant === 'spinner'">
|
|
9
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
|
10
|
-
<circle cx="24" cy="4" r="4" fill="currentColor" />
|
|
11
|
-
<circle cx="12.19" cy="7.86" r="3.7" fill="currentColor" />
|
|
12
|
-
<circle cx="5.02" cy="17.68" r="3.4" fill="currentColor" />
|
|
13
|
-
<circle cx="5.02" cy="30.32" r="3.1" fill="currentColor" />
|
|
14
|
-
<circle cx="12.19" cy="40.14" r="2.8" fill="currentColor" />
|
|
15
|
-
<circle cx="24" cy="44" r="2.5" fill="currentColor" />
|
|
16
|
-
<circle cx="35.81" cy="40.14" r="2.2" fill="currentColor" />
|
|
17
|
-
<circle cx="42.98" cy="30.32" r="1.9" fill="currentColor" />
|
|
18
|
-
<circle cx="42.98" cy="17.68" r="1.6" fill="currentColor" />
|
|
19
|
-
<circle cx="35.81" cy="7.86" r="1.3" fill="currentColor" />
|
|
20
|
-
</svg>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div class="textInput" *ngIf="variant === 'textInput'">
|
|
24
|
-
<input
|
|
25
|
-
disabled
|
|
26
|
-
type="text"
|
|
27
|
-
class="form-control"
|
|
28
|
-
placeholder="Loading..."
|
|
29
|
-
>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div class="picker" *ngIf="variant === 'picker'">
|
|
33
|
-
<input
|
|
34
|
-
disabled
|
|
35
|
-
type="text"
|
|
36
|
-
class="form-control"
|
|
37
|
-
placeholder="Loading..."
|
|
38
|
-
>
|
|
39
|
-
<div class="chevronDown"></div>
|
|
40
|
-
</div>
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
@import '../../../style/themes/default/variables';
|
|
2
|
-
|
|
3
|
-
:host {
|
|
4
|
-
display: block;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.threeDots {
|
|
8
|
-
display: block;
|
|
9
|
-
position: relative;
|
|
10
|
-
|
|
11
|
-
&.tiny {
|
|
12
|
-
--base: 4px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.small {
|
|
16
|
-
--base: 8px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.medium {
|
|
20
|
-
--base: 12px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&.large {
|
|
24
|
-
--base: 18px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&.huge {
|
|
28
|
-
--base: 26px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
width: calc(4 * var(--base));
|
|
32
|
-
height: var(--base);
|
|
33
|
-
|
|
34
|
-
div {
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 0px;
|
|
37
|
-
width: var(--base);
|
|
38
|
-
height: var(--base);
|
|
39
|
-
border-radius: 50%;
|
|
40
|
-
background: $primary;
|
|
41
|
-
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
div:nth-child(1) {
|
|
45
|
-
animation: lds-ellipsis1 0.6s infinite;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
div:nth-child(2) {
|
|
49
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
div:nth-child(3) {
|
|
53
|
-
left: calc(1.5 * var(--base));
|
|
54
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
div:nth-child(4) {
|
|
58
|
-
left: calc(3 * var(--base));
|
|
59
|
-
animation: lds-ellipsis3 0.6s infinite;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@keyframes lds-ellipsis1 {
|
|
63
|
-
0% {
|
|
64
|
-
transform: scale(0);
|
|
65
|
-
}
|
|
66
|
-
100% {
|
|
67
|
-
transform: scale(1);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
@keyframes lds-ellipsis3 {
|
|
71
|
-
0% {
|
|
72
|
-
transform: scale(1);
|
|
73
|
-
}
|
|
74
|
-
100% {
|
|
75
|
-
transform: scale(0);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
@keyframes lds-ellipsis2 {
|
|
79
|
-
0% {
|
|
80
|
-
transform: translate(0, 0);
|
|
81
|
-
}
|
|
82
|
-
100% {
|
|
83
|
-
transform: translate(150%, 0);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.spinner {
|
|
89
|
-
&.tiny {
|
|
90
|
-
svg {
|
|
91
|
-
width: 1rem;
|
|
92
|
-
height: 1rem;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
&.small {
|
|
96
|
-
svg {
|
|
97
|
-
width: 1.6rem;
|
|
98
|
-
height: 1.6rem;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
&.medium {
|
|
102
|
-
svg {
|
|
103
|
-
width: 2.5rem;
|
|
104
|
-
height: 2.5rem;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
&.large {
|
|
108
|
-
svg {
|
|
109
|
-
width: 3rem;
|
|
110
|
-
height: 3rem;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
&.huge {
|
|
114
|
-
svg {
|
|
115
|
-
width: 4rem;
|
|
116
|
-
height: 4rem;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
svg {
|
|
121
|
-
-webkit-transition-property: -webkit-transform;
|
|
122
|
-
-webkit-transition-duration: 1.2s;
|
|
123
|
-
-webkit-animation-name: rotate;
|
|
124
|
-
-webkit-animation-iteration-count: infinite;
|
|
125
|
-
-webkit-animation-timing-function: linear;
|
|
126
|
-
|
|
127
|
-
-moz-transition-property: -moz-transform;
|
|
128
|
-
-moz-animation-name: rotate;
|
|
129
|
-
-moz-animation-duration: 1.2s;
|
|
130
|
-
-moz-animation-iteration-count: infinite;
|
|
131
|
-
-moz-animation-timing-function: linear;
|
|
132
|
-
|
|
133
|
-
transition-property: transform;
|
|
134
|
-
animation-name: rotate;
|
|
135
|
-
animation-duration: 1.2s;
|
|
136
|
-
animation-iteration-count: infinite;
|
|
137
|
-
animation-timing-function: linear;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@-webkit-keyframes rotate {
|
|
141
|
-
from {
|
|
142
|
-
-webkit-transform: rotate(0deg);
|
|
143
|
-
}
|
|
144
|
-
to {
|
|
145
|
-
-webkit-transform: rotate(360deg);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
@-moz-keyframes rotate {
|
|
150
|
-
from {
|
|
151
|
-
-moz-transform: rotate(0deg);
|
|
152
|
-
}
|
|
153
|
-
to {
|
|
154
|
-
-moz-transform: rotate(360deg);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@keyframes rotate {
|
|
159
|
-
from {
|
|
160
|
-
transform: rotate(0deg);
|
|
161
|
-
}
|
|
162
|
-
to {
|
|
163
|
-
transform: rotate(360deg);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
.picker {
|
|
168
|
-
position: relative;
|
|
169
|
-
.chevronDown {
|
|
170
|
-
position: absolute;
|
|
171
|
-
top: 18px;
|
|
172
|
-
right: 23px;
|
|
173
|
-
width: 0;
|
|
174
|
-
height: 0;
|
|
175
|
-
border-top: 5px solid $default-text-color;
|
|
176
|
-
border-left: 5px solid transparent;
|
|
177
|
-
border-right: 5px solid transparent;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'klp-loading-indicator',
|
|
5
|
-
templateUrl: './loading-indicator.component.html',
|
|
6
|
-
styleUrls: ['./loading-indicator.component.scss'],
|
|
7
|
-
})
|
|
8
|
-
export class LoadingIndicatorComponent {
|
|
9
|
-
@Input() public variant: '3dots' | 'spinner' | 'textInput' | 'picker' = '3dots';
|
|
10
|
-
@Input() public size: 'tiny' | 'small' | 'medium' | 'large' | 'huge' = 'medium';
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import {ValueAccessorBase} from "../value-accessor-base/value-accessor-base.component";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'klp-form-number-input',
|
|
7
|
-
templateUrl: './number-input.component.html',
|
|
8
|
-
styleUrls: ['./number-input.component.scss'],
|
|
9
|
-
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: NumberInputComponent, multi: true }],
|
|
10
|
-
})
|
|
11
|
-
export class NumberInputComponent extends ValueAccessorBase<string> {
|
|
12
|
-
@Input() placeholder: string;
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import {ValueAccessorBase} from "../value-accessor-base/value-accessor-base.component";
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'klp-password-field',
|
|
7
|
-
templateUrl: './password-field.component.html',
|
|
8
|
-
styleUrls: ['./password-field.component.scss'],
|
|
9
|
-
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: PasswordFieldComponent, multi: true }],
|
|
10
|
-
})
|
|
11
|
-
export class PasswordFieldComponent extends ValueAccessorBase<string> {}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<ng-select
|
|
2
|
-
[placeholder]="placeholder"
|
|
3
|
-
bindLabel="name"
|
|
4
|
-
bindValue="id"
|
|
5
|
-
[items]="options"
|
|
6
|
-
[clearable]="clearable"
|
|
7
|
-
[(ngModel)]="innerValue"
|
|
8
|
-
[ngClass]="{showErrors: isInErrorState()}"
|
|
9
|
-
(change)="setInnerValueAndNotify(innerValue)"
|
|
10
|
-
[multiple]="multiple"
|
|
11
|
-
[disabled]="disabled"
|
|
12
|
-
(blur)="touch()"
|
|
13
|
-
[dropdownPosition]="dropdownPosition"
|
|
14
|
-
[searchFn]="customSearchFn"
|
|
15
|
-
>
|
|
16
|
-
<ng-template let-item="item" ng-option-tmp>
|
|
17
|
-
{{ item.name }}
|
|
18
|
-
<div *ngIf="item.description" class="dropdown-item-description">
|
|
19
|
-
{{ item.description }}
|
|
20
|
-
</div>
|
|
21
|
-
</ng-template>
|
|
22
|
-
</ng-select>
|