@pinnacle0/web-ui 0.6.45 → 0.7.0-beta.1
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/admin/AdminApp/Default/NavigatorSide/index.js +1 -1
- package/admin/AdminApp/Default/NavigatorSide/index.js.map +1 -1
- package/core/Amount/AmountPercentage.d.ts +1 -4
- package/core/Amount/AmountPercentage.js +5 -8
- package/core/Amount/AmountPercentage.js.map +1 -1
- package/core/Amount/index.d.ts +3 -8
- package/core/Amount/index.js +27 -35
- package/core/Amount/index.js.map +1 -1
- package/core/AuthenticationCodeInput/index.less +1 -1
- package/core/AutoCompleteInput/index.d.ts +2 -5
- package/core/AutoCompleteInput/index.js +5 -7
- package/core/AutoCompleteInput/index.js.map +1 -1
- package/core/BoolSwitch/index.d.ts +5 -7
- package/core/BoolSwitch/index.js +11 -13
- package/core/BoolSwitch/index.js.map +1 -1
- package/core/Breadcrumb/index.d.ts +1 -5
- package/core/Breadcrumb/index.js +8 -16
- package/core/Breadcrumb/index.js.map +1 -1
- package/core/Button/index.d.ts +2 -2
- package/core/Button/index.js +3 -2
- package/core/Button/index.js.map +1 -1
- package/core/Card/index.d.ts +3 -6
- package/core/Card/index.js +4 -7
- package/core/Card/index.js.map +1 -1
- package/core/Carousel/index.d.ts +1 -4
- package/core/Carousel/index.js +4 -7
- package/core/Carousel/index.js.map +1 -1
- package/core/Carousel3D/index.d.ts +1 -21
- package/core/Carousel3D/index.js +76 -83
- package/core/Carousel3D/index.js.map +1 -1
- package/core/Cascader/InitialNullable.d.ts +1 -4
- package/core/Cascader/InitialNullable.js +5 -8
- package/core/Cascader/InitialNullable.js.map +1 -1
- package/core/Cascader/Nullable.d.ts +2 -7
- package/core/Cascader/Nullable.js +10 -12
- package/core/Cascader/Nullable.js.map +1 -1
- package/core/Cascader/index.d.ts +4 -13
- package/core/Cascader/index.js +18 -20
- package/core/Cascader/index.js.map +1 -1
- package/core/Checkbox/index.d.ts +4 -7
- package/core/Checkbox/index.js +4 -9
- package/core/Checkbox/index.js.map +1 -1
- package/core/Collapse/index.d.ts +2 -7
- package/core/Collapse/index.js +4 -6
- package/core/Collapse/index.js.map +1 -1
- package/core/Countdown/SlidingDigit.d.ts +1 -10
- package/core/Countdown/SlidingDigit.js +16 -21
- package/core/Countdown/SlidingDigit.js.map +1 -1
- package/core/Countdown/index.d.ts +1 -18
- package/core/Countdown/index.js +53 -74
- package/core/Countdown/index.js.map +1 -1
- package/core/DarkOverlay/index.d.ts +1 -4
- package/core/DarkOverlay/index.js +4 -7
- package/core/DarkOverlay/index.js.map +1 -1
- package/core/DateCalendar/index.d.ts +2 -13
- package/core/DateCalendar/index.js +12 -14
- package/core/DateCalendar/index.js.map +1 -1
- package/core/DatePicker/index.d.ts +1 -7
- package/core/DatePicker/index.js +9 -16
- package/core/DatePicker/index.js.map +1 -1
- package/core/DateRangePicker/index.d.ts +1 -14
- package/core/DateRangePicker/index.js +25 -34
- package/core/DateRangePicker/index.js.map +1 -1
- package/core/DateTimePicker/index.d.ts +1 -7
- package/core/DateTimePicker/index.js +12 -21
- package/core/DateTimePicker/index.js.map +1 -1
- package/core/DateTimeRangePicker/index.d.ts +1 -17
- package/core/DateTimeRangePicker/index.js +21 -31
- package/core/DateTimeRangePicker/index.js.map +1 -1
- package/core/Descriptions/index.d.ts +3 -8
- package/core/Descriptions/index.js +7 -13
- package/core/Descriptions/index.js.map +1 -1
- package/core/Descriptions/index.less +0 -8
- package/core/DocumentTitle/index.d.ts +4 -13
- package/core/DocumentTitle/index.js +18 -31
- package/core/DocumentTitle/index.js.map +1 -1
- package/core/Drawer/index.d.ts +1 -3
- package/core/Drawer/index.js +4 -5
- package/core/Drawer/index.js.map +1 -1
- package/core/Dropdown/index.d.ts +3 -4
- package/core/Dropdown/index.js +4 -3
- package/core/Dropdown/index.js.map +1 -1
- package/core/EnumCheckboxGroup/Map.d.ts +1 -4
- package/core/EnumCheckboxGroup/Map.js +5 -9
- package/core/EnumCheckboxGroup/Map.js.map +1 -1
- package/core/EnumCheckboxGroup/index.d.ts +3 -4
- package/core/EnumCheckboxGroup/index.js +11 -12
- package/core/EnumCheckboxGroup/index.js.map +1 -1
- package/core/EnumRadio/InitialNullable.d.ts +1 -5
- package/core/EnumRadio/InitialNullable.js +6 -9
- package/core/EnumRadio/InitialNullable.js.map +1 -1
- package/core/EnumRadio/Map.d.ts +1 -4
- package/core/EnumRadio/Map.js +6 -9
- package/core/EnumRadio/Map.js.map +1 -1
- package/core/EnumRadio/Nullable.d.ts +1 -5
- package/core/EnumRadio/Nullable.js +12 -14
- package/core/EnumRadio/Nullable.js.map +1 -1
- package/core/EnumRadio/index.d.ts +5 -12
- package/core/EnumRadio/index.js +9 -17
- package/core/EnumRadio/index.js.map +1 -1
- package/core/EnumSelect/InitialNullable.d.ts +1 -4
- package/core/EnumSelect/InitialNullable.js +4 -8
- package/core/EnumSelect/InitialNullable.js.map +1 -1
- package/core/EnumSelect/Map.d.ts +1 -4
- package/core/EnumSelect/Map.js +6 -9
- package/core/EnumSelect/Map.js.map +1 -1
- package/core/EnumSelect/Nullable.d.ts +1 -5
- package/core/EnumSelect/Nullable.js +12 -14
- package/core/EnumSelect/Nullable.js.map +1 -1
- package/core/EnumSelect/index.d.ts +5 -15
- package/core/EnumSelect/index.js +19 -27
- package/core/EnumSelect/index.js.map +1 -1
- package/core/EnumSelect/index.less +1 -1
- package/core/FlatList/Content/Footer/index.js +3 -2
- package/core/FlatList/Content/Footer/index.js.map +1 -1
- package/core/FlatList/Content/index.d.ts +1 -1
- package/core/FlatList/Content/index.js +10 -8
- package/core/FlatList/Content/index.js.map +1 -1
- package/core/FlatList/FloatingLoader/index.js +3 -2
- package/core/FlatList/FloatingLoader/index.js.map +1 -1
- package/core/FlatList/Refresh/index.js +3 -2
- package/core/FlatList/Refresh/index.js.map +1 -1
- package/core/FlatList/index.d.ts +1 -1
- package/core/FlatList/index.js +10 -9
- package/core/FlatList/index.js.map +1 -1
- package/core/FlatList/shared/Loader/index.js +3 -2
- package/core/FlatList/shared/Loader/index.js.map +1 -1
- package/core/Form/Item.d.ts +1 -16
- package/core/Form/Item.js +28 -40
- package/core/Form/Item.js.map +1 -1
- package/core/Form/index.d.ts +6 -17
- package/core/Form/index.js +29 -46
- package/core/Form/index.js.map +1 -1
- package/core/Form/index.less +1 -1
- package/core/Grid/index.d.ts +2 -2
- package/core/Grid/index.js +2 -1
- package/core/Grid/index.js.map +1 -1
- package/core/HTMLContent/index.d.ts +1 -4
- package/core/HTMLContent/index.js +4 -7
- package/core/HTMLContent/index.js.map +1 -1
- package/core/Image/index.d.ts +3 -6
- package/core/Image/index.js +6 -7
- package/core/Image/index.js.map +1 -1
- package/core/ImageUploader/index.d.ts +2 -11
- package/core/ImageUploader/index.js +17 -25
- package/core/ImageUploader/index.js.map +1 -1
- package/core/Input/index.d.ts +12 -18
- package/core/Input/index.js +37 -41
- package/core/Input/index.js.map +1 -1
- package/core/LabelledSelect/index.d.ts +3 -5
- package/core/LabelledSelect/index.js +4 -7
- package/core/LabelledSelect/index.js.map +1 -1
- package/core/Link/index.d.ts +1 -4
- package/core/Link/index.js +16 -19
- package/core/Link/index.js.map +1 -1
- package/core/LocalImporter/index.d.ts +1 -10
- package/core/LocalImporter/index.js +11 -18
- package/core/LocalImporter/index.js.map +1 -1
- package/core/LocaleSelect/index.d.ts +1 -10
- package/core/LocaleSelect/index.js +16 -18
- package/core/LocaleSelect/index.js.map +1 -1
- package/core/Markdown/index.d.ts +1 -7
- package/core/Markdown/index.js +13 -16
- package/core/Markdown/index.js.map +1 -1
- package/core/Modal/index.less +1 -1
- package/core/MultipleCascader/index.d.ts +1 -9
- package/core/MultipleCascader/index.js +15 -19
- package/core/MultipleCascader/index.js.map +1 -1
- package/core/MultipleEnumSelect/index.d.ts +1 -8
- package/core/MultipleEnumSelect/index.js +9 -15
- package/core/MultipleEnumSelect/index.js.map +1 -1
- package/core/MultipleSelector/TablePopover.d.ts +1 -7
- package/core/MultipleSelector/TablePopover.js +23 -26
- package/core/MultipleSelector/TablePopover.js.map +1 -1
- package/core/MultipleSelector/index.d.ts +1 -9
- package/core/MultipleSelector/index.js +18 -26
- package/core/MultipleSelector/index.js.map +1 -1
- package/core/MutableTable/index.d.ts +1 -13
- package/core/MutableTable/index.js +25 -35
- package/core/MutableTable/index.js.map +1 -1
- package/core/NumberInput/NumberInputPercentage.d.ts +1 -8
- package/core/NumberInput/NumberInputPercentage.js +8 -25
- package/core/NumberInput/NumberInputPercentage.js.map +1 -1
- package/core/NumberInput/index.d.ts +5 -33
- package/core/NumberInput/index.js +44 -72
- package/core/NumberInput/index.js.map +1 -1
- package/core/OverflowableText/index.d.ts +1 -12
- package/core/OverflowableText/index.js +11 -28
- package/core/OverflowableText/index.js.map +1 -1
- package/core/Pagination/index.d.ts +1 -7
- package/core/Pagination/index.js +17 -19
- package/core/Pagination/index.js.map +1 -1
- package/core/Popover/index.d.ts +0 -1
- package/core/Popover/index.js +2 -5
- package/core/Popover/index.js.map +1 -1
- package/core/Progress/index.d.ts +1 -4
- package/core/Progress/index.js +4 -6
- package/core/Progress/index.js.map +1 -1
- package/core/Radio/index.d.ts +5 -7
- package/core/Radio/index.js +2 -8
- package/core/Radio/index.js.map +1 -1
- package/core/RelativeTime/index.d.ts +1 -15
- package/core/RelativeTime/index.js +17 -31
- package/core/RelativeTime/index.js.map +1 -1
- package/core/Resizable/index.js +3 -2
- package/core/Resizable/index.js.map +1 -1
- package/core/SearchableSelect/index.d.ts +3 -5
- package/core/SearchableSelect/index.js +4 -7
- package/core/SearchableSelect/index.js.map +1 -1
- package/core/Select/index.d.ts +8 -7
- package/core/Select/index.js +8 -8
- package/core/Select/index.js.map +1 -1
- package/core/SignedAmountInput/index.d.ts +1 -8
- package/core/SignedAmountInput/index.js +16 -24
- package/core/SignedAmountInput/index.js.map +1 -1
- package/core/Skeleton/index.d.ts +1 -4
- package/core/Skeleton/index.js +4 -7
- package/core/Skeleton/index.js.map +1 -1
- package/core/Slider/RangeSlider.d.ts +2 -6
- package/core/Slider/RangeSlider.js +4 -7
- package/core/Slider/RangeSlider.js.map +1 -1
- package/core/Slider/index.d.ts +3 -7
- package/core/Slider/index.js +15 -20
- package/core/Slider/index.js.map +1 -1
- package/core/Space/index.d.ts +3 -5
- package/core/Space/index.js +4 -7
- package/core/Space/index.js.map +1 -1
- package/core/Spin/index.d.ts +3 -6
- package/core/Spin/index.js +4 -7
- package/core/Spin/index.js.map +1 -1
- package/core/StepFormContainer/index.d.ts +2 -7
- package/core/StepFormContainer/index.js +13 -17
- package/core/StepFormContainer/index.js.map +1 -1
- package/core/Steps/index.d.ts +3 -6
- package/core/Steps/index.js +4 -6
- package/core/Steps/index.js.map +1 -1
- package/core/Table/index.d.ts +6 -34
- package/core/Table/index.js +64 -80
- package/core/Table/index.js.map +1 -1
- package/core/Tabs/Single.d.ts +1 -4
- package/core/Tabs/Single.js +4 -7
- package/core/Tabs/Single.js.map +1 -1
- package/core/Tabs/index.d.ts +3 -13
- package/core/Tabs/index.js +27 -35
- package/core/Tabs/index.js.map +1 -1
- package/core/Tag/index.d.ts +2 -5
- package/core/Tag/index.js +4 -6
- package/core/Tag/index.js.map +1 -1
- package/core/TagInput/index.d.ts +2 -15
- package/core/TagInput/index.js +25 -41
- package/core/TagInput/index.js.map +1 -1
- package/core/Tags/index.d.ts +1 -6
- package/core/Tags/index.js +9 -13
- package/core/Tags/index.js.map +1 -1
- package/core/TimePicker/index.d.ts +1 -7
- package/core/TimePicker/index.js +8 -11
- package/core/TimePicker/index.js.map +1 -1
- package/core/TimeRangePicker/index.d.ts +1 -14
- package/core/TimeRangePicker/index.js +21 -27
- package/core/TimeRangePicker/index.js.map +1 -1
- package/core/Tooltip/index.d.ts +3 -4
- package/core/Tooltip/index.js +2 -5
- package/core/Tooltip/index.js.map +1 -1
- package/core/TypedTabs/index.d.ts +1 -4
- package/core/TypedTabs/index.js +16 -18
- package/core/TypedTabs/index.js.map +1 -1
- package/core/Uploader/index.d.ts +1 -17
- package/core/Uploader/index.js +25 -31
- package/core/Uploader/index.js.map +1 -1
- package/core/VirtualList/index.d.ts +1 -1
- package/core/VirtualList/index.js +3 -2
- package/core/VirtualList/index.js.map +1 -1
- package/core/VirtualTable/{TableHeader.js → OldVirtualTable/TableHeader.js} +2 -2
- package/core/VirtualTable/OldVirtualTable/TableHeader.js.map +1 -0
- package/core/VirtualTable/{TableRow.js → OldVirtualTable/TableRow.js} +2 -2
- package/core/VirtualTable/OldVirtualTable/TableRow.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnWidths.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useColumnWidths.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnsStickyPosition.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useColumnsStickyPosition.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useRowSelection.d.ts +1 -1
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useRowSelection.js +2 -2
- package/core/VirtualTable/OldVirtualTable/hooks/useRowSelection.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/hooks/useScroll.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScrollBarSize.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useScrollBarSize.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/index.d.ts +28 -0
- package/core/VirtualTable/OldVirtualTable/index.js +58 -0
- package/core/VirtualTable/OldVirtualTable/index.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/index.old.less +160 -0
- package/core/VirtualTable/OldVirtualTable/type.js.map +1 -0
- package/core/VirtualTable/index.d.ts +24 -23
- package/core/VirtualTable/index.js +54 -50
- package/core/VirtualTable/index.js.map +1 -1
- package/core/VirtualTable/index.less +28 -140
- package/core/WithExplanation/index.d.ts +1 -6
- package/core/WithExplanation/index.js +11 -20
- package/core/WithExplanation/index.js.map +1 -1
- package/core/WithTooltipList/index.d.ts +1 -9
- package/core/WithTooltipList/index.js +28 -27
- package/core/WithTooltipList/index.js.map +1 -1
- package/core/YearMonthSelector/index.d.ts +1 -7
- package/core/YearMonthSelector/index.js +9 -15
- package/core/YearMonthSelector/index.js.map +1 -1
- package/css/global.less +0 -9
- package/hooks/useParentResizeObserver/index.d.ts +2 -0
- package/hooks/useParentResizeObserver/index.js +17 -0
- package/hooks/useParentResizeObserver/index.js.map +1 -0
- package/hooks/useResizeObserver/index.d.ts +1 -1
- package/hooks/useResizeObserver/index.js +6 -10
- package/hooks/useResizeObserver/index.js.map +1 -1
- package/package.json +9 -9
- package/util/ModalUtil/index.less +1 -1
- package/util/PromptUtil/PromptBody.d.ts +4 -13
- package/util/PromptUtil/PromptBody.js +19 -28
- package/util/PromptUtil/PromptBody.js.map +1 -1
- package/util/PromptUtil/index.js +1 -1
- package/util/PromptUtil/index.js.map +1 -1
- package/util/ReactUtil/index.d.ts +20 -0
- package/util/ReactUtil/index.js +35 -0
- package/util/ReactUtil/index.js.map +1 -1
- package/core/VirtualTable/TableHeader.js.map +0 -1
- package/core/VirtualTable/TableRow.js.map +0 -1
- package/core/VirtualTable/hooks/useColumnWidths.js.map +0 -1
- package/core/VirtualTable/hooks/useColumnsStickyPosition.js.map +0 -1
- package/core/VirtualTable/hooks/useRowSelection.js.map +0 -1
- package/core/VirtualTable/hooks/useScroll.js.map +0 -1
- package/core/VirtualTable/hooks/useScrollBarSize.js.map +0 -1
- package/core/VirtualTable/type.js.map +0 -1
- /package/core/VirtualTable/{TableHeader.d.ts → OldVirtualTable/TableHeader.d.ts} +0 -0
- /package/core/VirtualTable/{TableRow.d.ts → OldVirtualTable/TableRow.d.ts} +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnWidths.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnsStickyPosition.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScroll.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScroll.js +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScrollBarSize.d.ts +0 -0
- /package/core/VirtualTable/{type.d.ts → OldVirtualTable/type.d.ts} +0 -0
- /package/core/VirtualTable/{type.js → OldVirtualTable/type.js} +0 -0
|
@@ -2,16 +2,20 @@ import React from "react";
|
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
import DatePicker from "antd/es/date-picker";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
6
|
+
export const DateTimeRangePicker = ReactUtil.memo("DateTimeRangePicker", (props) => {
|
|
7
|
+
const { value, allowNull, disabled, className, presets, showSecond, preserveInvalidOnBlur = true, disabledRange, onChange } = props;
|
|
8
|
+
const [shouldCheckDateRangeValid, setShouldCheckDateRangeValid] = React.useState(false);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
if (shouldCheckDateRangeValid && value[0] && value[1]) {
|
|
11
|
+
const typedOnChange = onChange;
|
|
12
|
+
if (dayjs(value[0]).isAfter(dayjs(value[1]))) {
|
|
13
|
+
typedOnChange([value[1], value[0]]);
|
|
14
|
+
}
|
|
15
|
+
setShouldCheckDateRangeValid(false);
|
|
16
|
+
}
|
|
17
|
+
}, [shouldCheckDateRangeValid, value, onChange]);
|
|
18
|
+
const isDateDisabled = (current) => {
|
|
15
19
|
if (!current)
|
|
16
20
|
return false;
|
|
17
21
|
/**
|
|
@@ -22,10 +26,10 @@ export class DateTimeRangePicker extends React.PureComponent {
|
|
|
22
26
|
if (current.valueOf() >= new Date(2038, 0).valueOf())
|
|
23
27
|
return true;
|
|
24
28
|
const diffToToday = Math.floor(current.diff(dayjs().startOf("day"), "day", true));
|
|
25
|
-
return
|
|
29
|
+
return disabledRange?.(diffToToday, current.toDate()) || false;
|
|
26
30
|
};
|
|
27
|
-
|
|
28
|
-
const typedOnChange =
|
|
31
|
+
const onAntChange = (dates) => {
|
|
32
|
+
const typedOnChange = onChange;
|
|
29
33
|
if (dates) {
|
|
30
34
|
// need manually reset the min/max millisecond
|
|
31
35
|
// otherwise, from/to will use now's millisecond value, which is inaccurate
|
|
@@ -39,23 +43,9 @@ export class DateTimeRangePicker extends React.PureComponent {
|
|
|
39
43
|
typedOnChange([null, null]);
|
|
40
44
|
}
|
|
41
45
|
};
|
|
42
|
-
onOpenChange = (open) => {
|
|
43
|
-
|
|
46
|
+
const onOpenChange = (open) => {
|
|
47
|
+
setShouldCheckDateRangeValid(!open);
|
|
44
48
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const dates = this.props.value;
|
|
48
|
-
const typedOnChange = this.props.onChange;
|
|
49
|
-
if (dayjs(dates[0]).isAfter(dayjs(dates[1]))) {
|
|
50
|
-
typedOnChange([dates[1], dates[0]]);
|
|
51
|
-
}
|
|
52
|
-
this.setState({ shouldCheckDateRangeValid: false });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
const { value, allowNull, disabled, className, presets, showSecond, preserveInvalidOnBlur = true } = this.props;
|
|
57
|
-
const parsedValue = [value[0] ? dayjs(value[0]) : null, value[1] ? dayjs(value[1]) : null];
|
|
58
|
-
return (React.createElement(DatePicker.RangePicker, { className: className, value: parsedValue, onCalendarChange: this.onChange, disabledDate: this.isDateDisabled, allowClear: allowNull, disabled: disabled, presets: presets, showTime: DateTimeRangePicker.showTime, showSecond: showSecond, preserveInvalidOnBlur: preserveInvalidOnBlur, onOpenChange: this.onOpenChange, needConfirm: false }));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
49
|
+
return (React.createElement(DatePicker.RangePicker, { className: className, value: [value[0] ? dayjs(value[0]) : null, value[1] ? dayjs(value[1]) : null], onCalendarChange: onAntChange, disabledDate: isDateDisabled, allowClear: allowNull, disabled: disabled, presets: presets, showTime: { defaultValue: [dayjs().startOf("day"), dayjs().endOf("day")] }, showSecond: showSecond, preserveInvalidOnBlur: preserveInvalidOnBlur, onOpenChange: onOpenChange, needConfirm: false }));
|
|
50
|
+
});
|
|
61
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimeRangePicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAG7C,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/DateTimeRangePicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAG7C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAY/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAoB,KAAe,EAAE,EAAE;IAC5G,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,qBAAqB,GAAG,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IAClI,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,yBAAyB,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE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
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { PickOptional } from "../../internal/type";
|
|
3
2
|
import "./index.less";
|
|
4
3
|
export interface Props {
|
|
5
4
|
children: React.ReactNode;
|
|
@@ -17,10 +16,6 @@ export interface DescriptionsItemProps {
|
|
|
17
16
|
style?: React.CSSProperties;
|
|
18
17
|
span?: number;
|
|
19
18
|
}
|
|
20
|
-
export declare
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
static Item: (props: DescriptionsItemProps) => React.JSX.Element;
|
|
24
|
-
private readonly containerStyle;
|
|
25
|
-
render(): React.JSX.Element;
|
|
26
|
-
}
|
|
19
|
+
export declare const Descriptions: ((props: Props) => React.JSX.Element) & {
|
|
20
|
+
Item: (props: DescriptionsItemProps) => React.JSX.Element;
|
|
21
|
+
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import AntDescriptions from "antd/es/descriptions";
|
|
3
3
|
import "./index.less";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
render() {
|
|
12
|
-
const { horizontal, column, title, children, className, style, bordered } = this.props;
|
|
13
|
-
const columnCount = column || React.Children.count(children);
|
|
14
|
-
return (React.createElement(AntDescriptions, { style: { ...this.containerStyle, ...style }, className: className, layout: horizontal ? "horizontal" : "vertical", bordered: bordered, title: title, column: columnCount }, children));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
5
|
+
const containerStyle = { marginBottom: 15 };
|
|
6
|
+
export const Descriptions = ReactUtil.compound("Descriptions", { Item: (props) => React.createElement(AntDescriptions.Item, { ...props }) }, (props) => {
|
|
7
|
+
const { horizontal, column, title, children, className, style, bordered = true } = props;
|
|
8
|
+
const columnCount = column || React.Children.count(children);
|
|
9
|
+
return (React.createElement(AntDescriptions, { style: { ...containerStyle, ...style }, className: className, layout: horizontal ? "horizontal" : "vertical", bordered: bordered, title: title, column: columnCount }, children));
|
|
10
|
+
});
|
|
17
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Descriptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Descriptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAoB/C,MAAM,cAAc,GAAwB,EAAC,YAAY,EAAE,EAAE,EAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAC,IAAI,EAAE,CAAC,KAA4B,EAAE,EAAE,CAAC,oBAAC,eAAe,CAAC,IAAI,OAAK,KAAK,GAAI,EAAC,EAAE,CAAC,KAAY,EAAE,EAAE;IAC3J,MAAM,EAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IACvF,MAAM,WAAW,GAAG,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,OAAO,CACH,oBAAC,eAAe,IAAC,KAAK,EAAE,EAAC,GAAG,cAAc,EAAE,GAAG,KAAK,EAAC,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,IAC7K,QAAQ,CACK,CACrB,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
.ant-descriptions {
|
|
2
|
-
padding: 0;
|
|
3
|
-
|
|
4
2
|
.ant-descriptions-title {
|
|
5
|
-
font-size: 24px;
|
|
6
3
|
margin-bottom: 12px;
|
|
7
|
-
color: #777;
|
|
8
4
|
}
|
|
9
5
|
|
|
10
6
|
.ant-descriptions-item-label {
|
|
11
|
-
padding: 8px 10px;
|
|
12
7
|
width: 120px;
|
|
13
|
-
text-align: left;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
.ant-descriptions-item-content {
|
|
17
|
-
padding: 8px 10px;
|
|
18
11
|
position: relative;
|
|
19
|
-
color: inherit;
|
|
20
12
|
}
|
|
21
13
|
}
|
|
@@ -13,16 +13,7 @@ interface BaseOption {
|
|
|
13
13
|
baseTitle: string;
|
|
14
14
|
separator: string;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private readonly prevTitle;
|
|
21
|
-
constructor(props: Props);
|
|
22
|
-
componentDidMount(): void;
|
|
23
|
-
componentDidUpdate(prevProps: Readonly<Props>): void;
|
|
24
|
-
componentWillUnmount(): void;
|
|
25
|
-
updateTitle: () => void;
|
|
26
|
-
render(): React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
16
|
+
declare const DocumentTitle: (({ title, children }: Props) => React.ReactNode) & {
|
|
17
|
+
register: <K extends keyof BaseOption>(option: Pick<BaseOption, K> | BaseOption) => BaseOption | (BaseOption & Pick<BaseOption, K>);
|
|
18
|
+
};
|
|
19
|
+
export { DocumentTitle };
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
prevTitle;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.prevTitle = document.title;
|
|
13
|
-
}
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
this.updateTitle();
|
|
16
|
-
}
|
|
17
|
-
componentDidUpdate(prevProps) {
|
|
18
|
-
if (prevProps.title !== this.props.title) {
|
|
19
|
-
this.updateTitle();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
componentWillUnmount() {
|
|
23
|
-
document.title = this.prevTitle;
|
|
24
|
-
}
|
|
25
|
-
updateTitle = () => {
|
|
26
|
-
const { title } = this.props;
|
|
27
|
-
const { baseTitle, separator } = DocumentTitle.baseOption;
|
|
2
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
3
|
+
import { useWillUnmountEffect } from "../../hooks/useWillUnmountEffect";
|
|
4
|
+
const baseOption = {
|
|
5
|
+
baseTitle: "<Document Title Unset>",
|
|
6
|
+
separator: "-",
|
|
7
|
+
};
|
|
8
|
+
const InternalDocumentTitle = ReactUtil.memo("DocumentTitle", ({ title, children }) => {
|
|
9
|
+
const prevTitle = React.useRef(document.title);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const { baseTitle, separator } = baseOption;
|
|
28
12
|
const fullTitle = title ? `${baseTitle} ${separator} ${title}` : baseTitle;
|
|
29
13
|
document.title = fullTitle;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
14
|
+
}, [title]);
|
|
15
|
+
useWillUnmountEffect(() => {
|
|
16
|
+
document.title = prevTitle.current;
|
|
17
|
+
});
|
|
18
|
+
return children;
|
|
19
|
+
});
|
|
20
|
+
const DocumentTitle = Object.assign(InternalDocumentTitle, { register: (option) => Object.assign(baseOption, option) });
|
|
21
|
+
export { DocumentTitle };
|
|
35
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../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C,CAAC,CAAC;AAEpL,OAAO,EAAC,aAAa,EAAC,CAAC"}
|
package/core/Drawer/index.d.ts
CHANGED
|
@@ -2,7 +2,5 @@ import React from "react";
|
|
|
2
2
|
import type { DrawerProps, PushState } from "antd/es/drawer";
|
|
3
3
|
export interface Props extends DrawerProps {
|
|
4
4
|
}
|
|
5
|
-
export declare class Drawer extends React.PureComponent<Props> {
|
|
6
|
-
render(): React.JSX.Element;
|
|
7
|
-
}
|
|
8
5
|
export type { PushState };
|
|
6
|
+
export declare const Drawer: ({ ...props }: Props) => React.JSX.Element;
|
package/core/Drawer/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import AntdDrawer from "antd/es/drawer";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const Drawer = ReactUtil.memo("Drawer", ({ ...props }) => {
|
|
5
|
+
return React.createElement(AntdDrawer, { ...props });
|
|
6
|
+
});
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/core/Drawer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Drawer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Drawer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAK/C,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAC,GAAG,KAAK,EAAQ,EAAE,EAAE;IACjE,OAAO,oBAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AACrC,CAAC,CAAC,CAAC"}
|
package/core/Dropdown/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import AntdDropdown from "antd/es/dropdown";
|
|
2
1
|
import type { DropdownProps } from "antd/es/dropdown";
|
|
3
2
|
export type { DropdownButtonProps, DropdownButtonType } from "antd/es/dropdown";
|
|
4
3
|
export interface Props extends DropdownProps {
|
|
5
4
|
}
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
}
|
|
5
|
+
export declare const Dropdown: {
|
|
6
|
+
Button: import("react").FC<import("antd/es/dropdown").DropdownButtonProps>;
|
|
7
|
+
};
|
package/core/Dropdown/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import AntdDropdown from "antd/es/dropdown";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
3
|
+
export const Dropdown = ReactUtil.statics("Dropdown", {
|
|
4
|
+
Button: AntdDropdown.Button,
|
|
5
|
+
});
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAK/C,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE;IAClD,MAAM,EAAE,YAAY,CAAC,MAAM;CAC9B,CAAC,CAAC"}
|
|
@@ -4,7 +4,4 @@ export interface Props<Enum extends string> extends ControlledFormValue<Enum[]>
|
|
|
4
4
|
map: Record<Enum, React.ReactElement | string | number | null>;
|
|
5
5
|
disabledItems?: Enum[] | "all";
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
static displayName: string;
|
|
9
|
-
render(): React.JSX.Element;
|
|
10
|
-
}
|
|
7
|
+
export declare const Map: <Enum extends string>({ map, ...restProps }: Props<Enum>) => React.JSX.Element;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumCheckboxGroup } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const translator = (_) => map[_];
|
|
9
|
-
return React.createElement(EnumCheckboxGroup, { list: list, translator: translator, ...restProps });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const Map = ReactUtil.memo("Map", ({ map, ...restProps }) => {
|
|
5
|
+
const list = Object.keys(map);
|
|
6
|
+
return React.createElement(EnumCheckboxGroup, { list: list, translator: _ => map[_], ...restProps });
|
|
7
|
+
});
|
|
12
8
|
//# sourceMappingURL=Map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumCheckboxGroup/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumCheckboxGroup/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAsB,EAAC,GAAG,EAAE,GAAG,SAAS,EAAc,EAAE,EAAE;IAC/F,MAAM,IAAI,GAAW,MAAM,CAAC,IAAI,CAAC,GAAG,CAAW,CAAC;IAChD,OAAO,oBAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAM,SAAS,GAAI,CAAC;AACrF,CAAC,CAAC,CAAC"}
|
|
@@ -5,8 +5,7 @@ interface Props<Enum extends string | boolean | number> extends ControlledFormVa
|
|
|
5
5
|
translator?: (enumValue: Enum) => React.ReactElement | string | number | null;
|
|
6
6
|
disabledItems?: Enum[] | "all";
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
export declare const EnumCheckboxGroup: (<Enum extends string | boolean | number>(props: Props<Enum>) => React.JSX.Element) & {
|
|
9
|
+
Map: <Enum extends string>({ map, ...restProps }: import("./Map").Props<Enum>) => React.JSX.Element;
|
|
10
|
+
};
|
|
12
11
|
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Checkbox } from "../Checkbox";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
import { Map } from "./Map";
|
|
5
|
+
export const EnumCheckboxGroup = ReactUtil.compound("EnumCheckboxGroup", { Map }, (props) => {
|
|
6
|
+
const { list, translator, disabledItems, value, onChange } = props;
|
|
7
|
+
const options = list.map(_ => ({
|
|
8
|
+
label: translator ? translator(_) : _.toString(),
|
|
9
|
+
value: _,
|
|
10
|
+
disabled: disabledItems ? disabledItems === "all" || disabledItems.includes(_) : false,
|
|
11
|
+
}));
|
|
12
|
+
return React.createElement(Checkbox.Group, { options: options, value: value, onChange: onChange });
|
|
13
|
+
});
|
|
15
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/EnumCheckboxGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/EnumCheckboxGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,EAAC,GAAG,EAAC,EAAE,CAAyC,KAAkB,EAAE,EAAE;IAC3I,MAAM,EAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IACjE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QAChD,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,aAAa,KAAK,KAAK,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;KACzF,CAAC,CAAC,CAAC;IACJ,OAAO,oBAAC,QAAQ,CAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAe,GAAI,CAAC;AACzF,CAAC,CAAC,CAAC"}
|
|
@@ -4,8 +4,4 @@ export interface Props<Enum extends string | boolean | number> extends BaseProps
|
|
|
4
4
|
value: Enum | null;
|
|
5
5
|
onChange: (newValue: Enum) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
static displayName: string;
|
|
9
|
-
private readonly nullValue;
|
|
10
|
-
render(): React.JSX.Element;
|
|
11
|
-
}
|
|
7
|
+
export declare const InitialNullable: <Enum extends string | boolean | number>({ value, ...restProps }: Props<Enum>) => React.JSX.Element;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumRadio } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return React.createElement(EnumRadio, { value: wrappedValue, ...restProps });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
const NULL_VALUE = "@@NULL";
|
|
5
|
+
export const InitialNullable = ReactUtil.memo("InitialNullable", ({ value, ...restProps }) => {
|
|
6
|
+
const wrappedValue = (value === null ? NULL_VALUE : value); // nullValue does not exist in list, so no Radio will be selected
|
|
7
|
+
return React.createElement(EnumRadio, { value: wrappedValue, ...restProps });
|
|
8
|
+
});
|
|
12
9
|
//# sourceMappingURL=InitialNullable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitialNullable.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/InitialNullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"InitialNullable.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/InitialNullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAClC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,MAAM,UAAU,GAAG,QAAQ,CAAC;AAO5B,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAyC,EAAC,KAAK,EAAE,GAAG,SAAS,EAAc,EAAE,EAAE;IAC5I,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAS,CAAC,CAAC,iEAAiE;IACrI,OAAO,oBAAC,SAAS,IAAC,KAAK,EAAE,YAAY,KAAM,SAAS,GAAI,CAAC;AAC7D,CAAC,CAAC,CAAC"}
|
package/core/EnumRadio/Map.d.ts
CHANGED
|
@@ -4,7 +4,4 @@ import type { ControlledFormValue } from "../../internal/type";
|
|
|
4
4
|
export interface Props<Enum extends string> extends Omit<BaseProps<any>, "list" | "translator">, ControlledFormValue<Enum> {
|
|
5
5
|
map: Record<Enum, React.ReactElement | string | number | null>;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
static displayName: string;
|
|
9
|
-
render(): React.JSX.Element;
|
|
10
|
-
}
|
|
7
|
+
export declare const Map: <Enum extends string>({ map, ...restProps }: Props<Enum>) => React.JSX.Element;
|
package/core/EnumRadio/Map.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumRadio } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return React.createElement(EnumRadio, { list: list, translator: translator, ...restProps });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const Map = ReactUtil.memo("Map", ({ map, ...restProps }) => {
|
|
5
|
+
const list = Object.keys(map);
|
|
6
|
+
const translator = (_) => map[_];
|
|
7
|
+
return React.createElement(EnumRadio, { list: list, translator: translator, ...restProps });
|
|
8
|
+
});
|
|
12
9
|
//# sourceMappingURL=Map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAM/C,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAsB,EAAC,GAAG,EAAE,GAAG,SAAS,EAAc,EAAE,EAAE;IAC/F,MAAM,IAAI,GAAW,MAAM,CAAC,IAAI,CAAC,GAAG,CAAW,CAAC;IAChD,MAAM,UAAU,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,KAAM,SAAS,GAAI,CAAC;AAC5E,CAAC,CAAC,CAAC"}
|
|
@@ -5,8 +5,4 @@ export interface Props<Enum extends string | boolean | number> extends BaseProps
|
|
|
5
5
|
nullText?: React.ReactElement | string | number | null;
|
|
6
6
|
nullPositionIndex?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
static displayName: string;
|
|
10
|
-
private readonly nullValue;
|
|
11
|
-
render(): React.JSX.Element;
|
|
12
|
-
}
|
|
8
|
+
export declare const Nullable: <Enum extends string | boolean | number>(props: Props<Enum>) => React.JSX.Element;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumRadio } from "./index";
|
|
3
3
|
import { i18n } from "../../internal/i18n/core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
5
|
+
const NULL_VALUE = "@@NULL";
|
|
6
|
+
export const Nullable = ReactUtil.memo("Nullable", (props) => {
|
|
7
|
+
const { value, onChange, nullText, nullPositionIndex, list, translator, ...restProps } = props;
|
|
8
|
+
const t = i18n();
|
|
9
|
+
const wrappedValue = value === null ? NULL_VALUE : value;
|
|
10
|
+
const wrappedOnChange = (value) => onChange(value === NULL_VALUE ? null : value);
|
|
11
|
+
const wrappedList = [...list];
|
|
12
|
+
wrappedList.splice(nullPositionIndex || 0, 0, NULL_VALUE);
|
|
13
|
+
const wrappedTranslator = (value) => (value === NULL_VALUE ? (nullText ?? t.all) : translator ? translator(value) : value.toString());
|
|
14
|
+
return React.createElement(EnumRadio, { value: wrappedValue, onChange: wrappedOnChange, list: wrappedList, translator: wrappedTranslator, ...restProps });
|
|
15
|
+
});
|
|
18
16
|
//# sourceMappingURL=Nullable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nullable.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/Nullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Nullable.js","sourceRoot":"","sources":["../../../src/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EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,KAAM,SAAS,GAAI,CAAC;AAC1I,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { RadioChangeEvent } from "../Radio";
|
|
3
2
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
|
-
import { Nullable } from "./Nullable";
|
|
5
|
-
import { InitialNullable } from "./InitialNullable";
|
|
6
|
-
import { Map } from "./Map";
|
|
7
3
|
import type { RadioGroupButtonStyle } from "antd/es/radio";
|
|
8
4
|
export interface BaseProps<Enum extends string | boolean | number> {
|
|
9
5
|
list: readonly Enum[];
|
|
@@ -16,11 +12,8 @@ export interface BaseProps<Enum extends string | boolean | number> {
|
|
|
16
12
|
}
|
|
17
13
|
export interface Props<Enum extends string | boolean | number> extends BaseProps<Enum>, ControlledFormValue<Enum> {
|
|
18
14
|
}
|
|
19
|
-
export declare
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onChange: (event: RadioChangeEvent) => void;
|
|
25
|
-
render(): React.JSX.Element;
|
|
26
|
-
}
|
|
15
|
+
export declare const EnumRadio: (<Enum extends string | boolean | number>(props: Props<Enum>) => React.JSX.Element) & {
|
|
16
|
+
Nullable: <Enum extends string | boolean | number>(props: import("./Nullable").Props<Enum>) => React.JSX.Element;
|
|
17
|
+
InitialNullable: <Enum extends string | boolean | number>({ value, ...restProps }: import("./InitialNullable").Props<Enum>) => React.JSX.Element;
|
|
18
|
+
Map: <Enum extends string>({ map, ...restProps }: import("./Map").Props<Enum>) => React.JSX.Element;
|
|
19
|
+
};
|
package/core/EnumRadio/index.js
CHANGED
|
@@ -3,21 +3,13 @@ import { Radio } from "../Radio";
|
|
|
3
3
|
import { Nullable } from "./Nullable";
|
|
4
4
|
import { InitialNullable } from "./InitialNullable";
|
|
5
5
|
import { Map } from "./Map";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onChange
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
render() {
|
|
16
|
-
const { list, translator, value, useButtonMode, buttonStyle, disabled, className, style } = this.props;
|
|
17
|
-
const RadioItem = useButtonMode ? Radio.Button : Radio;
|
|
18
|
-
return (React.createElement(Radio.Group, { value: value, onChange: this.onChange, disabled: disabled, className: className, style: style, optionType: useButtonMode ? "button" : undefined, buttonStyle: buttonStyle }, list.map(_ => (
|
|
19
|
-
// RadioItem can accept any type as value, and emit the exact type while onChange
|
|
20
|
-
React.createElement(RadioItem, { key: _.toString(), value: _ }, translator ? translator(_) : _.toString())))));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
6
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
7
|
+
export const EnumRadio = ReactUtil.compound("EnumRadio", { Nullable, InitialNullable, Map }, (props) => {
|
|
8
|
+
const { list, translator, value, useButtonMode, buttonStyle, disabled, className, style, onChange } = props;
|
|
9
|
+
const RadioItem = useButtonMode ? Radio.Button : Radio;
|
|
10
|
+
const onAntChange = (event) => onChange(event.target.value);
|
|
11
|
+
return (React.createElement(Radio.Group, { value: value, onChange: onAntChange, disabled: disabled, className: className, style: style, optionType: useButtonMode ? "button" : undefined, buttonStyle: buttonStyle }, list.map(_ => (
|
|
12
|
+
// RadioItem can accept any type as value, and emit the exact type while onChange
|
|
13
|
+
React.createElement(RadioItem, { key: _.toString(), value: _ }, translator ? translator(_) : _.toString())))));
|
|
14
|
+
});
|
|
23
15
|
//# sourceMappingURL=index.js.map
|