geonetwork-ui 2.3.0-dev.6083baae → 2.3.0-dev.a288b23a
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-rich/form-field-rich.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +24 -10
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -13
- package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +3 -3
- package/fesm2022/geonetwork-ui.mjs +21 -20
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +4 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/record-form.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-rich/form-field-rich.component.css +0 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +24 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +19 -4
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +2 -21
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.css +0 -5
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +1 -1
- package/tailwind.base.css +7 -0
package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
1
2
|
import { FormControl } from '@angular/forms';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import { FormFieldConfig } from './form-field.model';
|
|
@@ -7,8 +8,10 @@ export declare class FormFieldComponent {
|
|
|
7
8
|
config: FormFieldConfig;
|
|
8
9
|
set value(v: unknown);
|
|
9
10
|
valueChange: Observable<unknown>;
|
|
11
|
+
titleInput: ElementRef;
|
|
10
12
|
formControl: FormControl<any>;
|
|
11
13
|
constructor();
|
|
14
|
+
focusTitleInput(): void;
|
|
12
15
|
get simpleType(): "number" | "text" | "url" | "toggle" | "date" | "list";
|
|
13
16
|
get isSimpleField(): boolean;
|
|
14
17
|
get isFileField(): boolean;
|
|
@@ -19,6 +22,7 @@ export declare class FormFieldComponent {
|
|
|
19
22
|
get isFieldOk(): boolean;
|
|
20
23
|
get isFieldLocked(): boolean;
|
|
21
24
|
get isFieldInvalid(): boolean;
|
|
25
|
+
get isTitle(): boolean;
|
|
22
26
|
get isAbstract(): boolean;
|
|
23
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
24
28
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "gn-ui-form-field", never, { "model": { "alias": "model"; "required": false; }; "config": { "alias": "config"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.component.d.ts","sourceRoot":"","sources":["../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-field.component.d.ts","sourceRoot":"","sources":["../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,UAAU,EAIX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,WAAW,EAAuB,MAAM,gBAAgB,CAAA;AAKjE,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAQjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;;AAEpD,qBAsBa,kBAAkB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,eAAe,CAAA;IAChC,IAAa,KAAK,CAAC,CAAC,EAAE,OAAO,EAI5B;IACS,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,CAAA;IAEjB,UAAU,EAAE,UAAU,CAAA;IAE/C,WAAW,mBAAoB;;IAM/B,eAAe;IAIf,IAAI,UAAU,2DAQb;IAED,IAAI,aAAa,YAShB;IACD,IAAI,WAAW,YAEd;IACD,IAAI,oBAAoB,YAEvB;IACD,IAAI,qBAAqB,YAExB;IACD,IAAI,YAAY,YAEf;IACD,IAAI,aAAa,YAEhB;IAED,IAAI,SAAS,YAEZ;IACD,IAAI,aAAa,YAEhB;IACD,IAAI,cAAc,YAEjB;IAED,IAAI,OAAO,YAEV;IACD,IAAI,UAAU,YAEb;yCAzEU,kBAAkB;2CAAlB,kBAAkB;CA0E9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-form.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;
|
|
1
|
+
{"version":3,"file":"record-form.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;AAG9E,qBAQa,mBAAmB;IAGX,MAAM,EAAE,YAAY;IAFvC,OAAO;;;SAA4B;gBAEhB,MAAM,EAAE,YAAY;IAEvC,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB;IAO1E,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB;yCAZxC,mBAAmB;2CAAnB,mBAAmB;CAe/B"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[extraClass]="getButtonExtraClass()"
|
|
5
5
|
(buttonClick)="togglePreview()"
|
|
6
6
|
>
|
|
7
|
-
<span class="material-symbols-outlined mr-1 icon-small">{{
|
|
7
|
+
<span class="material-symbols-outlined mr-1 gn-ui-icon-small">{{
|
|
8
8
|
preview ? 'visibility' : 'visibility_off'
|
|
9
9
|
}}</span>
|
|
10
10
|
{{ preview ? 'WYSIWYG' : 'Markdown' }}
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -24,6 +24,30 @@
|
|
|
24
24
|
>cancel</mat-icon
|
|
25
25
|
>
|
|
26
26
|
</div>
|
|
27
|
+
<ng-container *ngIf="isTitle">
|
|
28
|
+
<div class="flex justify-between items-center gap-3">
|
|
29
|
+
<h2
|
|
30
|
+
#titleInput
|
|
31
|
+
class="grow text-3xl font-normal"
|
|
32
|
+
[gnUiEditableLabel]="true"
|
|
33
|
+
(editableLabelChanged)="formControl.setValue($event)"
|
|
34
|
+
>
|
|
35
|
+
{{ formControl.value }}
|
|
36
|
+
</h2>
|
|
37
|
+
<span
|
|
38
|
+
class="material-symbols-outlined gn-ui-icon-small m-2 cursor-pointer"
|
|
39
|
+
(click)="focusTitleInput()"
|
|
40
|
+
>edit</span
|
|
41
|
+
>
|
|
42
|
+
<span
|
|
43
|
+
class="material-symbols-outlined gn-ui-icon-small m-2"
|
|
44
|
+
[matTooltip]="config.hintKey | translate"
|
|
45
|
+
matTooltipPosition="above"
|
|
46
|
+
>
|
|
47
|
+
help
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
</ng-container>
|
|
27
51
|
<ng-container *ngIf="isSimpleField">
|
|
28
52
|
<gn-ui-form-field-simple
|
|
29
53
|
[type]="simpleType"
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
1
2
|
import {
|
|
2
3
|
ChangeDetectionStrategy,
|
|
3
4
|
Component,
|
|
5
|
+
ElementRef,
|
|
4
6
|
Input,
|
|
5
7
|
Output,
|
|
8
|
+
ViewChild,
|
|
6
9
|
} from '@angular/core'
|
|
7
10
|
import { FormControl, ReactiveFormsModule } from '@angular/forms'
|
|
8
11
|
import { MatIconModule } from '@angular/material/icon'
|
|
12
|
+
import { MatTooltipModule } from '@angular/material/tooltip'
|
|
13
|
+
import { EditableLabelDirective } from '../../../../../../../../libs/ui/inputs/src'
|
|
9
14
|
import { TranslateModule } from '@ngx-translate/core'
|
|
10
15
|
import { Observable } from 'rxjs'
|
|
11
16
|
import { FormFieldArrayComponent } from './form-field-array/form-field-array.component'
|
|
@@ -16,7 +21,6 @@ import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.
|
|
|
16
21
|
import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
|
|
17
22
|
import { FormFieldTemporalExtentComponent } from './form-field-temporal-extent/form-field-temporal-extent.component'
|
|
18
23
|
import { FormFieldConfig } from './form-field.model'
|
|
19
|
-
import { CommonModule } from '@angular/common'
|
|
20
24
|
|
|
21
25
|
@Component({
|
|
22
26
|
selector: 'gn-ui-form-field',
|
|
@@ -25,6 +29,11 @@ import { CommonModule } from '@angular/common'
|
|
|
25
29
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
30
|
standalone: true,
|
|
27
31
|
imports: [
|
|
32
|
+
CommonModule,
|
|
33
|
+
ReactiveFormsModule,
|
|
34
|
+
EditableLabelDirective,
|
|
35
|
+
MatIconModule,
|
|
36
|
+
MatTooltipModule,
|
|
28
37
|
FormFieldSimpleComponent,
|
|
29
38
|
FormFieldRichComponent,
|
|
30
39
|
FormFieldObjectComponent,
|
|
@@ -32,10 +41,7 @@ import { CommonModule } from '@angular/common'
|
|
|
32
41
|
FormFieldTemporalExtentComponent,
|
|
33
42
|
FormFieldFileComponent,
|
|
34
43
|
FormFieldArrayComponent,
|
|
35
|
-
CommonModule,
|
|
36
|
-
ReactiveFormsModule,
|
|
37
44
|
TranslateModule,
|
|
38
|
-
MatIconModule,
|
|
39
45
|
],
|
|
40
46
|
})
|
|
41
47
|
export class FormFieldComponent {
|
|
@@ -48,12 +54,18 @@ export class FormFieldComponent {
|
|
|
48
54
|
}
|
|
49
55
|
@Output() valueChange: Observable<unknown>
|
|
50
56
|
|
|
57
|
+
@ViewChild('titleInput') titleInput: ElementRef
|
|
58
|
+
|
|
51
59
|
formControl = new FormControl()
|
|
52
60
|
|
|
53
61
|
constructor() {
|
|
54
62
|
this.valueChange = this.formControl.valueChanges
|
|
55
63
|
}
|
|
56
64
|
|
|
65
|
+
focusTitleInput() {
|
|
66
|
+
this.titleInput.nativeElement.children[0].focus()
|
|
67
|
+
}
|
|
68
|
+
|
|
57
69
|
get simpleType() {
|
|
58
70
|
return this.config.type as
|
|
59
71
|
| 'date'
|
|
@@ -100,6 +112,9 @@ export class FormFieldComponent {
|
|
|
100
112
|
return !this.config.locked && this.config.invalid
|
|
101
113
|
}
|
|
102
114
|
|
|
115
|
+
get isTitle() {
|
|
116
|
+
return this.model === 'title'
|
|
117
|
+
}
|
|
103
118
|
get isAbstract() {
|
|
104
119
|
return this.model === 'abstract'
|
|
105
120
|
}
|
|
@@ -2,16 +2,7 @@ import { CommonModule } from '@angular/common'
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
|
3
3
|
import { EditorFacade } from '../../+state/editor.facade'
|
|
4
4
|
import { EditorFieldState, EditorFieldValue } from '../../models/fields.model'
|
|
5
|
-
import {
|
|
6
|
-
FormFieldArrayComponent,
|
|
7
|
-
FormFieldComponent,
|
|
8
|
-
FormFieldFileComponent,
|
|
9
|
-
FormFieldObjectComponent,
|
|
10
|
-
FormFieldRichComponent,
|
|
11
|
-
FormFieldSimpleComponent,
|
|
12
|
-
FormFieldSpatialExtentComponent,
|
|
13
|
-
FormFieldTemporalExtentComponent,
|
|
14
|
-
} from './form-field'
|
|
5
|
+
import { FormFieldComponent } from './form-field'
|
|
15
6
|
|
|
16
7
|
@Component({
|
|
17
8
|
selector: 'gn-ui-record-form',
|
|
@@ -19,17 +10,7 @@ import {
|
|
|
19
10
|
styleUrls: ['./record-form.component.css'],
|
|
20
11
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
12
|
standalone: true,
|
|
22
|
-
imports: [
|
|
23
|
-
CommonModule,
|
|
24
|
-
FormFieldComponent,
|
|
25
|
-
FormFieldArrayComponent,
|
|
26
|
-
FormFieldFileComponent,
|
|
27
|
-
FormFieldObjectComponent,
|
|
28
|
-
FormFieldRichComponent,
|
|
29
|
-
FormFieldSimpleComponent,
|
|
30
|
-
FormFieldSpatialExtentComponent,
|
|
31
|
-
FormFieldTemporalExtentComponent,
|
|
32
|
-
],
|
|
13
|
+
imports: [CommonModule, FormFieldComponent],
|
|
33
14
|
})
|
|
34
15
|
export class RecordFormComponent {
|
|
35
16
|
fields$ = this.facade.recordFields$
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="flex-1 flex justify-end items-center">
|
|
5
5
|
<ng-content select="[form-field-interaction]"></ng-content>
|
|
6
6
|
<span
|
|
7
|
-
class="material-symbols-outlined m-2 icon-small"
|
|
7
|
+
class="material-symbols-outlined m-2 gn-ui-icon-small"
|
|
8
8
|
[matTooltip]="hint"
|
|
9
9
|
matTooltipPosition="above"
|
|
10
10
|
>
|
package/tailwind.base.css
CHANGED
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
@apply shadow-xl hover:shadow-xl-hover transition-shadow;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/* ICON CLASSES */
|
|
13
|
+
.gn-ui-icon-small {
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
width: 16px;
|
|
16
|
+
height: 16px;
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
/* LINK CLASSES */
|
|
13
20
|
.gn-ui-link {
|
|
14
21
|
@apply text-blue-600 hover:text-blue-700 hover:underline;
|