@pnp/spfx-controls-react 3.9.0-beta.2556922 → 3.9.0-beta.2597970

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.
@@ -2,9 +2,9 @@
2
2
  "errors": [],
3
3
  "warnings": [],
4
4
  "version": "4.44.2",
5
- "hash": "a1eb58624d821cc0408f",
6
- "time": 19298,
7
- "builtAt": 1656088186191,
5
+ "hash": "4ffdca8f97c6ae696d25",
6
+ "time": 19267,
7
+ "builtAt": 1656694169806,
8
8
  "publicPath": "",
9
9
  "outputPath": "/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/dist",
10
10
  "assetsByChunkName": {
@@ -292,7 +292,7 @@
292
292
  },
293
293
  {
294
294
  "name": "controls-test-web-part.js",
295
- "size": 18384117,
295
+ "size": 18384681,
296
296
  "chunks": [
297
297
  "controls-test-web-part"
298
298
  ],
@@ -305,7 +305,7 @@
305
305
  },
306
306
  {
307
307
  "name": "controls-test-web-part.js.map",
308
- "size": 16507771,
308
+ "size": 16508528,
309
309
  "chunks": [
310
310
  "controls-test-web-part"
311
311
  ],
@@ -404,7 +404,7 @@
404
404
  "rendered": true,
405
405
  "initial": true,
406
406
  "entry": true,
407
- "size": 13221242,
407
+ "size": 13221704,
408
408
  "names": [
409
409
  "controls-test-web-part"
410
410
  ],
@@ -412,7 +412,7 @@
412
412
  "controls-test-web-part.js",
413
413
  "controls-test-web-part.js.map"
414
414
  ],
415
- "hash": "4b72eaa5c94fcd7b6e63",
415
+ "hash": "60d5b5a1ed243c751c8e",
416
416
  "siblings": [],
417
417
  "parents": [],
418
418
  "children": [],
@@ -55594,7 +55594,7 @@
55594
55594
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
55595
55595
  "type": "harmony import specifier",
55596
55596
  "userRequest": "./dynamicField",
55597
- "loc": "695:47-59"
55597
+ "loc": "708:47-59"
55598
55598
  }
55599
55599
  ],
55600
55600
  "providedExports": null,
@@ -61568,7 +61568,7 @@
61568
61568
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
61569
61569
  "type": "harmony import specifier",
61570
61570
  "userRequest": "office-ui-fabric-react/lib/ProgressIndicator",
61571
- "loc": "692:32-49"
61571
+ "loc": "705:32-49"
61572
61572
  }
61573
61573
  ],
61574
61574
  "providedExports": [
@@ -85832,7 +85832,16 @@
85832
85832
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
85833
85833
  "type": "harmony import specifier",
85834
85834
  "userRequest": "../../services/SPService",
85835
- "loc": "676:31-40"
85835
+ "loc": "689:60-69"
85836
+ },
85837
+ {
85838
+ "moduleId": "RPzn",
85839
+ "moduleIdentifier": "/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/node_modules/source-map-loader/index.js!/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/lib/controls/dynamicForm/DynamicForm.js",
85840
+ "module": "./lib/controls/dynamicForm/DynamicForm.js",
85841
+ "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
85842
+ "type": "harmony import specifier",
85843
+ "userRequest": "../../services/SPService",
85844
+ "loc": "689:125-134"
85836
85845
  },
85837
85846
  {
85838
85847
  "moduleId": "k0SN",
@@ -138336,7 +138345,16 @@
138336
138345
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138337
138346
  "type": "harmony import specifier",
138338
138347
  "userRequest": "@pnp/sp/presets/all",
138339
- "loc": "222:45-47"
138348
+ "loc": "223:45-47"
138349
+ },
138350
+ {
138351
+ "moduleId": "RPzn",
138352
+ "moduleIdentifier": "/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/node_modules/source-map-loader/index.js!/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/lib/controls/dynamicForm/DynamicForm.js",
138353
+ "module": "./lib/controls/dynamicForm/DynamicForm.js",
138354
+ "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138355
+ "type": "harmony import specifier",
138356
+ "userRequest": "@pnp/sp/presets/all",
138357
+ "loc": "240:45-47"
138340
138358
  },
138341
138359
  {
138342
138360
  "moduleId": "RPzn",
@@ -138345,7 +138363,7 @@
138345
138363
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138346
138364
  "type": "harmony import specifier",
138347
138365
  "userRequest": "@pnp/sp/presets/all",
138348
- "loc": "239:45-47"
138366
+ "loc": "286:45-47"
138349
138367
  },
138350
138368
  {
138351
138369
  "moduleId": "RPzn",
@@ -138354,7 +138372,7 @@
138354
138372
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138355
138373
  "type": "harmony import specifier",
138356
138374
  "userRequest": "@pnp/sp/presets/all",
138357
- "loc": "285:45-47"
138375
+ "loc": "320:61-63"
138358
138376
  },
138359
138377
  {
138360
138378
  "moduleId": "RPzn",
@@ -138363,7 +138381,7 @@
138363
138381
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138364
138382
  "type": "harmony import specifier",
138365
138383
  "userRequest": "@pnp/sp/presets/all",
138366
- "loc": "319:61-63"
138384
+ "loc": "362:45-47"
138367
138385
  },
138368
138386
  {
138369
138387
  "moduleId": "RPzn",
@@ -138372,7 +138390,7 @@
138372
138390
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138373
138391
  "type": "harmony import specifier",
138374
138392
  "userRequest": "@pnp/sp/presets/all",
138375
- "loc": "361:45-47"
138393
+ "loc": "670:12-14"
138376
138394
  },
138377
138395
  {
138378
138396
  "moduleId": "RPzn",
@@ -138381,7 +138399,7 @@
138381
138399
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
138382
138400
  "type": "harmony import specifier",
138383
138401
  "userRequest": "@pnp/sp/presets/all",
138384
- "loc": "668:8-10"
138402
+ "loc": "680:12-14"
138385
138403
  },
138386
138404
  {
138387
138405
  "moduleId": "Y+es",
@@ -141471,7 +141489,7 @@
141471
141489
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
141472
141490
  "type": "harmony import specifier",
141473
141491
  "userRequest": "./DynamicForm.module.scss",
141474
- "loc": "697:56-62"
141492
+ "loc": "711:60-66"
141475
141493
  },
141476
141494
  {
141477
141495
  "moduleId": "Y+es",
@@ -144711,7 +144729,7 @@
144711
144729
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
144712
144730
  "type": "harmony import specifier",
144713
144731
  "userRequest": "office-ui-fabric-react/lib/Button",
144714
- "loc": "698:40-53"
144732
+ "loc": "712:44-57"
144715
144733
  },
144716
144734
  {
144717
144735
  "moduleId": "RPzn",
@@ -144720,7 +144738,7 @@
144720
144738
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
144721
144739
  "type": "harmony import specifier",
144722
144740
  "userRequest": "office-ui-fabric-react/lib/Button",
144723
- "loc": "699:40-53"
144741
+ "loc": "713:44-57"
144724
144742
  },
144725
144743
  {
144726
144744
  "moduleId": "SXK8",
@@ -249852,7 +249870,7 @@
249852
249870
  "name": "./lib/controls/dynamicForm/DynamicForm.js",
249853
249871
  "index": 3092,
249854
249872
  "index2": 3401,
249855
- "size": 42886,
249873
+ "size": 43348,
249856
249874
  "cacheable": true,
249857
249875
  "built": true,
249858
249876
  "optional": false,
@@ -249909,7 +249927,7 @@
249909
249927
  ],
249910
249928
  "optimizationBailout": [],
249911
249929
  "depth": 3,
