@smartsoft001/crud-shell-angular 2.76.0 → 2.80.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.
Files changed (75) hide show
  1. package/fesm2022/smartsoft001-crud-shell-angular.mjs +2840 -0
  2. package/fesm2022/smartsoft001-crud-shell-angular.mjs.map +1 -0
  3. package/index.d.ts +632 -0
  4. package/package.json +18 -3
  5. package/.storybook/addons.js +0 -1
  6. package/.storybook/config.js +0 -5
  7. package/.storybook/tsconfig.json +0 -8
  8. package/.storybook/webpack.config.js +0 -7
  9. package/jest.config.ts +0 -38
  10. package/ng-package.json +0 -7
  11. package/project.json +0 -49
  12. package/src/index.ts +0 -13
  13. package/src/lib/+state/crud.facade.ts +0 -82
  14. package/src/lib/+state/crud.methods.ts +0 -258
  15. package/src/lib/+state/crud.store.ts +0 -77
  16. package/src/lib/components/components.module.ts +0 -58
  17. package/src/lib/components/export/export.component.ts +0 -69
  18. package/src/lib/components/filter/base/base.component.ts +0 -175
  19. package/src/lib/components/filter/check/check.component.scss +0 -25
  20. package/src/lib/components/filter/check/check.component.ts +0 -72
  21. package/src/lib/components/filter/date/date.component.html +0 -30
  22. package/src/lib/components/filter/date/date.component.ts +0 -70
  23. package/src/lib/components/filter/date-time/date-time.component.html +0 -62
  24. package/src/lib/components/filter/date-time/date-time.component.ts +0 -56
  25. package/src/lib/components/filter/date-with-edit/date-with-edit.component.html +0 -109
  26. package/src/lib/components/filter/date-with-edit/date-with-edit.component.ts +0 -70
  27. package/src/lib/components/filter/filter.component.html +0 -52
  28. package/src/lib/components/filter/filter.component.ts +0 -34
  29. package/src/lib/components/filter/flag/flag.component.ts +0 -55
  30. package/src/lib/components/filter/index.ts +0 -9
  31. package/src/lib/components/filter/int/int.component.html +0 -74
  32. package/src/lib/components/filter/int/int.component.ts +0 -57
  33. package/src/lib/components/filter/radio/radio.component.ts +0 -74
  34. package/src/lib/components/filter/text/text.component.ts +0 -46
  35. package/src/lib/components/filters/filters.component.scss +0 -150
  36. package/src/lib/components/filters/filters.component.ts +0 -157
  37. package/src/lib/components/filters-config/filters-config.component.ts +0 -69
  38. package/src/lib/components/group/group.component.ts +0 -93
  39. package/src/lib/components/index.ts +0 -7
  40. package/src/lib/components/multiselect/multiselect.component.html +0 -41
  41. package/src/lib/components/multiselect/multiselect.component.scss +0 -125
  42. package/src/lib/components/multiselect/multiselect.component.ts +0 -104
  43. package/src/lib/crud-full.module.ts +0 -51
  44. package/src/lib/crud.config.ts +0 -79
  45. package/src/lib/crud.module.ts +0 -72
  46. package/src/lib/factories/list-pagination/list-pagination.factory.ts +0 -77
  47. package/src/lib/models/index.ts +0 -1
  48. package/src/lib/models/interfaces.ts +0 -34
  49. package/src/lib/pages/index.ts +0 -6
  50. package/src/lib/pages/item/base/base.component.ts +0 -54
  51. package/src/lib/pages/item/item.component.ts +0 -513
  52. package/src/lib/pages/item/standard/standard.component.scss +0 -0
  53. package/src/lib/pages/item/standard/standard.component.ts +0 -50
  54. package/src/lib/pages/list/base/base.component.ts +0 -29
  55. package/src/lib/pages/list/list.component.stories.ts +0 -77
  56. package/src/lib/pages/list/list.component.ts +0 -438
  57. package/src/lib/pages/list/standard/standard.component.ts +0 -42
  58. package/src/lib/pipes/form-options/form-options.pipe.ts +0 -61
  59. package/src/lib/pipes/index.ts +0 -2
  60. package/src/lib/pipes/pipes.module.ts +0 -9
  61. package/src/lib/providers/model-possibilities/model-possibilities.provider.ts +0 -19
  62. package/src/lib/services/crud/crud.service.spec.ts +0 -303
  63. package/src/lib/services/crud/crud.service.ts +0 -178
  64. package/src/lib/services/list-group/list-group.service.spec.ts +0 -87
  65. package/src/lib/services/list-group/list-group.service.ts +0 -65
  66. package/src/lib/services/page/page.service.spec.ts +0 -143
  67. package/src/lib/services/page/page.service.ts +0 -44
  68. package/src/lib/services/search/search.service.spec.ts +0 -134
  69. package/src/lib/services/search/search.service.ts +0 -42
  70. package/test-setup.ts +0 -0
  71. package/tsconfig.json +0 -13
  72. package/tsconfig.lib.json +0 -31
  73. package/tsconfig.lib.prod.json +0 -11
  74. package/tsconfig.spec.json +0 -10
  75. package/tslint.json +0 -10
