@mikezimm/fps-library-v2 1.0.148 → 1.0.149

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.d.ts +11 -0
  3. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.d.ts.map +1 -0
  4. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.js +2 -0
  5. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.js.map +1 -0
  6. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardState.d.ts +5 -0
  7. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardState.d.ts.map +1 -0
  8. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardState.js +2 -0
  9. package/lib/components/atoms/PersonaCard/Interfaces/IPersonaCardState.js.map +1 -0
  10. package/lib/components/atoms/PersonaCard/Interfaces/IUserProperties.d.ts +13 -0
  11. package/lib/components/atoms/PersonaCard/Interfaces/IUserProperties.d.ts.map +1 -0
  12. package/lib/components/atoms/PersonaCard/Interfaces/IUserProperties.js +2 -0
  13. package/lib/components/atoms/PersonaCard/Interfaces/IUserProperties.js.map +1 -0
  14. package/lib/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.d.ts +5 -0
  15. package/lib/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.d.ts.map +1 -0
  16. package/lib/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.js +5 -0
  17. package/lib/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.js.map +1 -0
  18. package/lib/components/atoms/PersonaCard/PersonaCard.d.ts +57 -0
  19. package/lib/components/atoms/PersonaCard/PersonaCard.d.ts.map +1 -0
  20. package/lib/components/atoms/PersonaCard/PersonaCard.js +233 -0
  21. package/lib/components/atoms/PersonaCard/PersonaCard.js.map +1 -0
  22. package/lib/components/atoms/PersonaCard/PersonaIcons.d.ts +4 -0
  23. package/lib/components/atoms/PersonaCard/PersonaIcons.d.ts.map +1 -0
  24. package/lib/components/atoms/PersonaCard/PersonaIcons.js +16 -0
  25. package/lib/components/atoms/PersonaCard/PersonaIcons.js.map +1 -0
  26. package/lib/components/atoms/PersonaCard/PersonaRow.d.ts +54 -0
  27. package/lib/components/atoms/PersonaCard/PersonaRow.d.ts.map +1 -0
  28. package/lib/components/atoms/PersonaCard/PersonaRow.js +116 -0
  29. package/lib/components/atoms/PersonaCard/PersonaRow.js.map +1 -0
  30. package/lib/components/atoms/Suggestions/ISuggestion.d.ts +14 -0
  31. package/lib/components/atoms/Suggestions/ISuggestion.d.ts.map +1 -0
  32. package/lib/components/atoms/Suggestions/ISuggestion.js +5 -0
  33. package/lib/components/atoms/Suggestions/ISuggestion.js.map +1 -0
  34. package/lib/components/atoms/Suggestions/SuggestionsSample-Labels.d.ts +17 -0
  35. package/lib/components/atoms/Suggestions/SuggestionsSample-Labels.d.ts.map +1 -0
  36. package/lib/components/atoms/Suggestions/SuggestionsSample-Labels.js +89 -0
  37. package/lib/components/atoms/Suggestions/SuggestionsSample-Labels.js.map +1 -0
  38. package/lib/components/atoms/Suggestions/convertSugsLC.d.ts +10 -0
  39. package/lib/components/atoms/Suggestions/convertSugsLC.d.ts.map +1 -0
  40. package/lib/components/atoms/Suggestions/convertSugsLC.js +18 -0
  41. package/lib/components/atoms/Suggestions/convertSugsLC.js.map +1 -0
  42. package/lib/components/atoms/Suggestions/getSuggestionsByKeys.d.ts +7 -0
  43. package/lib/components/atoms/Suggestions/getSuggestionsByKeys.d.ts.map +1 -0
  44. package/lib/components/atoms/Suggestions/getSuggestionsByKeys.js +37 -0
  45. package/lib/components/atoms/Suggestions/getSuggestionsByKeys.js.map +1 -0
  46. package/lib/components/atoms/WordSummary/IWordSummary.d.ts +19 -0
  47. package/lib/components/atoms/WordSummary/IWordSummary.d.ts.map +1 -0
  48. package/lib/components/atoms/WordSummary/IWordSummary.js +2 -0
  49. package/lib/components/atoms/WordSummary/IWordSummary.js.map +1 -0
  50. package/lib/components/atoms/WordSummary/buildWordSummary.d.ts +5 -0
  51. package/lib/components/atoms/WordSummary/buildWordSummary.d.ts.map +1 -0
  52. package/lib/components/atoms/WordSummary/buildWordSummary.js +67 -0
  53. package/lib/components/atoms/WordSummary/buildWordSummary.js.map +1 -0
  54. package/lib/components/molecules/ModernPages/Interfaces/IModernPage.d.ts +25 -0
  55. package/lib/components/molecules/ModernPages/Interfaces/IModernPage.d.ts.map +1 -0
  56. package/lib/components/molecules/ModernPages/Interfaces/IModernPage.js +13 -0
  57. package/lib/components/molecules/ModernPages/Interfaces/IModernPage.js.map +1 -0
  58. package/lib/components/molecules/SearchPage/Interfaces/ISourceSearch.d.ts +1 -0
  59. package/lib/components/molecules/SearchPage/Interfaces/ISourceSearch.d.ts.map +1 -1
  60. package/lib/components/molecules/SearchPage/component/SearchBoxRow.d.ts +18 -0
  61. package/lib/components/molecules/SearchPage/component/SearchBoxRow.d.ts.map +1 -0
  62. package/lib/components/molecules/SearchPage/component/SearchBoxRow.js +25 -0
  63. package/lib/components/molecules/SearchPage/component/SearchBoxRow.js.map +1 -0
  64. package/lib/components/molecules/SearchPage/functions/getFilteredV1.d.ts +20 -0
  65. package/lib/components/molecules/SearchPage/functions/getFilteredV1.d.ts.map +1 -0
  66. package/lib/components/molecules/SearchPage/functions/getFilteredV1.js +127 -0
  67. package/lib/components/molecules/SearchPage/functions/getFilteredV1.js.map +1 -0
  68. package/lib/components/molecules/SourceList/ItemPane/IItemPaneProps.d.ts +30 -0
  69. package/lib/components/molecules/SourceList/ItemPane/IItemPaneProps.d.ts.map +1 -0
  70. package/lib/components/molecules/SourceList/ItemPane/IItemPaneProps.js +2 -0
  71. package/lib/components/molecules/SourceList/ItemPane/IItemPaneProps.js.map +1 -0
  72. package/lib/components/molecules/SourceList/ItemPane/component.d.ts +36 -0
  73. package/lib/components/molecules/SourceList/ItemPane/component.d.ts.map +1 -0
  74. package/lib/components/molecules/SourceList/ItemPane/component.js +263 -0
  75. package/lib/components/molecules/SourceList/ItemPane/component.js.map +1 -0
  76. package/lib/logic/Strings/getWordsFromString.d.ts +1 -0
  77. package/lib/logic/Strings/getWordsFromString.d.ts.map +1 -1
  78. package/lib/logic/Strings/getWordsFromString.js +12 -5
  79. package/lib/logic/Strings/getWordsFromString.js.map +1 -1
  80. package/lib/logic/Time/getFPSPrefNavLang.js +1 -1
  81. package/lib/logic/Time/getFPSPrefNavLang.js.map +1 -1
  82. package/lib/pnpjs/SourceItems/Interface.d.ts +3 -0
  83. package/lib/pnpjs/SourceItems/Interface.d.ts.map +1 -1
  84. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,12 +5,25 @@ npm run build
