@genesislcap/foundation-entity-management 14.19.0 → 14.20.0-bny.20
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 +137 -37
- package/dist/dts/entities/entities.d.ts +18 -12
- package/dist/dts/entities/entities.d.ts.map +1 -1
- package/dist/dts/entities/entities.styles.d.ts.map +1 -1
- package/dist/dts/entities/entities.template.d.ts.map +1 -1
- package/dist/dts/list/list.d.ts +0 -2
- package/dist/dts/list/list.d.ts.map +1 -1
- package/dist/dts/list/list.styles.d.ts.map +1 -1
- package/dist/dts/list/list.template.d.ts +0 -23
- package/dist/dts/list/list.template.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +26 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/esm/entities/entities.js +27 -5
- package/dist/esm/entities/entities.styles.js +6 -0
- package/dist/esm/entities/entities.template.js +16 -3
- package/dist/esm/list/list.js +2 -7
- package/dist/esm/list/list.styles.js +0 -6
- package/dist/esm/list/list.template.js +0 -35
- package/dist/esm/utils/index.js +25 -0
- package/dist/foundation-entity-management.api.json +167 -0
- package/dist/foundation-entity-management.d.ts +45 -12
- package/docs/api/foundation-entity-management.buttoncellrenderer.md +34 -0
- package/docs/api/foundation-entity-management.entitymanagement.create.md +17 -0
- package/docs/api/foundation-entity-management.entitymanagement.criteriachanged.md +22 -0
- package/docs/api/foundation-entity-management.entitymanagement.defaultentityvalues.md +11 -0
- package/docs/api/foundation-entity-management.entitymanagement.md +4 -0
- package/docs/api/foundation-entity-management.entitymanagement.modalposition.md +13 -0
- package/docs/api/foundation-entity-management.md +1 -0
- package/docs/api-report.md +31 -0
- package/package.json +13 -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 .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`",
|
|
132
|
+
"default": "css`\n :host {\n contain: content;\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 :host::part(header) {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n`",
|
|
133
133
|
"description": "Defines the css of the entity component as an ElementStyles object"
|
|
134
134
|
}
|
|
135
135
|
],
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
{
|
|
152
152
|
"kind": "variable",
|
|
153
153
|
"name": "template",
|
|
154
|
-
"default": "html<EntityManagement>`\n <div class=\"container\">\n <entity-list\n title=${(x) => x.title}\n persist-column-state-key=${(x) => x.persistColumnStateKey}\n size-columns-to-fit=${(x) => x.sizeColumnsToFit}\n enable-filter-bar=${(x) => x.enableFilterBar}\n resourceName=${(x) => x.resourceName}\n :
|
|
154
|
+
"default": "html<EntityManagement>`\n <div class=\"container\">\n <slot name=\"header\" part=\"header\">${defaultHeader}</slot>\n <entity-list\n title=${(x) => x.title}\n persist-column-state-key=${(x) => x.persistColumnStateKey}\n size-columns-to-fit=${(x) => x.sizeColumnsToFit}\n enable-filter-bar=${(x) => x.enableFilterBar}\n resourceName=${(x) => x.resourceName}\n :deleteEvent=${(x) => x.deleteEvent}\n :updateEvent=${(x) => x.updateEvent}\n :columns=${(x) => x.columns}\n :datasourceConfig=${(x) => x.datasourceConfig}\n data-test-id=\"entity-list\"\n >\n <slot name=\"header\" slot=\"header\">${defaultHeader}</slot>\n </entity-list>\n <zero-modal\n ${ref('editEntityModal')}\n position=${(x) => x.modalPosition}\n :onCloseCallback=${(x) => x.closeModal.bind(x)}\n data-test-id=\"edit-entity-modal\"\n >\n <div slot=\"top\" data-test-id=\"dialog-title\">${(x) => x.editDialogTitle}</div>\n\n <slot name=\"edit\">\n ${when(\n (x) => x.editModalVisible,\n html<EntityManagement>`\n <foundation-form\n part=\"form\"\n resourceName=${(x) => x.formResourceName}\n :data=${(x) => x.editedEntity}\n :uischema=${(x) => x.formUiSchema}\n @submit-success=${(x, c) => x.submitEntityChanges(c.event as CustomEvent)}\n @submit-failure=${(x, c) =>\n x.errorSnack((c.event as CustomEvent<{ errors: MessageError[] }>).detail.errors)}\n ></foundation-form>\n `\n )}\n </slot>\n </zero-modal>\n </div>\n`",
|
|
155
155
|
"description": "Defines the html of the entity component as a ViewTemplate object"
|
|
156
156
|
}
|
|
157
157
|
],
|
|
@@ -333,6 +333,13 @@
|
|
|
333
333
|
"text": "boolean"
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
|
+
{
|
|
337
|
+
"kind": "field",
|
|
338
|
+
"name": "defaultEntityValues",
|
|
339
|
+
"type": {
|
|
340
|
+
"text": "any"
|
|
341
|
+
}
|
|
342
|
+
},
|
|
336
343
|
{
|
|
337
344
|
"kind": "field",
|
|
338
345
|
"name": "editDialogTitle",
|
|
@@ -382,6 +389,16 @@
|
|
|
382
389
|
"text": "boolean"
|
|
383
390
|
}
|
|
384
391
|
},
|
|
392
|
+
{
|
|
393
|
+
"kind": "field",
|
|
394
|
+
"name": "modalPosition",
|
|
395
|
+
"type": {
|
|
396
|
+
"text": "'centre' | 'left' | 'right'"
|
|
397
|
+
},
|
|
398
|
+
"default": "'right'",
|
|
399
|
+
"description": "Determines where the modal dialog will appear on screen",
|
|
400
|
+
"privacy": "public"
|
|
401
|
+
},
|
|
385
402
|
{
|
|
386
403
|
"kind": "method",
|
|
387
404
|
"name": "deepClone",
|
|
@@ -408,6 +425,12 @@
|
|
|
408
425
|
],
|
|
409
426
|
"description": "Event handler for when the user submits the action for the currently open form, either editing or adding the entity"
|
|
410
427
|
},
|
|
428
|
+
{
|
|
429
|
+
"kind": "method",
|
|
430
|
+
"name": "create",
|
|
431
|
+
"privacy": "public",
|
|
432
|
+
"description": "Show the entity create form"
|
|
433
|
+
},
|
|
411
434
|
{
|
|
412
435
|
"kind": "method",
|
|
413
436
|
"name": "readEntity",
|
|
@@ -426,6 +449,19 @@
|
|
|
426
449
|
"name": "closeModal",
|
|
427
450
|
"privacy": "public"
|
|
428
451
|
},
|
|
452
|
+
{
|
|
453
|
+
"kind": "method",
|
|
454
|
+
"name": "criteriaChanged",
|
|
455
|
+
"privacy": "public",
|
|
456
|
+
"parameters": [
|
|
457
|
+
{
|
|
458
|
+
"name": "e",
|
|
459
|
+
"type": {
|
|
460
|
+
"text": "CustomEvent<string>"
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
]
|
|
464
|
+
},
|
|
429
465
|
{
|
|
430
466
|
"kind": "method",
|
|
431
467
|
"name": "confirmDelete",
|
|
@@ -528,6 +564,15 @@
|
|
|
528
564
|
"text": "boolean"
|
|
529
565
|
},
|
|
530
566
|
"fieldName": "enableCellFlashing"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"name": "modal-position",
|
|
570
|
+
"type": {
|
|
571
|
+
"text": "'centre' | 'left' | 'right'"
|
|
572
|
+
},
|
|
573
|
+
"default": "'right'",
|
|
574
|
+
"description": "Determines where the modal dialog will appear on screen",
|
|
575
|
+
"fieldName": "modalPosition"
|
|
531
576
|
}
|
|
532
577
|
],
|
|
533
578
|
"mixins": [
|
|
@@ -665,7 +710,7 @@
|
|
|
665
710
|
{
|
|
666
711
|
"kind": "variable",
|
|
667
712
|
"name": "listStyles",
|
|
668
|
-
"default": "css`\n :host {\n contain: content;\n }\n\n :host,\n fast-router {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n height: inherit;\n width: 100%;\n }\n
|
|
713
|
+
"default": "css`\n :host {\n contain: content;\n }\n\n :host,\n fast-router {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n }\n\n .container {\n display: flex;\n flex-direction: column;\n height: inherit;\n width: 100%;\n }\n`"
|
|
669
714
|
}
|
|
670
715
|
],
|
|
671
716
|
"exports": [
|
|
@@ -683,33 +728,13 @@
|
|
|
683
728
|
"kind": "javascript-module",
|
|
684
729
|
"path": "src/list/list.template.ts",
|
|
685
730
|
"declarations": [
|
|
686
|
-
{
|
|
687
|
-
"kind": "function",
|
|
688
|
-
"name": "buttonCellRenderer",
|
|
689
|
-
"parameters": [
|
|
690
|
-
{
|
|
691
|
-
"name": "title"
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
"name": "clickHandler"
|
|
695
|
-
}
|
|
696
|
-
]
|
|
697
|
-
},
|
|
698
731
|
{
|
|
699
732
|
"kind": "variable",
|
|
700
733
|
"name": "listTemplate",
|
|
701
|
-
"default": "html<List>`\n <div class=\"
|
|
734
|
+
"default": "html<List>`\n <div class=\"container\">\n ${when(\n (x) => x.enableFilterBar,\n html<List>`\n <zero-filter-bar\n resource=${(x) => x.resourceName}\n only=${(x) => x.columns?.map((colDef) => colDef.field).filter((field) => !!field)}\n labels=${(x) => x.columns?.map((colDef) => colDef.headerName || '')}\n target=\"datasource\"\n ></zero-filter-bar>\n `\n )}\n <zero-grid-pro\n ${ref('grid')}\n auto-cell-renderer-by-type\n rowSelection=\"single\"\n rowHeight=\"36\"\n headerHeight=\"36\"\n persist-column-state-key=${(x) => x.persistColumnStateKey}\n ?only-template-col-defs=${(x) => !!x.columns}\n suppressCellFocus=\"true\"\n suppressRowDeselection=\"true\"\n enable-cell-flashing=${(x) => x.enableCellFlashing}\n >\n <grid-pro-genesis-datasource\n ${ref('datasource')}\n resource-name=${(x) => x.resourceName}\n criteria=${(x) => x.datasourceConfig?.criteria}\n fields=${(x) => x.datasourceConfig?.fields}\n is-snapshot=${(x) => x.datasourceConfig?.isSnapshot}\n max-rows=${(x) => x.datasourceConfig?.maxRows}\n max-view=${(x) => x.datasourceConfig?.maxView}\n order-by=${(x) => x.datasourceConfig?.orderBy}\n reverse=${(x) => x.datasourceConfig?.reverse}\n ></grid-pro-genesis-datasource>\n ${repeat(\n (x) => x.columns,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `\n )}\n ${repeat(\n (x) => x.actionButtonsConfig,\n html`\n <grid-pro-column :definition=${(x) => x}></grid-pro-column>\n `\n )}\n </zero-grid-pro>\n </div>\n`"
|
|
702
735
|
}
|
|
703
736
|
],
|
|
704
737
|
"exports": [
|
|
705
|
-
{
|
|
706
|
-
"kind": "js",
|
|
707
|
-
"name": "buttonCellRenderer",
|
|
708
|
-
"declaration": {
|
|
709
|
-
"name": "buttonCellRenderer",
|
|
710
|
-
"module": "src/list/list.template.ts"
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
738
|
{
|
|
714
739
|
"kind": "js",
|
|
715
740
|
"name": "listTemplate",
|
|
@@ -811,13 +836,6 @@
|
|
|
811
836
|
},
|
|
812
837
|
"default": "[]"
|
|
813
838
|
},
|
|
814
|
-
{
|
|
815
|
-
"kind": "field",
|
|
816
|
-
"name": "createEvent",
|
|
817
|
-
"type": {
|
|
818
|
-
"text": "string"
|
|
819
|
-
}
|
|
820
|
-
},
|
|
821
839
|
{
|
|
822
840
|
"kind": "field",
|
|
823
841
|
"name": "deleteEvent",
|
|
@@ -862,11 +880,6 @@
|
|
|
862
880
|
}
|
|
863
881
|
]
|
|
864
882
|
},
|
|
865
|
-
{
|
|
866
|
-
"kind": "method",
|
|
867
|
-
"name": "create",
|
|
868
|
-
"privacy": "public"
|
|
869
|
-
},
|
|
870
883
|
{
|
|
871
884
|
"kind": "field",
|
|
872
885
|
"name": "edit",
|
|
@@ -1399,6 +1412,17 @@
|
|
|
1399
1412
|
"module": "src/entities/entities.ts"
|
|
1400
1413
|
}
|
|
1401
1414
|
},
|
|
1415
|
+
{
|
|
1416
|
+
"kind": "field",
|
|
1417
|
+
"name": "defaultEntityValues",
|
|
1418
|
+
"type": {
|
|
1419
|
+
"text": "any"
|
|
1420
|
+
},
|
|
1421
|
+
"inheritedFrom": {
|
|
1422
|
+
"name": "EntityManagement",
|
|
1423
|
+
"module": "src/entities/entities.ts"
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1402
1426
|
{
|
|
1403
1427
|
"kind": "field",
|
|
1404
1428
|
"name": "editDialogTitle",
|
|
@@ -1476,6 +1500,20 @@
|
|
|
1476
1500
|
"module": "src/entities/entities.ts"
|
|
1477
1501
|
}
|
|
1478
1502
|
},
|
|
1503
|
+
{
|
|
1504
|
+
"kind": "field",
|
|
1505
|
+
"name": "modalPosition",
|
|
1506
|
+
"type": {
|
|
1507
|
+
"text": "'centre' | 'left' | 'right'"
|
|
1508
|
+
},
|
|
1509
|
+
"default": "'right'",
|
|
1510
|
+
"description": "Determines where the modal dialog will appear on screen",
|
|
1511
|
+
"privacy": "public",
|
|
1512
|
+
"inheritedFrom": {
|
|
1513
|
+
"name": "EntityManagement",
|
|
1514
|
+
"module": "src/entities/entities.ts"
|
|
1515
|
+
}
|
|
1516
|
+
},
|
|
1479
1517
|
{
|
|
1480
1518
|
"kind": "method",
|
|
1481
1519
|
"name": "deepClone",
|
|
@@ -1510,6 +1548,16 @@
|
|
|
1510
1548
|
"module": "src/entities/entities.ts"
|
|
1511
1549
|
}
|
|
1512
1550
|
},
|
|
1551
|
+
{
|
|
1552
|
+
"kind": "method",
|
|
1553
|
+
"name": "create",
|
|
1554
|
+
"privacy": "public",
|
|
1555
|
+
"description": "Show the entity create form",
|
|
1556
|
+
"inheritedFrom": {
|
|
1557
|
+
"name": "EntityManagement",
|
|
1558
|
+
"module": "src/entities/entities.ts"
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1513
1561
|
{
|
|
1514
1562
|
"kind": "method",
|
|
1515
1563
|
"name": "readEntity",
|
|
@@ -1536,6 +1584,23 @@
|
|
|
1536
1584
|
"module": "src/entities/entities.ts"
|
|
1537
1585
|
}
|
|
1538
1586
|
},
|
|
1587
|
+
{
|
|
1588
|
+
"kind": "method",
|
|
1589
|
+
"name": "criteriaChanged",
|
|
1590
|
+
"privacy": "public",
|
|
1591
|
+
"parameters": [
|
|
1592
|
+
{
|
|
1593
|
+
"name": "e",
|
|
1594
|
+
"type": {
|
|
1595
|
+
"text": "CustomEvent<string>"
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
],
|
|
1599
|
+
"inheritedFrom": {
|
|
1600
|
+
"name": "EntityManagement",
|
|
1601
|
+
"module": "src/entities/entities.ts"
|
|
1602
|
+
}
|
|
1603
|
+
},
|
|
1539
1604
|
{
|
|
1540
1605
|
"kind": "method",
|
|
1541
1606
|
"name": "confirmDelete",
|
|
@@ -1700,6 +1765,19 @@
|
|
|
1700
1765
|
"name": "EntityManagement",
|
|
1701
1766
|
"module": "src/entities/entities.ts"
|
|
1702
1767
|
}
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
"name": "modal-position",
|
|
1771
|
+
"type": {
|
|
1772
|
+
"text": "'centre' | 'left' | 'right'"
|
|
1773
|
+
},
|
|
1774
|
+
"default": "'right'",
|
|
1775
|
+
"description": "Determines where the modal dialog will appear on screen",
|
|
1776
|
+
"fieldName": "modalPosition",
|
|
1777
|
+
"inheritedFrom": {
|
|
1778
|
+
"name": "EntityManagement",
|
|
1779
|
+
"module": "src/entities/entities.ts"
|
|
1780
|
+
}
|
|
1703
1781
|
}
|
|
1704
1782
|
]
|
|
1705
1783
|
}
|
|
@@ -1932,7 +2010,21 @@
|
|
|
1932
2010
|
{
|
|
1933
2011
|
"kind": "javascript-module",
|
|
1934
2012
|
"path": "src/utils/index.ts",
|
|
1935
|
-
"declarations": [
|
|
2013
|
+
"declarations": [
|
|
2014
|
+
{
|
|
2015
|
+
"kind": "function",
|
|
2016
|
+
"name": "buttonCellRenderer",
|
|
2017
|
+
"parameters": [
|
|
2018
|
+
{
|
|
2019
|
+
"name": "title"
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
"name": "clickHandler"
|
|
2023
|
+
}
|
|
2024
|
+
],
|
|
2025
|
+
"privacy": "public"
|
|
2026
|
+
}
|
|
2027
|
+
],
|
|
1936
2028
|
"exports": [
|
|
1937
2029
|
{
|
|
1938
2030
|
"kind": "js",
|
|
@@ -1949,6 +2041,14 @@
|
|
|
1949
2041
|
"name": "*",
|
|
1950
2042
|
"package": "./logger"
|
|
1951
2043
|
}
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
"kind": "js",
|
|
2047
|
+
"name": "buttonCellRenderer",
|
|
2048
|
+
"declaration": {
|
|
2049
|
+
"name": "buttonCellRenderer",
|
|
2050
|
+
"module": "src/utils/index.ts"
|
|
2051
|
+
}
|
|
1952
2052
|
}
|
|
1953
2053
|
]
|
|
1954
2054
|
},
|
|
@@ -129,19 +129,7 @@ declare const EntityManagement_base: (new (...args: any[]) => {
|
|
|
129
129
|
requestPointerLock(): void;
|
|
130
130
|
scroll(options?: ScrollToOptions): void;
|
|
131
131
|
scroll(x: number, y: number): void;
|
|
132
|
-
/**
|
|
133
|
-
* Updates the reference to the current entity stored in the class. Added as an event listener on the class when receiving the `rowSelected` event.
|
|
134
|
-
*
|
|
135
|
-
* @param e - CustomEvent which contains data about the selected entity. If the row is not selected then the reference will be set to an empty object.
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
132
|
scrollBy(options?: ScrollToOptions): void;
|
|
139
|
-
/**
|
|
140
|
-
* Updates the reference to the current entity stored in the class. Added as an event listener on the class when receiving the `rowSelected` event.
|
|
141
|
-
*
|
|
142
|
-
* @param e - CustomEvent which contains data about the selected entity. If the row is not selected then the reference will be set to an empty object.
|
|
143
|
-
* @internal
|
|
144
|
-
*/
|
|
145
133
|
scrollBy(x: number, y: number): void;
|
|
146
134
|
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
147
135
|
scrollTo(options?: ScrollToOptions): void;
|
|
@@ -191,6 +179,12 @@ declare const EntityManagement_base: (new (...args: any[]) => {
|
|
|
191
179
|
readonly DOCUMENT_POSITION_FOLLOWING: number;
|
|
192
180
|
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
|
|
193
181
|
readonly DOCUMENT_POSITION_PRECEDING: number;
|
|
182
|
+
/**
|
|
183
|
+
* Handler for deleting the entity. Added as an event listener on the class when receiving the `delete-entity` event.
|
|
184
|
+
*
|
|
185
|
+
* @param e - CustomEvent where `e.detail` contains data to update the selectedEntity reference with the entity to delete.
|
|
186
|
+
* @internal
|
|
187
|
+
*/
|
|
194
188
|
readonly DOCUMENT_TYPE_NODE: number;
|
|
195
189
|
readonly ELEMENT_NODE: number;
|
|
196
190
|
readonly ENTITY_NODE: number;
|
|
@@ -497,6 +491,7 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
497
491
|
*/
|
|
498
492
|
editedEntity: any;
|
|
499
493
|
submitting: boolean;
|
|
494
|
+
defaultEntityValues: any;
|
|
500
495
|
/**
|
|
501
496
|
* String which contains the text of the popup modal when the user is adding or editing an entity
|
|
502
497
|
*/
|
|
@@ -507,6 +502,11 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
507
502
|
sizeColumnsToFit: boolean;
|
|
508
503
|
enableFilterBar: boolean;
|
|
509
504
|
enableCellFlashing: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Determines where the modal dialog will appear on screen
|
|
507
|
+
* @public
|
|
508
|
+
*/
|
|
509
|
+
modalPosition: 'centre' | 'left' | 'right';
|
|
510
510
|
/**
|
|
511
511
|
* Set up the web component
|
|
512
512
|
* @internal
|
|
@@ -526,6 +526,11 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
526
526
|
* @public
|
|
527
527
|
*/
|
|
528
528
|
submitEntityChanges(e: CustomEvent): Promise<void>;
|
|
529
|
+
/**
|
|
530
|
+
* Show the entity create form
|
|
531
|
+
* @public
|
|
532
|
+
*/
|
|
533
|
+
create(): void;
|
|
529
534
|
/**
|
|
530
535
|
* Updates the reference to the current entity stored in the class. Added as an event listener on the class when receiving the `rowSelected` event.
|
|
531
536
|
*
|
|
@@ -542,6 +547,7 @@ export declare class EntityManagement extends EntityManagement_base {
|
|
|
542
547
|
private editEntity;
|
|
543
548
|
private readEntity;
|
|
544
549
|
closeModal(): void;
|
|
550
|
+
criteriaChanged(e: CustomEvent<string>): void;
|
|
545
551
|
/**
|
|
546
552
|
* Handler for deleting the entity. Added as an event listener on the class when receiving the `delete-entity` event.
|
|
547
553
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AASzF,OAAO,EAAuB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAKvF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AASzF,OAAO,EAAuB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AAKvF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8RxF;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAjSL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAKa,gBAAiB,SAAQ,qBAA2B;IAC/D;;;;;;;OAOG;IACM,SAAS,CAAC,OAAO,EAAG,OAAO,CAAC;IAErC;;;OAGG;IACG,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,CAAC,GAAG,IAAI,OAAA,KAAK,EAAE,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAE7C;;;OAGG;IACG,WAAW,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACG,WAAW,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACG,WAAW,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACG,KAAK,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACG,WAAW,EAAE,MAAM,CAAM;IAE/B;;;;;;;;;;OAUG;IAC8C,qBAAqB,EAAE,MAAM,CAAC;IAE/E;;;OAGG;IACS,OAAO,EAAE,MAAM,EAAE,CAAC;IAE9B;;;;;;;OAOG;IACS,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,YAAY,EAAE,GAAG,CAAC;IAClB,kBAAkB,EAAE,GAAG,CAAC;IACxB,kBAAkB,EAAE,GAAG,CAAC;IAEpC;;;OAGG;IACS,gBAAgB,EAAE,MAAM,CAAC;IAErC;;;;;;;OAOG;IACS,cAAc,EAAE,GAAG,CAAC;IAGhC;;;OAGG;IACS,YAAY,EAAE,GAAG,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IAEpB,mBAAmB,EAAE,GAAG,CAAC;IAErC;;OAEG;IACS,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAS;IAC9C,uBAAuB;IAShB,eAAe,EAAE,GAAG,CAAC;IAEiC,gBAAgB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAE1F;;;OAGG;IACoC,aAAa,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAW;IAE5F;;;OAGG;IACG,iBAAiB;IAavB;;;OAGG;IACM,SAAS,IAAI,IAAI;IAc1B;;;;;;;OAOG;IACU,mBAAmB,CAAC,CAAC,EAAE,WAAW;IAI/C;;;OAGG;IACI,MAAM;IAIb;;;;;OAKG;IACH,OAAO,CAAC,YAAY,CAElB;IAEF;;;;;OAKG;YACW,UAAU;IA4BxB,OAAO,CAAC,UAAU;IAMX,UAAU;IAKV,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAI7C;;;;;OAKG;IACG,YAAY,CAAC,CAAC,EAAE,WAAW;YAKnB,aAAa;IAoB3B,OAAO,CAAC,sBAAsB;IAgB9B;;;OAGG;IACI,WAAW,CAAC,OAAO,KAAA;IAuB1B;;OAEG;IACI,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE;CAexC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.styles.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.styles.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"entities.styles.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.styles.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,iDA4BlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.template.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.template.d.ts","sourceRoot":"","sources":["../../../src/entities/entities.template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAmB9C;;;GAGG;AACH,eAAO,MAAM,QAAQ,uEA2CpB,CAAC"}
|
package/dist/dts/list/list.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare class List extends FASTElement {
|
|
|
14
14
|
columns: ColDef[];
|
|
15
15
|
datasourceConfig: DatasourceConfiguration;
|
|
16
16
|
actionButtonsConfig: any[];
|
|
17
|
-
createEvent: string;
|
|
18
17
|
deleteEvent: string;
|
|
19
18
|
updateEvent: string;
|
|
20
19
|
connectedCallback(): void;
|
|
@@ -22,7 +21,6 @@ export declare class List extends FASTElement {
|
|
|
22
21
|
private handleFilterChanged;
|
|
23
22
|
private handleFilterCleared;
|
|
24
23
|
private select;
|
|
25
|
-
create(): void;
|
|
26
24
|
private edit;
|
|
27
25
|
delete(e: any): Promise<void>;
|
|
28
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/list/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAuB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/list/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAuB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAK/D,qBAKa,IAAK,SAAQ,WAAW;IAC7B,YAAY,EAAE,MAAM,CAAM;IAC1B,KAAK,EAAE,MAAM,CAAM;IACwB,qBAAqB,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IACnF,IAAI,EAAG,WAAW,CAAC;IACnB,UAAU,EAAG,wBAAwB,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,uBAAuB,CAAC;IAC1C,mBAAmB,QAAM;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAEhC,iBAAiB;IA4BjB,oBAAoB,IAAI,IAAI;IAQ5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI,CAEV;IAEI,MAAM,CAAC,CAAC,KAAA;CAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.styles.d.ts","sourceRoot":"","sources":["../../../src/list/list.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"list.styles.d.ts","sourceRoot":"","sources":["../../../src/list/list.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,iDAmBtB,CAAC"}
|
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
import { List } from './list';
|
|
2
|
-
export declare const buttonCellRenderer: (title: any, clickHandler: any) => {
|
|
3
|
-
width: number;
|
|
4
|
-
pinned: string;
|
|
5
|
-
enableCellChangeFlash: boolean;
|
|
6
|
-
cellStyle: {
|
|
7
|
-
padding: string;
|
|
8
|
-
lineHeight: string;
|
|
9
|
-
};
|
|
10
|
-
filter: boolean;
|
|
11
|
-
suppressFiltersToolPanel: boolean;
|
|
12
|
-
suppressColumnsToolPanel: boolean;
|
|
13
|
-
headerName: string;
|
|
14
|
-
minWidth: number;
|
|
15
|
-
maxWidth: number;
|
|
16
|
-
cellRendererSelector: (params: any) => {
|
|
17
|
-
component: string;
|
|
18
|
-
params: {
|
|
19
|
-
actionClick: any;
|
|
20
|
-
actionName: any;
|
|
21
|
-
appearance: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
2
|
export declare const listTemplate: import("@microsoft/fast-element").ViewTemplate<List, any>;
|
|
26
3
|
//# sourceMappingURL=list.template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.template.d.ts","sourceRoot":"","sources":["../../../src/list/list.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"list.template.d.ts","sourceRoot":"","sources":["../../../src/list/list.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY,2DAkDxB,CAAC"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
export * from './formatting';
|
|
2
2
|
export * from './logger';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const buttonCellRenderer: (title: any, clickHandler: any) => {
|
|
7
|
+
width: number;
|
|
8
|
+
pinned: string;
|
|
9
|
+
enableCellChangeFlash: boolean;
|
|
10
|
+
cellStyle: {
|
|
11
|
+
padding: string;
|
|
12
|
+
lineHeight: string;
|
|
13
|
+
};
|
|
14
|
+
filter: boolean;
|
|
15
|
+
suppressFiltersToolPanel: boolean;
|
|
16
|
+
suppressColumnsToolPanel: boolean;
|
|
17
|
+
headerName: string;
|
|
18
|
+
minWidth: number;
|
|
19
|
+
maxWidth: number;
|
|
20
|
+
cellRendererSelector: (params: any) => {
|
|
21
|
+
component: string;
|
|
22
|
+
params: {
|
|
23
|
+
actionClick: any;
|
|
24
|
+
actionName: any;
|
|
25
|
+
appearance: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
3
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;CAsB7B,CAAC"}
|
|
@@ -46,6 +46,11 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
46
46
|
*/
|
|
47
47
|
this.entityLabel = '';
|
|
48
48
|
this.editModalVisible = false;
|
|
49
|
+
/**
|
|
50
|
+
* Determines where the modal dialog will appear on screen
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
this.modalPosition = 'right';
|
|
49
54
|
/**
|
|
50
55
|
* Updates the reference to the current entity stored in the class. Added as an event listener on the class when receiving the `rowSelected` event.
|
|
51
56
|
*
|
|
@@ -82,6 +87,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
82
87
|
}
|
|
83
88
|
this.addEventListener('edit-entity', this.editEntity);
|
|
84
89
|
this.addEventListener('read-entity', this.readEntity);
|
|
90
|
+
this.addEventListener('criteria-changed', this.criteriaChanged);
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
93
|
/**
|
|
@@ -114,6 +120,13 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
114
120
|
this.closeModal();
|
|
115
121
|
});
|
|
116
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Show the entity create form
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
create() {
|
|
128
|
+
this.editEntity();
|
|
129
|
+
}
|
|
117
130
|
/**
|
|
118
131
|
* Sets up and opens the model to either edit or add an entity. Added as an event listener on the class when receiving the `edit-entity` event.
|
|
119
132
|
*
|
|
@@ -122,10 +135,10 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
122
135
|
*/
|
|
123
136
|
editEntity(e) {
|
|
124
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
this.editDialogTitle = `${e.detail ? 'Edit' : 'Add'} ${this.entityLabel}`;
|
|
126
|
-
this.formUiSchema = e.detail ? this.updateFormUiSchema : this.createFormUiSchema;
|
|
127
|
-
this.formResourceName = e.detail ? this.updateEvent : this.createEvent;
|
|
128
|
-
if (e.detail) {
|
|
138
|
+
this.editDialogTitle = `${(e === null || e === void 0 ? void 0 : e.detail) ? 'Edit' : 'Add'} ${this.entityLabel}`;
|
|
139
|
+
this.formUiSchema = (e === null || e === void 0 ? void 0 : e.detail) ? this.updateFormUiSchema : this.createFormUiSchema;
|
|
140
|
+
this.formResourceName = (e === null || e === void 0 ? void 0 : e.detail) ? this.updateEvent : this.createEvent;
|
|
141
|
+
if (e === null || e === void 0 ? void 0 : e.detail) {
|
|
129
142
|
const _a = e.detail, { ROW_REF } = _a, formData = __rest(_a, ["ROW_REF"]);
|
|
130
143
|
this.editedEntity = formData;
|
|
131
144
|
if (this.readEventFn) {
|
|
@@ -140,7 +153,7 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
140
153
|
}
|
|
141
154
|
}
|
|
142
155
|
else {
|
|
143
|
-
this.editedEntity = {};
|
|
156
|
+
this.editedEntity = Object.assign({}, this.defaultEntityValues);
|
|
144
157
|
}
|
|
145
158
|
this.editModalVisible = true;
|
|
146
159
|
});
|
|
@@ -154,6 +167,9 @@ let EntityManagement = class EntityManagement extends LifecycleMixin(FASTElement
|
|
|
154
167
|
this.readonly = false;
|
|
155
168
|
this.editModalVisible = false;
|
|
156
169
|
}
|
|
170
|
+
criteriaChanged(e) {
|
|
171
|
+
this.datasourceConfig = Object.assign(Object.assign({}, this.datasourceConfig), { criteria: e.detail });
|
|
172
|
+
}
|
|
157
173
|
/**
|
|
158
174
|
* Handler for deleting the entity. Added as an event listener on the class when receiving the `delete-entity` event.
|
|
159
175
|
*
|
|
@@ -292,6 +308,9 @@ __decorate([
|
|
|
292
308
|
__decorate([
|
|
293
309
|
observable
|
|
294
310
|
], EntityManagement.prototype, "submitting", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
observable
|
|
313
|
+
], EntityManagement.prototype, "defaultEntityValues", void 0);
|
|
295
314
|
__decorate([
|
|
296
315
|
observable
|
|
297
316
|
], EntityManagement.prototype, "editDialogTitle", void 0);
|
|
@@ -307,6 +326,9 @@ __decorate([
|
|
|
307
326
|
__decorate([
|
|
308
327
|
attr({ mode: 'boolean', attribute: 'enable-cell-flashing' })
|
|
309
328
|
], EntityManagement.prototype, "enableCellFlashing", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
attr({ attribute: 'modal-position' })
|
|
331
|
+
], EntityManagement.prototype, "modalPosition", void 0);
|
|
310
332
|
EntityManagement = __decorate([
|
|
311
333
|
customElement({
|
|
312
334
|
name: 'entity-management',
|
|
@@ -3,28 +3,40 @@ import { html, ref, when } from '@microsoft/fast-element';
|
|
|
3
3
|
import { List } from '../list';
|
|
4
4
|
List;
|
|
5
5
|
Form;
|
|
6
|
+
/**
|
|
7
|
+
* Default header for Entity Management screen
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
const defaultHeader = html `
|
|
11
|
+
<h3>${(x) => x.title}</h3>
|
|
12
|
+
${when((x) => x.createEvent, html `
|
|
13
|
+
<zero-button appearance="accent" @click=${(x, y) => x.create()}>Add</zero-button>
|
|
14
|
+
`)}
|
|
15
|
+
`;
|
|
6
16
|
/**
|
|
7
17
|
* Defines the html of the entity component as a ViewTemplate object
|
|
8
18
|
* @typeParam EntityManagement - the {@link EntityManagement | class} the template is defined for
|
|
9
19
|
*/
|
|
10
20
|
export const template = html `
|
|
11
21
|
<div class="container">
|
|
22
|
+
<slot name="header" part="header">${defaultHeader}</slot>
|
|
12
23
|
<entity-list
|
|
13
24
|
title=${(x) => x.title}
|
|
14
25
|
persist-column-state-key=${(x) => x.persistColumnStateKey}
|
|
15
26
|
size-columns-to-fit=${(x) => x.sizeColumnsToFit}
|
|
16
27
|
enable-filter-bar=${(x) => x.enableFilterBar}
|
|
17
28
|
resourceName=${(x) => x.resourceName}
|
|
18
|
-
:createEvent=${(x) => x.createEvent}
|
|
19
29
|
:deleteEvent=${(x) => x.deleteEvent}
|
|
20
30
|
:updateEvent=${(x) => x.updateEvent}
|
|
21
31
|
:columns=${(x) => x.columns}
|
|
22
32
|
:datasourceConfig=${(x) => x.datasourceConfig}
|
|
23
33
|
data-test-id="entity-list"
|
|
24
|
-
|
|
34
|
+
>
|
|
35
|
+
<slot name="header" slot="header">${defaultHeader}</slot>
|
|
36
|
+
</entity-list>
|
|
25
37
|
<zero-modal
|
|
26
38
|
${ref('editEntityModal')}
|
|
27
|
-
position
|
|
39
|
+
position=${(x) => x.modalPosition}
|
|
28
40
|
:onCloseCallback=${(x) => x.closeModal.bind(x)}
|
|
29
41
|
data-test-id="edit-entity-modal"
|
|
30
42
|
>
|
|
@@ -33,6 +45,7 @@ export const template = html `
|
|
|
33
45
|
<slot name="edit">
|
|
34
46
|
${when((x) => x.editModalVisible, html `
|
|
35
47
|
<foundation-form
|
|
48
|
+
part="form"
|
|
36
49
|
resourceName=${(x) => x.formResourceName}
|
|
37
50
|
:data=${(x) => x.editedEntity}
|
|
38
51
|
:uischema=${(x) => x.formUiSchema}
|