@sunggang/ui-lib 0.1.20 → 0.1.22
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.esm.css
CHANGED
package/index.esm2.js
CHANGED
|
@@ -6600,7 +6600,6 @@ var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
6600
6600
|
ref: ref
|
|
6601
6601
|
}, props));
|
|
6602
6602
|
});
|
|
6603
|
-
Button.displayName = "Button";
|
|
6604
6603
|
|
|
6605
6604
|
function _define_property$1(obj, key, value) {
|
|
6606
6605
|
if (key in obj) {
|
|
@@ -6881,7 +6880,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
6881
6880
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
6882
6881
|
}
|
|
6883
6882
|
function DateRangePicker(param) {
|
|
6884
|
-
var className = param.className, disable = param.disable, onChange = param.onChange, dates = param.dates;
|
|
6883
|
+
var className = param.className, inputClassName = param.inputClassName, disable = param.disable, _param_isShowCleanBtn = param.isShowCleanBtn, isShowCleanBtn = _param_isShowCleanBtn === void 0 ? true : _param_isShowCleanBtn, onChange = param.onChange, dates = param.dates;
|
|
6885
6884
|
var _useState = _sliced_to_array(useState({
|
|
6886
6885
|
from: (dates === null || dates === void 0 ? void 0 : dates.from) || undefined,
|
|
6887
6886
|
to: (dates === null || dates === void 0 ? void 0 : dates.to) || undefined
|
|
@@ -6892,50 +6891,62 @@ function DateRangePicker(param) {
|
|
|
6892
6891
|
if (onChange) onChange(newDate);
|
|
6893
6892
|
}
|
|
6894
6893
|
};
|
|
6895
|
-
return /*#__PURE__*/
|
|
6896
|
-
className:
|
|
6897
|
-
children:
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
children:
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
className: "
|
|
6908
|
-
}),
|
|
6909
|
-
(date === null || date === void 0 ? void 0 : date.from) ? date.to ? /*#__PURE__*/ jsxs(Fragment$1, {
|
|
6894
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
6895
|
+
className: "flex gap-2 items-center",
|
|
6896
|
+
children: [
|
|
6897
|
+
/*#__PURE__*/ jsx("div", {
|
|
6898
|
+
className: cn("grid gap-2", className, disable ? "pointer-events-none opacity-55" : "pointer-events-auto opacity-100"),
|
|
6899
|
+
children: /*#__PURE__*/ jsxs(Popover, {
|
|
6900
|
+
children: [
|
|
6901
|
+
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
6902
|
+
asChild: true,
|
|
6903
|
+
children: /*#__PURE__*/ jsxs(Button, {
|
|
6904
|
+
id: "date",
|
|
6905
|
+
variant: "outline",
|
|
6906
|
+
className: cn("w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground", inputClassName),
|
|
6910
6907
|
children: [
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6908
|
+
/*#__PURE__*/ jsx(Calendar$1, {
|
|
6909
|
+
className: "mr-2 h-4 w-4"
|
|
6910
|
+
}),
|
|
6911
|
+
(date === null || date === void 0 ? void 0 : date.from) ? date.to ? /*#__PURE__*/ jsxs(Fragment$1, {
|
|
6912
|
+
children: [
|
|
6913
|
+
format(date.from, "yyyy-MM-dd"),
|
|
6914
|
+
" -",
|
|
6915
|
+
" ",
|
|
6916
|
+
format(date.to, "yyyy-MM-dd")
|
|
6917
|
+
]
|
|
6918
|
+
}) : format(date.from, "yyyy-MM-dd") : /*#__PURE__*/ jsx("span", {
|
|
6919
|
+
children: "請選擇日期"
|
|
6920
|
+
})
|
|
6915
6921
|
]
|
|
6916
|
-
}) : format(date.from, "yyyy-MM-dd") : /*#__PURE__*/ jsx("span", {
|
|
6917
|
-
children: "請選擇日期"
|
|
6918
6922
|
})
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6923
|
+
}),
|
|
6924
|
+
/*#__PURE__*/ jsx(PopoverContent, {
|
|
6925
|
+
className: "w-auto p-0",
|
|
6926
|
+
align: "start",
|
|
6927
|
+
children: /*#__PURE__*/ jsx(Calendar, {
|
|
6928
|
+
initialFocus: true,
|
|
6929
|
+
mode: "range",
|
|
6930
|
+
defaultMonth: date === null || date === void 0 ? void 0 : date.from,
|
|
6931
|
+
selected: date,
|
|
6932
|
+
onSelect: handleDateChange,
|
|
6933
|
+
numberOfMonths: 2
|
|
6934
|
+
})
|
|
6935
|
+
})
|
|
6936
|
+
]
|
|
6933
6937
|
})
|
|
6934
|
-
|
|
6935
|
-
|
|
6938
|
+
}),
|
|
6939
|
+
isShowCleanBtn && /*#__PURE__*/ jsx(Button, {
|
|
6940
|
+
variant: "ghost",
|
|
6941
|
+
className: cn("justify-start text-left font-normal"),
|
|
6942
|
+
onClick: function() {
|
|
6943
|
+
return setDate(undefined);
|
|
6944
|
+
},
|
|
6945
|
+
children: "清除日期"
|
|
6946
|
+
})
|
|
6947
|
+
]
|
|
6936
6948
|
});
|
|
6937
6949
|
}
|
|
6938
|
-
DateRangePicker.displayName = "DateRangePicker";
|
|
6939
6950
|
|
|
6940
6951
|
// Use this file to export React client components (e.g. those with 'use client' directive) or other non-server utilities
|
|
6941
6952
|
var CkEditor = dynamic(function() {
|
package/index.esm3.js
CHANGED
|
@@ -64138,10 +64138,6 @@ function _ts_values(o) {
|
|
|
64138
64138
|
|
|
64139
64139
|
var Editor = /*@__PURE__*/getDefaultExportFromCjs(ckeditor.exports);
|
|
64140
64140
|
|
|
64141
|
-
// interface CkeditorProps {
|
|
64142
|
-
// content: string;
|
|
64143
|
-
// setContent: (content: string) => void;
|
|
64144
|
-
// }
|
|
64145
64141
|
var CkEditor = function(param) {
|
|
64146
64142
|
var content = param.content, setContent = param.setContent;
|
|
64147
64143
|
return /*#__PURE__*/ jsx(dist.exports.CKEditor, {
|
package/package.json
CHANGED
|
@@ -5,12 +5,11 @@ interface DateRangeType {
|
|
|
5
5
|
}
|
|
6
6
|
interface DateRangePickerProps {
|
|
7
7
|
className?: string;
|
|
8
|
+
inputClassName?: string;
|
|
8
9
|
disable?: boolean;
|
|
10
|
+
isShowCleanBtn?: boolean;
|
|
9
11
|
onChange?: (date: DateRange) => void;
|
|
10
12
|
dates?: DateRangeType;
|
|
11
13
|
}
|
|
12
|
-
declare function DateRangePicker({ className, disable, onChange, dates, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare namespace DateRangePicker {
|
|
14
|
-
var displayName: string;
|
|
15
|
-
}
|
|
14
|
+
declare function DateRangePicker({ className, inputClassName, disable, isShowCleanBtn, onChange, dates, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export { DateRangePicker };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
interface SinglePickerProps {
|
|
2
3
|
disable?: boolean;
|
|
3
4
|
onChange?: (date: Date) => void;
|
|
4
5
|
}
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
var displayName: string;
|
|
8
|
-
}
|
|
9
|
-
export { SingleDatePicker };
|
|
6
|
+
export declare const SingleDatePicker: React.FC<SinglePickerProps>;
|
|
7
|
+
export default SingleDatePicker;
|