5
5
  npm version major/minor/patch
6
6
  npm publish --access=public
7
7
 
8
- npm install @mikezimm/fps-library-v2@1.0.148
8
+ npm install @mikezimm/fps-library-v2@1.0.149
9
9
 
10
10
  # Changelog
11
11
 
12
12
  NOTE: TURN BACK ON STRICT NULL CHECKS - turned off for PropPaneCols
13
13
 
14
+ ## 1.0.149 - 2023-Mar-28: PersonaCard, PersonaRow, Suggestions, WordSummary, SourceSearchHook etc from Compliance and ALVFM
15
+ - add PersonaCard and PersonaRow from Compliance to src\components\atoms\PersonaCard <<< NEED TO VERIFY >>>
16
+ - add Suggestions logic, interface and samples from Compliance to src\components\atoms\Suggestions <<< NEED TO VERIFY >>>
17
+ - add WordSummary from Compliance to src\components\atoms\WordSummary\ <<< NEED TO VERIFY >>>
18
+ - add getWordsFromString and related functions from Compliance to src\logic\Strings\getWordsFromString
19
+ - add SourceSearchHook from Complaince to src\components\molecules\SearchPage\component\SearchBoxRow
20
+ - add ISourceInfo from Compliance to src\pnpjs\SourceItems\Interface
21
+ - add getFiltered from Compliance to src\components\molecules\SearchPage\functions\getFilteredV1
22
+ - add SourceList ItemPane from ALVFinMan to src\components\molecules\SourceList\ItemPane\component
23
+
24
+ ## 1.0.149 - 2023-Mar-26: month date labels and pref language
25
+ - fix casing of return in getFPSPrefNavLang since all are supposed to be LC.
26
+
14
27
  ## 1.0.148 - 2023-Mar-26: month date labels and pref language
