mgwdev-m365-components 0.0.3 → 0.0.5
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/{lib → dist}/App.d.ts +3 -3
- package/{lib → dist}/components/Test.d.ts +4 -4
- package/dist/components/common/ConditionalRenderComponent.d.ts +7 -0
- package/dist/components/common/GraphGroupMembershipTrimmedComponent.d.ts +10 -0
- package/{lib → dist}/components/common/GraphPersona.d.ts +12 -10
- package/dist/components/common/SPPermissionTrimmedComponent.d.ts +11 -0
- package/{lib → dist}/components/common/graphEntityPicker/AbstractGraphEntityPicker.d.ts +16 -16
- package/{lib → dist}/components/common/graphEntityPicker/ChannelPicker.d.ts +11 -11
- package/{lib → dist}/components/common/graphEntityPicker/DrivePicker.d.ts +11 -11
- package/{lib → dist}/components/common/graphEntityPicker/ListPicker.d.ts +11 -11
- package/{lib → dist}/components/common/graphEntityPicker/PeoplePicker.d.ts +8 -8
- package/{lib → dist}/components/common/graphEntityPicker/SitePicker.d.ts +8 -8
- package/{lib → dist}/components/common/graphEntityPicker/TeamPicker.d.ts +8 -8
- package/{lib → dist}/components/common/graphEntityPicker/index.d.ts +6 -6
- package/dist/components/common/index.d.ts +4 -0
- package/{lib → dist}/components/index.d.ts +2 -2
- package/{lib → dist}/components/search/DefaultDocumentCard.d.ts +7 -7
- package/{lib → dist}/components/search/M365Search.d.ts +18 -18
- package/{lib → dist}/components/search/SearchDefaults.d.ts +1 -1
- package/{lib → dist}/components/search/index.d.ts +2 -2
- package/{lib → dist}/context/AuthenticationContext.d.ts +11 -11
- package/{lib → dist}/context/DataverseContext.d.ts +13 -13
- package/{lib → dist}/context/GraphContext.d.ts +11 -11
- package/{lib → dist}/context/SPContext.d.ts +13 -13
- package/{lib → dist}/context/index.d.ts +4 -4
- package/{lib → dist}/index.d.ts +2 -2
- package/{lib → dist}/main.d.ts +1 -1
- package/{lib → dist}/model/IEntityWithIdAndDisplayName.d.ts +4 -4
- package/{lib → dist}/model/ISearchResult.d.ts +19 -19
- package/{lib → dist}/model/index.d.ts +1 -1
- package/{lib → dist}/model/infra/ICacheEntry.d.ts +4 -4
- package/dist/mwdev-m365-components.es.js +15417 -0
- package/dist/mwdev-m365-components.umd.js +145 -0
- package/{lib → dist}/services/PersonaService.d.ts +12 -12
- package/{lib → dist}/utils/FileUtils.d.ts +29 -29
- package/{lib → dist}/utils/StringUtils.d.ts +1 -1
- package/{lib → dist}/utils/ThumbnailUtils.d.ts +7 -7
- package/{lib → dist}/utils/index.d.ts +3 -3
- package/dist/vite.svg +1 -0
- package/package.json +70 -67
- package/lib/App.js +0 -212
- package/lib/components/Test.js +0 -37
- package/lib/components/common/GraphPersona.js +0 -125
- package/lib/components/common/graphEntityPicker/AbstractGraphEntityPicker.js +0 -117
- package/lib/components/common/graphEntityPicker/ChannelPicker.js +0 -83
- package/lib/components/common/graphEntityPicker/DrivePicker.js +0 -77
- package/lib/components/common/graphEntityPicker/ListPicker.js +0 -77
- package/lib/components/common/graphEntityPicker/PeoplePicker.js +0 -76
- package/lib/components/common/graphEntityPicker/SitePicker.js +0 -73
- package/lib/components/common/graphEntityPicker/TeamPicker.js +0 -77
- package/lib/components/common/graphEntityPicker/index.js +0 -6
- package/lib/components/common/index.d.ts +0 -2
- package/lib/components/common/index.js +0 -2
- package/lib/components/index.js +0 -2
- package/lib/components/provisioning/GetSiteTemplate.d.ts +0 -6
- package/lib/components/provisioning/GetSiteTemplate.js +0 -41
- package/lib/components/search/DefaultDocumentCard.js +0 -59
- package/lib/components/search/M365Search.js +0 -69
- package/lib/components/search/SearchDefaults.js +0 -17
- package/lib/components/search/index.js +0 -2
- package/lib/context/AuthenticationContext.js +0 -50
- package/lib/context/DataverseContext.js +0 -29
- package/lib/context/GraphContext.js +0 -26
- package/lib/context/SPContext.js +0 -30
- package/lib/context/index.js +0 -4
- package/lib/index.js +0 -2
- package/lib/main.js +0 -6
- package/lib/model/IEntityWithIdAndDisplayName.js +0 -1
- package/lib/model/ISearchResult.js +0 -1
- package/lib/model/index.js +0 -1
- package/lib/model/infra/ICacheEntry.js +0 -1
- package/lib/service-worker/sw.d.ts +0 -3
- package/lib/service-worker/sw.js +0 -20
- package/lib/services/PersonaService.js +0 -134
- package/lib/utils/FileUtils.js +0 -200
- package/lib/utils/StringUtils.js +0 -10
- package/lib/utils/ThumbnailUtils.js +0 -92
- package/lib/utils/index.js +0 -3
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { Persona, Spinner } from "@fluentui/react-components";
|
|
50
|
-
import { PersonaService } from "../../services/PersonaService";
|
|
51
|
-
import { useGraph } from "../../context";
|
|
52
|
-
export function GraphPersona(props) {
|
|
53
|
-
var _this = this;
|
|
54
|
-
var _a, _b, _c, _d, _e;
|
|
55
|
-
var id = props.id;
|
|
56
|
-
var graphClient = props.graphClient;
|
|
57
|
-
if (!graphClient) {
|
|
58
|
-
graphClient = (useGraph()).graphClient;
|
|
59
|
-
}
|
|
60
|
-
var getPresence = function (presenceString) {
|
|
61
|
-
switch (presenceString) {
|
|
62
|
-
case "":
|
|
63
|
-
return "offline";
|
|
64
|
-
case "Available":
|
|
65
|
-
return "available";
|
|
66
|
-
case "Busy":
|
|
67
|
-
return "busy";
|
|
68
|
-
case "Away":
|
|
69
|
-
return "away";
|
|
70
|
-
case "DoNotDisturb":
|
|
71
|
-
return "do-not-disturb";
|
|
72
|
-
case "Offline":
|
|
73
|
-
return "offline";
|
|
74
|
-
case "PresenceUnknown":
|
|
75
|
-
return "unknown";
|
|
76
|
-
case "OutOfOffice":
|
|
77
|
-
return "out-of-office";
|
|
78
|
-
case "Blocked":
|
|
79
|
-
return "blocked";
|
|
80
|
-
case "BeRightBack":
|
|
81
|
-
return "away";
|
|
82
|
-
case "BusyIdle":
|
|
83
|
-
return "busy";
|
|
84
|
-
case "AvailableIdle":
|
|
85
|
-
return "available";
|
|
86
|
-
default:
|
|
87
|
-
return presenceString === null || presenceString === void 0 ? void 0 : presenceString.toLowerCase();
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var personaService = React.useRef(new PersonaService(graphClient, props.showPresence));
|
|
91
|
-
var _f = React.useState(!props.user), loading = _f[0], setLoading = _f[1];
|
|
92
|
-
var _g = React.useState(props.user), user = _g[0], setUser = _g[1];
|
|
93
|
-
var getUserInfo = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
94
|
-
var userResult;
|
|
95
|
-
return __generator(this, function (_a) {
|
|
96
|
-
switch (_a.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, personaService.current.getUser(id)];
|
|
98
|
-
case 1:
|
|
99
|
-
userResult = _a.sent();
|
|
100
|
-
setUser(__assign(__assign({}, props.user), userResult));
|
|
101
|
-
setLoading(false);
|
|
102
|
-
return [2 /*return*/];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}); };
|
|
106
|
-
React.useEffect(function () {
|
|
107
|
-
if (!props.user) {
|
|
108
|
-
getUserInfo();
|
|
109
|
-
}
|
|
110
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
-
}, [id]);
|
|
112
|
-
if (loading) {
|
|
113
|
-
return React.createElement(Spinner, null);
|
|
114
|
-
}
|
|
115
|
-
var primaryText = (user === null || user === void 0 ? void 0 : user.displayName) || props.name || props.title || props.id;
|
|
116
|
-
return (React.createElement(Persona, __assign({ primaryText: primaryText, secondaryText: user === null || user === void 0 ? void 0 : user.jobTitle, avatar: {
|
|
117
|
-
image: { src: user === null || user === void 0 ? void 0 : user.photo },
|
|
118
|
-
initials: ((_a = user === null || user === void 0 ? void 0 : user.displayName) === null || _a === void 0 ? void 0 : _a.split(" ").map(function (x) { return x[0]; }).join("")) || ((_b = props.name) === null || _b === void 0 ? void 0 : _b.split(" ").map(function (x) { return x[0]; }).join("")),
|
|
119
|
-
}, presence: props.showPresence
|
|
120
|
-
? {
|
|
121
|
-
status: getPresence((_c = user === null || user === void 0 ? void 0 : user.presence) === null || _c === void 0 ? void 0 : _c.availability),
|
|
122
|
-
outOfOffice: (_e = (_d = user === null || user === void 0 ? void 0 : user.presence) === null || _d === void 0 ? void 0 : _d.outOfOfficeSettings) === null || _e === void 0 ? void 0 : _e.isOutOfOffice
|
|
123
|
-
}
|
|
124
|
-
: undefined }, props)));
|
|
125
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
-
if (ar || !(i in from)) {
|
|
40
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
-
ar[i] = from[i];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
-
};
|
|
46
|
-
import { Combobox, Field, ProgressBar, Option } from "@fluentui/react-components";
|
|
47
|
-
import { DebounceHandler } from "mgwdev-m365-helpers/lib/utils/DebounceHandler";
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
export function AbstractGraphEntityPicker(props) {
|
|
50
|
-
var _this = this;
|
|
51
|
-
var _a = React.useState(props.value || []), entities = _a[0], setEntities = _a[1];
|
|
52
|
-
var _b = React.useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
53
|
-
var _c = React.useState(""), inputValue = _c[0], setInputValue = _c[1];
|
|
54
|
-
var _d = React.useState(props.value || []), selectedEntities = _d[0], setSelectedEntities = _d[1];
|
|
55
|
-
var loadEntities = function (searchText) {
|
|
56
|
-
return DebounceHandler.debounce("entityPicker-".concat(props.additionalKey), function () { return __awaiter(_this, void 0, void 0, function () {
|
|
57
|
-
var queriedEntities, e_1;
|
|
58
|
-
return __generator(this, function (_a) {
|
|
59
|
-
switch (_a.label) {
|
|
60
|
-
case 0:
|
|
61
|
-
setIsLoading(true);
|
|
62
|
-
_a.label = 1;
|
|
63
|
-
case 1:
|
|
64
|
-
_a.trys.push([1, 3, , 4]);
|
|
65
|
-
return [4 /*yield*/, props.onDataRequested(searchText)];
|
|
66
|
-
case 2:
|
|
67
|
-
queriedEntities = _a.sent();
|
|
68
|
-
//get distinct entities
|
|
69
|
-
setEntities(__spreadArray(__spreadArray([], queriedEntities, true), selectedEntities, true).reduce(function (acc, current) {
|
|
70
|
-
var x = acc.find(function (item) { return item.id === current.id; });
|
|
71
|
-
if (!x) {
|
|
72
|
-
return acc.concat([current]);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return acc;
|
|
76
|
-
}
|
|
77
|
-
}, []));
|
|
78
|
-
setIsLoading(false);
|
|
79
|
-
return [3 /*break*/, 4];
|
|
80
|
-
case 3:
|
|
81
|
-
e_1 = _a.sent();
|
|
82
|
-
console.error(e_1);
|
|
83
|
-
setIsLoading(false);
|
|
84
|
-
return [3 /*break*/, 4];
|
|
85
|
-
case 4: return [2 /*return*/];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}); }, 500);
|
|
89
|
-
};
|
|
90
|
-
React.useEffect(function () {
|
|
91
|
-
loadEntities(inputValue);
|
|
92
|
-
}, [inputValue]);
|
|
93
|
-
if (props.renderOverride) {
|
|
94
|
-
return props.renderOverride(entities, isLoading, loadEntities);
|
|
95
|
-
}
|
|
96
|
-
return React.createElement(Field, { label: props.label, hint: props.description },
|
|
97
|
-
React.createElement(Combobox, { value: inputValue, multiselect: props.multiSelect, freeform: true, onChange: function (e) {
|
|
98
|
-
setInputValue(e.target.value);
|
|
99
|
-
}, size: props.size, disabled: props.disabled, onOptionSelect: function (e, data) {
|
|
100
|
-
var newSelected = [];
|
|
101
|
-
var selectedEntity = entities.find(function (x) { return x.id === data.optionValue; });
|
|
102
|
-
if (selectedEntities.some(function (x) { return x.id === data.optionValue; })) {
|
|
103
|
-
newSelected = selectedEntities.filter(function (x) { return x.id !== data.optionValue; });
|
|
104
|
-
}
|
|
105
|
-
else if (props.multiSelect) {
|
|
106
|
-
newSelected = __spreadArray(__spreadArray([], selectedEntities, true), [selectedEntity], false);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
newSelected = [selectedEntity];
|
|
110
|
-
}
|
|
111
|
-
newSelected = newSelected.filter(function (x) { return !!x; });
|
|
112
|
-
props.onEntitySelected && props.onEntitySelected(newSelected);
|
|
113
|
-
setSelectedEntities(newSelected);
|
|
114
|
-
setInputValue(newSelected.map(function (x) { return x.displayName; }).join(", "));
|
|
115
|
-
}, defaultSelectedOptions: selectedEntities.map(function (x) { return x.id; }) }, entities.map(function (x) { return React.createElement(Option, { key: encodeURIComponent(x.id), text: x.displayName, value: x.id }, props.onSuggestionRendering ? props.onSuggestionRendering(x) : x.displayName); })),
|
|
116
|
-
isLoading && React.createElement(ProgressBar, null));
|
|
117
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { AbstractGraphEntityPicker } from "./AbstractGraphEntityPicker";
|
|
50
|
-
import { useGraph } from "../../../context";
|
|
51
|
-
export function ChannelPicker(props) {
|
|
52
|
-
var graphClient = useGraph().graphClient;
|
|
53
|
-
return React.createElement(ChannelPickerStandalone, __assign({}, props, { graphClient: graphClient }));
|
|
54
|
-
}
|
|
55
|
-
export function ChannelPickerStandalone(props) {
|
|
56
|
-
var _this = this;
|
|
57
|
-
var loadChannels = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
58
|
-
var response, result;
|
|
59
|
-
return __generator(this, function (_a) {
|
|
60
|
-
switch (_a.label) {
|
|
61
|
-
case 0: return [4 /*yield*/, props.graphClient.get("/teams/".concat(props.teamId, "/channels?$select=id,displayName"))];
|
|
62
|
-
case 1:
|
|
63
|
-
response = _a.sent();
|
|
64
|
-
return [4 /*yield*/, response.json()];
|
|
65
|
-
case 2:
|
|
66
|
-
result = _a.sent();
|
|
67
|
-
return [2 /*return*/, result.value];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}); };
|
|
71
|
-
React.useEffect(function () {
|
|
72
|
-
loadChannels();
|
|
73
|
-
}, [props.teamId]);
|
|
74
|
-
var getData = function (search) { return __awaiter(_this, void 0, void 0, function () {
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0: return [4 /*yield*/, loadChannels()];
|
|
78
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}); };
|
|
82
|
-
return React.createElement(AbstractGraphEntityPicker, __assign({ additionalKey: "team-".concat(props.teamId, "-channels") }, props, { onDataRequested: getData }));
|
|
83
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { AbstractGraphEntityPicker } from "./AbstractGraphEntityPicker";
|
|
50
|
-
import { useGraph } from "../../../context";
|
|
51
|
-
export function DrivePicker(props) {
|
|
52
|
-
var graphClient = useGraph().graphClient;
|
|
53
|
-
return React.createElement(DrivePickerStandalone, __assign({}, props, { graphClient: graphClient, siteId: props.siteId }));
|
|
54
|
-
}
|
|
55
|
-
export function DrivePickerStandalone(props) {
|
|
56
|
-
var _this = this;
|
|
57
|
-
var getData = function (search) { return __awaiter(_this, void 0, void 0, function () {
|
|
58
|
-
var api, response, result;
|
|
59
|
-
return __generator(this, function (_a) {
|
|
60
|
-
switch (_a.label) {
|
|
61
|
-
case 0:
|
|
62
|
-
api = props.siteId ? "/sites/".concat(props.siteId, "/drives?$select=id,name") : "/me/drives?$select=id,name";
|
|
63
|
-
if (search) {
|
|
64
|
-
api += "&$filter=startswith(name, '".concat(search, "')");
|
|
65
|
-
}
|
|
66
|
-
return [4 /*yield*/, props.graphClient.get(api)];
|
|
67
|
-
case 1:
|
|
68
|
-
response = _a.sent();
|
|
69
|
-
return [4 /*yield*/, response.json()];
|
|
70
|
-
case 2:
|
|
71
|
-
result = _a.sent();
|
|
72
|
-
return [2 /*return*/, result.value.map(function (x) { return ({ id: x.id, displayName: x.name }); })];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); };
|
|
76
|
-
return React.createElement(AbstractGraphEntityPicker, __assign({ additionalKey: "drive-picker-".concat(props.siteId) }, props, { onDataRequested: getData }));
|
|
77
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { AbstractGraphEntityPicker } from "./AbstractGraphEntityPicker";
|
|
50
|
-
import { useGraph } from "../../../context";
|
|
51
|
-
export function ListPickerPicker(props) {
|
|
52
|
-
var graphClient = useGraph().graphClient;
|
|
53
|
-
return React.createElement(ListPickerStandalone, __assign({}, props, { graphClient: graphClient, siteId: props.siteId }));
|
|
54
|
-
}
|
|
55
|
-
export function ListPickerStandalone(props) {
|
|
56
|
-
var _this = this;
|
|
57
|
-
var getData = function (search) { return __awaiter(_this, void 0, void 0, function () {
|
|
58
|
-
var api, response, result;
|
|
59
|
-
return __generator(this, function (_a) {
|
|
60
|
-
switch (_a.label) {
|
|
61
|
-
case 0:
|
|
62
|
-
api = "/sites/".concat(props.siteId, "/lists?$select=id,name");
|
|
63
|
-
if (search) {
|
|
64
|
-
api += "&$filter=startswith(name, '".concat(search, "')");
|
|
65
|
-
}
|
|
66
|
-
return [4 /*yield*/, props.graphClient.get(api)];
|
|
67
|
-
case 1:
|
|
68
|
-
response = _a.sent();
|
|
69
|
-
return [4 /*yield*/, response.json()];
|
|
70
|
-
case 2:
|
|
71
|
-
result = _a.sent();
|
|
72
|
-
return [2 /*return*/, result.value.map(function (x) { return ({ id: x.id, displayName: x.name }); })];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); };
|
|
76
|
-
return React.createElement(AbstractGraphEntityPicker, __assign({ additionalKey: "list-picker-".concat(props.siteId) }, props, { onDataRequested: getData }));
|
|
77
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { AbstractGraphEntityPicker } from "./AbstractGraphEntityPicker";
|
|
50
|
-
import { useGraph } from "../../../context";
|
|
51
|
-
import { PeopleProvider } from "mgwdev-m365-helpers";
|
|
52
|
-
import { GraphPersona } from "../GraphPersona";
|
|
53
|
-
export function PeoplePicker(props) {
|
|
54
|
-
var graphClient = useGraph().graphClient;
|
|
55
|
-
return React.createElement(PeoplePickerStandalone, __assign({}, props, { graphClient: graphClient }));
|
|
56
|
-
}
|
|
57
|
-
export function PeoplePickerStandalone(props) {
|
|
58
|
-
var _this = this;
|
|
59
|
-
var peopleProvider = new PeopleProvider(props.graphClient, true, true);
|
|
60
|
-
var getData = function (search) { return __awaiter(_this, void 0, void 0, function () {
|
|
61
|
-
return __generator(this, function (_a) {
|
|
62
|
-
switch (_a.label) {
|
|
63
|
-
case 0:
|
|
64
|
-
peopleProvider.setQuery(search);
|
|
65
|
-
return [4 /*yield*/, peopleProvider.getData()];
|
|
66
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}); };
|
|
70
|
-
return React.createElement(AbstractGraphEntityPicker, __assign({}, props, { additionalKey: "people-picker", onDataRequested: getData, onSuggestionRendering: function (user) {
|
|
71
|
-
if (user.photo) {
|
|
72
|
-
user.photo = "data:image/png;base64,".concat(user.photo.replace('"', "").replace('"', ""));
|
|
73
|
-
}
|
|
74
|
-
return React.createElement(GraphPersona, { showPresence: true, user: user, graphClient: props.graphClient });
|
|
75
|
-
} }));
|
|
76
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import * as React from "react";
|
|
49
|
-
import { AbstractGraphEntityPicker } from "./AbstractGraphEntityPicker";
|
|
50
|
-
import { useGraph } from "../../../context";
|
|
51
|
-
import { GraphSearchPagedDataProvider } from "mgwdev-m365-helpers";
|
|
52
|
-
export function SitePicker(props) {
|
|
53
|
-
var graphClient = useGraph().graphClient;
|
|
54
|
-
return React.createElement(SitePickerStandalone, __assign({}, props, { graphClient: graphClient }));
|
|
55
|
-
}
|
|
56
|
-
export function SitePickerStandalone(props) {
|
|
57
|
-
var _this = this;
|
|
58
|
-
var dataProvider = React.useRef(new GraphSearchPagedDataProvider(props.graphClient, ["site"], ["id", "displayName"]));
|
|
59
|
-
var getData = function (search) { return __awaiter(_this, void 0, void 0, function () {
|
|
60
|
-
var results;
|
|
61
|
-
return __generator(this, function (_a) {
|
|
62
|
-
switch (_a.label) {
|
|
63
|
-
case 0:
|
|
64
|
-
dataProvider.current.setQuery(search || "*");
|
|
65
|
-
return [4 /*yield*/, dataProvider.current.getData()];
|
|
66
|
-
case 1:
|
|
67
|
-
results = _a.sent();
|
|
68
|
-
return [2 /*return*/, results];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}); };
|
|
72
|
-
return React.createElement(AbstractGraphEntityPicker, __assign({}, props, { onDataRequested: getData }));
|
|
73
|
-
}
|