@genesislcap/foundation-entity-management 14.203.1 → 14.203.2
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/dist/custom-elements.json +103 -11
- package/dist/dts/entities/entities.d.ts +28 -18
- package/dist/dts/entities/entities.d.ts.map +1 -1
- package/dist/dts/entities/entities.template.d.ts.map +1 -1
- package/dist/dts/list/list.d.ts +1 -0
- package/dist/dts/list/list.d.ts.map +1 -1
- package/dist/dts/profiles/profiles.d.ts.map +1 -1
- package/dist/dts/types.d.ts +11 -0
- package/dist/dts/types.d.ts.map +1 -1
- package/dist/esm/entities/entities.js +67 -17
- package/dist/esm/entities/entities.styles.js +2 -2
- package/dist/esm/entities/entities.template.js +6 -5
- package/dist/esm/list/list.js +4 -0
- package/dist/esm/profiles/profiles.js +2 -1
- package/dist/esm/types.js +13 -0
- package/dist/foundation-entity-management.api.json +181 -30
- package/dist/foundation-entity-management.d.ts +40 -15
- package/docs/api/foundation-entity-management.entitymanagement.gettitlebasedonactionortype.md +24 -0
- package/docs/api/foundation-entity-management.entitymanagement.md +4 -1
- package/docs/api/foundation-entity-management.entitymanagement.modalformtitle.md +13 -0
- package/docs/api/foundation-entity-management.entitymanagement.modalformtype.md +13 -0
- package/docs/api/foundation-entity-management.entitymanagement.selectionchanged.md +24 -0
- package/docs/api-report.md +11 -4
- package/package.json +21 -21
- package/docs/api/foundation-entity-management.entitymanagement.editdialogtitle.md +0 -13
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
{
|
|
130
130
|
"kind": "variable",
|
|
131
131
|
"name": "styles",
|
|
132
|
-
"default": "css`\n :host {\n contain: content;\n }\n\n :host::part(header) {\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n }\n\n :host([modal-position='centre']) .edit-modal {\n overflow-y: auto;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n foundation-form {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n\n .title {\n margin-left: 1px;\n }\n\n .header-title {\n color: var(--neutral-foreground-rest);\n font-size: var(--type-ramp-plus-4-font-size);\n font-family: var(--body-font);\n font-weight: 700;\n
|
|
132
|
+
"default": "css`\n :host {\n contain: content;\n }\n\n :host::part(header) {\n display: flex;\n justify-content: space-between;\n align-items: center;\n user-select: none;\n padding: 0 calc(var(--design-unit) * 2px);\n }\n\n :host([modal-position='centre']) .edit-modal {\n overflow-y: auto;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n foundation-form {\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n\n .title {\n margin-left: 1px;\n }\n\n .header-title {\n color: var(--neutral-foreground-rest);\n font-size: var(--type-ramp-plus-4-font-size);\n font-family: var(--body-font);\n font-weight: 700;\n }\n\n .search-container {\n display: flex;\n align-items: center;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .search-container zero-search-bar,\n .search-container rapid-search-bar {\n width: 500px;\n }\n\n .crud-buttons {\n display: flex;\n gap: calc(var(--design-unit) * 2px);\n }\n\n .crud-buttons-wrapper {\n display: flex;\n gap: calc(var(--design-unit) * 2px);\n justify-content: flex-end;\n }\n\n .crud-buttons-wrapper-bottom {\n padding: calc(var(--design-unit) * 2px);\n }\n`",
|
|
133
133
|
"description": "Defines the css of the entity component as an ElementStyles object"
|
|
134
134
|
}
|
|
135
135
|
],
|
|
@@ -294,7 +294,6 @@
|
|
|
294
294
|
"type": {
|
|
295
295
|
"text": "string"
|
|
296
296
|
},
|
|
297
|
-
"default": "''",
|
|
298
297
|
"description": "Label for the entity which has usages such as being shown in the title of the modal wen editing the entity",
|
|
299
298
|
"privacy": "public"
|
|
300
299
|
},
|
|
@@ -471,11 +470,11 @@
|
|
|
471
470
|
},
|
|
472
471
|
{
|
|
473
472
|
"kind": "field",
|
|
474
|
-
"name": "
|
|
473
|
+
"name": "modalFormType",
|
|
475
474
|
"type": {
|
|
476
|
-
"text": "
|
|
475
|
+
"text": "ModalFormType"
|
|
477
476
|
},
|
|
478
|
-
"description": "
|
|
477
|
+
"description": "The type of form that is currently being displayed in the modal"
|
|
479
478
|
},
|
|
480
479
|
{
|
|
481
480
|
"kind": "field",
|
|
@@ -596,6 +595,27 @@
|
|
|
596
595
|
"privacy": "public",
|
|
597
596
|
"description": "The Id of the crud buttons wrapper element"
|
|
598
597
|
},
|
|
598
|
+
{
|
|
599
|
+
"kind": "method",
|
|
600
|
+
"name": "getTitleBasedOnActionOrType",
|
|
601
|
+
"privacy": "public",
|
|
602
|
+
"parameters": [
|
|
603
|
+
{
|
|
604
|
+
"name": "actionOrType",
|
|
605
|
+
"type": {
|
|
606
|
+
"text": "CrudAction | ModalFormType"
|
|
607
|
+
},
|
|
608
|
+
"description": "The crud action or modal form type"
|
|
609
|
+
}
|
|
610
|
+
],
|
|
611
|
+
"description": "The helper function to determine the title of the modal form or button based on the action or type"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"kind": "field",
|
|
615
|
+
"name": "modalFormTitle",
|
|
616
|
+
"description": "Getter for the title of the modal form",
|
|
617
|
+
"readonly": true
|
|
618
|
+
},
|
|
599
619
|
{
|
|
600
620
|
"kind": "field",
|
|
601
621
|
"name": "shouldHideEditInColumn",
|
|
@@ -799,6 +819,20 @@
|
|
|
799
819
|
}
|
|
800
820
|
],
|
|
801
821
|
"description": "Emit the CRUD event for the selected entity"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"kind": "method",
|
|
825
|
+
"name": "selectionChanged",
|
|
826
|
+
"privacy": "public",
|
|
827
|
+
"parameters": [
|
|
828
|
+
{
|
|
829
|
+
"name": "event",
|
|
830
|
+
"type": {
|
|
831
|
+
"text": "CustomEvent<SelectionChangedEvent>"
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
],
|
|
835
|
+
"description": "The event handler for when the selection changes in the grid."
|
|
802
836
|
}
|
|
803
837
|
],
|
|
804
838
|
"attributes": [
|
|
@@ -869,7 +903,6 @@
|
|
|
869
903
|
"type": {
|
|
870
904
|
"text": "string"
|
|
871
905
|
},
|
|
872
|
-
"default": "''",
|
|
873
906
|
"description": "Label for the entity which has usages such as being shown in the title of the modal wen editing the entity",
|
|
874
907
|
"fieldName": "entityLabel"
|
|
875
908
|
},
|
|
@@ -1452,6 +1485,19 @@
|
|
|
1452
1485
|
}
|
|
1453
1486
|
]
|
|
1454
1487
|
},
|
|
1488
|
+
{
|
|
1489
|
+
"kind": "method",
|
|
1490
|
+
"name": "selectionChanged",
|
|
1491
|
+
"privacy": "private",
|
|
1492
|
+
"parameters": [
|
|
1493
|
+
{
|
|
1494
|
+
"name": "e",
|
|
1495
|
+
"type": {
|
|
1496
|
+
"text": "CustomEvent<SelectionChangedEvent>"
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
]
|
|
1500
|
+
},
|
|
1455
1501
|
{
|
|
1456
1502
|
"kind": "field",
|
|
1457
1503
|
"name": "edit",
|
|
@@ -1944,9 +1990,9 @@
|
|
|
1944
1990
|
"type": {
|
|
1945
1991
|
"text": "string"
|
|
1946
1992
|
},
|
|
1947
|
-
"default": "'Profile'",
|
|
1948
1993
|
"description": "Label for the entity which has usages such as being shown in the title of the modal wen editing the entity",
|
|
1949
1994
|
"privacy": "public",
|
|
1995
|
+
"default": "'Profile'",
|
|
1950
1996
|
"inheritedFrom": {
|
|
1951
1997
|
"name": "EntityManagement",
|
|
1952
1998
|
"module": "src/entities/entities.ts"
|
|
@@ -2215,11 +2261,11 @@
|
|
|
2215
2261
|
},
|
|
2216
2262
|
{
|
|
2217
2263
|
"kind": "field",
|
|
2218
|
-
"name": "
|
|
2264
|
+
"name": "modalFormType",
|
|
2219
2265
|
"type": {
|
|
2220
|
-
"text": "
|
|
2266
|
+
"text": "ModalFormType"
|
|
2221
2267
|
},
|
|
2222
|
-
"description": "
|
|
2268
|
+
"description": "The type of form that is currently being displayed in the modal",
|
|
2223
2269
|
"inheritedFrom": {
|
|
2224
2270
|
"name": "EntityManagement",
|
|
2225
2271
|
"module": "src/entities/entities.ts"
|
|
@@ -2404,6 +2450,35 @@
|
|
|
2404
2450
|
"module": "src/entities/entities.ts"
|
|
2405
2451
|
}
|
|
2406
2452
|
},
|
|
2453
|
+
{
|
|
2454
|
+
"kind": "method",
|
|
2455
|
+
"name": "getTitleBasedOnActionOrType",
|
|
2456
|
+
"privacy": "public",
|
|
2457
|
+
"parameters": [
|
|
2458
|
+
{
|
|
2459
|
+
"name": "actionOrType",
|
|
2460
|
+
"type": {
|
|
2461
|
+
"text": "CrudAction | ModalFormType"
|
|
2462
|
+
},
|
|
2463
|
+
"description": "The crud action or modal form type"
|
|
2464
|
+
}
|
|
2465
|
+
],
|
|
2466
|
+
"description": "The helper function to determine the title of the modal form or button based on the action or type",
|
|
2467
|
+
"inheritedFrom": {
|
|
2468
|
+
"name": "EntityManagement",
|
|
2469
|
+
"module": "src/entities/entities.ts"
|
|
2470
|
+
}
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
"kind": "field",
|
|
2474
|
+
"name": "modalFormTitle",
|
|
2475
|
+
"description": "Getter for the title of the modal form",
|
|
2476
|
+
"readonly": true,
|
|
2477
|
+
"inheritedFrom": {
|
|
2478
|
+
"name": "EntityManagement",
|
|
2479
|
+
"module": "src/entities/entities.ts"
|
|
2480
|
+
}
|
|
2481
|
+
},
|
|
2407
2482
|
{
|
|
2408
2483
|
"kind": "field",
|
|
2409
2484
|
"name": "shouldHideEditInColumn",
|
|
@@ -2675,6 +2750,24 @@
|
|
|
2675
2750
|
"name": "EntityManagement",
|
|
2676
2751
|
"module": "src/entities/entities.ts"
|
|
2677
2752
|
}
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
"kind": "method",
|
|
2756
|
+
"name": "selectionChanged",
|
|
2757
|
+
"privacy": "public",
|
|
2758
|
+
"parameters": [
|
|
2759
|
+
{
|
|
2760
|
+
"name": "event",
|
|
2761
|
+
"type": {
|
|
2762
|
+
"text": "CustomEvent<SelectionChangedEvent>"
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
],
|
|
2766
|
+
"description": "The event handler for when the selection changes in the grid.",
|
|
2767
|
+
"inheritedFrom": {
|
|
2768
|
+
"name": "EntityManagement",
|
|
2769
|
+
"module": "src/entities/entities.ts"
|
|
2770
|
+
}
|
|
2678
2771
|
}
|
|
2679
2772
|
],
|
|
2680
2773
|
"superclass": {
|
|
@@ -2784,7 +2877,6 @@
|
|
|
2784
2877
|
"type": {
|
|
2785
2878
|
"text": "string"
|
|
2786
2879
|
},
|
|
2787
|
-
"default": "''",
|
|
2788
2880
|
"description": "Label for the entity which has usages such as being shown in the title of the modal wen editing the entity",
|
|
2789
2881
|
"fieldName": "entityLabel",
|
|
2790
2882
|
"inheritedFrom": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ColDef, GridOptions } from '@ag-grid-community/core';
|
|
2
|
-
import { Connect, DatasourceOptions } from '@genesislcap/foundation-comms';
|
|
1
|
+
import { ColDef, GridOptions, SelectionChangedEvent } from '@ag-grid-community/core';
|
|
2
|
+
import { Connect, DatasourceOptions, MessageError } from '@genesislcap/foundation-comms';
|
|
3
3
|
import type { UiSchema } from '@genesislcap/foundation-forms';
|
|
4
4
|
import { RendererEntry } from '@genesislcap/foundation-forms';
|
|
5
|
-
import
|
|
5
|
+
import { Modal } from '@genesislcap/foundation-ui';
|
|
6
6
|
import { AvailableOption, SelectedOption } from '@genesislcap/foundation-ui';
|
|
7
7
|
import type { DatasourceType, GridProCaseType } from '@genesislcap/grid-pro';
|
|
8
8
|
import { FASTElement } from '@microsoft/fast-element';
|
|
9
|
-
import { CrudMenuPosition, ActionsMenuStyle } from '../types';
|
|
9
|
+
import { CrudMenuPosition, ActionsMenuStyle, ModalFormType, CrudAction } from '../types';
|
|
10
10
|
/**
|
|
11
11
|
* The attribute which is set to configure the resource that the entity manager is working with
|
|
12
12
|
*
|
|
@@ -44,11 +44,7 @@ declare const EntityManagement_base: (new (...args: any[]) => {
|
|
|
44
44
|
readonly $fastController: import("@microsoft/fast-element").Controller;
|
|
45
45
|
$emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail">): boolean | void;
|
|
46
46
|
disconnectedCallback(): void;
|
|
47
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
48
|
-
* This attribute allows you to change row-selection to 'single' or 'multiple' which will allow you to select single or multiple rows.
|
|
49
|
-
* @remarks Defaults to single
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
47
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
52
48
|
accessKey: string;
|
|
53
49
|
readonly accessKeyLabel: string;
|
|
54
50
|
autocapitalize: string;
|
|
@@ -66,10 +62,6 @@ declare const EntityManagement_base: (new (...args: any[]) => {
|
|
|
66
62
|
outerText: string;
|
|
67
63
|
spellcheck: boolean;
|
|
68
64
|
title: string;
|
|
69
|
-
/**
|
|
70
|
-
* If true, will enable row flashing for all rows for `add` transactions
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
65
|
translate: boolean;
|
|
74
66
|
attachInternals(): ElementInternals;
|
|
75
67
|
click(): void;
|
|
@@ -286,7 +278,12 @@ declare const EntityManagement_base: (new (...args: any[]) => {
|
|
|
286
278
|
ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any;
|
|
287
279
|
ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any;
|
|
288
280
|
ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any;
|
|
289
|
-
ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any;
|
|
281
|
+
ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any; /**
|
|
282
|
+
* Opens the model to edit an entity. Added as an event listener on the class when receiving the `edit-entity` event.
|
|
283
|
+
*
|
|
284
|
+
* @param e - CustomEvent where `e.detail` is the entity to edit.
|
|
285
|
+
* @internal
|
|
286
|
+
*/
|
|
290
287
|
ondurationchange: (this: GlobalEventHandlers, ev: Event) => any;
|
|
291
288
|
onemptied: (this: GlobalEventHandlers, ev: Event) => any;
|
|
292
289
|
onended: (this: GlobalEventHandlers, ev: Event) => any;
|
|
@@ -552,9 +549,9 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
552
549
|
defaultEntityValues: Record<string, unknown>;
|
|
553
550
|
submitting: boolean;
|
|
554
551
|
/**
|
|
555
|
-
*
|
|
552
|
+
* The type of form that is currently being displayed in the modal
|
|
556
553
|
*/
|
|
557
|
-
|
|
554
|
+
modalFormType: ModalFormType;
|
|
558
555
|
editModalVisible: boolean;
|
|
559
556
|
editModalVisibleChanged(): void;
|
|
560
557
|
editEntityModal: Modal;
|
|
@@ -597,6 +594,15 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
597
594
|
* The Id of the crud buttons wrapper element
|
|
598
595
|
*/
|
|
599
596
|
crudMenuWrapper: any;
|
|
597
|
+
/**
|
|
598
|
+
* The helper function to determine the title of the modal form or button based on the action or type
|
|
599
|
+
* @param actionOrType - The crud action or modal form type
|
|
600
|
+
*/
|
|
601
|
+
getTitleBasedOnActionOrType(actionOrType: CrudAction | ModalFormType): string;
|
|
602
|
+
/**
|
|
603
|
+
* Getter for the title of the modal form
|
|
604
|
+
*/
|
|
605
|
+
get modalFormTitle(): string;
|
|
600
606
|
/**
|
|
601
607
|
* Determines whether the button edit should be hidden in the column
|
|
602
608
|
*/
|
|
@@ -687,10 +693,10 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
687
693
|
*/
|
|
688
694
|
emitCrud(action: 'create' | 'edit' | 'delete'): void;
|
|
689
695
|
/**
|
|
690
|
-
* Show notifications
|
|
696
|
+
* Show notifications after CRUD operations (success or failure).
|
|
691
697
|
* @internal
|
|
692
698
|
*/
|
|
693
|
-
|
|
699
|
+
handleNotify(type: ModalFormType | CrudAction.Delete, requestError?: MessageError[]): void;
|
|
694
700
|
/**
|
|
695
701
|
* Clear the selected entity
|
|
696
702
|
* @internal
|
|
@@ -702,6 +708,10 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
702
708
|
* @internal
|
|
703
709
|
*/
|
|
704
710
|
private generateCrudActionsMenu;
|
|
711
|
+
/**
|
|
712
|
+
* The event handler for when the selection changes in the grid.
|
|
713
|
+
*/
|
|
714
|
+
selectionChanged(event: CustomEvent<SelectionChangedEvent>): void;
|
|
705
715
|
}
|
|
706
716
|
export {};
|
|
707
717
|
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,OAAO,EACP,iBAAiB,EAGjB,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAa,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAe,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,eAAe,EAGf,cAAc,EACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAIL,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKzF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,c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;OAKG;IACG,YAAY,CAAC,CAAC,EAAE,WAAW;IAK3B,aAAa;IAwBnB,OAAO,CAAC,sBAAsB;IAc9B;;;OAGG;IACI,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ;IAIpD;;;OAGG;IACI,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE;IA6C1F;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAkC/B;;OAEG;IACI,gBAAgB,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC;CASlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.template.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entities.template.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.template.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,gBAAgB,EAAc,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAoBnD;;GAEG;AACH,eAAO,MAAM,mBAAmB,0BAAsB,gBAAgB,0EAkDrE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,wFAWlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,wFAGzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,wFAS3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,wFAyD/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,QAAQ,uEAEpB,CAAC"}
|
package/dist/dts/list/list.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/list/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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,kBAAkB,UAAS;IAC5B,iBAAiB,UAAS;IACpC,QAAQ,UAAS;IACf,UAAU,UAAS;IAChC,cAAc,EAAE,cAAc,CAAY;IACzC,cAAc,EAAE,eAAe,CAAC;IAClE,IAAI,EAAG,WAAW,CAAC;IACnB,UAAU,EAAG,wBAAwB,CAAC;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,mBAAmB,QAAM;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,OAAO,EAAG,OAAO,CAAC;IAErC,IAAI,sBAAsB,IAAI,OAAO,CAEpC;IAED,iBAAiB;YAgEH,oBAAoB;IA+C5B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3C,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,IAAI,CAEV;IAEI,MAAM,CAAC,CAAC,KAAA;CAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/profiles/profiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/profiles/profiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAIjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAKa,QAAS,SAAQ,gBAAgB;IAC5C;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,CAAO;IAEzB;;OAEG;;IAuBU,eAAe,CAAC,OAAO,KAAA;;;;;IAsBrB,aAAa;CAM7B"}
|
package/dist/dts/types.d.ts
CHANGED
|
@@ -25,4 +25,15 @@ export declare enum CrudMenuPosition {
|
|
|
25
25
|
Action = "action",
|
|
26
26
|
None = "none"
|
|
27
27
|
}
|
|
28
|
+
export declare enum CrudAction {
|
|
29
|
+
Create = "create",
|
|
30
|
+
Read = "read",
|
|
31
|
+
Update = "update",
|
|
32
|
+
Delete = "delete"
|
|
33
|
+
}
|
|
34
|
+
export declare enum ModalFormType {
|
|
35
|
+
Create = "create",
|
|
36
|
+
Read = "read",
|
|
37
|
+
Update = "update"
|
|
38
|
+
}
|
|
28
39
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/dts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD,eAAO,MAAM,aAAa,8DAA6C,CAAC;AACxE,eAAO,MAAM,WAAW,8DAA2C,CAAC;AAEpE,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,QAAQ,GACR;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEN,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,eAAe,qBAAqB;IACpC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD,eAAO,MAAM,aAAa,8DAA6C,CAAC;AACxE,eAAO,MAAM,WAAW,8DAA2C,CAAC;AAEpE,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,QAAQ,GACR;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEN,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,eAAe,qBAAqB;IACpC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
|
|
@@ -5,7 +5,7 @@ import { showNotification, showNotificationDialog } from '@genesislcap/foundatio
|
|
|
5
5
|
import { getCriteriaBuilder, INPUT_MIN_LENGTH, } from '@genesislcap/foundation-ui';
|
|
6
6
|
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
|
7
7
|
import { attr, customElement, DOM, FASTElement, observable, volatile, } from '@microsoft/fast-element';
|
|
8
|
-
import { CrudMenuPosition, ActionsMenuStyle } from '../types';
|
|
8
|
+
import { CrudMenuPosition, ActionsMenuStyle, ModalFormType, CrudAction } from '../types';
|
|
9
9
|
import { getErrorFormat, logger } from '../utils';
|
|
10
10
|
import { styles } from './entities.styles';
|
|
11
11
|
import { defaultHeader, searchBarHeader, template } from './entities.template';
|
|
@@ -48,11 +48,6 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
50
|
this.prefix = 'zero';
|
|
51
|
-
/**
|
|
52
|
-
* Label for the entity which has usages such as being shown in the title of the modal wen editing the entity
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
this.entityLabel = '';
|
|
56
51
|
/**
|
|
57
52
|
* Whether to use the `applyTransactionAsync` function for *add* transactions
|
|
58
53
|
* @remarks Defaults to false
|
|
@@ -146,6 +141,28 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
146
141
|
}
|
|
147
142
|
}
|
|
148
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* The helper function to determine the title of the modal form or button based on the action or type
|
|
146
|
+
* @param actionOrType - The crud action or modal form type
|
|
147
|
+
*/
|
|
148
|
+
getTitleBasedOnActionOrType(actionOrType) {
|
|
149
|
+
switch (actionOrType) {
|
|
150
|
+
case ModalFormType.Create:
|
|
151
|
+
return `Add ${this.entityLabel || ''}`;
|
|
152
|
+
case ModalFormType.Update:
|
|
153
|
+
return `Edit ${this.entityLabel || ''}`;
|
|
154
|
+
case CrudAction.Delete:
|
|
155
|
+
return `Delete ${this.entityLabel || ''}`;
|
|
156
|
+
default:
|
|
157
|
+
return '';
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Getter for the title of the modal form
|
|
162
|
+
*/
|
|
163
|
+
get modalFormTitle() {
|
|
164
|
+
return this.getTitleBasedOnActionOrType(this.modalFormType);
|
|
165
|
+
}
|
|
149
166
|
/**
|
|
150
167
|
* Determines whether the button edit should be hidden in the column
|
|
151
168
|
*/
|
|
@@ -261,7 +278,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
261
278
|
}
|
|
262
279
|
});
|
|
263
280
|
}
|
|
264
|
-
copy.
|
|
281
|
+
copy.modalFormType = structuredClone(this.modalFormType);
|
|
265
282
|
copy.editModalVisible = structuredClone(this.editModalVisible);
|
|
266
283
|
copy.formResourceName = structuredClone(this.formResourceName);
|
|
267
284
|
copy.formUiSchema = structuredClone(this.formUiSchema);
|
|
@@ -284,6 +301,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
284
301
|
*/
|
|
285
302
|
submitEntityChanges(e) {
|
|
286
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
+
this.handleNotify(this.modalFormType);
|
|
287
305
|
this.closeModal();
|
|
288
306
|
});
|
|
289
307
|
}
|
|
@@ -293,7 +311,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
293
311
|
* @internal
|
|
294
312
|
*/
|
|
295
313
|
createEntity() {
|
|
296
|
-
this.
|
|
314
|
+
this.modalFormType = ModalFormType.Create;
|
|
297
315
|
this.formUiSchema = this.createFormUiSchema;
|
|
298
316
|
this.formResourceName = this.createEvent;
|
|
299
317
|
this.editedEntity = Object.assign({}, this.defaultEntityValues);
|
|
@@ -307,7 +325,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
307
325
|
*/
|
|
308
326
|
editEntity({ detail }) {
|
|
309
327
|
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
-
this.
|
|
328
|
+
this.modalFormType = ModalFormType.Update;
|
|
311
329
|
this.formUiSchema = this.updateFormUiSchema;
|
|
312
330
|
this.formResourceName = this.updateEvent;
|
|
313
331
|
if (detail) {
|
|
@@ -331,11 +349,12 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
331
349
|
});
|
|
332
350
|
}
|
|
333
351
|
readEntity(e) {
|
|
352
|
+
this.modalFormType = ModalFormType.Read;
|
|
334
353
|
this.readonly = true;
|
|
335
354
|
this.editEntity(e);
|
|
336
|
-
this.editDialogTitle = '';
|
|
337
355
|
}
|
|
338
356
|
closeModal() {
|
|
357
|
+
this.modalFormType = null;
|
|
339
358
|
this.readonly = false;
|
|
340
359
|
this.editModalVisible = false;
|
|
341
360
|
}
|
|
@@ -435,7 +454,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
435
454
|
const deleteReq = yield this.connect.commitEvent(this.deleteEvent, {
|
|
436
455
|
DETAILS,
|
|
437
456
|
});
|
|
438
|
-
this.
|
|
457
|
+
this.handleNotify(CrudAction.Delete, deleteReq.ERROR);
|
|
439
458
|
if (!deleteReq.ERROR) {
|
|
440
459
|
this.clearSelectedEntity();
|
|
441
460
|
}
|
|
@@ -464,14 +483,14 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
464
483
|
this.$emit(`${action}-entity`, this.selectedEntity);
|
|
465
484
|
}
|
|
466
485
|
/**
|
|
467
|
-
* Show notifications
|
|
486
|
+
* Show notifications after CRUD operations (success or failure).
|
|
468
487
|
* @internal
|
|
469
488
|
*/
|
|
470
|
-
|
|
489
|
+
handleNotify(type, requestError) {
|
|
471
490
|
const notificationCloseTimeout = 5000;
|
|
472
|
-
if (
|
|
473
|
-
logger.error(
|
|
474
|
-
|
|
491
|
+
if (requestError) {
|
|
492
|
+
logger.error(requestError);
|
|
493
|
+
requestError.forEach((err) => {
|
|
475
494
|
showNotification({
|
|
476
495
|
title: err.CODE,
|
|
477
496
|
body: getErrorFormat(err),
|
|
@@ -481,6 +500,25 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
481
500
|
}, this.prefix);
|
|
482
501
|
});
|
|
483
502
|
}
|
|
503
|
+
else {
|
|
504
|
+
const titleAndBody = {
|
|
505
|
+
[ModalFormType.Create]: {
|
|
506
|
+
title: this.entityLabel ? `${this.entityLabel} Added` : 'Entity Added',
|
|
507
|
+
body: 'The entity was successfully added',
|
|
508
|
+
},
|
|
509
|
+
[ModalFormType.Update]: {
|
|
510
|
+
title: this.entityLabel ? `${this.entityLabel} Updated` : 'Entity Updated',
|
|
511
|
+
body: 'The entity was successfully updated',
|
|
512
|
+
},
|
|
513
|
+
[CrudAction.Delete]: {
|
|
514
|
+
title: this.entityLabel ? `${this.entityLabel} Deleted` : 'Entity Deleted',
|
|
515
|
+
body: 'The entity was successfully deleted',
|
|
516
|
+
},
|
|
517
|
+
}[type] || { title: '', body: '' };
|
|
518
|
+
showNotification(Object.assign(Object.assign({}, titleAndBody), { config: {
|
|
519
|
+
toast: { type: 'success', autoClose: true, closeTimeout: notificationCloseTimeout },
|
|
520
|
+
} }), this.prefix);
|
|
521
|
+
}
|
|
484
522
|
}
|
|
485
523
|
/**
|
|
486
524
|
* Clear the selected entity
|
|
@@ -525,6 +563,18 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
525
563
|
(_a = this.crudMenuWrapper) === null || _a === void 0 ? void 0 : _a.appendChild(actionsMenu);
|
|
526
564
|
});
|
|
527
565
|
}
|
|
566
|
+
/**
|
|
567
|
+
* The event handler for when the selection changes in the grid.
|
|
568
|
+
*/
|
|
569
|
+
selectionChanged(event) {
|
|
570
|
+
const selectedRows = event.detail.api.getSelectedRows();
|
|
571
|
+
if (selectedRows && selectedRows.length !== 0) {
|
|
572
|
+
this.selectedEntity = selectedRows[0];
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
this.selectedEntity = null;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
528
578
|
};
|
|
529
579
|
__decorate([
|
|
530
580
|
Connect
|
|
@@ -621,7 +671,7 @@ __decorate([
|
|
|
621
671
|
], EntityManagement.prototype, "submitting", void 0);
|
|
622
672
|
__decorate([
|
|
623
673
|
observable
|
|
624
|
-
], EntityManagement.prototype, "
|
|
674
|
+
], EntityManagement.prototype, "modalFormType", void 0);
|
|
625
675
|
__decorate([
|
|
626
676
|
observable
|
|
627
677
|
], EntityManagement.prototype, "editModalVisible", void 0);
|
|
@@ -17,6 +17,7 @@ export const styles = css `
|
|
|
17
17
|
justify-content: space-between;
|
|
18
18
|
align-items: center;
|
|
19
19
|
user-select: none;
|
|
20
|
+
padding: 0 calc(var(--design-unit) * 2px);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
:host([modal-position='centre']) .edit-modal {
|
|
@@ -46,7 +47,6 @@ export const styles = css `
|
|
|
46
47
|
font-size: var(--type-ramp-plus-4-font-size);
|
|
47
48
|
font-family: var(--body-font);
|
|
48
49
|
font-weight: 700;
|
|
49
|
-
padding-left: calc(var(--design-unit) * 2px);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.search-container {
|
|
@@ -72,6 +72,6 @@ export const styles = css `
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.crud-buttons-wrapper-bottom {
|
|
75
|
-
padding
|
|
75
|
+
padding: calc(var(--design-unit) * 2px);
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
@@ -2,7 +2,7 @@ import { customEvent } from '@genesislcap/foundation-events';
|
|
|
2
2
|
import { Form } from '@genesislcap/foundation-forms';
|
|
3
3
|
import { html, ref, when } from '@microsoft/fast-element';
|
|
4
4
|
import { List } from '../list';
|
|
5
|
-
import { CrudMenuPosition } from '../types';
|
|
5
|
+
import { ModalFormType, CrudMenuPosition, CrudAction } from '../types';
|
|
6
6
|
List;
|
|
7
7
|
Form;
|
|
8
8
|
/**
|
|
@@ -12,7 +12,7 @@ const addButtonTemplate = (prefix) => html `
|
|
|
12
12
|
${when((x) => x.createEvent, html `
|
|
13
13
|
<${prefix}-button class="crud-button" appearance="neutral" @click=${(x) => x.createEntity()}>
|
|
14
14
|
<${prefix}-icon size="lg" name="plus"></${prefix}-icon>
|
|
15
|
-
|
|
15
|
+
${(x) => x.getTitleBasedOnActionOrType(ModalFormType.Create)}
|
|
16
16
|
</${prefix}-button>
|
|
17
17
|
`)}
|
|
18
18
|
`;
|
|
@@ -38,13 +38,13 @@ export const crudButtonsTemplate = (prefix, position) => html `
|
|
|
38
38
|
${when((x) => x.updateEvent && !x.hideEdit, html `
|
|
39
39
|
<${prefix}-button class="crud-button" appearance="neutral" title="Select an item from the grid to enable editing" @click=${(x, y) => x.emitCrud('edit')} disabled=${(x) => (x.hasSelectedEntity ? null : 'disabled')}>
|
|
40
40
|
<${prefix}-icon size="lg" name="pen"></${prefix}-icon>
|
|
41
|
-
|
|
41
|
+
${(x) => x.getTitleBasedOnActionOrType(ModalFormType.Update)}
|
|
42
42
|
</${prefix}-button>
|
|
43
43
|
`)}
|
|
44
44
|
${when((x) => x.deleteEvent && !x.hideDelete, html `
|
|
45
45
|
<${prefix}-button class="crud-button" appearance="neutral" title="Select an item from the grid to enable deleting" @click=${(x, y) => x.emitCrud('delete')} disabled=${(x) => (x.hasSelectedEntity ? null : 'disabled')}>
|
|
46
46
|
<${prefix}-icon size="lg" name="trash-alt"></${prefix}-icon>
|
|
47
|
-
Delete
|
|
47
|
+
${(x) => x.getTitleBasedOnActionOrType(CrudAction.Delete)}
|
|
48
48
|
</${prefix}-button>
|
|
49
49
|
`)}
|
|
50
50
|
`)}
|
|
@@ -119,6 +119,7 @@ export const getPrefixedEntities = (prefix) => html `
|
|
|
119
119
|
hide-delete=${(x) => x.shouldHideDeleteInColumn}
|
|
120
120
|
header-case-type=${(x) => x.headerCaseType}
|
|
121
121
|
datasource-type=${(x) => x.datasourceType}
|
|
122
|
+
@selectionChanged=${(x, c) => x.selectionChanged(c.event)}
|
|
122
123
|
></entity-list>
|
|
123
124
|
<slot name="footer" slot="footer">${crudButtonsTemplate(prefix, CrudMenuPosition.Bottom)}</slot>
|
|
124
125
|
<${prefix}-modal
|
|
@@ -128,7 +129,7 @@ export const getPrefixedEntities = (prefix) => html `
|
|
|
128
129
|
:onCloseCallback=${(x) => x.closeModal.bind(x)}
|
|
129
130
|
data-test-id="edit-entity-modal"
|
|
130
131
|
>
|
|
131
|
-
<div slot="top" data-test-id="dialog-title">${(x) => x.
|
|
132
|
+
<div slot="top" data-test-id="dialog-title">${(x) => x.modalFormTitle}</div>
|
|
132
133
|
|
|
133
134
|
<slot name="edit">
|
|
134
135
|
${when((x) => x.editModalVisible, html `
|