249912
- "source": "var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport * as React from 'react';\nimport styles from './DynamicForm.module.scss';\nimport { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';\nimport { Stack } from 'office-ui-fabric-react/lib/Stack';\nimport SPservice from '../../services/SPService';\nimport { DynamicField } from './dynamicField';\nimport { sp } from '@pnp/sp/presets/all';\nimport { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';\nimport * as strings from 'ControlStrings';\nimport { SPHttpClient } from '@microsoft/sp-http';\nvar stackTokens = { childrenGap: 20 };\n/**\n * DynamicForm Class Control\n */\nvar DynamicForm = /** @class */ (function (_super) {\n __extends(DynamicForm, _super);\n function DynamicForm(props) {\n var _this = _super.call(this, props) || this;\n //trigger when the user submits the form.\n _this.onSubmitClick = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, onSubmitted, onBeforeSubmit, onSubmitError, shouldBeReturnBack_1, fields, objects, _loop_1, this_1, i, len, isCancelled, iur, error_1, iar, error_2, error_3;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId, onSubmitted = _a.onSubmitted, onBeforeSubmit = _a.onBeforeSubmit, onSubmitError = _a.onSubmitError;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 16, , 17]);\n shouldBeReturnBack_1 = false;\n fields = (this.state.fieldCollection || []).slice();\n fields.forEach(function (val) {\n if (val.required) {\n if (val.newValue === null) {\n if (val.fieldDefaultValue === null || val.fieldDefaultValue === '' || val.fieldDefaultValue.length === 0) {\n if (val.fieldType === \"DateTime\")\n val.fieldDefaultValue = null;\n else\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n else if (val.newValue === '') {\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n });\n if (shouldBeReturnBack_1) {\n this.setState({ fieldCollection: fields });\n return [2 /*return*/];\n }\n this.setState({\n isSaving: true\n });\n objects = {};\n _loop_1 = function (i, len) {\n var val, fieldType, additionalData, columnInternalName, hiddenFieldName, value_1, uploadedImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n val = fields[i];\n fieldType = val.fieldType, additionalData = val.additionalData, columnInternalName = val.columnInternalName, hiddenFieldName = val.hiddenFieldName;\n if (!(val.newValue !== null && val.newValue !== undefined)) return [3 /*break*/, 14];\n value_1 = val.newValue;\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 1];\n objects[columnInternalName + \"Id\"] = value_1[0].key;\n return [3 /*break*/, 14];\n case 1:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 2];\n value_1 = [];\n val.newValue.forEach(function (element) {\n value_1.push(element.key);\n });\n objects[columnInternalName + \"Id\"] = { results: value_1 };\n return [3 /*break*/, 14];\n case 2:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 3];\n objects[columnInternalName] = {\n '__metadata': { 'type': 'SP.Taxonomy.TaxonomyFieldValue' },\n 'Label': value_1[0].name,\n 'TermGuid': value_1[0].key,\n 'WssId': '-1'\n };\n return [3 /*break*/, 14];\n case 3:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 4];\n objects[hiddenFieldName] = val.newValue.map(function (term) { return \"-1#;\" + term.name + \"|\" + term.key + \";\"; }).join('#');\n return [3 /*break*/, 14];\n case 4:\n if (!(fieldType === \"User\")) return [3 /*break*/, 5];\n objects[columnInternalName + \"Id\"] = val.newValue;\n return [3 /*break*/, 14];\n case 5:\n if (!(fieldType === \"Choice\")) return [3 /*break*/, 6];\n objects[columnInternalName] = val.newValue.key;\n return [3 /*break*/, 14];\n case 6:\n if (!(fieldType === \"MultiChoice\")) return [3 /*break*/, 7];\n objects[columnInternalName] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 7:\n if (!(fieldType === \"Location\")) return [3 /*break*/, 8];\n objects[columnInternalName] = JSON.stringify(val.newValue);\n return [3 /*break*/, 14];\n case 8:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 9];\n objects[columnInternalName + \"Id\"] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 9:\n if (!(fieldType === 'Thumbnail')) return [3 /*break*/, 13];\n if (!additionalData) return [3 /*break*/, 11];\n return [4 /*yield*/, this_1.uplaodImage(additionalData)];\n case 10:\n uploadedImage = _a.sent();\n objects[columnInternalName] = JSON.stringify({\n type: 'thumbnail',\n fileName: uploadedImage.Name,\n serverRelativeUrl: uploadedImage.ServerRelativeUrl,\n id: uploadedImage.UniqueId\n });\n return [3 /*break*/, 12];\n case 11:\n objects[columnInternalName] = null;\n _a.label = 12;\n case 12: return [3 /*break*/, 14];\n case 13:\n objects[columnInternalName] = val.newValue;\n _a.label = 14;\n case 14: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n i = 0, len = fields.length;\n _b.label = 2;\n case 2:\n if (!(i < len)) return [3 /*break*/, 5];\n return [5 /*yield**/, _loop_1(i, len)];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n if (!onBeforeSubmit) return [3 /*break*/, 7];\n return [4 /*yield*/, onBeforeSubmit(objects)];\n case 6:\n isCancelled = _b.sent();\n if (isCancelled) {\n this.setState({\n isSaving: false\n });\n return [2 /*return*/];\n }\n _b.label = 7;\n case 7:\n if (!listItemId) return [3 /*break*/, 12];\n _b.label = 8;\n case 8:\n _b.trys.push([8, 10, , 11]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.getById(listItemId).update(objects)];\n case 9:\n iur = _b.sent();\n if (onSubmitted) {\n onSubmitted(iur.data, this.props.returnListItemInstanceOnSubmit !== false ? iur.item : undefined);\n }\n return [3 /*break*/, 11];\n case 10:\n error_1 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_1);\n }\n console.log(\"Error\", error_1);\n return [3 /*break*/, 11];\n case 11: return [3 /*break*/, 15];\n case 12:\n _b.trys.push([12, 14, , 15]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.add(objects)];\n case 13:\n iar = _b.sent();\n if (onSubmitted) {\n onSubmitted(iar.data, this.props.returnListItemInstanceOnSubmit !== false ? iar.item : undefined);\n }\n return [3 /*break*/, 15];\n case 14:\n error_2 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_2);\n }\n console.log(\"Error\", error_2);\n return [3 /*break*/, 15];\n case 15:\n this.setState({\n isSaving: false\n });\n return [3 /*break*/, 17];\n case 16:\n error_3 = _b.sent();\n if (onSubmitError) {\n onSubmitError(null, error_3);\n }\n console.log(\"Error onSubmit\", error_3);\n return [3 /*break*/, 17];\n case 17: return [2 /*return*/];\n }\n });\n }); };\n // trigger when the user change any value in the form\n _this.onChange = function (internalName, newValue, additionalData) { return __awaiter(_this, void 0, void 0, function () {\n var fieldCol, field, user, result, _loop_2, retrivedItem, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fieldCol = (this.state.fieldCollection || []).slice();\n field = fieldCol.filter(function (element, i) { return element.columnInternalName === internalName; })[0];\n field.newValue = newValue;\n field.additionalData = additionalData;\n if (!(field.fieldType === \"User\" && newValue.length !== 0)) return [3 /*break*/, 4];\n if (!(newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = newValue[0].secondaryText;\n if (user.indexOf('@') === -1) {\n user = newValue[0].loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue = result.data.Id;\n return [3 /*break*/, 3];\n case 2:\n field.newValue = newValue[0].id;\n _a.label = 3;\n case 3: return [3 /*break*/, 8];\n case 4:\n if (!(field.fieldType === \"UserMulti\" && newValue.length !== 0)) return [3 /*break*/, 8];\n field.newValue = [];\n _loop_2 = function (index) {\n var element, user, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n element = newValue[index];\n retrivedItem = false;\n if (field.fieldDefaultValue != null) {\n if (field.fieldDefaultValue.join(',').indexOf(element.text) !== -1)\n field.fieldDefaultValue.forEach(function (item) {\n if (item.split('/')[1] === element.text) {\n retrivedItem = true;\n field.newValue.push(item.split('/')[0]);\n }\n });\n }\n if (!!retrivedItem) return [3 /*break*/, 3];\n if (!(element.id === undefined || parseInt(element.id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = element.secondaryText;\n if (user.indexOf('@') === -1) {\n user = element.loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue.push(result.data.Id);\n return [3 /*break*/, 3];\n case 2:\n field.newValue.push(element.id);\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n };\n index = 0;\n _a.label = 5;\n case 5:\n if (!(index < newValue.length)) return [3 /*break*/, 8];\n return [5 /*yield**/, _loop_2(index)];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7:\n index++;\n return [3 /*break*/, 5];\n case 8:\n this.setState({\n fieldCollection: fieldCol\n });\n return [2 /*return*/];\n }\n });\n }); };\n //getting all the fields information as part of get ready process\n _this.getFieldInformations = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, context, listId, listItemId, disabledFields, contentTypeId, spList, item, defaultContentType, listFeilds, tempFields, order, responseValue, _loop_3, this_2, i, len, error_4;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, context = _a.context, listId = _a.listId, listItemId = _a.listItemId, disabledFields = _a.disabledFields;\n contentTypeId = this.props.contentTypeId;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 12, , 13]);\n return [4 /*yield*/, sp.web.lists.getById(listId)];\n case 2:\n spList = _b.sent();\n item = null;\n if (!(listItemId !== undefined && listItemId !== null && listItemId !== 0)) return [3 /*break*/, 4];\n return [4 /*yield*/, spList.items.getById(listItemId).get()];\n case 3:\n item = _b.sent();\n _b.label = 4;\n case 4:\n if (!(contentTypeId === undefined || contentTypeId === '')) return [3 /*break*/, 6];\n return [4 /*yield*/, spList.contentTypes.select(\"Id\", \"Name\").get()];\n case 5:\n defaultContentType = _b.sent();\n contentTypeId = defaultContentType[0][\"Id\"].StringValue;\n _b.label = 6;\n case 6: return [4 /*yield*/, this.getFormFields(listId, contentTypeId, context.pageContext.web.absoluteUrl)];\n case 7:\n listFeilds = _b.sent();\n tempFields = [];\n order = 0;\n responseValue = listFeilds['value'];\n _loop_3 = function (i, len) {\n var field, fieldType, hiddenName, termSetId, lookupListId, lookupField, choices, defaultValue, selectedTags, richText, dateFormat, principalType, response, response, schemaXml, dateFormatRegEx, userEmails, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n field = responseValue[i];\n order++;\n fieldType = field['TypeAsString'];\n field.order = order;\n hiddenName = \"\";\n termSetId = \"\";\n lookupListId = \"\";\n lookupField = \"\";\n choices = [];\n defaultValue = null;\n selectedTags = [];\n richText = false;\n dateFormat = void 0;\n principalType = \"\";\n if (item !== null) {\n defaultValue = item[field.EntityPropertyName];\n }\n else {\n defaultValue = field.DefaultValue;\n }\n if (!(fieldType === 'Choice' || fieldType === 'MultiChoice')) return [3 /*break*/, 1];\n field[\"Choices\"].forEach(function (element) {\n choices.push({ key: element, text: element });\n });\n return [3 /*break*/, 27];\n case 1:\n if (!(fieldType === \"Note\")) return [3 /*break*/, 2];\n richText = field[\"RichText\"];\n return [3 /*break*/, 27];\n case 2:\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 6];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 4];\n return [4 /*yield*/, this_2._spService.getLookupValue(listId, listItemId, field.InternalName, lookupField, context.pageContext.web.absoluteUrl)];\n case 3:\n defaultValue = _c.sent();\n return [3 /*break*/, 5];\n case 4:\n defaultValue = [];\n _c.label = 5;\n case 5: return [3 /*break*/, 27];\n case 6:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 10];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 8];\n return [4 /*yield*/, this_2._spService.getLookupValues(listId, listItemId, field.InternalName, lookupField, context.pageContext.web.absoluteUrl)];\n case 7:\n defaultValue = _c.sent();\n return [3 /*break*/, 9];\n case 8:\n defaultValue = [];\n _c.label = 9;\n case 9: return [3 /*break*/, 27];\n case 10:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 12];\n return [4 /*yield*/, this_2._spService.getTaxonomyFieldInternalName(this_2.props.listId, field.InternalName, this_2.props.context.pageContext.web.absoluteUrl)];\n case 11:\n response = _c.sent();\n hiddenName = response[\"value\"];\n termSetId = field[\"TermSetId\"];\n if (item !== null) {\n item[field.InternalName].forEach(function (element) {\n selectedTags.push({ key: element.TermGuid, name: element.Label });\n });\n defaultValue = selectedTags;\n }\n else {\n if (defaultValue !== \"\") {\n defaultValue.split(/#|;/).forEach(function (element) {\n if (element.indexOf('|') !== -1)\n selectedTags.push({ key: element.split('|')[1], name: element.split('|')[0] });\n });\n defaultValue = selectedTags;\n }\n }\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 12:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 16];\n termSetId = field[\"TermSetId\"];\n if (!(item !== null)) return [3 /*break*/, 14];\n return [4 /*yield*/, this_2._spService.getSingleManagedMtadataLabel(listId, listItemId, field.InternalName)];\n case 13:\n response = _c.sent();\n if (response) {\n selectedTags.push({ key: response[\"TermID\"], name: response[\"Label\"] });\n defaultValue = selectedTags;\n }\n return [3 /*break*/, 15];\n case 14:\n if (defaultValue !== \"\") {\n selectedTags.push({ key: defaultValue.split('|')[1], name: defaultValue.split('|')[0].split('#')[1] });\n defaultValue = selectedTags;\n }\n _c.label = 15;\n case 15:\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 16:\n if (!(fieldType === \"DateTime\")) return [3 /*break*/, 17];\n if (item !== null && item[field.InternalName])\n defaultValue = new Date(item[field.InternalName]);\n else if (defaultValue === '[today]') {\n defaultValue = new Date();\n }\n schemaXml = field.SchemaXml;\n dateFormatRegEx = /\\s+Format=\\\"([^\\\"]+)\\\"/gmi.exec(schemaXml);\n dateFormat = dateFormatRegEx && dateFormatRegEx.length ? dateFormatRegEx[1] : 'DateOnly';\n return [3 /*break*/, 27];\n case 17:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 21];\n if (!(item !== null)) return [3 /*break*/, 19];\n return [4 /*yield*/, this_2._spService.getUsersUPNFromFieldValue(listId, listItemId, field.InternalName, context.pageContext.web.absoluteUrl)];\n case 18:\n defaultValue = _c.sent();\n return [3 /*break*/, 20];\n case 19:\n defaultValue = [];\n _c.label = 20;\n case 20:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 21:\n if (!(fieldType === \"Thumbnail\")) return [3 /*break*/, 22];\n if (defaultValue !== null) {\n defaultValue = context.pageContext.web.absoluteUrl.split('/sites/')[0] + JSON.parse(defaultValue).serverRelativeUrl;\n }\n return [3 /*break*/, 27];\n case 22:\n if (!(fieldType === \"User\")) return [3 /*break*/, 26];\n if (!(item !== null)) return [3 /*break*/, 24];\n userEmails = [];\n _b = (_a = userEmails).push;\n return [4 /*yield*/, this_2._spService.getUserUPNById(parseInt(item[field.InternalName + \"Id\"]))];\n case 23:\n _b.apply(_a, [(_c.sent()) + '']);\n defaultValue = userEmails;\n return [3 /*break*/, 25];\n case 24:\n defaultValue = [];\n _c.label = 25;\n case 25:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 26:\n if (fieldType === \"Location\") {\n defaultValue = JSON.parse(defaultValue);\n }\n else if (fieldType === \"Boolean\") {\n defaultValue = Boolean(Number(defaultValue));\n }\n _c.label = 27;\n case 27:\n tempFields.push({\n newValue: null,\n fieldTermSetId: termSetId,\n options: choices,\n lookupListID: lookupListId,\n lookupField: lookupField,\n changedValue: defaultValue,\n fieldType: field.TypeAsString,\n fieldTitle: field.Title,\n fieldDefaultValue: defaultValue,\n context: this_2.props.context,\n disabled: this_2.props.disabled || (disabledFields && disabledFields.indexOf(field.InternalName) > -1),\n listId: this_2.props.listId,\n columnInternalName: field.EntityPropertyName,\n label: field.Title,\n onChanged: this_2.onChange,\n required: field.Required,\n hiddenFieldName: hiddenName,\n Order: field.order,\n isRichText: richText,\n dateFormat: dateFormat,\n listItemId: listItemId,\n principalType: principalType,\n description: field.Description\n });\n tempFields.sort(function (a, b) { return a.Order - b.Order; });\n return [2 /*return*/];\n }\n });\n };\n this_2 = this;\n i = 0, len = responseValue.length;\n _b.label = 8;\n case 8:\n if (!(i < len)) return [3 /*break*/, 11];\n return [5 /*yield**/, _loop_3(i, len)];\n case 9:\n _b.sent();\n _b.label = 10;\n case 10:\n i++;\n return [3 /*break*/, 8];\n case 11:\n this.setState({ fieldCollection: tempFields });\n return [3 /*break*/, 13];\n case 12:\n error_4 = _b.sent();\n console.log(\"Error get field informations\", error_4);\n return [2 /*return*/, null];\n case 13: return [2 /*return*/];\n }\n });\n }); };\n _this.uplaodImage = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, fileInstance, buffer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId;\n if (!file.fileAbsoluteUrl) return [3 /*break*/, 1];\n return [2 /*return*/, {\n Name: file.fileName,\n ServerRelativeUrl: file.fileAbsoluteUrl,\n UniqueId: ''\n }];\n case 1: return [4 /*yield*/, file.downloadFileContent()];\n case 2:\n fileInstance = _b.sent();\n return [4 /*yield*/, this.getImageArrayBuffer(fileInstance)];\n case 3:\n buffer = _b.sent();\n return [4 /*yield*/, this._spService.uploadImage(listId, listItemId, file.fileName, buffer, undefined)];\n case 4: return [2 /*return*/, _b.sent()];\n }\n });\n }); };\n _this.getImageArrayBuffer = function (file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(file);\n reader.onload = function () {\n resolve(reader.result);\n };\n });\n };\n _this.getFormFields = function (listId, contentTypeId, webUrl) { return __awaiter(_this, void 0, void 0, function () {\n var context, webAbsoluteUrl, apiUrl, data, results, error_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 4, , 5]);\n context = this.props.context;\n webAbsoluteUrl = !webUrl ? context.pageContext.web.absoluteUrl : webUrl;\n apiUrl = '';\n if (contentTypeId !== undefined && contentTypeId !== '') {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/contenttypes('\" + contentTypeId + \"')/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n else {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n return [4 /*yield*/, context.spHttpClient.get(apiUrl, SPHttpClient.configurations.v1)];\n case 1:\n data = _a.sent();\n if (!data.ok) return [3 /*break*/, 3];\n return [4 /*yield*/, data.json()];\n case 2:\n results = _a.sent();\n if (results) {\n return [2 /*return*/, results];\n }\n _a.label = 3;\n case 3: return [2 /*return*/, null];\n case 4:\n error_5 = _a.sent();\n console.dir(error_5);\n return [2 /*return*/, Promise.reject(error_5)];\n case 5: return [2 /*return*/];\n }\n });\n }); };\n // Initialize pnp sp\n sp.setup({\n spfxContext: _this.props.context\n });\n // Initialize state\n _this.state = {\n fieldCollection: []\n };\n // Get SPService Factory\n _this._spService = new SPservice(_this.props.context);\n return _this;\n }\n /**\n * Lifecycle hook when component is mounted\n */\n DynamicForm.prototype.componentDidMount = function () {\n this.getFieldInformations();\n };\n /**\n * Default React component render method\n */\n DynamicForm.prototype.render = function () {\n var _this = this;\n var _a = this.state, fieldCollection = _a.fieldCollection, isSaving = _a.isSaving;\n return (React.createElement(\"div\", null, fieldCollection.length === 0 ? React.createElement(\"div\", null,\n React.createElement(ProgressIndicator, { label: strings.DynamicFormLoading, description: strings.DynamicFormPleaseWait })) :\n React.createElement(\"div\", null,\n fieldCollection.map(function (v, i) {\n return React.createElement(DynamicField, __assign({}, v, { disabled: v.disabled || isSaving }));\n }),\n React.createElement(Stack, { className: styles.buttons, horizontal: true, tokens: stackTokens },\n React.createElement(PrimaryButton, { disabled: isSaving, text: strings.Save, onClick: function () { return _this.onSubmitClick(); } }),\n React.createElement(DefaultButton, { disabled: isSaving, text: strings.Cancel, onClick: this.props.onCancelled })))));\n };\n return DynamicForm;\n}(React.Component));\nexport { DynamicForm };\n"
249930
+ "source": "var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport * as React from 'react';\nimport styles from './DynamicForm.module.scss';\nimport { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';\nimport { Stack } from 'office-ui-fabric-react/lib/Stack';\nimport SPservice from '../../services/SPService';\nimport { DynamicField } from './dynamicField';\nimport { sp } from '@pnp/sp/presets/all';\nimport { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';\nimport * as strings from 'ControlStrings';\nimport { SPHttpClient } from '@microsoft/sp-http';\nvar stackTokens = { childrenGap: 20 };\n/**\n * DynamicForm Class Control\n */\nvar DynamicForm = /** @class */ (function (_super) {\n __extends(DynamicForm, _super);\n function DynamicForm(props) {\n var _this = _super.call(this, props) || this;\n _this.webURL = _this.props.webAbsoluteUrl ? _this.props.webAbsoluteUrl : _this.props.context.pageContext.web.absoluteUrl;\n //trigger when the user submits the form.\n _this.onSubmitClick = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, onSubmitted, onBeforeSubmit, onSubmitError, shouldBeReturnBack_1, fields, objects, _loop_1, this_1, i, len, isCancelled, iur, error_1, iar, error_2, error_3;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId, onSubmitted = _a.onSubmitted, onBeforeSubmit = _a.onBeforeSubmit, onSubmitError = _a.onSubmitError;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 16, , 17]);\n shouldBeReturnBack_1 = false;\n fields = (this.state.fieldCollection || []).slice();\n fields.forEach(function (val) {\n if (val.required) {\n if (val.newValue === null) {\n if (val.fieldDefaultValue === null || val.fieldDefaultValue === '' || val.fieldDefaultValue.length === 0) {\n if (val.fieldType === \"DateTime\")\n val.fieldDefaultValue = null;\n else\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n else if (val.newValue === '') {\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n });\n if (shouldBeReturnBack_1) {\n this.setState({ fieldCollection: fields });\n return [2 /*return*/];\n }\n this.setState({\n isSaving: true\n });\n objects = {};\n _loop_1 = function (i, len) {\n var val, fieldType, additionalData, columnInternalName, hiddenFieldName, value_1, uploadedImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n val = fields[i];\n fieldType = val.fieldType, additionalData = val.additionalData, columnInternalName = val.columnInternalName, hiddenFieldName = val.hiddenFieldName;\n if (!(val.newValue !== null && val.newValue !== undefined)) return [3 /*break*/, 14];\n value_1 = val.newValue;\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 1];\n objects[columnInternalName + \"Id\"] = value_1[0].key;\n return [3 /*break*/, 14];\n case 1:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 2];\n value_1 = [];\n val.newValue.forEach(function (element) {\n value_1.push(element.key);\n });\n objects[columnInternalName + \"Id\"] = { results: value_1 };\n return [3 /*break*/, 14];\n case 2:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 3];\n objects[columnInternalName] = {\n '__metadata': { 'type': 'SP.Taxonomy.TaxonomyFieldValue' },\n 'Label': value_1[0].name,\n 'TermGuid': value_1[0].key,\n 'WssId': '-1'\n };\n return [3 /*break*/, 14];\n case 3:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 4];\n objects[hiddenFieldName] = val.newValue.map(function (term) { return \"-1#;\" + term.name + \"|\" + term.key + \";\"; }).join('#');\n return [3 /*break*/, 14];\n case 4:\n if (!(fieldType === \"User\")) return [3 /*break*/, 5];\n objects[columnInternalName + \"Id\"] = val.newValue;\n return [3 /*break*/, 14];\n case 5:\n if (!(fieldType === \"Choice\")) return [3 /*break*/, 6];\n objects[columnInternalName] = val.newValue.key;\n return [3 /*break*/, 14];\n case 6:\n if (!(fieldType === \"MultiChoice\")) return [3 /*break*/, 7];\n objects[columnInternalName] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 7:\n if (!(fieldType === \"Location\")) return [3 /*break*/, 8];\n objects[columnInternalName] = JSON.stringify(val.newValue);\n return [3 /*break*/, 14];\n case 8:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 9];\n objects[columnInternalName + \"Id\"] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 9:\n if (!(fieldType === 'Thumbnail')) return [3 /*break*/, 13];\n if (!additionalData) return [3 /*break*/, 11];\n return [4 /*yield*/, this_1.uplaodImage(additionalData)];\n case 10:\n uploadedImage = _a.sent();\n objects[columnInternalName] = JSON.stringify({\n type: 'thumbnail',\n fileName: uploadedImage.Name,\n serverRelativeUrl: uploadedImage.ServerRelativeUrl,\n id: uploadedImage.UniqueId\n });\n return [3 /*break*/, 12];\n case 11:\n objects[columnInternalName] = null;\n _a.label = 12;\n case 12: return [3 /*break*/, 14];\n case 13:\n objects[columnInternalName] = val.newValue;\n _a.label = 14;\n case 14: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n i = 0, len = fields.length;\n _b.label = 2;\n case 2:\n if (!(i < len)) return [3 /*break*/, 5];\n return [5 /*yield**/, _loop_1(i, len)];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n if (!onBeforeSubmit) return [3 /*break*/, 7];\n return [4 /*yield*/, onBeforeSubmit(objects)];\n case 6:\n isCancelled = _b.sent();\n if (isCancelled) {\n this.setState({\n isSaving: false\n });\n return [2 /*return*/];\n }\n _b.label = 7;\n case 7:\n if (!listItemId) return [3 /*break*/, 12];\n _b.label = 8;\n case 8:\n _b.trys.push([8, 10, , 11]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.getById(listItemId).update(objects)];\n case 9:\n iur = _b.sent();\n if (onSubmitted) {\n onSubmitted(iur.data, this.props.returnListItemInstanceOnSubmit !== false ? iur.item : undefined);\n }\n return [3 /*break*/, 11];\n case 10:\n error_1 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_1);\n }\n console.log(\"Error\", error_1);\n return [3 /*break*/, 11];\n case 11: return [3 /*break*/, 15];\n case 12:\n _b.trys.push([12, 14, , 15]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.add(objects)];\n case 13:\n iar = _b.sent();\n if (onSubmitted) {\n onSubmitted(iar.data, this.props.returnListItemInstanceOnSubmit !== false ? iar.item : undefined);\n }\n return [3 /*break*/, 15];\n case 14:\n error_2 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_2);\n }\n console.log(\"Error\", error_2);\n return [3 /*break*/, 15];\n case 15:\n this.setState({\n isSaving: false\n });\n return [3 /*break*/, 17];\n case 16:\n error_3 = _b.sent();\n if (onSubmitError) {\n onSubmitError(null, error_3);\n }\n console.log(\"Error onSubmit\", error_3);\n return [3 /*break*/, 17];\n case 17: return [2 /*return*/];\n }\n });\n }); };\n // trigger when the user change any value in the form\n _this.onChange = function (internalName, newValue, additionalData) { return __awaiter(_this, void 0, void 0, function () {\n var fieldCol, field, user, result, _loop_2, retrivedItem, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fieldCol = (this.state.fieldCollection || []).slice();\n field = fieldCol.filter(function (element, i) { return element.columnInternalName === internalName; })[0];\n field.newValue = newValue;\n field.additionalData = additionalData;\n if (!(field.fieldType === \"User\" && newValue.length !== 0)) return [3 /*break*/, 4];\n if (!(newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = newValue[0].secondaryText;\n if (user.indexOf('@') === -1) {\n user = newValue[0].loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue = result.data.Id;\n return [3 /*break*/, 3];\n case 2:\n field.newValue = newValue[0].id;\n _a.label = 3;\n case 3: return [3 /*break*/, 8];\n case 4:\n if (!(field.fieldType === \"UserMulti\" && newValue.length !== 0)) return [3 /*break*/, 8];\n field.newValue = [];\n _loop_2 = function (index) {\n var element, user, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n element = newValue[index];\n retrivedItem = false;\n if (field.fieldDefaultValue != null) {\n if (field.fieldDefaultValue.join(',').indexOf(element.text) !== -1)\n field.fieldDefaultValue.forEach(function (item) {\n if (item.split('/')[1] === element.text) {\n retrivedItem = true;\n field.newValue.push(item.split('/')[0]);\n }\n });\n }\n if (!!retrivedItem) return [3 /*break*/, 3];\n if (!(element.id === undefined || parseInt(element.id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = element.secondaryText;\n if (user.indexOf('@') === -1) {\n user = element.loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue.push(result.data.Id);\n return [3 /*break*/, 3];\n case 2:\n field.newValue.push(element.id);\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n };\n index = 0;\n _a.label = 5;\n case 5:\n if (!(index < newValue.length)) return [3 /*break*/, 8];\n return [5 /*yield**/, _loop_2(index)];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7:\n index++;\n return [3 /*break*/, 5];\n case 8:\n this.setState({\n fieldCollection: fieldCol\n });\n return [2 /*return*/];\n }\n });\n }); };\n //getting all the fields information as part of get ready process\n _this.getFieldInformations = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, context, listId, listItemId, disabledFields, contentTypeId, spList, item, defaultContentType, listFeilds, tempFields, order, responseValue, _loop_3, this_2, i, len, error_4;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, context = _a.context, listId = _a.listId, listItemId = _a.listItemId, disabledFields = _a.disabledFields;\n contentTypeId = this.props.contentTypeId;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 12, , 13]);\n return [4 /*yield*/, sp.web.lists.getById(listId)];\n case 2:\n spList = _b.sent();\n item = null;\n if (!(listItemId !== undefined && listItemId !== null && listItemId !== 0)) return [3 /*break*/, 4];\n return [4 /*yield*/, spList.items.getById(listItemId).get()];\n case 3:\n item = _b.sent();\n _b.label = 4;\n case 4:\n if (!(contentTypeId === undefined || contentTypeId === '')) return [3 /*break*/, 6];\n return [4 /*yield*/, spList.contentTypes.select(\"Id\", \"Name\").get()];\n case 5:\n defaultContentType = _b.sent();\n contentTypeId = defaultContentType[0][\"Id\"].StringValue;\n _b.label = 6;\n case 6: return [4 /*yield*/, this.getFormFields(listId, contentTypeId, this.webURL)];\n case 7:\n listFeilds = _b.sent();\n tempFields = [];\n order = 0;\n responseValue = listFeilds['value'];\n _loop_3 = function (i, len) {\n var field, fieldType, hiddenName, termSetId, lookupListId, lookupField, choices, defaultValue, selectedTags, richText, dateFormat, principalType, response, response, schemaXml, dateFormatRegEx, userEmails, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n field = responseValue[i];\n order++;\n fieldType = field['TypeAsString'];\n field.order = order;\n hiddenName = \"\";\n termSetId = \"\";\n lookupListId = \"\";\n lookupField = \"\";\n choices = [];\n defaultValue = null;\n selectedTags = [];\n richText = false;\n dateFormat = void 0;\n principalType = \"\";\n if (item !== null) {\n defaultValue = item[field.EntityPropertyName];\n }\n else {\n defaultValue = field.DefaultValue;\n }\n if (!(fieldType === 'Choice' || fieldType === 'MultiChoice')) return [3 /*break*/, 1];\n field[\"Choices\"].forEach(function (element) {\n choices.push({ key: element, text: element });\n });\n return [3 /*break*/, 27];\n case 1:\n if (!(fieldType === \"Note\")) return [3 /*break*/, 2];\n richText = field[\"RichText\"];\n return [3 /*break*/, 27];\n case 2:\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 6];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 4];\n return [4 /*yield*/, this_2._spService.getLookupValue(listId, listItemId, field.EntityPropertyName, lookupField, this_2.webURL)];\n case 3:\n defaultValue = _c.sent();\n return [3 /*break*/, 5];\n case 4:\n defaultValue = [];\n _c.label = 5;\n case 5: return [3 /*break*/, 27];\n case 6:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 10];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 8];\n return [4 /*yield*/, this_2._spService.getLookupValues(listId, listItemId, field.EntityPropertyName, lookupField, this_2.webURL)];\n case 7:\n defaultValue = _c.sent();\n return [3 /*break*/, 9];\n case 8:\n defaultValue = [];\n _c.label = 9;\n case 9: return [3 /*break*/, 27];\n case 10:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 12];\n return [4 /*yield*/, this_2._spService.getTaxonomyFieldInternalName(this_2.props.listId, field.InternalName, this_2.webURL)];\n case 11:\n response = _c.sent();\n hiddenName = response[\"value\"];\n termSetId = field[\"TermSetId\"];\n if (item !== null) {\n item[field.InternalName].forEach(function (element) {\n selectedTags.push({ key: element.TermGuid, name: element.Label });\n });\n defaultValue = selectedTags;\n }\n else {\n if (defaultValue !== \"\") {\n defaultValue.split(/#|;/).forEach(function (element) {\n if (element.indexOf('|') !== -1)\n selectedTags.push({ key: element.split('|')[1], name: element.split('|')[0] });\n });\n defaultValue = selectedTags;\n }\n }\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 12:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 16];\n termSetId = field[\"TermSetId\"];\n if (!(item !== null)) return [3 /*break*/, 14];\n return [4 /*yield*/, this_2._spService.getSingleManagedMtadataLabel(listId, listItemId, field.InternalName)];\n case 13:\n response = _c.sent();\n if (response) {\n selectedTags.push({ key: response[\"TermID\"], name: response[\"Label\"] });\n defaultValue = selectedTags;\n }\n return [3 /*break*/, 15];\n case 14:\n if (defaultValue !== \"\") {\n selectedTags.push({ key: defaultValue.split('|')[1], name: defaultValue.split('|')[0].split('#')[1] });\n defaultValue = selectedTags;\n }\n _c.label = 15;\n case 15:\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 16:\n if (!(fieldType === \"DateTime\")) return [3 /*break*/, 17];\n if (item !== null && item[field.InternalName])\n defaultValue = new Date(item[field.InternalName]);\n else if (defaultValue === '[today]') {\n defaultValue = new Date();\n }\n schemaXml = field.SchemaXml;\n dateFormatRegEx = /\\s+Format=\\\"([^\\\"]+)\\\"/gmi.exec(schemaXml);\n dateFormat = dateFormatRegEx && dateFormatRegEx.length ? dateFormatRegEx[1] : 'DateOnly';\n return [3 /*break*/, 27];\n case 17:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 21];\n if (!(item !== null)) return [3 /*break*/, 19];\n return [4 /*yield*/, this_2._spService.getUsersUPNFromFieldValue(listId, listItemId, field.InternalName, this_2.webURL)];\n case 18:\n defaultValue = _c.sent();\n return [3 /*break*/, 20];\n case 19:\n defaultValue = [];\n _c.label = 20;\n case 20:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 21:\n if (!(fieldType === \"Thumbnail\")) return [3 /*break*/, 22];\n if (defaultValue !== null) {\n defaultValue = this_2.webURL.split('/sites/')[0] + JSON.parse(defaultValue).serverRelativeUrl;\n }\n return [3 /*break*/, 27];\n case 22:\n if (!(fieldType === \"User\")) return [3 /*break*/, 26];\n if (!(item !== null)) return [3 /*break*/, 24];\n userEmails = [];\n _b = (_a = userEmails).push;\n return [4 /*yield*/, this_2._spService.getUserUPNById(parseInt(item[field.InternalName + \"Id\"]))];\n case 23:\n _b.apply(_a, [(_c.sent()) + '']);\n defaultValue = userEmails;\n return [3 /*break*/, 25];\n case 24:\n defaultValue = [];\n _c.label = 25;\n case 25:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 26:\n if (fieldType === \"Location\") {\n defaultValue = JSON.parse(defaultValue);\n }\n else if (fieldType === \"Boolean\") {\n defaultValue = Boolean(Number(defaultValue));\n }\n _c.label = 27;\n case 27:\n tempFields.push({\n newValue: null,\n fieldTermSetId: termSetId,\n options: choices,\n lookupListID: lookupListId,\n lookupField: lookupField,\n changedValue: defaultValue,\n fieldType: field.TypeAsString,\n fieldTitle: field.Title,\n fieldDefaultValue: defaultValue,\n context: this_2.props.context,\n disabled: this_2.props.disabled || (disabledFields && disabledFields.indexOf(field.InternalName) > -1),\n listId: this_2.props.listId,\n columnInternalName: field.EntityPropertyName,\n label: field.Title,\n onChanged: this_2.onChange,\n required: field.Required,\n hiddenFieldName: hiddenName,\n Order: field.order,\n isRichText: richText,\n dateFormat: dateFormat,\n listItemId: listItemId,\n principalType: principalType,\n description: field.Description\n });\n tempFields.sort(function (a, b) { return a.Order - b.Order; });\n return [2 /*return*/];\n }\n });\n };\n this_2 = this;\n i = 0, len = responseValue.length;\n _b.label = 8;\n case 8:\n if (!(i < len)) return [3 /*break*/, 11];\n return [5 /*yield**/, _loop_3(i, len)];\n case 9:\n _b.sent();\n _b.label = 10;\n case 10:\n i++;\n return [3 /*break*/, 8];\n case 11:\n this.setState({ fieldCollection: tempFields });\n return [3 /*break*/, 13];\n case 12:\n error_4 = _b.sent();\n console.log(\"Error get field informations\", error_4);\n return [2 /*return*/, null];\n case 13: return [2 /*return*/];\n }\n });\n }); };\n _this.uplaodImage = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, fileInstance, buffer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId;\n if (!file.fileAbsoluteUrl) return [3 /*break*/, 1];\n return [2 /*return*/, {\n Name: file.fileName,\n ServerRelativeUrl: file.fileAbsoluteUrl,\n UniqueId: ''\n }];\n case 1: return [4 /*yield*/, file.downloadFileContent()];\n case 2:\n fileInstance = _b.sent();\n return [4 /*yield*/, this.getImageArrayBuffer(fileInstance)];\n case 3:\n buffer = _b.sent();\n return [4 /*yield*/, this._spService.uploadImage(listId, listItemId, file.fileName, buffer, undefined)];\n case 4: return [2 /*return*/, _b.sent()];\n }\n });\n }); };\n _this.getImageArrayBuffer = function (file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(file);\n reader.onload = function () {\n resolve(reader.result);\n };\n });\n };\n _this.getFormFields = function (listId, contentTypeId, webUrl) { return __awaiter(_this, void 0, void 0, function () {\n var context, webAbsoluteUrl, apiUrl, data, results, error_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 4, , 5]);\n context = this.props.context;\n webAbsoluteUrl = !webUrl ? this.webURL : webUrl;\n apiUrl = '';\n if (contentTypeId !== undefined && contentTypeId !== '') {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/contenttypes('\" + contentTypeId + \"')/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n else {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n return [4 /*yield*/, context.spHttpClient.get(apiUrl, SPHttpClient.configurations.v1)];\n case 1:\n data = _a.sent();\n if (!data.ok) return [3 /*break*/, 3];\n return [4 /*yield*/, data.json()];\n case 2:\n results = _a.sent();\n if (results) {\n return [2 /*return*/, results];\n }\n _a.label = 3;\n case 3: return [2 /*return*/, null];\n case 4:\n error_5 = _a.sent();\n console.dir(error_5);\n return [2 /*return*/, Promise.reject(error_5)];\n case 5: return [2 /*return*/];\n }\n });\n }); };\n // Initialize pnp sp\n if (_this.props.webAbsoluteUrl) {\n sp.setup({\n sp: {\n headers: {\n Accept: \"application/json;odata=verbose\",\n },\n baseUrl: _this.props.webAbsoluteUrl\n },\n });\n }\n else {\n sp.setup({\n spfxContext: _this.props.context\n });\n }\n // Initialize state\n _this.state = {\n fieldCollection: []\n };\n // Get SPService Factory\n _this._spService = _this.props.webAbsoluteUrl ? new SPservice(_this.props.context, _this.props.webAbsoluteUrl) : new SPservice(_this.props.context);\n return _this;\n }\n /**\n * Lifecycle hook when component is mounted\n */\n DynamicForm.prototype.componentDidMount = function () {\n this.getFieldInformations();\n };\n /**\n * Default React component render method\n */\n DynamicForm.prototype.render = function () {\n var _this = this;\n var _a = this.state, fieldCollection = _a.fieldCollection, isSaving = _a.isSaving;\n return (React.createElement(\"div\", null, fieldCollection.length === 0 ? React.createElement(\"div\", null,\n React.createElement(ProgressIndicator, { label: strings.DynamicFormLoading, description: strings.DynamicFormPleaseWait })) :\n React.createElement(\"div\", null,\n fieldCollection.map(function (v, i) {\n return React.createElement(DynamicField, __assign({}, v, { disabled: v.disabled || isSaving }));\n }),\n !this.props.disabled &&\n React.createElement(Stack, { className: styles.buttons, horizontal: true, tokens: stackTokens },\n React.createElement(PrimaryButton, { disabled: isSaving, text: strings.Save, onClick: function () { return _this.onSubmitClick(); } }),\n React.createElement(DefaultButton, { disabled: isSaving, text: strings.Cancel, onClick: this.props.onCancelled })))));\n };\n return DynamicForm;\n}(React.Component));\nexport { DynamicForm };\n"
249913
249931
  },
