@sprucelabs/spruce-people-utils 3.6.9 → 3.7.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.
|
@@ -31,6 +31,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
|
|
|
31
31
|
getRenderedValue(): any;
|
|
32
32
|
protected loadCurrentPerson(): Promise<void>;
|
|
33
33
|
private _loadCurrentPerson;
|
|
34
|
+
reload(): Promise<void>;
|
|
34
35
|
render(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.AutocompleteInput;
|
|
35
36
|
}
|
|
36
37
|
type AutocompleteInput = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.AutocompleteInput;
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { AbstractViewController, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
|
-
import { isValidNumber } from '@sprucelabs/schema';
|
|
11
|
+
import { formatPhoneNumber, isValidNumber } from '@sprucelabs/schema';
|
|
12
12
|
import InvitePersonCardViewController from '../inviting/InvitePersonCard.vc.js';
|
|
13
13
|
import searchPeopleToSuggestions, { renderLabel, } from './searchPeopleToSuggestions.js';
|
|
14
14
|
class PersonSelectInputViewController extends AbstractViewController {
|
|
@@ -122,6 +122,9 @@ class PersonSelectInputViewController extends AbstractViewController {
|
|
|
122
122
|
if (!isValidNumber(search)) {
|
|
123
123
|
search = '';
|
|
124
124
|
}
|
|
125
|
+
else {
|
|
126
|
+
search = formatPhoneNumber(search);
|
|
127
|
+
}
|
|
125
128
|
const vc = this.Controller('people.invite-person-card', {
|
|
126
129
|
organizationId: this.organizationId,
|
|
127
130
|
locationId: this.locationId,
|
|
@@ -210,6 +213,12 @@ class PersonSelectInputViewController extends AbstractViewController {
|
|
|
210
213
|
}
|
|
211
214
|
});
|
|
212
215
|
}
|
|
216
|
+
reload() {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
this.lastLoadedPersonId = undefined;
|
|
219
|
+
return this.loadCurrentPerson();
|
|
220
|
+
});
|
|
221
|
+
}
|
|
213
222
|
render() {
|
|
214
223
|
void this.loadCurrentPerson();
|
|
215
224
|
return this.autoCompleteVc.render();
|
|
@@ -31,6 +31,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
|
|
|
31
31
|
getRenderedValue(): any;
|
|
32
32
|
protected loadCurrentPerson(): Promise<void>;
|
|
33
33
|
private _loadCurrentPerson;
|
|
34
|
+
reload(): Promise<void>;
|
|
34
35
|
render(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.AutocompleteInput;
|
|
35
36
|
}
|
|
36
37
|
type AutocompleteInput = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.AutocompleteInput;
|
|
@@ -131,6 +131,9 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
|
|
|
131
131
|
if (!(0, schema_1.isValidNumber)(search)) {
|
|
132
132
|
search = '';
|
|
133
133
|
}
|
|
134
|
+
else {
|
|
135
|
+
search = (0, schema_1.formatPhoneNumber)(search);
|
|
136
|
+
}
|
|
134
137
|
const vc = this.Controller('people.invite-person-card', {
|
|
135
138
|
organizationId: this.organizationId,
|
|
136
139
|
locationId: this.locationId,
|
|
@@ -209,6 +212,10 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
|
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
}
|
|
215
|
+
async reload() {
|
|
216
|
+
this.lastLoadedPersonId = undefined;
|
|
217
|
+
return this.loadCurrentPerson();
|
|
218
|
+
}
|
|
212
219
|
render() {
|
|
213
220
|
void this.loadCurrentPerson();
|
|
214
221
|
return this.autoCompleteVc.render();
|