@dvrd/dvr-controls 1.1.12 → 1.1.14

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.12",
3
+ "version": "1.1.14",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "files": [
@@ -26,39 +26,29 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@dvrd/idate": "^1.8.8",
29
- "@fortawesome/fontawesome-svg-core": "6.5.2",
30
- "@fortawesome/free-brands-svg-icons": "6.5.2",
31
- "@fortawesome/free-regular-svg-icons": "6.5.2",
32
- "@fortawesome/free-solid-svg-icons": "6.5.2",
33
- "@fortawesome/react-fontawesome": "0.2.0",
34
- "@types/dompurify": "2.4.0",
35
- "@types/js-cookie": "3.0.3",
36
- "@types/lodash.defer": "^4.1.7",
37
- "@types/lodash.delay": "^4.1.7",
38
- "@types/lodash.isequal": "^4.5.6",
39
- "@types/lodash.merge": "^4.6.7",
40
- "@types/lodash.mergewith": "^4.6.7",
29
+ "@fortawesome/fontawesome-svg-core": "*",
30
+ "@fortawesome/free-brands-svg-icons": "*",
31
+ "@fortawesome/free-regular-svg-icons": "*",
32
+ "@fortawesome/free-solid-svg-icons": "*",
33
+ "@fortawesome/react-fontawesome": "*",
34
+ "@types/dompurify": "*",
35
+ "@types/js-cookie": "*",
41
36
  "@types/node": "18.14.0",
42
37
  "@types/react": "*",
43
38
  "@types/react-color": "3.0.13",
44
39
  "@types/react-dom": "*",
45
40
  "@types/react-router": "*",
46
- "@types/uuid": "9.0.0",
47
- "classnames": "2.5.1",
48
- "dompurify": "3.2.4",
49
- "js-cookie": "3.0.1",
50
- "lodash.defer": "^4.1.0",
51
- "lodash.delay": "^4.1.1",
52
- "lodash.isequal": "^4.5.0",
53
- "lodash.merge": "^4.6.2",
54
- "lodash.mergewith": "^4.6.2",
41
+ "@types/uuid": "*",
42
+ "classnames": "*",
43
+ "dompurify": "*",
44
+ "js-cookie": "*",
55
45
  "react": "*",
56
46
  "react-color": "2.19.3",
57
47
  "react-dom": "*",
58
48
  "react-rnd": "10.4.1",
59
49
  "react-router": "*",
60
50
  "swiper": "^11.1.4",
61
- "typescript": "5.6.3",
62
- "uuid": "9.0.0"
51
+ "typescript": "*",
52
+ "uuid": "*"
63
53
  }
64
54
  }
@@ -29,7 +29,6 @@
29
29
  font-size: .9rem;
30
30
  font-weight: 500;
31
31
  text-transform: uppercase;
32
- font-family: 'Roboto', sans-serif;
33
32
 