249914
249932
  {
249915
249933
  "id": "RQLH",
@@ -259998,7 +260016,7 @@
259998
260016
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
259999
260017
  "type": "harmony import specifier",
260000
260018
  "userRequest": "ControlStrings",
260001
- "loc": "692:60-86"
260019
+ "loc": "705:60-86"
260002
260020
  },
260003
260021
  {
260004
260022
  "moduleId": "RPzn",
@@ -260007,7 +260025,7 @@
260007
260025
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
260008
260026
  "type": "harmony import specifier",
260009
260027
  "userRequest": "ControlStrings",
260010
- "loc": "692:101-130"
260028
+ "loc": "705:101-130"
260011
260029
  },
260012
260030
  {
260013
260031
  "moduleId": "RPzn",
@@ -260016,7 +260034,7 @@
260016
260034
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
260017
260035
  "type": "harmony import specifier",
260018
260036
  "userRequest": "ControlStrings",
260019
- "loc": "698:83-95"
260037
+ "loc": "712:87-99"
260020
260038
  },
260021
260039
  {
260022
260040
  "moduleId": "RPzn",
@@ -260025,7 +260043,7 @@
260025
260043
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
260026
260044
  "type": "harmony import specifier",
260027
260045
  "userRequest": "ControlStrings",
260028
- "loc": "699:83-97"
260046
+ "loc": "713:87-101"
260029
260047
  },
