@trackunit/react-table-base-components 2.1.4 → 2.1.6-alpha-ecf53e535f3.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.js
CHANGED
|
@@ -7,7 +7,6 @@ var tailwindMerge = require('tailwind-merge');
|
|
|
7
7
|
var reactFormComponents = require('@trackunit/react-form-components');
|
|
8
8
|
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
9
9
|
var dateAndTimeUtils = require('@trackunit/date-and-time-utils');
|
|
10
|
-
var reactDateAndTimeHooks = require('@trackunit/react-date-and-time-hooks');
|
|
11
10
|
var react = require('react');
|
|
12
11
|
var sharedUtils = require('@trackunit/shared-utils');
|
|
13
12
|
|
|
@@ -288,11 +287,7 @@ const cvaDateTimeSince$1 = cssClassVarianceUtilities.cvaMerge(["slashed-zero", "
|
|
|
288
287
|
* @param {DateTimeCellProps} props - The props for the DateTimeCell component
|
|
289
288
|
* @returns {ReactElement} DateTimeCell component
|
|
290
289
|
*/
|
|
291
|
-
const DateTimeCell = ({ format, date, withTimeSince = true, className, "data-testid": dataTestId, style,
|
|
292
|
-
const { preferred: preferredTimezone } = reactDateAndTimeHooks.useTimezone();
|
|
293
|
-
const resolvedLocale = reactDateAndTimeHooks.useLocale();
|
|
294
|
-
const timeZone = timeZoneProp ?? preferredTimezone.id;
|
|
295
|
-
const locale = localeProp ?? resolvedLocale;
|
|
290
|
+
const DateTimeCell = ({ format, timeZone, locale, date, withTimeSince = true, className, "data-testid": dataTestId, style, }) => {
|
|
296
291
|
if (!date) {
|
|
297
292
|
return null;
|
|
298
293
|
}
|
package/index.esm.js
CHANGED
|
@@ -5,7 +5,6 @@ import { twMerge } from 'tailwind-merge';
|
|
|
5
5
|
import { Checkbox } from '@trackunit/react-form-components';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { formatDateUtil, timeSinceAuto, timeSinceInDays, Temporal } from '@trackunit/date-and-time-utils';
|
|
8
|
-
import { useTimezone, useLocale } from '@trackunit/react-date-and-time-hooks';
|
|
9
8
|
import { useMemo, useState, useEffect, isValidElement, cloneElement } from 'react';
|
|
10
9
|
import { DateTimeFormat } from '@trackunit/shared-utils';
|
|
11
10
|
|
|
@@ -286,11 +285,7 @@ const cvaDateTimeSince$1 = cvaMerge(["slashed-zero", "text-neutral-500", "text-x
|
|
|
286
285
|
* @param {DateTimeCellProps} props - The props for the DateTimeCell component
|
|
287
286
|
* @returns {ReactElement} DateTimeCell component
|
|
288
287
|
*/
|
|
289
|
-
const DateTimeCell = ({ format, date, withTimeSince = true, className, "data-testid": dataTestId, style,
|
|
290
|
-
const { preferred: preferredTimezone } = useTimezone();
|
|
291
|
-
const resolvedLocale = useLocale();
|
|
292
|
-
const timeZone = timeZoneProp ?? preferredTimezone.id;
|
|
293
|
-
const locale = localeProp ?? resolvedLocale;
|
|
288
|
+
const DateTimeCell = ({ format, timeZone, locale, date, withTimeSince = true, className, "data-testid": dataTestId, style, }) => {
|
|
294
289
|
if (!date) {
|
|
295
290
|
return null;
|
|
296
291
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6-alpha-ecf53e535f3.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "2.1.
|
|
11
|
-
"@trackunit/ui-icons": "1.13.
|
|
12
|
-
"@trackunit/react-form-components": "2.1.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.13.
|
|
14
|
-
"@trackunit/date-and-time-utils": "1.13.
|
|
15
|
-
"@trackunit/
|
|
16
|
-
"@trackunit/
|
|
17
|
-
"@trackunit/i18n-library-translation": "2.0.5",
|
|
10
|
+
"@trackunit/react-components": "2.1.5-alpha-ecf53e535f3.0",
|
|
11
|
+
"@trackunit/ui-icons": "1.13.16-alpha-ecf53e535f3.0",
|
|
12
|
+
"@trackunit/react-form-components": "2.1.6-alpha-ecf53e535f3.0",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.13.15-alpha-ecf53e535f3.0",
|
|
14
|
+
"@trackunit/date-and-time-utils": "1.13.16-alpha-ecf53e535f3.0",
|
|
15
|
+
"@trackunit/shared-utils": "1.15.15-alpha-ecf53e535f3.0",
|
|
16
|
+
"@trackunit/i18n-library-translation": "2.0.7-alpha-ecf53e535f3.0",
|
|
18
17
|
"tailwind-merge": "^2.0.0"
|
|
19
18
|
},
|
|
20
19
|
"peerDependencies": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TemporalFormat } from "@trackunit/date-and-time-utils";
|
|
2
2
|
import { CommonProps, Refable, type Styleable } from "@trackunit/react-components";
|
|
3
|
-
import { ReactElement } from "react";
|
|
4
3
|
export interface DateTimeCellProps extends CommonProps, Refable<HTMLDivElement>, Styleable {
|
|
5
4
|
/**
|
|
6
5
|
* The date to render.
|
|
@@ -21,16 +20,13 @@ export interface DateTimeCellProps extends CommonProps, Refable<HTMLDivElement>,
|
|
|
21
20
|
*/
|
|
22
21
|
format?: TemporalFormat;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* In most cases you do not need this — the component resolves the correct timezone
|
|
28
|
-
* automatically via `AssetTimezoneProvider` and user preference context.
|
|
23
|
+
* The time zone to use for the date.
|
|
24
|
+
* See the formatDateUtil function for more information.
|
|
29
25
|
*/
|
|
30
26
|
timeZone?: string;
|
|
31
27
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
28
|
+
* The locale to use for the date.
|
|
29
|
+
* See the formatDateUtil function for more information.
|
|
34
30
|
*/
|
|
35
31
|
locale?: string;
|
|
36
32
|
}
|
|
@@ -90,4 +86,7 @@ export interface DateTimeCellProps extends CommonProps, Refable<HTMLDivElement>,
|
|
|
90
86
|
* @param {DateTimeCellProps} props - The props for the DateTimeCell component
|
|
91
87
|
* @returns {ReactElement} DateTimeCell component
|
|
92
88
|
*/
|
|
93
|
-
export declare const DateTimeCell: ({ format, date, withTimeSince, className, "data-testid": dataTestId, style,
|
|
89
|
+
export declare const DateTimeCell: ({ format, timeZone, locale, date, withTimeSince, className, "data-testid": dataTestId, style, }: DateTimeCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
90
|
+
export interface TimeSinceProps extends Pick<DateTimeCellProps, "date" | "timeZone" | "locale"> {
|
|
91
|
+
date: Date;
|
|
92
|
+
}
|