34
33
  &.singleChild {
35
34
  justify-content: center;
@@ -25,7 +25,6 @@
25
25
  font-size: .9rem;
26
26
  font-weight: 500;
27
27
  text-transform: uppercase;
28
- font-family: 'Roboto', sans-serif;
29
28
  transition: color .2s ease-in-out;
30
29
 
31
30
  &.singleChild {
@@ -4,11 +4,10 @@
4
4
  import './style/DVRCarousel.scss';
5
5
 
6
6
  import React, {MouseEventHandler} from 'react';
7
- import {PureComponent, ReactElement} from "react";
8
- import AwesomeIcon from "../icon/awesomeIcon";
9
- import classNames from "classnames";
10
- import {voidFunction} from "../util/controlUtil";
11
- import isEqual from 'lodash.isequal';
7
+ import {PureComponent, ReactElement} from 'react';
8
+ import AwesomeIcon from '../icon/awesomeIcon';
9
+ import classNames from 'classnames';
10
+ import {voidFunction} from '../util/controlUtil';
12
11
 
13
12
  interface Props {
14
13
  onClickNext: MouseEventHandler;
@@ -29,8 +28,8 @@ interface State {
29
28
 
30
29
  export default class DVRCarousel extends PureComponent<Props, State> {
31
30
  state: State = {
32
- initialRendered: false,
33
- }
31
+ initialRendered: false
32
+ };
34
33
  carousel: HTMLDivElement;
35
34
 
36
35
  getMaxWidth = (): number => {
@@ -49,14 +48,14 @@ export default class DVRCarousel extends PureComponent<Props, State> {
49
48
 
50
49
  getVisibleIndexes = (): { firstIndex: number, lastIndex: number } => {
51
50
  const {currentIndex, visibleItems, infinite, children} = this.props,
52
- itemsBefore = Math.floor((visibleItems - 1) / 2), itemsAfter = Math.ceil((visibleItems - 1) / 2)
51
+ itemsBefore = Math.floor((visibleItems - 1) / 2), itemsAfter = Math.ceil((visibleItems - 1) / 2);
53
52
  let firstIndex = currentIndex - itemsBefore, lastIndex = currentIndex + itemsAfter;
54
53
  if (firstIndex < 0) {
55
54
  lastIndex = visibleItems - 1;
56
55
  firstIndex = 0;
57
56
  }
58
57
  if (lastIndex > children.length - 1) {
59
- if (infinite) lastIndex -= (children.length - 1)
58
+ if (infinite) lastIndex -= (children.length - 1);
60
59
  else {
61
60
  lastIndex = children.length - -1;
62
61
  firstIndex = Math.max(0, lastIndex - visibleItems);
@@ -67,7 +66,7 @@ export default class DVRCarousel extends PureComponent<Props, State> {
67
66
 
68
67
  getItemContainer = (index: number): HTMLDivElement | null => {
69
68
  return document.querySelector(`div[data-name=dvr-carousel-${index}]`);
70
- }
69
+ };
71
70
 
72
71
  getVisibleWidth = (): number => {
73
72
  const {firstIndex, lastIndex} = this.getVisibleIndexes();
@@ -99,7 +98,7 @@ export default class DVRCarousel extends PureComponent<Props, State> {
99
98
 
100
99
  }
101
100
  if (!this.state.initialRendered) this.setState({initialRendered: true});
102
- }
101
+ };
103
102
 
104
103
  renderPrevControl = () => {
105
104
  const {showControls, onClickPrev, currentIndex, infinite} = this.props;
@@ -120,7 +119,9 @@ export default class DVRCarousel extends PureComponent<Props, State> {
120
119
  };
121
120
 
122
121
  renderItems = () => {
123
- const {lazy, children} = this.props, {initialRendered} = this.state, {firstIndex, lastIndex} = this.getVisibleIndexes();
122
+ const {lazy, children} = this.props, {initialRendered} = this.state, {
123
+ firstIndex, lastIndex
124
+ } = this.getVisibleIndexes();
124
125
  return (
125
126
  <div className='carousel-items-container' ref={(ref: HTMLDivElement) => {
126
127
  this.carousel = ref;
@@ -133,11 +134,11 @@ export default class DVRCarousel extends PureComponent<Props, State> {
133
134
  data-name={`dvr-carousel-${index}`}>
134
135
  {(!hidden || !lazy) && child}
135
136
  </div>
136
- )
137
+ );
137
138
  })}
138
139
  </div>
139
140
  </div>
140
- )
141
+ );
141
142
  };
142
143
 
143
144
  componentDidMount = () => {
@@ -146,7 +147,8 @@ export default class DVRCarousel extends PureComponent<Props, State> {
146
147
 
147
148
  componentDidUpdate = (prevProps: Props, prevState: State) => {
148
149
  const {currentIndex, visibleItems, children} = this.props, {initialRendered} = this.state;
149
- if (currentIndex !== prevProps.currentIndex || visibleItems !== prevProps.visibleItems || !isEqual(children, prevProps.children) || initialRendered !== prevState.initialRendered)
150
+ if (currentIndex !== prevProps.currentIndex || visibleItems !== prevProps.visibleItems || JSON.stringify(
151
+ children) !== JSON.stringify(prevProps.children) || initialRendered !== prevState.initialRendered)
150
152
  window.setTimeout(this.setStyle, 0);
151
153
  };
152
154
 
@@ -157,6 +159,6 @@ export default class DVRCarousel extends PureComponent<Props, State> {
157
159
  {this.renderItems()}
158
160
  {this.renderNextControl()}
159
161
  </div>
160
- )
162
+ );
161
163
  };
162
164
  }
@@ -22,7 +22,6 @@ import DvrdButton from "../button/dvrdButton";
22
22
  import {generateComponentId} from "../util/componentUtil";
23
23
  import IDate from '@dvrd/idate';
24
24
  import {pad} from "../util/controlUtil";
25
- import defer from 'lodash.defer';
26
25
  import {Swiper, SwiperClass, SwiperSlide} from 'swiper/react';
27
26
  import {FreeMode, Mousewheel} from 'swiper/modules';
28
27
  import 'swiper/css';
@@ -356,7 +355,7 @@ function DatePicker(props: DatePickerProps) {
356
355
  useEffect(() => {
357
356
  if (open) {
358
357
  document.addEventListener('keydown', keyListener);
359
- defer(addMountClass);
358
+ window.setTimeout(addMountClass);
360
359
  window.setTimeout(removeMountClass, 1000);
361
360
  } else {
362
361
  document.removeEventListener('keydown', keyListener);
@@ -5,21 +5,20 @@
5
5
  import './style/dateField.scss';
6
6
 
7
7
  import React, {ChangeEvent, CSSProperties, KeyboardEventHandler, PureComponent} from 'react';
8
- import {ChangeFunction, ControlVariant} from "../../util/interfaces";
9
- import {DateTimeParts, DateType} from "./dateFieldController";
10
- import classNames from "classnames";
11
- import {ControlContext} from "../../util/controlContext";
12
- import {BACKSPACE_CODE} from "../../util/constants";
13
- import DatePicker from "./datePicker/datePicker";
14
- import TimePicker from "./timePicker/timePicker";
15
- import DateInput from "./input/dateInput";
16
- import {DVRInputControllerProps} from "../v2/inputController_v2";
17
- import mergeWith from 'lodash.mergewith';
8
+ import {ChangeFunction, ControlVariant} from '../../util/interfaces';
9
+ import {DateTimeParts, DateType} from './dateFieldController';
10
+ import classNames from 'classnames';
11
+ import {ControlContext} from '../../util/controlContext';
12
+ import {BACKSPACE_CODE} from '../../util/constants';
13
+ import DatePicker from './datePicker/datePicker';
14
+ import TimePicker from './timePicker/timePicker';
15
+ import DateInput from './input/dateInput';
16
+ import {DVRInputControllerProps} from '../v2/inputController_v2';
18
17
  import {colorIsWhite, convertColor, editColor} from '../../util/colorUtil';
19
18
  import {pad} from '../../util/controlUtil';
20
- import AwesomeIcon from "../../icon/awesomeIcon";
19
+ import AwesomeIcon from '../../icon/awesomeIcon';
21
20
  import WithBackground from '../../popup/withBackground';
22
- import ButtonController from "../../button/buttonController";
21
+ import ButtonController from '../../button/buttonController';
23
22
  import IDate, {IDateValue} from '@dvrd/idate';
24
23
 
25
24
  export interface DateNumParts {
@@ -64,8 +63,8 @@ export default class DateField extends PureComponent<Props, State> {
64
63
  this.state = {
65
64
  pickerOpen: false,
66
65
  pickerState: this.getDefaultPickerState(),
67
- pickerValue: this.getInitPickerValue(),
68
- }
66
+ pickerValue: this.getInitPickerValue()
67
+ };
69
68
  }
70
69
 
71
70
  onMouseEnterSelector = (forState: PickerState) => (evt: MouseEvent) => {
@@ -102,7 +101,7 @@ export default class DateField extends PureComponent<Props, State> {
102
101
  month: currentMoment.month(),
103
102
  year: currentMoment.year(),
104
103
  hour: currentMoment.hours(),
105
- minute: currentMoment.minutes(),
104
+ minute: currentMoment.minutes()
106
105
  };
107
106
  } else {
108
107
  nextValue = Object.assign({}, this.state.pickerValue, {[key]: value});
@@ -208,7 +207,7 @@ export default class DateField extends PureComponent<Props, State> {
208
207
  day: today.day(),
209
208
  minute: today.minutes(),
210
209
  hour: today.hours(),
211
- year: today.year(),
210
+ year: today.year()
212
211
  }
213
212
  }, () => {
214
213
  if (this.props.dateType === DateType.DATE) {
@@ -242,20 +241,28 @@ export default class DateField extends PureComponent<Props, State> {
242
241
  return PickerState.DATE;
243
242
  };
244
243
 
245
- getInitPickerValue = () => {
246
- const dateParts = Object.assign({}, this.props.dateParts);
244
+ getInitPickerValue = (): DateNumParts => {
245
+ const dateParts = this.props.dateParts;
247
246
  const now = IDate.now();
248
247
  if (!isNaN(Number(dateParts.month))) dateParts.month = (Number(dateParts.month) - 1).toString();
249
- return mergeWith(dateParts, {
250
- day: now.day(),
251
- month: now.month(),
252
- year: now.year(),
253
- hour: now.hours(),
254
- minute: now.minutes(),
255
- }, (source1: string, source2: number) => {
256
- if (!source1 || source1.length === 0 || ['dd', 'mm', 'yyyy', 'hh'].includes(source1)) return source2;
257
- return Number(source1);
258
- });
248
+ const merged: DateNumParts = {
249
+ day: now.day(), month: now.month(), year: now.year(), hour: now.hours(), minute: now.minutes()
250
+ };
251
+ for (const [key, value] of Object.entries(dateParts)) {
252
+ if(!value || !value.length || ['dd', 'mm', 'yyyy', 'hh'].includes(value)) continue;
253
+ merged[key as keyof DateNumParts] = Number(value);
254
+ }
255
+ return merged;
256
+ // return mergeWith(dateParts, {
257
+ // day: now.day(),
258
+ // month: now.month(),
259
+ // year: now.year(),
260
+ // hour: now.hours(),
261
+ // minute: now.minutes()
262
+ // }, (source1: string, source2: number) => {
263
+ // if (!source1 || source1.length === 0 || ['dd', 'mm', 'yyyy', 'hh'].includes(source1)) return source2;
264
+ // return Number(source1);
265
+ // });
259
266
  };
260
267
 
261
268
  scrollToCurrent = () => {
@@ -330,7 +337,7 @@ export default class DateField extends PureComponent<Props, State> {
330
337
  primary={false}/>}
331
338
  </div>
332
339
  </div>
333
- )
340
+ );
334
341
  };
335
342
 
336
343
  renderStateSelector = () => {
@@ -345,7 +352,7 @@ export default class DateField extends PureComponent<Props, State> {
345
352
  onMouseEnter={this.onMouseEnterSelector(PickerState.TIME)}
346
353
  onMouseLeave={this.onMouseLeaveSelector(PickerState.TIME)}/>
347
354
  </div>
348
- )
355
+ );
349
356
  };
350
357
 
351
358
  componentDidUpdate = (prevProps: Props, prevState: State) => {
@@ -364,6 +371,6 @@ export default class DateField extends PureComponent<Props, State> {
364
371
  fullWidth={fullWidth} disabled={disabled}/>
365
372
  <WithBackground onClose={this.onClosePicker} active={pickerOpen}>{this.renderPicker()}</WithBackground>
366
373
  </>
367
- )
374
+ );
368
375
  };
369
376
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React, {PureComponent} from 'react';
6
6
  import {ControlVariant} from "../../util/interfaces";
7
- import DateField from "./dateField";
7
+ import DateField, {DateNumParts} from './dateField';
8
8
  import {DefaultInputProps, DVRInputControllerProps} from "../v2/inputController_v2";
9
9
  import IDate, {IDateValue} from '@dvrd/idate';
10
10
 
@@ -28,7 +28,7 @@ interface State {
28
28
  value: string;
29
29
  }
30
30
 
31
- export interface DateTimeParts {
31
+ export interface DateTimeParts extends Record<keyof DateNumParts, string> {
32
32
  day: string;
33
33
  month: string;
34
34
  year: string;
@@ -8,7 +8,6 @@ import classNames from 'classnames';
8
8
  import {ControlContext} from "../util/controlContext";
9
9
  import {convertColor} from "../util/colorUtil";
10
10
  import {calculateTextWidth, getComputedProperty, remToPx} from "../util/controlUtil";
11
- import defer from 'lodash.defer';
12
11
 
13
12
  export enum LabelType {
14
13
  LABEL, SPAN, PAR,
@@ -154,7 +153,7 @@ export default function Label(props: Props) {
154
153
  }
155
154
 
156
155
  useEffect(() => {
157
- defer(renderText);
156
+ window.setTimeout(renderText);
158
157
  }, []);
159
158
 
160
159
  switch (labelType) {
@@ -17,7 +17,6 @@ import React, {
17
17
  import {useMatch, useNavigate} from 'react-router';
18
18
  import {NavigationItem} from "../util/interfaces";
19
19
  import {AwesomeIcon, hasHover} from "../../../index";
20
- import defer from 'lodash.defer';
21
20
 
22
21
  interface Props {
23
22
  onClickItem?: (item: NavigationItem) => MouseEventHandler;
@@ -116,7 +115,7 @@ function MobileNavigation(props: Props, ref: ForwardedRef<MobileNavigationRef>)
116
115
  }
117
116
 
118
117
  useEffect(() => {
119
- defer(() => {
118
+ window.setTimeout(() => {
120
119
  if (open) document.addEventListener('click', outsideClickListener);
121
120
  else document.removeEventListener('click', outsideClickListener);
122
121
  });
@@ -9,7 +9,6 @@ import {
9
9
  } from "../../util/interfaces";
10
10
  import {PDFDraggable, PdfElement} from "../element/pdfElement";
11
11
  import {nullify} from "../../util/miscUtil";
12
- import merge from 'lodash.merge';
13
12
  import {AwesomeIcon, directTimeout, PAGE_HEIGHT, PAGE_WIDTH} from "../../../../index";
14
13
 
15
14
  interface Props {
@@ -42,12 +41,13 @@ export default class PdfImage extends PdfElement<Props, State> {
42
41
  constructor(props: Props) {
43
42
  super(props);
44
43
  this.state = {
45
- settings: merge({}, {
46
- img: props.values?.default_image || '',
44
+ settings: {
47
45
  persistent: PDFElementPersist.NOT_PERSISTENT,
48
46
  alignment: undefined,
49
47
  display: PDFDisplay.ALL_PAGES,
50
- }, props.defaultSettings),
48
+ ...props.defaultSettings,
49
+ img: (props.defaultSettings?.img ?? (props.values?.default_image || '')) as string,
50
+ },
51
51
  dragging: false,
52
52
  };
53
53
  };
@@ -9,7 +9,6 @@ import {
9
9
  PDFElementParams, PDFElementPersist, PDFElementType, PdfFont, PDFInvoiceTableParams
10
10
  } from "../../util/interfaces";
11
11
  import {PDFDraggable, PdfElement} from "../element/pdfElement";
12
- import merge from 'lodash.merge';
13
12
  import {parsePrice, pxToPt} from "../../util/pdfUtil";
14
13
  import {WithEvents} from "../../../../index";
15
14
 
@@ -37,7 +36,7 @@ export default class PdfInvoiceTable extends PdfElement<Props, State> {
37
36
  constructor(props: Props) {
38
37
  super(props);
39
38
  this.state = {
40
- settings: merge({}, {
39
+ settings: {
41
40
  widths: [40, 20, 20, 20],
42
41
  fontSize: 12,
43
42
  font: props.mainFont,
@@ -45,7 +44,8 @@ export default class PdfInvoiceTable extends PdfElement<Props, State> {
45
44
  headerColor: '#000',
46
45
  alignment: ElementPosition.CENTER,
47
46
  persistent: PDFElementPersist.NOT_PERSISTENT,
48
- }, props.defaultSettings),
47
+ ...props.defaultSettings
48
+ },
49
49
  dragging: false,
50
50
  };
51
51
  }
@@ -17,7 +17,6 @@ import {
17
17
  } from "../../util/interfaces";
18
18
  import {PDFDraggable, PdfElement} from "../element/pdfElement";
19
19
  import {debug, sanitizeHtml} from "../../util/miscUtil";
20
- import merge from 'lodash.merge';
21
20
  import {PAGE_WIDTH, pxToPt, setPdfVariables, waitForFonts} from "../../util/pdfUtil";
22
21
  import {directTimeout} from "../../util/componentUtil";
23
22
  import {dispatchCustomEvent, showDialog} from "../../util/eventUtil";
@@ -57,7 +56,7 @@ export default class PdfText extends PdfElement<Props, State> {
57
56
  constructor(props: Props) {
58
57
  super(props);
59
58
  this.state = {
60
- settings: merge({}, {
59
+ settings: {
61
60
  text: 'Klik hier om deze tekst aan te passen.',
62
61
  bold: false,
63
62
  underline: false,
@@ -68,7 +67,8 @@ export default class PdfText extends PdfElement<Props, State> {
68
67
  color: '#000',
69
68
  persistent: PDFElementPersist.NOT_PERSISTENT,
70
69
  display: PDFDisplay.ALL_PAGES,
71
- }, props.defaultSettings),
70
+ ...props.defaultSettings
71
+ },
72
72
  dragging: false,
73
73
  focused: false,
74
74
  }
@@ -16,8 +16,6 @@ import React, {
16
16
  import {ElementPosition, PDFElementPersist, RNDDimensions} from "../../../util/interfaces";
17
17
  import {generateComponentId} from "../../../util/componentUtil";
18
18
  import {DraggableData, HandleStyles, Position, ResizableDelta, ResizeEnable, Rnd, RndDragCallback} from 'react-rnd';
19
- import defer from 'lodash.defer';
20
- import delay from 'lodash.delay';
21
19
  import {PDFDraggableType, ResizeDirection} from "../types/pdfTemplateTypes";
22
20
  import {PAGE_WIDTH} from "../../../util/pdfUtil";
23
21
  import classNames from 'classnames';
@@ -95,7 +93,7 @@ function PDFDraggableElement(props: PropsWithChildren<Props>, ref: ForwardedRef<
95
93
  function setSize(width: number, height: number, notifyResized: boolean = true) {
96
94
  setDimensions({width, height});
97
95
  if (notifyResized)
98
- defer(props.onResized);
96
+ window.setTimeout(props.onResized);
99
97
  }
100
98
 
101
99
  function setFocus() {
@@ -104,7 +102,7 @@ function PDFDraggableElement(props: PropsWithChildren<Props>, ref: ForwardedRef<
104
102
 
105
103
  function setPosition(_position: Position, callback?: VoidFunction) {
106
104
  _setPosition(Object.assign({}, position, _position));
107
- if (callback) defer(callback);
105
+ if (callback) window.setTimeout(callback);
108
106
  }
109
107
 
110
108
  function getPosition(): Position {
@@ -129,7 +127,7 @@ function PDFDraggableElement(props: PropsWithChildren<Props>, ref: ForwardedRef<
129
127
  function onResizeStop(evt: any, direction: ResizeDirection, ref: HTMLElement, delta: ResizableDelta, position: Position) {
130
128
  setDimensions({width: ref.style.width, height: ref.style.height});
131
129
  _setPosition(position);
132
- defer(props.onResized);
130
+ window.setTimeout(props.onResized);
133
131
  }
134
132
 
135
133
  function setInitialPosition() {
@@ -153,7 +151,7 @@ function PDFDraggableElement(props: PropsWithChildren<Props>, ref: ForwardedRef<
153
151
  }));
154
152
 
155
153
  useEffect(() => {
156
- delay(setInitialPosition, 20);
154
+ window.setTimeout(setInitialPosition, 20);
157
155
  }, [props.alignment]);
158
156
 
159
157
  const axis = props.alignment ? 'y' : 'both';
@@ -7,7 +7,6 @@ import React, {ForwardedRef, forwardRef, useEffect, useImperativeHandle, useMemo
7
7
  import {ErrorType, GroupedSelectItem, SelectValueType} from "../util/interfaces";
8
8
  import classNames from 'classnames';
9
9
  import AwesomeIcon from "../icon/awesomeIcon";
10
- import defer from 'lodash.defer';
11
10
  import {stopPropagation} from "../util/controlUtil";
12
11
 
13
12
 
@@ -267,7 +266,7 @@ function DVRDGroupedSelect(props: Props, ref: ForwardedRef<GroupedSelectRef>) {
267
266
  useEffect(() => {
268
267
  if (open) {
269
268
  document.body.addEventListener('click', clickListener);
270
- defer(scrollSelectedInView);
269
+ window.setTimeout(scrollSelectedInView);
271
270
  } else document.body.removeEventListener('click', clickListener);
272
271
  }, [open]);
273
272
 
@@ -8,7 +8,6 @@ import classNames from 'classnames';
8
8
  import {ChangeFunction, ErrorType, SelectItemShape} from '../util/interfaces';
9
9
  import {hasHover, stopPropagation} from '../util/controlUtil';
10
10
  import AwesomeIcon from '../icon/awesomeIcon';
11
- import delay from 'lodash.delay';
12
11
 
13
12
  interface Props {
14
13
  onChange: (selected: Array<string | number>, submit: boolean) => VoidFunction;
@@ -83,7 +82,7 @@ export default function DvrdMultiSelect(props: Props) {
83
82
  }
84
83
 
85
84
  function onBlurInput() {
86
- delay(() => {
85
+ window.setTimeout(() => {
87
86
  setSearchFocused(false);
88
87
  onChangeSearch({target: {value: ''}});
89
88
  }, transitionDuration);
@@ -40,7 +40,6 @@
40
40
  padding: .75rem;
41
41
  color: #2A435F;
42
42
  border-radius: inherit;
43
- font-family: avenir-light, sans-serif;
44
43
  }
45
44
 
46
45
  .grouped-select-placeholder, .grouped-select-value {
@@ -30,7 +30,6 @@
30
30
 
31
31
  .dvrd-select-value {
32
32
  color: $color-blue-text;
33
- font-family: avenir-light, sans-serif;
34
33
  }
35
34
 
36
35
  .dvrd-select-search {
@@ -40,7 +39,6 @@
40
39
  padding: .75rem;
41
40
  color: #2A435F;
42
41
  border-radius: inherit;
43
- font-family: avenir-light, sans-serif;
44
42
  }
45
43
 
46
44
  .dvrd-select-arrow {
@@ -73,7 +71,6 @@
73
71
  background-color: white;
74
72
  transition: background-color .2s ease-in-out;
75
73
  cursor: pointer;
76
- font-family: avenir-light, sans-serif;
77
74
  white-space: nowrap;
78
75
 
79
76
  &:hover {
@@ -9,7 +9,6 @@ import {SidebarItem, SideMenuMode} from '../util/interfaces';
9
9
  import classNames from 'classnames';
10
10
  import {AwesomeIcon, generateComponentId, isAbsoluteLink} from '../../../index';
11
11
  import {ControlContext} from '../util/controlContext';
12
- import defer from 'lodash.defer';
13
12
  import {IconName} from '@fortawesome/fontawesome-svg-core';
14
13
 
15
14
  interface Props {
@@ -160,7 +159,7 @@ export default function SidebarMenu(props: Props) {
160
159
 
161
160
  useEffect(() => {
162
161
  setColors();
163
- defer(_setActiveItem);
162
+ window.setTimeout(_setActiveItem);
164
163
  }, []);
165
164
 
166
165
  useEffect(() => {
@@ -5,8 +5,6 @@
5
5
  import React, {useEffect, useRef, useState} from 'react';
6
6
  import Snackbar from "./snackbar";
7
7
  import {Snack} from "../util/interfaces";
8
- import delay from 'lodash.delay';
9
- import defer from 'lodash.defer';
10
8
  import {useEvent} from "../util/componentUtil";
11
9
 
12
10
  interface Props {
@@ -50,16 +48,16 @@ export default function SnackbarController(props: Props) {
50
48
  if (!snack) return;
51
49
  const _activeTime = snack.config?.duration ?? activeTime ?? 3000;
52
50
  setSnack(snack);
53
- defer(() => setActive(true));
51
+ window.setTimeout(() => setActive(true));
54
52
  timeoutID.current = window.setTimeout(deactivate, _activeTime);
55
53
  }
56
54
 
57
55
  function deactivate() {
58
56
  setActive(false);
59
57
  // Clear snack after 200ms (css transition)
60
- delay(() => {
58
+ window.setTimeout(() => {
61
59
  setSnack(null);
62
- defer(() => {
60
+ window.setTimeout(() => {
63
61
  if (snackQueue.current.length)
64
62
  // Open next
65
63
  timeoutID.current = window.setTimeout(activate, 500);
@@ -4,7 +4,6 @@
4
4
 
5
5
  import React, {Context, PropsWithChildren, useEffect} from 'react';
6
6
  import {ControlVariant} from "./interfaces";
7
- import defer from 'lodash.defer';
8
7
  import {convertColor, hexToRgb} from "./colorUtil";
9
8
 
10
9
  // noinspection JSUnusedGlobalSymbols
@@ -33,7 +32,7 @@ export const ControlContext: Context<ThemeShape> = React.createContext<ThemeShap
33
32
  export default function ThemeContextProvider(props: PropsWithChildren<ProviderProps>) {
34
33
  const {theme, children} = props;
35
34
  useEffect(() => {
36
- defer(() => {
35
+ window.setTimeout(() => {
37
36
  const root = document.documentElement;
38
37
  const baseRgb = hexToRgb(convertColor(theme.baseColor));
39
38
  const contrastRgb = hexToRgb(convertColor(theme.contrastColor));
@@ -193,7 +193,7 @@ export type DefaultPDFElementParams<T extends PDFElementType, O extends IndexedO
193
193
  linkedID?: string;
194
194
  }>
195
195
  export type PDFImageParams = {
196
- img: File | string | null,
196
+ img: File | string | null;
197
197
  persistent: PDFElementPersist;
198
198
  alignment?: ElementPosition;
199
199
  display?: PDFDisplay