@dvrd/dvr-controls 1.1.27 → 1.1.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "1.1.27",
3
+ "version": "1.1.29",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -10,9 +10,6 @@
10
10
  "type": "git",
11
11
  "url": "https://bitbucket.org/Naampie/dvr-controls/"
12
12
  },
13
- "scripts": {
14
- "build": "npm publish"
15
- },
16
13
  "author": "Dave van Rijn",
17
14
  "license": "ISC",
18
15
  "browserslist": {
@@ -224,7 +224,7 @@ export default class PDFTemplateCreator extends PureComponent<Props, State> {
224
224
  ref: (ref: any) => {
225
225
  this.refObjects[id] = ref;
226
226
  },
227
- defaultSettings: {...config.dimensions, ...config.options},
227
+ defaultSettings: {...config.dimensions, ...config.options, sub_type: config.sub_type},
228
228
  key,
229
229
  }
230
230
  let element = <div/>;
@@ -198,6 +198,7 @@ export default class PdfText extends PdfElement<Props, State> {
198
198
  type: PDFElementType.TEXT,
199
199
  options: {fontSize: fontSize, bold, italic, text, underline, alignment, font, color, persistent, display},
200
200
  linkedID: linkedID,
201
+ sub_type: settings.sub_type,
201
202
  };
202
203
  }
203
204
 
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) 2024. Dave van Rijn Development
3
3
  */
4
4
 
5
- import Cookies, {CookieAttributes} from "js-cookie";
5
+ import Cookies from "js-cookie";
6
6
 
7
- export const setCookie = (key: string, value: string, args?: CookieAttributes) => {
7
+ export const setCookie = (key: string, value: string, args?: Cookies.CookieAttributes) => {
8
8
  Cookies.set(key, value, {...args})
9
9
  }
10
10
 
11
- export const removeCookie = (key: string, args?: CookieAttributes) => {
11
+ export const removeCookie = (key: string, args?: Cookies.CookieAttributes) => {
12
12
  Cookies.remove(key, args);
13
13
  };
14
14
 
@@ -191,6 +191,7 @@ export type DefaultPDFElementParams<T extends PDFElementType, O extends IndexedO
191
191
  persistent?: PDFElementPersist;
192
192
  key: string;
193
193
  linkedID?: string;
194
+ sub_type?: PDFElementSubType | null;
194
195
  }>
195
196
  export type PDFImageParams = {
196
197
  img: File | string | null;
@@ -210,6 +211,7 @@ export type PDFTextParams = {
210
211
  color: string;
211
212
  persistent: PDFElementPersist;
212
213
  display?: PDFDisplay
214
+ sub_type?: PDFElementSubType | null;
213
215
  };
214
216
  export type PDFInvoiceTableParams = {
215
217
  fontSize: number;
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2024. Dave van Rijn Development
3
3
  */
4
4
 
5
- import Cookies, {CookieAttributes} from "js-cookie";
6
- import {debug, getSetting} from "./miscUtil";
5
+ import Cookies from "js-cookie";
6
+ import {getSetting} from "./miscUtil";
7
7
 
8
8
  let jwtToken: string | null = null;
9
9
 
@@ -20,14 +20,14 @@ export const getJwt = (cookieName: string = 'JWT'): string | null => {
20
20
  };
21
21
 
22
22
  export function setJWT(token: string | null, options?: {
23
- preserveNull?: boolean; useStorage?: boolean, cookieName?: string; attributes?: CookieAttributes
23
+ preserveNull?: boolean; useStorage?: boolean, cookieName?: string; attributes?: Cookies.CookieAttributes
24
24
  }) {
25
25
  jwtToken = token;
26
26
  const preserveNull = options?.preserveNull ?? false;
27
27
  const useStorage = options?.useStorage ?? true;
28
28
  if (window.allowCookies || !token) {
29
29
  if (token) {
30
- let cookieOptions: CookieAttributes = {expires: 1, sameSite: 'strict', ...options?.attributes};
30
+ let cookieOptions: Cookies.CookieAttributes = {expires: 1, sameSite: 'strict', ...options?.attributes};
31
31
  if (getSetting('mode') !== 'dev') {
32
32
  cookieOptions.secure = true;
33
33
  cookieOptions.sameSite = 'strict';
@@ -40,12 +40,12 @@ export function setJWT(token: string | null, options?: {
40
40
  }
41
41
 
42
42
  export const setJwt = (token: string | null, preserveOnNull: boolean = false, includeStorage: boolean = true,
43
- _options?: CookieAttributes) => {
43
+ _options?: Cookies.CookieAttributes) => {
44
44
  console.debug('Settings JWT token', {token, preserveOnNull, includeStorage, allowCookies: window.allowCookies});
45
45
  jwtToken = token;
46
46
  if (window.allowCookies || !token) {
47
47
  if (token) {
48
- let options: CookieAttributes = {expires: 1, sameSite: 'strict'};
48
+ let options: Cookies.CookieAttributes = {expires: 1, sameSite: 'strict'};
49
49
  if (_options) options = Object.assign({}, options, _options);
50
50
  if (getSetting('mode') !== 'dev') {
51
51
  options.secure = true;