@pinnacle0/web-ui 0.5.84 → 0.6.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 +14 -50
- package/admin/AdminApp/Default/NavigatorSide/index.js.map +1 -1
- package/admin/AdminApp/Default/SoundSwitch.js +15 -34
- package/admin/AdminApp/Default/SoundSwitch.js.map +1 -1
- package/admin/AdminApp/Default/SquareLogo/index.js +8 -29
- package/admin/AdminApp/Default/SquareLogo/index.js.map +1 -1
- package/admin/AdminApp/Menu.js +40 -82
- package/admin/AdminApp/Menu.js.map +1 -1
- package/admin/AdminApp/Navigator.js +57 -83
- package/admin/AdminApp/Navigator.js.map +1 -1
- package/admin/AdminApp/NotFound.js +8 -30
- package/admin/AdminApp/NotFound.js.map +1 -1
- package/admin/AdminApp/RouteSwitch.js +21 -53
- package/admin/AdminApp/RouteSwitch.js.map +1 -1
- package/admin/AdminApp/WithErrorBoundary.js +13 -33
- package/admin/AdminApp/WithErrorBoundary.js.map +1 -1
- package/admin/AdminApp/context.js +3 -3
- package/admin/AdminApp/context.js.map +1 -1
- package/admin/AdminApp/index.js +26 -43
- package/admin/AdminApp/index.js.map +1 -1
- package/admin/AdminPage/Filter.js +20 -38
- package/admin/AdminPage/Filter.js.map +1 -1
- package/admin/AdminPage/Result.js +15 -62
- package/admin/AdminPage/Result.js.map +1 -1
- package/admin/AdminPage/SaveBar.js +7 -28
- package/admin/AdminPage/SaveBar.js.map +1 -1
- package/admin/AdminPage/Summary.js +6 -27
- package/admin/AdminPage/Summary.js.map +1 -1
- package/admin/AdminPage/TopBar.js +6 -27
- package/admin/AdminPage/TopBar.js.map +1 -1
- package/admin/AdminPage/index.js +11 -32
- package/admin/AdminPage/index.js.map +1 -1
- package/admin/AdminPermissionSelector.js +147 -195
- package/admin/AdminPermissionSelector.js.map +1 -1
- package/core/Amount/AmountPercentage.js +7 -50
- package/core/Amount/AmountPercentage.js.map +1 -1
- package/core/Amount/index.js +15 -36
- package/core/Amount/index.js.map +1 -1
- package/core/AmountConditionInput.js +27 -74
- package/core/AmountConditionInput.js.map +1 -1
- package/core/AmountRangeInput.js +17 -75
- package/core/AmountRangeInput.js.map +1 -1
- package/core/Animated/AnimatePresence.js +35 -87
- package/core/Animated/AnimatePresence.js.map +1 -1
- package/core/Animated/createAnimatedComponent.js +28 -50
- package/core/Animated/createAnimatedComponent.js.map +1 -1
- package/core/Animated/index.js +5 -5
- package/core/Animated/index.js.map +1 -1
- package/core/AuthenticationCodeInput/index.js +48 -136
- package/core/AuthenticationCodeInput/index.js.map +1 -1
- package/core/AutoCompleteInput.js +6 -38
- package/core/AutoCompleteInput.js.map +1 -1
- package/core/Badge.js +2 -13
- package/core/Badge.js.map +1 -1
- package/core/BoolRadio.js +16 -64
- package/core/BoolRadio.js.map +1 -1
- package/core/BoolSelect.js +16 -63
- package/core/BoolSelect.js.map +1 -1
- package/core/BoolSwitch.js +16 -48
- package/core/BoolSwitch.js.map +1 -1
- package/core/Breadcrumb/index.js +18 -66
- package/core/Breadcrumb/index.js.map +1 -1
- package/core/Button.js +2 -25
- package/core/Button.js.map +1 -1
- package/core/Card.js +6 -38
- package/core/Card.js.map +1 -1
- package/core/Carousel.js +6 -49
- package/core/Carousel.js.map +1 -1
- package/core/Carousel3D/index.js +64 -83
- package/core/Carousel3D/index.js.map +1 -1
- package/core/Cascader/InitialNullable.js +7 -50
- package/core/Cascader/InitialNullable.js.map +1 -1
- package/core/Cascader/Nullable.js +11 -81
- package/core/Cascader/Nullable.js.map +1 -1
- package/core/Cascader/index.js +38 -109
- package/core/Cascader/index.js.map +1 -1
- package/core/Checkbox.js +9 -67
- package/core/Checkbox.js.map +1 -1
- package/core/Collapse.js +5 -37
- package/core/Collapse.js.map +1 -1
- package/core/Countdown/SlidingDigit.js +12 -32
- package/core/Countdown/SlidingDigit.js.map +1 -1
- package/core/Countdown/index.js +56 -74
- package/core/Countdown/index.js.map +1 -1
- package/core/DarkOverlay/index.js +6 -27
- package/core/DarkOverlay/index.js.map +1 -1
- package/core/DateCalendar.js +48 -96
- package/core/DateCalendar.js.map +1 -1
- package/core/DatePicker.js +26 -73
- package/core/DatePicker.js.map +1 -1
- package/core/DateRangePicker.js +44 -64
- package/core/DateRangePicker.js.map +1 -1
- package/core/DateTimePicker.js +30 -78
- package/core/DateTimePicker.js.map +1 -1
- package/core/DateTimeRangePicker/index.js +48 -68
- package/core/DateTimeRangePicker/index.js.map +1 -1
- package/core/Descriptions/index.js +11 -69
- package/core/Descriptions/index.js.map +1 -1
- package/core/DocumentTitle.js +25 -43
- package/core/DocumentTitle.js.map +1 -1
- package/core/Drawer.js +4 -36
- package/core/Drawer.js.map +1 -1
- package/core/Dropdown.js +3 -7
- package/core/Dropdown.js.map +1 -1
- package/core/EnumCheckboxGroup/Map.js +8 -51
- package/core/EnumCheckboxGroup/Map.js.map +1 -1
- package/core/EnumCheckboxGroup/index.js +8 -29
- package/core/EnumCheckboxGroup/index.js.map +1 -1
- package/core/EnumRadio/InitialNullable.js +9 -78
- package/core/EnumRadio/InitialNullable.js.map +1 -1
- package/core/EnumRadio/Map.js +8 -51
- package/core/EnumRadio/Map.js.map +1 -1
- package/core/EnumRadio/Nullable.js +13 -83
- package/core/EnumRadio/Nullable.js.map +1 -1
- package/core/EnumRadio/index.js +16 -63
- package/core/EnumRadio/index.js.map +1 -1
- package/core/EnumSelect/InitialNullable.js +7 -50
- package/core/EnumSelect/InitialNullable.js.map +1 -1
- package/core/EnumSelect/Map.js +8 -51
- package/core/EnumSelect/Map.js.map +1 -1
- package/core/EnumSelect/Nullable.js +13 -83
- package/core/EnumSelect/Nullable.js.map +1 -1
- package/core/EnumSelect/index.js +37 -86
- package/core/EnumSelect/index.js.map +1 -1
- package/core/FlatList/Content/Footer/index.js +5 -6
- package/core/FlatList/Content/Footer/index.js.map +1 -1
- package/core/FlatList/Content/index.js +28 -51
- package/core/FlatList/Content/index.js.map +1 -1
- package/core/FlatList/FloatingLoader/index.js +2 -3
- package/core/FlatList/FloatingLoader/index.js.map +1 -1
- package/core/FlatList/Refresh/index.js +2 -3
- package/core/FlatList/Refresh/index.js.map +1 -1
- package/core/FlatList/hook/useRefreshing.js +7 -23
- package/core/FlatList/hook/useRefreshing.js.map +1 -1
- package/core/FlatList/hook/useScrollListSwipe.js +22 -40
- package/core/FlatList/hook/useScrollListSwipe.js.map +1 -1
- package/core/FlatList/index.js +19 -52
- package/core/FlatList/index.js.map +1 -1
- package/core/FlatList/shared/Loader/index.js +1 -1
- package/core/FlatList/shared/Loader/index.js.map +1 -1
- package/core/Form/Item.js +31 -91
- package/core/Form/Item.js.map +1 -1
- package/core/Form/context.js +4 -4
- package/core/Form/context.js.map +1 -1
- package/core/Form/index.js +52 -124
- package/core/Form/index.js.map +1 -1
- package/core/Grid.js +2 -2
- package/core/Grid.js.map +1 -1
- package/core/HTMLContent/index.js +6 -27
- package/core/HTMLContent/index.js.map +1 -1
- package/core/Image.js +5 -37
- package/core/Image.js.map +1 -1
- package/core/ImageUploader/index.js +44 -156
- package/core/ImageUploader/index.js.map +1 -1
- package/core/Input.js +34 -120
- package/core/Input.js.map +1 -1
- package/core/LabelledSelect.js +6 -38
- package/core/LabelledSelect.js.map +1 -1
- package/core/Link.js +7 -28
- package/core/Link.js.map +1 -1
- package/core/LocalImporter.js +22 -84
- package/core/LocalImporter.js.map +1 -1
- package/core/LocaleSelect.js +17 -64
- package/core/LocaleSelect.js.map +1 -1
- package/core/Markdown/index.js +30 -78
- package/core/Markdown/index.js.map +1 -1
- package/core/Modal/index.js +11 -54
- package/core/Modal/index.js.map +1 -1
- package/core/MultipleCascader/index.js +55 -135
- package/core/MultipleCascader/index.js.map +1 -1
- package/core/MultipleEnumSelect.js +13 -60
- package/core/MultipleEnumSelect.js.map +1 -1
- package/core/MultipleSelector/TablePopover.js +37 -85
- package/core/MultipleSelector/TablePopover.js.map +1 -1
- package/core/MultipleSelector/index.js +41 -88
- package/core/MultipleSelector/index.js.map +1 -1
- package/core/MutableTable/index.js +71 -125
- package/core/MutableTable/index.js.map +1 -1
- package/core/NumberInput/NumberInputPercentage.js +24 -93
- package/core/NumberInput/NumberInputPercentage.js.map +1 -1
- package/core/NumberInput/index.js +80 -115
- package/core/NumberInput/index.js.map +1 -1
- package/core/NumberInput/util.js +9 -9
- package/core/NumberInput/util.js.map +1 -1
- package/core/OrientationContext.js +4 -21
- package/core/OrientationContext.js.map +1 -1
- package/core/OverflowableText/index.js +19 -49
- package/core/OverflowableText/index.js.map +1 -1
- package/core/PagedList/index.js +18 -35
- package/core/PagedList/index.js.map +1 -1
- package/core/Pagination/index.js +19 -66
- package/core/Pagination/index.js.map +1 -1
- package/core/Popover/index.js +7 -29
- package/core/Popover/index.js.map +1 -1
- package/core/Progress/index.js +5 -37
- package/core/Progress/index.js.map +1 -1
- package/core/Progress.js +5 -37
- package/core/Progress.js.map +1 -1
- package/core/Radio.d.ts +2 -2
- package/core/Radio.js +7 -39
- package/core/Radio.js.map +1 -1
- package/core/RelativeTime.js +27 -45
- package/core/RelativeTime.js.map +1 -1
- package/core/Resizable/Resizer.js +4 -16
- package/core/Resizable/Resizer.js.map +1 -1
- package/core/Resizable/index.js +32 -55
- package/core/Resizable/index.js.map +1 -1
- package/core/SearchableSelect.js +6 -38
- package/core/SearchableSelect.js.map +1 -1
- package/core/Select.js +7 -39
- package/core/Select.js.map +1 -1
- package/core/SignedAmountInput.js +23 -70
- package/core/SignedAmountInput.js.map +1 -1
- package/core/Skeleton.js +6 -49
- package/core/Skeleton.js.map +1 -1
- package/core/Slider/RangeSlider.js +6 -49
- package/core/Slider/RangeSlider.js.map +1 -1
- package/core/Slider/index.js +24 -94
- package/core/Slider/index.js.map +1 -1
- package/core/Space.js +6 -38
- package/core/Space.js.map +1 -1
- package/core/Spin.js +6 -49
- package/core/Spin.js.map +1 -1
- package/core/StepFormContainer/index.js +17 -64
- package/core/StepFormContainer/index.js.map +1 -1
- package/core/Steps.js +5 -37
- package/core/Steps.js.map +1 -1
- package/core/Table.js +83 -116
- package/core/Table.js.map +1 -1
- package/core/Tabs/Single.js +6 -49
- package/core/Tabs/Single.js.map +1 -1
- package/core/Tabs/index.js +29 -100
- package/core/Tabs/index.js.map +1 -1
- package/core/Tag.js +5 -37
- package/core/Tag.js.map +1 -1
- package/core/TagInput/index.js +50 -95
- package/core/TagInput/index.js.map +1 -1
- package/core/Tags.js +13 -60
- package/core/Tags.js.map +1 -1
- package/core/TimePicker.js +17 -64
- package/core/TimePicker.js.map +1 -1
- package/core/TimeRangePicker.js +28 -47
- package/core/TimeRangePicker.js.map +1 -1
- package/core/Tooltip.js +7 -29
- package/core/Tooltip.js.map +1 -1
- package/core/TypedTabs/index.js +13 -75
- package/core/TypedTabs/index.js.map +1 -1
- package/core/UIProvider.js +4 -27
- package/core/UIProvider.js.map +1 -1
- package/core/Uploader.js +54 -85
- package/core/Uploader.js.map +1 -1
- package/core/VerticalMarquee/index.js +18 -35
- package/core/VerticalMarquee/index.js.map +1 -1
- package/core/VirtualList/index.js +19 -20
- package/core/VirtualList/index.js.map +1 -1
- package/core/VirtualTable/TableHeader.js +7 -9
- package/core/VirtualTable/TableHeader.js.map +1 -1
- package/core/VirtualTable/TableRow.js +12 -13
- package/core/VirtualTable/TableRow.js.map +1 -1
- package/core/VirtualTable/hooks/useColumnWidths.js +20 -36
- package/core/VirtualTable/hooks/useColumnWidths.js.map +1 -1
- package/core/VirtualTable/hooks/useColumnsStickyPosition.js +9 -9
- package/core/VirtualTable/hooks/useColumnsStickyPosition.js.map +1 -1
- package/core/VirtualTable/hooks/useRowSelection.js +28 -54
- package/core/VirtualTable/hooks/useRowSelection.js.map +1 -1
- package/core/VirtualTable/hooks/useScroll.js +13 -29
- package/core/VirtualTable/hooks/useScroll.js.map +1 -1
- package/core/VirtualTable/hooks/useScrollBarSize.js +6 -22
- package/core/VirtualTable/hooks/useScrollBarSize.js.map +1 -1
- package/core/VirtualTable/index.js +24 -25
- package/core/VirtualTable/index.js.map +1 -1
- package/core/WithExplanation/index.js +11 -32
- package/core/WithExplanation/index.js.map +1 -1
- package/core/WithTooltipList.js +17 -66
- package/core/WithTooltipList.js.map +1 -1
- package/core/YearMonthSelector.js +28 -76
- package/core/YearMonthSelector.js.map +1 -1
- package/hooks/useAPI.js +8 -44
- package/hooks/useAPI.js.map +1 -1
- package/hooks/useBool.js +4 -21
- package/hooks/useBool.js.map +1 -1
- package/hooks/useCompositeRef.js +4 -8
- package/hooks/useCompositeRef.js.map +1 -1
- package/hooks/useDebounce.js +6 -35
- package/hooks/useDebounce.js.map +1 -1
- package/hooks/useDelayed.js +7 -8
- package/hooks/useDelayed.js.map +1 -1
- package/hooks/useDidMountEffect.js +1 -1
- package/hooks/useDidMountEffect.js.map +1 -1
- package/hooks/useDraggable/DragController.js +37 -45
- package/hooks/useDraggable/DragController.js.map +1 -1
- package/hooks/useDraggable/index.js +25 -53
- package/hooks/useDraggable/index.js.map +1 -1
- package/hooks/useDraggable/useDrag.js +5 -5
- package/hooks/useDraggable/useDrag.js.map +1 -1
- package/hooks/useExtended.js +8 -8
- package/hooks/useExtended.js.map +1 -1
- package/hooks/useForceUpdate.js +2 -18
- package/hooks/useForceUpdate.js.map +1 -1
- package/hooks/useOrientation.js +2 -18
- package/hooks/useOrientation.js.map +1 -1
- package/hooks/usePrevious.js +1 -1
- package/hooks/usePrevious.js.map +1 -1
- package/hooks/useResizeObserver.js +7 -9
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useSwipe/controller.js +68 -75
- package/hooks/useSwipe/controller.js.map +1 -1
- package/hooks/useSwipe/index.js +6 -14
- package/hooks/useSwipe/index.js.map +1 -1
- package/hooks/useThunk.js +9 -36
- package/hooks/useThunk.js.map +1 -1
- package/hooks/useTransform.js +18 -30
- package/hooks/useTransform.js.map +1 -1
- package/hooks/useWhyDidYouUpdate.js +10 -19
- package/hooks/useWhyDidYouUpdate.js.map +1 -1
- package/hooks/useWillUnmountEffect.js +1 -1
- package/hooks/useWillUnmountEffect.js.map +1 -1
- package/internal/ArrayUtil.js +13 -38
- package/internal/ArrayUtil.js.map +1 -1
- package/internal/ExpirableLocalStorage.js +70 -74
- package/internal/ExpirableLocalStorage.js.map +1 -1
- package/internal/NumberUtil.js +11 -11
- package/internal/NumberUtil.js.map +1 -1
- package/internal/StorageHelper.js +62 -65
- package/internal/StorageHelper.js.map +1 -1
- package/internal/TextUtil.js +6 -10
- package/internal/TextUtil.js.map +1 -1
- package/internal/i18n/admin/en.js +1 -1
- package/internal/i18n/admin/en.js.map +1 -1
- package/internal/i18n/admin/index.js +3 -3
- package/internal/i18n/admin/index.js.map +1 -1
- package/internal/i18n/admin/zh.js +1 -1
- package/internal/i18n/admin/zh.js.map +1 -1
- package/internal/i18n/core/en.js +1 -1
- package/internal/i18n/core/en.js.map +1 -1
- package/internal/i18n/core/index.js +3 -3
- package/internal/i18n/core/index.js.map +1 -1
- package/internal/i18n/core/zh.js +1 -1
- package/internal/i18n/core/zh.js.map +1 -1
- package/internal/i18n/util/en.js +1 -1
- package/internal/i18n/util/en.js.map +1 -1
- package/internal/i18n/util/index.js +3 -3
- package/internal/i18n/util/index.js.map +1 -1
- package/internal/i18n/util/zh.js +1 -1
- package/internal/i18n/util/zh.js.map +1 -1
- package/package.json +6 -6
- package/util/AdminNavigationUtil.js +22 -64
- package/util/AdminNavigationUtil.js.map +1 -1
- package/util/BrowserBookmarkUtil.js +5 -5
- package/util/BrowserBookmarkUtil.js.map +1 -1
- package/util/BrowserUtil/index.js +29 -68
- package/util/BrowserUtil/index.js.map +1 -1
- package/util/CanvasUtil.js +22 -61
- package/util/CanvasUtil.js.map +1 -1
- package/util/Clipboard.js +25 -85
- package/util/Clipboard.js.map +1 -1
- package/util/ExpirableLocalStorageUtil.js +1 -1
- package/util/ExpirableLocalStorageUtil.js.map +1 -1
- package/util/ExportUtil.js +13 -13
- package/util/ExportUtil.js.map +1 -1
- package/util/ImportUtil.js +34 -86
- package/util/ImportUtil.js.map +1 -1
- package/util/LocalStorageUtil.js +1 -1
- package/util/LocalStorageUtil.js.map +1 -1
- package/util/LocaleUtil.js +16 -19
- package/util/LocaleUtil.js.map +1 -1
- package/util/MediaUtil/index.js +15 -15
- package/util/MediaUtil/index.js.map +1 -1
- package/util/MessageUtil.js +5 -16
- package/util/MessageUtil.js.map +1 -1
- package/util/ModalUtil/index.js +46 -68
- package/util/ModalUtil/index.js.map +1 -1
- package/util/NotificationUtil.js +8 -24
- package/util/NotificationUtil.js.map +1 -1
- package/util/OrientationUtil.js +8 -8
- package/util/OrientationUtil.js.map +1 -1
- package/util/PromptUtil/PromptBody.js +24 -88
- package/util/PromptUtil/PromptBody.js.map +1 -1
- package/util/PromptUtil/index.js +20 -33
- package/util/PromptUtil/index.js.map +1 -1
- package/util/ReactUtil.js +20 -54
- package/util/ReactUtil.js.map +1 -1
- package/util/RecentUsedStorageUtil/index.js +14 -15
- package/util/RecentUsedStorageUtil/index.js.map +1 -1
- package/util/RecentUsedStorageUtil/pushToList.js +3 -28
- package/util/RecentUsedStorageUtil/pushToList.js.map +1 -1
- package/util/SessionStorageUtil.js +1 -1
- package/util/SessionStorageUtil.js.map +1 -1
- package/util/SwipeUtil.js +9 -9
- package/util/SwipeUtil.js.map +1 -1
- package/util/UploadUtil/index.js +29 -30
- package/util/UploadUtil/index.js.map +1 -1
package/core/PagedList/index.js
CHANGED
|
@@ -1,43 +1,26 @@
|
|
|
1
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
-
if (!m) return o;
|
|
4
|
-
var i = m.call(o), r, ar = [], e;
|
|
5
|
-
try {
|
|
6
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
-
}
|
|
8
|
-
catch (error) { e = { error: error }; }
|
|
9
|
-
finally {
|
|
10
|
-
try {
|
|
11
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
-
}
|
|
13
|
-
finally { if (e) throw e.error; }
|
|
14
|
-
}
|
|
15
|
-
return ar;
|
|
16
|
-
};
|
|
17
1
|
import React from "react";
|
|
18
2
|
import { ReactUtil } from "../../util/ReactUtil";
|
|
19
3
|
import { classNames } from "../../util/ClassNames";
|
|
20
4
|
import { i18n } from "../../internal/i18n/core";
|
|
21
5
|
import "./index.less";
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var goPreviousPage = function () {
|
|
6
|
+
export const PagedList = ReactUtil.memo("PagedList", ({ dataSource, rowKey, renderItem, itemWidth, pageSize, onPageChange }) => {
|
|
7
|
+
const [currentItemIndex, setCurrentItemIndex] = React.useState(0);
|
|
8
|
+
const t = i18n();
|
|
9
|
+
const Component = renderItem;
|
|
10
|
+
const isNextDisabled = currentItemIndex === 0;
|
|
11
|
+
const upperLimit = dataSource.length - pageSize;
|
|
12
|
+
const isPreviousDisabled = currentItemIndex >= upperLimit;
|
|
13
|
+
const currentPageIndex = React.useMemo(() => Math.floor(currentItemIndex / pageSize), [currentItemIndex, pageSize]);
|
|
14
|
+
const shownDataIndex = [Math.max(currentItemIndex - 1 * pageSize, 0), Math.min(currentItemIndex + 2 * pageSize, dataSource.length)];
|
|
15
|
+
const totalSize = dataSource.length * itemWidth * pageSize;
|
|
16
|
+
const goPreviousPage = () => {
|
|
34
17
|
setCurrentItemIndex(Math.max(0, Math.min(currentItemIndex + pageSize, upperLimit)));
|
|
35
18
|
};
|
|
36
|
-
|
|
19
|
+
const goNextPage = () => {
|
|
37
20
|
setCurrentItemIndex(Math.max(0, currentItemIndex - pageSize));
|
|
38
21
|
};
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
const goCurrentPage = () => setCurrentItemIndex(0);
|
|
23
|
+
const getRowKey = (record, index) => {
|
|
41
24
|
if (rowKey === "index") {
|
|
42
25
|
return index;
|
|
43
26
|
}
|
|
@@ -48,17 +31,17 @@ export var PagedList = ReactUtil.memo("PagedList", function (_a) {
|
|
|
48
31
|
return record[rowKey];
|
|
49
32
|
}
|
|
50
33
|
};
|
|
51
|
-
React.useEffect(
|
|
52
|
-
onPageChange
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
onPageChange?.(currentPageIndex);
|
|
53
36
|
}, [currentPageIndex, onPageChange]);
|
|
54
37
|
return (React.createElement("div", { className: "g-paged-list" },
|
|
55
38
|
React.createElement("div", { className: "list-wrap", style: { width: itemWidth * pageSize } },
|
|
56
|
-
React.createElement("div", { className: "list", style: { width: totalSize, transform:
|
|
39
|
+
React.createElement("div", { className: "list", style: { width: totalSize, transform: `translateX(${-(totalSize - (currentItemIndex + pageSize) * itemWidth)}px)` } }, dataSource.map((item, index) => {
|
|
57
40
|
if (index < shownDataIndex[0])
|
|
58
41
|
return null;
|
|
59
42
|
if (index > shownDataIndex[1])
|
|
60
43
|
return null;
|
|
61
|
-
return (React.createElement("div", { style: { position: "absolute", width: itemWidth, transform:
|
|
44
|
+
return (React.createElement("div", { style: { position: "absolute", width: itemWidth, transform: `translateX(-${index * itemWidth}px)` }, key: getRowKey(item, index) },
|
|
62
45
|
React.createElement(Component, { index: index, item: item })));
|
|
63
46
|
})),
|
|
64
47
|
dataSource.length === 0 && React.createElement("div", { className: "no-data" }, t.noData)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/PagedList/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/PagedList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C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-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
17
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
18
|
-
if (!m) return o;
|
|
19
|
-
var i = m.call(o), r, ar = [], e;
|
|
20
|
-
try {
|
|
21
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
22
|
-
}
|
|
23
|
-
catch (error) { e = { error: error }; }
|
|
24
|
-
finally {
|
|
25
|
-
try {
|
|
26
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
27
|
-
}
|
|
28
|
-
finally { if (e) throw e.error; }
|
|
29
|
-
}
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
33
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
34
|
-
if (ar || !(i in from)) {
|
|
35
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
36
|
-
ar[i] = from[i];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
40
|
-
};
|
|
41
1
|
import React from "react";
|
|
42
2
|
import AntPagination from "antd/es/pagination";
|
|
43
3
|
import { i18n } from "../../internal/i18n/core";
|
|
44
4
|
import { TextUtil } from "../../internal/TextUtil";
|
|
45
5
|
import "./index.less";
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
return _this;
|
|
62
|
-
}
|
|
63
|
-
Pagination.prototype.render = function () {
|
|
64
|
-
var _a = this.props, disabled = _a.disabled, onPageSizeChange = _a.onPageSizeChange, totalPage = _a.totalPage, pageIndex = _a.pageIndex, totalCount = _a.totalCount, small = _a.small, _b = _a.renderSummary, renderSummary = _b === void 0 ? this.renderSummary : _b, _c = _a.pageSize, pageSize = _c === void 0 ? 10 : _c, pageSizeOptions = _a.pageSizeOptions;
|
|
6
|
+
export class Pagination extends React.PureComponent {
|
|
7
|
+
static displayName = "Pagination";
|
|
8
|
+
// antd default onChange is triggered by either pageIndex, or pageSize change
|
|
9
|
+
onChange = (pageIndex, pageSize) => {
|
|
10
|
+
if (this.props.onPageSizeChange === undefined || pageSize === this.props.pageSize) {
|
|
11
|
+
this.props.onPageIndexChange(pageIndex);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
onShowSizeChange = (_, pageSize) => this.props.onPageSizeChange?.(pageSize);
|
|
15
|
+
renderSummary = (totalCount, pageIndex, totalPage) => {
|
|
16
|
+
const t = i18n();
|
|
17
|
+
return React.createElement("div", null, TextUtil.interpolate(t.paginationSummary, totalCount.toString(), pageIndex.toString(), totalPage.toString()));
|
|
18
|
+
};
|
|
19
|
+
render() {
|
|
20
|
+
const { disabled, onPageSizeChange, totalPage, pageIndex, totalCount, small, renderSummary = this.renderSummary, pageSize = 10, pageSizeOptions } = this.props;
|
|
65
21
|
// If last page is divisible by pageSize that it is full page, otherwise only use reminder as last page size.
|
|
66
|
-
|
|
67
|
-
|
|
22
|
+
const lastPageSize = totalCount % pageSize === 0 ? pageSize : totalCount % pageSize;
|
|
23
|
+
const totalAvailableRecords = pageSize * (totalPage - 1) + lastPageSize;
|
|
68
24
|
return (totalCount > 0 && (React.createElement("div", { className: "g-pagination" },
|
|
69
25
|
renderSummary !== "none" && renderSummary(totalCount, pageIndex, totalPage),
|
|
70
26
|
React.createElement(AntPagination, { disabled: disabled, showSizeChanger: onPageSizeChange !== undefined, size: small ? "small" : "default", onChange: this.onChange, onShowSizeChange: this.onShowSizeChange, current: pageIndex, pageSize: pageSize, total: totalAvailableRecords, pageSizeOptions: pageSizeOptions }))));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return Pagination;
|
|
74
|
-
}(React.PureComponent));
|
|
75
|
-
export { Pagination };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
76
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Pagination/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,cAAc,CAAC;AAgBtB,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAAoB;IACtD,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;IAElC,6EAA6E;IAC7E,QAAQ,GAAG,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAE;QAC/C,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,QA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gBAAgB,KAAK,SAAS,EAC/C,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,qBAAqB,EAC5B,eAAe,EAAE,eAAe,GAClC,CACA,CACT,CACJ,CAAC;IACN,CAAC"}
|
package/core/Popover/index.js
CHANGED
|
@@ -1,35 +1,13 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import AntPopover from "antd/es/popover";
|
|
24
2
|
import React from "react";
|
|
25
3
|
import "./index.less";
|
|
26
4
|
import { ReactUtil } from "../../util/ReactUtil";
|
|
27
|
-
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (React.createElement(AntPopover,
|
|
33
|
-
React.createElement("div",
|
|
5
|
+
const inlineChildStyle = { display: "inline" };
|
|
6
|
+
export const Popover = ReactUtil.memo("Popover", (props) => {
|
|
7
|
+
const { children, childContainerProps = {}, isInline, ...restProps } = props;
|
|
8
|
+
const { style, ...restChildContainerProps } = childContainerProps;
|
|
9
|
+
const combinedChildContainerStyle = isInline ? { ...style, ...inlineChildStyle } : style;
|
|
10
|
+
return (React.createElement(AntPopover, { ...restProps },
|
|
11
|
+
React.createElement("div", { ...restChildContainerProps, style: combinedChildContainerStyle }, children)));
|
|
34
12
|
});
|
|
35
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Popover/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Popover/index.tsx"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,gBAAgB,GAAwB,EAAC,OAAO,EAAE,QAAQ,EAAC,CAAC;AAElE,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,KAAY,EAAE,EAAE;IAC9D,MAAM,EAAC,QAAQ,EAAE,mBAAmB,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAC,GAAG,KAAK,CAAC;IAC3E,MAAM,EAAC,KAAK,EAAE,GAAG,uBAAuB,EAAC,GAAG,mBAAmB,CAAC;IAChE,MAAM,2BAA2B,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAC,GAAG,KAAK,EAAE,GAAG,gBAAgB,EAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAEvF,OAAO,CACH,oBAAC,UAAU,OAAK,SAAS;QACrB,gCAAS,uBAAuB,EAAE,KAAK,EAAE,2BAA2B,IAC/D,QAAQ,CACP,CACG,CAChB,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/core/Progress/index.js
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
1
|
import React from "react";
|
|
28
2
|
import Progress from "antd/es/progress";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
3
|
+
export class Popover extends React.PureComponent {
|
|
4
|
+
static displayName = "Progress";
|
|
5
|
+
render() {
|
|
6
|
+
return React.createElement(Progress, { ...this.props });
|
|
33
7
|
}
|
|
34
|
-
|
|
35
|
-
return React.createElement(Progress, __assign({}, this.props));
|
|
36
|
-
};
|
|
37
|
-
Popover.displayName = "Progress";
|
|
38
|
-
return Popover;
|
|
39
|
-
}(React.PureComponent));
|
|
40
|
-
export { Popover };
|
|
8
|
+
}
|
|
41
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Progress/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Progress/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAKxC,MAAM,OAAO,OAAQ,SAAQ,KAAK,CAAC,aAAoB;IACnD,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC;IAEhC,MAAM;QACF,OAAO,oBAAC,QAAQ,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IACxC,CAAC"}
|
package/core/Progress.js
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
1
|
import AntProgress from "antd/es/progress";
|
|
28
2
|
import React from "react";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
3
|
+
export class Progress extends React.PureComponent {
|
|
4
|
+
static displayName = "Progress";
|
|
5
|
+
render() {
|
|
6
|
+
return React.createElement(AntProgress, { ...this.props });
|
|
33
7
|
}
|
|
34
|
-
|
|
35
|
-
return React.createElement(AntProgress, __assign({}, this.props));
|
|
36
|
-
};
|
|
37
|
-
Progress.displayName = "Progress";
|
|
38
|
-
return Progress;
|
|
39
|
-
}(React.PureComponent));
|
|
40
|
-
export { Progress };
|
|
8
|
+
}
|
|
41
9
|
//# sourceMappingURL=Progress.js.map
|
package/core/Progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../src/core/Progress.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../src/core/Progress.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,aAAoB;IACpD,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC;IAEhC,MAAM;QACF,OAAO,oBAAC,WAAW,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IAC3C,CAAC"}
|
package/core/Radio.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export interface Props extends RadioProps {
|
|
|
4
4
|
}
|
|
5
5
|
export declare class Radio extends React.PureComponent<Props> {
|
|
6
6
|
static displayName: string;
|
|
7
|
-
static Button: React.ForwardRefExoticComponent<import("antd/es/radio/radioButton").RadioButtonProps & React.RefAttributes<import("antd
|
|
8
|
-
static Group: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd
|
|
7
|
+
static Button: React.ForwardRefExoticComponent<import("antd/es/radio/radioButton").RadioButtonProps & React.RefAttributes<import("antd").CheckboxRef>>;
|
|
8
|
+
static Group: React.MemoExoticComponent<React.ForwardRefExoticComponent<import("antd").RadioGroupProps & React.RefAttributes<HTMLDivElement>>>;
|
|
9
9
|
render(): React.JSX.Element;
|
|
10
10
|
}
|
|
11
11
|
export type { RadioChangeEvent };
|
package/core/Radio.js
CHANGED
|
@@ -1,43 +1,11 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
1
|
import React from "react";
|
|
28
2
|
import AntRadio from "antd/es/radio";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
export class Radio extends React.PureComponent {
|
|
4
|
+
static displayName = "Radio";
|
|
5
|
+
static Button = AntRadio.Button;
|
|
6
|
+
static Group = AntRadio.Group;
|
|
7
|
+
render() {
|
|
8
|
+
return React.createElement(AntRadio, { ...this.props });
|
|
33
9
|
}
|
|
34
|
-
|
|
35
|
-
return React.createElement(AntRadio, __assign({}, this.props));
|
|
36
|
-
};
|
|
37
|
-
Radio.displayName = "Radio";
|
|
38
|
-
Radio.Button = AntRadio.Button;
|
|
39
|
-
Radio.Group = AntRadio.Group;
|
|
40
|
-
return Radio;
|
|
41
|
-
}(React.PureComponent));
|
|
42
|
-
export { Radio };
|
|
10
|
+
}
|
|
43
11
|
//# sourceMappingURL=Radio.js.map
|
package/core/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/core/Radio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/core/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,QAAQ,MAAM,eAAe,CAAC;AAIrC,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAoB;IACjD,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC;IAE7B,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAEhC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAE9B,MAAM;QACF,OAAO,oBAAC,QAAQ,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IACxC,CAAC"}
|
package/core/RelativeTime.js
CHANGED
|
@@ -1,61 +1,43 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
1
|
import React from "react";
|
|
17
2
|
import dayjs from "dayjs";
|
|
18
3
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
19
4
|
// load plugin when component is imported
|
|
20
5
|
dayjs.extend(relativeTime);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var elapsedText = dayjs(_this.props.date).fromNow();
|
|
28
|
-
_this.setState({ elapsedText: elapsedText });
|
|
29
|
-
/**
|
|
30
|
-
* dayjs relative time plugin uses 45 minutes for "an hour ago" threshold and 45 seconds for "a minute ago" threshold.
|
|
31
|
-
* Repaint after 15 minutes / seconds interval should be good enough for now.
|
|
32
|
-
* See: https://day.js.org/docs/en/customization/relative-time
|
|
33
|
-
*/
|
|
34
|
-
var isAnHourAgo = Date.now() - _this.props.date.getTime() > 3600 * 1000;
|
|
35
|
-
var timeoutDuration = isAnHourAgo ? 15 * 1000 * 60 : 15 * 1000;
|
|
36
|
-
_this.repaintTimeout = window.setTimeout(_this.repaint, timeoutDuration);
|
|
37
|
-
};
|
|
38
|
-
_this.state = {
|
|
6
|
+
export class RelativeTime extends React.PureComponent {
|
|
7
|
+
static displayName = "RelativeTime";
|
|
8
|
+
repaintTimeout;
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = {
|
|
39
12
|
elapsedText: "-",
|
|
40
13
|
};
|
|
41
|
-
return _this;
|
|
42
14
|
}
|
|
43
|
-
|
|
15
|
+
componentDidMount() {
|
|
44
16
|
this.repaint();
|
|
45
|
-
}
|
|
46
|
-
|
|
17
|
+
}
|
|
18
|
+
componentDidUpdate(prevProps) {
|
|
47
19
|
if (prevProps.date !== this.props.date) {
|
|
48
20
|
this.repaint();
|
|
49
21
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
22
|
+
}
|
|
23
|
+
componentWillUnmount() {
|
|
24
|
+
clearTimeout(this.repaintTimeout);
|
|
25
|
+
}
|
|
26
|
+
repaint = () => {
|
|
52
27
|
clearTimeout(this.repaintTimeout);
|
|
28
|
+
const elapsedText = dayjs(this.props.date).fromNow();
|
|
29
|
+
this.setState({ elapsedText });
|
|
30
|
+
/**
|
|
31
|
+
* dayjs relative time plugin uses 45 minutes for "an hour ago" threshold and 45 seconds for "a minute ago" threshold.
|
|
32
|
+
* Repaint after 15 minutes / seconds interval should be good enough for now.
|
|
33
|
+
* See: https://day.js.org/docs/en/customization/relative-time
|
|
34
|
+
*/
|
|
35
|
+
const isAnHourAgo = Date.now() - this.props.date.getTime() > 3600 * 1000;
|
|
36
|
+
const timeoutDuration = isAnHourAgo ? 15 * 1000 * 60 : 15 * 1000;
|
|
37
|
+
this.repaintTimeout = window.setTimeout(this.repaint, timeoutDuration);
|
|
53
38
|
};
|
|
54
|
-
|
|
39
|
+
render() {
|
|
55
40
|
return this.state.elapsedText;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return RelativeTime;
|
|
59
|
-
}(React.PureComponent));
|
|
60
|
-
export { RelativeTime };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
61
43
|
//# sourceMappingURL=RelativeTime.js.map
|
package/core/RelativeTime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelativeTime.js","sourceRoot":"","sources":["../../src/core/RelativeTime.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RelativeTime.js","sourceRoot":"","sources":["../../src/core/RelativeTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,yCAAyC;AACzC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAU3B,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,aAA2B;IAC/D,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;IAE5B,cAAc,CAAqB;IAE3C,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,WAAW,EAAE,GAAG;SACnB,CAAC;IACN,CAAC;IAED,iBAAiB;QACb,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,kBAAkB,CAAC,SAA0B;QACzC,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;IACL,CAAC;IAED,oBAAoB;QAChB,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,GAAG,GAAG,EAAE;QACX,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAElC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACrD,IAAI,CAAC,QAAQ,CAAC,EAAC,WAAW,EAAC,CAAC,CAAC;QAC7B;;;;WAIG;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;QACzE,MAAM,eAAe,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;IAClC,CAAC"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import React from "react";
|
|
13
2
|
import { useDraggable } from "../../hooks/useDraggable";
|
|
14
3
|
import { classNames } from "../../util/ClassNames";
|
|
15
4
|
import { ReactUtil } from "../../util/ReactUtil";
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return React.createElement("div", __assign({ className: classNames("resizer", className), ref: ref }, bind));
|
|
5
|
+
export const Resizer = ReactUtil.memo("Resizer", ({ onResizeStart, onResize, gap, className }) => {
|
|
6
|
+
const ref = React.useRef(null);
|
|
7
|
+
const bind = useDraggable({ target: ref, onDragStart: onResizeStart, onDrag: onResize, disabled: true, gap });
|
|
8
|
+
return React.createElement("div", { className: classNames("resizer", className), ref: ref, ...bind });
|
|
21
9
|
});
|
|
22
10
|
//# sourceMappingURL=Resizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resizer.js","sourceRoot":"","sources":["../../../src/core/Resizable/Resizer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Resizer.js","sourceRoot":"","sources":["../../../src/core/Resizable/Resizer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAS/C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAC,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAQ,EAAE,EAAE;IAClG,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,YAAY,CAAC,EAAC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC;IAE5G,OAAO,6BAAK,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;AACpF,CAAC,CAAC,CAAC"}
|