@mikezimm/fps-library-v2 1.0.32 → 1.0.33
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.md +6 -1
- package/lib/banner/components/EasyPages/functions.d.ts +1 -1
- package/lib/banner/components/EasyPages/functions.d.ts.map +1 -1
- package/lib/banner/components/SpecialBanner/component.d.ts +1 -1
- package/lib/banner/components/SpecialBanner/component.d.ts.map +1 -1
- package/lib/banner/features/Expando/functions.d.ts +1 -1
- package/lib/banner/features/Expando/functions.d.ts.map +1 -1
- package/lib/banner/features/PageStyle/minimzeToolbar.d.ts +2 -2
- package/lib/banner/features/PageStyle/minimzeToolbar.d.ts.map +1 -1
- package/lib/banner/features/PageStyle/setAllSectionStyles.d.ts +1 -1
- package/lib/banner/features/PageStyle/setAllSectionStyles.d.ts.map +1 -1
- package/lib/banner/features/PinMe/FPSPinMenu.d.ts +1 -1
- package/lib/banner/features/PinMe/FPSPinMenu.d.ts.map +1 -1
- package/lib/banner/propPane/controls.d.ts +1 -1
- package/lib/banner/propPane/controls.d.ts.map +1 -1
- package/lib/common/interfaces/openSource/spfxControlsReact/@3.7.2/IViewField.d.ts +139 -0
- package/lib/common/interfaces/openSource/spfxControlsReact/@3.7.2/IViewField.d.ts.map +1 -0
- package/lib/common/interfaces/openSource/spfxControlsReact/@3.7.2/IViewField.js +2 -0
- package/lib/common/interfaces/openSource/spfxControlsReact/@3.7.2/IViewField.js.map +1 -0
- package/lib/components/atoms/Elements/basic.d.ts +1 -1
- package/lib/components/atoms/Elements/basic.d.ts.map +1 -1
- package/lib/components/molecules/Performance/tables.d.ts +1 -1
- package/lib/components/molecules/Performance/tables.d.ts.map +1 -1
- package/lib/components/molecules/PropPaneCols/PropPaneCols.module.scss.d.ts +3 -0
- package/lib/components/molecules/PropPaneCols/PropPaneCols.module.scss.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneCols.module.scss.js +6 -0
- package/lib/components/molecules/PropPaneCols/PropPaneCols.module.scss.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsClass.d.ts +42 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsClass.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsClass.js +240 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsClass.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsHook.d.ts +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsHook.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsHook.js +135 -0
- package/lib/components/molecules/PropPaneCols/PropPaneColsHook.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/FieldPanel.d.ts +10 -0
- package/lib/components/molecules/PropPaneCols/components/FieldPanel.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/FieldPanel.js +43 -0
- package/lib/components/molecules/PropPaneCols/components/FieldPanel.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/IPropPaneColsProps.d.ts +87 -0
- package/lib/components/molecules/PropPaneCols/components/IPropPaneColsProps.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/IPropPaneColsProps.js +2 -0
- package/lib/components/molecules/PropPaneCols/components/IPropPaneColsProps.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/OnClickHelpers.d.ts +18 -0
- package/lib/components/molecules/PropPaneCols/components/OnClickHelpers.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/OnClickHelpers.js +120 -0
- package/lib/components/molecules/PropPaneCols/components/OnClickHelpers.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/Accordion.d.ts +17 -0
- package/lib/components/molecules/PropPaneCols/components/command/Accordion.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/Accordion.js +229 -0
- package/lib/components/molecules/PropPaneCols/components/command/Accordion.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/IAccordion.d.ts +69 -0
- package/lib/components/molecules/PropPaneCols/components/command/IAccordion.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/IAccordion.js +73 -0
- package/lib/components/molecules/PropPaneCols/components/command/IAccordion.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign copy.d.ts +9 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign copy.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign copy.js +61 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign copy.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign.d.ts +10 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign.js +66 -0
- package/lib/components/molecules/PropPaneCols/components/command/SampleDesign.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/createLogic.d.ts +13 -0
- package/lib/components/molecules/PropPaneCols/components/command/createLogic.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/createLogic.js +397 -0
- package/lib/components/molecules/PropPaneCols/components/command/createLogic.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/helpers.d.ts +2 -0
- package/lib/components/molecules/PropPaneCols/components/command/helpers.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/helpers.js +2 -0
- package/lib/components/molecules/PropPaneCols/components/command/helpers.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/tableRows.d.ts +5 -0
- package/lib/components/molecules/PropPaneCols/components/command/tableRows.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/command/tableRows.js +25 -0
- package/lib/components/molecules/PropPaneCols/components/command/tableRows.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/common.d.ts +4 -0
- package/lib/components/molecules/PropPaneCols/components/common.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/common.js +16 -0
- package/lib/components/molecules/PropPaneCols/components/common.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/Pane.d.ts +11 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/Pane.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/Pane.js +51 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/Pane.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/funcions.d.ts +3 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/funcions.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/funcions.js +96 -0
- package/lib/components/molecules/PropPaneCols/components/fetch/funcions.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/main/FieldTable.d.ts +14 -0
- package/lib/components/molecules/PropPaneCols/components/main/FieldTable.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/main/FieldTable.js +68 -0
- package/lib/components/molecules/PropPaneCols/components/main/FieldTable.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/main/Pane.d.ts +13 -0
- package/lib/components/molecules/PropPaneCols/components/main/Pane.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/main/Pane.js +87 -0
- package/lib/components/molecules/PropPaneCols/components/main/Pane.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/selected/TableHook.d.ts +9 -0
- package/lib/components/molecules/PropPaneCols/components/selected/TableHook.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/selected/TableHook.js +63 -0
- package/lib/components/molecules/PropPaneCols/components/selected/TableHook.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/selected/functions.d.ts +5 -0
- package/lib/components/molecules/PropPaneCols/components/selected/functions.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/selected/functions.js +59 -0
- package/lib/components/molecules/PropPaneCols/components/selected/functions.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/views/Accordion.d.ts +12 -0
- package/lib/components/molecules/PropPaneCols/components/views/Accordion.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/views/Accordion.js +29 -0
- package/lib/components/molecules/PropPaneCols/components/views/Accordion.js.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/views/functions.d.ts +5 -0
- package/lib/components/molecules/PropPaneCols/components/views/functions.d.ts.map +1 -0
- package/lib/components/molecules/PropPaneCols/components/views/functions.js +133 -0
- package/lib/components/molecules/PropPaneCols/components/views/functions.js.map +1 -0
- package/lib/logic/Errors/friendly.d.ts +1 -1
- package/lib/logic/Errors/friendly.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Web, } from "@pnp/sp/presets/all";
|
|
2
|
+
import { IsEditable } from "../IPropPaneColsProps";
|
|
3
|
+
import { getHelpfullErrorV2 } from '../../../../../logic/Errors/friendly';
|
|
4
|
+
// export async function clickFetchFields( list: IMinListProps, setState: any, updatePerformance: any ) : Promise<void> {
|
|
5
|
+
export async function fetchFields(list) {
|
|
6
|
+
const { webURL, listTitle, } = list;
|
|
7
|
+
try {
|
|
8
|
+
if (listTitle && webURL) {
|
|
9
|
+
let FilteredFields = [];
|
|
10
|
+
//setlistFields( await allAvailableFields( webURL, listTitle, ) );
|
|
11
|
+
// const fetchWebURL = getFullUrlFromSlashSitesUrl( webURL );
|
|
12
|
+
const fetchWebURL = webURL;
|
|
13
|
+
const thisWebInstance = Web(fetchWebURL);
|
|
14
|
+
const allFields = await thisWebInstance.lists.getByTitle(listTitle).fields.orderBy("Title", true)();
|
|
15
|
+
FilteredFields = allFields.filter(field => field.Hidden !== true && field.Sealed !== true);
|
|
16
|
+
const DefaultSelected = ['ID', 'Editor', 'Modified', 'Title', 'FileLeafRef'];
|
|
17
|
+
const PreSelectedFields = [];
|
|
18
|
+
const SelectedNames = [];
|
|
19
|
+
let versionField = null;
|
|
20
|
+
let fileField = null;
|
|
21
|
+
FilteredFields.map((field, idx) => {
|
|
22
|
+
field.idx = idx;
|
|
23
|
+
field.commands = {};
|
|
24
|
+
// field.searchTextLC: = ['Title', 'InternalName', 'TypeDisplayName', 'Description', 'Choices', 'Formula', 'DefaultValue' ].map( prop => {
|
|
25
|
+
field.searchTextLC = ['Title', 'InternalName', 'TypeDisplayName', 'Description', 'Choices', 'Formula', 'DefaultValue'].map(prop => {
|
|
26
|
+
const anyField = field;
|
|
27
|
+
return anyField[prop] ? `${prop}:${anyField[prop]}` : '';
|
|
28
|
+
}).filter(str => str && str !== '').join(' || ').toLocaleLowerCase();
|
|
29
|
+
let ReadOnly = field.ReadOnlyField === true ? 'IsReadOnly' : IsEditable.toLocaleLowerCase();
|
|
30
|
+
if (field.InternalName === 'ContentType')
|
|
31
|
+
ReadOnly = '';
|
|
32
|
+
field.searchTextLC += ` : ${ReadOnly}`;
|
|
33
|
+
if (DefaultSelected.indexOf(field.InternalName) > -1) {
|
|
34
|
+
field.isKeeper = true;
|
|
35
|
+
field.isSelected = true;
|
|
36
|
+
PreSelectedFields.push(field);
|
|
37
|
+
SelectedNames.push(field.InternalName);
|
|
38
|
+
}
|
|
39
|
+
if (field.InternalName === '_UIVersionString')
|
|
40
|
+
versionField = field;
|
|
41
|
+
if (field.FileLeafRef)
|
|
42
|
+
fileField = field;
|
|
43
|
+
});
|
|
44
|
+
//Add version column only if it's a library.
|
|
45
|
+
if (fileField)
|
|
46
|
+
PreSelectedFields.push(versionField);
|
|
47
|
+
const SortedPreSelectedFields = [];
|
|
48
|
+
DefaultSelected.map(name => {
|
|
49
|
+
const idx = SelectedNames.indexOf(name);
|
|
50
|
+
if (idx > -1) {
|
|
51
|
+
SortedPreSelectedFields.push(PreSelectedFields[idx]);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// const fieldPanelState: IFieldPanelState = {
|
|
55
|
+
const FieldPanelState = {
|
|
56
|
+
listFields: FilteredFields,
|
|
57
|
+
filtered: FilteredFields,
|
|
58
|
+
selected: SortedPreSelectedFields,
|
|
59
|
+
status: 'Success - Fetched!',
|
|
60
|
+
fetched: true,
|
|
61
|
+
searchText: '',
|
|
62
|
+
searchProp: '',
|
|
63
|
+
errMessage: '',
|
|
64
|
+
};
|
|
65
|
+
return FieldPanelState;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Was missing webUrl or list Title
|
|
69
|
+
const FieldPanelState = {
|
|
70
|
+
listFields: [],
|
|
71
|
+
filtered: [],
|
|
72
|
+
selected: [],
|
|
73
|
+
status: 'Failed to fetch columns!',
|
|
74
|
+
fetched: false,
|
|
75
|
+
searchText: '',
|
|
76
|
+
searchProp: '',
|
|
77
|
+
errMessage: 'Missing Web URL or List Title',
|
|
78
|
+
};
|
|
79
|
+
return FieldPanelState;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
const FieldPanelState = {
|
|
84
|
+
listFields: [],
|
|
85
|
+
filtered: [],
|
|
86
|
+
selected: [],
|
|
87
|
+
status: 'Did not fetch columns!',
|
|
88
|
+
fetched: false,
|
|
89
|
+
searchText: '',
|
|
90
|
+
searchProp: '',
|
|
91
|
+
errMessage: getHelpfullErrorV2(e, false, true, `FetchFunction ~ 101`).returnMess,
|
|
92
|
+
};
|
|
93
|
+
return FieldPanelState;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=funcions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funcions.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/fetch/funcions.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,GAAG,GAAG,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAA4B,UAAU,EAAyB,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAExE,0HAA0H;AAC5H,MAAM,CAAC,KAAK,UAAU,WAAW,CAAG,IAAmB;IAErD,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,GAAG,IAAI,CAAE;IACrC,IAAI;Q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E,CAAE,CAAC;iBAAE;YAC/E,CAAC,CAAC,CAAC;YAEH,8CAA8C;YAC9C,MAAM,eAAe,GAA0B;gBAC7C,UAAU,EAAE,cAAc;gBAC1B,QAAQ,EAAE,cAAc;gBACxB,QAAQ,EAAE,uBAAuB;gBACjC,MAAM,EAAE,oBAAoB;gBAC5B,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,EAAE;aACf,CAAA;YAED,OAAO,eAAe,CAAC;SAExB;aAAM;YACL,mCAAmC;YACnC,MAAM,eAAe,GAA0B;gBAC3C,UAAU,EAAE,EAAE;gBACd,QAAQ,EAAE,EAAE;gBACZ,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,0BAA0B;gBAClC,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,+BAA+B;aAC9C,CAAC;YAEF,OAAO,eAAe,CAAC;SAExB;KAEF;IAAC,OAAO,CAAC,EAAE;QAEV,MAAM,eAAe,GAA0B;YAC7C,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,wBAAwB;YAChC,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,kBAAkB,CAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,CAAG,CAAC,UAAU;SACpF,CAAC;QAEF,OAAO,eAAe,CAAC;KACxB;AAEH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IMinField } from "../IPropPaneColsProps";
|
|
3
|
+
export interface IMainFieldTableHookProps {
|
|
4
|
+
filtered: IMinField[];
|
|
5
|
+
designMode: boolean;
|
|
6
|
+
listFields: IMinField[];
|
|
7
|
+
searchProp: string;
|
|
8
|
+
searchText: string;
|
|
9
|
+
onSelectItem: any;
|
|
10
|
+
onTypeClick: any;
|
|
11
|
+
}
|
|
12
|
+
declare const MainFieldTableHook: React.FC<IMainFieldTableHookProps>;
|
|
13
|
+
export default MainFieldTableHook;
|
|
14
|
+
//# sourceMappingURL=FieldTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldTable.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/main/FieldTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,wBAAwB;IAKvC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,GAAG,CAAC;CAIlB;AAGD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuF1D,CAAA;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import { getHighlightedText, } from '../../../../../components/atoms/Elements/HighlightedText';
|
|
5
|
+
import { Icon, } from 'office-ui-fabric-react/lib/Icon';
|
|
6
|
+
import SelectedItemPanelHook from "../FieldPanel";
|
|
7
|
+
// export function buildMainFieldTable( filtered: IMinField[], designMode: boolean, listFields: IMinField[], searchProp: string, searchText: string, onSelectItem: any, onTypeClick: any, showFieldPanel: any ) : JSX.Element {
|
|
8
|
+
const MainFieldTableHook = (props) => {
|
|
9
|
+
const { filtered, designMode, listFields, searchProp, searchText, onSelectItem, onTypeClick, } = props;
|
|
10
|
+
const [panelItem, setPanelItem] = useState(null);
|
|
11
|
+
const showFieldPanel = (item) => {
|
|
12
|
+
setPanelItem(item);
|
|
13
|
+
};
|
|
14
|
+
const onClosePanel = () => {
|
|
15
|
+
setPanelItem(null);
|
|
16
|
+
};
|
|
17
|
+
let heading = '';
|
|
18
|
+
if (listFields.length > 0) {
|
|
19
|
+
heading = 'Description';
|
|
20
|
+
if (searchProp === 'Choice') {
|
|
21
|
+
heading = 'Choices';
|
|
22
|
+
}
|
|
23
|
+
else if (searchProp === 'Calculated') {
|
|
24
|
+
heading = 'Formula';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const tableRows = [];
|
|
28
|
+
tableRows.push(React.createElement("tr", null,
|
|
29
|
+
React.createElement("th", { style: { display: designMode === true ? '' : 'none' } }, "Add"),
|
|
30
|
+
React.createElement("th", null,
|
|
31
|
+
"Title ( ",
|
|
32
|
+
filtered.length,
|
|
33
|
+
" )"),
|
|
34
|
+
React.createElement("th", null, "InternalName"),
|
|
35
|
+
React.createElement("th", null, "Type"),
|
|
36
|
+
React.createElement("th", null, heading)));
|
|
37
|
+
filtered.map((field) => {
|
|
38
|
+
let detailValue = field.Description;
|
|
39
|
+
if (searchProp === 'Choice' || (!detailValue && field.TypeAsString === 'Choice')) {
|
|
40
|
+
detailValue = JSON.stringify(field.Choices);
|
|
41
|
+
}
|
|
42
|
+
else if (searchProp === 'Calculated' || (!detailValue && field.Formula)) {
|
|
43
|
+
detailValue = JSON.stringify(field.Formula);
|
|
44
|
+
detailValue = detailValue.slice(1, detailValue.length - 1); //Remove extra quotes around formula
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
detailValue = field.Description;
|
|
48
|
+
}
|
|
49
|
+
const SelectIcon = React.createElement(Icon, { className: 'select-icon', "data-fieldname": field.InternalName, onClick: onSelectItem, iconName: field.isSelected === true ? 'SkypeCircleCheck' : 'StatusCircleRing' });
|
|
50
|
+
// const fieldName: string = target.dataset?.fieldname ? '' : target.dataset.fieldname;
|
|
51
|
+
// const index: number = target.dataset?.fieldindex ? -1 : target.dataset.fieldindex;
|
|
52
|
+
// const KeeperIcon = <Icon className={ 'selectIcon } data-fieldname={ field.InternalName }
|
|
53
|
+
// onClick= { onKeeperClick } iconName={ isKeeper === true ? 'CheckboxComposite' : 'Checkbox' }/>;
|
|
54
|
+
const row = React.createElement("tr", null,
|
|
55
|
+
React.createElement("td", { style: { display: designMode === true ? '' : 'none' } }, SelectIcon),
|
|
56
|
+
React.createElement("td", { "data-fieldname": field.InternalName, "data-fieldindex": field.idx, onClick: () => showFieldPanel(field) }, getHighlightedText(field.Title, searchText)),
|
|
57
|
+
React.createElement("td", { title: field.InternalName }, getHighlightedText(field.InternalName, searchText)),
|
|
58
|
+
React.createElement("td", { onClick: () => onTypeClick(field, this) }, getHighlightedText(field.TypeDisplayName, searchText)),
|
|
59
|
+
React.createElement("td", { title: detailValue }, getHighlightedText(detailValue, searchText)));
|
|
60
|
+
tableRows.push(row);
|
|
61
|
+
});
|
|
62
|
+
const MainFieldTable = React.createElement("table", { className: 'field-table' },
|
|
63
|
+
React.createElement(SelectedItemPanelHook, { panelItem: panelItem, searchText: searchText, onClosePanel: onClosePanel.bind(this) }),
|
|
64
|
+
tableRows);
|
|
65
|
+
return (MainFieldTable);
|
|
66
|
+
};
|
|
67
|
+
export default MainFieldTableHook;
|
|
68
|
+
//# sourceMappingURL=FieldTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldTable.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/main/FieldTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAG5C,6DAA6D;AAC7D,OAAO,EAAE,kBAAkB,GAAI,MAAM,0DAA0D,CAAC;AAQhG,OAAO,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AAO;YAElE,4BAAI,OAAO,EAAG,GAAG,EAAE,CAAC,WAAW,CAAE,KAAK,EAAE,IAAI,CAAE,IAAM,kBAAkB,CAAE,KAAK,CAAC,eAAe,EAAG,UAAU,CAAE,CAAO;YACnH,4BAAI,KAAK,EAAE,WAAW,IAAI,kBAAkB,CAAE,WAAW,EAAG,UAAU,CAAE,CAAO,CAC5E,CAAC;QACN,SAAS,CAAC,IAAI,CAAE,GAAG,CAAE,CAAC;IAExB,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAgB,+BAAO,SAAS,EAAG,aAAa;QAC9D,oBAAE,qBAAqB,IACrB,SAAS,EAAI,SAAS,EACtB,UAAU,EAAG,UAAU,EACvB,YAAY,EAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GACpC;QACF,SAAS,CACL,CAAC;IAEb,OAAQ,CAAE,cAAc,CAAE,CAAC;AAC7B,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IFieldPanelProps, IFieldPanelState } from '../IPropPaneColsProps';
|
|
3
|
+
export declare function mainSiteLink(webURL: string): JSX.Element;
|
|
4
|
+
export interface IMainCallbacks {
|
|
5
|
+
selectFiltered: any;
|
|
6
|
+
onFilterClick2: any;
|
|
7
|
+
onTextSearch: any;
|
|
8
|
+
toggleDesign: any;
|
|
9
|
+
onSelectItem: any;
|
|
10
|
+
onTypeClick: any;
|
|
11
|
+
}
|
|
12
|
+
export declare function MainPane(props: IFieldPanelProps, state: IFieldPanelState, callbacks: IMainCallbacks): JSX.Element;
|
|
13
|
+
//# sourceMappingURL=Pane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pane.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/main/Pane.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAc,MAAM,uBAAuB,CAAC;AAKvF,wBAAgB,YAAY,CAAE,MAAM,EAAE,MAAM,GAAI,GAAG,CAAC,OAAO,CAM1D;AAGD,MAAM,WAAW,cAAc;IAE7B,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,GAAG,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,GAAG,CAAC;CAKlB;AAED,wBAAgB,QAAQ,CAAG,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,GAAI,GAAG,CAAC,OAAO,CAkGpH"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
|
+
// import { IGrouping, IViewField } from "@pnp/spfx-controls-react/lib/ListView";
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
// import { IFieldInfo, FieldTypes } from "@pnp/sp/presets/all";
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
import { Toggle, } from 'office-ui-fabric-react/lib/Toggle';
|
|
8
|
+
import { SearchBox, } from 'office-ui-fabric-react/lib/SearchBox';
|
|
9
|
+
import { Icon, } from 'office-ui-fabric-react/lib/Icon';
|
|
10
|
+
// import styles from '../PropPaneCols.module.scss';
|
|
11
|
+
import { IsEditable } from '../IPropPaneColsProps';
|
|
12
|
+
// import { buildMainFieldTable } from './MainFieldTable';
|
|
13
|
+
import MainFieldTableHook from './FieldTable';
|
|
14
|
+
export function mainSiteLink(webURL) {
|
|
15
|
+
return (React.createElement("div", { style: { paddingBottom: '15px', fontSize: 'larger', fontWeight: 'bolder' } },
|
|
16
|
+
"on this site:",
|
|
17
|
+
React.createElement("span", { style: { color: 'darkblue', cursor: 'pointer', marginLeft: '25px' }, onClick: () => { window.open(webURL, '_blank'); } }, webURL)));
|
|
18
|
+
}
|
|
19
|
+
export function MainPane(props, state, callbacks) {
|
|
20
|
+
const { selectFiltered, onFilterClick2, onSelectItem, } = callbacks;
|
|
21
|
+
const { onTextSearch, onTypeClick, } = callbacks;
|
|
22
|
+
// const { onTextSearch,} = callbacks;
|
|
23
|
+
const { toggleDesign } = callbacks;
|
|
24
|
+
// const onTextSearch: any = null;
|
|
25
|
+
// const toggleDesign: any = null;
|
|
26
|
+
const { lists, disableDesign } = props;
|
|
27
|
+
const { status, filtered, listFields, designMode, searchProp, searchText, fetched, listIdx } = state;
|
|
28
|
+
const searchBoxStyles = { root: { width: 200 } };
|
|
29
|
+
const FieldSearchBox = React.createElement(SearchBox, { className: '', styles: searchBoxStyles, placeholder: "Search", value: searchText, onSearch: onTextSearch,
|
|
30
|
+
// onFocus={ () => console.log('this.state', this.state) }
|
|
31
|
+
// onBlur={ () => console.log('onBlur called') }
|
|
32
|
+
onChange: onTextSearch, onClear: onTextSearch });
|
|
33
|
+
const DesignToggle = fetched !== true ? null : React.createElement(Toggle, { label: 'Design', inlineLabel: true,
|
|
34
|
+
// onChange={ () => toggleDesign() }
|
|
35
|
+
onChange: toggleDesign, checked: designMode, disabled: disableDesign, styles: { root: { width: 160, float: 'right' } } });
|
|
36
|
+
const SelectFiltered = React.createElement(Icon, { iconName: 'SkypeCircleArrow', title: 'Select All these columns', style: { color: searchText ? '' : 'lightgray' }, "data-fieldtype": '', onClick: !fetched ? null : selectFiltered, className: 'type-filter-icon' });
|
|
37
|
+
const DateFilterIcon = React.createElement(Icon, { iconName: 'DateTime', title: 'Filter for DateTime columns', style: {}, "data-fieldtype": 'Date and Time', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
38
|
+
const UserFilterIcon = React.createElement(Icon, { iconName: 'Contact', title: 'Filter for User columns', style: {}, "data-fieldtype": 'Person or Group', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
39
|
+
const TextFilterIcon = React.createElement(Icon, { iconName: 'TextField', title: 'Filter for Text columns', style: {}, "data-fieldtype": 'Text', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
40
|
+
const ChoiceFilterIcon = React.createElement(Icon, { iconName: 'Stack', title: 'Filter for Choice columns', style: {}, "data-fieldtype": 'Choice', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
41
|
+
const NumberFilterIcon = React.createElement(Icon, { iconName: 'Number', title: 'Filter for Number columns', style: {}, "data-fieldtype": 'Number', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
42
|
+
const YesNoFilterIcon = React.createElement(Icon, { iconName: 'CheckboxComposite', title: 'Filter for Number columns', style: {}, "data-fieldtype": 'Yes/No', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
43
|
+
const LookupFilterIcon = React.createElement(Icon, { iconName: 'Relationship', title: 'Filter for Lookup columns', style: {}, "data-fieldtype": 'Lookup', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
44
|
+
const UrlFilterIcon = React.createElement(Icon, { iconName: 'Link', title: 'Filter for Link columns', style: {}, "data-fieldtype": 'Hyperlink or Picture', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
45
|
+
const EditableFilterIcon = React.createElement(Icon, { iconName: 'Edit', title: 'All Editable', style: {}, "data-fieldtype": IsEditable, onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
46
|
+
const CalculatedFilterIcon = React.createElement(Icon, { iconName: 'Variable', title: 'Calculated columns', style: {}, "data-fieldtype": 'Calculated', onClick: !fetched ? null : onFilterClick2, className: 'type-filter-icon' });
|
|
47
|
+
const FilterButtons = React.createElement("div", { style: { display: 'flex', marginLeft: '50px' } },
|
|
48
|
+
SelectFiltered,
|
|
49
|
+
" ",
|
|
50
|
+
DateFilterIcon,
|
|
51
|
+
" ",
|
|
52
|
+
UserFilterIcon,
|
|
53
|
+
" ",
|
|
54
|
+
TextFilterIcon,
|
|
55
|
+
ChoiceFilterIcon,
|
|
56
|
+
" ",
|
|
57
|
+
NumberFilterIcon,
|
|
58
|
+
" ",
|
|
59
|
+
CalculatedFilterIcon,
|
|
60
|
+
YesNoFilterIcon,
|
|
61
|
+
" ",
|
|
62
|
+
LookupFilterIcon,
|
|
63
|
+
" ",
|
|
64
|
+
UrlFilterIcon,
|
|
65
|
+
" ",
|
|
66
|
+
EditableFilterIcon);
|
|
67
|
+
const MainFieldTable = React.createElement(MainFieldTableHook, { filtered: filtered, designMode: designMode, listFields: listFields, searchProp: searchProp, searchText: searchText, onSelectItem: onSelectItem, onTypeClick: onTypeClick });
|
|
68
|
+
const { listTitle, } = lists[listIdx];
|
|
69
|
+
return (React.createElement("div", { className: 'right-side' },
|
|
70
|
+
React.createElement("h3", { style: { marginTop: '0px' } },
|
|
71
|
+
`Fields from '${listTitle}'`,
|
|
72
|
+
" ",
|
|
73
|
+
DesignToggle),
|
|
74
|
+
mainSiteLink(lists[listIdx].webURL),
|
|
75
|
+
React.createElement("div", { style: { paddingBottom: '15px', display: 'flex', alignContent: 'space-between' } },
|
|
76
|
+
FieldSearchBox,
|
|
77
|
+
" ",
|
|
78
|
+
FilterButtons),
|
|
79
|
+
React.createElement("div", { style: { paddingBottom: '15px', fontSize: 'smaller' } },
|
|
80
|
+
"CTRL-click ",
|
|
81
|
+
React.createElement("b", null, "Add"),
|
|
82
|
+
" to add to Top of list, Click ",
|
|
83
|
+
React.createElement("b", null, "Type"),
|
|
84
|
+
" to filter on column type"),
|
|
85
|
+
MainFieldTable));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=Pane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pane.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/main/Pane.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,6DAA6D;AAC7D,iF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,aAAa;;QAAK,kBAAkB,CAC3E,CAAC;IAET,MAAM,cAAc,GAAiB,oBAAC,kBAAkB,IACtD,QAAQ,EAAG,QAAQ,EACnB,UAAU,EAAG,UAAU,EACvB,UAAU,EAAG,UAAU,EACvB,UAAU,EAAG,UAAU,EACvB,UAAU,EAAG,UAAU,EACvB,YAAY,EAAG,YAAY,EAC3B,WAAW,EAAG,WAAW,GAEzB,CAAC;IAEH,MAAM,EAAE,SAAS,GAAG,GAAG,KAAK,CAAE,OAAO,CAAE,CAAE;IACzC,OAAO,CACL,6BAAK,SAAS,EAAG,YAAY;QAC3B,4BAAI,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YAAI,gBAAiB,SAAU,GAAG;;YAAM,YAAY,CAAM;QACvF,YAAY,CAAE,KAAK,CAAE,OAAO,CAAE,CAAC,MAAM,CAAE;QACzC,6BAAK,KAAK,EAAE,EAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE;YAAI,cAAc;;YAAO,aAAa,CAAQ;QAClI,6BAAK,KAAK,EAAE,EAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE;;YAAa,qCAAU;;YAA8B,sCAAW;wCAA+B;QAEtJ,cAAc,CACd,CAAE,CAAA;AAEV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IMinField } from "../IPropPaneColsProps";
|
|
3
|
+
export interface ISelectedTableHookProps {
|
|
4
|
+
selected: IMinField[];
|
|
5
|
+
updateSelected: any;
|
|
6
|
+
}
|
|
7
|
+
declare const SelectedTableHook: React.FC<ISelectedTableHookProps>;
|
|
8
|
+
export default SelectedTableHook;
|
|
9
|
+
//# sourceMappingURL=TableHook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHook.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/selected/TableHook.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKlD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,EAAE,CAAC;IAGtB,cAAc,EAAE,GAAG,CAAC;CAErB;AAGD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwFxD,CAAA;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Icon, } from 'office-ui-fabric-react/lib/Icon';
|
|
4
|
+
import SelectedItemPanelHook from "../FieldPanel";
|
|
5
|
+
import { getDirectionClicks, getKeeperClicks } from './functions';
|
|
6
|
+
// export const SelectedTableHook( selected: IMinField[], onKeeperClick: any, onDirectionClick: any , showFieldPanel: any) : JSX.Element {
|
|
7
|
+
const SelectedTableHook = (props) => {
|
|
8
|
+
const { selected, updateSelected } = props;
|
|
9
|
+
const [panelItem, setPanelItem] = useState(null);
|
|
10
|
+
// const [ selected, setSelected ] = useState<IMinField[]>(props.selected);
|
|
11
|
+
const onKeeperClick = (ev) => {
|
|
12
|
+
const newSelected = getKeeperClicks(ev, selected);
|
|
13
|
+
updateSelected(newSelected);
|
|
14
|
+
// setSelected( newSelected );
|
|
15
|
+
};
|
|
16
|
+
const onDirectionClick = (ev) => {
|
|
17
|
+
const newSelected = getDirectionClicks(ev, selected);
|
|
18
|
+
updateSelected(newSelected);
|
|
19
|
+
// setSelected( newSelected );
|
|
20
|
+
};
|
|
21
|
+
const tableRows = [];
|
|
22
|
+
tableRows.push(React.createElement("tr", null,
|
|
23
|
+
React.createElement("th", null),
|
|
24
|
+
React.createElement("th", { style: {} }, "Keep"),
|
|
25
|
+
React.createElement("th", null,
|
|
26
|
+
"Title ( ",
|
|
27
|
+
selected.length,
|
|
28
|
+
" )"),
|
|
29
|
+
React.createElement("th", null, "Type"),
|
|
30
|
+
React.createElement("th", null, "Up"),
|
|
31
|
+
React.createElement("th", null, "Down")));
|
|
32
|
+
const showFieldPanel = (item) => {
|
|
33
|
+
setPanelItem(item);
|
|
34
|
+
};
|
|
35
|
+
const onClosePanel = () => {
|
|
36
|
+
setPanelItem(null);
|
|
37
|
+
};
|
|
38
|
+
let selectedIndex = -1;
|
|
39
|
+
selected.map((field, idx) => {
|
|
40
|
+
const disableUp = idx === 0 ? true : false;
|
|
41
|
+
const disableDown = idx === selected.length - 1 ? true : false;
|
|
42
|
+
const isKeeper = field.isKeeper;
|
|
43
|
+
if (isKeeper === true)
|
|
44
|
+
selectedIndex++;
|
|
45
|
+
const KeeperIcon = React.createElement(Icon, { className: 'select-icon', "data-fieldname": field.InternalName, onClick: onKeeperClick, iconName: isKeeper === true ? 'CheckboxComposite' : 'Checkbox' });
|
|
46
|
+
const UpIcon = React.createElement(Icon, { className: 'command-icon', "data-fieldname": field.InternalName, "data-direction": 'up', style: { color: disableUp === true ? 'dimgray' : '' }, onClick: disableUp !== true ? onDirectionClick : null, iconName: disableUp === false ? 'Up' : 'StatusCircleBlock2' });
|
|
47
|
+
const DownIcon = React.createElement(Icon, { className: 'command-icon', "data-fieldname": field.InternalName, "data-direction": 'down', style: { color: disableDown === true ? 'dimgray' : '' }, onClick: disableDown !== true ? onDirectionClick : null, iconName: disableDown === false ? 'Down' : 'StatusCircleBlock2' });
|
|
48
|
+
const row = React.createElement("tr", null,
|
|
49
|
+
React.createElement("td", null, isKeeper === true ? selectedIndex : ''),
|
|
50
|
+
React.createElement("td", null, KeeperIcon),
|
|
51
|
+
React.createElement("td", { style: { fontWeight: isKeeper === true ? 700 : 400 }, title: field.InternalName, "data-fieldname": field.InternalName, "data-fieldindex": field.idx, onClick: () => showFieldPanel(field) }, field.Title),
|
|
52
|
+
React.createElement("td", { title: field.TypeAsString }, field.TypeAsString),
|
|
53
|
+
React.createElement("td", null, UpIcon),
|
|
54
|
+
React.createElement("td", null, DownIcon));
|
|
55
|
+
tableRows.push(row);
|
|
56
|
+
});
|
|
57
|
+
const SelectedTable = React.createElement("div", null,
|
|
58
|
+
React.createElement(SelectedItemPanelHook, { panelItem: panelItem, searchText: '', onClosePanel: onClosePanel.bind(this) }),
|
|
59
|
+
React.createElement("table", { className: 'selected-table' }, tableRows));
|
|
60
|
+
return (SelectedTable);
|
|
61
|
+
};
|
|
62
|
+
export default SelectedTableHook;
|
|
63
|
+
//# sourceMappingURL=TableHook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHook.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/selected/TableHook.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAU5C,OAAO,EAAE,IAAI,GAAG,MAAM,iCAAiC,CAAC;AAKxD,OAAO,qBAAqB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWlE,0IAA0I;AAC1I,MAAM,iBAAiB,GAAsC,CAAE,KAAK,EAAG,EAAE;IAEvE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE3C,MAAM,CAAE,SAAS,EAAE,YAAY,CAAE,GAAG,QAAQ,CAAY,IAAI,CAAC,CAAC;IAC9D,2EAA2E;IAE3E,MAAM,aAAa,GAAG,CAAE,EAAiC,EAAU,EAAE;QACnE,MAAM,WAAW,GAAgB,eAAe,CAAE,EAAE,EAAE,QAAQ,CAAE,CAAC;QACjE,cAAc,CAAE,WAAW,CAAE,CAAC;QAC9B,8BAA8B;IAChC,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAE,EAAiC,EAAU,EAAE;QACtE,MAAM,WAAW,GAAgB,kBAAkB,CAAE,E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CAAM,MAAM,CAAO;YACnB,gCAAM,QAAQ,CAAO,CAClB,CAAC;QACN,SAAS,CAAC,IAAI,CAAE,GAAG,CAAE,CAAC;IAExB,CAAC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAgB;QAE/B,oBAAE,qBAAqB,IACnB,SAAS,EAAI,SAAS,EACtB,UAAU,EAAC,EAAE,EACb,YAAY,EAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GACpC;QACN,+BAAO,SAAS,EAAG,gBAAgB,IAC/B,SAAS,CACL,CACJ,CAAC;IAET,OAAO,CAAE,aAAa,CAAE,CAAC;AAE3B,CAAC,CAAA;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IMinField } from "../IPropPaneColsProps";
|
|
3
|
+
export declare function getKeeperClicks(ev: React.MouseEvent<HTMLElement>, selected: IMinField[]): IMinField[];
|
|
4
|
+
export declare function getDirectionClicks(ev: React.MouseEvent<HTMLElement>, selected: IMinField[]): IMinField[];
|
|
5
|
+
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/selected/functions.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGhD,wBAAgB,eAAe,CAAG,EAAE,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAK,SAAS,EAAE,CAkB3G;AAED,wBAAgB,kBAAkB,CAAG,EAAE,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAK,SAAS,EAAE,CA+C5G"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// private _onKeeperClick = ( ev: React.MouseEvent<HTMLElement> ): void => {
|
|
2
|
+
export function getKeeperClicks(ev, selected) {
|
|
3
|
+
const target = ev.target;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const { altKey, ctrlKey, shiftKey, type } = ev; // type is like 'click'
|
|
6
|
+
const itemName = target.dataset.fieldname;
|
|
7
|
+
// let thisSelected : IMinField = null;
|
|
8
|
+
const newSelected = [];
|
|
9
|
+
selected.map(field => {
|
|
10
|
+
if (field.InternalName === itemName) {
|
|
11
|
+
field.isKeeper = field.isKeeper === true ? false : true;
|
|
12
|
+
}
|
|
13
|
+
newSelected.push(field);
|
|
14
|
+
});
|
|
15
|
+
return newSelected;
|
|
16
|
+
}
|
|
17
|
+
export function getDirectionClicks(ev, selected) {
|
|
18
|
+
const target = ev.target;
|
|
19
|
+
// const { altKey, ctrlKey, shiftKey, type } = ev; // type is like 'click'
|
|
20
|
+
const itemName = target.dataset.fieldname;
|
|
21
|
+
const direction = target.dataset.direction;
|
|
22
|
+
const ctrlKey = ev.ctrlKey;
|
|
23
|
+
let idx = -1;
|
|
24
|
+
selected.map((field, i) => {
|
|
25
|
+
if (field.InternalName === itemName) {
|
|
26
|
+
idx = i;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const currentPick = selected[idx];
|
|
30
|
+
let newSelected = [];
|
|
31
|
+
if (idx === -1) {
|
|
32
|
+
alert('Something went wrong :(');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (ctrlKey === true) {
|
|
36
|
+
if (direction === 'up')
|
|
37
|
+
newSelected.push(currentPick);
|
|
38
|
+
selected.map((field, i) => {
|
|
39
|
+
if (field.InternalName !== itemName) {
|
|
40
|
+
newSelected.push(field);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (direction === 'down')
|
|
44
|
+
newSelected.push(currentPick);
|
|
45
|
+
}
|
|
46
|
+
else if (direction === 'up') {
|
|
47
|
+
const part1 = idx === 1 ? [] : selected.slice(0, idx - 1);
|
|
48
|
+
const part2 = idx === selected.length - 1 ? [] : selected.slice(idx + 1);
|
|
49
|
+
newSelected = [...part1, ...[currentPick], ...[selected[idx - 1]], ...part2];
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const part1 = idx === 0 ? [] : selected.slice(0, idx);
|
|
53
|
+
const part2 = idx === selected.length - 2 ? [] : selected.slice(idx + 2);
|
|
54
|
+
newSelected = [...part1, ...[selected[idx + 1]], ...[currentPick], ...part2];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return newSelected;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/selected/functions.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC3E,MAAM,UAAU,eAAe,CAAG,EAAiC,EAAE,QAAqB;IAE1F,MAAM,MAAM,GAAQ,EAAE,CAAC,MAAM,CAAC;IAE9B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,uBAAuB;IACvE,MAAM,QAAQ,GAAW,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;IAElD,uCAAuC;IACvC,MAAM,WAAW,GAAiB,EAAG,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAE,KAAK,CAAC,EAAE;QACpB,IAAK,KAAK,CAAC,YAAY,KAAK,QAAQ,EAAG;YACrC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;SACzD;QACD,WAAW,CAAC,IAAI,CAAE,KAAK,CAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAG,EAAiC,EAAE,QAAq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CAAC;YAC1E,MAAM,KAAK,GAAgB,GAAG,KAAK,QAAQ,CAAC,MAAM,GAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,QAAQ,CAAC,KAAK,CAAE,GAAG,GAAG,CAAC,CAAE,CAAC;YACtF,WAAW,GAAG,CAAE,GAAG,KAAK,EAAE,GAAG,CAAE,WAAW,CAAE,EAAE,GAAG,CAAE,QAAQ,CAAE,GAAG,GAAG,CAAC,CAAE,CAAE,EAAI,GAAG,KAAK,CAAE,CAAC;SAExF;aAAM;YACL,MAAM,KAAK,GAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAE,CAAC,EAAE,GAAG,CAAE,CAAC;YACrE,MAAM,KAAK,GAAgB,GAAG,KAAK,QAAQ,CAAC,MAAM,GAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAE,GAAG,GAAG,CAAC,CAAE,CAAC;YACvF,WAAW,GAAG,CAAE,GAAG,KAAK,EAAE,GAAG,CAAE,QAAQ,CAAE,GAAG,GAAG,CAAC,CAAE,CAAE,EAAE,GAAG,CAAE,WAAW,CAAE,EAAI,GAAG,KAAK,CAAE,CAAC;SAExF;KAEF;IAED,OAAO,WAAW,CAAC;AAErB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IMinField } from "../IPropPaneColsProps";
|
|
3
|
+
export interface IViewBuilderHookProps {
|
|
4
|
+
selected: IMinField[];
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
onExpandRight: any;
|
|
7
|
+
tryCallback?: any;
|
|
8
|
+
saveCallback?: any;
|
|
9
|
+
}
|
|
10
|
+
declare const ViewBuilderHook: React.FC<IViewBuilderHookProps>;
|
|
11
|
+
export default ViewBuilderHook;
|
|
12
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/views/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKlD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,aAAa,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;CAEpB;AAID,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6CpD,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icon, } from 'office-ui-fabric-react/lib/Icon';
|
|
3
|
+
import { createThisViewField } from './functions';
|
|
4
|
+
import ReactJson from 'react-json-view';
|
|
5
|
+
import Accordion from '../../../../molecules/Accordion/Accordion';
|
|
6
|
+
// export function createViewBuilder( selected: IMinField[], onExpandRight: any = null ) : JSX.Element {
|
|
7
|
+
const ViewBuilderHook = (props) => {
|
|
8
|
+
const { selected, expanded, onExpandRight, tryCallback, saveCallback } = props;
|
|
9
|
+
const viewFields = [];
|
|
10
|
+
selected.map(field => {
|
|
11
|
+
if (field.isKeeper === true) {
|
|
12
|
+
viewFields.push(createThisViewField(field));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const expandRightIcon = React.createElement(Icon, { iconName: 'TransitionPop', title: 'Expand right to see button object', style: {}, "data-fieldtype": 'Commands', onClick: onExpandRight, className: 'type-filter-icon' });
|
|
16
|
+
const tryIcon = React.createElement(Icon, { iconName: "Save", className: 'type-filter-icon', onClick: saveCallback ? () => saveCallback(viewFields) : null, title: 'Save Views Set', style: { display: saveCallback ? '' : 'none' } });
|
|
17
|
+
const saveIcon = React.createElement(Icon, { iconName: "TestImpactSolid", className: 'type-filter-icon', onClick: tryCallback ? () => tryCallback(viewFields) : null, title: 'Try Views Set', style: { display: tryCallback ? '' : 'none' } });
|
|
18
|
+
const viewElement = React.createElement("div", null,
|
|
19
|
+
React.createElement("div", { style: { display: 'flex' } },
|
|
20
|
+
tryIcon,
|
|
21
|
+
saveIcon,
|
|
22
|
+
expandRightIcon),
|
|
23
|
+
React.createElement(ReactJson, { src: viewFields, name: 'viewFields', collapsed: 1, displayDataTypes: false, displayObjectSize: false, enableClipboard: true, style: { padding: '20px 0px' }, theme: 'rjv-default', indentWidth: 2 }));
|
|
24
|
+
const viewTitle = `Build Views`;
|
|
25
|
+
const DesignViews = React.createElement(Accordion, { title: viewTitle, showAccordion: false, animation: 'TopDown', contentStyles: { height: '' }, content: viewElement, componentStyles: { marginBottom: '15px', border: '4px solid #d1d1d1', background: '#f5f5f5', padding: '10px' } });
|
|
26
|
+
return (DesignViews);
|
|
27
|
+
};
|
|
28
|
+
export default ViewBuilderHook;
|
|
29
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/views/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,EAAE,IAAI,GAAG,MAAM,iCAAiC,CAAC;AAKxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,SAAS,MAAM,2CAA2C,CAAC;AAYlE,wGAAwG;AAExG,MAAM,eAAe,GAAoC,CAAE,KAAK,EAAG,EAAE;IAEnE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,KA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N,oBAAC,SAAS,IAAC,GAAG,EAAG,UAAU,EAAG,IAAI,EAAG,YAAY,EAAG,SAAS,EAAG,CAAC,EAAG,gBAAgB,EAAG,KAAK,EAAG,iBAAiB,EAAG,KAAK,EACpH,eAAe,EAAG,IAAI,EAAG,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,KAAK,EAAI,aAAa,EAAG,WAAW,EAAG,CAAC,GAAG,CACpG,CAAC;IAEP,MAAM,SAAS,GAAG,aAAa,CAAC;IAEhC,MAAM,WAAW,GAAgB,oBAAC,SAAS,IACzC,KAAK,EAAG,SAAS,EACjB,aAAa,EAAG,KAAK,EACrB,SAAS,EAAI,SAAS,EACtB,aAAa,EAAG,EAAC,MAAM,EAAE,EAAE,EAAC,EAC5B,OAAO,EAAK,WAAW,EACvB,eAAe,EAAI,EAAG,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAG,GAElH,CAAC;IAEH,OAAO,CAAE,WAAW,CAAE,CAAC;AAEzB,CAAC,CAAA;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IViewField } from "../../../../../common/interfaces/openSource/spfxControlsReact/@3.7.2/IViewField";
|
|
2
|
+
import { IMinField } from "../IPropPaneColsProps";
|
|
3
|
+
export declare function createViewFromFields(fields: IMinField[]): IViewField[];
|
|
4
|
+
export declare function createThisViewField(field: IMinField): IViewField;
|
|
5
|
+
//# sourceMappingURL=functions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/PropPaneCols/components/views/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,MAAM,iFAAiF,CAAC;AAIxH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAmBlD,wBAAgB,oBAAoB,CAAE,MAAM,EAAE,SAAS,EAAE,GAAK,UAAU,EAAE,CAMzE;AAED,wBAAgB,mBAAmB,CAAE,KAAK,EAAE,SAAS,GAAK,UAAU,CAyJnE"}
|