geonetwork-ui 2.4.0-dev.6c8dcba0 → 2.4.0-dev.8f04e899
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/api/metadata-converter/src/lib/gn4/types/index.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/keywords.model.mjs +2 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/keyword.mapper.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +1 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +5 -5
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +11 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +34 -14
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +4 -4
- package/esm2022/libs/feature/dataviz/src/lib/feature-dataviz.module.mjs +7 -4
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +6 -4
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +2 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +57 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +64 -50
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +17 -35
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/feature-editor.module.mjs +4 -3
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +8 -1
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +12 -6
- package/esm2022/libs/feature/record/src/lib/feature-record.module.mjs +7 -4
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -3
- package/esm2022/libs/feature/search/src/lib/feature-search.module.mjs +7 -4
- package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
- package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +6 -6
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +4 -4
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +59 -26
- package/esm2022/libs/ui/inputs/src/lib/badge/badge.component.mjs +28 -0
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +11 -10
- package/esm2022/libs/ui/widgets/src/index.mjs +1 -2
- package/esm2022/libs/ui/widgets/src/lib/popup-alert/popup-alert.component.mjs +5 -3
- package/esm2022/libs/ui/widgets/src/lib/ui-widgets.module.mjs +1 -6
- package/fesm2022/geonetwork-ui.mjs +520 -393
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/index.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/index.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/keywords.model.d.ts +31 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/keywords.model.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +3 -2
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/keyword.mapper.d.ts +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/keyword.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +3 -2
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +3 -3
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +8 -5
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +4 -7
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +12 -5
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +3 -3
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +1 -1
- package/libs/feature/dataviz/src/lib/feature-dataviz.module.d.ts +2 -1
- package/libs/feature/dataviz/src/lib/feature-dataviz.module.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +1 -0
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +1 -1
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +1 -0
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts +25 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts +6 -6
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +6 -10
- 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/form-field/index.d.ts +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/feature-editor.module.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/feature-record.module.d.ts +2 -1
- package/libs/feature/record/src/lib/feature-record.module.d.ts.map +1 -1
- package/libs/feature/search/src/lib/feature-search.module.d.ts +2 -1
- package/libs/feature/search/src/lib/feature-search.module.d.ts.map +1 -1
- package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +1 -1
- package/libs/ui/inputs/src/index.d.ts +1 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts +7 -4
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/badge/badge.component.d.ts +11 -0
- package/libs/ui/inputs/src/lib/badge/badge.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +35 -35
- package/libs/ui/widgets/src/index.d.ts +0 -1
- package/libs/ui/widgets/src/index.d.ts.map +1 -1
- package/libs/ui/widgets/src/lib/popup-alert/popup-alert.component.d.ts +1 -1
- package/libs/ui/widgets/src/lib/popup-alert/popup-alert.component.d.ts.map +1 -1
- package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts +10 -11
- package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/types/index.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/types/keywords.model.ts +31 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/keyword.mapper.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +7 -8
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +24 -3
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +70 -21
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +4 -9
- package/src/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.ts +13 -6
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +3 -3
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +1 -1
- package/src/libs/feature/dataviz/src/lib/feature-dataviz.module.ts +2 -1
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +2 -0
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +35 -29
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +1 -0
- package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +19 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +77 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.ts +95 -86
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +7 -22
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +16 -44
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -1
- package/src/libs/feature/editor/src/lib/feature-editor.module.ts +2 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +7 -0
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +20 -6
- package/src/libs/feature/record/src/lib/feature-record.module.ts +3 -2
- package/src/libs/feature/search/src/lib/feature-search.module.ts +2 -1
- package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +2 -2
- package/src/libs/feature/search/src/lib/results-table/results-table.component.ts +1 -2
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -2
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +0 -1
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +23 -19
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +79 -27
- package/src/libs/ui/inputs/src/lib/badge/badge.component.css +0 -0
- package/src/libs/ui/inputs/src/lib/badge/badge.component.html +18 -0
- package/src/libs/ui/inputs/src/lib/badge/badge.component.ts +27 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +3 -3
- package/src/libs/ui/widgets/src/index.ts +0 -1
- package/src/libs/ui/widgets/src/lib/popup-alert/popup-alert.component.ts +4 -0
- package/src/libs/ui/widgets/src/lib/ui-widgets.module.ts +0 -3
- package/esm2022/libs/ui/widgets/src/lib/badge/badge.component.mjs +0 -18
- package/libs/ui/widgets/src/lib/badge/badge.component.d.ts +0 -7
- package/libs/ui/widgets/src/lib/badge/badge.component.d.ts.map +0 -1
- package/src/libs/ui/widgets/src/lib/badge/badge.component.html +0 -10
- package/src/libs/ui/widgets/src/lib/badge/badge.component.ts +0 -14
- /package/src/libs/{ui/widgets/src/lib/badge/badge.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.css} +0 -0
|
@@ -13,25 +13,29 @@ import {
|
|
|
13
13
|
SimpleChanges,
|
|
14
14
|
ViewChild,
|
|
15
15
|
} from '@angular/core'
|
|
16
|
-
import { UntypedFormControl } from '@angular/forms'
|
|
16
|
+
import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms'
|
|
17
17
|
import {
|
|
18
18
|
MatAutocomplete,
|
|
19
|
+
MatAutocompleteModule,
|
|
19
20
|
MatAutocompleteSelectedEvent,
|
|
20
21
|
MatAutocompleteTrigger,
|
|
21
22
|
} from '@angular/material/autocomplete'
|
|
22
|
-
import { merge, Observable, of, ReplaySubject, Subscription } from 'rxjs'
|
|
23
|
+
import { first, merge, Observable, of, ReplaySubject, Subscription } from 'rxjs'
|
|
23
24
|
import {
|
|
24
25
|
catchError,
|
|
25
26
|
debounceTime,
|
|
26
27
|
distinctUntilChanged,
|
|
27
28
|
filter,
|
|
28
29
|
finalize,
|
|
29
|
-
first,
|
|
30
30
|
map,
|
|
31
31
|
switchMap,
|
|
32
32
|
take,
|
|
33
33
|
tap,
|
|
34
34
|
} from 'rxjs/operators'
|
|
35
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
36
|
+
import { PopupAlertComponent } from '../../../../../../libs/ui/widgets/src'
|
|
37
|
+
import { CommonModule } from '@angular/common'
|
|
38
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
35
39
|
|
|
36
40
|
export type AutocompleteItem = unknown
|
|
37
41
|
|
|
@@ -40,6 +44,15 @@ export type AutocompleteItem = unknown
|
|
|
40
44
|
templateUrl: './autocomplete.component.html',
|
|
41
45
|
styleUrls: ['./autocomplete.component.css'],
|
|
42
46
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
47
|
+
standalone: true,
|
|
48
|
+
imports: [
|
|
49
|
+
MatIconModule,
|
|
50
|
+
PopupAlertComponent,
|
|
51
|
+
MatAutocompleteModule,
|
|
52
|
+
CommonModule,
|
|
53
|
+
TranslateModule,
|
|
54
|
+
ReactiveFormsModule,
|
|
55
|
+
],
|
|
43
56
|
})
|
|
44
57
|
export class AutocompleteComponent
|
|
45
58
|
implements OnInit, AfterViewInit, OnDestroy, OnChanges
|
|
@@ -49,6 +62,8 @@ export class AutocompleteComponent
|
|
|
49
62
|
@Input() value?: AutocompleteItem
|
|
50
63
|
@Input() clearOnSelection = false
|
|
51
64
|
@Input() autoFocus = false
|
|
65
|
+
@Input() minCharacterCount? = 3
|
|
66
|
+
@Input() allowSubmit = true
|
|
52
67
|
@Output() itemSelected = new EventEmitter<AutocompleteItem>()
|
|
53
68
|
@Output() inputSubmitted = new EventEmitter<string>()
|
|
54
69
|
@Output() inputCleared = new EventEmitter<void>()
|
|
@@ -57,22 +72,28 @@ export class AutocompleteComponent
|
|
|
57
72
|
@ViewChild('searchInput') inputRef: ElementRef<HTMLInputElement>
|
|
58
73
|
|
|
59
74
|
searching: boolean
|
|
60
|
-
suggestions$: Observable<AutocompleteItem[]>
|
|
61
75
|
control = new UntypedFormControl()
|
|
62
|
-
subscription = new Subscription()
|
|
63
76
|
cancelEnter = true
|
|
64
77
|
selectionSubject = new ReplaySubject<MatAutocompleteSelectedEvent>(1)
|
|
65
78
|
lastInputValue$ = new ReplaySubject<string>(1)
|
|
66
79
|
error: string | null = null
|
|
80
|
+
suggestions$: Observable<AutocompleteItem[]>
|
|
81
|
+
subscription = new Subscription()
|
|
67
82
|
|
|
68
|
-
@Input() displayWithFn: (AutocompleteItem) => string = (item) =>
|
|
83
|
+
@Input() displayWithFn: (item: AutocompleteItem) => string = (item) =>
|
|
84
|
+
item.toString()
|
|
85
|
+
|
|
86
|
+
displayWithFnInternal = (item?: AutocompleteItem) => {
|
|
87
|
+
if (item === null || item === undefined) return null
|
|
88
|
+
return this.displayWithFn(item)
|
|
89
|
+
}
|
|
69
90
|
|
|
70
91
|
constructor(private cdRef: ChangeDetectorRef) {}
|
|
71
92
|
ngOnChanges(changes: SimpleChanges): void {
|
|
72
93
|
const { value } = changes
|
|
73
94
|
if (value) {
|
|
74
|
-
const previousTextValue = this.
|
|
75
|
-
const currentTextValue = this.
|
|
95
|
+
const previousTextValue = this.displayWithFnInternal(value.previousValue)
|
|
96
|
+
const currentTextValue = this.displayWithFnInternal(value.currentValue)
|
|
76
97
|
if (previousTextValue !== currentTextValue) {
|
|
77
98
|
this.updateInputValue(value.currentValue)
|
|
78
99
|
}
|
|
@@ -80,20 +101,33 @@ export class AutocompleteComponent
|
|
|
80
101
|
}
|
|
81
102
|
|
|
82
103
|
ngOnInit(): void {
|
|
83
|
-
|
|
104
|
+
const newValue$ = merge(
|
|
105
|
+
of(''),
|
|
106
|
+
this.inputCleared.pipe(map(() => '')),
|
|
84
107
|
this.control.valueChanges.pipe(
|
|
85
108
|
filter((value) => typeof value === 'string'),
|
|
86
|
-
filter((value: string) => value.length > 2),
|
|
87
|
-
debounceTime(400),
|
|
88
109
|
distinctUntilChanged(),
|
|
89
|
-
|
|
90
|
-
),
|
|
91
|
-
this.control.valueChanges.pipe(
|
|
92
|
-
filter((value) => typeof value === 'object' && value.title),
|
|
93
|
-
map((item) => item.title)
|
|
110
|
+
debounceTime(400)
|
|
94
111
|
)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
const externalValueChange$ = this.control.valueChanges.pipe(
|
|
115
|
+
filter((value) => typeof value === 'object' && value.title),
|
|
116
|
+
map((item) => item.title)
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
// this observable emits arrays of suggestions loaded using the given action
|
|
120
|
+
const suggestionsFromAction = merge(
|
|
121
|
+
newValue$.pipe(
|
|
122
|
+
filter((value: string) => value.length >= this.minCharacterCount)
|
|
123
|
+
),
|
|
124
|
+
externalValueChange$
|
|
95
125
|
).pipe(
|
|
96
|
-
|
|
126
|
+
tap(() => {
|
|
127
|
+
this.searching = true
|
|
128
|
+
this.error = null
|
|
129
|
+
}),
|
|
130
|
+
switchMap((value) => this.action(value)),
|
|
97
131
|
catchError((error: Error) => {
|
|
98
132
|
this.error = error.message
|
|
99
133
|
return of([])
|
|
@@ -101,11 +135,32 @@ export class AutocompleteComponent
|
|
|
101
135
|
finalize(() => (this.searching = false))
|
|
102
136
|
)
|
|
103
137
|
|
|
104
|
-
this.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
138
|
+
this.suggestions$ = merge(
|
|
139
|
+
suggestionsFromAction,
|
|
140
|
+
// if a new value is under the min char count, clear suggestions
|
|
141
|
+
newValue$.pipe(
|
|
142
|
+
filter((value: string) => value.length < this.minCharacterCount),
|
|
143
|
+
map(() => [])
|
|
144
|
+
)
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
// close the panel whenever suggestions are cleared
|
|
148
|
+
this.subscription.add(
|
|
149
|
+
this.suggestions$
|
|
150
|
+
.pipe(filter((suggestions) => suggestions.length === 0))
|
|
151
|
+
.subscribe(() => {
|
|
152
|
+
this.triggerRef?.closePanel()
|
|
153
|
+
})
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
this.subscription.add(
|
|
157
|
+
this.control.valueChanges.subscribe((any) => {
|
|
158
|
+
if (any !== '') {
|
|
159
|
+
this.cancelEnter = false
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
)
|
|
163
|
+
|
|
109
164
|
this.control.valueChanges
|
|
110
165
|
.pipe(filter((value) => typeof value === 'string'))
|
|
111
166
|
.subscribe(this.lastInputValue$)
|
|
@@ -120,7 +175,7 @@ export class AutocompleteComponent
|
|
|
120
175
|
}
|
|
121
176
|
|
|
122
177
|
ngOnDestroy(): void {
|
|
123
|
-
this.subscription
|
|
178
|
+
this.subscription?.unsubscribe()
|
|
124
179
|
}
|
|
125
180
|
|
|
126
181
|
updateInputValue(value: AutocompleteItem) {
|
|
@@ -139,19 +194,16 @@ export class AutocompleteComponent
|
|
|
139
194
|
.pipe(take(1))
|
|
140
195
|
.subscribe((selection) => selection && selection.option.deselect())
|
|
141
196
|
this.inputRef.nativeElement.focus()
|
|
142
|
-
this.triggerRef.closePanel()
|
|
143
197
|
}
|
|
144
198
|
|
|
145
199
|
handleEnter(any: string) {
|
|
146
|
-
if (!this.cancelEnter) {
|
|
200
|
+
if (!this.cancelEnter && this.allowSubmit) {
|
|
147
201
|
this.inputSubmitted.emit(any)
|
|
148
|
-
this.triggerRef.closePanel()
|
|
149
202
|
}
|
|
150
203
|
}
|
|
151
204
|
|
|
152
205
|
handleClickSearch() {
|
|
153
206
|
this.inputSubmitted.emit(this.inputRef.nativeElement.value)
|
|
154
|
-
this.triggerRef.closePanel()
|
|
155
207
|
}
|
|
156
208
|
|
|
157
209
|
handleSelection(event: MatAutocompleteSelectedEvent) {
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="gn-ui-badge flex items-center gap-1.5"
|
|
3
|
+
[ngClass]="
|
|
4
|
+
clickable
|
|
5
|
+
? 'hover:bg-primary cursor-pointer transition-colors duration-100'
|
|
6
|
+
: ''
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<span><ng-content></ng-content></span>
|
|
10
|
+
<gn-ui-button
|
|
11
|
+
class="material-symbols-outlined cursor-pointer text-xs"
|
|
12
|
+
*ngIf="removable"
|
|
13
|
+
(buttonClick)="removeBadge()"
|
|
14
|
+
extraClass="p-1 bg-transparent border-0 border-transparent "
|
|
15
|
+
>
|
|
16
|
+
close
|
|
17
|
+
</gn-ui-button>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
Input,
|
|
7
|
+
Output,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import { ButtonComponent } from '../button/button.component'
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'gn-ui-badge',
|
|
13
|
+
templateUrl: './badge.component.html',
|
|
14
|
+
styleUrls: ['./badge.component.css'],
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [CommonModule, ButtonComponent],
|
|
18
|
+
})
|
|
19
|
+
export class BadgeComponent {
|
|
20
|
+
@Input() clickable? = false
|
|
21
|
+
@Input() removable? = false
|
|
22
|
+
@Output() badgeRemoveClicked = new EventEmitter<void>()
|
|
23
|
+
|
|
24
|
+
removeBadge() {
|
|
25
|
+
this.badgeRemoveClicked.emit()
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -4,8 +4,8 @@ import { UtilSharedModule } from '../../../../../libs/util/shared/src'
|
|
|
4
4
|
import { TranslateModule } from '@ngx-translate/core'
|
|
5
5
|
import { TagInputModule } from 'ngx-chips'
|
|
6
6
|
import { NgxDropzoneModule } from 'ngx-dropzone'
|
|
7
|
-
import { AutocompleteComponent } from './autocomplete/autocomplete.component'
|
|
8
7
|
import { ButtonComponent } from './button/button.component'
|
|
8
|
+
import { BadgeComponent } from './badge/badge.component'
|
|
9
9
|
import { ChipsInputComponent } from './chips-input/chips-input.component'
|
|
10
10
|
import { DragAndDropFileInputComponent } from './drag-and-drop-file-input/drag-and-drop-file-input.component'
|
|
11
11
|
import { DropdownSelectorComponent } from './dropdown-selector/dropdown-selector.component'
|
|
@@ -36,7 +36,6 @@ import { ImageInputComponent } from './image-input/image-input.component'
|
|
|
36
36
|
|
|
37
37
|
@NgModule({
|
|
38
38
|
declarations: [
|
|
39
|
-
AutocompleteComponent,
|
|
40
39
|
TextInputComponent,
|
|
41
40
|
DragAndDropFileInputComponent,
|
|
42
41
|
ChipsInputComponent,
|
|
@@ -73,10 +72,10 @@ import { ImageInputComponent } from './image-input/image-input.component'
|
|
|
73
72
|
DropdownSelectorComponent,
|
|
74
73
|
DateRangePickerComponent,
|
|
75
74
|
CheckToggleComponent,
|
|
75
|
+
BadgeComponent,
|
|
76
76
|
],
|
|
77
77
|
exports: [
|
|
78
78
|
DropdownSelectorComponent,
|
|
79
|
-
AutocompleteComponent,
|
|
80
79
|
ButtonComponent,
|
|
81
80
|
TextInputComponent,
|
|
82
81
|
DragAndDropFileInputComponent,
|
|
@@ -93,6 +92,7 @@ import { ImageInputComponent } from './image-input/image-input.component'
|
|
|
93
92
|
DateRangePickerComponent,
|
|
94
93
|
EditableLabelDirective,
|
|
95
94
|
ImageInputComponent,
|
|
95
|
+
BadgeComponent,
|
|
96
96
|
],
|
|
97
97
|
})
|
|
98
98
|
export class UiInputsModule {}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './lib/ui-widgets.module'
|
|
2
2
|
export * from './lib/progress-bar/progress-bar.component'
|
|
3
3
|
export * from './lib/loading-mask/loading-mask.component'
|
|
4
|
-
export * from './lib/badge/badge.component'
|
|
5
4
|
export * from './lib/color-scale/color-scale.component'
|
|
6
5
|
export * from './lib/popup-alert/popup-alert.component'
|
|
7
6
|
export * from './lib/spinning-loader/spinning-loader.component'
|
|
@@ -7,12 +7,16 @@ import {
|
|
|
7
7
|
OnInit,
|
|
8
8
|
ViewChild,
|
|
9
9
|
} from '@angular/core'
|
|
10
|
+
import { CommonModule } from '@angular/common'
|
|
11
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
10
12
|
|
|
11
13
|
@Component({
|
|
12
14
|
selector: 'gn-ui-popup-alert',
|
|
13
15
|
templateUrl: './popup-alert.component.html',
|
|
14
16
|
styleUrls: ['./popup-alert.component.css'],
|
|
15
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CommonModule, MatIconModule],
|
|
16
20
|
})
|
|
17
21
|
export class PopupAlertComponent implements OnInit {
|
|
18
22
|
@Input() icon: string
|
|
@@ -9,7 +9,6 @@ import { TagInputModule } from 'ngx-chips'
|
|
|
9
9
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
|
10
10
|
import { LoadingMaskComponent } from './loading-mask/loading-mask.component'
|
|
11
11
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'
|
|
12
|
-
import { PopupAlertComponent } from './popup-alert/popup-alert.component'
|
|
13
12
|
import { MatIconModule } from '@angular/material/icon'
|
|
14
13
|
import { SpinningLoaderComponent } from './spinning-loader/spinning-loader.component'
|
|
15
14
|
import { CommonModule } from '@angular/common'
|
|
@@ -20,7 +19,6 @@ import { CommonModule } from '@angular/common'
|
|
|
20
19
|
ProgressBarComponent,
|
|
21
20
|
StepBarComponent,
|
|
22
21
|
LoadingMaskComponent,
|
|
23
|
-
PopupAlertComponent,
|
|
24
22
|
SpinningLoaderComponent,
|
|
25
23
|
],
|
|
26
24
|
imports: [
|
|
@@ -38,7 +36,6 @@ import { CommonModule } from '@angular/common'
|
|
|
38
36
|
ProgressBarComponent,
|
|
39
37
|
StepBarComponent,
|
|
40
38
|
LoadingMaskComponent,
|
|
41
|
-
PopupAlertComponent,
|
|
42
39
|
SpinningLoaderComponent,
|
|
43
40
|
],
|
|
44
41
|
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/common";
|
|
5
|
-
export class BadgeComponent {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.clickable = false;
|
|
8
|
-
}
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BadgeComponent, isStandalone: true, selector: "gn-ui-badge", inputs: { clickable: "clickable" }, ngImport: i0, template: "<div\n class=\"gn-ui-badge\"\n [ngClass]=\"\n clickable\n ? 'hover:bg-primary cursor-pointer transition-colors duration-100'\n : ''\n \"\n>\n <ng-content></ng-content>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11
|
-
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
13
|
-
type: Component,
|
|
14
|
-
args: [{ selector: 'gn-ui-badge', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule], template: "<div\n class=\"gn-ui-badge\"\n [ngClass]=\"\n clickable\n ? 'hover:bg-primary cursor-pointer transition-colors duration-100'\n : ''\n \"\n>\n <ng-content></ng-content>\n</div>\n" }]
|
|
15
|
-
}], propDecorators: { clickable: [{
|
|
16
|
-
type: Input
|
|
17
|
-
}] } });
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFkZ2UuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy91aS93aWRnZXRzL3NyYy9saWIvYmFkZ2UvYmFkZ2UuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy91aS93aWRnZXRzL3NyYy9saWIvYmFkZ2UvYmFkZ2UuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDekUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFBOzs7QUFVOUMsTUFBTSxPQUFPLGNBQWM7SUFSM0I7UUFTVyxjQUFTLEdBQUcsS0FBSyxDQUFBO0tBQzNCOytHQUZZLGNBQWM7bUdBQWQsY0FBYywyR0NYM0Isb01BVUEseURERFksWUFBWTs7NEZBRVgsY0FBYztrQkFSMUIsU0FBUzsrQkFDRSxhQUFhLG1CQUdOLHVCQUF1QixDQUFDLE1BQU0sY0FDbkMsSUFBSSxXQUNQLENBQUMsWUFBWSxDQUFDOzhCQUdkLFNBQVM7c0JBQWpCLEtBQUsiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneSwgQ29tcG9uZW50LCBJbnB1dCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnXG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nXG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ2duLXVpLWJhZGdlJyxcbiAgdGVtcGxhdGVVcmw6ICcuL2JhZGdlLmNvbXBvbmVudC5odG1sJyxcbiAgc3R5bGVVcmxzOiBbJy4vYmFkZ2UuY29tcG9uZW50LmNzcyddLFxuICBjaGFuZ2VEZXRlY3Rpb246IENoYW5nZURldGVjdGlvblN0cmF0ZWd5Lk9uUHVzaCxcbiAgc3RhbmRhbG9uZTogdHJ1ZSxcbiAgaW1wb3J0czogW0NvbW1vbk1vZHVsZV0sXG59KVxuZXhwb3J0IGNsYXNzIEJhZGdlQ29tcG9uZW50IHtcbiAgQElucHV0KCkgY2xpY2thYmxlID0gZmFsc2Vcbn1cbiIsIjxkaXZcbiAgY2xhc3M9XCJnbi11aS1iYWRnZVwiXG4gIFtuZ0NsYXNzXT1cIlxuICAgIGNsaWNrYWJsZVxuICAgICAgPyAnaG92ZXI6YmctcHJpbWFyeSBjdXJzb3ItcG9pbnRlciB0cmFuc2l0aW9uLWNvbG9ycyBkdXJhdGlvbi0xMDAnXG4gICAgICA6ICcnXG4gIFwiXG4+XG4gIDxuZy1jb250ZW50PjwvbmctY29udGVudD5cbjwvZGl2PlxuIl19
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class BadgeComponent {
|
|
3
|
-
clickable: boolean;
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BadgeComponent, never>;
|
|
5
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BadgeComponent, "gn-ui-badge", never, { "clickable": { "alias": "clickable"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=badge.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"badge.component.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/ui/widgets/src/lib/badge/badge.component.ts"],"names":[],"mappings":";AAGA,qBAQa,cAAc;IAChB,SAAS,UAAQ;yCADf,cAAc;2CAAd,cAAc;CAE1B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
-
import { CommonModule } from '@angular/common'
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'gn-ui-badge',
|
|
6
|
-
templateUrl: './badge.component.html',
|
|
7
|
-
styleUrls: ['./badge.component.css'],
|
|
8
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
standalone: true,
|
|
10
|
-
imports: [CommonModule],
|
|
11
|
-
})
|
|
12
|
-
export class BadgeComponent {
|
|
13
|
-
@Input() clickable = false
|
|
14
|
-
}
|