geonetwork-ui 2.4.0-dev.4e89bcad → 2.4.0-dev.58b3c2e5
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/repository/src/lib/gn4/platform/gn4-platform.service.mjs +9 -5
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/records/records.service.mjs +4 -6
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +4 -2
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +5 -5
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +6 -3
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +7 -3
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +5 -4
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +7 -4
- package/esm2022/libs/ui/layout/src/lib/max-lines/max-lines.component.mjs +3 -3
- package/esm2022/translations/de.json +47 -39
- package/esm2022/translations/en.json +17 -12
- package/esm2022/translations/es.json +17 -9
- package/esm2022/translations/fr.json +16 -11
- package/esm2022/translations/it.json +17 -9
- package/esm2022/translations/nl.json +17 -9
- package/esm2022/translations/pt.json +17 -9
- package/fesm2022/geonetwork-ui.mjs +247 -183
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +2 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +2 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/records/records.service.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.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +26 -15
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +5 -1
- package/src/libs/feature/catalog/src/lib/records/records.service.ts +6 -8
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +8 -6
- package/src/libs/feature/editor/src/lib/fields.config.ts +4 -4
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +6 -2
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +16 -2
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +29 -29
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +31 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +15 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +38 -0
- package/src/libs/ui/layout/src/lib/max-lines/max-lines.component.html +1 -0
- package/translations/de.json +47 -39
- package/translations/en.json +17 -12
- package/translations/es.json +17 -9
- package/translations/fr.json +16 -11
- package/translations/it.json +17 -9
- package/translations/nl.json +17 -9
- package/translations/pt.json +17 -9
- package/translations/sk.json +17 -9
|
@@ -6,6 +6,7 @@ import { Keyword, Organization, UserFeedback } from '../../../../../../../libs/c
|
|
|
6
6
|
import { Gn4PlatformMapper } from './gn4-platform.mapper';
|
|
7
7
|
import { LangService } from '../../../../../../../libs/util/i18n/src';
|
|
8
8
|
import { HttpClient } from '@angular/common/http';
|
|
9
|
+
import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class Gn4PlatformService implements PlatformServiceInterface {
|
|
11
12
|
private siteApiService;
|
|
@@ -39,7 +40,7 @@ export declare class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
39
40
|
getUsers(): Observable<UserModel[]>;
|
|
40
41
|
translateKey(key: string): Observable<string>;
|
|
41
42
|
private allThesaurus$;
|
|
42
|
-
searchKeywords(query: string): Observable<Keyword[]>;
|
|
43
|
+
searchKeywords(query: string, keywordTypes: KeywordType[]): Observable<Keyword[]>;
|
|
43
44
|
getKeywordsByUri(uri: string): Observable<Keyword[]>;
|
|
44
45
|
getUserFeedbacks(uuid: string): Observable<UserFeedback[]>;
|
|
45
46
|
postUserFeedbacks(userFeedback: UserFeedback): Observable<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gn4-platform.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgC,MAAM,MAAM,CAAA;AAE/D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"gn4-platform.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgC,MAAM,MAAM,CAAA;AAE/D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,eAAe,EAChB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4EAA4E,CAAA;AACrH,OAAO,EAAE,SAAS,EAAE,MAAM,uEAAuE,CAAA;AACjG,OAAO,EACL,OAAO,EACP,YAAY,EACZ,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAKjD,OAAO,EAAE,WAAW,EAAE,MAAM,iEAAiE,CAAA;;AAI7F,qBACa,kBAAmB,YAAW,wBAAwB;IAwC/D,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,UAAU;IA/CpB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAuB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IAEtD,OAAO,CAAC,gBAAgB,CAQrB;IAEH,OAAO,CAAC,SAAS,CAGhB;IAED,OAAO,CAAC,QAAQ,CAAC,WAAW,CAU3B;IAED;;;OAGG;IACH,OAAO,CAAC,kBAAkB,CAA4C;gBAG5D,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,iBAAiB,EACzB,eAAe,EAAE,eAAe,EAChC,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,WAAW,EACxB,sBAAsB,EAAE,sBAAsB,EAC9C,UAAU,EAAE,UAAU;IAiBhC,OAAO,IAAI,MAAM;IAIjB,aAAa,IAAI,UAAU,CAAC,MAAM,CAAC;IAInC,KAAK,IAAI,UAAU,CAAC,SAAS,CAAC;IAI9B,WAAW,IAAI,UAAU,CAAC,OAAO,CAAC;IAIlC,gBAAgB,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;IAI9C,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAI3E,QAAQ,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;IAInC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAkB7C,OAAO,CAAC,aAAa,CASlB;IAEH,cAAc,CACZ,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,WAAW,EAAE,GAC1B,UAAU,CAAC,OAAO,EAAE,CAAC;IAkCxB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;IAiCpD,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC;IAY1D,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;yCA5MpD,kBAAkB;6CAAlB,kBAAkB;CAsN9B"}
|
|
@@ -2,6 +2,7 @@ import type { Observable } from 'rxjs';
|
|
|
2
2
|
import type { UserModel } from './model/user/user.model';
|
|
3
3
|
import type { Organization } from './model/record/organization.model';
|
|
4
4
|
import { Keyword, UserFeedback } from './model/record';
|
|
5
|
+
import { KeywordType } from './model/thesaurus';
|
|
5
6
|
export declare abstract class PlatformServiceInterface {
|
|
6
7
|
abstract getType(): string;
|
|
7
8
|
abstract getApiVersion(): Observable<string>;
|
|
@@ -11,7 +12,7 @@ export declare abstract class PlatformServiceInterface {
|
|
|
11
12
|
abstract getUsersByOrganization(organisation: Organization): Observable<UserModel[]>;
|
|
12
13
|
abstract getOrganizations(): Observable<Organization[]>;
|
|
13
14
|
abstract translateKey(key: string): Observable<string>;
|
|
14
|
-
abstract searchKeywords(query: string): Observable<Keyword[]>;
|
|
15
|
+
abstract searchKeywords(query: string, keywordTypes: KeywordType[]): Observable<Keyword[]>;
|
|
15
16
|
abstract getKeywordsByUri(uri: string): Observable<Keyword[]>;
|
|
16
17
|
abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>;
|
|
17
18
|
abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.service.interface.d.ts","sourceRoot":"","sources":["../../../../../src/libs/common/domain/src/lib/platform.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"platform.service.interface.d.ts","sourceRoot":"","sources":["../../../../../src/libs/common/domain/src/lib/platform.service.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,8BAAsB,wBAAwB;IAC5C,QAAQ,CAAC,OAAO,IAAI,MAAM;IAC1B,QAAQ,CAAC,aAAa,IAAI,UAAU,CAAC,MAAM,CAAC;IAE5C,QAAQ,CAAC,KAAK,IAAI,UAAU,CAAC,SAAS,CAAC;IACvC,QAAQ,CAAC,WAAW,IAAI,UAAU,CAAC,OAAO,CAAC;IAC3C,QAAQ,CAAC,QAAQ,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;IAC5C,QAAQ,CAAC,sBAAsB,CAC7B,YAAY,EAAE,YAAY,GACzB,UAAU,CAAC,SAAS,EAAE,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;IACvD,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACtD,QAAQ,CAAC,cAAc,CACrB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,WAAW,EAAE,GAC1B,UAAU,CAAC,OAAO,EAAE,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;IAC7D,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC;IACzE,QAAQ,CAAC,iBAAiB,CAAC,UAAU,EAAE,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;CACvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/catalog/src/lib/records/records.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"records.service.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/catalog/src/lib/records/records.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAiB,MAAM,MAAM,CAAA;AAEhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sFAAsF,CAAA;;AAEjI,qBAGa,cAAc;IAMb,OAAO,CAAC,iBAAiB;IALrC,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,CAGhC;gBAEmB,iBAAiB,EAAE,0BAA0B;yCANtD,cAAc;6CAAd,cAAc;CAO1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-keywords.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kFAAkF,CAAA;AAQ3H,OAAO,EAAE,OAAO,EAAE,MAAM,oEAAoE,CAAA;;AAE5F,KAAK,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAEzD,qBAca,0BAA0B;
|
|
1
|
+
{"version":3,"file":"form-field-keywords.component.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kFAAkF,CAAA;AAQ3H,OAAO,EAAE,OAAO,EAAE,MAAM,oEAAoE,CAAA;;AAE5F,KAAK,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAA;AAEzD,qBAca,0BAA0B;IAmBzB,OAAO,CAAC,eAAe;IAlB1B,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,CAAA;IAExC,aAAa,SAAU,gBAAgB,YAEtC;IAED,kBAAkB,UAAW,MAAM;;;SAUlC;gBAEmB,eAAe,EAAE,wBAAwB;IAE7D,mBAAmB,CAAC,IAAI,EAAE,gBAAgB;IAI1C,UAAU,CAAC,OAAO,EAAE,OAAO;IAmB3B,aAAa,CAAC,KAAK,EAAE,MAAM;yCA5ChB,0BAA0B;2CAA1B,0BAA0B;CAiDtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdview.facade.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/record/src/lib/state/mdview.facade.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAA;AAY3C,OAAO,EAAE,qBAAqB,EAAa,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wFAAwF,CAAA;AAClI,OAAO,EACL,aAAa,EACb,YAAY,EACb,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAA;;AAExE,qBAOa,YAAY;IAErB,OAAO,CAAC,KAAK;IACN,cAAc,EAAE,qBAAqB;IAC5C,OAAO,CAAC,aAAa;IACd,WAAW,EAAE,WAAW;gBAHvB,KAAK,EAAE,KAAK,EACb,cAAc,EAAE,qBAAqB,EACpC,aAAa,EAAE,sBAAsB,EACtC,WAAW,EAAE,WAAW;IAGjC,UAAU,qCAGT;IAED,kBAAkB,qCAEjB;IAED,SAAS,oDAGR;IAED,aAAa,qCAGZ;IAED,MAAM;;;OAA4D;IAElE,QAAQ,6CAAsD;IAE9D,YAAY,uDAA0D;IAEtE,SAAS,8HAER;IAED,SAAS,8HAIR;IAED,YAAY,8HAMX;IAED,cAAc,8HAMb;IAED,UAAU,8HAIT;IAED,aAAa,8HAMZ;IAED,yBAAyB,
|
|
1
|
+
{"version":3,"file":"mdview.facade.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/feature/record/src/lib/state/mdview.facade.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAA;AAY3C,OAAO,EAAE,qBAAqB,EAAa,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wFAAwF,CAAA;AAClI,OAAO,EACL,aAAa,EACb,YAAY,EACb,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAA;;AAExE,qBAOa,YAAY;IAErB,OAAO,CAAC,KAAK;IACN,cAAc,EAAE,qBAAqB;IAC5C,OAAO,CAAC,aAAa;IACd,WAAW,EAAE,WAAW;gBAHvB,KAAK,EAAE,KAAK,EACb,cAAc,EAAE,qBAAqB,EACpC,aAAa,EAAE,sBAAsB,EACtC,WAAW,EAAE,WAAW;IAGjC,UAAU,qCAGT;IAED,kBAAkB,qCAEjB;IAED,SAAS,oDAGR;IAED,aAAa,qCAGZ;IAED,MAAM;;;OAA4D;IAElE,QAAQ,6CAAsD;IAE9D,YAAY,uDAA0D;IAEtE,SAAS,8HAER;IAED,SAAS,8HAIR;IAED,YAAY,8HAMX;IAED,cAAc,8HAMb;IAED,UAAU,8HAIT;IAED,aAAa,8HAMZ;IAED,yBAAyB,mCAkCxB;IAED,iBAAiB,mCAEhB;IAED,WAAW,8HAMV;IAED,cAAc,4CAA4D;IAC1E,yBAAyB,qCAExB;IACD,yBAAyB,qCAExB;IAED;;;OAGG;IACH,qBAAqB,CAAC,UAAU,EAAE,aAAa;IAI/C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM;IAIrB,aAAa;IAIb,cAAc,CAAC,WAAW,EAAE,yBAAyB;IAIrD;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,YAAY;IAI1C,iBAAiB,CAAC,WAAW,EAAE,MAAM;yCA/J1B,YAAY;6CAAZ,YAAY;CAkKxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/search/src/lib/utils/service/fields.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,UAAU,EASX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAY,UAAU,EAAM,MAAM,MAAM,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;;AAI3F,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"fields.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/libs/feature/search/src/lib/utils/service/fields.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,UAAU,EASX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAY,UAAU,EAAM,MAAM,MAAM,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;;AAI3F,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,CAAA;AAiBnE,qBAGa,aAAa;IAqDZ,SAAS,CAAC,QAAQ,EAAE,QAAQ;IApDxC,SAAS,CAAC,MAAM,sCA8CwB;IAExC,IAAI,eAAe,aAElB;gBAEqB,QAAQ,EAAE,QAAQ;IAExC,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAMpC,OAAO,CAAC,mBAAmB;IAG3B,OAAO,CAAC,mBAAmB;IAI3B,2BAA2B,CACzB,WAAW,EAAE,WAAW,GACvB,UAAU,CAAC,YAAY,CAAC;IAkB3B,0BAA0B,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC;yCAxF/D,aAAa;6CAAb,aAAa;CAoGzB"}
|
|
@@ -32,9 +32,10 @@ import * as i30 from "./markdown-parser/markdown-parser.component";
|
|
|
32
32
|
import * as i31 from "./thumbnail/thumbnail.component";
|
|
33
33
|
import * as i32 from "./user-feedback-item/time-since.pipe";
|
|
34
34
|
import * as i33 from "../../../inputs/src/lib/badge/badge.component";
|
|
35
|
+
import * as i34 from "../../../layout/src/lib/max-lines/max-lines.component";
|
|
35
36
|
export declare class UiElementsModule {
|
|
36
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiElementsModule, never>;
|
|
37
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<UiElementsModule, [typeof i1.MetadataInfoComponent, typeof i2.ContentGhostComponent, typeof i3.DownloadItemComponent, typeof i4.DownloadsListComponent, typeof i5.ApiCardComponent, typeof i6.RelatedRecordCardComponent, typeof i7.MetadataContactComponent, typeof i8.MetadataCatalogComponent, typeof i9.MetadataQualityComponent, typeof i10.MetadataQualityItemComponent, typeof i11.ErrorComponent, typeof i12.PaginationComponent, typeof i13.AvatarComponent, typeof i14.UserPreviewComponent, typeof i15.GnUiLinkifyDirective, typeof i16.PaginationButtonsComponent, typeof i17.RecordApiFormComponent, typeof i18.UserFeedbackItemComponent, typeof i19.ImageOverlayPreviewComponent], [typeof i20.CommonModule, typeof i21.MatIconModule, typeof i22.MatTooltipModule, typeof i23.UiWidgetsModule, typeof i24.UiLayoutModule, typeof i25.TranslateModule, typeof i26.UtilSharedModule, typeof i27.RouterModule, typeof i28.UiInputsModule, typeof i29.FormsModule, typeof i20.NgOptimizedImage, typeof i30.MarkdownParserComponent, typeof i31.ThumbnailComponent, typeof i32.TimeSincePipe, typeof i33.BadgeComponent], [typeof i1.MetadataInfoComponent, typeof i2.ContentGhostComponent, typeof i3.DownloadItemComponent, typeof i4.DownloadsListComponent, typeof i5.ApiCardComponent, typeof i6.RelatedRecordCardComponent, typeof i7.MetadataContactComponent, typeof i8.MetadataCatalogComponent, typeof i9.MetadataQualityComponent, typeof i10.MetadataQualityItemComponent, typeof i11.ErrorComponent, typeof i12.PaginationComponent, typeof i31.ThumbnailComponent, typeof i13.AvatarComponent, typeof i14.UserPreviewComponent, typeof i16.PaginationButtonsComponent, typeof i17.RecordApiFormComponent, typeof i30.MarkdownParserComponent, typeof i18.UserFeedbackItemComponent, typeof i19.ImageOverlayPreviewComponent]>;
|
|
38
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<UiElementsModule, [typeof i1.MetadataInfoComponent, typeof i2.ContentGhostComponent, typeof i3.DownloadItemComponent, typeof i4.DownloadsListComponent, typeof i5.ApiCardComponent, typeof i6.RelatedRecordCardComponent, typeof i7.MetadataContactComponent, typeof i8.MetadataCatalogComponent, typeof i9.MetadataQualityComponent, typeof i10.MetadataQualityItemComponent, typeof i11.ErrorComponent, typeof i12.PaginationComponent, typeof i13.AvatarComponent, typeof i14.UserPreviewComponent, typeof i15.GnUiLinkifyDirective, typeof i16.PaginationButtonsComponent, typeof i17.RecordApiFormComponent, typeof i18.UserFeedbackItemComponent, typeof i19.ImageOverlayPreviewComponent], [typeof i20.CommonModule, typeof i21.MatIconModule, typeof i22.MatTooltipModule, typeof i23.UiWidgetsModule, typeof i24.UiLayoutModule, typeof i25.TranslateModule, typeof i26.UtilSharedModule, typeof i27.RouterModule, typeof i28.UiInputsModule, typeof i29.FormsModule, typeof i20.NgOptimizedImage, typeof i30.MarkdownParserComponent, typeof i31.ThumbnailComponent, typeof i32.TimeSincePipe, typeof i33.BadgeComponent, typeof i34.MaxLinesComponent], [typeof i1.MetadataInfoComponent, typeof i2.ContentGhostComponent, typeof i3.DownloadItemComponent, typeof i4.DownloadsListComponent, typeof i5.ApiCardComponent, typeof i6.RelatedRecordCardComponent, typeof i7.MetadataContactComponent, typeof i8.MetadataCatalogComponent, typeof i9.MetadataQualityComponent, typeof i10.MetadataQualityItemComponent, typeof i11.ErrorComponent, typeof i12.PaginationComponent, typeof i31.ThumbnailComponent, typeof i13.AvatarComponent, typeof i14.UserPreviewComponent, typeof i16.PaginationButtonsComponent, typeof i17.RecordApiFormComponent, typeof i30.MarkdownParserComponent, typeof i18.UserFeedbackItemComponent, typeof i19.ImageOverlayPreviewComponent]>;
|
|
38
39
|
static ɵinj: i0.ɵɵInjectorDeclaration<UiElementsModule>;
|
|
39
40
|
}
|
|
40
41
|
//# sourceMappingURL=ui-elements.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-elements.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/elements/src/lib/ui-elements.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-elements.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/elements/src/lib/ui-elements.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,qBA+Da,gBAAgB;yCAAhB,gBAAgB;0CAAhB,gBAAgB;0CAAhB,gBAAgB;CAAG"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
MeApiService,
|
|
6
6
|
RegistriesApiService,
|
|
7
7
|
SiteApiService,
|
|
8
|
-
ThesaurusInfoApiModel,
|
|
9
8
|
ToolsApiService,
|
|
10
9
|
UserfeedbackApiService,
|
|
11
10
|
UsersApiService,
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
KeywordApiResponse,
|
|
26
25
|
ThesaurusApiResponse,
|
|
27
26
|
} from '../../../../../../../libs/api/metadata-converter/src'
|
|
27
|
+
import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus'
|
|
28
28
|
|
|
29
29
|
const minApiVersion = '4.2.2'
|
|
30
30
|
|
|
@@ -146,25 +146,36 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
146
146
|
)
|
|
147
147
|
.pipe(
|
|
148
148
|
map((thesaurus) => {
|
|
149
|
-
// FIXME: find a better way to exclude place keywords
|
|
150
|
-
// thesaurus[0].filter((thes) => thes.dname !== 'place')
|
|
151
149
|
return thesaurus[0] as ThesaurusApiResponse[]
|
|
152
150
|
}),
|
|
153
151
|
shareReplay(1)
|
|
154
152
|
)
|
|
155
153
|
|
|
156
|
-
searchKeywords(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
searchKeywords(
|
|
155
|
+
query: string,
|
|
156
|
+
keywordTypes: KeywordType[]
|
|
157
|
+
): Observable<Keyword[]> {
|
|
158
|
+
const keywords$: Observable<KeywordApiResponse[]> = this.allThesaurus$.pipe(
|
|
159
|
+
switchMap((thesaurus) => {
|
|
160
|
+
const selectedThesauri = []
|
|
161
|
+
keywordTypes.map((keywordType) => {
|
|
162
|
+
selectedThesauri.push(
|
|
163
|
+
...thesaurus.filter((thes) => thes.dname === keywordType)
|
|
164
|
+
)
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
return this.registriesApiService.searchKeywords(
|
|
168
|
+
query,
|
|
169
|
+
this.langService.iso3,
|
|
170
|
+
10,
|
|
171
|
+
0,
|
|
172
|
+
null,
|
|
173
|
+
selectedThesauri.map((thes) => thes.key),
|
|
174
|
+
null,
|
|
175
|
+
`*${query}*`
|
|
176
|
+
) as Observable<KeywordApiResponse[]>
|
|
177
|
+
})
|
|
178
|
+
)
|
|
168
179
|
|
|
169
180
|
return combineLatest([keywords$, this.allThesaurus$]).pipe(
|
|
170
181
|
map(([keywords, thesaurus]) => {
|
|
@@ -2,6 +2,7 @@ import type { Observable } from 'rxjs'
|
|
|
2
2
|
import type { UserModel } from './model/user/user.model'
|
|
3
3
|
import type { Organization } from './model/record/organization.model'
|
|
4
4
|
import { Keyword, UserFeedback } from './model/record'
|
|
5
|
+
import { KeywordType } from './model/thesaurus'
|
|
5
6
|
|
|
6
7
|
export abstract class PlatformServiceInterface {
|
|
7
8
|
abstract getType(): string
|
|
@@ -15,7 +16,10 @@ export abstract class PlatformServiceInterface {
|
|
|
15
16
|
): Observable<UserModel[]>
|
|
16
17
|
abstract getOrganizations(): Observable<Organization[]>
|
|
17
18
|
abstract translateKey(key: string): Observable<string>
|
|
18
|
-
abstract searchKeywords(
|
|
19
|
+
abstract searchKeywords(
|
|
20
|
+
query: string,
|
|
21
|
+
keywordTypes: KeywordType[]
|
|
22
|
+
): Observable<Keyword[]>
|
|
19
23
|
abstract getKeywordsByUri(uri: string): Observable<Keyword[]>
|
|
20
24
|
abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>
|
|
21
25
|
abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
|
-
import { Observable, of } from 'rxjs'
|
|
3
|
-
import {
|
|
2
|
+
import { Observable, of, switchMap } from 'rxjs'
|
|
3
|
+
import { shareReplay } from 'rxjs/operators'
|
|
4
4
|
import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
5
5
|
|
|
6
6
|
@Injectable({
|
|
7
7
|
providedIn: 'root',
|
|
8
8
|
})
|
|
9
9
|
export class RecordsService {
|
|
10
|
-
recordsCount$: Observable<number> =
|
|
11
|
-
.getMatchesCount({})
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
catchError(() => of(0))
|
|
15
|
-
)
|
|
10
|
+
recordsCount$: Observable<number> = of(true).pipe(
|
|
11
|
+
switchMap(() => this.recordsRepository.getMatchesCount({})),
|
|
12
|
+
shareReplay(1)
|
|
13
|
+
)
|
|
16
14
|
|
|
17
15
|
constructor(private recordsRepository: RecordsRepositoryInterface) {}
|
|
18
16
|
}
|
|
@@ -35,13 +35,15 @@ export class FormFieldKeywordsComponent {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
autoCompleteAction = (query: string) => {
|
|
38
|
-
return this.platformService
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
return this.platformService
|
|
39
|
+
.searchKeywords(query, ['temporal', 'theme', 'other'])
|
|
40
|
+
.pipe(
|
|
41
|
+
map((keywords) =>
|
|
42
|
+
keywords.map((keyword) => {
|
|
43
|
+
return { title: keyword.label, value: keyword }
|
|
44
|
+
})
|
|
45
|
+
)
|
|
43
46
|
)
|
|
44
|
-
)
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
constructor(private platformService: PlatformServiceInterface) {}
|
|
@@ -5,21 +5,21 @@ export const DEFAULT_FIELDS: EditorFieldsConfig = [
|
|
|
5
5
|
{
|
|
6
6
|
model: 'title',
|
|
7
7
|
formFieldConfig: {
|
|
8
|
-
labelKey: '
|
|
8
|
+
labelKey: marker('editor.record.form.metadata.title'),
|
|
9
9
|
type: 'text',
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
model: 'abstract',
|
|
14
14
|
formFieldConfig: {
|
|
15
|
-
labelKey: '
|
|
15
|
+
labelKey: marker('editor.record.form.abstract'),
|
|
16
16
|
type: 'rich',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
model: 'uniqueIdentifier',
|
|
21
21
|
formFieldConfig: {
|
|
22
|
-
labelKey: '
|
|
22
|
+
labelKey: marker('editor.record.form.unique.identifier'),
|
|
23
23
|
type: 'text',
|
|
24
24
|
locked: true,
|
|
25
25
|
},
|
|
@@ -27,7 +27,7 @@ export const DEFAULT_FIELDS: EditorFieldsConfig = [
|
|
|
27
27
|
{
|
|
28
28
|
model: 'recordUpdated',
|
|
29
29
|
formFieldConfig: {
|
|
30
|
-
labelKey: '
|
|
30
|
+
labelKey: marker('editor.record.form.record.updated'),
|
|
31
31
|
type: 'text',
|
|
32
32
|
locked: true,
|
|
33
33
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { select, Store } from '@ngrx/store'
|
|
3
3
|
import {
|
|
4
|
+
catchError,
|
|
4
5
|
defaultIfEmpty,
|
|
5
6
|
filter,
|
|
6
7
|
map,
|
|
7
8
|
mergeMap,
|
|
8
|
-
scan,
|
|
9
9
|
switchMap,
|
|
10
10
|
toArray,
|
|
11
11
|
} from 'rxjs/operators'
|
|
@@ -119,7 +119,11 @@ export class MdViewFacade {
|
|
|
119
119
|
? link
|
|
120
120
|
: null
|
|
121
121
|
}),
|
|
122
|
-
defaultIfEmpty(null)
|
|
122
|
+
defaultIfEmpty(null),
|
|
123
|
+
catchError((e) => {
|
|
124
|
+
console.error(e)
|
|
125
|
+
return of(null)
|
|
126
|
+
})
|
|
123
127
|
)
|
|
124
128
|
} else {
|
|
125
129
|
return of(link)
|
|
@@ -25,19 +25,21 @@ marker('search.filters.keyword')
|
|
|
25
25
|
marker('search.filters.isSpatial')
|
|
26
26
|
marker('search.filters.license')
|
|
27
27
|
marker('search.filters.publicationYear')
|
|
28
|
-
marker('search.filters.
|
|
28
|
+
marker('search.filters.organization')
|
|
29
29
|
marker('search.filters.representationType')
|
|
30
30
|
marker('search.filters.resourceType')
|
|
31
31
|
marker('search.filters.standard')
|
|
32
32
|
marker('search.filters.topic')
|
|
33
33
|
marker('search.filters.contact')
|
|
34
|
+
marker('search.filters.producerOrg')
|
|
35
|
+
marker('search.filters.publisherOrg')
|
|
34
36
|
|
|
35
37
|
@Injectable({
|
|
36
38
|
providedIn: 'root',
|
|
37
39
|
})
|
|
38
40
|
export class FieldsService {
|
|
39
41
|
protected fields = {
|
|
40
|
-
|
|
42
|
+
organization: new OrganizationSearchField(this.injector),
|
|
41
43
|
format: new SimpleSearchField('format', this.injector, 'asc'),
|
|
42
44
|
resourceType: new TranslatedSearchField(
|
|
43
45
|
'resourceType',
|
|
@@ -70,6 +72,18 @@ export class FieldsService {
|
|
|
70
72
|
q: new FullTextSearchField(),
|
|
71
73
|
license: new LicenseSearchField(this.injector),
|
|
72
74
|
owner: new OwnerSearchField(this.injector),
|
|
75
|
+
producerOrg: new MultilingualSearchField(
|
|
76
|
+
'originatorOrgForResourceObject',
|
|
77
|
+
this.injector,
|
|
78
|
+
'asc',
|
|
79
|
+
'key'
|
|
80
|
+
),
|
|
81
|
+
publisherOrg: new MultilingualSearchField(
|
|
82
|
+
'distributorOrgForResourceObject',
|
|
83
|
+
this.injector,
|
|
84
|
+
'asc',
|
|
85
|
+
'key'
|
|
86
|
+
),
|
|
73
87
|
} as Record<string, AbstractSearchField>
|
|
74
88
|
|
|
75
89
|
get supportedFields() {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="group flex flex-col justify-between h-40 pt-5 pb-6 px-7 rounded filter overflow-hidden"
|
|
3
|
-
[ngClass]="{ 'cursor-pointer': displayApiFormButton }"
|
|
4
|
-
(click)="openRecordApiFormPanel()"
|
|
2
|
+
class="group flex flex-col justify-between h-40 pt-5 pb-6 px-7 rounded filter overflow-hidden cursor-default"
|
|
5
3
|
>
|
|
6
4
|
<div
|
|
7
5
|
class="font-title font-medium text-21 text-black text-ellipsis overflow-hidden break-words pb-5 h-[4.5rem]"
|
|
@@ -17,35 +15,37 @@
|
|
|
17
15
|
}"
|
|
18
16
|
>{{ link.accessServiceProtocol }}</span
|
|
19
17
|
>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[ngClass]="{
|
|
30
|
-
'py-2 px-4 rounded-r-md bg-gray-400 hover:bg-gray-600 focus:bg-gray-800 text-white':
|
|
31
|
-
displayText
|
|
32
|
-
}"
|
|
33
|
-
mat-raised-button
|
|
34
|
-
[matTooltip]="
|
|
35
|
-
!currentlyActive
|
|
36
|
-
? ('record.metadata.api.form.openForm' | translate)
|
|
37
|
-
: ('record.metadata.api.form.closeForm' | translate)
|
|
38
|
-
"
|
|
39
|
-
matTooltipPosition="above"
|
|
40
|
-
>
|
|
41
|
-
<mat-icon
|
|
42
|
-
class="material-symbols-outlined pointer-events-none align-middle card-icon"
|
|
18
|
+
<div class="flex flex-row gap-2 items-center">
|
|
19
|
+
<gn-ui-copy-text-button
|
|
20
|
+
[text]="link.url"
|
|
21
|
+
[tooltipText]="'tooltip.url.copy' | translate"
|
|
22
|
+
[displayText]="false"
|
|
23
|
+
></gn-ui-copy-text-button>
|
|
24
|
+
<button
|
|
25
|
+
*ngIf="displayApiFormButton"
|
|
26
|
+
type="button"
|
|
43
27
|
[ngClass]="{
|
|
44
|
-
'
|
|
28
|
+
'py-2 px-4 rounded-r-md bg-gray-400 hover:bg-gray-600 focus:bg-gray-800 text-white':
|
|
29
|
+
displayText
|
|
45
30
|
}"
|
|
46
|
-
|
|
31
|
+
mat-raised-button
|
|
32
|
+
[matTooltip]="
|
|
33
|
+
!currentlyActive
|
|
34
|
+
? ('record.metadata.api.form.openForm' | translate)
|
|
35
|
+
: ('record.metadata.api.form.closeForm' | translate)
|
|
36
|
+
"
|
|
37
|
+
matTooltipPosition="above"
|
|
38
|
+
(click)="openRecordApiFormPanel()"
|
|
47
39
|
>
|
|
48
|
-
|
|
40
|
+
<mat-icon
|
|
41
|
+
class="material-symbols-outlined pointer-events-none align-middle card-icon"
|
|
42
|
+
[ngClass]="{
|
|
43
|
+
'text-secondary opacity-100': currentlyActive
|
|
44
|
+
}"
|
|
45
|
+
>more_horiz</mat-icon
|
|
46
|
+
>
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
@@ -10,7 +10,7 @@ import { DownloadItemComponent } from './download-item/download-item.component'
|
|
|
10
10
|
import { DownloadsListComponent } from './downloads-list/downloads-list.component'
|
|
11
11
|
import { ApiCardComponent } from './api-card/api-card.component'
|
|
12
12
|
import { UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
|
|
13
|
-
import { UiLayoutModule } from '../../../../../libs/ui/layout/src'
|
|
13
|
+
import { MaxLinesComponent, UiLayoutModule } from '../../../../../libs/ui/layout/src'
|
|
14
14
|
import { TranslateModule } from '@ngx-translate/core'
|
|
15
15
|
import { RelatedRecordCardComponent } from './related-record-card/related-record-card.component'
|
|
16
16
|
import { MetadataContactComponent } from './metadata-contact/metadata-contact.component'
|
|
@@ -49,6 +49,7 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
|
|
|
49
49
|
ThumbnailComponent,
|
|
50
50
|
TimeSincePipe,
|
|
51
51
|
BadgeComponent,
|
|
52
|
+
MaxLinesComponent,
|
|
52
53
|
],
|
|
53
54
|
declarations: [
|
|
54
55
|
MetadataInfoComponent,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--mat-standard-button-toggle-height: 32px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.mat-button-toggle-group-appearance-standard {
|
|
6
|
+
background-color: var(--color-gray-200);
|
|
7
|
+
padding: 4px;
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.mat-button-toggle-appearance-standard {
|
|
14
|
+
color: var(--color-main);
|
|
15
|
+
background-color: var(--color-gray-200);
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
border-left: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mat-button-toggle-appearance-standard.mat-button-toggle-checked {
|
|
21
|
+
background-color: var(--color-main);
|
|
22
|
+
color: var(--color-primary-white);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
button.mat-button-toggle-button.mat-focus-indicator.mat-button-toggle-label-content {
|
|
26
|
+
line-height: 32px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mat-button-toggle-label-content {
|
|
30
|
+
line-height: 32px;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<mat-button-toggle-group
|
|
2
|
+
#group="matButtonToggleGroup"
|
|
3
|
+
multiple="false"
|
|
4
|
+
class="flex w-full"
|
|
5
|
+
>
|
|
6
|
+
<mat-button-toggle
|
|
7
|
+
*ngFor="let option of options"
|
|
8
|
+
[aria-label]="option.label"
|
|
9
|
+
[value]="option.value"
|
|
10
|
+
[checked]="option.checked"
|
|
11
|
+
(change)="onChange(option)"
|
|
12
|
+
[class]="extraClasses"
|
|
13
|
+
>{{ option.label }}</mat-button-toggle
|
|
14
|
+
>
|
|
15
|
+
</mat-button-toggle-group>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
EventEmitter,
|
|
6
|
+
Input,
|
|
7
|
+
Output,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle'
|
|
10
|
+
|
|
11
|
+
export type SwitchToggleOption = {
|
|
12
|
+
label: string
|
|
13
|
+
value: string
|
|
14
|
+
checked: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'gn-ui-switch-toggle',
|
|
19
|
+
templateUrl: './switch-toggle.component.html',
|
|
20
|
+
styleUrls: ['./switch-toggle.component.css'],
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
+
standalone: true,
|
|
23
|
+
imports: [MatButtonToggleModule, CommonModule],
|
|
24
|
+
})
|
|
25
|
+
export class SwitchToggleComponent {
|
|
26
|
+
@Input() options: SwitchToggleOption[]
|
|
27
|
+
@Input() ariaLabel? = ''
|
|
28
|
+
@Input() extraClasses? = ''
|
|
29
|
+
@Output() selectedValue = new EventEmitter<SwitchToggleOption>()
|
|
30
|
+
|
|
31
|
+
onChange(selectedOption: SwitchToggleOption) {
|
|
32
|
+
this.options.find(
|
|
33
|
+
(option) => option.value === selectedOption.value
|
|
34
|
+
).checked = true
|
|
35
|
+
|
|
36
|
+
this.selectedValue.emit(selectedOption)
|
|
37
|
+
}
|
|
38
|
+
}
|