@uncinc/uncinc-react-kitchen-sink 2.11.8 → 2.11.10

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,9 +1,11 @@
1
- var _excluded = ["title", "required", "description", "placeholder", "fieldName", "validation", "className", "wrapperClassName", "disabled", "minDate", "maxDate", "onChange", "includeFieldSet"];
1
+ var _excluded = ["title", "required", "description", "placeholder", "fieldName", "validation", "className", "wrapperClassName", "disabled", "minDate", "maxDate", "onChange", "includeFieldSet", "calendarStartDay", "locale"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React from 'react';
6
- import ReactDatePicker from 'react-datepicker';
6
+ import ReactDatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker';
7
+ import enUS from 'date-fns/locale/en-US';
8
+ import nl from 'date-fns/locale/nl';
7
9
  import { Field } from 'formik';
8
10
  import c from 'classnames';
9
11
  import { useTranslation } from 'react-i18next';
@@ -26,6 +28,10 @@ var DatePicker = function DatePicker(props) {
26
28
  maxDate = props.maxDate,
27
29
  _onChange = props.onChange,
28
30
  includeFieldSet = props.includeFieldSet,
31
+ _props$calendarStartD = props.calendarStartDay,
32
+ calendarStartDay = _props$calendarStartD === void 0 ? 1 : _props$calendarStartD,
33
+ _props$locale = props.locale,
34
+ locale = _props$locale === void 0 ? 'nl' : _props$locale,
29
35
  restProps = _objectWithoutProperties(props, _excluded);
30
36
  var _useExtendedFormikCon = useExtendedFormikContext(),
31
37
  values = _useExtendedFormikCon.values,
@@ -60,6 +66,13 @@ var DatePicker = function DatePicker(props) {
60
66
  });
61
67
  }
62
68
  };
69
+ registerLocale('en', enUS);
70
+ registerLocale('nl', nl);
71
+
72
+ // Changing locales breaks the test suite in horrible ways
73
+ if (process.env.NODE_ENV !== 'test') {
74
+ setDefaultLocale(locale);
75
+ }
63
76
  return /*#__PURE__*/React.createElement(GenericFormElement, {
64
77
  className: c('DatePicker', wrapperClassName),
65
78
  title: title,
@@ -96,7 +109,8 @@ var DatePicker = function DatePicker(props) {
96
109
  className: className,
97
110
  disabled: disabled,
98
111
  required: required,
99
- placeholderText: placeholder
112
+ placeholderText: placeholder,
113
+ calendarStartDay: calendarStartDay
100
114
  }, restProps));
101
115
  }));
102
116
  };
@@ -1 +1,3 @@
1
- export default function usePrevious<T>(value: T): T | undefined;
1
+ type Value<T> = T | null | undefined;
2
+ export default function usePrevious<T>(value: T): Value<T>;
3
+ export {};
@@ -1,8 +1,10 @@
1
- import { useEffect, useRef } from 'react';
1
+ import { useRef } from 'react';
2
2
  export default function usePrevious(value) {
3
- var ref = useRef();
4
- useEffect(function () {
5
- ref.current = value;
6
- }, [value]);
7
- return ref.current;
3
+ var previous = useRef(undefined);
4
+ var current = useRef(undefined);
5
+ if (value !== current.current) {
6
+ previous.current = current.current;
7
+ current.current = value;
8
+ }
9
+ return previous.current;
8
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.11.8",
3
+ "version": "2.11.10",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",
@@ -72,7 +72,7 @@
72
72
  "react": "^16 || ^17 || ^18",
73
73
  "react-animate-height": "^2.0.23",
74
74
  "react-autosuggest": "^10.0.2",
75
- "react-datepicker": "^3.0.0",
75
+ "react-datepicker": "^7.0.0",
76
76
  "react-dom": "^16 || ^17 || ^18",
77
77
  "react-global-configuration": "^1.4.0",
78
78
  "react-hook-videojs": "^3.0.2",