260030
260048
  {
260031
260049
  "moduleId": "SXK8",
@@ -359731,7 +359749,7 @@
359731
359749
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359732
359750
  "type": "harmony import specifier",
359733
359751
  "userRequest": "react",
359734
- "loc": "691:16-35"
359752
+ "loc": "704:16-35"
359735
359753
  },
359736
359754
  {
359737
359755
  "moduleId": "RPzn",
@@ -359740,7 +359758,7 @@
359740
359758
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359741
359759
  "type": "harmony import specifier",
359742
359760
  "userRequest": "react",
359743
- "loc": "691:80-99"
359761
+ "loc": "704:80-99"
359744
359762
  },
359745
359763
  {
359746
359764
  "moduleId": "RPzn",
@@ -359749,7 +359767,7 @@
359749
359767
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359750
359768
  "type": "harmony import specifier",
359751
359769
  "userRequest": "react",
359752
- "loc": "692:12-31"
359770
+ "loc": "705:12-31"
359753
359771
  },
359754
359772
  {
359755
359773
  "moduleId": "RPzn",
@@ -359758,7 +359776,7 @@
359758
359776
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359759
359777
  "type": "harmony import specifier",
359760
359778
  "userRequest": "react",
359761
- "loc": "693:12-31"
359779
+ "loc": "706:12-31"
359762
359780
  },
359763
359781
  {
359764
359782
  "moduleId": "RPzn",
@@ -359767,7 +359785,7 @@
359767
359785
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359768
359786
  "type": "harmony import specifier",
359769
359787
  "userRequest": "react",
359770
- "loc": "695:27-46"
359788
+ "loc": "708:27-46"
359771
359789
  },
359772
359790
  {
359773
359791
  "moduleId": "RPzn",
@@ -359776,7 +359794,7 @@
359776
359794
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359777
359795
  "type": "harmony import specifier",
359778
359796
  "userRequest": "react",
359779
- "loc": "697:16-35"
359797
+ "loc": "711:20-39"
359780
359798
  },
359781
359799
  {
359782
359800
  "moduleId": "RPzn",
@@ -359785,7 +359803,7 @@
359785
359803
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359786
359804
  "type": "harmony import specifier",
359787
359805
  "userRequest": "react",
359788
- "loc": "698:20-39"
359806
+ "loc": "712:24-43"
359789
359807
  },
359790
359808
  {
359791
359809
  "moduleId": "RPzn",
@@ -359794,7 +359812,7 @@
359794
359812
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359795
359813
  "type": "harmony import specifier",
359796
359814
  "userRequest": "react",
359797
- "loc": "699:20-39"
359815
+ "loc": "713:24-43"
359798
359816
  },
359799
359817
  {
359800
359818
  "moduleId": "RPzn",
@@ -359803,7 +359821,7 @@
359803
359821
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
359804
359822
  "type": "harmony import specifier",
359805
359823
  "userRequest": "react",
359806
- "loc": "702:2-17"
359824
+ "loc": "716:2-17"
359807
359825
  },
359808
359826
  {
359809
359827
  "moduleId": "RQjC",
@@ -391240,7 +391258,7 @@
391240
391258
  ],
391241
391259
  "optimizationBailout": [],
391242
391260
  "depth": 4,
391243
- "source": "export var version = \"3.9.0-beta.2556922\";\n"
391261
+ "source": "export var version = \"3.9.0-beta.2597970\";\n"
391244
391262
  },
391245
391263
  {
391246
391264
  "id": "cLrF",
@@ -520643,7 +520661,7 @@
520643
520661
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
520644
520662
  "type": "harmony import specifier",
520645
520663
  "userRequest": "office-ui-fabric-react/lib/Stack",
520646
- "loc": "697:36-41"
520664
+ "loc": "711:40-45"
520647
520665
  },
520648
520666
  {
520649
520667
  "moduleId": "SXK8",
@@ -532441,7 +532459,7 @@
532441
532459
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
532442
532460
  "type": "harmony import specifier",
532443
532461
  "userRequest": "@microsoft/sp-http",
532444
- "loc": "647:78-90"
532462
+ "loc": "648:78-90"
532445
532463
  },
532446
532464
  {
532447
532465
  "moduleId": "SRtU",
@@ -572142,7 +572160,7 @@
572142
572160
  "ootb-fields-field-customizer.js",
572143
572161
  "ootb-fields-field-customizer.js.map"
572144
572162
  ],
572145
- "hash": "11d6dd989097f38c67c6",
572163
+ "hash": "56ad8ac29051ee0aa9cd",
572146
572164
  "siblings": [],
572147
572165
  "parents": [],
572148
572166
  "children": [],
@@ -608047,7 +608065,7 @@
608047
608065
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
608048
608066
  "type": "harmony import specifier",
608049
608067
  "userRequest": "office-ui-fabric-react/lib/Button",
608050
- "loc": "698:40-53"
608068
+ "loc": "712:44-57"
608051
608069
  },
608052
608070
  {
608053
608071
  "moduleId": "RPzn",
@@ -608056,7 +608074,7 @@
608056
608074
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
608057
608075
  "type": "harmony import specifier",
608058
608076
  "userRequest": "office-ui-fabric-react/lib/Button",
608059
- "loc": "699:40-53"
608077
+ "loc": "713:44-57"
608060
608078
  },
608061
608079
  {
608062
608080
  "moduleId": "SXK8",
@@ -658765,7 +658783,7 @@
658765
658783
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
658766
658784
  "type": "harmony import specifier",
658767
658785
  "userRequest": "ControlStrings",
658768
- "loc": "692:60-86"
658786
+ "loc": "705:60-86"
658769
658787
  },
658770
658788
  {
658771
658789
  "moduleId": "RPzn",
@@ -658774,7 +658792,7 @@
658774
658792
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
658775
658793
  "type": "harmony import specifier",
658776
658794
  "userRequest": "ControlStrings",
658777
- "loc": "692:101-130"
658795
+ "loc": "705:101-130"
658778
658796
  },
658779
658797
  {
658780
658798
  "moduleId": "RPzn",
@@ -658783,7 +658801,7 @@
658783
658801
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
658784
658802
  "type": "harmony import specifier",
658785
658803
  "userRequest": "ControlStrings",
658786
- "loc": "698:83-95"
658804
+ "loc": "712:87-99"
658787
658805
  },
658788
658806
  {
658789
658807
  "moduleId": "RPzn",
@@ -658792,7 +658810,7 @@
658792
658810
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
658793
658811
  "type": "harmony import specifier",
658794
658812
  "userRequest": "ControlStrings",
658795
- "loc": "699:83-97"
658813
+ "loc": "713:87-101"
658796
658814
  },
658797
658815
  {
658798
658816
  "moduleId": "SXK8",
@@ -701245,7 +701263,7 @@
701245
701263
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701246
701264
  "type": "harmony import specifier",
701247
701265
  "userRequest": "react",
701248
- "loc": "691:16-35"
701266
+ "loc": "704:16-35"
701249
701267
  },
701250
701268
  {
701251
701269
  "moduleId": "RPzn",
@@ -701254,7 +701272,7 @@
701254
701272
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701255
701273
  "type": "harmony import specifier",
701256
701274
  "userRequest": "react",
701257
- "loc": "691:80-99"
701275
+ "loc": "704:80-99"
701258
701276
  },
701259
701277
  {
701260
701278
  "moduleId": "RPzn",
@@ -701263,7 +701281,7 @@
701263
701281
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701264
701282
  "type": "harmony import specifier",
701265
701283
  "userRequest": "react",
701266
- "loc": "692:12-31"
701284
+ "loc": "705:12-31"
701267
701285
  },
701268
701286
  {
701269
701287
  "moduleId": "RPzn",
@@ -701272,7 +701290,7 @@
701272
701290
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701273
701291
  "type": "harmony import specifier",
701274
701292
  "userRequest": "react",
701275
- "loc": "693:12-31"
701293
+ "loc": "706:12-31"
701276
701294
  },
