@trackunit/react-form-components 0.0.461 → 0.0.464
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/index.cjs.js +1 -2
- package/index.esm.js +1 -2
- package/package.json +1 -2
package/index.cjs.js
CHANGED
|
@@ -10,7 +10,6 @@ var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities
|
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var uuid = require('uuid');
|
|
12
12
|
var dateFns = require('date-fns');
|
|
13
|
-
var isDate = require('rxjs/internal/util/isDate');
|
|
14
13
|
var parsePhoneNumberFromString = require('libphonenumber-js');
|
|
15
14
|
var reactHookForm = require('react-hook-form');
|
|
16
15
|
var ReactSelect = require('react-select');
|
|
@@ -737,7 +736,7 @@ ColorField.displayName = "ColorField";
|
|
|
737
736
|
*/
|
|
738
737
|
const DateInput = React.forwardRef((_a, ref) => {
|
|
739
738
|
var { min, max, defaultValue, value } = _a, rest = __rest(_a, ["min", "max", "defaultValue", "value"]);
|
|
740
|
-
const formatDateToInputString = (date) =>
|
|
739
|
+
const formatDateToInputString = (date) => date instanceof Date ? dateFns.format(date, "yyyy-MM-dd") : date;
|
|
741
740
|
// Chrome and Firefox need their default icon to have datepicker functionality.
|
|
742
741
|
const showIcon = !/Chrome/.test(navigator.userAgent) && !/Firefox/.test(navigator.userAgent);
|
|
743
742
|
return (jsxRuntime.jsx(BaseInput, Object.assign({ defaultValue: formatDateToInputString(defaultValue), max: formatDateToInputString(max), min: formatDateToInputString(min), ref: ref, suffix: showIcon ? jsxRuntime.jsx(reactComponents.Icon, { dataTestId: "calendar", name: "Calendar", size: "medium", type: "solid" }) : null, type: "date", value: formatDateToInputString(value) }, rest)));
|
package/index.esm.js
CHANGED
|
@@ -7,7 +7,6 @@ import * as React from 'react';
|
|
|
7
7
|
import React__default, { isValidElement, forwardRef, useState, useCallback, useRef, cloneElement, useEffect, useMemo, useImperativeHandle } from 'react';
|
|
8
8
|
import { v4 } from 'uuid';
|
|
9
9
|
import { format } from 'date-fns';
|
|
10
|
-
import { isValidDate } from 'rxjs/internal/util/isDate';
|
|
11
10
|
import parsePhoneNumberFromString, { isSupportedCountry, getCountries, getCountryCallingCode, AsYouType, parseIncompletePhoneNumber, isValidPhoneNumber } from 'libphonenumber-js';
|
|
12
11
|
import { Controller } from 'react-hook-form';
|
|
13
12
|
import ReactSelect, { components } from 'react-select';
|
|
@@ -707,7 +706,7 @@ ColorField.displayName = "ColorField";
|
|
|
707
706
|
*/
|
|
708
707
|
const DateInput = forwardRef((_a, ref) => {
|
|
709
708
|
var { min, max, defaultValue, value } = _a, rest = __rest(_a, ["min", "max", "defaultValue", "value"]);
|
|
710
|
-
const formatDateToInputString = (date) =>
|
|
709
|
+
const formatDateToInputString = (date) => date instanceof Date ? format(date, "yyyy-MM-dd") : date;
|
|
711
710
|
// Chrome and Firefox need their default icon to have datepicker functionality.
|
|
712
711
|
const showIcon = !/Chrome/.test(navigator.userAgent) && !/Firefox/.test(navigator.userAgent);
|
|
713
712
|
return (jsx(BaseInput, Object.assign({ defaultValue: formatDateToInputString(defaultValue), max: formatDateToInputString(max), min: formatDateToInputString(min), ref: ref, suffix: showIcon ? jsx(Icon, { dataTestId: "calendar", name: "Calendar", size: "medium", type: "solid" }) : null, type: "date", value: formatDateToInputString(value) }, rest)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.464",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"@trackunit/i18n-library-translation": "*",
|
|
23
23
|
"zod": "3.22.4",
|
|
24
24
|
"react-hook-form": "7.40.0",
|
|
25
|
-
"rxjs": "7.8.1",
|
|
26
25
|
"tailwind-merge": "^2.0.0"
|
|
27
26
|
},
|
|
28
27
|
"module": "./index.esm.js",
|