geonetwork-ui 2.4.0-dev.a9a61288 → 2.4.0-dev.ac57b75b
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/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +7 -6
- package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +6 -3
- package/fesm2022/geonetwork-ui.mjs +11 -7
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +3 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +3 -2
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +8 -7
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +3 -1
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts +6 -2
|
@@ -21,7 +21,9 @@ export declare class FormFieldTemporalExtentsComponent implements OnInit, OnDest
|
|
|
21
21
|
}]>;
|
|
22
22
|
constructor(translateService: TranslateService);
|
|
23
23
|
ngOnInit(): void;
|
|
24
|
-
onElementsChange(elements:
|
|
24
|
+
onElementsChange(elements: {
|
|
25
|
+
inputs: Record<string, unknown>;
|
|
26
|
+
}[]): void;
|
|
25
27
|
onAdd(eventName: string): void;
|
|
26
28
|
ngOnDestroy(): void;
|
|
27
29
|
private resetValueFromInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-temporal-extents.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,MAAM,EACN,IAAI,EACL,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAsB,MAAM,MAAM,CAAA;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;;AAGtD,qBAQa,iCAAkC,YAAW,MAAM,EAAE,SAAS;IAoB7D,OAAO,CAAC,gBAAgB;IAnB3B,OAAO,EAAG,WAAW,CAAA;IAE9B,YAAY,EAAE,YAAY,CAAA;IAE1B,KAAK,EAAE,SAAS,CAAoB;IACpC,QAAQ,EAAE,KAAK,CAAC;QACd,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC5B,CAAC,CAAA;IAEF,WAAW;;;;;;QAOT;gBAEkB,gBAAgB,EAAE,gBAAgB;IAEtD,QAAQ;IAkBR,gBAAgB,CAAC,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"form-field-temporal-extents.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,MAAM,EACN,IAAI,EACL,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,YAAY,EAAsB,MAAM,MAAM,CAAA;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;;AAGtD,qBAQa,iCAAkC,YAAW,MAAM,EAAE,SAAS;IAoB7D,OAAO,CAAC,gBAAgB;IAnB3B,OAAO,EAAG,WAAW,CAAA;IAE9B,YAAY,EAAE,YAAY,CAAA;IAE1B,KAAK,EAAE,SAAS,CAAoB;IACpC,QAAQ,EAAE,KAAK,CAAC;QACd,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC5B,CAAC,CAAA;IAEF,WAAW;;;;;;QAOT;gBAEkB,gBAAgB,EAAE,gBAAgB;IAEtD,QAAQ;IAkBR,gBAAgB,CAAC,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE;IAShE,KAAK,CAAC,SAAS,EAAE,MAAM;IAkBvB,WAAW,IAAI,IAAI;IAInB,OAAO,CAAC,mBAAmB;yCAvEhB,iCAAiC;2CAAjC,iCAAiC;CA0G7C"}
|
|
@@ -2,8 +2,8 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
|
2
2
|
import { EventEmitter, Type } from '@angular/core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
type DynamicElement = {
|
|
5
|
-
component: Type<
|
|
6
|
-
inputs: Record<string,
|
|
5
|
+
component: Type<unknown>;
|
|
6
|
+
inputs: Record<string, unknown>;
|
|
7
7
|
};
|
|
8
8
|
export declare class SortableListComponent {
|
|
9
9
|
elements: Array<DynamicElement>;
|
|
@@ -15,6 +15,7 @@ export declare class SortableListComponent {
|
|
|
15
15
|
add: EventEmitter<string>;
|
|
16
16
|
drop(event: CdkDragDrop<string[]>): void;
|
|
17
17
|
removeElement(index: number): void;
|
|
18
|
+
trackByFn(index: number): number;
|
|
18
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<SortableListComponent, never>;
|
|
19
20
|
static ɵcmp: i0.ɵɵComponentDeclaration<SortableListComponent, "gn-ui-sortable-list", never, { "elements": { "alias": "elements"; "required": false; }; "addOptions": { "alias": "addOptions"; "required": false; }; }, { "elementsChange": "elementsChange"; "add": "add"; }, never, never, true, never>;
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable-list.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAIZ,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAGL,YAAY,EAGZ,IAAI,EACL,MAAM,eAAe,CAAA;;AAItB,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"sortable-list.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAIZ,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAGL,YAAY,EAGZ,IAAI,EACL,MAAM,eAAe,CAAA;;AAItB,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC,CAAA;AAED,qBAgBa,qBAAqB;IACvB,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,CAAA;IAC/B,UAAU,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5D,cAAc,iCAA4C;IAC1D,GAAG,uBAA6B;IAE1C,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAKjC,aAAa,CAAC,KAAK,EAAE,MAAM;IAK3B,SAAS,CAAC,KAAK,EAAE,MAAM;yCAhBZ,qBAAqB;2CAArB,qBAAqB;CAmBjC"}
|
package/package.json
CHANGED
|
@@ -62,9 +62,9 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
onElementsChange(elements:
|
|
65
|
+
onElementsChange(elements: { inputs: Record<string, unknown> }[]) {
|
|
66
66
|
this.array.clear({ emitEvent: false })
|
|
67
|
-
elements.forEach((e
|
|
67
|
+
elements.forEach((e, i) =>
|
|
68
68
|
this.array.push(e.inputs.control, {
|
|
69
69
|
emitEvent: i === elements.length - 1,
|
|
70
70
|
})
|
|
@@ -95,7 +95,7 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
95
95
|
|
|
96
96
|
private resetValueFromInput(value) {
|
|
97
97
|
this.array.clear({ emitEvent: false })
|
|
98
|
-
|
|
98
|
+
let newElements = []
|
|
99
99
|
value.forEach((v: any) => {
|
|
100
100
|
if ('start' in v && 'end' in v) {
|
|
101
101
|
const rangeControl = new FormControl({
|
|
@@ -103,8 +103,8 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
103
103
|
end: v.end,
|
|
104
104
|
})
|
|
105
105
|
this.array.push(rangeControl, { emitEvent: false })
|
|
106
|
-
|
|
107
|
-
...
|
|
106
|
+
newElements = [
|
|
107
|
+
...newElements,
|
|
108
108
|
{
|
|
109
109
|
component: FormFieldTemporalExtentsRangeComponent,
|
|
110
110
|
inputs: {
|
|
@@ -115,8 +115,8 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
115
115
|
} else {
|
|
116
116
|
const dateControl = new FormControl({ start: v.start })
|
|
117
117
|
this.array.push(dateControl, { emitEvent: false })
|
|
118
|
-
|
|
119
|
-
...
|
|
118
|
+
newElements = [
|
|
119
|
+
...newElements,
|
|
120
120
|
{
|
|
121
121
|
component: FormFieldTemporalExtentsDateComponent,
|
|
122
122
|
inputs: {
|
|
@@ -126,5 +126,6 @@ export class FormFieldTemporalExtentsComponent implements OnInit, OnDestroy {
|
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
})
|
|
129
|
+
this.elements = newElements
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
class="sortable-list flex flex-col gap-3 p-2"
|
|
13
13
|
(cdkDropListDropped)="drop($event)"
|
|
14
14
|
>
|
|
15
|
-
<ng-container
|
|
15
|
+
<ng-container
|
|
16
|
+
*ngFor="let element of elements; index as index; trackBy: trackByFn"
|
|
17
|
+
>
|
|
16
18
|
<div class="sortable-box bg-white flex items-center" cdkDrag>
|
|
17
19
|
<span
|
|
18
20
|
cdkDragHandle
|
|
@@ -18,8 +18,8 @@ import { MatIconModule } from '@angular/material/icon'
|
|
|
18
18
|
import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
|
|
19
19
|
|
|
20
20
|
type DynamicElement = {
|
|
21
|
-
component: Type<
|
|
22
|
-
inputs: Record<string,
|
|
21
|
+
component: Type<unknown>
|
|
22
|
+
inputs: Record<string, unknown>
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@Component({
|
|
@@ -53,4 +53,8 @@ export class SortableListComponent {
|
|
|
53
53
|
this.elements = this.elements.filter((_, i) => i !== index)
|
|
54
54
|
this.elementsChange.emit(this.elements)
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
trackByFn(index: number) {
|
|
58
|
+
return index
|
|
59
|
+
}
|
|
56
60
|
}
|