@sprucelabs/spruce-people-utils 1.0.16 → 1.0.17

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.
@@ -7,6 +7,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
7
7
  protected shouldIgnoreNextChange: boolean;
8
8
  constructor(options: ViewControllerOptions & PersonSelectInputOptions);
9
9
  private handleFocusInput;
10
+ private renderAnonSuggestion;
10
11
  private handleOnChangeRenderedValue;
11
12
  private populateSuggestions;
12
13
  private handleClickInviteAnonymous;
@@ -25,16 +25,17 @@ export default class PersonSelectInputViewController extends AbstractViewControl
25
25
  handleFocusInput() {
26
26
  return __awaiter(this, void 0, void 0, function* () {
27
27
  if (this.autoCompleteVc.getRenderedValue() === '') {
28
- this.autoCompleteVc.showSuggestions([
29
- {
30
- id: 'anonymous',
31
- label: 'Add anonymous',
32
- onClick: this.handleClickInviteAnonymous.bind(this),
33
- },
34
- ]);
28
+ this.autoCompleteVc.showSuggestions([this.renderAnonSuggestion()]);
35
29
  }
36
30
  });
37
31
  }
32
+ renderAnonSuggestion() {
33
+ return {
34
+ id: 'anonymous',
35
+ label: 'Add anonymous',
36
+ onClick: this.handleClickInviteAnonymous.bind(this),
37
+ };
38
+ }
38
39
  handleOnChangeRenderedValue(value) {
39
40
  return __awaiter(this, void 0, void 0, function* () {
40
41
  if (!this.shouldIgnoreNextChange && value.length > 2) {
@@ -56,11 +57,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
56
57
  label: 'Invite person',
57
58
  onClick: this.handleClickInvitePerson.bind(this),
58
59
  },
59
- {
60
- id: 'anonymous',
61
- label: 'Add anonymously',
62
- onClick: this.handleClickInviteAnonymous.bind(this),
63
- },
60
+ this.renderAnonSuggestion(),
64
61
  ]);
65
62
  }
66
63
  catch (err) {
@@ -7,6 +7,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
7
7
  protected shouldIgnoreNextChange: boolean;
8
8
  constructor(options: ViewControllerOptions & PersonSelectInputOptions);
9
9
  private handleFocusInput;
10
+ private renderAnonSuggestion;
10
11
  private handleOnChangeRenderedValue;
11
12
  private populateSuggestions;
12
13
  private handleClickInviteAnonymous;
@@ -40,15 +40,16 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
40
40
  }
41
41
  async handleFocusInput() {
42
42
  if (this.autoCompleteVc.getRenderedValue() === '') {
43
- this.autoCompleteVc.showSuggestions([
44
- {
45
- id: 'anonymous',
46
- label: 'Add anonymous',
47
- onClick: this.handleClickInviteAnonymous.bind(this),
48
- },
49
- ]);
43
+ this.autoCompleteVc.showSuggestions([this.renderAnonSuggestion()]);
50
44
  }
51
45
  }
46
+ renderAnonSuggestion() {
47
+ return {
48
+ id: 'anonymous',
49
+ label: 'Add anonymous',
50
+ onClick: this.handleClickInviteAnonymous.bind(this),
51
+ };
52
+ }
52
53
  async handleOnChangeRenderedValue(value) {
53
54
  if (!this.shouldIgnoreNextChange && value.length > 2) {
54
55
  await this.populateSuggestions(value);
@@ -67,11 +68,7 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
67
68
  label: 'Invite person',
68
69
  onClick: this.handleClickInvitePerson.bind(this),
69
70
  },
70
- {
71
- id: 'anonymous',
72
- label: 'Add anonymously',
73
- onClick: this.handleClickInviteAnonymous.bind(this),
74
- },
71
+ this.renderAnonSuggestion(),
75
72
  ]);
76
73
  }
77
74
  catch (err) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-people-utils",
3
3
  "description": "People Utilities",
4
- "version": "1.0.16",
4
+ "version": "1.0.17",
5
5
  "skill": {
6
6
  "namespace": "invite"
7
7
  },