701277
701295
  {
701278
701296
  "moduleId": "RPzn",
@@ -701281,7 +701299,7 @@
701281
701299
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701282
701300
  "type": "harmony import specifier",
701283
701301
  "userRequest": "react",
701284
- "loc": "695:27-46"
701302
+ "loc": "708:27-46"
701285
701303
  },
701286
701304
  {
701287
701305
  "moduleId": "RPzn",
@@ -701290,7 +701308,7 @@
701290
701308
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701291
701309
  "type": "harmony import specifier",
701292
701310
  "userRequest": "react",
701293
- "loc": "697:16-35"
701311
+ "loc": "711:20-39"
701294
701312
  },
701295
701313
  {
701296
701314
  "moduleId": "RPzn",
@@ -701299,7 +701317,7 @@
701299
701317
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701300
701318
  "type": "harmony import specifier",
701301
701319
  "userRequest": "react",
701302
- "loc": "698:20-39"
701320
+ "loc": "712:24-43"
701303
701321
  },
701304
701322
  {
701305
701323
  "moduleId": "RPzn",
@@ -701308,7 +701326,7 @@
701308
701326
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701309
701327
  "type": "harmony import specifier",
701310
701328
  "userRequest": "react",
701311
- "loc": "699:20-39"
701329
+ "loc": "713:24-43"
701312
701330
  },
701313
701331
  {
701314
701332
  "moduleId": "RPzn",
@@ -701317,7 +701335,7 @@
701317
701335
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
701318
701336
  "type": "harmony import specifier",
701319
701337
  "userRequest": "react",
701320
- "loc": "702:2-17"
701338
+ "loc": "716:2-17"
701321
701339
  },
701322
701340
  {
701323
701341
  "moduleId": "RQjC",
@@ -732601,7 +732619,7 @@
732601
732619
  ],
732602
732620
  "optimizationBailout": [],
732603
732621
  "depth": 4,
732604
- "source": "export var version = \"3.9.0-beta.2556922\";\n"
732622
+ "source": "export var version = \"3.9.0-beta.2597970\";\n"
732605
732623
  },
732606
732624
  {
732607
732625
  "id": "cPD0",
@@ -762552,7 +762570,7 @@
762552
762570
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
762553
762571
  "type": "harmony import specifier",
762554
762572
  "userRequest": "@microsoft/sp-http",
762555
- "loc": "647:78-90"
762573
+ "loc": "648:78-90"
762556
762574
  },
762557
762575
  {
762558
762576
  "moduleId": "SRtU",
@@ -832558,7 +832576,7 @@
832558
832576
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
832559
832577
  "type": "harmony import specifier",
832560
832578
  "userRequest": "./dynamicField",
832561
- "loc": "695:47-59"
832579
+ "loc": "708:47-59"
832562
832580
  }
832563
832581
  ],
832564
832582
  "providedExports": null,
@@ -838532,7 +838550,7 @@
838532
838550
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
838533
838551
  "type": "harmony import specifier",
838534
838552
  "userRequest": "office-ui-fabric-react/lib/ProgressIndicator",
838535
- "loc": "692:32-49"
838553
+ "loc": "705:32-49"
838536
838554
  }
838537
838555
  ],
838538
838556
  "providedExports": [
@@ -862887,7 +862905,16 @@
862887
862905
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
862888
862906
  "type": "harmony import specifier",
862889
862907
  "userRequest": "../../services/SPService",
862890
- "loc": "676:31-40"
862908
+ "loc": "689:60-69"
862909
+ },
862910
+ {
862911
+ "moduleId": "RPzn",
862912
+ "moduleIdentifier": "/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/node_modules/source-map-loader/index.js!/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/lib/controls/dynamicForm/DynamicForm.js",
862913
+ "module": "./lib/controls/dynamicForm/DynamicForm.js",
862914
+ "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
862915
+ "type": "harmony import specifier",
862916
+ "userRequest": "../../services/SPService",
862917
+ "loc": "689:125-134"
862891
862918
  },
862892
862919
  {
862893
862920
  "moduleId": "k0SN",
@@ -915391,7 +915418,7 @@
915391
915418
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915392
915419
  "type": "harmony import specifier",
915393
915420
  "userRequest": "@pnp/sp/presets/all",
915394
- "loc": "222:45-47"
915421
+ "loc": "223:45-47"
915395
915422
  },
915396
915423
  {
915397
915424
  "moduleId": "RPzn",
@@ -915400,7 +915427,7 @@
915400
915427
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915401
915428
  "type": "harmony import specifier",
915402
915429
  "userRequest": "@pnp/sp/presets/all",
915403
- "loc": "239:45-47"
915430
+ "loc": "240:45-47"
915404
915431
  },
915405
915432
  {
915406
915433
  "moduleId": "RPzn",
@@ -915409,7 +915436,7 @@
915409
915436
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915410
915437
  "type": "harmony import specifier",
915411
915438
  "userRequest": "@pnp/sp/presets/all",
915412
- "loc": "285:45-47"
915439
+ "loc": "286:45-47"
915413
915440
  },
915414
915441
  {
915415
915442
  "moduleId": "RPzn",
@@ -915418,7 +915445,7 @@
915418
915445
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915419
915446
  "type": "harmony import specifier",
915420
915447
  "userRequest": "@pnp/sp/presets/all",
915421
- "loc": "319:61-63"
915448
+ "loc": "320:61-63"
915422
915449
  },
915423
915450
  {
915424
915451
  "moduleId": "RPzn",
@@ -915427,7 +915454,7 @@
915427
915454
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915428
915455
  "type": "harmony import specifier",
915429
915456
  "userRequest": "@pnp/sp/presets/all",
915430
- "loc": "361:45-47"
915457
+ "loc": "362:45-47"
915431
915458
  },
915432
915459
  {
915433
915460
  "moduleId": "RPzn",
@@ -915436,7 +915463,16 @@
915436
915463
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915437
915464
  "type": "harmony import specifier",
915438
915465
  "userRequest": "@pnp/sp/presets/all",
915439
- "loc": "668:8-10"
915466
+ "loc": "670:12-14"
915467
+ },
915468
+ {
915469
+ "moduleId": "RPzn",
915470
+ "moduleIdentifier": "/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/node_modules/source-map-loader/index.js!/home/runner/work/sp-dev-fx-controls-react/sp-dev-fx-controls-react/lib/controls/dynamicForm/DynamicForm.js",
915471
+ "module": "./lib/controls/dynamicForm/DynamicForm.js",
915472
+ "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
915473
+ "type": "harmony import specifier",
915474
+ "userRequest": "@pnp/sp/presets/all",
915475
+ "loc": "680:12-14"
915440
915476
  },
915441
915477
  {
915442
915478
  "moduleId": "Y+es",
@@ -918526,7 +918562,7 @@
918526
918562
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
918527
918563
  "type": "harmony import specifier",
918528
918564
  "userRequest": "./DynamicForm.module.scss",
918529
- "loc": "697:56-62"
918565
+ "loc": "711:60-66"
918530
918566
  },
918531
918567
  {
918532
918568
  "moduleId": "Y+es",
@@ -921766,7 +921802,7 @@
921766
921802
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
921767
921803
  "type": "harmony import specifier",
921768
921804
  "userRequest": "office-ui-fabric-react/lib/Button",
921769
- "loc": "698:40-53"
921805
+ "loc": "712:44-57"
921770
921806
  },
921771
921807
  {
921772
921808
  "moduleId": "RPzn",
@@ -921775,7 +921811,7 @@
921775
921811
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
921776
921812
  "type": "harmony import specifier",
921777
921813
  "userRequest": "office-ui-fabric-react/lib/Button",
921778
- "loc": "699:40-53"
921814
+ "loc": "713:44-57"
921779
921815
  },
921780
921816
  {
921781
921817
  "moduleId": "SXK8",
@@ -1026985,7 +1027021,7 @@
1026985
1027021
  "name": "./lib/controls/dynamicForm/DynamicForm.js",
1026986
1027022
  "index": 3092,
1026987
1027023
  "index2": 3401,
1026988
- "size": 42886,
1027024
+ "size": 43348,
1026989
1027025
  "cacheable": true,
1026990
1027026
  "built": true,
1026991
1027027
  "optional": false,
@@ -1027042,7 +1027078,7 @@
1027042
1027078
  ],
1027043
1027079
  "optimizationBailout": [],
1027044
1027080
  "depth": 3,
