jitz-sharepoint-utilities 2.0.5 → 2.0.6

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.
@@ -1,5 +1,5 @@
1
1
  export default class UtilityService {
2
- static setCookie: (name: string, val: string, validMinutes?: number) => void;
2
+ static setCookie: (name: string, val: string, validMilliSeconds?: number) => void;
3
3
  static getCookie: (name: string) => string | undefined;
4
4
  static deleteCookie: (name: string) => void;
5
5
  static formatDate: (date: Date) => string;
@@ -25,4 +25,5 @@ export default class UtilityService {
25
25
  static LightenDarkenColor: (col: string, amt: number) => string;
26
26
  static getProfilePictureUrl: (siteUrl: string, email: string, apiType?: string, size?: string) => string;
27
27
  static getRandomColorCode: () => string;
28
+ static transparentize(value: string, opacity: number): string;
28
29
  }
@@ -1,18 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var sp_core_library_1 = require("@microsoft/sp-core-library");
4
+ var color_1 = require("@kurkle/color");
4
5
  var XLSX = require("xlsx");
5
6
  var UtilityService = /** @class */ (function () {
6
7
  function UtilityService() {
7
8
  }
9
+ UtilityService.transparentize = function (value, opacity) {
10
+ var alpha = opacity === undefined ? 0.5 : 1 - opacity;
11
+ return (0, color_1.default)(value).alpha(alpha).rgbString();
12
+ };
8
13
  var _a;
9
14
  _a = UtilityService;
10
- UtilityService.setCookie = function (name, val, validMinutes) {
11
- if (validMinutes === void 0) { validMinutes = 604800000; }
15
+ UtilityService.setCookie = function (name, val, validMilliSeconds) {
16
+ if (validMilliSeconds === void 0) { validMilliSeconds = 604800000; }
12
17
  var date = new Date();
13
18
  var value = val;
14
19
  // Set it expire in 7 days
15
- date.setTime(date.getTime() + validMinutes);
20
+ date.setTime(date.getTime() + validMilliSeconds);
16
21
  // Set it
17
22
  document.cookie =
18
23
  name + "=" + value + "; expires=" + date.toUTCString() + "; path=/";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jitz-sharepoint-utilities",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Essential SharePoint utilities for SharePoint Add-in and SPFx development",
5
5
  "author": "Jithendra Mani",
6
6
  "license": "ISC",
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@fluentui/react": "^8.106.4",
14
+ "@kurkle/color": "^0.3.4",
14
15
  "@microsoft/sp-core-library": "^1.19.0",
15
16
  "@microsoft/sp-lodash-subset": "^1.19.0",
16
17
  "@microsoft/sp-office-ui-fabric-core": "^1.19.0",