@sunggang/ui-lib 0.1.16 → 0.1.17
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.esm2.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
4
4
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import {
|
|
7
|
+
import { format } from 'date-fns';
|
|
8
8
|
import { Calendar as Calendar$1 } from 'lucide-react';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import { cva } from 'class-variance-authority';
|
|
@@ -6810,10 +6810,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
6810
6810
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
6811
6811
|
}
|
|
6812
6812
|
function DateRangePicker(param) {
|
|
6813
|
-
var className = param.className, disable = param.disable, onChange = param.onChange;
|
|
6813
|
+
var className = param.className, disable = param.disable, onChange = param.onChange, dates = param.dates;
|
|
6814
|
+
console.log(dates);
|
|
6814
6815
|
var _useState = _sliced_to_array(useState({
|
|
6815
|
-
from:
|
|
6816
|
-
to:
|
|
6816
|
+
from: (dates === null || dates === void 0 ? void 0 : dates.from) || undefined,
|
|
6817
|
+
to: (dates === null || dates === void 0 ? void 0 : dates.to) || undefined
|
|
6817
6818
|
}), 2), date = _useState[0], setDate = _useState[1];
|
|
6818
6819
|
var handleDateChange = function(newDate) {
|
|
6819
6820
|
if (newDate) {
|
|
@@ -6843,7 +6844,7 @@ function DateRangePicker(param) {
|
|
|
6843
6844
|
format(date.to, "yyyy-MM-dd")
|
|
6844
6845
|
]
|
|
6845
6846
|
}) : format(date.from, "yyyy-MM-dd") : /*#__PURE__*/ jsx("span", {
|
|
6846
|
-
children: "
|
|
6847
|
+
children: "請選擇日期"
|
|
6847
6848
|
})
|
|
6848
6849
|
]
|
|
6849
6850
|
})
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { DateRange } from 'react-day-picker';
|
|
2
|
+
interface DateRangeType {
|
|
3
|
+
from: Date | undefined;
|
|
4
|
+
to: Date | undefined;
|
|
5
|
+
}
|
|
2
6
|
interface DateRangePickerProps {
|
|
3
7
|
className?: string;
|
|
4
8
|
disable?: boolean;
|
|
5
9
|
onChange?: (date: DateRange) => void;
|
|
10
|
+
dates?: DateRangeType;
|
|
6
11
|
}
|
|
7
|
-
declare function DateRangePicker({ className, disable, onChange, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DateRangePicker({ className, disable, onChange, dates, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
13
|
declare namespace DateRangePicker {
|
|
9
14
|
var displayName: string;
|
|
10
15
|
}
|