1027045
- "source": "var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport * as React from 'react';\nimport styles from './DynamicForm.module.scss';\nimport { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';\nimport { Stack } from 'office-ui-fabric-react/lib/Stack';\nimport SPservice from '../../services/SPService';\nimport { DynamicField } from './dynamicField';\nimport { sp } from '@pnp/sp/presets/all';\nimport { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';\nimport * as strings from 'ControlStrings';\nimport { SPHttpClient } from '@microsoft/sp-http';\nvar stackTokens = { childrenGap: 20 };\n/**\n * DynamicForm Class Control\n */\nvar DynamicForm = /** @class */ (function (_super) {\n __extends(DynamicForm, _super);\n function DynamicForm(props) {\n var _this = _super.call(this, props) || this;\n //trigger when the user submits the form.\n _this.onSubmitClick = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, onSubmitted, onBeforeSubmit, onSubmitError, shouldBeReturnBack_1, fields, objects, _loop_1, this_1, i, len, isCancelled, iur, error_1, iar, error_2, error_3;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId, onSubmitted = _a.onSubmitted, onBeforeSubmit = _a.onBeforeSubmit, onSubmitError = _a.onSubmitError;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 16, , 17]);\n shouldBeReturnBack_1 = false;\n fields = (this.state.fieldCollection || []).slice();\n fields.forEach(function (val) {\n if (val.required) {\n if (val.newValue === null) {\n if (val.fieldDefaultValue === null || val.fieldDefaultValue === '' || val.fieldDefaultValue.length === 0) {\n if (val.fieldType === \"DateTime\")\n val.fieldDefaultValue = null;\n else\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n else if (val.newValue === '') {\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n });\n if (shouldBeReturnBack_1) {\n this.setState({ fieldCollection: fields });\n return [2 /*return*/];\n }\n this.setState({\n isSaving: true\n });\n objects = {};\n _loop_1 = function (i, len) {\n var val, fieldType, additionalData, columnInternalName, hiddenFieldName, value_1, uploadedImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n val = fields[i];\n fieldType = val.fieldType, additionalData = val.additionalData, columnInternalName = val.columnInternalName, hiddenFieldName = val.hiddenFieldName;\n if (!(val.newValue !== null && val.newValue !== undefined)) return [3 /*break*/, 14];\n value_1 = val.newValue;\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 1];\n objects[columnInternalName + \"Id\"] = value_1[0].key;\n return [3 /*break*/, 14];\n case 1:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 2];\n value_1 = [];\n val.newValue.forEach(function (element) {\n value_1.push(element.key);\n });\n objects[columnInternalName + \"Id\"] = { results: value_1 };\n return [3 /*break*/, 14];\n case 2:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 3];\n objects[columnInternalName] = {\n '__metadata': { 'type': 'SP.Taxonomy.TaxonomyFieldValue' },\n 'Label': value_1[0].name,\n 'TermGuid': value_1[0].key,\n 'WssId': '-1'\n };\n return [3 /*break*/, 14];\n case 3:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 4];\n objects[hiddenFieldName] = val.newValue.map(function (term) { return \"-1#;\" + term.name + \"|\" + term.key + \";\"; }).join('#');\n return [3 /*break*/, 14];\n case 4:\n if (!(fieldType === \"User\")) return [3 /*break*/, 5];\n objects[columnInternalName + \"Id\"] = val.newValue;\n return [3 /*break*/, 14];\n case 5:\n if (!(fieldType === \"Choice\")) return [3 /*break*/, 6];\n objects[columnInternalName] = val.newValue.key;\n return [3 /*break*/, 14];\n case 6:\n if (!(fieldType === \"MultiChoice\")) return [3 /*break*/, 7];\n objects[columnInternalName] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 7:\n if (!(fieldType === \"Location\")) return [3 /*break*/, 8];\n objects[columnInternalName] = JSON.stringify(val.newValue);\n return [3 /*break*/, 14];\n case 8:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 9];\n objects[columnInternalName + \"Id\"] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 9:\n if (!(fieldType === 'Thumbnail')) return [3 /*break*/, 13];\n if (!additionalData) return [3 /*break*/, 11];\n return [4 /*yield*/, this_1.uplaodImage(additionalData)];\n case 10:\n uploadedImage = _a.sent();\n objects[columnInternalName] = JSON.stringify({\n type: 'thumbnail',\n fileName: uploadedImage.Name,\n serverRelativeUrl: uploadedImage.ServerRelativeUrl,\n id: uploadedImage.UniqueId\n });\n return [3 /*break*/, 12];\n case 11:\n objects[columnInternalName] = null;\n _a.label = 12;\n case 12: return [3 /*break*/, 14];\n case 13:\n objects[columnInternalName] = val.newValue;\n _a.label = 14;\n case 14: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n i = 0, len = fields.length;\n _b.label = 2;\n case 2:\n if (!(i < len)) return [3 /*break*/, 5];\n return [5 /*yield**/, _loop_1(i, len)];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n if (!onBeforeSubmit) return [3 /*break*/, 7];\n return [4 /*yield*/, onBeforeSubmit(objects)];\n case 6:\n isCancelled = _b.sent();\n if (isCancelled) {\n this.setState({\n isSaving: false\n });\n return [2 /*return*/];\n }\n _b.label = 7;\n case 7:\n if (!listItemId) return [3 /*break*/, 12];\n _b.label = 8;\n case 8:\n _b.trys.push([8, 10, , 11]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.getById(listItemId).update(objects)];\n case 9:\n iur = _b.sent();\n if (onSubmitted) {\n onSubmitted(iur.data, this.props.returnListItemInstanceOnSubmit !== false ? iur.item : undefined);\n }\n return [3 /*break*/, 11];\n case 10:\n error_1 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_1);\n }\n console.log(\"Error\", error_1);\n return [3 /*break*/, 11];\n case 11: return [3 /*break*/, 15];\n case 12:\n _b.trys.push([12, 14, , 15]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.add(objects)];\n case 13:\n iar = _b.sent();\n if (onSubmitted) {\n onSubmitted(iar.data, this.props.returnListItemInstanceOnSubmit !== false ? iar.item : undefined);\n }\n return [3 /*break*/, 15];\n case 14:\n error_2 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_2);\n }\n console.log(\"Error\", error_2);\n return [3 /*break*/, 15];\n case 15:\n this.setState({\n isSaving: false\n });\n return [3 /*break*/, 17];\n case 16:\n error_3 = _b.sent();\n if (onSubmitError) {\n onSubmitError(null, error_3);\n }\n console.log(\"Error onSubmit\", error_3);\n return [3 /*break*/, 17];\n case 17: return [2 /*return*/];\n }\n });\n }); };\n // trigger when the user change any value in the form\n _this.onChange = function (internalName, newValue, additionalData) { return __awaiter(_this, void 0, void 0, function () {\n var fieldCol, field, user, result, _loop_2, retrivedItem, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fieldCol = (this.state.fieldCollection || []).slice();\n field = fieldCol.filter(function (element, i) { return element.columnInternalName === internalName; })[0];\n field.newValue = newValue;\n field.additionalData = additionalData;\n if (!(field.fieldType === \"User\" && newValue.length !== 0)) return [3 /*break*/, 4];\n if (!(newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = newValue[0].secondaryText;\n if (user.indexOf('@') === -1) {\n user = newValue[0].loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue = result.data.Id;\n return [3 /*break*/, 3];\n case 2:\n field.newValue = newValue[0].id;\n _a.label = 3;\n case 3: return [3 /*break*/, 8];\n case 4:\n if (!(field.fieldType === \"UserMulti\" && newValue.length !== 0)) return [3 /*break*/, 8];\n field.newValue = [];\n _loop_2 = function (index) {\n var element, user, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n element = newValue[index];\n retrivedItem = false;\n if (field.fieldDefaultValue != null) {\n if (field.fieldDefaultValue.join(',').indexOf(element.text) !== -1)\n field.fieldDefaultValue.forEach(function (item) {\n if (item.split('/')[1] === element.text) {\n retrivedItem = true;\n field.newValue.push(item.split('/')[0]);\n }\n });\n }\n if (!!retrivedItem) return [3 /*break*/, 3];\n if (!(element.id === undefined || parseInt(element.id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = element.secondaryText;\n if (user.indexOf('@') === -1) {\n user = element.loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue.push(result.data.Id);\n return [3 /*break*/, 3];\n case 2:\n field.newValue.push(element.id);\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n };\n index = 0;\n _a.label = 5;\n case 5:\n if (!(index < newValue.length)) return [3 /*break*/, 8];\n return [5 /*yield**/, _loop_2(index)];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7:\n index++;\n return [3 /*break*/, 5];\n case 8:\n this.setState({\n fieldCollection: fieldCol\n });\n return [2 /*return*/];\n }\n });\n }); };\n //getting all the fields information as part of get ready process\n _this.getFieldInformations = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, context, listId, listItemId, disabledFields, contentTypeId, spList, item, defaultContentType, listFeilds, tempFields, order, responseValue, _loop_3, this_2, i, len, error_4;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, context = _a.context, listId = _a.listId, listItemId = _a.listItemId, disabledFields = _a.disabledFields;\n contentTypeId = this.props.contentTypeId;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 12, , 13]);\n return [4 /*yield*/, sp.web.lists.getById(listId)];\n case 2:\n spList = _b.sent();\n item = null;\n if (!(listItemId !== undefined && listItemId !== null && listItemId !== 0)) return [3 /*break*/, 4];\n return [4 /*yield*/, spList.items.getById(listItemId).get()];\n case 3:\n item = _b.sent();\n _b.label = 4;\n case 4:\n if (!(contentTypeId === undefined || contentTypeId === '')) return [3 /*break*/, 6];\n return [4 /*yield*/, spList.contentTypes.select(\"Id\", \"Name\").get()];\n case 5:\n defaultContentType = _b.sent();\n contentTypeId = defaultContentType[0][\"Id\"].StringValue;\n _b.label = 6;\n case 6: return [4 /*yield*/, this.getFormFields(listId, contentTypeId, context.pageContext.web.absoluteUrl)];\n case 7:\n listFeilds = _b.sent();\n tempFields = [];\n order = 0;\n responseValue = listFeilds['value'];\n _loop_3 = function (i, len) {\n var field, fieldType, hiddenName, termSetId, lookupListId, lookupField, choices, defaultValue, selectedTags, richText, dateFormat, principalType, response, response, schemaXml, dateFormatRegEx, userEmails, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n field = responseValue[i];\n order++;\n fieldType = field['TypeAsString'];\n field.order = order;\n hiddenName = \"\";\n termSetId = \"\";\n lookupListId = \"\";\n lookupField = \"\";\n choices = [];\n defaultValue = null;\n selectedTags = [];\n richText = false;\n dateFormat = void 0;\n principalType = \"\";\n if (item !== null) {\n defaultValue = item[field.EntityPropertyName];\n }\n else {\n defaultValue = field.DefaultValue;\n }\n if (!(fieldType === 'Choice' || fieldType === 'MultiChoice')) return [3 /*break*/, 1];\n field[\"Choices\"].forEach(function (element) {\n choices.push({ key: element, text: element });\n });\n return [3 /*break*/, 27];\n case 1:\n if (!(fieldType === \"Note\")) return [3 /*break*/, 2];\n richText = field[\"RichText\"];\n return [3 /*break*/, 27];\n case 2:\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 6];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 4];\n return [4 /*yield*/, this_2._spService.getLookupValue(listId, listItemId, field.InternalName, lookupField, context.pageContext.web.absoluteUrl)];\n case 3:\n defaultValue = _c.sent();\n return [3 /*break*/, 5];\n case 4:\n defaultValue = [];\n _c.label = 5;\n case 5: return [3 /*break*/, 27];\n case 6:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 10];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 8];\n return [4 /*yield*/, this_2._spService.getLookupValues(listId, listItemId, field.InternalName, lookupField, context.pageContext.web.absoluteUrl)];\n case 7:\n defaultValue = _c.sent();\n return [3 /*break*/, 9];\n case 8:\n defaultValue = [];\n _c.label = 9;\n case 9: return [3 /*break*/, 27];\n case 10:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 12];\n return [4 /*yield*/, this_2._spService.getTaxonomyFieldInternalName(this_2.props.listId, field.InternalName, this_2.props.context.pageContext.web.absoluteUrl)];\n case 11:\n response = _c.sent();\n hiddenName = response[\"value\"];\n termSetId = field[\"TermSetId\"];\n if (item !== null) {\n item[field.InternalName].forEach(function (element) {\n selectedTags.push({ key: element.TermGuid, name: element.Label });\n });\n defaultValue = selectedTags;\n }\n else {\n if (defaultValue !== \"\") {\n defaultValue.split(/#|;/).forEach(function (element) {\n if (element.indexOf('|') !== -1)\n selectedTags.push({ key: element.split('|')[1], name: element.split('|')[0] });\n });\n defaultValue = selectedTags;\n }\n }\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 12:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 16];\n termSetId = field[\"TermSetId\"];\n if (!(item !== null)) return [3 /*break*/, 14];\n return [4 /*yield*/, this_2._spService.getSingleManagedMtadataLabel(listId, listItemId, field.InternalName)];\n case 13:\n response = _c.sent();\n if (response) {\n selectedTags.push({ key: response[\"TermID\"], name: response[\"Label\"] });\n defaultValue = selectedTags;\n }\n return [3 /*break*/, 15];\n case 14:\n if (defaultValue !== \"\") {\n selectedTags.push({ key: defaultValue.split('|')[1], name: defaultValue.split('|')[0].split('#')[1] });\n defaultValue = selectedTags;\n }\n _c.label = 15;\n case 15:\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 16:\n if (!(fieldType === \"DateTime\")) return [3 /*break*/, 17];\n if (item !== null && item[field.InternalName])\n defaultValue = new Date(item[field.InternalName]);\n else if (defaultValue === '[today]') {\n defaultValue = new Date();\n }\n schemaXml = field.SchemaXml;\n dateFormatRegEx = /\\s+Format=\\\"([^\\\"]+)\\\"/gmi.exec(schemaXml);\n dateFormat = dateFormatRegEx && dateFormatRegEx.length ? dateFormatRegEx[1] : 'DateOnly';\n return [3 /*break*/, 27];\n case 17:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 21];\n if (!(item !== null)) return [3 /*break*/, 19];\n return [4 /*yield*/, this_2._spService.getUsersUPNFromFieldValue(listId, listItemId, field.InternalName, context.pageContext.web.absoluteUrl)];\n case 18:\n defaultValue = _c.sent();\n return [3 /*break*/, 20];\n case 19:\n defaultValue = [];\n _c.label = 20;\n case 20:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 21:\n if (!(fieldType === \"Thumbnail\")) return [3 /*break*/, 22];\n if (defaultValue !== null) {\n defaultValue = context.pageContext.web.absoluteUrl.split('/sites/')[0] + JSON.parse(defaultValue).serverRelativeUrl;\n }\n return [3 /*break*/, 27];\n case 22:\n if (!(fieldType === \"User\")) return [3 /*break*/, 26];\n if (!(item !== null)) return [3 /*break*/, 24];\n userEmails = [];\n _b = (_a = userEmails).push;\n return [4 /*yield*/, this_2._spService.getUserUPNById(parseInt(item[field.InternalName + \"Id\"]))];\n case 23:\n _b.apply(_a, [(_c.sent()) + '']);\n defaultValue = userEmails;\n return [3 /*break*/, 25];\n case 24:\n defaultValue = [];\n _c.label = 25;\n case 25:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 26:\n if (fieldType === \"Location\") {\n defaultValue = JSON.parse(defaultValue);\n }\n else if (fieldType === \"Boolean\") {\n defaultValue = Boolean(Number(defaultValue));\n }\n _c.label = 27;\n case 27:\n tempFields.push({\n newValue: null,\n fieldTermSetId: termSetId,\n options: choices,\n lookupListID: lookupListId,\n lookupField: lookupField,\n changedValue: defaultValue,\n fieldType: field.TypeAsString,\n fieldTitle: field.Title,\n fieldDefaultValue: defaultValue,\n context: this_2.props.context,\n disabled: this_2.props.disabled || (disabledFields && disabledFields.indexOf(field.InternalName) > -1),\n listId: this_2.props.listId,\n columnInternalName: field.EntityPropertyName,\n label: field.Title,\n onChanged: this_2.onChange,\n required: field.Required,\n hiddenFieldName: hiddenName,\n Order: field.order,\n isRichText: richText,\n dateFormat: dateFormat,\n listItemId: listItemId,\n principalType: principalType,\n description: field.Description\n });\n tempFields.sort(function (a, b) { return a.Order - b.Order; });\n return [2 /*return*/];\n }\n });\n };\n this_2 = this;\n i = 0, len = responseValue.length;\n _b.label = 8;\n case 8:\n if (!(i < len)) return [3 /*break*/, 11];\n return [5 /*yield**/, _loop_3(i, len)];\n case 9:\n _b.sent();\n _b.label = 10;\n case 10:\n i++;\n return [3 /*break*/, 8];\n case 11:\n this.setState({ fieldCollection: tempFields });\n return [3 /*break*/, 13];\n case 12:\n error_4 = _b.sent();\n console.log(\"Error get field informations\", error_4);\n return [2 /*return*/, null];\n case 13: return [2 /*return*/];\n }\n });\n }); };\n _this.uplaodImage = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, fileInstance, buffer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId;\n if (!file.fileAbsoluteUrl) return [3 /*break*/, 1];\n return [2 /*return*/, {\n Name: file.fileName,\n ServerRelativeUrl: file.fileAbsoluteUrl,\n UniqueId: ''\n }];\n case 1: return [4 /*yield*/, file.downloadFileContent()];\n case 2:\n fileInstance = _b.sent();\n return [4 /*yield*/, this.getImageArrayBuffer(fileInstance)];\n case 3:\n buffer = _b.sent();\n return [4 /*yield*/, this._spService.uploadImage(listId, listItemId, file.fileName, buffer, undefined)];\n case 4: return [2 /*return*/, _b.sent()];\n }\n });\n }); };\n _this.getImageArrayBuffer = function (file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(file);\n reader.onload = function () {\n resolve(reader.result);\n };\n });\n };\n _this.getFormFields = function (listId, contentTypeId, webUrl) { return __awaiter(_this, void 0, void 0, function () {\n var context, webAbsoluteUrl, apiUrl, data, results, error_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 4, , 5]);\n context = this.props.context;\n webAbsoluteUrl = !webUrl ? context.pageContext.web.absoluteUrl : webUrl;\n apiUrl = '';\n if (contentTypeId !== undefined && contentTypeId !== '') {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/contenttypes('\" + contentTypeId + \"')/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n else {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n return [4 /*yield*/, context.spHttpClient.get(apiUrl, SPHttpClient.configurations.v1)];\n case 1:\n data = _a.sent();\n if (!data.ok) return [3 /*break*/, 3];\n return [4 /*yield*/, data.json()];\n case 2:\n results = _a.sent();\n if (results) {\n return [2 /*return*/, results];\n }\n _a.label = 3;\n case 3: return [2 /*return*/, null];\n case 4:\n error_5 = _a.sent();\n console.dir(error_5);\n return [2 /*return*/, Promise.reject(error_5)];\n case 5: return [2 /*return*/];\n }\n });\n }); };\n // Initialize pnp sp\n sp.setup({\n spfxContext: _this.props.context\n });\n // Initialize state\n _this.state = {\n fieldCollection: []\n };\n // Get SPService Factory\n _this._spService = new SPservice(_this.props.context);\n return _this;\n }\n /**\n * Lifecycle hook when component is mounted\n */\n DynamicForm.prototype.componentDidMount = function () {\n this.getFieldInformations();\n };\n /**\n * Default React component render method\n */\n DynamicForm.prototype.render = function () {\n var _this = this;\n var _a = this.state, fieldCollection = _a.fieldCollection, isSaving = _a.isSaving;\n return (React.createElement(\"div\", null, fieldCollection.length === 0 ? React.createElement(\"div\", null,\n React.createElement(ProgressIndicator, { label: strings.DynamicFormLoading, description: strings.DynamicFormPleaseWait })) :\n React.createElement(\"div\", null,\n fieldCollection.map(function (v, i) {\n return React.createElement(DynamicField, __assign({}, v, { disabled: v.disabled || isSaving }));\n }),\n React.createElement(Stack, { className: styles.buttons, horizontal: true, tokens: stackTokens },\n React.createElement(PrimaryButton, { disabled: isSaving, text: strings.Save, onClick: function () { return _this.onSubmitClick(); } }),\n React.createElement(DefaultButton, { disabled: isSaving, text: strings.Cancel, onClick: this.props.onCancelled })))));\n };\n return DynamicForm;\n}(React.Component));\nexport { DynamicForm };\n"
1027081
+ "source": "var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport * as React from 'react';\nimport styles from './DynamicForm.module.scss';\nimport { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';\nimport { Stack } from 'office-ui-fabric-react/lib/Stack';\nimport SPservice from '../../services/SPService';\nimport { DynamicField } from './dynamicField';\nimport { sp } from '@pnp/sp/presets/all';\nimport { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';\nimport * as strings from 'ControlStrings';\nimport { SPHttpClient } from '@microsoft/sp-http';\nvar stackTokens = { childrenGap: 20 };\n/**\n * DynamicForm Class Control\n */\nvar DynamicForm = /** @class */ (function (_super) {\n __extends(DynamicForm, _super);\n function DynamicForm(props) {\n var _this = _super.call(this, props) || this;\n _this.webURL = _this.props.webAbsoluteUrl ? _this.props.webAbsoluteUrl : _this.props.context.pageContext.web.absoluteUrl;\n //trigger when the user submits the form.\n _this.onSubmitClick = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, onSubmitted, onBeforeSubmit, onSubmitError, shouldBeReturnBack_1, fields, objects, _loop_1, this_1, i, len, isCancelled, iur, error_1, iar, error_2, error_3;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId, onSubmitted = _a.onSubmitted, onBeforeSubmit = _a.onBeforeSubmit, onSubmitError = _a.onSubmitError;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 16, , 17]);\n shouldBeReturnBack_1 = false;\n fields = (this.state.fieldCollection || []).slice();\n fields.forEach(function (val) {\n if (val.required) {\n if (val.newValue === null) {\n if (val.fieldDefaultValue === null || val.fieldDefaultValue === '' || val.fieldDefaultValue.length === 0) {\n if (val.fieldType === \"DateTime\")\n val.fieldDefaultValue = null;\n else\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n else if (val.newValue === '') {\n val.fieldDefaultValue = '';\n shouldBeReturnBack_1 = true;\n }\n }\n });\n if (shouldBeReturnBack_1) {\n this.setState({ fieldCollection: fields });\n return [2 /*return*/];\n }\n this.setState({\n isSaving: true\n });\n objects = {};\n _loop_1 = function (i, len) {\n var val, fieldType, additionalData, columnInternalName, hiddenFieldName, value_1, uploadedImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n val = fields[i];\n fieldType = val.fieldType, additionalData = val.additionalData, columnInternalName = val.columnInternalName, hiddenFieldName = val.hiddenFieldName;\n if (!(val.newValue !== null && val.newValue !== undefined)) return [3 /*break*/, 14];\n value_1 = val.newValue;\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 1];\n objects[columnInternalName + \"Id\"] = value_1[0].key;\n return [3 /*break*/, 14];\n case 1:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 2];\n value_1 = [];\n val.newValue.forEach(function (element) {\n value_1.push(element.key);\n });\n objects[columnInternalName + \"Id\"] = { results: value_1 };\n return [3 /*break*/, 14];\n case 2:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 3];\n objects[columnInternalName] = {\n '__metadata': { 'type': 'SP.Taxonomy.TaxonomyFieldValue' },\n 'Label': value_1[0].name,\n 'TermGuid': value_1[0].key,\n 'WssId': '-1'\n };\n return [3 /*break*/, 14];\n case 3:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 4];\n objects[hiddenFieldName] = val.newValue.map(function (term) { return \"-1#;\" + term.name + \"|\" + term.key + \";\"; }).join('#');\n return [3 /*break*/, 14];\n case 4:\n if (!(fieldType === \"User\")) return [3 /*break*/, 5];\n objects[columnInternalName + \"Id\"] = val.newValue;\n return [3 /*break*/, 14];\n case 5:\n if (!(fieldType === \"Choice\")) return [3 /*break*/, 6];\n objects[columnInternalName] = val.newValue.key;\n return [3 /*break*/, 14];\n case 6:\n if (!(fieldType === \"MultiChoice\")) return [3 /*break*/, 7];\n objects[columnInternalName] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 7:\n if (!(fieldType === \"Location\")) return [3 /*break*/, 8];\n objects[columnInternalName] = JSON.stringify(val.newValue);\n return [3 /*break*/, 14];\n case 8:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 9];\n objects[columnInternalName + \"Id\"] = { results: val.newValue };\n return [3 /*break*/, 14];\n case 9:\n if (!(fieldType === 'Thumbnail')) return [3 /*break*/, 13];\n if (!additionalData) return [3 /*break*/, 11];\n return [4 /*yield*/, this_1.uplaodImage(additionalData)];\n case 10:\n uploadedImage = _a.sent();\n objects[columnInternalName] = JSON.stringify({\n type: 'thumbnail',\n fileName: uploadedImage.Name,\n serverRelativeUrl: uploadedImage.ServerRelativeUrl,\n id: uploadedImage.UniqueId\n });\n return [3 /*break*/, 12];\n case 11:\n objects[columnInternalName] = null;\n _a.label = 12;\n case 12: return [3 /*break*/, 14];\n case 13:\n objects[columnInternalName] = val.newValue;\n _a.label = 14;\n case 14: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n i = 0, len = fields.length;\n _b.label = 2;\n case 2:\n if (!(i < len)) return [3 /*break*/, 5];\n return [5 /*yield**/, _loop_1(i, len)];\n case 3:\n _b.sent();\n _b.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n if (!onBeforeSubmit) return [3 /*break*/, 7];\n return [4 /*yield*/, onBeforeSubmit(objects)];\n case 6:\n isCancelled = _b.sent();\n if (isCancelled) {\n this.setState({\n isSaving: false\n });\n return [2 /*return*/];\n }\n _b.label = 7;\n case 7:\n if (!listItemId) return [3 /*break*/, 12];\n _b.label = 8;\n case 8:\n _b.trys.push([8, 10, , 11]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.getById(listItemId).update(objects)];\n case 9:\n iur = _b.sent();\n if (onSubmitted) {\n onSubmitted(iur.data, this.props.returnListItemInstanceOnSubmit !== false ? iur.item : undefined);\n }\n return [3 /*break*/, 11];\n case 10:\n error_1 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_1);\n }\n console.log(\"Error\", error_1);\n return [3 /*break*/, 11];\n case 11: return [3 /*break*/, 15];\n case 12:\n _b.trys.push([12, 14, , 15]);\n return [4 /*yield*/, sp.web.lists.getById(listId).items.add(objects)];\n case 13:\n iar = _b.sent();\n if (onSubmitted) {\n onSubmitted(iar.data, this.props.returnListItemInstanceOnSubmit !== false ? iar.item : undefined);\n }\n return [3 /*break*/, 15];\n case 14:\n error_2 = _b.sent();\n if (onSubmitError) {\n onSubmitError(objects, error_2);\n }\n console.log(\"Error\", error_2);\n return [3 /*break*/, 15];\n case 15:\n this.setState({\n isSaving: false\n });\n return [3 /*break*/, 17];\n case 16:\n error_3 = _b.sent();\n if (onSubmitError) {\n onSubmitError(null, error_3);\n }\n console.log(\"Error onSubmit\", error_3);\n return [3 /*break*/, 17];\n case 17: return [2 /*return*/];\n }\n });\n }); };\n // trigger when the user change any value in the form\n _this.onChange = function (internalName, newValue, additionalData) { return __awaiter(_this, void 0, void 0, function () {\n var fieldCol, field, user, result, _loop_2, retrivedItem, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fieldCol = (this.state.fieldCollection || []).slice();\n field = fieldCol.filter(function (element, i) { return element.columnInternalName === internalName; })[0];\n field.newValue = newValue;\n field.additionalData = additionalData;\n if (!(field.fieldType === \"User\" && newValue.length !== 0)) return [3 /*break*/, 4];\n if (!(newValue[0].id === undefined || parseInt(newValue[0].id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = newValue[0].secondaryText;\n if (user.indexOf('@') === -1) {\n user = newValue[0].loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue = result.data.Id;\n return [3 /*break*/, 3];\n case 2:\n field.newValue = newValue[0].id;\n _a.label = 3;\n case 3: return [3 /*break*/, 8];\n case 4:\n if (!(field.fieldType === \"UserMulti\" && newValue.length !== 0)) return [3 /*break*/, 8];\n field.newValue = [];\n _loop_2 = function (index) {\n var element, user, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n element = newValue[index];\n retrivedItem = false;\n if (field.fieldDefaultValue != null) {\n if (field.fieldDefaultValue.join(',').indexOf(element.text) !== -1)\n field.fieldDefaultValue.forEach(function (item) {\n if (item.split('/')[1] === element.text) {\n retrivedItem = true;\n field.newValue.push(item.split('/')[0]);\n }\n });\n }\n if (!!retrivedItem) return [3 /*break*/, 3];\n if (!(element.id === undefined || parseInt(element.id, 10).toString() === \"NaN\")) return [3 /*break*/, 2];\n user = element.secondaryText;\n if (user.indexOf('@') === -1) {\n user = element.loginName;\n }\n return [4 /*yield*/, sp.web.ensureUser(user)];\n case 1:\n result = _a.sent();\n field.newValue.push(result.data.Id);\n return [3 /*break*/, 3];\n case 2:\n field.newValue.push(element.id);\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n };\n index = 0;\n _a.label = 5;\n case 5:\n if (!(index < newValue.length)) return [3 /*break*/, 8];\n return [5 /*yield**/, _loop_2(index)];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7:\n index++;\n return [3 /*break*/, 5];\n case 8:\n this.setState({\n fieldCollection: fieldCol\n });\n return [2 /*return*/];\n }\n });\n }); };\n //getting all the fields information as part of get ready process\n _this.getFieldInformations = function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, context, listId, listItemId, disabledFields, contentTypeId, spList, item, defaultContentType, listFeilds, tempFields, order, responseValue, _loop_3, this_2, i, len, error_4;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, context = _a.context, listId = _a.listId, listItemId = _a.listItemId, disabledFields = _a.disabledFields;\n contentTypeId = this.props.contentTypeId;\n _b.label = 1;\n case 1:\n _b.trys.push([1, 12, , 13]);\n return [4 /*yield*/, sp.web.lists.getById(listId)];\n case 2:\n spList = _b.sent();\n item = null;\n if (!(listItemId !== undefined && listItemId !== null && listItemId !== 0)) return [3 /*break*/, 4];\n return [4 /*yield*/, spList.items.getById(listItemId).get()];\n case 3:\n item = _b.sent();\n _b.label = 4;\n case 4:\n if (!(contentTypeId === undefined || contentTypeId === '')) return [3 /*break*/, 6];\n return [4 /*yield*/, spList.contentTypes.select(\"Id\", \"Name\").get()];\n case 5:\n defaultContentType = _b.sent();\n contentTypeId = defaultContentType[0][\"Id\"].StringValue;\n _b.label = 6;\n case 6: return [4 /*yield*/, this.getFormFields(listId, contentTypeId, this.webURL)];\n case 7:\n listFeilds = _b.sent();\n tempFields = [];\n order = 0;\n responseValue = listFeilds['value'];\n _loop_3 = function (i, len) {\n var field, fieldType, hiddenName, termSetId, lookupListId, lookupField, choices, defaultValue, selectedTags, richText, dateFormat, principalType, response, response, schemaXml, dateFormatRegEx, userEmails, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n field = responseValue[i];\n order++;\n fieldType = field['TypeAsString'];\n field.order = order;\n hiddenName = \"\";\n termSetId = \"\";\n lookupListId = \"\";\n lookupField = \"\";\n choices = [];\n defaultValue = null;\n selectedTags = [];\n richText = false;\n dateFormat = void 0;\n principalType = \"\";\n if (item !== null) {\n defaultValue = item[field.EntityPropertyName];\n }\n else {\n defaultValue = field.DefaultValue;\n }\n if (!(fieldType === 'Choice' || fieldType === 'MultiChoice')) return [3 /*break*/, 1];\n field[\"Choices\"].forEach(function (element) {\n choices.push({ key: element, text: element });\n });\n return [3 /*break*/, 27];\n case 1:\n if (!(fieldType === \"Note\")) return [3 /*break*/, 2];\n richText = field[\"RichText\"];\n return [3 /*break*/, 27];\n case 2:\n if (!(fieldType === \"Lookup\")) return [3 /*break*/, 6];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 4];\n return [4 /*yield*/, this_2._spService.getLookupValue(listId, listItemId, field.EntityPropertyName, lookupField, this_2.webURL)];\n case 3:\n defaultValue = _c.sent();\n return [3 /*break*/, 5];\n case 4:\n defaultValue = [];\n _c.label = 5;\n case 5: return [3 /*break*/, 27];\n case 6:\n if (!(fieldType === \"LookupMulti\")) return [3 /*break*/, 10];\n lookupListId = field[\"LookupList\"];\n lookupField = field[\"LookupField\"];\n if (!(item !== null)) return [3 /*break*/, 8];\n return [4 /*yield*/, this_2._spService.getLookupValues(listId, listItemId, field.EntityPropertyName, lookupField, this_2.webURL)];\n case 7:\n defaultValue = _c.sent();\n return [3 /*break*/, 9];\n case 8:\n defaultValue = [];\n _c.label = 9;\n case 9: return [3 /*break*/, 27];\n case 10:\n if (!(fieldType === \"TaxonomyFieldTypeMulti\")) return [3 /*break*/, 12];\n return [4 /*yield*/, this_2._spService.getTaxonomyFieldInternalName(this_2.props.listId, field.InternalName, this_2.webURL)];\n case 11:\n response = _c.sent();\n hiddenName = response[\"value\"];\n termSetId = field[\"TermSetId\"];\n if (item !== null) {\n item[field.InternalName].forEach(function (element) {\n selectedTags.push({ key: element.TermGuid, name: element.Label });\n });\n defaultValue = selectedTags;\n }\n else {\n if (defaultValue !== \"\") {\n defaultValue.split(/#|;/).forEach(function (element) {\n if (element.indexOf('|') !== -1)\n selectedTags.push({ key: element.split('|')[1], name: element.split('|')[0] });\n });\n defaultValue = selectedTags;\n }\n }\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 12:\n if (!(fieldType === \"TaxonomyFieldType\")) return [3 /*break*/, 16];\n termSetId = field[\"TermSetId\"];\n if (!(item !== null)) return [3 /*break*/, 14];\n return [4 /*yield*/, this_2._spService.getSingleManagedMtadataLabel(listId, listItemId, field.InternalName)];\n case 13:\n response = _c.sent();\n if (response) {\n selectedTags.push({ key: response[\"TermID\"], name: response[\"Label\"] });\n defaultValue = selectedTags;\n }\n return [3 /*break*/, 15];\n case 14:\n if (defaultValue !== \"\") {\n selectedTags.push({ key: defaultValue.split('|')[1], name: defaultValue.split('|')[0].split('#')[1] });\n defaultValue = selectedTags;\n }\n _c.label = 15;\n case 15:\n if (defaultValue === \"\")\n defaultValue = null;\n return [3 /*break*/, 27];\n case 16:\n if (!(fieldType === \"DateTime\")) return [3 /*break*/, 17];\n if (item !== null && item[field.InternalName])\n defaultValue = new Date(item[field.InternalName]);\n else if (defaultValue === '[today]') {\n defaultValue = new Date();\n }\n schemaXml = field.SchemaXml;\n dateFormatRegEx = /\\s+Format=\\\"([^\\\"]+)\\\"/gmi.exec(schemaXml);\n dateFormat = dateFormatRegEx && dateFormatRegEx.length ? dateFormatRegEx[1] : 'DateOnly';\n return [3 /*break*/, 27];\n case 17:\n if (!(fieldType === \"UserMulti\")) return [3 /*break*/, 21];\n if (!(item !== null)) return [3 /*break*/, 19];\n return [4 /*yield*/, this_2._spService.getUsersUPNFromFieldValue(listId, listItemId, field.InternalName, this_2.webURL)];\n case 18:\n defaultValue = _c.sent();\n return [3 /*break*/, 20];\n case 19:\n defaultValue = [];\n _c.label = 20;\n case 20:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 21:\n if (!(fieldType === \"Thumbnail\")) return [3 /*break*/, 22];\n if (defaultValue !== null) {\n defaultValue = this_2.webURL.split('/sites/')[0] + JSON.parse(defaultValue).serverRelativeUrl;\n }\n return [3 /*break*/, 27];\n case 22:\n if (!(fieldType === \"User\")) return [3 /*break*/, 26];\n if (!(item !== null)) return [3 /*break*/, 24];\n userEmails = [];\n _b = (_a = userEmails).push;\n return [4 /*yield*/, this_2._spService.getUserUPNById(parseInt(item[field.InternalName + \"Id\"]))];\n case 23:\n _b.apply(_a, [(_c.sent()) + '']);\n defaultValue = userEmails;\n return [3 /*break*/, 25];\n case 24:\n defaultValue = [];\n _c.label = 25;\n case 25:\n principalType = field.SchemaXml.split('UserSelectionMode=\"')[1];\n principalType = principalType.substring(0, principalType.indexOf('\"'));\n return [3 /*break*/, 27];\n case 26:\n if (fieldType === \"Location\") {\n defaultValue = JSON.parse(defaultValue);\n }\n else if (fieldType === \"Boolean\") {\n defaultValue = Boolean(Number(defaultValue));\n }\n _c.label = 27;\n case 27:\n tempFields.push({\n newValue: null,\n fieldTermSetId: termSetId,\n options: choices,\n lookupListID: lookupListId,\n lookupField: lookupField,\n changedValue: defaultValue,\n fieldType: field.TypeAsString,\n fieldTitle: field.Title,\n fieldDefaultValue: defaultValue,\n context: this_2.props.context,\n disabled: this_2.props.disabled || (disabledFields && disabledFields.indexOf(field.InternalName) > -1),\n listId: this_2.props.listId,\n columnInternalName: field.EntityPropertyName,\n label: field.Title,\n onChanged: this_2.onChange,\n required: field.Required,\n hiddenFieldName: hiddenName,\n Order: field.order,\n isRichText: richText,\n dateFormat: dateFormat,\n listItemId: listItemId,\n principalType: principalType,\n description: field.Description\n });\n tempFields.sort(function (a, b) { return a.Order - b.Order; });\n return [2 /*return*/];\n }\n });\n };\n this_2 = this;\n i = 0, len = responseValue.length;\n _b.label = 8;\n case 8:\n if (!(i < len)) return [3 /*break*/, 11];\n return [5 /*yield**/, _loop_3(i, len)];\n case 9:\n _b.sent();\n _b.label = 10;\n case 10:\n i++;\n return [3 /*break*/, 8];\n case 11:\n this.setState({ fieldCollection: tempFields });\n return [3 /*break*/, 13];\n case 12:\n error_4 = _b.sent();\n console.log(\"Error get field informations\", error_4);\n return [2 /*return*/, null];\n case 13: return [2 /*return*/];\n }\n });\n }); };\n _this.uplaodImage = function (file) { return __awaiter(_this, void 0, void 0, function () {\n var _a, listId, listItemId, fileInstance, buffer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this.props, listId = _a.listId, listItemId = _a.listItemId;\n if (!file.fileAbsoluteUrl) return [3 /*break*/, 1];\n return [2 /*return*/, {\n Name: file.fileName,\n ServerRelativeUrl: file.fileAbsoluteUrl,\n UniqueId: ''\n }];\n case 1: return [4 /*yield*/, file.downloadFileContent()];\n case 2:\n fileInstance = _b.sent();\n return [4 /*yield*/, this.getImageArrayBuffer(fileInstance)];\n case 3:\n buffer = _b.sent();\n return [4 /*yield*/, this._spService.uploadImage(listId, listItemId, file.fileName, buffer, undefined)];\n case 4: return [2 /*return*/, _b.sent()];\n }\n });\n }); };\n _this.getImageArrayBuffer = function (file) {\n return new Promise(function (resolve) {\n var reader = new FileReader();\n reader.readAsArrayBuffer(file);\n reader.onload = function () {\n resolve(reader.result);\n };\n });\n };\n _this.getFormFields = function (listId, contentTypeId, webUrl) { return __awaiter(_this, void 0, void 0, function () {\n var context, webAbsoluteUrl, apiUrl, data, results, error_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 4, , 5]);\n context = this.props.context;\n webAbsoluteUrl = !webUrl ? this.webURL : webUrl;\n apiUrl = '';\n if (contentTypeId !== undefined && contentTypeId !== '') {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/contenttypes('\" + contentTypeId + \"')/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n else {\n apiUrl = webAbsoluteUrl + \"/_api/web/lists(@listId)/fields?@listId=guid'\" + encodeURIComponent(listId) + \"'&$filter=ReadOnlyField eq false and Hidden eq false and (FromBaseType eq false or StaticName eq 'Title')\";\n }\n return [4 /*yield*/, context.spHttpClient.get(apiUrl, SPHttpClient.configurations.v1)];\n case 1:\n data = _a.sent();\n if (!data.ok) return [3 /*break*/, 3];\n return [4 /*yield*/, data.json()];\n case 2:\n results = _a.sent();\n if (results) {\n return [2 /*return*/, results];\n }\n _a.label = 3;\n case 3: return [2 /*return*/, null];\n case 4:\n error_5 = _a.sent();\n console.dir(error_5);\n return [2 /*return*/, Promise.reject(error_5)];\n case 5: return [2 /*return*/];\n }\n });\n }); };\n // Initialize pnp sp\n if (_this.props.webAbsoluteUrl) {\n sp.setup({\n sp: {\n headers: {\n Accept: \"application/json;odata=verbose\",\n },\n baseUrl: _this.props.webAbsoluteUrl\n },\n });\n }\n else {\n sp.setup({\n spfxContext: _this.props.context\n });\n }\n // Initialize state\n _this.state = {\n fieldCollection: []\n };\n // Get SPService Factory\n _this._spService = _this.props.webAbsoluteUrl ? new SPservice(_this.props.context, _this.props.webAbsoluteUrl) : new SPservice(_this.props.context);\n return _this;\n }\n /**\n * Lifecycle hook when component is mounted\n */\n DynamicForm.prototype.componentDidMount = function () {\n this.getFieldInformations();\n };\n /**\n * Default React component render method\n */\n DynamicForm.prototype.render = function () {\n var _this = this;\n var _a = this.state, fieldCollection = _a.fieldCollection, isSaving = _a.isSaving;\n return (React.createElement(\"div\", null, fieldCollection.length === 0 ? React.createElement(\"div\", null,\n React.createElement(ProgressIndicator, { label: strings.DynamicFormLoading, description: strings.DynamicFormPleaseWait })) :\n React.createElement(\"div\", null,\n fieldCollection.map(function (v, i) {\n return React.createElement(DynamicField, __assign({}, v, { disabled: v.disabled || isSaving }));\n }),\n !this.props.disabled &&\n React.createElement(Stack, { className: styles.buttons, horizontal: true, tokens: stackTokens },\n React.createElement(PrimaryButton, { disabled: isSaving, text: strings.Save, onClick: function () { return _this.onSubmitClick(); } }),\n React.createElement(DefaultButton, { disabled: isSaving, text: strings.Cancel, onClick: this.props.onCancelled })))));\n };\n return DynamicForm;\n}(React.Component));\nexport { DynamicForm };\n"
1027046
1027082
  },