15
28
  - add getMonthStr3Array, getMMMDDFromDate and getMMMDDFromStr to src\logic\Time\monthLabels.ts
16
29
  - add getMonthStrArray, getFullMonthStrFromDate and getFullMonthStrFromDate to src\logic\Time\monthStrings.ts
@@ -0,0 +1,11 @@
1
+ import { WebPartContext } from "@microsoft/sp-webpart-base";
2
+ import { IUserProperties } from "./IUserProperties";
3
+ import { PersonaSize } from 'office-ui-fabric-react/lib/Persona';
4
+ export interface IPersonaCardProps {
5
+ context: WebPartContext;
6
+ profileProperties: IUserProperties;
7
+ size: PersonaSize;
8
+ iconSize: number;
9
+ iconTextSize: number;
10
+ }
11
+ //# sourceMappingURL=IPersonaCardProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPersonaCardProps.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,iBAAiB,EAAE,eAAe,CAAC;IAEnC,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IPersonaCardProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPersonaCardProps.js","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IPersonaCardProps.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface IPersonaCardState {
2
+ livePersonaCard: any;
3
+ pictureUrl: string;
4
+ }
5
+ //# sourceMappingURL=IPersonaCardState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPersonaCardState.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IPersonaCardState.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAEhC,eAAe,EAAE,GAAG,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IPersonaCardState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IPersonaCardState.js","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IPersonaCardState.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ export interface IUserProperties {
2
+ Department: string;
3
+ MobilePhone?: string;
4
+ PictureUrl: string;
5
+ Title: string;
6
+ DisplayName: string;
7
+ Email: string;
8
+ WorkPhone?: string;
9
+ Location?: string;
10
+ isSiteAdmin?: boolean;
11
+ isGuest?: boolean;
12
+ }
13
+ //# sourceMappingURL=IUserProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IUserProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IUserProperties.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IUserProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IUserProperties.js","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/IUserProperties.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export declare const SiteAdminGroupName = "SiteAdmins";
2
+ export declare const SiteAdminIconName = "HeadsetSolid";
3
+ export declare const GuestsGroupName = "Guests";
4
+ export declare const GuestsIconName = "UserWarning";
5
+ //# sourceMappingURL=StandardPersonIconNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardPersonIconNames.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAC/C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export const SiteAdminGroupName = 'SiteAdmins';
2
+ export const SiteAdminIconName = 'HeadsetSolid';
3
+ export const GuestsGroupName = 'Guests';
4
+ export const GuestsIconName = 'UserWarning';
5
+ //# sourceMappingURL=StandardPersonIconNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardPersonIconNames.js","sourceRoot":"","sources":["../../../../../src/components/atoms/PersonaCard/Interfaces/StandardPersonIconNames.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC"}
@@ -0,0 +1,57 @@
1
+ import * as React from 'react';
2
+ import { IPersonaCardProps } from './Interfaces/IPersonaCardProps';
3
+ import { IPersonaCardState } from './Interfaces/IPersonaCardState';
4
+ /**
5
+ * 2023-03-28
6
+ * VERIFY STYLES BEFORE USING IN PRODUCTION
7
+ * Migrated scss back to css from Complaince/PivotTiles
8
+ */
9
+ export declare class PersonaCard extends React.Component<IPersonaCardProps, IPersonaCardState> {
10
+ constructor(props: IPersonaCardProps);
11
+ /**
12
+ *
13
+ *
14
+ * @memberof PersonaCard
15
+ */
16
+ componentDidMount(): Promise<void>;
17
+ /**
18
+ *
19
+ *
20
+ * @param {IPersonaCardProps} prevProps
21
+ * @param {IPersonaCardState} prevState
22
+ * @memberof PersonaCard
23
+ */
24
+ componentDidUpdate(prevProps: IPersonaCardProps, prevState: IPersonaCardState): void;
25
+ /**
26
+ *
27
+ *
28
+ * @private
29
+ * @returns
30
+ * @memberof PersonaCard
31
+ */
32
+ private _LivePersonaCard;
33
+ private getCardHeight;
34
+ private getCardPadding;
35
+ private getCardWidth;
36
+ /**
37
+ *
38
+ *
39
+ * @private
40
+ * @returns {JSX.Element}
41
+ * @memberof PersonaCard
42
+ */
43
+ private _PersonaCard;
44
+ /**
45
+ * Load SPFx component by id, SPComponentLoader is used to load the SPFx components
46
+ * @param componentId - componentId, guid of the component library
47
+ */
48
+ private _loadSPComponentById;
49
+ /**
50
+ *
51
+ *
52
+ * @returns {React.ReactElement<IPersonaCardProps>}
53
+ * @memberof PersonaCard
54
+ */
55
+ render(): React.ReactElement<IPersonaCardProps>;
56
+ }
57
+ //# sourceMappingURL=PersonaCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaCard.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAkBnE;;;;GAIG;AAEH,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAC9C,iBAAiB,EACjB,iBAAiB,CAChB;gBACW,KAAK,EAAE,iBAAiB;IAKpC;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/C;;;;;;OAMG;IACI,kBAAkB,CACvB,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,iBAAiB,GAC3B,IAAI;IAGP;;;;;;OAMG;IAEH,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,aAAa;IAkBnB,OAAO,CAAC,cAAc;IAkBxB,OAAO,CAAC,YAAY;IAoBpB;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAuFpB;;;OAGG;YAEW,oBAAoB;IAelC;;;;;OAKG;IACI,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC;CAevD"}
@@ -0,0 +1,233 @@
1
+ import * as React from 'react';
2
+ import { Log, Environment, EnvironmentType, } from '@microsoft/sp-core-library';
3
+ import { SPComponentLoader } from '@microsoft/sp-loader';
4
+ import { Persona, PersonaSize } from 'office-ui-fabric-react/lib/Persona';
5
+ import { DocumentCard, DocumentCardType } from 'office-ui-fabric-react/lib/DocumentCard';
6
+ import { Icon } from 'office-ui-fabric-react/lib/Icon';
7
+ require('@mikezimm/fps-styles/dist/PersonaCard.css');
8
+ import { GuestsIconName, SiteAdminIconName, } from './Interfaces/StandardPersonIconNames';
9
+ const EXP_SOURCE = 'SPFxDirectory';
10
+ const LIVE_PERSONA_COMPONENT_ID = '914330ee-2df2-4f6e-a858-30c23a812408';
11
+ /**
12
+ * 2023-03-28
13
+ * VERIFY STYLES BEFORE USING IN PRODUCTION
14
+ * Migrated scss back to css from Complaince/PivotTiles
15
+ */
16
+ export class PersonaCard extends React.Component {
17
+ constructor(props) {
18
+ super(props);
19
+ this.state = { livePersonaCard: undefined, pictureUrl: undefined };
20
+ }
21
+ /**
22
+ *
23
+ *
24
+ * @memberof PersonaCard
25
+ */
26
+ async componentDidMount() {
27
+ if (Environment.type !== EnvironmentType.Local) {
28
+ const sharedLibrary = await this._loadSPComponentById(LIVE_PERSONA_COMPONENT_ID);
29
+ const livePersonaCard = sharedLibrary.LivePersonaCard;
30
+ this.setState({ livePersonaCard: livePersonaCard });
31
+ }
32
+ }
33
+ /**
34
+ *
35
+ *
36
+ * @param {IPersonaCardProps} prevProps
37
+ * @param {IPersonaCardState} prevState
38
+ * @memberof PersonaCard
39
+ */
40
+ componentDidUpdate(prevProps, prevState) {
41
+ }
42
+ /**
43
+ *
44
+ *
45
+ * @private
46
+ * @returns
47
+ * @memberof PersonaCard
48
+ */
49
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
50
+ _LivePersonaCard() {
51
+ return React.createElement(this.state.livePersonaCard, {
52
+ serviceScope: this.props.context.serviceScope,
53
+ upn: this.props.profileProperties.Email,
54
+ onCardOpen: () => {
55
+ console.log('LivePersonaCard Open');
56
+ },
57
+ onCardClose: () => {
58
+ console.log('LivePersonaCard Close');
59
+ },
60
+ }, this._PersonaCard());
61
+ }
62
+ //2020-11-24: Added for adjusting card size
63
+ getCardHeight() {
64
+ const size = this.props.size;
65
+ if (size === PersonaSize.size72) {
66
+ return '120px';
67
+ }
68
+ else if (size === PersonaSize.size48) {
69
+ return '80px';
70
+ }
71
+ else if (size === PersonaSize.size32) {
72
+ return '60px';
73
+ }
74
+ else if (size === PersonaSize.size24 || size === PersonaSize.size28) {
75
+ return '45px';
76
+ }
77
+ else if (size === PersonaSize.size16) {
78
+ return '30px';
79
+ }
80
+ else if (size === PersonaSize.size10) {
81
+ return '20px';
82
+ }
83
+ }
84
+ //2021-04-13: Added for adjusting card size
85
+ getCardPadding() {
86
+ const size = this.props.size;
87
+ if (size === PersonaSize.size72) {
88
+ return '15px';
89
+ }
90
+ else if (size === PersonaSize.size48) {
91
+ return '11px';
92
+ }
93
+ else if (size === PersonaSize.size32) {
94
+ return '8px';
95
+ }
96
+ else if (size === PersonaSize.size24 || size === PersonaSize.size28) {
97
+ return '7px';
98
+ }
99
+ else if (size === PersonaSize.size16) {
100
+ return '0px';
101
+ }
102
+ else if (size === PersonaSize.size10) {
103
+ return '0px';
104
+ }
105
+ }
106
+ //2020-11-24: Added for adjusting card size
107
+ getCardWidth() {
108
+ const size = this.props.size;
109
+ let width = this.props.profileProperties.isSiteAdmin === true || this.props.profileProperties.isGuest === true ? 60 : 0;
110
+ if (size === PersonaSize.size72) {
111
+ width += 250;
112
+ }
113
+ else if (size === PersonaSize.size48) {
114
+ width += 210;
115
+ }
116
+ else if (size === PersonaSize.size32) {
117
+ width += 170;
118
+ }
119
+ else if (size === PersonaSize.size24 || size === PersonaSize.size28) {
120
+ width += 140;
121
+ }
122
+ else if (size === PersonaSize.size16) {
123
+ width += 120;
124
+ }
125
+ else if (size === PersonaSize.size10) {
126
+ width += 100;
127
+ }
128
+ return width + 'px';
129
+ }
130
+ /**
131
+ *
132
+ *
133
+ * @private
134
+ * @returns {JSX.Element}
135
+ * @memberof PersonaCard
136
+ */
137
+ _PersonaCard() {
138
+ const sizeBracket = this.props.size === PersonaSize.size16 || this.props.size === PersonaSize.size10 ? 'small' : 'large';
139
+ let docCardClass = 'documentCardDefault';
140
+ if (this.props.profileProperties.isSiteAdmin === true) {
141
+ docCardClass = 'documentCardAdmin';
142
+ }
143
+ else if (this.props.profileProperties.isGuest === true) {
144
+ docCardClass = 'documentCardGuest';
145
+ }
146
+ const docCardClassFinal = [docCardClass, sizeBracket === 'large' ? 'documentCardBorder' : 'documentCardNoBorder'].join(' ');
147
+ const iconSize = this.props.iconSize;
148
+ const iconTextSize = this.props.iconTextSize;
149
+ const iconLeftPad = sizeBracket === 'large' ? '0px' : '20px';
150
+ const AdminIcon = this.props.profileProperties.isSiteAdmin !== true ? false :
151
+ React.createElement("div", { style: { fontSize: iconSize, color: 'darkgreen', paddingLeft: iconLeftPad, paddingRight: 10, whiteSpace: 'nowrap' } },
152
+ React.createElement(Icon, { iconName: SiteAdminIconName, title: 'Site Admin' }),
153
+ React.createElement("span", { style: { fontSize: iconTextSize } }, "Admin"));
154
+ const GuestIcon = this.props.profileProperties.isGuest !== true ? false :
155
+ React.createElement("div", { style: { fontSize: iconSize, color: 'saddlebrown', paddingLeft: iconLeftPad, paddingRight: 4, whiteSpace: 'nowrap' } },
156
+ React.createElement(Icon, { iconName: GuestsIconName, title: 'Guest User' }),
157
+ React.createElement("span", { style: { fontSize: iconTextSize } }, "Guest"));
158
+ const cardHeight = this.getCardHeight();
159
+ let personaStyles = 'inlineFlex';
160
+ if (cardHeight !== '120px' && (AdminIcon !== false || GuestIcon !== false)) {
161
+ personaStyles = 'inlineFlexWBPadding';
162
+ }
163
+ const personaClass = ['persona', sizeBracket === 'small' ? 'flexDirRow' : null].join(' ');
164
+ let personaContent = null;
165
+ if (sizeBracket === 'small') {
166
+ personaContent = React.createElement("div", { className: 'inlineFlexSpaceBetween' },
167
+ this.props.profileProperties.DisplayName,
168
+ " ",
169
+ AdminIcon,
170
+ " ",
171
+ GuestIcon,
172
+ " ");
173
+ }
174
+ else {
175
+ personaContent = React.createElement(Persona, { text: this.props.profileProperties.DisplayName, secondaryText: this.props.profileProperties.Title, tertiaryText: this.props.profileProperties.Department, imageUrl: this.props.profileProperties.PictureUrl, size: this.props.size, imageShouldFadeIn: true, imageShouldStartVisible: true },
176
+ " ",
177
+ React.createElement("div", { className: personaStyles },
178
+ " ",
179
+ AdminIcon,
180
+ " ",
181
+ GuestIcon,
182
+ " "),
183
+ this.props.profileProperties.WorkPhone ? (React.createElement("div", null,
184
+ React.createElement(Icon, { iconName: "Phone", style: { fontSize: '12px' } }),
185
+ React.createElement("span", { style: { marginLeft: 5, fontSize: '12px' } },
186
+ ' ',
187
+ this.props.profileProperties.WorkPhone))) : (''),
188
+ this.props.profileProperties.Location ? (React.createElement("div", { className: 'textOverflow' },
189
+ React.createElement(Icon, { iconName: "Poi", style: { fontSize: '12px' } }),
190
+ React.createElement("span", { style: { marginLeft: 5, fontSize: '12px' } },
191
+ ' ',
192
+ this.props.profileProperties.Location))) : (''));
193
+ }
194
+ return (React.createElement(DocumentCard, { className: docCardClassFinal, type: DocumentCardType.normal,
195
+ //2020-11-24: Added for adjusting card size
196
+ style: { height: this.getCardHeight(), minWidth: this.getCardWidth(), maxWidth: this.getCardWidth() + 200 } },
197
+ React.createElement("div", { className: personaClass, style: { paddingTop: this.getCardPadding(), paddingBottom: this.getCardPadding(), minWidth: this.getCardWidth(), maxWidth: this.getCardWidth() + 200 } }, personaContent)));
198
+ }
199
+ /**
200
+ * Load SPFx component by id, SPComponentLoader is used to load the SPFx components
201
+ * @param componentId - componentId, guid of the component library
202
+ */
203
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
204
+ async _loadSPComponentById(componentId) {
205
+ try {
206
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
207
+ const component = await SPComponentLoader.loadComponentById(componentId);
208
+ return component;
209
+ }
210
+ catch (error) {
211
+ // eslint-disable-next-line no-void
212
+ void Promise.reject(error);
213
+ // 2023-03-28: To migrate casting serviceScope as any to pass linting
214
+ Log.error(EXP_SOURCE, error, this.props.context.serviceScope);
215
+ }
216
+ }
217
+ /**
218
+ *
219
+ *
220
+ * @returns {React.ReactElement<IPersonaCardProps>}
221
+ * @memberof PersonaCard
222
+ */
223
+ render() {
224
+ const sizeBracket = this.props.size === PersonaSize.size16 || this.props.size === PersonaSize.size10 ? 'small' : 'large';
225
+ const personaContainer = sizeBracket === 'large' ? 'personaContainerNormal' : 'personaContainerSmall';
226
+ return (
227
+ //2020-11-24: Added for adjusting card size
228
+ React.createElement("div", { className: personaContainer, style: { minWidth: this.getCardWidth(), maxWidth: this.getCardWidth() + 200 } }, this.state.livePersonaCard
229
+ ? this._LivePersonaCard()
230
+ : this._PersonaCard()));
231
+ }
232
+ }
233
+ //# sourceMappingURL=PersonaCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaCard.tsx"],"names":[],"mappings":"AAAA,OA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BAAgB,EAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,GAAG,GAAG,EAAC,IAE7G,IAAI,CAAC,KAAK,CAAC,eAAe;YACzB,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CACnB,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare function getAdminIcon(iconSize: number, iconLeftPad: string, iconTextSize: number): JSX.Element;
3
+ export declare function getGuestIcon(iconSize: number, iconLeftPad: string, iconTextSize: number): JSX.Element;
4
+ //# sourceMappingURL=PersonaIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaIcons.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaIcons.tsx"],"names":[],"mappings":";AAMA,wBAAgB,YAAY,CAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAI,GAAG,CAAC,OAAO,CAMvG;AAED,wBAAgB,YAAY,CAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAI,GAAG,CAAC,OAAO,CAMvG"}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { Icon, } from 'office-ui-fabric-react/lib/Icon';
3
+ import { GuestsIconName, SiteAdminIconName, } from './Interfaces/StandardPersonIconNames';
4
+ export function getAdminIcon(iconSize, iconLeftPad, iconTextSize) {
5
+ const AdminIcon = React.createElement("div", { style: { fontSize: iconSize, color: 'darkgreen', paddingLeft: iconLeftPad, paddingRight: 10, whiteSpace: 'nowrap' } },
6
+ React.createElement(Icon, { iconName: SiteAdminIconName, title: 'Site Admin' }),
7
+ React.createElement("span", { style: { fontSize: iconTextSize } }, "Admin"));
8
+ return AdminIcon;
9
+ }
10
+ export function getGuestIcon(iconSize, iconLeftPad, iconTextSize) {
11
+ const GuestIcon = React.createElement("div", { style: { fontSize: iconSize, color: 'saddlebrown', paddingLeft: iconLeftPad, paddingRight: 4, whiteSpace: 'nowrap' } },
12
+ React.createElement(Icon, { iconName: GuestsIconName, title: 'Guest User' }),
13
+ React.createElement("span", { style: { fontSize: iconTextSize } }, "Guest"));
14
+ return GuestIcon;
15
+ }
16
+ //# sourceMappingURL=PersonaIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaIcons.js","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,GAAG,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,iBAAiB,GAAG,MAAM,sCAAsC,CAAC;AAE1F,MAAM,UAAU,YAAY,CAAE,QAAgB,EAAE,WAAmB,EAAE,YAAoB;IACrF,MAAM,SAAS,GAAG,6BAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAG,KAAK,EAAE,WAAW,EAAG,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;QAC1I,oBAAC,IAAI,IAAC,QAAQ,EAAG,iBAAiB,EAAG,KAAK,EAAE,YAAY,GAAI;QAC5D,8BAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAc,CACjD,CAAC;IACP,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,YAAY,CAAE,QAAgB,EAAE,WAAmB,EAAE,YAAoB;IACvF,MAAM,SAAS,GAAG,6BAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAG,KAAK,EAAE,aAAa,EAAG,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE;QACzI,oBAAC,IAAI,IAAC,QAAQ,EAAG,cAAc,EAAG,KAAK,EAAE,YAAY,GAAI;QACzD,8BAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAc,CACjD,CAAC;IACP,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import * as React from 'react';
2
+ import { IPersonaCardProps } from './Interfaces/IPersonaCardProps';
3
+ import { IPersonaCardState } from './Interfaces/IPersonaCardState';
4
+ /**
5
+ * 2023-03-28
6
+ * VERIFY STYLES BEFORE USING IN PRODUCTION
7
+ * Migrated scss back to css from Complaince/PivotTiles
8
+ */
9
+ export declare class PersonaRow extends React.Component<IPersonaCardProps, IPersonaCardState> {
10
+ constructor(props: IPersonaCardProps);
11
+ /**
12
+ *
13
+ *
14
+ * @memberof PersonaRow
15
+ */
16
+ componentDidMount(): Promise<void>;
17
+ /**
18
+ *
19
+ *
20
+ * @param {IPersonaCardProps} prevProps
21
+ * @param {IPersonaCardState} prevState
22
+ * @memberof PersonaRow
23
+ */
24
+ componentDidUpdate(prevProps: IPersonaCardProps, prevState: IPersonaCardState): void;
25
+ /**
26
+ *
27
+ *
28
+ * @private
29
+ * @returns
30
+ * @memberof PersonaRow
31
+ */
32
+ private _LivePersonaCard;
33
+ /**
34
+ *
35
+ *
36
+ * @private
37
+ * @returns {JSX.Element}
38
+ * @memberof PersonaCard
39
+ */
40
+ private _PersonaRow;
41
+ /**
42
+ * Load SPFx component by id, SPComponentLoader is used to load the SPFx components
43
+ * @param componentId - componentId, guid of the component library
44
+ */
45
+ private _loadSPComponentById;
46
+ /**
47
+ *
48
+ *
49
+ * @returns {React.ReactElement<IPersonaCardProps>}
50
+ * @memberof PersonaCard
51
+ */
52
+ render(): React.ReactElement<IPersonaCardProps>;
53
+ }
54
+ //# sourceMappingURL=PersonaRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaRow.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAmBnE;;;;GAIG;AAEH,qBAAa,UAAW,SAAQ,KAAK,CAAC,SAAS,CAC7C,iBAAiB,EACjB,iBAAiB,CAChB;gBACW,KAAK,EAAE,iBAAiB;IAKpC;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAW/C;;;;;;OAMG;IACI,kBAAkB,CACvB,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,iBAAiB,GAC3B,IAAI;IAIP;;;;;;OAMG;IAEH,OAAO,CAAC,gBAAgB;IAiBxB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAwBnB;;;OAGG;YAEW,oBAAoB;IAelC;;;;;OAKG;IACI,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC;CAavD"}
@@ -0,0 +1,116 @@
1
+ import * as React from 'react';
2
+ import { Log, Environment, EnvironmentType, } from '@microsoft/sp-core-library';
3
+ import { SPComponentLoader } from '@microsoft/sp-loader';
4
+ import { DocumentCard, DocumentCardType, } from 'office-ui-fabric-react/lib/DocumentCard';
5
+ import { getAdminIcon, getGuestIcon } from './PersonaIcons';
6
+ require('@mikezimm/fps-styles/dist/PersonaRow.css');
7
+ const EXP_SOURCE = 'SPFxDirectory';
8
+ const LIVE_PERSONA_COMPONENT_ID = '914330ee-2df2-4f6e-a858-30c23a812408';
9
+ /**
10
+ * 2023-03-28
11
+ * VERIFY STYLES BEFORE USING IN PRODUCTION
12
+ * Migrated scss back to css from Complaince/PivotTiles
13
+ */
14
+ export class PersonaRow extends React.Component {
15
+ constructor(props) {
16
+ super(props);
17
+ this.state = { livePersonaCard: undefined, pictureUrl: undefined };
18
+ }
19
+ /**
20
+ *
21
+ *
22
+ * @memberof PersonaRow
23
+ */
24
+ async componentDidMount() {
25
+ if (Environment.type !== EnvironmentType.Local) {
26
+ const sharedLibrary = await this._loadSPComponentById(LIVE_PERSONA_COMPONENT_ID);
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ const livePersonaCard = sharedLibrary.LivePersonaCard;
29
+ this.setState({ livePersonaCard: livePersonaCard });
30
+ }
31
+ }
32
+ /**
33
+ *
34
+ *
35
+ * @param {IPersonaCardProps} prevProps
36
+ * @param {IPersonaCardState} prevState
37
+ * @memberof PersonaRow
38
+ */
39
+ componentDidUpdate(prevProps, prevState) {
40
+ //
41
+ }
42
+ /**
43
+ *
44
+ *
45
+ * @private
46
+ * @returns
47
+ * @memberof PersonaRow
48
+ */
49
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
50
+ _LivePersonaCard() {
51
+ return React.createElement(this.state.livePersonaCard, {
52
+ serviceScope: this.props.context.serviceScope,
53
+ upn: this.props.profileProperties.Email,
54
+ onCardOpen: () => {
55
+ console.log('LivePersonaCard Open');
56
+ },
57
+ onCardClose: () => {
58
+ console.log('LivePersonaCard Close');
59
+ },
60
+ }, this._PersonaRow());
61
+ }
62
+ /**
63
+ *
64
+ *
65
+ * @private
66
+ * @returns {JSX.Element}
67
+ * @memberof PersonaCard
68
+ */
69
+ _PersonaRow() {
70
+ const AdminIcon = this.props.profileProperties.isSiteAdmin !== true ? false : getAdminIcon(this.props.iconSize, '20px', this.props.iconTextSize);
71
+ const GuestIcon = this.props.profileProperties.isGuest !== true ? false : getGuestIcon(this.props.iconSize, '20px', this.props.iconTextSize);
72
+ const personaContent = React.createElement("div", { className: 'inlineFlexSpaceBetween' },
73
+ this.props.profileProperties.DisplayName,
74
+ " ",
75
+ AdminIcon,
76
+ " ",
77
+ GuestIcon,
78
+ " ");
79
+ const personaClass = ['persona'].join(' ');
80
+ return (React.createElement(DocumentCard, { className: 'docCardRow', type: DocumentCardType.normal, style: {} },
81
+ React.createElement("div", { className: personaClass, style: {} }, personaContent)));
82
+ }
83
+ /**
84
+ * Load SPFx component by id, SPComponentLoader is used to load the SPFx components
85
+ * @param componentId - componentId, guid of the component library
86
+ */
87
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
+ async _loadSPComponentById(componentId) {
89
+ try {
90
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
91
+ const component = await SPComponentLoader.loadComponentById(componentId);
92
+ return component;
93
+ }
94
+ catch (error) {
95
+ // eslint-disable-next-line no-void
96
+ void Promise.reject(error);
97
+ // 2023-03-28: To migrate casting serviceScope as any to pass linting
98
+ Log.error(EXP_SOURCE, error, this.props.context.serviceScope);
99
+ }
100
+ }
101
+ /**
102
+ *
103
+ *
104
+ * @returns {React.ReactElement<IPersonaCardProps>}
105
+ * @memberof PersonaCard
106
+ */
107
+ render() {
108
+ const personaContainer = 'personaContainerSmall';
109
+ return (
110
+ //2020-11-24: Added for adjusting card size
111
+ React.createElement("div", { className: personaContainer, style: {} }, this.state.livePersonaCard
112
+ ? this._LivePersonaCard()
113
+ : this._PersonaRow()));
114
+ }
115
+ }
116
+ //# sourceMappingURL=PersonaRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonaRow.js","sourceRoot":"","sources":["../../../../src/components/atoms/PersonaCard/PersonaRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,GAAG,EAAE,WAAW,EAAE,eAAe,GAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,YAAY,EACZ,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,CAAC,0CAA0C,CAAC,CAAC;AAEpD,MAAM,UAAU,GAAW,eAAe,CAAC;AAC3C,MAAM,yBAA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