@pnp/spfx-property-controls 3.3.0-beta.1446999 → 3.3.0-beta.1474462
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +6 -3
- package/CHANGELOG.md +4 -1
- package/lib/common/telemetry/version.js +1 -1
- package/lib/propertyFields/collectionData/IBaseCollectionFIeldsProps.d.ts +9 -0
- package/lib/propertyFields/collectionData/IBaseCollectionFIeldsProps.d.ts.map +1 -0
- package/lib/propertyFields/collectionData/IBaseCollectionFIeldsProps.js +1 -0
- package/lib/propertyFields/collectionData/IBaseCollectionFIeldsProps.js.map +1 -0
- package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.d.ts +6 -0
- package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.d.ts.map +1 -0
- package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.js +82 -0
- package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.js.map +1 -0
- package/lib/propertyFields/collectionData/collectionColorField/CollectionColorField.d.ts +18 -0
- package/lib/propertyFields/collectionData/collectionColorField/CollectionColorField.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionColorField/CollectionColorField.js +93 -3
- package/lib/propertyFields/collectionData/collectionColorField/CollectionColorField.js.map +1 -1
- package/lib/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.d.ts +2 -6
- package/lib/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionDataItem/CollectionDataItem.d.ts +11 -2
- package/lib/propertyFields/collectionData/collectionDataItem/CollectionDataItem.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionDataItem/CollectionDataItem.js +178 -82
- package/lib/propertyFields/collectionData/collectionDataItem/CollectionDataItem.js.map +1 -1
- package/lib/propertyFields/collectionData/collectionDataItem/ICollectionDataItemState.d.ts +1 -0
- package/lib/propertyFields/collectionData/collectionDataItem/ICollectionDataItemState.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionDropdownField/CollectionDropdownField.d.ts +2 -7
- package/lib/propertyFields/collectionData/collectionDropdownField/CollectionDropdownField.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionDropdownField/CollectionDropdownField.js +10 -7
- package/lib/propertyFields/collectionData/collectionDropdownField/CollectionDropdownField.js.map +1 -1
- package/lib/propertyFields/collectionData/collectionIconField/CollectionIconField.js +47 -1
- package/lib/propertyFields/collectionData/collectionIconField/CollectionIconField.js.map +1 -1
- package/lib/propertyFields/collectionData/collectionIconField/ICollectionIconFieldProps.d.ts +2 -7
- package/lib/propertyFields/collectionData/collectionIconField/ICollectionIconFieldProps.d.ts.map +1 -1
- package/lib/propertyFields/collectionData/collectionNumberField/CollectionNumberField.js +16 -7
- package/lib/propertyFields/collectionData/collectionNumberField/CollectionNumberField.js.map +1 -1
- package/lib/propertyFields/collectionData/collectionNumberField/ICollectionNumberFieldProps.d.ts +2 -7
- package/lib/propertyFields/collectionData/collectionNumberField/ICollectionNumberFieldProps.d.ts.map +1 -1
- package/package.json +1 -1
- package/release/webpack-stats/sp-dev-fx-property-controls.stats.json +3449 -3053
package/CHANGELOG.json
CHANGED
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
"changes": {
|
|
6
6
|
"new": [],
|
|
7
7
|
"enhancements": [
|
|
8
|
-
"SharePoint Framework v1.13 support",
|
|
8
|
+
"SharePoint Framework v1.13.* support",
|
|
9
9
|
"`PropertyPanePropertyEditor`: Add translations for property editor control button and header [#399](https://github.com/pnp/sp-dev-fx-property-controls/pull/399)",
|
|
10
|
-
"`PropertyFieldCollectionData`: Adds conditional column visibility [#394](https://github.com/pnp/sp-dev-fx-property-controls/pull/394)"
|
|
10
|
+
"`PropertyFieldCollectionData`: Adds conditional column visibility [#394](https://github.com/pnp/sp-dev-fx-property-controls/pull/394)",
|
|
11
|
+
"Include `mystrings.d.ts` in definition output [#393](https://github.com/pnp/sp-dev-fx-property-controls/pull/393)",
|
|
12
|
+
"`PropertyFieldCollectionData`: `onGetErrorMessage` support for boolean, custom and color fields. [#395](https://github.com/pnp/sp-dev-fx-property-controls/pull/395)"
|
|
11
13
|
],
|
|
12
14
|
"fixes": [
|
|
13
|
-
"`PropertyPanePropertyEditor`: Minor fix to allow PropertyEditor control to update properties when their current value is blank [#384](https://github.com/pnp/sp-dev-fx-property-controls/pull/384)"
|
|
15
|
+
"`PropertyPanePropertyEditor`: Minor fix to allow PropertyEditor control to update properties when their current value is blank [#384](https://github.com/pnp/sp-dev-fx-property-controls/pull/384)",
|
|
16
|
+
"`PropertyFieldSitePicker`: Some sites do not show up in Property Field Site Picker control [#402](https://github.com/pnp/sp-dev-fx-property-controls/issues/402)"
|
|
14
17
|
]
|
|
15
18
|
},
|
|
16
19
|
"contributions": [
|
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
### Enhancements
|
|
6
6
|
|
|
7
|
-
- SharePoint Framework v1.13 support
|
|
7
|
+
- SharePoint Framework v1.13.* support
|
|
8
8
|
- `PropertyPanePropertyEditor`: Add translations for property editor control button and header [#399](https://github.com/pnp/sp-dev-fx-property-controls/pull/399)
|
|
9
9
|
- `PropertyFieldCollectionData`: Adds conditional column visibility [#394](https://github.com/pnp/sp-dev-fx-property-controls/pull/394)
|
|
10
|
+
- Include `mystrings.d.ts` in definition output [#393](https://github.com/pnp/sp-dev-fx-property-controls/pull/393)
|
|
11
|
+
- `PropertyFieldCollectionData`: `onGetErrorMessage` support for boolean, custom and color fields. [#395](https://github.com/pnp/sp-dev-fx-property-controls/pull/395)
|
|
10
12
|
|
|
11
13
|
### Fixes
|
|
12
14
|
|
|
13
15
|
- `PropertyPanePropertyEditor`: Minor fix to allow PropertyEditor control to update properties when their current value is blank [#384](https://github.com/pnp/sp-dev-fx-property-controls/pull/384)
|
|
16
|
+
- `PropertyFieldSitePicker`: Some sites do not show up in Property Field Site Picker control [#402](https://github.com/pnp/sp-dev-fx-property-controls/issues/402)
|
|
14
17
|
|
|
15
18
|
### Contributors
|
|
16
19
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = "3.3.0-beta.
|
|
1
|
+
export var version = "3.3.0-beta.1474462";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICustomCollectionField } from ".";
|
|
2
|
+
export interface IBaseCollectionFieldProps {
|
|
3
|
+
field: ICustomCollectionField;
|
|
4
|
+
item: any;
|
|
5
|
+
disableEdit: boolean;
|
|
6
|
+
fOnValueChange: (fieldId: string, value: any) => void | Promise<void>;
|
|
7
|
+
fValidation: (field: ICustomCollectionField, value: any) => Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=IBaseCollectionFIeldsProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IBaseCollectionFIeldsProps.d.ts","sourceRoot":"","sources":["../../../src/propertyFields/collectionData/IBaseCollectionFIeldsProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,GAAG,CAAC;AAE3C,MAAM,WAAW,yBAAyB;IACtC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;IAErB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,WAAW,EAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=IBaseCollectionFIeldsProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IBaseCollectionFIeldsProps.js","sourceRoot":"","sources":["../../../src/propertyFields/collectionData/IBaseCollectionFIeldsProps.ts"],"names":[],"mappings":""}
|
package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IBaseCollectionFieldProps } from '../IBaseCollectionFIeldsProps';
|
|
3
|
+
export interface ICollectionCheckboxFieldProps extends IBaseCollectionFieldProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const CollectionCheckboxField: React.FunctionComponent<ICollectionCheckboxFieldProps>;
|
|
6
|
+
//# sourceMappingURL=CollectionCheckboxField.d.ts.map
|
package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionCheckboxField.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;CAAI;AAEpF,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,6BAA6B,CAyC1F,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import * as React from 'react';
|
|
38
|
+
import styles from '../PropertyFieldCollectionDataHost.module.scss';
|
|
39
|
+
import { Checkbox } from 'office-ui-fabric-react/lib/components/Checkbox';
|
|
40
|
+
export var CollectionCheckboxField = function (_a) {
|
|
41
|
+
var field = _a.field, item = _a.item, disableEdit = _a.disableEdit, fOnValueChange = _a.fOnValueChange, fValidation = _a.fValidation;
|
|
42
|
+
var _b = React.useState(), errorMessage = _b[0], setErrorMessage = _b[1];
|
|
43
|
+
var onValueChange = React.useCallback(function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
|
+
var error;
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
switch (_a.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
if (!field) {
|
|
49
|
+
return [2 /*return*/];
|
|
50
|
+
}
|
|
51
|
+
if (!fOnValueChange) return [3 /*break*/, 2];
|
|
52
|
+
return [4 /*yield*/, fOnValueChange(field.id, value)];
|
|
53
|
+
case 1:
|
|
54
|
+
_a.sent();
|
|
55
|
+
_a.label = 2;
|
|
56
|
+
case 2:
|
|
57
|
+
if (!fValidation) return [3 /*break*/, 4];
|
|
58
|
+
return [4 /*yield*/, fValidation(field, value)];
|
|
59
|
+
case 3:
|
|
60
|
+
error = _a.sent();
|
|
61
|
+
setErrorMessage(error);
|
|
62
|
+
_a.label = 4;
|
|
63
|
+
case 4: return [2 /*return*/];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}); }, [field, fOnValueChange, fValidation]);
|
|
67
|
+
React.useEffect(function () {
|
|
68
|
+
if (item && field) {
|
|
69
|
+
onValueChange(item[field.id]);
|
|
70
|
+
}
|
|
71
|
+
}, []);
|
|
72
|
+
if (!field || !item) {
|
|
73
|
+
return React.createElement(React.Fragment, null);
|
|
74
|
+
}
|
|
75
|
+
return React.createElement(Checkbox, { checked: item[field.id] ? item[field.id] : false, onChange: function (e, v) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
76
|
+
switch (_a.label) {
|
|
77
|
+
case 0: return [4 /*yield*/, onValueChange(v)];
|
|
78
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
79
|
+
}
|
|
80
|
+
}); }); }, disabled: disableEdit, className: "PropertyFieldCollectionData__panel__boolean-field " + (errorMessage ? styles.invalidField : '') });
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=CollectionCheckboxField.js.map
|
package/lib/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionCheckboxField.js","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionCheckboxField/CollectionCheckboxField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,gDAAgD,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAK1E,MAAM,CAAC,IAAM,uBAAuB,GAA2D,UAAC,EAM/F;QALC,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,WAAW,iBAAA;IAGL,IAAA,KAAkC,KAAK,CAAC,QAAQ,EAAU,EAAzD,YAAY,QAAA,EAAE,eAAe,QAA4B,CAAC;IAEjE,IAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,UAAO,KAAU;;;;;oBAEvD,IAAI,CAAC,KAAK,EAAE;wBACV,sBAAO;qBACR;yBAEG,cAAc,EAAd,wBAAc;oBAChB,qBAAM,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAA;;oBAArC,SAAqC,CAAC;;;yBAGpC,WAAW,EAAX,wBAAW;oBACC,qBAAM,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,EAAA;;oBAAvC,KAAK,GAAG,SAA+B;oBAC7C,eAAe,CAAC,KAAK,CAAC,CAAC;;;;;SAE1B,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAGzC,KAAK,CAAC,SAAS,CAAC;QACd,IAAI,IAAI,IAAI,KAAK,EAAE;YACjB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE;QACnB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,oBAAC,QAAQ,IAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAC/D,QAAQ,EAAE,UAAO,CAAC,EAAE,CAAC;;wBAAK,qBAAM,aAAa,CAAC,CAAC,CAAC,EAAA;wBAAtB,sBAAA,SAAsB,EAAA;;iBAAA,EAChD,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,wDAAqD,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAE,GAAI,CAAC;AAClH,CAAC,CAAC"}
|
|
@@ -3,12 +3,30 @@ import { ICollectionColorFieldProps } from '.';
|
|
|
3
3
|
interface ICollectionColorFieldState {
|
|
4
4
|
isCalloutVisible: boolean;
|
|
5
5
|
color: string;
|
|
6
|
+
errorMessage: string;
|
|
6
7
|
}
|
|
7
8
|
export declare class CollectionColorField extends React.Component<ICollectionColorFieldProps, ICollectionColorFieldState> {
|
|
9
|
+
private async;
|
|
10
|
+
private delayedValidate;
|
|
8
11
|
private _colorElement;
|
|
9
12
|
constructor(props: ICollectionColorFieldProps, state: ICollectionColorFieldState);
|
|
13
|
+
/**
|
|
14
|
+
* componentWillMount lifecycle hook
|
|
15
|
+
*/
|
|
16
|
+
componentWillMount(): void;
|
|
10
17
|
private _onCalloutDismiss;
|
|
11
18
|
private _onCalloutToggle;
|
|
19
|
+
/**
|
|
20
|
+
* Value change event handler
|
|
21
|
+
*
|
|
22
|
+
* @param field
|
|
23
|
+
* @param value
|
|
24
|
+
*/
|
|
25
|
+
private valueChange;
|
|
26
|
+
/**
|
|
27
|
+
* Delayed field validation
|
|
28
|
+
*/
|
|
29
|
+
private valueValidation;
|
|
12
30
|
render(): React.ReactElement<ICollectionColorFieldProps>;
|
|
13
31
|
}
|
|
14
32
|
export {};
|
package/lib/propertyFields/collectionData/collectionColorField/CollectionColorField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionColorField.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionColorField/CollectionColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"CollectionColorField.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionColorField/CollectionColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,GAAG,CAAC;AAM/C,UAAU,0BAA0B;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,oBAAqB,SAAQ,KAAK,CAAC,SAAS,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAC/G,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,eAAe,CAA4D;IACnF,OAAO,CAAC,aAAa,CAAqC;gBAEvC,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B;IAcvF;;OAEG;IACI,kBAAkB,IAAI,IAAI;IAIjC,OAAO,CAAC,iBAAiB,CAIxB;IAED,OAAO,CAAC,gBAAgB,CAIvB;IAEA;;;;;MAKE;IACH,OAAO,CAAC,WAAW,CAMlB;IAED;;OAEG;IACH,OAAO,CAAC,eAAe,CAMtB;IAEM,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,0BAA0B,CAAC;CA8BhE"}
|
|
@@ -11,8 +11,45 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
+
function step(op) {
|
|
28
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
+
while (_) try {
|
|
30
|
+
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;
|
|
31
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
+
switch (op[0]) {
|
|
33
|
+
case 0: case 1: t = op; break;
|
|
34
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
+
default:
|
|
38
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
+
if (t[2]) _.ops.pop();
|
|
43
|
+
_.trys.pop(); continue;
|
|
44
|
+
}
|
|
45
|
+
op = body.call(thisArg, _);
|
|
46
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
14
50
|
import * as React from 'react';
|
|
15
51
|
import styles from '../PropertyFieldCollectionDataHost.module.scss';
|
|
52
|
+
import { Async } from 'office-ui-fabric-react/lib/Utilities';
|
|
16
53
|
import { Callout, DirectionalHint } from 'office-ui-fabric-react/lib/Callout';
|
|
17
54
|
import { ColorPicker } from 'office-ui-fabric-react/lib/ColorPicker';
|
|
18
55
|
var CollectionColorField = /** @class */ (function (_super) {
|
|
@@ -30,21 +67,74 @@ var CollectionColorField = /** @class */ (function (_super) {
|
|
|
30
67
|
isCalloutVisible: !_this.state.isCalloutVisible
|
|
31
68
|
});
|
|
32
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Value change event handler
|
|
72
|
+
*
|
|
73
|
+
* @param field
|
|
74
|
+
* @param value
|
|
75
|
+
*/
|
|
76
|
+
_this.valueChange = function (field, value) { return __awaiter(_this, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
switch (_a.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
this.setState({
|
|
81
|
+
color: value
|
|
82
|
+
});
|
|
83
|
+
return [4 /*yield*/, this.props.fOnValueChange(field.id, value)];
|
|
84
|
+
case 1:
|
|
85
|
+
_a.sent();
|
|
86
|
+
this.delayedValidate(field, value);
|
|
87
|
+
return [2 /*return*/];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}); };
|
|
91
|
+
/**
|
|
92
|
+
* Delayed field validation
|
|
93
|
+
*/
|
|
94
|
+
_this.valueValidation = function (field, value) { return __awaiter(_this, void 0, void 0, function () {
|
|
95
|
+
var validation;
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0: return [4 /*yield*/, this.props.fValidation(field, value)];
|
|
99
|
+
case 1:
|
|
100
|
+
validation = _a.sent();
|
|
101
|
+
// Update the error message
|
|
102
|
+
this.setState({
|
|
103
|
+
errorMessage: validation
|
|
104
|
+
});
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}); };
|
|
33
109
|
var _a = _this.props, field = _a.field, item = _a.item;
|
|
34
110
|
_this.state = {
|
|
35
111
|
isCalloutVisible: false,
|
|
36
|
-
color: item[field.id] ? item[field.id] : "#0000ff"
|
|
112
|
+
color: item[field.id] ? item[field.id] : "#0000ff",
|
|
113
|
+
errorMessage: ''
|
|
37
114
|
};
|
|
115
|
+
_this.async = new Async(_this);
|
|
116
|
+
_this.delayedValidate = _this.async.debounce(_this.valueValidation, (_this.props.field.deferredValidationTime || _this.props.field.deferredValidationTime >= 0) ? _this.props.field.deferredValidationTime : 200);
|
|
38
117
|
return _this;
|
|
39
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* componentWillMount lifecycle hook
|
|
121
|
+
*/
|
|
122
|
+
CollectionColorField.prototype.componentWillMount = function () {
|
|
123
|
+
this.valueChange(this.props.field, this.props.item[this.props.field.id]);
|
|
124
|
+
};
|
|
40
125
|
CollectionColorField.prototype.render = function () {
|
|
41
126
|
var _this = this;
|
|
42
127
|
var field = this.props.field;
|
|
43
|
-
return (React.createElement("div", { className: "PropertyFieldCollectionData__panel__color-field " + styles.colorField },
|
|
128
|
+
return (React.createElement("div", { className: "PropertyFieldCollectionData__panel__color-field " + styles.colorField + " " + (this.state.errorMessage ? styles.invalidField : "") },
|
|
44
129
|
React.createElement("div", { className: styles.colorIndicator, style: { backgroundColor: this.state.color, cursor: this.props.disableEdit ? 'default' : 'hand' }, ref: this._colorElement, onClick: function () { if (!_this.props.disableEdit)
|
|
45
130
|
_this._onCalloutToggle(); } }),
|
|
46
131
|
React.createElement(Callout, { gapSpace: 0, target: this._colorElement.current, onDismiss: this._onCalloutDismiss, setInitialFocus: true, hidden: !this.state.isCalloutVisible, directionalHint: DirectionalHint.rightCenter },
|
|
47
|
-
React.createElement(ColorPicker, { color: this.state.color, alphaSliderHidden: true, onChange: function (
|
|
132
|
+
React.createElement(ColorPicker, { color: this.state.color, alphaSliderHidden: true, onChange: function (ev, color) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0: return [4 /*yield*/, this.valueChange(this.props.field, color.str)];
|
|
135
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
136
|
+
}
|
|
137
|
+
}); }); } }))));
|
|
48
138
|
};
|
|
49
139
|
return CollectionColorField;
|
|
50
140
|
}(React.Component));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionColorField.js","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionColorField/CollectionColorField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CollectionColorField.js","sourceRoot":"","sources":["../../../../src/propertyFields/coll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K,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAE;YAE1I,6BAAK,SAAS,EAAE,MAAM,CAAC,cAAc,EACnC,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,EACjG,GAAG,EAAE,IAAI,CAAC,aAAa,EACvB,OAAO,EAAE,cAAQ,IAAI,CAAC,KAAI,CAAC,KAAK,CAAC,WAAW;oBAAE,KAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,GACpE;YAEN,oBAAC,OAAO,IACN,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAClC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EACjC,eAAe,EAAE,IAAI,EACrB,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACpC,eAAe,EAAE,eAAe,CAAC,WAAW;gBAE5C,oBAAC,WAAW,IACV,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,iBAAiB,EAAE,IAAI,EACvB,QAAQ,EAAE,UAAO,EAAE,EAAE,KAAK;;oCAAK,qBAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAA;oCAAnD,sBAAA,SAAmD,EAAA;;6BAAA,GAClF,CAEM,CACN,CACP,CAAC;IACJ,CAAC;IACH,2BAAC;AAAD,CAAC,AA7FD,CAA0C,KAAK,CAAC,SAAS,GA6FxD"}
|
package/lib/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ICollectionColorFieldProps {
|
|
3
|
-
field: ICustomCollectionField;
|
|
4
|
-
item: any;
|
|
5
|
-
disableEdit: boolean;
|
|
6
|
-
fOnValueChange: (fieldId: string, value: string) => void;
|
|
1
|
+
import { IBaseCollectionFieldProps } from "../IBaseCollectionFIeldsProps";
|
|
2
|
+
export interface ICollectionColorFieldProps extends IBaseCollectionFieldProps {
|
|
7
3
|
}
|
|
8
4
|
//# sourceMappingURL=ICollectionColorFieldProps.d.ts.map
|
package/lib/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ICollectionColorFieldProps.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ICollectionColorFieldProps.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionColorField/ICollectionColorFieldProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,WAAW,0BAA2B,SAAQ,yBAAyB;CAAI"}
|
|
@@ -29,9 +29,14 @@ export declare class CollectionDataItem extends React.Component<ICollectionDataI
|
|
|
29
29
|
*/
|
|
30
30
|
private checkAnyFieldContainsValue;
|
|
31
31
|
/**
|
|
32
|
-
* Check
|
|
32
|
+
* Check onGetCustomErrorMessage
|
|
33
|
+
* @param item
|
|
34
|
+
*/
|
|
35
|
+
private checkAnyFieldCustomErrorMessage;
|
|
36
|
+
/**
|
|
37
|
+
* Check if row is ready for save
|
|
33
38
|
*/
|
|
34
|
-
private
|
|
39
|
+
private checkRowIsValidForSave;
|
|
35
40
|
/**
|
|
36
41
|
* Checks if all fields are valid
|
|
37
42
|
*/
|
|
@@ -55,6 +60,10 @@ export declare class CollectionDataItem extends React.Component<ICollectionDataI
|
|
|
55
60
|
* @param value
|
|
56
61
|
*/
|
|
57
62
|
private fieldValidation;
|
|
63
|
+
/**
|
|
64
|
+
* Updates callout and validation state
|
|
65
|
+
*/
|
|
66
|
+
private storeFieldValidation;
|
|
58
67
|
/**
|
|
59
68
|
* Custom field validation
|
|
60
69
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionDataItem.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionDataItem/CollectionDataItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AAgBvE,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IACzG,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,cAAc,CAAc;gBAExB,KAAK,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"CollectionDataItem.d.ts","sourceRoot":"","sources":["../../../../src/propertyFields/collectionData/collectionDataItem/CollectionDataItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAC;AAgBvE,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IACzG,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,cAAc,CAAc;gBAExB,KAAK,EAAE,wBAAwB;IAc3C;;;;OAIG;IACI,kBAAkB,CAAC,SAAS,EAAE,wBAAwB,GAAG,IAAI;IAQpE;;OAEG;IACH,OAAO,CAAC,cAAc,CASrB;IAED;;OAEG;YACW,gBAAgB;IAwB9B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAYnC;;;OAGG;IACH,OAAO,CAA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