@sprucelabs/spruce-profile-utils 3.1.2 → 3.2.0

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,5 +1,5 @@
1
1
  import { Locale } from '@sprucelabs/calendar-utils';
2
- import { AbstractViewController, Authenticator, Card, CardViewController, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
2
+ import { AbstractViewController, Authenticator, Card, CardHeader, CardViewController, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { Person, PersonSchema } from '../profile.types';
4
4
  export default class ProfileCardViewController extends AbstractViewController<Card> {
5
5
  static id: string;
@@ -27,4 +27,5 @@ export interface ProfileCardLoadOptions {
27
27
  export type OnSubmitHandler = (person: Person) => Promise<void>;
28
28
  export interface ProfileCardViewControllerOptions {
29
29
  onSubmit?: OnSubmitHandler;
30
+ header?: CardHeader;
30
31
  }
@@ -14,17 +14,15 @@ import { personSchema } from '@sprucelabs/spruce-core-schemas';
14
14
  class ProfileCardViewController extends AbstractViewController {
15
15
  constructor(options) {
16
16
  super(options);
17
- const { onSubmit } = options;
17
+ const { onSubmit, header } = options;
18
18
  this.onSubmitHandler = onSubmit;
19
19
  this.formVc = this.FormVc();
20
- this.cardVc = this.CardVc();
20
+ this.cardVc = this.CardVc(header);
21
21
  }
22
- CardVc() {
22
+ CardVc(header) {
23
23
  return this.Controller('card', {
24
24
  id: 'profile',
25
- header: {
26
- title: 'Your profile',
27
- },
25
+ header: Object.assign({ title: 'Your profile' }, header),
28
26
  body: {
29
27
  isBusy: true,
30
28
  sections: [{ form: this.formVc.render() }],
@@ -1,5 +1,5 @@
1
1
  import { Locale } from '@sprucelabs/calendar-utils';
2
- import { AbstractViewController, Authenticator, Card, CardViewController, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
2
+ import { AbstractViewController, Authenticator, Card, CardHeader, CardViewController, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { Person, PersonSchema } from '../profile.types';
4
4
  export default class ProfileCardViewController extends AbstractViewController<Card> {
5
5
  static id: string;
@@ -27,4 +27,5 @@ export interface ProfileCardLoadOptions {
27
27
  export type OnSubmitHandler = (person: Person) => Promise<void>;
28
28
  export interface ProfileCardViewControllerOptions {
29
29
  onSubmit?: OnSubmitHandler;
30
+ header?: CardHeader;
30
31
  }
@@ -7,17 +7,15 @@ const spruce_core_schemas_1 = require("@sprucelabs/spruce-core-schemas");
7
7
  class ProfileCardViewController extends heartwood_view_controllers_1.AbstractViewController {
8
8
  constructor(options) {
9
9
  super(options);
10
- const { onSubmit } = options;
10
+ const { onSubmit, header } = options;
11
11
  this.onSubmitHandler = onSubmit;
12
12
  this.formVc = this.FormVc();
13
- this.cardVc = this.CardVc();
13
+ this.cardVc = this.CardVc(header);
14
14
  }
15
- CardVc() {
15
+ CardVc(header) {
16
16
  return this.Controller('card', {
17
17
  id: 'profile',
18
- header: {
19
- title: 'Your profile',
20
- },
18
+ header: Object.assign({ title: 'Your profile' }, header),
21
19
  body: {
22
20
  isBusy: true,
23
21
  sections: [{ form: this.formVc.render() }],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-profile-utils",
3
3
  "description": "Useeful utilities",
4
- "version": "3.1.2",
4
+ "version": "3.2.0",
5
5
  "skill": {
6
6
  "namespace": "profile"
7
7
  },