@@ -1,175 +0,0 @@
1
- import {
2
- Directive,
3
- inject,
4
- input,
5
- InputSignal,
6
- OnInit,
7
- Signal,
8
- } from '@angular/core';
9
- import { TranslateService } from '@ngx-translate/core';
10
- import { Debounce } from 'lodash-decorators';
11
-
12
- import { IEntity } from '@smartsoft001/domain-core';
13
- import { FieldType, IModelFilter } from '@smartsoft001/models';
14
-
15
- import { CrudFacade } from '../../../+state/crud.facade';
16
- import { ICrudFilter } from '../../../models';
17
-
18
- @Directive()
19
- export class BaseComponent<T extends IEntity<string>> implements OnInit {
20
- protected facade = inject(CrudFacade<T>);
21
- protected translateService = inject(TranslateService);
22
-
23
- possibilities: Signal<{ id: any; text: string }[]>;
24
-
25
- readonly item: InputSignal<IModelFilter> = input<IModelFilter>();
26
- readonly filter: InputSignal<ICrudFilter> = input<ICrudFilter>();
27
-
28
- get value(): any {
29
- if (this.isArrayType()) {
30
- return this.filter()
31
- .query.filter(
32
- (q) => q.key === this.item().key && q.type === this.item().type,
33
- )
34
- .map((q) => q.value);
35
- }
36
-
37
- const query = this.filter().query.find(
38
- (q) => q.key === this.item().key && q.type === this.item().type,
39
- );
40
- return query?.value;
41
- }
42
-
43
- set value(val: any) {
44
- this.refresh(val);
45
- }
46
-
47
- get minValue(): any {
48
- if (this.isArrayType()) {
49
- return this.filter()
50
- .query.filter((q) => q.key === this.item().key && q.type === '>=')
51
- .map((q) => q.value);
52
- }
53
-
54
- const query = this.filter().query.find(
55
- (q) => q.key === this.item().key && q.type === '>=',
56
- );
57
- return query?.value;
58
- }
59
-
60
- set minValue(val: any) {
61
- this.refresh(val, '>=');
62
- }
63
-
64
- get maxValue(): any {
65
- if (this.isArrayType()) {
66
- return this.filter()
67
- .query.filter((q) => q.key === this.item().key && q.type === '<=')
68
- .map((q) => q.value);
69
- }
70
-
71
- const query = this.filter().query.find(
72
- (q) => q.key === this.item().key && q.type === '<=',
73
- );
74
- return query?.value;
75
- }
76
-
77
- set maxValue(val: any) {
78
- this.refresh(val, '<=');
79
- }
80
-
81
- get lang(): string {
82
- return this.translateService.currentLang;
83
- }
84
-
85
- @Debounce(500)
86
- refresh(val: any, type = null): void {
87
- if (!type) type = this.item().type;
88
-
89
- this.filter().offset = 0;
90
-
91
- if (this.isArrayType()) {
92
- this.refreshForArray(val as [], type);
93
- return;
94
- }
95
-
96
- let query = this.filter().query.find(
97
- (q) => q.key === this.item().key && q.type === type,
98
- );
99
-
100
- if (val === null || val === undefined || val === '') {
101
- const index = this.filter().query.indexOf(query);
102
- if (index > -1) {
103
- this.filter().query.splice(index, 1);
104
- }
105
-
106
- this.facade.read(this.filter());
107
- return;
108
- }
109
-
110
- if (!query) {
111
- query = {
112
- key: this.item().key,
113
- type: type,
114
- value: null,
115
- };
116
-
117
- this.filter().query.push(query);
118
- }
119
-
120
- query.value = val;
121
- query.label = this.item().label;
122
-
123
- this.facade.read(this.filter());
124
- }
125
-
126
- clear(): void {
127
- this.filter().query = this.filter().query.filter(
128
- (q) => q.key !== this.item().key,
129
- );
130
- this.filter().offset = 0;
131
- this.facade.read(this.filter());
132
- }
133
-
134
- ngOnInit(): void {
135
- this.initPossibilities();
136
- }
137
-
138
- private initPossibilities(): void {
139
- this.possibilities = this.item().possibilities;
140
- }
141
-
142
- private isArrayType(): boolean {
143
- return this.item()?.fieldType === FieldType.check;
144
- }
145
-
146
- private refreshForArray(vals: [], type): void {
147
- const queries = this.filter().query.filter(
148
- (q) => q.key === this.item().key && q.type === type,
149
- );
150
-
151
- queries.forEach((query) => {
152
- const index = this.filter().query.indexOf(query);
153
- if (index > -1) {
154
- this.filter().query.splice(index, 1);
155
- }
156
- });
157
-
158
- if (vals === null || vals === undefined || !vals.length) {
159
- this.facade.read(this.filter());
160
- return;
161
- }
162
-
163
- vals.forEach((val) => {
164
- const query = {
165
- key: this.item().key,
166
- type: type,
167
- value: val,
168
- };
169
-
170
- this.filter().query.push(query);
171
- });
172
-
173
- this.facade.read(this.filter());
174
- }
175
- }
@@ -1,25 +0,0 @@
1
- :host {
2
- width: 100%;
3
- margin-bottom: 1.2rem;
4
-
5
- ion-item-divider {
6
- //--padding-end: 0.8rem;
7
- //--ion-background-color: linear-gradient(
8
- // 90deg,
9
- // transparent,
10
- // var(--ion-color-light)
11
- //);
12
- ion-icon {
13
- //--color: var(--ion-color-primary);
14
- }
15
- ion-label {
16
- //--padding: var(--smart-button-padding-left) / 2
17
- // var(--smart-button-padding-top) / 2 var(--smart-button-padding-right) /
18
- // 2 var(--smart-button-padding-bottom) / 2;
19
- }
20
- .square-button {
21
- //--padding-start: 0.2em;
22
- //--padding-end: 0.2em;
23
- }
24
- }
25
- }
@@ -1,72 +0,0 @@
1
- import { AfterContentInit, Component, computed, Signal } from '@angular/core';
2
- import { TranslatePipe } from '@ngx-translate/core';
3
-
4
- import { IEntity } from '@smartsoft001/domain-core';
5
-
6
- import { BaseComponent } from '../base/base.component';
7
-
8
- @Component({
9
- selector: 'smart-crud-filter-check',
10
- template: `
11
- <!-- <ion-row>-->
12
- <!-- <ion-col>-->
13
- <!-- <ion-item-divider class="text-xl font-light">-->
14
- <!-- <ion-icon class="mr-6 text-2xl" slot="start" name="filter-outline"></ion-icon>-->
15
- <!-- <ion-label>-->
16
- {{ item().label | translate }}
17
- <!-- </ion-label>-->
18
- @if (value?.length) {
19
- <!-- <ion-button-->
20
- <!-- slot="end"-->
21
- <!-- color="danger"-->
22
- <!-- (click)="refresh([])"-->
23
- <!-- class="square-button m-0 p-0 text-lg h-9 w-9"-->
24
- <!-- >-->
25
- <!-- <ion-icon class="text-2xl m-0 p-0" slot="icon-only" name="close-outline"></ion-icon>-->
26
- <!-- </ion-button>-->
27
- }
28
- <!-- </ion-item-divider>-->
29
-
30
- @for (entry of list(); track entry) {
31
- <!-- <ion-item>-->
32
- <!--<ion-label>-->{{ entry.value.text | translate
33
- }}<!--</ion-label>-->
34
- <!-- <ion-checkbox-->
35
- <!-- slot="end"-->
36
- <!-- [checked]="entry.isCheck"-->
37
- <!-- (ionChange)="onCheckChange($event.detail.checked, entry)"-->
38
- <!-- ></ion-checkbox>-->
39
- <!-- </ion-item>-->
40
- }
41
- <!-- </ion-col>-->
42
- <!-- </ion-row>-->
43
- `,
44
- imports: [TranslatePipe],
45
- styleUrls: ['./check.component.scss'],
46
- })
47
- export class FilterCheckComponent<T extends IEntity<string>>
48
- extends BaseComponent<T>
49
- implements AfterContentInit
50
- {
51
- list: Signal<{ value: any; isCheck: boolean }[]>;
52
-
53
- ngAfterContentInit(): void {
54
- this.list = computed(() => {
55
- const possibilities = this.possibilities();
56
- return possibilities.map((pos) => ({
57
- value: pos,
58
- isCheck: this.value.some((r) => r === pos.id),
59
- }));
60
- });
61
- }
62
-
63
- onCheckChange(checked: boolean, entry: { value: any; isCheck: boolean }) {
64
- if (checked && !this.value.some((r) => r === entry.value.id)) {
65
- this.value = [...this.value, entry.value.id];
66
- }
67
-
68
- if (!checked && this.value.some((r) => r === entry.value.id)) {
69
- this.value = this.value.filter((r) => r !== entry.value.id);
70
- }
71
- }
72
- }
@@ -1,30 +0,0 @@
1
- <!--<ion-row>-->
2
- <!-- <ion-col>-->
3
- <!-- <ion-label>-->
4
- {{ item().label | translate }}
5
- <!-- </ion-label>-->
6
- <!-- <ion-item button="true" id="open-date-input-{{ id }}" color="primary">-->
7
- <!-- <ion-text>-->
8
- {{ customValue ? customValue : ('select' | translate) }}
9
- <!-- </ion-text>-->
10
- <!-- <ion-popover trigger="open-date-input-{{ id }}" show-backdrop="false">-->
11
- <ng-template>
12
- <!-- <ion-datetime-->
13
- <!-- displayFormat="YYYY-MM-DD"-->
14
- <!-- pickerFormat="YYYY-MM-DD"-->
15
- <!-- [(ngModel)]="customValue"-->
16
- <!-- presentation="date"-->
17
- <!-- ></ion-datetime>-->
18
- </ng-template>
19
- <!-- </ion-popover>-->
20
- <!-- </ion-item>-->
21
- <!-- </ion-col>-->
22
-
23
- @if (value) {
24
- <!-- <ion-col size="auto">-->
25
- <!-- <ion-button color="danger" (click)="refresh(null)" class="square-button m-3">-->
26
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
27
- <!-- </ion-button>-->
28
- <!-- </ion-col>-->
29
- }
30
- <!--</ion-row>-->
@@ -1,70 +0,0 @@
1
- import { Component } from '@angular/core';
2
- import { FormsModule } from '@angular/forms';
3
- import { TranslatePipe } from '@ngx-translate/core';
4
- import moment from 'moment';
5
-
6
- import { IEntity } from '@smartsoft001/domain-core';
7
- import { GuidService } from '@smartsoft001/utils';
8
-
9
- import { BaseComponent } from '../base/base.component';
10
-
11
- @Component({
12
- selector: 'smart-crud-filter-date',
13
- templateUrl: './date.component.html',
14
- imports: [FormsModule, TranslatePipe],
15
- styles: [
16
- `
17
- :host {
18
- width: 100%;
19
- .square-button {
20
- height: var(--smart-button-height) !important;
21
- }
22
- }
23
- `,
24
- ],
25
- })
26
- export class FilterDateComponent<
27
- T extends IEntity<string>,
28
- > extends BaseComponent<T> {
29
- id = GuidService.create();
30
-
31
- get allowAdvanced(): boolean {
32
- return this.item()?.type === '=';
33
- }
34
-
35
- set customValue(val) {
36
- const momentDate = moment(val);
37
- this.value =
38
- (val as string)?.length >= 10 && momentDate.isValid()
39
- ? momentDate.format('YYYY-MM-DD')
40
- : val;
41
- }
42
-
43
- get customValue(): any {
44
- return this.value;
45
- }
46
-
47
- set customMinValue(val) {
48
- const momentDate = moment(val);
49
- this.minValue =
50
- (val as string)?.length >= 10 && momentDate.isValid()
51
- ? momentDate.format('YYYY-MM-DD')
52
- : val;
53
- }
54
-
55
- get customMinValue(): any {
56
- return this.minValue;
57
- }
58
-
59
- set customMaxValue(val) {
60
- const momentDate = moment(val);
61
- this.maxValue =
62
- (val as string)?.length >= 10 && momentDate.isValid()
63
- ? momentDate.format('YYYY-MM-DD')
64
- : val;
65
- }
66
-
67
- get customMaxValue(): any {
68
- return this.maxValue;
69
- }
70
- }
@@ -1,62 +0,0 @@
1
- <!--<ion-row>-->
2
- <!-- <ion-col>-->
3
- <!-- <ion-label>-->
4
- {{ item().label | translate }}
5
- <!-- </ion-label>-->
6
- <!-- </ion-col>-->
7
- @if (value || minValue || maxValue) {
8
- <!-- <ion-col size="auto">-->
9
- <!-- <ion-button color="danger" (click)="clear()" class="square-button m-3">-->
10
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
11
- <!-- </ion-button>-->
12
- <!-- </ion-col>-->
13
- }
14
- <!--</ion-row>-->
15
- <!--<ion-row>-->
16
- <!-- <ion-col>-->
17
- <!-- <ion-item>-->
18
- <!-- <ion-label>-->
19
- {{ 'from' | translate }}
20
- <!-- </ion-label>-->
21
- <!-- <ion-input-->
22
- <!-- placeholder="YYYY-MM-DD HH:mm:ss"-->
23
- <!-- [(ngModel)]="customMinValue"-->
24
- <!-- pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$"-->
25
- <!-- ></ion-input>-->
26
- <!-- </ion-item>-->
27
- <!-- </ion-col>-->
28
- @if (customMinValue) {
29
- <!-- <ion-col size="auto">-->
30
- <!-- <ion-button-->
31
- <!-- color="danger"-->
32
- <!-- (click)="refresh(null, '>=')"-->
33
- <!-- class="square-button m-3"-->
34
- <!-- >-->
35
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
36
- <!-- </ion-button>-->
37
- <!-- </ion-col>-->
38
- }
39
- <!-- <ion-col>-->
40
- <!-- <ion-item>-->
41
- <!-- <ion-label>-->
42
- {{ 'to' | translate }}
43
- <!-- </ion-label>-->
44
- <!-- <ion-input-->
45
- <!-- placeholder="YYYY-MM-DD HH:mm:ss"-->
46
- <!-- [(ngModel)]="customMaxValue"-->
47
- <!-- pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$"-->
48
- <!-- ></ion-input>-->
49
- <!-- </ion-item>-->
50
- <!-- </ion-col>-->
51
- @if (customMaxValue) {
52
- <!-- <ion-col size="auto">-->
53
- <!-- <ion-button-->
54
- <!-- color="danger"-->
55
- <!-- (click)="refresh(null, '<=')"-->
56
- <!-- class="square-button m-3"-->
57
- <!-- >-->
58
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
59
- <!-- </ion-button>-->
60
- <!-- </ion-col>-->
61
- }
62
- <!--</ion-row>-->
@@ -1,56 +0,0 @@
1
- import { Component, OnDestroy, OnInit } from '@angular/core';
2
- import { FormsModule } from '@angular/forms';
3
- import { TranslatePipe } from '@ngx-translate/core';
4
- import { Subscription } from 'rxjs';
5
-
6
- import { IEntity } from '@smartsoft001/domain-core';
7
- import { GuidService } from '@smartsoft001/utils';
8
-
9
- import { FilterDateComponent } from '../date/date.component';
10
-
11
- @Component({
12
- selector: 'smart-crud-filter-date-time',
13
- templateUrl: './date-time.component.html',
14
- imports: [TranslatePipe, FormsModule],
15
- styles: [
16
- `
17
- :host {
18
- width: 100%;
19
- .square-button {
20
- height: var(--smart-button-height) !important;
21
- }
22
- }
23
- `,
24
- ],
25
- })
26
- export class FilterDateTimeComponent<T extends IEntity<string>>
27
- extends FilterDateComponent<T>
28
- implements OnInit, OnDestroy
29
- {
30
- private _subscriptions = new Subscription();
31
-
32
- id = GuidService.create();
33
-
34
- // @ViewChild(IonDatetime, { read: IonDatetime, static: false })
35
- // dateTimePicker: IonDatetime;
36
-
37
- ngOnInit(): void {
38
- super.ngOnInit();
39
-
40
- // if (this.dateTimePicker) {
41
- // this._subscriptions.add(
42
- // this.dateTimePicker.ionChange.subscribe((val: CustomEvent) => {
43
- // this.customValue = val.detail.value;
44
- // }),
45
- // );
46
- // } else {
47
- // console.error('dateTimePicker not found!');
48
- // }
49
- }
50
-
51
- ngOnDestroy(): void {
52
- if (this._subscriptions) {
53
- this._subscriptions.unsubscribe();
54
- }
55
- }
56
- }
@@ -1,109 +0,0 @@
1
- <!--<ion-row>-->
2
- <!-- <ion-col>-->
3
- <!-- <ion-label>-->
4
- {{ item().label | translate }}
5
- <!-- </ion-label>-->
6
-
7
- @if (!advanced()) {
8
- <!-- <ion-input-->
9
- <!-- placeholder="YYYY-MM-DD"-->
10
- <!-- [(ngModel)]="customValue"-->
11
- <!-- [pattern]="'([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))'"-->
12
- <!-- ></ion-input>-->
13
- }
14
- <!-- </ion-col>-->
15
-
16
- @if (!advanced()) {
17
- <!-- <ion-col size="auto">-->
18
- <!-- <ion-button id="open-date-input-{{ id }}" class="square-button m-3">-->
19
- <!-- <ion-icon slot="icon-only" name="calendar-outline"></ion-icon>-->
20
- <!-- <ion-popover trigger="open-date-input-{{ id }}" show-backdrop="false">-->
21
- <ng-template>
22
- <!-- <ion-datetime-->
23
- <!-- displayFormat="YYYY-MM-DD"-->
24
- <!-- pickerFormat="YYYY-MM-DD"-->
25
- <!-- [(ngModel)]="customValue"-->
26
- <!-- presentation="date"-->
27
- <!-- first-day-of-week="1"-->
28
- <!-- locale="{{ lang }}"-->
29
- <!-- ></ion-datetime>-->
30
- </ng-template>
31
- <!-- </ion-popover>-->
32
- <!-- </ion-button>-->
33
- <!-- </ion-col>-->
34
- }
35
- @if (allowAdvanced) {
36
- <!-- <ion-col size="auto">-->
37
- <!-- <ion-button-->
38
- <!-- (click)="toggleAdvanced()"-->
39
- <!-- class="square-button m-3"-->
40
- <!-- [disabled]="minValue || maxValue"-->
41
- <!-- >-->
42
- @if (!advanced()) {
43
- <!-- <ion-icon slot="icon-only" name="settings-outline"></ion-icon>-->
44
- } @else {
45
- <!-- <ion-icon slot="icon-only" name="settings"></ion-icon>-->
46
- }
47
- <!-- </ion-button>-->
48
- <!-- </ion-col>-->
49
- }
50
- @if (value || minValue || maxValue) {
51
- <!-- <ion-col size="auto">-->
52
- <!-- <ion-button color="danger" (click)="clear()" class="square-button m-3">-->
53
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
54
- <!-- </ion-button>-->
55
- <!-- </ion-col>-->
56
- }
57
- <!--</ion-row>-->
58
-
59
- @if ((advanced() || minValue || maxValue) && allowAdvanced) {
60
- <!-- <ion-row>-->
61
- <!-- <ion-col>-->
62
- <!-- <ion-item>-->
63
- <!-- <ion-label>-->
64
- {{ 'from' | translate }}
65
- <!-- </ion-label>-->
66
- <!-- <ion-input-->
67
- <!-- placeholder="YYYY-MM-DD"-->
68
- <!-- [(ngModel)]="customMinValue"-->
69
- <!-- [pattern]="'([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))'"-->
70
- <!-- ></ion-input>-->
71
- <!-- </ion-item>-->
72
- <!-- </ion-col>-->
73
- @if (customMinValue) {
74
- <!-- <ion-col size="auto">-->
75
- <!-- <ion-button-->
76
- <!-- color="danger"-->
77
- <!-- (click)="refresh(null, '>=')"-->
78
- <!-- class="square-button m-3"-->
79
- <!-- >-->
80
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
81
- <!-- </ion-button>-->
82
- <!-- </ion-col>-->
83
- }
84
- <!-- <ion-col>-->
85
- <!-- <ion-item>-->
86
- <!-- <ion-label>-->
87
- {{ 'to' | translate }}
88
- <!-- </ion-label>-->
89
- <!-- <ion-input-->
90
- <!-- placeholder="YYYY-MM-DD"-->
91
- <!-- [(ngModel)]="customMaxValue"-->
92
- <!-- [pattern]="'([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))'"-->
93
- <!-- ></ion-input>-->
94
- <!-- </ion-item>-->
95
- <!-- </ion-col>-->
96
-
97
- @if (customMaxValue) {
98
- <!-- <ion-col size="auto">-->
99
- <!-- <ion-button-->
100
- <!-- color="danger"-->
101
- <!-- (click)="refresh(null, '<=')"-->
102
- <!-- class="square-button m-3"-->
103
- <!-- >-->
104
- <!-- <ion-icon slot="icon-only" name="close-outline"></ion-icon>-->
105
- <!-- </ion-button>-->
106
- <!-- </ion-col>-->
107
- }
108
- <!-- </ion-row>-->
109
- }
@@ -1,70 +0,0 @@
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
- }