1027047
1027083
  {
1027048
1027084
  "id": "RQLH",
@@ -1037131,7 +1037167,7 @@
1037131
1037167
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1037132
1037168
  "type": "harmony import specifier",
1037133
1037169
  "userRequest": "ControlStrings",
1037134
- "loc": "692:60-86"
1037170
+ "loc": "705:60-86"
1037135
1037171
  },
1037136
1037172
  {
1037137
1037173
  "moduleId": "RPzn",
@@ -1037140,7 +1037176,7 @@
1037140
1037176
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1037141
1037177
  "type": "harmony import specifier",
1037142
1037178
  "userRequest": "ControlStrings",
1037143
- "loc": "692:101-130"
1037179
+ "loc": "705:101-130"
1037144
1037180
  },
1037145
1037181
  {
1037146
1037182
  "moduleId": "RPzn",
@@ -1037149,7 +1037185,7 @@
1037149
1037185
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1037150
1037186
  "type": "harmony import specifier",
1037151
1037187
  "userRequest": "ControlStrings",
1037152
- "loc": "698:83-95"
1037188
+ "loc": "712:87-99"
1037153
1037189
  },
1037154
1037190
  {
1037155
1037191
  "moduleId": "RPzn",
@@ -1037158,7 +1037194,7 @@
1037158
1037194
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1037159
1037195
  "type": "harmony import specifier",
1037160
1037196
  "userRequest": "ControlStrings",
1037161
- "loc": "699:83-97"
1037197
+ "loc": "713:87-101"
1037162
1037198
  },
