@sprucelabs/spruce-location-utils 9.4.1 → 9.4.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ActiveRecordCardViewController, Button, Card } from '@sprucelabs/heartwood-view-controllers';
|
|
1
|
+
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ActiveRecordCardViewController, Button, Card, CardHeader } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Location } from '@sprucelabs/spruce-core-schemas';
|
|
3
3
|
export default class LocationListCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
@@ -30,6 +30,7 @@ export type LocationListCardViewControllerOptions = {
|
|
|
30
30
|
selectedLocationId?: string;
|
|
31
31
|
footerButtons?: Button[];
|
|
32
32
|
shouldRenderDeleteButtons?: boolean;
|
|
33
|
+
header?: CardHeader;
|
|
33
34
|
id?: string;
|
|
34
35
|
};
|
|
35
36
|
export type LocationListLoadOptions = SpruceSchemas.Mercury.v2020_12_25.ListLocationsEmitTargetAndPayload;
|
|
@@ -12,7 +12,7 @@ import { locationRenderer } from '@sprucelabs/spruce-skill-utils';
|
|
|
12
12
|
class LocationListCardViewController extends AbstractViewController {
|
|
13
13
|
constructor(options) {
|
|
14
14
|
super(options);
|
|
15
|
-
const { id, onDelete, selectedLocationId, footerButtons, currentOrganizationId, onClick, shouldRenderDeleteButtons, } = options;
|
|
15
|
+
const { id, onDelete, selectedLocationId, footerButtons, currentOrganizationId, onClick, shouldRenderDeleteButtons, header, } = options;
|
|
16
16
|
this.shouldRenderDeleteButtons = shouldRenderDeleteButtons !== null && shouldRenderDeleteButtons !== void 0 ? shouldRenderDeleteButtons : false;
|
|
17
17
|
this.onDeleteHandler = onDelete;
|
|
18
18
|
this.selectedLocationId = selectedLocationId;
|
|
@@ -21,14 +21,15 @@ class LocationListCardViewController extends AbstractViewController {
|
|
|
21
21
|
id,
|
|
22
22
|
currentOrganizationId,
|
|
23
23
|
footerButtons,
|
|
24
|
+
header,
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
ActiveRecordCardVc(options) {
|
|
27
|
-
const { currentOrganizationId, footerButtons, id } = options;
|
|
28
|
+
const { currentOrganizationId, footerButtons, id, header } = options;
|
|
28
29
|
return this.Controller('activeRecordCard', buildActiveRecordCard({
|
|
29
30
|
id,
|
|
30
31
|
columnWidths: this.onClickHandler ? ['fill'] : ['content', 'fill'],
|
|
31
|
-
header: {
|
|
32
|
+
header: header !== null && header !== void 0 ? header : {
|
|
32
33
|
title: 'Your locations',
|
|
33
34
|
},
|
|
34
35
|
eventName: 'list-locations::v2020_12_25',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ActiveRecordCardViewController, Button, Card } from '@sprucelabs/heartwood-view-controllers';
|
|
1
|
+
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ActiveRecordCardViewController, Button, Card, CardHeader } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { Location } from '@sprucelabs/spruce-core-schemas';
|
|
3
3
|
export default class LocationListCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
@@ -30,6 +30,7 @@ export type LocationListCardViewControllerOptions = {
|
|
|
30
30
|
selectedLocationId?: string;
|
|
31
31
|
footerButtons?: Button[];
|
|
32
32
|
shouldRenderDeleteButtons?: boolean;
|
|
33
|
+
header?: CardHeader;
|
|
33
34
|
id?: string;
|
|
34
35
|
};
|
|
35
36
|
export type LocationListLoadOptions = SpruceSchemas.Mercury.v2020_12_25.ListLocationsEmitTargetAndPayload;
|
|
@@ -5,7 +5,7 @@ const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
|
5
5
|
class LocationListCardViewController extends heartwood_view_controllers_1.AbstractViewController {
|
|
6
6
|
constructor(options) {
|
|
7
7
|
super(options);
|
|
8
|
-
const { id, onDelete, selectedLocationId, footerButtons, currentOrganizationId, onClick, shouldRenderDeleteButtons, } = options;
|
|
8
|
+
const { id, onDelete, selectedLocationId, footerButtons, currentOrganizationId, onClick, shouldRenderDeleteButtons, header, } = options;
|
|
9
9
|
this.shouldRenderDeleteButtons = shouldRenderDeleteButtons !== null && shouldRenderDeleteButtons !== void 0 ? shouldRenderDeleteButtons : false;
|
|
10
10
|
this.onDeleteHandler = onDelete;
|
|
11
11
|
this.selectedLocationId = selectedLocationId;
|
|
@@ -14,14 +14,15 @@ class LocationListCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
14
14
|
id,
|
|
15
15
|
currentOrganizationId,
|
|
16
16
|
footerButtons,
|
|
17
|
+
header,
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
ActiveRecordCardVc(options) {
|
|
20
|
-
const { currentOrganizationId, footerButtons, id } = options;
|
|
21
|
+
const { currentOrganizationId, footerButtons, id, header } = options;
|
|
21
22
|
return this.Controller('activeRecordCard', (0, heartwood_view_controllers_1.buildActiveRecordCard)({
|
|
22
23
|
id,
|
|
23
24
|
columnWidths: this.onClickHandler ? ['fill'] : ['content', 'fill'],
|
|
24
|
-
header: {
|
|
25
|
+
header: header !== null && header !== void 0 ? header : {
|
|
25
26
|
title: 'Your locations',
|
|
26
27
|
},
|
|
27
28
|
eventName: 'list-locations::v2020_12_25',
|