@k3-universe/react-kit 0.0.43 → 0.0.45
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/dist/index.js +20 -8
- package/dist/kit/builder/data-table/components/DataTablePagination.d.ts.map +1 -1
- package/dist/kit/builder/form/components/fields/DateField.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/kit/builder/data-table/components/DataTablePagination.tsx +5 -1
- package/src/kit/builder/form/components/fields/DateField.tsx +16 -5
- package/src/kit/components/datepicker/DatePicker.tsx +1 -1
- package/src/kit/components/datetimepicker/DateTimePicker.tsx +1 -1
- package/src/kit/components/monthpicker/MonthInput.tsx +1 -1
- package/src/kit/components/timepicker/TimePicker.tsx +1 -1
- package/src/shadcn/ui/table.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -9195,7 +9195,7 @@ function TableHead({ className, ...props2 }) {
|
|
|
9195
9195
|
{
|
|
9196
9196
|
"data-slot": "table-head",
|
|
9197
9197
|
className: cn$1(
|
|
9198
|
-
"text-
|
|
9198
|
+
"bg-primary text-white h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
9199
9199
|
className
|
|
9200
9200
|
),
|
|
9201
9201
|
...props2
|
|
@@ -22532,6 +22532,15 @@ function DateField({
|
|
|
22532
22532
|
onChange,
|
|
22533
22533
|
className
|
|
22534
22534
|
}) {
|
|
22535
|
+
const parseDateValueForInput = (date2) => {
|
|
22536
|
+
if (date2 instanceof Date) {
|
|
22537
|
+
return date2.toISOString().split("T")[0];
|
|
22538
|
+
}
|
|
22539
|
+
if (typeof date2 === "string") {
|
|
22540
|
+
return parseDateValueForInput(new Date(date2));
|
|
22541
|
+
}
|
|
22542
|
+
return "";
|
|
22543
|
+
};
|
|
22535
22544
|
return /* @__PURE__ */ jsx(
|
|
22536
22545
|
Input,
|
|
22537
22546
|
{
|
|
@@ -22539,7 +22548,10 @@ function DateField({
|
|
|
22539
22548
|
disabled: field.disabled || field.readOnly,
|
|
22540
22549
|
placeholder: field.placeholder,
|
|
22541
22550
|
type: "date",
|
|
22542
|
-
value:
|
|
22551
|
+
value: parseDateValueForInput(value),
|
|
22552
|
+
defaultValue: parseDateValueForInput(value),
|
|
22553
|
+
min: parseDateValueForInput(field.minDate),
|
|
22554
|
+
max: parseDateValueForInput(field.maxDate),
|
|
22543
22555
|
onChange: (e2) => onChange(e2.target.value ? new Date(e2.target.value) : null)
|
|
22544
22556
|
}
|
|
22545
22557
|
);
|
|
@@ -26771,7 +26783,7 @@ function DatePicker({
|
|
|
26771
26783
|
disabled,
|
|
26772
26784
|
variant: buttonVariant,
|
|
26773
26785
|
className: cn$1(
|
|
26774
|
-
"w-
|
|
26786
|
+
"w-full justify-start text-left font-normal",
|
|
26775
26787
|
!value && "text-muted-foreground"
|
|
26776
26788
|
),
|
|
26777
26789
|
children: [
|
|
@@ -27480,7 +27492,7 @@ function MonthInput({
|
|
|
27480
27492
|
disabled,
|
|
27481
27493
|
variant: buttonVariant,
|
|
27482
27494
|
className: cn$1(
|
|
27483
|
-
"w-
|
|
27495
|
+
"w-full justify-start text-left font-normal",
|
|
27484
27496
|
!value && "text-muted-foreground"
|
|
27485
27497
|
),
|
|
27486
27498
|
children: [
|
|
@@ -28101,7 +28113,7 @@ function TimePicker({
|
|
|
28101
28113
|
disabled,
|
|
28102
28114
|
variant: buttonVariant,
|
|
28103
28115
|
className: cn$1(
|
|
28104
|
-
"w-
|
|
28116
|
+
"w-full justify-start text-left font-normal",
|
|
28105
28117
|
!value && "text-muted-foreground"
|
|
28106
28118
|
),
|
|
28107
28119
|
children: [
|
|
@@ -28753,7 +28765,7 @@ function DateTimePicker({
|
|
|
28753
28765
|
disabled,
|
|
28754
28766
|
variant: buttonVariant,
|
|
28755
28767
|
className: cn$1(
|
|
28756
|
-
"w-
|
|
28768
|
+
"w-full flex justify-start text-left font-normal",
|
|
28757
28769
|
!value && "text-muted-foreground"
|
|
28758
28770
|
),
|
|
28759
28771
|
children: [
|
|
@@ -38375,12 +38387,12 @@ function DataTablePagination({
|
|
|
38375
38387
|
}
|
|
38376
38388
|
)
|
|
38377
38389
|
] }),
|
|
38378
|
-
/* @__PURE__ */
|
|
38390
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: table.getRowCount() > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38379
38391
|
"Page ",
|
|
38380
38392
|
pagination.pageIndex + 1,
|
|
38381
38393
|
" of ",
|
|
38382
38394
|
table.getPageCount()
|
|
38383
|
-
] }),
|
|
38395
|
+
] }) : "Page 0 of 0" }),
|
|
38384
38396
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
38385
38397
|
/* @__PURE__ */ jsxs(
|
|
38386
38398
|
Button$1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTablePagination.d.ts","sourceRoot":"","sources":["../../../../../src/kit/builder/data-table/components/DataTablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,MAAM,WAAW,wBAAwB,CAAC,KAAK;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,EACzC,KAAK,EACL,iBAA0B,GAC3B,EAAE,wBAAwB,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"DataTablePagination.d.ts","sourceRoot":"","sources":["../../../../../src/kit/builder/data-table/components/DataTablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,MAAM,WAAW,wBAAwB,CAAC,KAAK;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,EACzC,KAAK,EACL,iBAA0B,GAC3B,EAAE,wBAAwB,CAAC,KAAK,CAAC,2CA2FjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../../../src/kit/builder/form/components/fields/DateField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../../../src/kit/builder/form/components/fields/DateField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE,gBAAgB,2CA4BlB"}
|
package/package.json
CHANGED
|
@@ -58,7 +58,11 @@ export function DataTablePagination<TData>({
|
|
|
58
58
|
</div>
|
|
59
59
|
)}
|
|
60
60
|
<div className="flex w-[100px] items-center justify-center text-sm font-medium">
|
|
61
|
-
|
|
61
|
+
{table.getRowCount() > 0
|
|
62
|
+
? (
|
|
63
|
+
<>Page {pagination.pageIndex + 1} of {table.getPageCount()}</>
|
|
64
|
+
)
|
|
65
|
+
: "Page 0 of 0"}
|
|
62
66
|
</div>
|
|
63
67
|
<div className="flex items-center space-x-2">
|
|
64
68
|
<Button
|
|
@@ -7,17 +7,28 @@ export function DateField({
|
|
|
7
7
|
onChange,
|
|
8
8
|
className,
|
|
9
9
|
}: FieldRenderProps) {
|
|
10
|
+
const parseDateValueForInput = (date: unknown) => {
|
|
11
|
+
if (date instanceof Date) {
|
|
12
|
+
return date.toISOString().split('T')[0];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof date === 'string') {
|
|
16
|
+
return parseDateValueForInput(new Date(date));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
return (
|
|
11
23
|
<Input
|
|
12
24
|
className={className}
|
|
13
25
|
disabled={field.disabled || field.readOnly}
|
|
14
26
|
placeholder={field.placeholder}
|
|
15
27
|
type="date"
|
|
16
|
-
value={
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
28
|
+
value={parseDateValueForInput(value)}
|
|
29
|
+
defaultValue={parseDateValueForInput(value)}
|
|
30
|
+
min={parseDateValueForInput(field.minDate)}
|
|
31
|
+
max={parseDateValueForInput(field.maxDate)}
|
|
21
32
|
onChange={(e) =>
|
|
22
33
|
onChange(e.target.value ? new Date(e.target.value) : null)
|
|
23
34
|
}
|
|
@@ -114,7 +114,7 @@ export function DatePicker({
|
|
|
114
114
|
disabled={disabled}
|
|
115
115
|
variant={buttonVariant}
|
|
116
116
|
className={cn(
|
|
117
|
-
'w-
|
|
117
|
+
'w-full justify-start text-left font-normal',
|
|
118
118
|
!value && 'text-muted-foreground',
|
|
119
119
|
)}
|
|
120
120
|
>
|
|
@@ -312,7 +312,7 @@ export function DateTimePicker({
|
|
|
312
312
|
disabled={disabled}
|
|
313
313
|
variant={buttonVariant}
|
|
314
314
|
className={cn(
|
|
315
|
-
'w-
|
|
315
|
+
'w-full flex justify-start text-left font-normal',
|
|
316
316
|
!value && 'text-muted-foreground',
|
|
317
317
|
)}
|
|
318
318
|
>
|
|
@@ -169,7 +169,7 @@ export function TimePicker({
|
|
|
169
169
|
disabled={disabled}
|
|
170
170
|
variant={buttonVariant}
|
|
171
171
|
className={cn(
|
|
172
|
-
'w-
|
|
172
|
+
'w-full justify-start text-left font-normal',
|
|
173
173
|
!value && 'text-muted-foreground',
|
|
174
174
|
)}
|
|
175
175
|
>
|
package/src/shadcn/ui/table.tsx
CHANGED
|
@@ -70,7 +70,7 @@ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
|
70
70
|
<th
|
|
71
71
|
data-slot="table-head"
|
|
72
72
|
className={cn(
|
|
73
|
-
'text-
|
|
73
|
+
'bg-primary text-white h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
|
|
74
74
|
className,
|
|
75
75
|
)}
|
|
76
76
|
{...props}
|