1037163
1037199
  {
1037164
1037200
  "moduleId": "SXK8",
@@ -1136864,7 +1136900,7 @@
1136864
1136900
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136865
1136901
  "type": "harmony import specifier",
1136866
1136902
  "userRequest": "react",
1136867
- "loc": "691:16-35"
1136903
+ "loc": "704:16-35"
1136868
1136904
  },
1136869
1136905
  {
1136870
1136906
  "moduleId": "RPzn",
@@ -1136873,7 +1136909,7 @@
1136873
1136909
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136874
1136910
  "type": "harmony import specifier",
1136875
1136911
  "userRequest": "react",
1136876
- "loc": "691:80-99"
1136912
+ "loc": "704:80-99"
1136877
1136913
  },
1136878
1136914
  {
1136879
1136915
  "moduleId": "RPzn",
@@ -1136882,7 +1136918,7 @@
1136882
1136918
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136883
1136919
  "type": "harmony import specifier",
1136884
1136920
  "userRequest": "react",
1136885
- "loc": "692:12-31"
1136921
+ "loc": "705:12-31"
1136886
1136922
  },
1136887
1136923
  {
1136888
1136924
  "moduleId": "RPzn",
@@ -1136891,7 +1136927,7 @@
1136891
1136927
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136892
1136928
  "type": "harmony import specifier",
1136893
1136929
  "userRequest": "react",
1136894
- "loc": "693:12-31"
1136930
+ "loc": "706:12-31"
1136895
1136931
  },
1136896
1136932
  {
1136897
1136933
  "moduleId": "RPzn",
@@ -1136900,7 +1136936,7 @@
1136900
1136936
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136901
1136937
  "type": "harmony import specifier",
1136902
1136938
  "userRequest": "react",
1136903
- "loc": "695:27-46"
1136939
+ "loc": "708:27-46"
1136904
1136940
  },
1136905
1136941
  {
1136906
1136942
  "moduleId": "RPzn",
@@ -1136909,7 +1136945,7 @@
1136909
1136945
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136910
1136946
  "type": "harmony import specifier",
1136911
1136947
  "userRequest": "react",
1136912
- "loc": "697:16-35"
1136948
+ "loc": "711:20-39"
1136913
1136949
  },
1136914
1136950
  {
1136915
1136951
  "moduleId": "RPzn",
@@ -1136918,7 +1136954,7 @@
1136918
1136954
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136919
1136955
  "type": "harmony import specifier",
1136920
1136956
  "userRequest": "react",
1136921
- "loc": "698:20-39"
1136957
+ "loc": "712:24-43"
1136922
1136958
  },
1136923
1136959
  {
1136924
1136960
  "moduleId": "RPzn",
@@ -1136927,7 +1136963,7 @@
1136927
1136963
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136928
1136964
  "type": "harmony import specifier",
1136929
1136965
  "userRequest": "react",
1136930
- "loc": "699:20-39"
1136966
+ "loc": "713:24-43"
1136931
1136967
  },
1136932
1136968
  {
1136933
1136969
  "moduleId": "RPzn",
@@ -1136936,7 +1136972,7 @@
1136936
1136972
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1136937
1136973
  "type": "harmony import specifier",
1136938
1136974
  "userRequest": "react",
1136939
- "loc": "702:2-17"
1136975
+ "loc": "716:2-17"
1136940
1136976
  },
1136941
1136977
  {
1136942
1136978
  "moduleId": "RQjC",
@@ -1168373,7 +1168409,7 @@
1168373
1168409
  ],
1168374
1168410
  "optimizationBailout": [],
1168375
1168411
  "depth": 4,
1168376
- "source": "export var version = \"3.9.0-beta.2556922\";\n"
1168412
+ "source": "export var version = \"3.9.0-beta.2597970\";\n"
1168377
1168413
  },
1168378
1168414
  {
1168379
1168415
  "id": "cLrF",
@@ -1297836,7 +1297872,7 @@
1297836
1297872
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1297837
1297873
  "type": "harmony import specifier",
1297838
1297874
  "userRequest": "office-ui-fabric-react/lib/Stack",
1297839
- "loc": "697:36-41"
1297875
+ "loc": "711:40-45"
1297840
1297876
  },
1297841
1297877
  {
1297842
1297878
  "moduleId": "SXK8",
@@ -1309634,7 +1309670,7 @@
1309634
1309670
  "moduleName": "./lib/controls/dynamicForm/DynamicForm.js",
1309635
1309671
  "type": "harmony import specifier",
1309636
1309672
  "userRequest": "@microsoft/sp-http",
1309637
- "loc": "647:78-90"
1309673
+ "loc": "648:78-90"
1309638
1309674
  },
1309639
1309675
  {
1309640
1309676
  "moduleId": "SRtU",