@trackunit/react-form-components 0.0.15 → 0.0.18-alpha-47c0e3bbca.0
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 +3 -6
- package/index.js +3 -6
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -286,12 +286,9 @@ const CheckboxWrapper = tailwindStyledComponents.tw.span `
|
|
|
286
286
|
const DateInput = React.forwardRef((_a, ref) => {
|
|
287
287
|
var { min, max, defaultValue, value } = _a, rest = __rest(_a, ["min", "max", "defaultValue", "value"]);
|
|
288
288
|
const formatDateToInputString = (date) => date instanceof Date ? dateFns.format(date, "yyyy-MM-dd") : date;
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
// If it fails it will just show our icon.
|
|
293
|
-
const hideOnChrome = () => (window.chrome !== null && typeof window.chrome !== "undefined" ? "hidden" : "");
|
|
294
|
-
return (jsxRuntime.jsx(BaseInput, Object.assign({ type: "date", value: formatDateToInputString(value), defaultValue: formatDateToInputString(defaultValue), min: formatDateToInputString(min), max: formatDateToInputString(max), ref: ref, suffix: jsxRuntime.jsx(reactComponents.Icon, { dataTestId: "calendar", name: "CalendarIcon", size: "medium", type: "solid", className: hideOnChrome() }) }, rest)));
|
|
289
|
+
// Chrome and Firefox need their default icon to have datepicker functionality.
|
|
290
|
+
const showIcon = !/Chrome/.test(navigator.userAgent) && !/Firefox/.test(navigator.userAgent);
|
|
291
|
+
return (jsxRuntime.jsx(BaseInput, Object.assign({ type: "date", value: formatDateToInputString(value), defaultValue: formatDateToInputString(defaultValue), min: formatDateToInputString(min), max: formatDateToInputString(max), ref: ref, suffix: showIcon && jsxRuntime.jsx(reactComponents.Icon, { dataTestId: "calendar", name: "CalendarIcon", size: "medium", type: "solid" }) }, rest)));
|
|
295
292
|
});
|
|
296
293
|
|
|
297
294
|
/**
|
package/index.js
CHANGED
|
@@ -256,12 +256,9 @@ const CheckboxWrapper = tw.span `
|
|
|
256
256
|
const DateInput = forwardRef((_a, ref) => {
|
|
257
257
|
var { min, max, defaultValue, value } = _a, rest = __rest(_a, ["min", "max", "defaultValue", "value"]);
|
|
258
258
|
const formatDateToInputString = (date) => date instanceof Date ? format(date, "yyyy-MM-dd") : date;
|
|
259
|
-
//
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// If it fails it will just show our icon.
|
|
263
|
-
const hideOnChrome = () => (window.chrome !== null && typeof window.chrome !== "undefined" ? "hidden" : "");
|
|
264
|
-
return (jsx(BaseInput, Object.assign({ type: "date", value: formatDateToInputString(value), defaultValue: formatDateToInputString(defaultValue), min: formatDateToInputString(min), max: formatDateToInputString(max), ref: ref, suffix: jsx(Icon, { dataTestId: "calendar", name: "CalendarIcon", size: "medium", type: "solid", className: hideOnChrome() }) }, rest)));
|
|
259
|
+
// Chrome and Firefox need their default icon to have datepicker functionality.
|
|
260
|
+
const showIcon = !/Chrome/.test(navigator.userAgent) && !/Firefox/.test(navigator.userAgent);
|
|
261
|
+
return (jsx(BaseInput, Object.assign({ type: "date", value: formatDateToInputString(value), defaultValue: formatDateToInputString(defaultValue), min: formatDateToInputString(min), max: formatDateToInputString(max), ref: ref, suffix: showIcon && jsx(Icon, { dataTestId: "calendar", name: "CalendarIcon", size: "medium", type: "solid" }) }, rest)));
|
|
265
262
|
});
|
|
266
263
|
|
|
267
264
|
/**
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-form-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18-alpha-47c0e3bbca.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@trackunit/i18n-library-translation": "0.0.
|
|
8
|
-
"@trackunit/react-components": "0.1.
|
|
9
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
7
|
+
"@trackunit/i18n-library-translation": "0.0.44-alpha-47c0e3bbca.0",
|
|
8
|
+
"@trackunit/react-components": "0.1.83-alpha-47c0e3bbca.0",
|
|
9
|
+
"@trackunit/tailwind-styled-components": "0.0.56-alpha-47c0e3bbca.0",
|
|
10
10
|
"date-fns": "2.29.3",
|
|
11
11
|
"libphonenumber-js": "1.10.26",
|
|
12
12
|
"react": "18.2.0",
|