special-forms 1.0.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 +16 -0
- package/.storybook/db-theme.js +8 -0
- package/.storybook/main.js +15 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview-head.html +16 -0
- package/.storybook/preview.js +20 -0
- package/.storybook/tsconfig.json +21 -0
- package/.storybook/typings.d.ts +4 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +27 -0
- package/angular.json +38 -0
- package/documentation.json +10829 -0
- package/package.json +65 -0
- package/projects/special-forms/README.md +24 -0
- package/projects/special-forms/karma.conf.js +44 -0
- package/projects/special-forms/ng-package.json +7 -0
- package/projects/special-forms/package.json +11 -0
- package/projects/special-forms/src/lib/assets/styles.scss +213 -0
- package/projects/special-forms/src/lib/assets/themes/dark.scss +80 -0
- package/projects/special-forms/src/lib/assets/themes/light.scss +78 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-selector/form-control-selector.component.html +5 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-selector/form-control-selector.component.scss +6 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-selector/form-control-selector.component.spec.ts +21 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-selector/form-control-selector.component.ts +21 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-selector/form-control-selector.module.ts +36 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-viewer/form-control-viewer.component.html +5 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-viewer/form-control-viewer.component.scss +18 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-viewer/form-control-viewer.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-viewer/form-control-viewer.component.ts +66 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-control-viewer/form-control-viewer.module.ts +16 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/control-dialog.component.html +31 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/control-dialog.component.scss +0 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/control-dialog.component.spec.ts +22 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/control-dialog.component.ts +102 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/autocomplete.form.ts +87 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/checkbox.form.ts +51 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/common.form.interface.ts +24 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/common.form.ts +31 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/datepicker.form.ts +56 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/dropdown.form.ts +80 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/field.form.ts +189 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/input.form.ts +71 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/label.form.ts +33 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/text-area.form.ts +17 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/components/settings-strategy/upload.form.ts +35 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/form-group-viewer.component.html +37 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/form-group-viewer.component.scss +41 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/form-group-viewer.component.spec.ts +22 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/form-group-viewer.component.ts +95 -0
- package/projects/special-forms/src/lib/aux-storybook-components/form-group-viewer/form-group-viewer.module.ts +32 -0
- package/projects/special-forms/src/lib/components/index.ts +61 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.component.html +62 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.component.spec.ts +24 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.component.ts +58 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.interface.ts +20 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.module.ts +25 -0
- package/projects/special-forms/src/lib/components/special-autocomplete/special-autocomplete.stories.ts +81 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.html +17 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.ts +19 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.interface.ts +12 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.module.ts +25 -0
- package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.stories.ts +76 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.component.html +26 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.component.ts +21 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.interface.ts +13 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.module.ts +26 -0
- package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.stories.ts +69 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.component.html +41 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.component.scss +15 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.component.spec.ts +24 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.component.ts +34 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.interface.ts +18 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.module.ts +22 -0
- package/projects/special-forms/src/lib/components/special-dropdown/special-dropdown.stories.ts +83 -0
- package/projects/special-forms/src/lib/components/special-form/special-form-array.component.html +208 -0
- package/projects/special-forms/src/lib/components/special-form/special-form-array.component.scss +70 -0
- package/projects/special-forms/src/lib/components/special-form/special-form-array.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-form/special-form-array.module.ts +18 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.component.html +20 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.component.spec.ts +22 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.component.ts +85 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.module.ts +40 -0
- package/projects/special-forms/src/lib/components/special-form/special-form.stories.ts +45 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.component.html +37 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.component.ts +39 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.interface.ts +17 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.module.ts +24 -0
- package/projects/special-forms/src/lib/components/special-input/special-input.stories.ts +91 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.component.html +6 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.component.ts +27 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.interface.ts +14 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.module.ts +25 -0
- package/projects/special-forms/src/lib/components/special-label/special-label.stories.ts +99 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.html +82 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.ts +86 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.ts +20 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.module.ts +28 -0
- package/projects/special-forms/src/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.stories.ts +81 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.component.html +29 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.component.scss +3 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.component.ts +20 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.interface.ts +9 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.module.ts +24 -0
- package/projects/special-forms/src/lib/components/special-text-area/special-text-area.stories.ts +69 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.component.html +50 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.component.scss +29 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.component.spec.ts +23 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.component.ts +79 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.interface.ts +12 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.module.ts +23 -0
- package/projects/special-forms/src/lib/components/special-upload/special-upload.stories.ts +81 -0
- package/projects/special-forms/src/lib/core/aux-data/all-icons.ts +99 -0
- package/projects/special-forms/src/lib/core/aux-data/control-types.enum.ts +16 -0
- package/projects/special-forms/src/lib/core/aux-data/countries.ts +247 -0
- package/projects/special-forms/src/lib/core/aux-data/field-basic-data.ts +14 -0
- package/projects/special-forms/src/lib/core/aux-data/input-types.ts +23 -0
- package/projects/special-forms/src/lib/core/controls/icons.control.ts +8 -0
- package/projects/special-forms/src/lib/core/controls/index.ts +2 -0
- package/projects/special-forms/src/lib/core/controls/theme.control.ts +1 -0
- package/projects/special-forms/src/lib/core/controls/types.control.ts +9 -0
- package/projects/special-forms/src/lib/core/directives/control-render.directive.ts +19 -0
- package/projects/special-forms/src/lib/core/directives/control-render.module.ts +10 -0
- package/projects/special-forms/src/lib/core/forms/special-forms.ts +395 -0
- package/projects/special-forms/src/lib/core/interfaces/field-basics.interfaces.ts +22 -0
- package/projects/special-forms/src/lib/core/interfaces/form.interfaces.ts +83 -0
- package/projects/special-forms/src/lib/core/interfaces/special-control.interface.ts +9 -0
- package/projects/special-forms/src/lib/core/masks/currency.mask.ts +11 -0
- package/projects/special-forms/src/lib/core/masks/maks.enum.ts +12 -0
- package/projects/special-forms/src/lib/core/masks/number.mask.ts +4 -0
- package/projects/special-forms/src/lib/core/services/index.ts +3 -0
- package/projects/special-forms/src/lib/core/services/special-form-builder/special-form-builder.service.spec.ts +16 -0
- package/projects/special-forms/src/lib/core/services/special-form-builder/special-form-builder.service.ts +220 -0
- package/projects/special-forms/src/lib/core/utils/enum-to-array.util.ts +6 -0
- package/projects/special-forms/src/lib/pipes/controls-list-pipe/controls-list.pipe.module.ts +10 -0
- package/projects/special-forms/src/lib/pipes/controls-list-pipe/controls-list.pipe.ts +17 -0
- package/projects/special-forms/src/lib/pipes/error-message-pipe/error.pipe.module.ts +13 -0
- package/projects/special-forms/src/lib/pipes/error-message-pipe/error.pipe.ts +21 -0
- package/projects/special-forms/src/lib/pipes/index.ts +3 -0
- package/projects/special-forms/src/lib/pipes/text-by-function/text-by-function.pipe.module.ts +13 -0
- package/projects/special-forms/src/lib/pipes/text-by-function/text-by-function.pipe.ts +14 -0
- package/projects/special-forms/src/public-api.ts +8 -0
- package/projects/special-forms/src/test.ts +27 -0
- package/projects/special-forms/tsconfig.lib.json +15 -0
- package/projects/special-forms/tsconfig.lib.prod.json +10 -0
- package/projects/special-forms/tsconfig.spec.json +17 -0
- package/scss-bundle.config.json +6 -0
- package/stories/Button.stories.ts +42 -0
- package/stories/Header.stories.ts +35 -0
- package/stories/Introduction.stories.mdx +211 -0
- package/stories/Page.stories.ts +36 -0
- package/stories/User.ts +2 -0
- package/stories/assets/code-brackets.svg +1 -0
- package/stories/assets/colors.svg +1 -0
- package/stories/assets/comments.svg +1 -0
- package/stories/assets/direction.svg +1 -0
- package/stories/assets/flow.svg +1 -0
- package/stories/assets/plugin.svg +1 -0
- package/stories/assets/repo.svg +1 -0
- package/stories/assets/stackalt.svg +1 -0
- package/stories/button.component.ts +53 -0
- package/stories/button.css +30 -0
- package/stories/header.component.ts +75 -0
- package/stories/header.css +32 -0
- package/stories/page.component.ts +77 -0
- package/stories/page.css +69 -0
- package/tailwind.config.js +30 -0
- package/tsconfig.json +39 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<ng-container *ngIf="control && !control.hidden">
|
|
2
|
+
<mat-form-field
|
|
3
|
+
class="w-full {{ control.styleClasses }}"
|
|
4
|
+
[appearance]="control.label ? 'outline' : 'standard'"
|
|
5
|
+
>
|
|
6
|
+
<mat-label
|
|
7
|
+
[ngClass]="{ 'is-link': control.label }"
|
|
8
|
+
class="control-label"
|
|
9
|
+
*ngIf="control.label"
|
|
10
|
+
>
|
|
11
|
+
{{ control.label }}
|
|
12
|
+
</mat-label>
|
|
13
|
+
<input
|
|
14
|
+
type="text"
|
|
15
|
+
autocomplete="off"
|
|
16
|
+
[required]="control.required"
|
|
17
|
+
[readonly]="control.readOnly"
|
|
18
|
+
[placeholder]="control.placeholder"
|
|
19
|
+
matInput
|
|
20
|
+
[formControl]="control"
|
|
21
|
+
[matAutocomplete]="auto"
|
|
22
|
+
/>
|
|
23
|
+
<mat-autocomplete
|
|
24
|
+
class="autocomplete-options"
|
|
25
|
+
#auto="matAutocomplete"
|
|
26
|
+
[displayWith]="configValue"
|
|
27
|
+
(optionSelected)="optionSelected($event)"
|
|
28
|
+
>
|
|
29
|
+
<mat-option
|
|
30
|
+
*ngFor="let option of settings?.source | async"
|
|
31
|
+
[value]="option"
|
|
32
|
+
>
|
|
33
|
+
<div class="flex items-center">
|
|
34
|
+
<img
|
|
35
|
+
*ngIf="settings.fieldImage"
|
|
36
|
+
class="w-8 pr-2"
|
|
37
|
+
alt=""
|
|
38
|
+
[src]="option | textByFunction: settings.fieldImage"
|
|
39
|
+
/>
|
|
40
|
+
<span>
|
|
41
|
+
{{ option | textByFunction: settings.fieldName }}
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
</mat-option>
|
|
45
|
+
</mat-autocomplete>
|
|
46
|
+
<mat-icon *ngIf="control.icon" matPrefix>{{ control.icon }}</mat-icon>
|
|
47
|
+
<button
|
|
48
|
+
*ngIf="settings.icon"
|
|
49
|
+
mat-icon-button
|
|
50
|
+
matSuffix
|
|
51
|
+
(click)="iconClick($event)"
|
|
52
|
+
>
|
|
53
|
+
<mat-icon>
|
|
54
|
+
{{ settings.icon }}
|
|
55
|
+
</mat-icon>
|
|
56
|
+
</button>
|
|
57
|
+
<mat-hint>{{ control.tooltip }}</mat-hint>
|
|
58
|
+
<mat-error>
|
|
59
|
+
{{ control.errors | errorMessage: control.errorMessages }}
|
|
60
|
+
</mat-error>
|
|
61
|
+
</mat-form-field>
|
|
62
|
+
</ng-container>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SpecialAutocompleteComponent } from './special-autocomplete.component';
|
|
4
|
+
|
|
5
|
+
describe('SpecialAutocompleteComponent', () => {
|
|
6
|
+
let component: SpecialAutocompleteComponent;
|
|
7
|
+
let fixture: ComponentFixture<SpecialAutocompleteComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [SpecialAutocompleteComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(SpecialAutocompleteComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { debounceTime } from 'rxjs/operators';
|
|
3
|
+
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import { SpecialFormControl } from '../../core/forms/special-forms';
|
|
6
|
+
import { IAutocompleteSettings } from './special-autocomplete.interface';
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'sp-autocomplete',
|
|
9
|
+
templateUrl: './special-autocomplete.component.html',
|
|
10
|
+
styleUrls: ['./special-autocomplete.component.scss'],
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
})
|
|
13
|
+
export class SpecialAutocompleteComponent {
|
|
14
|
+
@Input() control: SpecialFormControl<IAutocompleteSettings>;
|
|
15
|
+
|
|
16
|
+
subs = new Subscription();
|
|
17
|
+
|
|
18
|
+
constructor() {}
|
|
19
|
+
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
this.init();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get settings(): IAutocompleteSettings {
|
|
25
|
+
return this.control.settings;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
init() {
|
|
29
|
+
this.subs.add(
|
|
30
|
+
this.control.valueChanges.pipe(debounceTime(500)).subscribe((value) => {
|
|
31
|
+
if (typeof value === 'string') {
|
|
32
|
+
this.settings.getData(value, this.control);
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
configValue = (item: any) => {
|
|
38
|
+
if (!item) return '';
|
|
39
|
+
const fieldName = this.settings.fieldName;
|
|
40
|
+
return fieldName instanceof Function ? fieldName(item) : item[fieldName];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
optionSelected(data: MatAutocompleteSelectedEvent) {
|
|
44
|
+
this.control.setValue(data.option.value);
|
|
45
|
+
if (this.settings.onSelect) this.settings.onSelect(data.option.value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
iconClick(event) {
|
|
49
|
+
if (this.settings.iconAction) {
|
|
50
|
+
this.settings.iconAction(this.control.value);
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this.subs.unsubscribe();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AbstractControl } from '@angular/forms';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
4
|
+
import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
|
|
5
|
+
|
|
6
|
+
export type IAutocompleteSettings = {
|
|
7
|
+
getData: (query: string, control?: AbstractControl) => void;
|
|
8
|
+
source: Observable<any[]>;
|
|
9
|
+
fieldId: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
iconAction?: (data: any) => void;
|
|
12
|
+
onSelect?: (data: any) => void;
|
|
13
|
+
fieldName: string | ((a?: any) => string);
|
|
14
|
+
fieldImage?: string | ((a?: any) => string);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface IAutocompleteField extends IFieldData {
|
|
18
|
+
settings: IAutocompleteSettings;
|
|
19
|
+
type: EControlTypes.autocomplete;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import { ErrorMessagePipeModule, TextByFunctionPipeModule } from '../../pipes';
|
|
8
|
+
import { SpecialAutocompleteComponent } from './special-autocomplete.component';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
declarations: [SpecialAutocompleteComponent],
|
|
13
|
+
imports: [
|
|
14
|
+
MatInputModule,
|
|
15
|
+
CommonModule,
|
|
16
|
+
MatAutocompleteModule,
|
|
17
|
+
MatIconModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
MatButtonModule,
|
|
20
|
+
ErrorMessagePipeModule,
|
|
21
|
+
TextByFunctionPipeModule,
|
|
22
|
+
],
|
|
23
|
+
exports: [SpecialAutocompleteComponent],
|
|
24
|
+
})
|
|
25
|
+
export class SpecialAutocompleteModule {}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
|
2
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
3
|
+
import { FormControlViewerModule } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.module';
|
|
4
|
+
import { FormControlViewerComponent } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.component';
|
|
5
|
+
import { ICONS_CONTROL } from '../../core/controls/icons.control';
|
|
6
|
+
import { action } from '@storybook/addon-actions';
|
|
7
|
+
import { countries } from '../../core/aux-data/countries';
|
|
8
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
9
|
+
import { THEMES_CONTROL } from '../../core/controls/theme.control';
|
|
10
|
+
import { FieldBasicData } from '../../core/aux-data/field-basic-data';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Special autocomplete control',
|
|
14
|
+
component: FormControlViewerComponent,
|
|
15
|
+
decorators: [
|
|
16
|
+
moduleMetadata({
|
|
17
|
+
imports: [FormControlViewerModule, BrowserAnimationsModule],
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
argTypes: {
|
|
21
|
+
icon: ICONS_CONTROL,
|
|
22
|
+
theme: THEMES_CONTROL,
|
|
23
|
+
},
|
|
24
|
+
} as Meta;
|
|
25
|
+
|
|
26
|
+
const Template: Story<FormControlViewerComponent> = (
|
|
27
|
+
args: FormControlViewerComponent
|
|
28
|
+
) => ({
|
|
29
|
+
title: 'Special autocomplete control',
|
|
30
|
+
template: `
|
|
31
|
+
<spf-form-control-viewer
|
|
32
|
+
(getData)="getData($event)"
|
|
33
|
+
[theme]="theme"
|
|
34
|
+
[autocomplete]="{
|
|
35
|
+
placeholder: placeholder,
|
|
36
|
+
label: label,
|
|
37
|
+
tooltip: tooltip,
|
|
38
|
+
icon: icon,
|
|
39
|
+
elementId: elementId,
|
|
40
|
+
styleClasses: styleClasses,
|
|
41
|
+
length: 0,
|
|
42
|
+
required: required,
|
|
43
|
+
hidden: false,
|
|
44
|
+
readOnly: readOnly,
|
|
45
|
+
defaultValue: defaultValue,
|
|
46
|
+
errorMessages: errorMessages,
|
|
47
|
+
type:type,
|
|
48
|
+
settings:{
|
|
49
|
+
fieldId: fieldId,
|
|
50
|
+
fieldName:fieldName,
|
|
51
|
+
source:source
|
|
52
|
+
}
|
|
53
|
+
}"
|
|
54
|
+
>
|
|
55
|
+
</spf-form-control-viewer>`,
|
|
56
|
+
props: {
|
|
57
|
+
...args,
|
|
58
|
+
type: EControlTypes.autocomplete,
|
|
59
|
+
getData: action('Get data'),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const light = Template.bind({});
|
|
64
|
+
light.args = {
|
|
65
|
+
...FieldBasicData,
|
|
66
|
+
theme: 'light-theme',
|
|
67
|
+
defaultValue: { name: 'Colombia', code: 'CO' },
|
|
68
|
+
fieldName: 'name',
|
|
69
|
+
fieldId: 'code',
|
|
70
|
+
source: countries(),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const dark = Template.bind({});
|
|
74
|
+
dark.args = {
|
|
75
|
+
...FieldBasicData,
|
|
76
|
+
theme: 'dark-theme',
|
|
77
|
+
defaultValue: { name: 'Colombia', code: 'CO' },
|
|
78
|
+
fieldName: 'name',
|
|
79
|
+
fieldId: 'code',
|
|
80
|
+
source: countries(),
|
|
81
|
+
};
|
package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div
|
|
2
|
+
*ngIf="control"
|
|
3
|
+
[id]="control.elementId"
|
|
4
|
+
class="w-full flex flex-col {{ control.styleClasses }}"
|
|
5
|
+
>
|
|
6
|
+
<mat-label *ngIf="control.label">{{ control.label }}</mat-label>
|
|
7
|
+
<mat-checkbox
|
|
8
|
+
[ngModel]="control.value"
|
|
9
|
+
(ngModelChange)="control.setValue($event); control.markAsDirty()"
|
|
10
|
+
[indeterminate]="control.settings.indeterminate"
|
|
11
|
+
[labelPosition]="control.settings.labelPosition"
|
|
12
|
+
[disabled]="control.disabled"
|
|
13
|
+
>
|
|
14
|
+
<mat-icon *ngIf="control.icon" matSuffix>{{ control.icon }} </mat-icon>
|
|
15
|
+
{{ control.placeholder }}
|
|
16
|
+
</mat-checkbox>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SpecialCheckboxComponent } from './special-checkbox.component';
|
|
4
|
+
|
|
5
|
+
describe('SpecialCheckboxComponent', () => {
|
|
6
|
+
let component: SpecialCheckboxComponent;
|
|
7
|
+
let fixture: ComponentFixture<SpecialCheckboxComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SpecialCheckboxComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(SpecialCheckboxComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.component.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
Input,
|
|
5
|
+
OnInit,
|
|
6
|
+
} from '@angular/core';
|
|
7
|
+
import { SpecialFormControl } from '../../core/forms/special-forms';
|
|
8
|
+
import { ICheckboxSettings } from './special-checkbox.interface';
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'sp-checkbox',
|
|
11
|
+
templateUrl: './special-checkbox.component.html',
|
|
12
|
+
styleUrls: ['./special-checkbox.component.scss'],
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
})
|
|
15
|
+
export class SpecialCheckboxComponent implements OnInit {
|
|
16
|
+
@Input() control: SpecialFormControl<ICheckboxSettings>;
|
|
17
|
+
constructor() {}
|
|
18
|
+
ngOnInit(): void {}
|
|
19
|
+
}
|
package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.interface.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
2
|
+
import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
|
|
3
|
+
|
|
4
|
+
export type ICheckboxSettings = {
|
|
5
|
+
labelPosition?: 'before' | 'after';
|
|
6
|
+
indeterminate?:boolean
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface ICheckboxField extends IFieldData {
|
|
10
|
+
settings: ICheckboxSettings;
|
|
11
|
+
type: EControlTypes.checkbox;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { SpecialCheckboxComponent } from './special-checkbox.component';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { ErrorMessagePipeModule } from '../../pipes';
|
|
9
|
+
import {MatCheckboxModule} from '@angular/material/checkbox';
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
declarations: [SpecialCheckboxComponent],
|
|
13
|
+
imports: [
|
|
14
|
+
FormsModule,
|
|
15
|
+
MatCheckboxModule,
|
|
16
|
+
CommonModule,
|
|
17
|
+
MatInputModule,
|
|
18
|
+
MatIconModule,
|
|
19
|
+
ReactiveFormsModule,
|
|
20
|
+
MatButtonModule,
|
|
21
|
+
ErrorMessagePipeModule
|
|
22
|
+
],
|
|
23
|
+
exports: [SpecialCheckboxComponent],
|
|
24
|
+
})
|
|
25
|
+
export class SpecialCheckboxModule {}
|
package/projects/special-forms/src/lib/components/special-checkbox/special-checkbox.stories.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/angular';
|
|
2
|
+
import { moduleMetadata } from '@storybook/angular';
|
|
3
|
+
import { FormControlViewerModule } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.module';
|
|
4
|
+
import { FormControlViewerComponent } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.component';
|
|
5
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
6
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
7
|
+
import { ICONS_CONTROL } from '../../core/controls';
|
|
8
|
+
import { THEMES_CONTROL } from '../../core/controls/theme.control';
|
|
9
|
+
import { FieldBasicData } from '../../core/aux-data/field-basic-data';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Special checkbox control',
|
|
13
|
+
component: FormControlViewerComponent,
|
|
14
|
+
decorators: [
|
|
15
|
+
moduleMetadata({
|
|
16
|
+
imports: [FormControlViewerModule, BrowserAnimationsModule],
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
argTypes: {
|
|
20
|
+
icon: ICONS_CONTROL,
|
|
21
|
+
theme: THEMES_CONTROL,
|
|
22
|
+
labelPosition: { control: 'radio', options: ['before', 'after'] },
|
|
23
|
+
},
|
|
24
|
+
} as Meta;
|
|
25
|
+
|
|
26
|
+
const Template: Story<FormControlViewerComponent> = (
|
|
27
|
+
args: FormControlViewerComponent
|
|
28
|
+
) => ({
|
|
29
|
+
title: 'Special checkbox control',
|
|
30
|
+
template: `
|
|
31
|
+
<spf-form-control-viewer
|
|
32
|
+
[theme]="theme"
|
|
33
|
+
[field]="{
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
label: label,
|
|
36
|
+
tooltip: tooltip,
|
|
37
|
+
icon: icon,
|
|
38
|
+
elementId: elementId,
|
|
39
|
+
styleClasses: styleClasses,
|
|
40
|
+
length: length,
|
|
41
|
+
defaultValue:defaultValue,
|
|
42
|
+
required: required,
|
|
43
|
+
hidden: false,
|
|
44
|
+
type:type,
|
|
45
|
+
readOnly: readOnly,
|
|
46
|
+
settings:{
|
|
47
|
+
labelPosition:labelPosition,
|
|
48
|
+
indeterminate:indeterminate
|
|
49
|
+
},
|
|
50
|
+
errorMessages: errorMessages
|
|
51
|
+
}"
|
|
52
|
+
>
|
|
53
|
+
</spf-form-control-viewer>`,
|
|
54
|
+
props: {
|
|
55
|
+
...args,
|
|
56
|
+
type: EControlTypes.checkbox,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const light = Template.bind({});
|
|
61
|
+
light.args = {
|
|
62
|
+
...FieldBasicData,
|
|
63
|
+
theme: 'light-theme',
|
|
64
|
+
defaultValue: false,
|
|
65
|
+
indeterminate: false,
|
|
66
|
+
labelPosition: 'before',
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const dark = Template.bind({});
|
|
70
|
+
dark.args = {
|
|
71
|
+
...FieldBasicData,
|
|
72
|
+
theme: 'dark-theme',
|
|
73
|
+
defaultValue: true,
|
|
74
|
+
indeterminate: false,
|
|
75
|
+
labelPosition: 'before',
|
|
76
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<mat-form-field
|
|
2
|
+
*ngIf="control"
|
|
3
|
+
[id]="control.elementId"
|
|
4
|
+
class="w-full {{ control.styleClasses }}"
|
|
5
|
+
[appearance]="control.label ? 'outline' : 'standard'"
|
|
6
|
+
>
|
|
7
|
+
<mat-label *ngIf="control.label">{{ control.label }}</mat-label>
|
|
8
|
+
<input
|
|
9
|
+
matInput
|
|
10
|
+
autocomplete="off"
|
|
11
|
+
[readonly]="control.readOnly"
|
|
12
|
+
[matDatepicker]="picker"
|
|
13
|
+
[required]="control.required"
|
|
14
|
+
[placeholder]="control.placeholder"
|
|
15
|
+
[formControl]="control"
|
|
16
|
+
/>
|
|
17
|
+
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
|
18
|
+
<mat-datepicker #picker startView="year" [startAt]="startAt">
|
|
19
|
+
</mat-datepicker>
|
|
20
|
+
<mat-hint>
|
|
21
|
+
{{ control.tooltip }}
|
|
22
|
+
</mat-hint>
|
|
23
|
+
<mat-error>
|
|
24
|
+
{{ control.errors | errorMessage: control.errorMessages }}
|
|
25
|
+
</mat-error>
|
|
26
|
+
</mat-form-field>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SpecialDatepickerComponent } from './special-datepicker.component';
|
|
4
|
+
|
|
5
|
+
describe('SpecialDatepickerComponent', () => {
|
|
6
|
+
let component: SpecialDatepickerComponent;
|
|
7
|
+
let fixture: ComponentFixture<SpecialDatepickerComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SpecialDatepickerComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(SpecialDatepickerComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.component.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { SpecialFormControl } from '../../core/forms/special-forms';
|
|
3
|
+
import { IDatePickerSettings } from './special-datepicker.interface';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'sp-datepicker',
|
|
7
|
+
templateUrl: './special-datepicker.component.html',
|
|
8
|
+
styleUrls: ['./special-datepicker.component.scss'],
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
})
|
|
11
|
+
export class SpecialDatepickerComponent implements OnInit {
|
|
12
|
+
@Input() control: SpecialFormControl<IDatePickerSettings>;
|
|
13
|
+
|
|
14
|
+
constructor() {}
|
|
15
|
+
|
|
16
|
+
get startAt() {
|
|
17
|
+
return this.control.settings?.startAt || new Date();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
ngOnInit(): void {}
|
|
21
|
+
}
|
package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.interface.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
2
|
+
import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
|
|
3
|
+
|
|
4
|
+
export type IDatePickerSettings = {
|
|
5
|
+
lowerLimit?: number;
|
|
6
|
+
upperLimit?: number;
|
|
7
|
+
startAt?: Date;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export interface IDatePickerField extends IFieldData {
|
|
11
|
+
settings: IDatePickerSettings;
|
|
12
|
+
type: EControlTypes.date;
|
|
13
|
+
}
|
package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.module.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { SpecialDatepickerComponent } from './special-datepicker.component';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { ErrorMessagePipeModule } from '../../pipes';
|
|
9
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
10
|
+
import { MatNativeDateModule } from '@angular/material/core';
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
declarations: [SpecialDatepickerComponent],
|
|
14
|
+
imports: [
|
|
15
|
+
MatInputModule,
|
|
16
|
+
MatDatepickerModule,
|
|
17
|
+
CommonModule,
|
|
18
|
+
MatIconModule,
|
|
19
|
+
ReactiveFormsModule,
|
|
20
|
+
MatButtonModule,
|
|
21
|
+
ErrorMessagePipeModule,
|
|
22
|
+
MatNativeDateModule
|
|
23
|
+
],
|
|
24
|
+
exports: [SpecialDatepickerComponent],
|
|
25
|
+
})
|
|
26
|
+
export class SpecialDatepickerModule {}
|
package/projects/special-forms/src/lib/components/special-datepicker/special-datepicker.stories.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/angular';
|
|
2
|
+
import { moduleMetadata } from '@storybook/angular';
|
|
3
|
+
import { FormControlViewerModule } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.module';
|
|
4
|
+
import { FormControlViewerComponent } from '../../aux-storybook-components/form-control-viewer/form-control-viewer.component';
|
|
5
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
6
|
+
import { ICONS_CONTROL } from '../../core/controls';
|
|
7
|
+
import { EControlTypes } from '../../core/aux-data/control-types.enum';
|
|
8
|
+
import { THEMES_CONTROL } from '../../core/controls/theme.control';
|
|
9
|
+
import { FieldBasicData } from '../../core/aux-data/field-basic-data';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Special datepicker control',
|
|
13
|
+
component: FormControlViewerComponent,
|
|
14
|
+
decorators: [
|
|
15
|
+
moduleMetadata({
|
|
16
|
+
imports: [FormControlViewerModule, BrowserAnimationsModule],
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
argTypes: {
|
|
20
|
+
icon: ICONS_CONTROL,
|
|
21
|
+
theme: THEMES_CONTROL,
|
|
22
|
+
length: { control: { type: 'range', min: 1, max: 100, step: 5 } },
|
|
23
|
+
},
|
|
24
|
+
} as Meta;
|
|
25
|
+
|
|
26
|
+
const Template: Story<FormControlViewerComponent> = (
|
|
27
|
+
args: FormControlViewerComponent
|
|
28
|
+
) => ({
|
|
29
|
+
title: 'Special input control',
|
|
30
|
+
template: `
|
|
31
|
+
<spf-form-control-viewer
|
|
32
|
+
[theme]="theme"
|
|
33
|
+
[field]="{
|
|
34
|
+
placeholder: placeholder,
|
|
35
|
+
label: label,
|
|
36
|
+
tooltip: tooltip,
|
|
37
|
+
icon: icon,
|
|
38
|
+
elementId: elementId,
|
|
39
|
+
styleClasses: styleClasses,
|
|
40
|
+
length: length,
|
|
41
|
+
defaultValue:defaultValue,
|
|
42
|
+
required: required,
|
|
43
|
+
hidden: false,
|
|
44
|
+
readOnly: readOnly,
|
|
45
|
+
type:type,
|
|
46
|
+
settings:{},
|
|
47
|
+
errorMessages: errorMessages
|
|
48
|
+
}"
|
|
49
|
+
>
|
|
50
|
+
</spf-form-control-viewer>`,
|
|
51
|
+
props: {
|
|
52
|
+
...args,
|
|
53
|
+
type: EControlTypes.date,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const light = Template.bind({});
|
|
58
|
+
light.args = {
|
|
59
|
+
...FieldBasicData,
|
|
60
|
+
theme: 'light-theme',
|
|
61
|
+
defaultValue: new Date(),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const dark = Template.bind({});
|
|
65
|
+
dark.args = {
|
|
66
|
+
...FieldBasicData,
|
|
67
|
+
theme: 'dark-theme',
|
|
68
|
+
defaultValue: new Date(),
|
|
69
|
+
};
|