@smartsoft001/crud-shell-angular 1.2.91 → 2.69.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/.storybook/addons.js +1 -0
- package/.storybook/config.js +5 -0
- package/.storybook/tsconfig.json +8 -0
- package/.storybook/webpack.config.js +7 -0
- package/jest.config.ts +38 -0
- package/ng-package.json +7 -0
- package/package.json +12 -23
- package/project.json +49 -0
- package/src/index.ts +13 -0
- package/src/lib/+state/crud.facade.ts +82 -0
- package/src/lib/+state/crud.feature.methods.ts +258 -0
- package/src/lib/+state/crud.feature.store.ts +77 -0
- package/src/lib/components/components.module.ts +58 -0
- package/src/lib/components/export/export.component.ts +69 -0
- package/src/lib/components/filter/base/base.component.ts +175 -0
- package/src/lib/components/filter/check/check.component.scss +25 -0
- package/src/lib/components/filter/check/check.component.ts +72 -0
- package/src/lib/components/filter/date/date.component.html +30 -0
- package/src/lib/components/filter/date/date.component.ts +70 -0
- package/src/lib/components/filter/date-time/date-time.component.html +62 -0
- package/src/lib/components/filter/date-time/date-time.component.ts +56 -0
- package/src/lib/components/filter/date-with-edit/date-with-edit.component.html +109 -0
- package/src/lib/components/filter/date-with-edit/date-with-edit.component.ts +70 -0
- package/src/lib/components/filter/filter.component.html +52 -0
- package/src/lib/components/filter/filter.component.ts +34 -0
- package/src/lib/components/filter/flag/flag.component.ts +55 -0
- package/src/lib/components/filter/index.ts +9 -0
- package/src/lib/components/filter/int/int.component.html +74 -0
- package/src/lib/components/filter/int/int.component.ts +57 -0
- package/src/lib/components/filter/radio/radio.component.ts +74 -0
- package/src/lib/components/filter/text/text.component.ts +46 -0
- package/src/lib/components/filters/filters.component.scss +150 -0
- package/src/lib/components/filters/filters.component.ts +157 -0
- package/src/lib/components/filters-config/filters-config.component.ts +69 -0
- package/src/lib/components/group/group.component.ts +93 -0
- package/src/lib/components/index.ts +7 -0
- package/src/lib/components/multiselect/multiselect.component.html +41 -0
- package/src/lib/components/multiselect/multiselect.component.scss +125 -0
- package/src/lib/components/multiselect/multiselect.component.ts +104 -0
- package/src/lib/crud-full.module.ts +51 -0
- package/src/lib/crud.config.ts +79 -0
- package/src/lib/crud.module.ts +72 -0
- package/src/lib/factories/list-pagination/list-pagination.factory.ts +77 -0
- package/src/lib/models/index.ts +1 -0
- package/src/lib/models/interfaces.ts +34 -0
- package/src/lib/pages/index.ts +6 -0
- package/src/lib/pages/item/base/base.component.ts +54 -0
- package/src/lib/pages/item/item.component.ts +513 -0
- package/src/lib/pages/item/standard/standard.component.scss +0 -0
- package/src/lib/pages/item/standard/standard.component.ts +50 -0
- package/src/lib/pages/list/base/base.component.ts +29 -0
- package/src/lib/pages/list/list.component.stories.ts +77 -0
- package/src/lib/pages/list/list.component.ts +438 -0
- package/src/lib/pages/list/standard/standard.component.ts +42 -0
- package/src/lib/pipes/form-options/form-options.pipe.ts +61 -0
- package/src/lib/pipes/index.ts +2 -0
- package/src/lib/pipes/pipes.module.ts +9 -0
- package/src/lib/providers/model-possibilities/model-possibilities.provider.ts +19 -0
- package/src/lib/services/crud/crud.service.spec.ts +303 -0
- package/src/lib/services/crud/crud.service.ts +178 -0
- package/src/lib/services/list-group/list-group.service.spec.ts +87 -0
- package/src/lib/services/list-group/list-group.service.ts +65 -0
- package/src/lib/services/page/page.service.spec.ts +143 -0
- package/src/lib/services/page/page.service.ts +44 -0
- package/src/lib/services/search/search.service.spec.ts +134 -0
- package/src/lib/services/search/search.service.ts +42 -0
- package/test-setup.ts +0 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +31 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +10 -0
- package/tslint.json +10 -0
- package/esm2022/index.mjs +0 -18
- package/esm2022/lib/+state/crud.actions.mjs +0 -224
- package/esm2022/lib/+state/crud.effects.mjs +0 -182
- package/esm2022/lib/+state/crud.facade.mjs +0 -91
- package/esm2022/lib/+state/crud.reducer.mjs +0 -214
- package/esm2022/lib/+state/crud.selectors.mjs +0 -11
- package/esm2022/lib/components/components.module.mjs +0 -110
- package/esm2022/lib/components/export/export.component.mjs +0 -47
- package/esm2022/lib/components/filter/base/base.component.mjs +0 -152
- package/esm2022/lib/components/filter/check/check.component.mjs +0 -36
- package/esm2022/lib/components/filter/date/date.component.mjs +0 -47
- package/esm2022/lib/components/filter/date-time/date-time.component.mjs +0 -43
- package/esm2022/lib/components/filter/date-with-edit/date-with-edit.component.mjs +0 -49
- package/esm2022/lib/components/filter/filter.component.mjs +0 -30
- package/esm2022/lib/components/filter/flag/flag.component.mjs +0 -16
- package/esm2022/lib/components/filter/index.mjs +0 -10
- package/esm2022/lib/components/filter/int/int.component.mjs +0 -38
- package/esm2022/lib/components/filter/radio/radio.component.mjs +0 -16
- package/esm2022/lib/components/filter/text/text.component.mjs +0 -16
- package/esm2022/lib/components/filters/filters.component.mjs +0 -111
- package/esm2022/lib/components/filters-config/filters-config.component.mjs +0 -37
- package/esm2022/lib/components/group/group.component.mjs +0 -54
- package/esm2022/lib/components/index.mjs +0 -8
- package/esm2022/lib/components/multiselect/multiselect.component.mjs +0 -71
- package/esm2022/lib/crud-full.module.mjs +0 -103
- package/esm2022/lib/crud.config.mjs +0 -17
- package/esm2022/lib/crud.module.mjs +0 -106
- package/esm2022/lib/factories/list-pagination/list-pagination.factory.mjs +0 -69
- package/esm2022/lib/models/index.mjs +0 -2
- package/esm2022/lib/models/interfaces.mjs +0 -2
- package/esm2022/lib/pages/index.mjs +0 -7
- package/esm2022/lib/pages/item/base/base.component.mjs +0 -44
- package/esm2022/lib/pages/item/item.component.mjs +0 -395
- package/esm2022/lib/pages/item/standard/standard.component.mjs +0 -15
- package/esm2022/lib/pages/list/base/base.component.mjs +0 -23
- package/esm2022/lib/pages/list/list.component.mjs +0 -355
- package/esm2022/lib/pages/list/standard/standard.component.mjs +0 -34
- package/esm2022/lib/pipes/form-options/form-options.pipe.mjs +0 -55
- package/esm2022/lib/pipes/index.mjs +0 -3
- package/esm2022/lib/pipes/pipes.module.mjs +0 -20
- package/esm2022/lib/providers/model-possibilities/model-possibilities.provider.mjs +0 -11
- package/esm2022/lib/services/crud/crud.service.mjs +0 -138
- package/esm2022/lib/services/list-group/list-group.service.mjs +0 -60
- package/esm2022/lib/services/page/page.service.mjs +0 -41
- package/esm2022/lib/services/search/search.service.mjs +0 -41
- package/esm2022/lib/services/socket/socket.service.mjs +0 -17
- package/esm2022/smartsoft001-crud-shell-angular.mjs +0 -5
- package/fesm2022/smartsoft001-crud-shell-angular.mjs +0 -2810
- package/fesm2022/smartsoft001-crud-shell-angular.mjs.map +0 -1
- package/index.d.ts +0 -18
- package/index.d.ts.map +0 -1
- package/lib/+state/crud.actions.d.ts +0 -152
- package/lib/+state/crud.actions.d.ts.map +0 -1
- package/lib/+state/crud.effects.d.ts +0 -18
- package/lib/+state/crud.effects.d.ts.map +0 -1
- package/lib/+state/crud.facade.d.ts +0 -44
- package/lib/+state/crud.facade.d.ts.map +0 -1
- package/lib/+state/crud.reducer.d.ts +0 -43
- package/lib/+state/crud.reducer.d.ts.map +0 -1
- package/lib/+state/crud.selectors.d.ts +0 -10
- package/lib/+state/crud.selectors.d.ts.map +0 -1
- package/lib/components/components.module.d.ts +0 -27
- package/lib/components/components.module.d.ts.map +0 -1
- package/lib/components/export/export.component.d.ts +0 -21
- package/lib/components/export/export.component.d.ts.map +0 -1
- package/lib/components/filter/base/base.component.d.ts +0 -39
- package/lib/components/filter/base/base.component.d.ts.map +0 -1
- package/lib/components/filter/check/check.component.d.ts +0 -19
- package/lib/components/filter/check/check.component.d.ts.map +0 -1
- package/lib/components/filter/date/date.component.d.ts +0 -16
- package/lib/components/filter/date/date.component.d.ts.map +0 -1
- package/lib/components/filter/date-time/date-time.component.d.ts +0 -15
- package/lib/components/filter/date-time/date-time.component.d.ts.map +0 -1
- package/lib/components/filter/date-with-edit/date-with-edit.component.d.ts +0 -17
- package/lib/components/filter/date-with-edit/date-with-edit.component.d.ts.map +0 -1
- package/lib/components/filter/filter.component.d.ts +0 -14
- package/lib/components/filter/filter.component.d.ts.map +0 -1
- package/lib/components/filter/flag/flag.component.d.ts +0 -8
- package/lib/components/filter/flag/flag.component.d.ts.map +0 -1
- package/lib/components/filter/index.d.ts +0 -10
- package/lib/components/filter/index.d.ts.map +0 -1
- package/lib/components/filter/int/int.component.d.ts +0 -15
- package/lib/components/filter/int/int.component.d.ts.map +0 -1
- package/lib/components/filter/radio/radio.component.d.ts +0 -8
- package/lib/components/filter/radio/radio.component.d.ts.map +0 -1
- package/lib/components/filter/text/text.component.d.ts +0 -8
- package/lib/components/filter/text/text.component.d.ts.map +0 -1
- package/lib/components/filters/filters.component.d.ts +0 -83
- package/lib/components/filters/filters.component.d.ts.map +0 -1
- package/lib/components/filters-config/filters-config.component.d.ts +0 -19
- package/lib/components/filters-config/filters-config.component.d.ts.map +0 -1
- package/lib/components/group/group.component.d.ts +0 -23
- package/lib/components/group/group.component.d.ts.map +0 -1
- package/lib/components/index.d.ts +0 -8
- package/lib/components/index.d.ts.map +0 -1
- package/lib/components/multiselect/multiselect.component.d.ts +0 -28
- package/lib/components/multiselect/multiselect.component.d.ts.map +0 -1
- package/lib/crud-full.module.d.ts +0 -28
- package/lib/crud-full.module.d.ts.map +0 -1
- package/lib/crud.config.d.ts +0 -65
- package/lib/crud.config.d.ts.map +0 -1
- package/lib/crud.module.d.ts +0 -34
- package/lib/crud.module.d.ts.map +0 -1
- package/lib/factories/list-pagination/list-pagination.factory.d.ts +0 -20
- package/lib/factories/list-pagination/list-pagination.factory.d.ts.map +0 -1
- package/lib/models/index.d.ts +0 -2
- package/lib/models/index.d.ts.map +0 -1
- package/lib/models/interfaces.d.ts +0 -30
- package/lib/models/interfaces.d.ts.map +0 -1
- package/lib/pages/index.d.ts +0 -7
- package/lib/pages/index.d.ts.map +0 -1
- package/lib/pages/item/base/base.component.d.ts +0 -25
- package/lib/pages/item/base/base.component.d.ts.map +0 -1
- package/lib/pages/item/item.component.d.ts +0 -70
- package/lib/pages/item/item.component.d.ts.map +0 -1
- package/lib/pages/item/standard/standard.component.d.ts +0 -8
- package/lib/pages/item/standard/standard.component.d.ts.map +0 -1
- package/lib/pages/list/base/base.component.d.ts +0 -15
- package/lib/pages/list/base/base.component.d.ts.map +0 -1
- package/lib/pages/list/list.component.d.ts +0 -54
- package/lib/pages/list/list.component.d.ts.map +0 -1
- package/lib/pages/list/standard/standard.component.d.ts +0 -14
- package/lib/pages/list/standard/standard.component.d.ts.map +0 -1
- package/lib/pipes/form-options/form-options.pipe.d.ts +0 -15
- package/lib/pipes/form-options/form-options.pipe.d.ts.map +0 -1
- package/lib/pipes/index.d.ts +0 -3
- package/lib/pipes/index.d.ts.map +0 -1
- package/lib/pipes/pipes.module.d.ts +0 -8
- package/lib/pipes/pipes.module.d.ts.map +0 -1
- package/lib/providers/model-possibilities/model-possibilities.provider.d.ts +0 -18
- package/lib/providers/model-possibilities/model-possibilities.provider.d.ts.map +0 -1
- package/lib/services/crud/crud.service.d.ts +0 -38
- package/lib/services/crud/crud.service.d.ts.map +0 -1
- package/lib/services/list-group/list-group.service.d.ts +0 -15
- package/lib/services/list-group/list-group.service.d.ts.map +0 -1
- package/lib/services/page/page.service.d.ts +0 -12
- package/lib/services/page/page.service.d.ts.map +0 -1
- package/lib/services/search/search.service.d.ts +0 -16
- package/lib/services/search/search.service.d.ts.map +0 -1
- package/lib/services/socket/socket.service.d.ts +0 -10
- package/lib/services/socket/socket.service.d.ts.map +0 -1
- package/smartsoft001-crud-shell-angular.d.ts.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnDestroy,
|
|
4
|
+
OnInit,
|
|
5
|
+
signal,
|
|
6
|
+
WritableSignal,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
11
|
+
|
|
12
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
13
|
+
import { GuidService } from '@smartsoft001/utils';
|
|
14
|
+
|
|
15
|
+
import { FilterDateComponent } from '../date/date.component';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'smart-crud-filter-date-with-edit',
|
|
19
|
+
templateUrl: './date-with-edit.component.html',
|
|
20
|
+
imports: [TranslatePipe, FormsModule],
|
|
21
|
+
styles: [
|
|
22
|
+
`
|
|
23
|
+
:host {
|
|
24
|
+
width: 100%;
|
|
25
|
+
.square-button {
|
|
26
|
+
height: var(--smart-button-height) !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
],
|
|
31
|
+
})
|
|
32
|
+
export class FilterDateWithEditComponent<T extends IEntity<string>>
|
|
33
|
+
extends FilterDateComponent<T>
|
|
34
|
+
implements OnInit, OnDestroy
|
|
35
|
+
{
|
|
36
|
+
private _subscriptions = new Subscription();
|
|
37
|
+
|
|
38
|
+
advanced: WritableSignal<boolean> = signal(false);
|
|
39
|
+
id = GuidService.create();
|
|
40
|
+
|
|
41
|
+
// @ViewChild(IonDatetime, { read: IonDatetime, static: false })
|
|
42
|
+
// dateTimePicker: IonDatetime;
|
|
43
|
+
|
|
44
|
+
toggleAdvanced(): void {
|
|
45
|
+
this.advanced.update((val) => !val);
|
|
46
|
+
if (this.advanced) {
|
|
47
|
+
this.value = null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ngOnInit(): void {
|
|
52
|
+
super.ngOnInit();
|
|
53
|
+
|
|
54
|
+
// if (this.dateTimePicker) {
|
|
55
|
+
// this._subscriptions.add(
|
|
56
|
+
// this.dateTimePicker.ionChange.subscribe((val: CustomEvent) => {
|
|
57
|
+
// this.customValue = val.detail.value;
|
|
58
|
+
// }),
|
|
59
|
+
// );
|
|
60
|
+
// } else {
|
|
61
|
+
// console.error('dateTimePicker not found!');
|
|
62
|
+
// }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
ngOnDestroy(): void {
|
|
66
|
+
if (this._subscriptions) {
|
|
67
|
+
this._subscriptions.unsubscribe();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!--<ion-item>-->
|
|
2
|
+
@switch (item().fieldType) {
|
|
3
|
+
@case (FieldType.date) {
|
|
4
|
+
<smart-crud-filter-date
|
|
5
|
+
[item]="item()"
|
|
6
|
+
[filter]="filter()"
|
|
7
|
+
></smart-crud-filter-date>
|
|
8
|
+
}
|
|
9
|
+
@case (FieldType.dateWithEdit) {
|
|
10
|
+
<smart-crud-filter-date-with-edit
|
|
11
|
+
[item]="item()"
|
|
12
|
+
[filter]="filter()"
|
|
13
|
+
></smart-crud-filter-date-with-edit>
|
|
14
|
+
}
|
|
15
|
+
@case (FieldType.dateTime) {
|
|
16
|
+
<smart-crud-filter-date-time
|
|
17
|
+
[item]="item()"
|
|
18
|
+
[filter]="filter()"
|
|
19
|
+
></smart-crud-filter-date-time>
|
|
20
|
+
}
|
|
21
|
+
@case (FieldType.radio) {
|
|
22
|
+
<smart-crud-filter-radio
|
|
23
|
+
[item]="item()"
|
|
24
|
+
[filter]="filter()"
|
|
25
|
+
></smart-crud-filter-radio>
|
|
26
|
+
}
|
|
27
|
+
@case (FieldType.check) {
|
|
28
|
+
<smart-crud-filter-check
|
|
29
|
+
[item]="item()"
|
|
30
|
+
[filter]="filter()"
|
|
31
|
+
></smart-crud-filter-check>
|
|
32
|
+
}
|
|
33
|
+
@case (FieldType.flag) {
|
|
34
|
+
<smart-crud-filter-flag
|
|
35
|
+
[item]="item()"
|
|
36
|
+
[filter]="filter()"
|
|
37
|
+
></smart-crud-filter-flag>
|
|
38
|
+
}
|
|
39
|
+
@case (FieldType.int) {
|
|
40
|
+
<smart-crud-filter-int
|
|
41
|
+
[item]="item()"
|
|
42
|
+
[filter]="filter()"
|
|
43
|
+
></smart-crud-filter-int>
|
|
44
|
+
}
|
|
45
|
+
@default {
|
|
46
|
+
<smart-crud-filter-text
|
|
47
|
+
[item]="item()"
|
|
48
|
+
[filter]="filter()"
|
|
49
|
+
></smart-crud-filter-text>
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
<!--</ion-item>-->
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component, input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { FieldType, IModelFilter } from '@smartsoft001/models';
|
|
4
|
+
|
|
5
|
+
import { ICrudFilter } from '../../models';
|
|
6
|
+
import { FilterCheckComponent } from './check/check.component';
|
|
7
|
+
import { FilterDateComponent } from './date/date.component';
|
|
8
|
+
import { FilterDateTimeComponent } from './date-time/date-time.component';
|
|
9
|
+
import { FilterDateWithEditComponent } from './date-with-edit/date-with-edit.component';
|
|
10
|
+
import { FilterFlagComponent } from './flag/flag.component';
|
|
11
|
+
import { FilterIntComponent } from './int/int.component';
|
|
12
|
+
import { FilterRadioComponent } from './radio/radio.component';
|
|
13
|
+
import { FilterTextComponent } from './text/text.component';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'smart-crud-filter',
|
|
17
|
+
templateUrl: './filter.component.html',
|
|
18
|
+
imports: [
|
|
19
|
+
FilterTextComponent,
|
|
20
|
+
FilterIntComponent,
|
|
21
|
+
FilterFlagComponent,
|
|
22
|
+
FilterCheckComponent,
|
|
23
|
+
FilterRadioComponent,
|
|
24
|
+
FilterDateTimeComponent,
|
|
25
|
+
FilterDateWithEditComponent,
|
|
26
|
+
FilterDateComponent,
|
|
27
|
+
],
|
|
28
|
+
})
|
|
29
|
+
export class FilterComponent {
|
|
30
|
+
FieldType = FieldType;
|
|
31
|
+
|
|
32
|
+
item = input<IModelFilter>();
|
|
33
|
+
filter = input<ICrudFilter>();
|
|
34
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
|
+
|
|
5
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
6
|
+
|
|
7
|
+
import { BaseComponent } from '../base/base.component';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'smart-crud-filter-flag',
|
|
11
|
+
template: `
|
|
12
|
+
<!-- <ion-row>-->
|
|
13
|
+
<!-- <ion-col>-->
|
|
14
|
+
<div
|
|
15
|
+
class="flag-container w-full flex flex-row flex-nowrap justify-between pr-5"
|
|
16
|
+
>
|
|
17
|
+
<!-- <ion-label class="align-middle my-6" position="static">-->
|
|
18
|
+
{{ item().label | translate }}
|
|
19
|
+
<!-- </ion-label>-->
|
|
20
|
+
<!-- <ion-checkbox [(ngModel)]="value" slot="end"></ion-checkbox>-->
|
|
21
|
+
</div>
|
|
22
|
+
<!-- </ion-col>-->
|
|
23
|
+
@if (typeof value === 'boolean') {
|
|
24
|
+
<!-- <ion-col size="auto">-->
|
|
25
|
+
<!-- <ion-button-->
|
|
26
|
+
<!-- color="danger"-->
|
|
27
|
+
<!-- (click)="refresh(null)"-->
|
|
28
|
+
<!-- class="square-button m-3"-->
|
|
29
|
+
<!-- >-->
|
|
30
|
+
<!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
|
|
31
|
+
<!-- </ion-button>-->
|
|
32
|
+
<!-- </ion-col>-->
|
|
33
|
+
}
|
|
34
|
+
<!-- </ion-row>-->
|
|
35
|
+
`,
|
|
36
|
+
imports: [TranslatePipe, FormsModule],
|
|
37
|
+
styles: [
|
|
38
|
+
`
|
|
39
|
+
:host {
|
|
40
|
+
width: 100%;
|
|
41
|
+
.flag-container {
|
|
42
|
+
ion-label {
|
|
43
|
+
/*--color: var(--smart-color-dark);*/
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.square-button {
|
|
47
|
+
height: var(--smart-button-height) !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
],
|
|
52
|
+
})
|
|
53
|
+
export class FilterFlagComponent<
|
|
54
|
+
T extends IEntity<string>,
|
|
55
|
+
> extends BaseComponent<T> {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './filter.component';
|
|
2
|
+
export * from './date/date.component';
|
|
3
|
+
export * from './date-with-edit/date-with-edit.component';
|
|
4
|
+
export * from './date-time/date-time.component';
|
|
5
|
+
export * from './radio/radio.component';
|
|
6
|
+
export * from './text/text.component';
|
|
7
|
+
export * from './flag/flag.component';
|
|
8
|
+
export * from './check/check.component';
|
|
9
|
+
export * from './int/int.component';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!--<ion-row>-->
|
|
2
|
+
<!-- <ion-col>-->
|
|
3
|
+
<!-- <ion-label>-->
|
|
4
|
+
{{ item().label | translate }}
|
|
5
|
+
<!-- </ion-label>-->
|
|
6
|
+
@if (!advanced()) {
|
|
7
|
+
<!-- <ion-input [(ngModel)]="value" type="number" step="1"></ion-input>-->
|
|
8
|
+
}
|
|
9
|
+
<!-- </ion-col>-->
|
|
10
|
+
@if (allowAdvanced) {
|
|
11
|
+
<!-- <ion-col size="auto">-->
|
|
12
|
+
<!-- <ion-button-->
|
|
13
|
+
<!-- (click)="toggleAdvanced()"-->
|
|
14
|
+
<!-- class="square-button m-3"-->
|
|
15
|
+
<!-- [disabled]="minValue || maxValue"-->
|
|
16
|
+
<!-- >-->
|
|
17
|
+
@if (!advanced()) {
|
|
18
|
+
<!-- <ion-icon slot="icon-only" name="settings-outline"></ion-icon>-->
|
|
19
|
+
} @else {
|
|
20
|
+
<!-- <ion-icon slot="icon-only" name="settings"></ion-icon>-->
|
|
21
|
+
}
|
|
22
|
+
<!-- </ion-button>-->
|
|
23
|
+
<!-- </ion-col>-->
|
|
24
|
+
}
|
|
25
|
+
@if (value || minValue || maxValue) {
|
|
26
|
+
<!-- <ion-col size="auto">-->
|
|
27
|
+
<!-- <ion-button color="danger" (click)="clear()" class="square-button m-3">-->
|
|
28
|
+
<!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
|
|
29
|
+
<!-- </ion-button>-->
|
|
30
|
+
<!-- </ion-col>-->
|
|
31
|
+
}
|
|
32
|
+
<!--</ion-row>-->
|
|
33
|
+
@if ((advanced() || minValue || maxValue) && allowAdvanced) {
|
|
34
|
+
<!-- <ion-row>-->
|
|
35
|
+
<!-- <ion-col>-->
|
|
36
|
+
<!-- <ion-item>-->
|
|
37
|
+
<!-- <ion-label>-->
|
|
38
|
+
{{ 'from' | translate }}
|
|
39
|
+
<!-- </ion-label>-->
|
|
40
|
+
<!-- <ion-input [(ngModel)]="minValue" type="number" step="1"></ion-input>-->
|
|
41
|
+
<!-- </ion-item>-->
|
|
42
|
+
<!-- </ion-col>-->
|
|
43
|
+
@if (minValue) {
|
|
44
|
+
<!-- <ion-col size="auto">-->
|
|
45
|
+
<!-- <ion-button-->
|
|
46
|
+
<!-- color="danger"-->
|
|
47
|
+
<!-- (click)="refresh(null, '>=')"-->
|
|
48
|
+
<!-- class="square-button m-3"-->
|
|
49
|
+
<!-- >-->
|
|
50
|
+
<!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
|
|
51
|
+
<!-- </ion-button>-->
|
|
52
|
+
<!-- </ion-col>-->
|
|
53
|
+
}
|
|
54
|
+
<!-- <ion-col>-->
|
|
55
|
+
<!-- <ion-item>-->
|
|
56
|
+
<!-- <ion-label>-->
|
|
57
|
+
{{ 'to' | translate }}
|
|
58
|
+
<!-- </ion-label>-->
|
|
59
|
+
<!-- <ion-input [(ngModel)]="maxValue" type="number" step="1"></ion-input>-->
|
|
60
|
+
<!-- </ion-item>-->
|
|
61
|
+
<!-- </ion-col>-->
|
|
62
|
+
@if (maxValue) {
|
|
63
|
+
<!-- <ion-col size="auto">-->
|
|
64
|
+
<!-- <ion-button-->
|
|
65
|
+
<!-- color="danger"-->
|
|
66
|
+
<!-- (click)="refresh(null, '<=')"-->
|
|
67
|
+
<!-- class="square-button m-3"-->
|
|
68
|
+
<!-- >-->
|
|
69
|
+
<!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
|
|
70
|
+
<!-- </ion-button>-->
|
|
71
|
+
<!-- </ion-col>-->
|
|
72
|
+
}
|
|
73
|
+
<!-- </ion-row>-->
|
|
74
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnDestroy,
|
|
4
|
+
OnInit,
|
|
5
|
+
signal,
|
|
6
|
+
WritableSignal,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
11
|
+
|
|
12
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
13
|
+
|
|
14
|
+
import { BaseComponent } from '../base/base.component';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'smart-crud-filter-int',
|
|
18
|
+
templateUrl: './int.component.html',
|
|
19
|
+
imports: [TranslatePipe, FormsModule],
|
|
20
|
+
styles: [
|
|
21
|
+
`
|
|
22
|
+
:host {
|
|
23
|
+
width: 100%;
|
|
24
|
+
.square-button {
|
|
25
|
+
height: var(--smart-button-height) !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
export class FilterIntComponent<T extends IEntity<string>>
|
|
32
|
+
extends BaseComponent<T>
|
|
33
|
+
implements OnInit, OnDestroy
|
|
34
|
+
{
|
|
35
|
+
private _subscriptions = new Subscription();
|
|
36
|
+
|
|
37
|
+
advanced: WritableSignal<boolean> = signal<boolean>(false);
|
|
38
|
+
|
|
39
|
+
get allowAdvanced(): boolean {
|
|
40
|
+
return this.item()?.type === '=';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ngOnInit(): void {
|
|
44
|
+
super.ngOnInit();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ngOnDestroy(): void {
|
|
48
|
+
if (this._subscriptions) {
|
|
49
|
+
this._subscriptions.unsubscribe();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
toggleAdvanced(): void {
|
|
54
|
+
this.advanced.update((val) => !val);
|
|
55
|
+
if (this.advanced) this.value = null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
|
+
|
|
5
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
6
|
+
|
|
7
|
+
import { BaseComponent } from '../base/base.component';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'smart-crud-filter-radio',
|
|
11
|
+
template: `
|
|
12
|
+
<!-- <ion-row>-->
|
|
13
|
+
<!-- <ion-col>-->
|
|
14
|
+
<!-- <ion-radio-group [(ngModel)]="value">-->
|
|
15
|
+
<!-- <ion-item-divider class="font-light text-xl">-->
|
|
16
|
+
<!-- <ion-icon class="mr-6 text-2xl" slot="start" name="filter-outline"></ion-icon>-->
|
|
17
|
+
<!-- <ion-label>-->
|
|
18
|
+
{{ item().label | translate }}
|
|
19
|
+
<!-- </ion-label>-->
|
|
20
|
+
@if (value || value === false) {
|
|
21
|
+
<!-- <ion-button-->
|
|
22
|
+
<!-- slot="end"-->
|
|
23
|
+
<!-- color="danger"-->
|
|
24
|
+
<!-- (click)="refresh(null)"-->
|
|
25
|
+
<!-- class="square-button m-0 text-lg h-9 w-9 p-0"-->
|
|
26
|
+
<!-- >-->
|
|
27
|
+
<!-- <ion-icon class="mr-6 text-2xl m-0 p-0" slot="icon-only" name="close-outline"></ion-icon>-->
|
|
28
|
+
<!-- </ion-button>-->
|
|
29
|
+
}
|
|
30
|
+
<!-- </ion-item-divider>-->
|
|
31
|
+
|
|
32
|
+
@for (item of possibilities(); track item) {
|
|
33
|
+
<!-- <ion-item>-->
|
|
34
|
+
<!-- <ion-label>{{ item.text | translate }}</ion-label>-->
|
|
35
|
+
<!-- <ion-radio class="mr-10" [value]="item.id"></ion-radio>-->
|
|
36
|
+
<!-- </ion-item>-->
|
|
37
|
+
}
|
|
38
|
+
<!-- </ion-radio-group>-->
|
|
39
|
+
<!-- </ion-col>-->
|
|
40
|
+
<!-- </ion-row>-->
|
|
41
|
+
`,
|
|
42
|
+
imports: [TranslatePipe, FormsModule],
|
|
43
|
+
styles: [
|
|
44
|
+
`
|
|
45
|
+
:host {
|
|
46
|
+
width: 100%;
|
|
47
|
+
margin-bottom: 1.2rem;
|
|
48
|
+
ion-item-divider {
|
|
49
|
+
//--padding-end: 0.8rem;
|
|
50
|
+
//--ion-background-color: linear-gradient(
|
|
51
|
+
// 90deg,
|
|
52
|
+
// transparent,
|
|
53
|
+
// var(--ion-color-light)
|
|
54
|
+
//);
|
|
55
|
+
ion-icon {
|
|
56
|
+
//--color: var(--ion-color-primary);
|
|
57
|
+
}
|
|
58
|
+
ion-label {
|
|
59
|
+
//--padding: var(--smart-button-padding-left) / 2
|
|
60
|
+
// var(--smart-button-padding-top) / 2 var(--smart-button-padding-right) /
|
|
61
|
+
// 2 var(--smart-button-padding-bottom) / 2;
|
|
62
|
+
}
|
|
63
|
+
.square-button {
|
|
64
|
+
//--padding-start: 0.2em;
|
|
65
|
+
//--padding-end: 0.2em;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
],
|
|
71
|
+
})
|
|
72
|
+
export class FilterRadioComponent<
|
|
73
|
+
T extends IEntity<string>,
|
|
74
|
+
> extends BaseComponent<T> {}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
|
+
|
|
5
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
6
|
+
|
|
7
|
+
import { BaseComponent } from '../base/base.component';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'smart-crud-filter-text',
|
|
11
|
+
template: `
|
|
12
|
+
<!-- <ion-row>-->
|
|
13
|
+
<!-- <ion-col>-->
|
|
14
|
+
<!-- <ion-label position="floating">-->
|
|
15
|
+
{{ item().label | translate }}
|
|
16
|
+
<!-- </ion-label>-->
|
|
17
|
+
<!-- <ion-input [(ngModel)]="value"></ion-input>-->
|
|
18
|
+
<!-- </ion-col>-->
|
|
19
|
+
@if (value) {
|
|
20
|
+
<!-- <ion-col size="auto">-->
|
|
21
|
+
<!-- <ion-button-->
|
|
22
|
+
<!-- color="danger"-->
|
|
23
|
+
<!-- (click)="refresh(null)"-->
|
|
24
|
+
<!-- class="square-button m-3"-->
|
|
25
|
+
<!-- >-->
|
|
26
|
+
<!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
|
|
27
|
+
<!-- </ion-button>-->
|
|
28
|
+
<!-- </ion-col>-->
|
|
29
|
+
}
|
|
30
|
+
<!-- </ion-row>-->
|
|
31
|
+
`,
|
|
32
|
+
imports: [TranslatePipe, FormsModule],
|
|
33
|
+
styles: [
|
|
34
|
+
`
|
|
35
|
+
:host {
|
|
36
|
+
width: 100%;
|
|
37
|
+
.square-button {
|
|
38
|
+
height: var(--smart-button-height) !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
export class FilterTextComponent<
|
|
45
|
+
T extends IEntity<string>,
|
|
46
|
+
> extends BaseComponent<T> {}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
ion-toolbar {
|
|
3
|
+
//--background: linear-gradient(
|
|
4
|
+
// 33deg,
|
|
5
|
+
// var(--ion-color-light),
|
|
6
|
+
// var(--ion-color-light-shade)
|
|
7
|
+
//);
|
|
8
|
+
//--color: var(--ion-color-dark);
|
|
9
|
+
ion-modal & {
|
|
10
|
+
//--background: linear-gradient(
|
|
11
|
+
// 33deg,
|
|
12
|
+
// var(--ion-color-light),
|
|
13
|
+
// var(--ion-color-light-shade)
|
|
14
|
+
//);
|
|
15
|
+
//--color: var(--ion-color-dark);
|
|
16
|
+
}
|
|
17
|
+
// @media (max-width: var(--smart-tablet-breakpoint)) {
|
|
18
|
+
@media only screen and (max-width: 992px) {
|
|
19
|
+
//--background: linear-gradient(
|
|
20
|
+
// 33deg,
|
|
21
|
+
// var(--ion-color-primary),
|
|
22
|
+
// var(--ion-color-tertiary)
|
|
23
|
+
//);
|
|
24
|
+
//--color: var(--ion-color-light);
|
|
25
|
+
ion-modal & {
|
|
26
|
+
//--background: linear-gradient(
|
|
27
|
+
// 33deg,
|
|
28
|
+
// var(--ion-color-light),
|
|
29
|
+
// var(--ion-color-light-shade)
|
|
30
|
+
//);
|
|
31
|
+
//color: var(--ion-color-dark);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// @media (max-width: var(--smart-phone-breakpoint)) {
|
|
35
|
+
@media only screen and (max-width: 420px) {
|
|
36
|
+
//--background: linear-gradient(
|
|
37
|
+
// 33deg,
|
|
38
|
+
// var(--ion-color-primary),
|
|
39
|
+
// var(--ion-color-tertiary)
|
|
40
|
+
//);
|
|
41
|
+
//--color: var(--ion-color-light);
|
|
42
|
+
ion-modal & {
|
|
43
|
+
//--background: linear-gradient(
|
|
44
|
+
// 33deg,
|
|
45
|
+
// var(--ion-color-light),
|
|
46
|
+
// var(--ion-color-light-shade)
|
|
47
|
+
//);
|
|
48
|
+
//color: var(--ion-color-dark);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// TODO: verify ios can exist on the component, if not remove
|
|
52
|
+
&.ios {
|
|
53
|
+
height: 4.6rem;
|
|
54
|
+
//--background: linear-gradient(
|
|
55
|
+
// 33deg,
|
|
56
|
+
// var(--ion-color-light),
|
|
57
|
+
// var(--ion-color-light-shade)
|
|
58
|
+
//);
|
|
59
|
+
//--color: var(--ion-color-dark);
|
|
60
|
+
// @media (max-width: var(--smart-tablet-breakpoint)) {
|
|
61
|
+
@media only screen and (max-width: 992px) {
|
|
62
|
+
//--background: linear-gradient(
|
|
63
|
+
// 33deg,
|
|
64
|
+
// var(--ion-color-primary),
|
|
65
|
+
// var(--ion-color-tertiary)
|
|
66
|
+
//);
|
|
67
|
+
//--color: var(--ion-color-light);
|
|
68
|
+
ion-title {
|
|
69
|
+
//text-align: left;
|
|
70
|
+
//padding-left: 5.2rem;
|
|
71
|
+
}
|
|
72
|
+
ion-icon {
|
|
73
|
+
//color: var(--ion-color-light);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// @media (max-width: var(--smart-phone-breakpoint)) {
|
|
77
|
+
@media only screen and (max-width: 420px) {
|
|
78
|
+
//--background: linear-gradient(
|
|
79
|
+
// 33deg,
|
|
80
|
+
// var(--ion-color-primary),
|
|
81
|
+
// var(--ion-color-tertiary)
|
|
82
|
+
//);
|
|
83
|
+
//--color: var(--ion-color-light);
|
|
84
|
+
ion-title {
|
|
85
|
+
//text-align: left;
|
|
86
|
+
//padding-left: 5.2rem;
|
|
87
|
+
}
|
|
88
|
+
ion-icon {
|
|
89
|
+
//color: var(--ion-color-light);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
.modal-wrapper & {
|
|
93
|
+
//--background: linear-gradient(
|
|
94
|
+
// 33deg,
|
|
95
|
+
// var(--ion-color-light),
|
|
96
|
+
// var(--ion-color-light-shade)
|
|
97
|
+
//);
|
|
98
|
+
//--color: var(--ion-color-dark);
|
|
99
|
+
// @media (max-width: var(--smart-tablet-breakpoint)) {
|
|
100
|
+
@media only screen and (max-width: 992px) {
|
|
101
|
+
//--background: linear-gradient(
|
|
102
|
+
// 33deg,
|
|
103
|
+
// var(--ion-color-light),
|
|
104
|
+
// var(--ion-color-light-shade)
|
|
105
|
+
//);
|
|
106
|
+
//color: var(--ion-color-dark);
|
|
107
|
+
ion-title {
|
|
108
|
+
//text-align: left;
|
|
109
|
+
//padding-left: 1.2rem;
|
|
110
|
+
}
|
|
111
|
+
ion-icon {
|
|
112
|
+
//color: var(--ion-color-dark);
|
|
113
|
+
}
|
|
114
|
+
ion-buttons {
|
|
115
|
+
//margin: 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// @media (max-width: var(--smart-phone-breakpoint)) {
|
|
119
|
+
@media only screen and (max-width: 420px) {
|
|
120
|
+
//--background: linear-gradient(
|
|
121
|
+
// 33deg,
|
|
122
|
+
// var(--ion-color-light),
|
|
123
|
+
// var(--ion-color-light-shade)
|
|
124
|
+
//);
|
|
125
|
+
//color: var(--ion-color-dark);
|
|
126
|
+
//ion-title {
|
|
127
|
+
// text-align: left;
|
|
128
|
+
// padding-left: 1.2rem;
|
|
129
|
+
//}
|
|
130
|
+
//ion-icon {
|
|
131
|
+
// color: var(--ion-color-dark);
|
|
132
|
+
//}
|
|
133
|
+
//ion-buttons {
|
|
134
|
+
// margin: 0;
|
|
135
|
+
//}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
ion-menu-button {
|
|
140
|
+
//color: var(--ion-color-light);
|
|
141
|
+
}
|
|
142
|
+
ion-buttons {
|
|
143
|
+
//height: var(--smart-button-height);
|
|
144
|
+
&.ios {
|
|
145
|
+
height: var(--smart-button-height);
|
|
146
|
+
margin: 0;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|