@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
|
@@ -1,43 +1,3 @@
|
|
|
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 __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 { Space } from "./Space";
|
|
43
3
|
import { NumberInput } from "./NumberInput";
|
|
@@ -51,41 +11,34 @@ export var Operator;
|
|
|
51
11
|
Operator["EQUALS"] = "EQUALS";
|
|
52
12
|
Operator["NOT_EQUALS"] = "NOT_EQUALS";
|
|
53
13
|
})(Operator || (Operator = {}));
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return _this;
|
|
80
|
-
}
|
|
81
|
-
AmountConditionInput.prototype.render = function () {
|
|
82
|
-
var _a = this.props, scale = _a.scale, value = _a.value;
|
|
14
|
+
export class AmountConditionInput extends React.PureComponent {
|
|
15
|
+
static displayName = "AmountConditionInput";
|
|
16
|
+
operators = this.props.operators || [Operator.GREATER_THAN, Operator.GREATER_EQUAL, Operator.LESS_THAN, Operator.LESS_EQUAL, Operator.EQUALS];
|
|
17
|
+
selectStyle = { width: 55 };
|
|
18
|
+
inputStyle = { width: 180, borderTopLeftRadius: 0, borderBottomLeftRadius: 0 };
|
|
19
|
+
operatorTranslator = (value) => {
|
|
20
|
+
switch (value) {
|
|
21
|
+
case Operator.GREATER_THAN:
|
|
22
|
+
return ">";
|
|
23
|
+
case Operator.GREATER_EQUAL:
|
|
24
|
+
return "≥";
|
|
25
|
+
case Operator.LESS_THAN:
|
|
26
|
+
return "<";
|
|
27
|
+
case Operator.LESS_EQUAL:
|
|
28
|
+
return "≤";
|
|
29
|
+
case Operator.EQUALS:
|
|
30
|
+
return "=";
|
|
31
|
+
case Operator.NOT_EQUALS:
|
|
32
|
+
return "≠";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
onConditionChange = (value) => this.props.onChange({ condition: value, amount: this.props.value.amount });
|
|
36
|
+
onAmountChange = (value) => this.props.onChange({ condition: this.props.value.condition, amount: value });
|
|
37
|
+
render() {
|
|
38
|
+
const { scale, value } = this.props;
|
|
83
39
|
return (React.createElement(Space.Compact, { block: true },
|
|
84
40
|
React.createElement(EnumSelect, { value: value.condition, onChange: this.onConditionChange, translator: this.operatorTranslator, list: this.operators, style: this.selectStyle }),
|
|
85
41
|
React.createElement(NumberInput, { allowNull: true, scale: scale, value: value.amount, onChange: this.onAmountChange, inputStyle: this.inputStyle })));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return AmountConditionInput;
|
|
89
|
-
}(React.PureComponent));
|
|
90
|
-
export { AmountConditionInput };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
91
44
|
//# sourceMappingURL=AmountConditionInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountConditionInput.js","sourceRoot":"","sources":["../../src/core/AmountConditionInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AmountConditionInput.js","sourceRoot":"","sources":["../../src/core/AmountConditionInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAGxC,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAChB,yCAA6B,CAAA;IAC7B,2CAA+B,CAAA;IAC/B,mCAAuB,CAAA;IACvB,qCAAyB,CAAA;IACzB,6BAAiB,CAAA;IACjB,qCAAyB,CAAA;AAC7B,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAYD,MAAM,OAAO,oBAAqB,SAAQ,KAAK,CAAC,aAAoB;IAChE,MAAM,CAAC,WAAW,GAAG,sBAAsB,CAAC;IAE3B,SAAS,GAAe,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1J,WAAW,GAAwB,EAAC,KAAK,EAAE,EAAE,EAAC,CAAC;IAC/C,UAAU,GAAwB,EAAC,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,C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,IAAC,SAAS,QAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,GAAI,CAC5G,CACnB,CAAC;IACN,CAAC"}
|
package/core/AmountRangeInput.js
CHANGED
|
@@ -1,84 +1,26 @@
|
|
|
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
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
28
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
29
|
-
if (!m) return o;
|
|
30
|
-
var i = m.call(o), r, ar = [], e;
|
|
31
|
-
try {
|
|
32
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
33
|
-
}
|
|
34
|
-
catch (error) { e = { error: error }; }
|
|
35
|
-
finally {
|
|
36
|
-
try {
|
|
37
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38
|
-
}
|
|
39
|
-
finally { if (e) throw e.error; }
|
|
40
|
-
}
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
44
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
45
|
-
if (ar || !(i in from)) {
|
|
46
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
47
|
-
ar[i] = from[i];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
51
|
-
};
|
|
52
1
|
import React from "react";
|
|
53
2
|
import { NumberInput } from "./NumberInput";
|
|
54
3
|
import { Input } from "./Input";
|
|
55
4
|
import { i18n } from "../internal/i18n/core";
|
|
56
5
|
import { Space } from "./Space";
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
61
|
-
_this.minInputStyle = { borderTopRightRadius: 0, borderBottomRightRadius: 0, width: 80, textAlign: "right" };
|
|
62
|
-
_this.maxInputStyle = { borderTopLeftRadius: 0, borderBottomLeftRadius: 0, width: 80, borderLeftWidth: 0, textAlign: "left" };
|
|
63
|
-
_this.connectorStyle = { width: 30, borderLeftWidth: 0, borderRightWidth: 0, backgroundColor: "#fff", pointerEvents: "none" };
|
|
64
|
-
_this.onMinAmountChange = function (value) { return _this.props.onChange([value, _this.props.value[1]]); };
|
|
65
|
-
_this.onMaxAmountChange = function (value) { return _this.props.onChange([_this.props.value[0], value]); };
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
AmountRangeInput.prototype.render = function () {
|
|
69
|
-
var _a = this.props, value = _a.value, scale = _a.scale, disabled = _a.disabled, min = _a.min, shouldNotEqual = _a.shouldNotEqual, allowNull = _a.allowNull, style = _a.style, inputStyle = _a.inputStyle;
|
|
70
|
-
var t = i18n();
|
|
71
|
-
return (React.createElement(Space.Compact, { block: true, style: style },
|
|
72
|
-
React.createElement(NumberInput, { disabled: disabled, allowNull: allowNull, min: min, scale: scale, placeholder: t.minimum, value: value[0], onChange: this.onMinAmountChange, inputStyle: __assign(__assign({}, this.minInputStyle), inputStyle) }),
|
|
73
|
-
React.createElement(Input.Readonly, { style: this.connectorStyle, value: "~" }),
|
|
74
|
-
React.createElement(NumberInput, { disabled: disabled, allowNull: allowNull, min: value[0] !== null ? (shouldNotEqual ? value[0] + 1 : value[0]) : 0, scale: scale, placeholder: t.maximum, value: value[1], onChange: this.onMaxAmountChange, inputStyle: __assign(__assign({}, this.maxInputStyle), inputStyle) })));
|
|
75
|
-
};
|
|
76
|
-
AmountRangeInput.displayName = "AmountRangeInput";
|
|
77
|
-
AmountRangeInput.defaultProps = {
|
|
6
|
+
export class AmountRangeInput extends React.PureComponent {
|
|
7
|
+
static displayName = "AmountRangeInput";
|
|
8
|
+
static defaultProps = {
|
|
78
9
|
scale: 2,
|
|
79
10
|
min: 0,
|
|
80
11
|
};
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
12
|
+
minInputStyle = { borderTopRightRadius: 0, borderBottomRightRadius: 0, width: 80, textAlign: "right" };
|
|
13
|
+
maxInputStyle = { borderTopLeftRadius: 0, borderBottomLeftRadius: 0, width: 80, borderLeftWidth: 0, textAlign: "left" };
|
|
14
|
+
connectorStyle = { width: 30, borderLeftWidth: 0, borderRightWidth: 0, backgroundColor: "#fff", pointerEvents: "none" };
|
|
15
|
+
onMinAmountChange = (value) => this.props.onChange([value, this.props.value[1]]);
|
|
16
|
+
onMaxAmountChange = (value) => this.props.onChange([this.props.value[0], value]);
|
|
17
|
+
render() {
|
|
18
|
+
const { value, scale, disabled, min, shouldNotEqual, allowNull, style, inputStyle } = this.props;
|
|
19
|
+
const t = i18n();
|
|
20
|
+
return (React.createElement(Space.Compact, { block: true, style: style },
|
|
21
|
+
React.createElement(NumberInput, { disabled: disabled, allowNull: allowNull, min: min, scale: scale, placeholder: t.minimum, value: value[0], onChange: this.onMinAmountChange, inputStyle: { ...this.minInputStyle, ...inputStyle } }),
|
|
22
|
+
React.createElement(Input.Readonly, { style: this.connectorStyle, value: "~" }),
|
|
23
|
+
React.createElement(NumberInput, { disabled: disabled, allowNull: allowNull, min: value[0] !== null ? (shouldNotEqual ? value[0] + 1 : value[0]) : 0, scale: scale, placeholder: t.maximum, value: value[1], onChange: this.onMaxAmountChange, inputStyle: { ...this.maxInputStyle, ...inputStyle } })));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
84
26
|
//# sourceMappingURL=AmountRangeInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountRangeInput.js","sourceRoot":"","sources":["../../src/core/AmountRangeInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AmountRangeInput.js","sourceRoot":"","sources":["../../src/core/AmountRangeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAc9B,MAAM,OAAO,gBAAoC,SAAQ,KAAK,CAAC,aAAuB;IAClF,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAExC,MAAM,CAAC,YAAY,GAA6B;QAC5C,KAAK,EAAE,CAAC;QACR,GAAG,EAAE,CAAC;KACT,CAAC;IAEe,aAAa,GAAwB,EAAC,oBAAoB,EAAE,CAAC,EAAE,uBAAuB,E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AI,CAAC,iBAAiB,EAChC,UAAU,EAAE,EAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,UAAU,EAAC,GACpD;YACF,oBAAC,KAAK,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,EAAC,GAAG,GAAG;YACxD,oBAAC,WAAW,IACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAU,EACrB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACvE,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,CAAC,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAQ,EACtB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,UAAU,EAAE,EAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,UAAU,EAAC,GACpD,CACU,CACnB,CAAC;IACN,CAAC"}
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
var __values = (this && this.__values) || function(o) {
|
|
2
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
-
if (m) return m.call(o);
|
|
4
|
-
if (o && typeof o.length === "number") return {
|
|
5
|
-
next: function () {
|
|
6
|
-
if (o && i >= o.length) o = void 0;
|
|
7
|
-
return { value: o && o[i++], done: !o };
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
-
};
|
|
12
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
-
if (!m) return o;
|
|
15
|
-
var i = m.call(o), r, ar = [], e;
|
|
16
|
-
try {
|
|
17
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
-
}
|
|
19
|
-
catch (error) { e = { error: error }; }
|
|
20
|
-
finally {
|
|
21
|
-
try {
|
|
22
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
-
}
|
|
24
|
-
finally { if (e) throw e.error; }
|
|
25
|
-
}
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
1
|
import React from "react";
|
|
29
2
|
import { usePrevious } from "../../hooks/usePrevious";
|
|
30
3
|
import { useForceUpdate } from "../../hooks/useForceUpdate";
|
|
@@ -34,35 +7,34 @@ import { useForceUpdate } from "../../hooks/useForceUpdate";
|
|
|
34
7
|
* Caveat: insert and remove element by index during animation do not work as expected
|
|
35
8
|
* PS: This component will most likely have bugs, so please fix them if you find any. ⛑️
|
|
36
9
|
*/
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var previousValidChildren = usePrevious(validChildren);
|
|
10
|
+
export const AnimatePresence = ({ children }) => {
|
|
11
|
+
const validChildren = getValidChildren(children);
|
|
12
|
+
const previousValidChildren = usePrevious(validChildren);
|
|
41
13
|
// render key of current rendered children, order matters
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
14
|
+
const renderedKeyList = React.useRef(validChildren.map(_ => getKey(_)));
|
|
15
|
+
const elementMapRef = React.useRef(new Map());
|
|
16
|
+
const forceUpdate = useForceUpdate();
|
|
17
|
+
const elementMap = elementMapRef.current;
|
|
46
18
|
// update the element map, update element by key, it there are any revert of element removal, it will be updated here
|
|
47
|
-
validChildren.map(
|
|
19
|
+
validChildren.map(element => elementMap.set(getKey(element), React.cloneElement(element, { __removed: false, __onExited: undefined })));
|
|
48
20
|
// calculate removed children of this render cycle, and update the their props of the element element map
|
|
49
|
-
|
|
50
|
-
removedChildren.forEach(
|
|
51
|
-
|
|
21
|
+
const removedChildren = calculateRemovedChildren(validChildren, previousValidChildren);
|
|
22
|
+
removedChildren.forEach(element => {
|
|
23
|
+
const key = getKey(element);
|
|
52
24
|
elementMap.set(key, React.cloneElement(element, {
|
|
53
25
|
__removed: true,
|
|
54
|
-
__onExited:
|
|
26
|
+
__onExited: () => {
|
|
55
27
|
elementMapRef.current.delete(key);
|
|
56
|
-
renderedKeyList.current = renderedKeyList.current.filter(
|
|
28
|
+
renderedKeyList.current = renderedKeyList.current.filter(_ => _ !== key);
|
|
57
29
|
forceUpdate();
|
|
58
30
|
},
|
|
59
31
|
}));
|
|
60
32
|
});
|
|
61
33
|
// loop through the element map find the index of all removed element in current rendered children (according to the renderedKeyList)
|
|
62
|
-
|
|
63
|
-
elementMapRef.current.forEach(
|
|
34
|
+
const removedChildrenRenderListIndex = [];
|
|
35
|
+
elementMapRef.current.forEach((element, key) => {
|
|
64
36
|
if (element.props.__removed) {
|
|
65
|
-
|
|
37
|
+
const index = renderedKeyList.current.findIndex(_ => _ === key);
|
|
66
38
|
if (index !== -1) {
|
|
67
39
|
removedChildrenRenderListIndex.push(index);
|
|
68
40
|
}
|
|
@@ -70,17 +42,16 @@ export var AnimatePresence = function (_a) {
|
|
|
70
42
|
});
|
|
71
43
|
// calculate added children and insert they into the renderedKeyList, the insert index is depend the number of removed children before it
|
|
72
44
|
// eg. A element is added at index 2 in the original children, if there are 2 removed children before it, it will be inserted at index 4
|
|
73
|
-
|
|
74
|
-
addedChildren.forEach(
|
|
75
|
-
|
|
76
|
-
var key = getKey(element);
|
|
45
|
+
const addedChildren = calculateAddedChildren(validChildren, previousValidChildren);
|
|
46
|
+
addedChildren.forEach(({ element, index }) => {
|
|
47
|
+
const key = getKey(element);
|
|
77
48
|
if (renderedKeyList.current.includes(key))
|
|
78
49
|
return;
|
|
79
|
-
|
|
50
|
+
const numOfRemovedChildrenBefore = removedChildrenRenderListIndex.filter(_ => _ <= index).length;
|
|
80
51
|
renderedKeyList.current.splice(index + numOfRemovedChildrenBefore, 0, getKey(element));
|
|
81
52
|
});
|
|
82
53
|
// render the children according to the renderedKeyList
|
|
83
|
-
|
|
54
|
+
const childrenToRender = renderedKeyList.current.map(key => elementMap.get(key));
|
|
84
55
|
return React.createElement(React.Fragment, null, childrenToRender);
|
|
85
56
|
};
|
|
86
57
|
function getKey(element) {
|
|
@@ -88,55 +59,32 @@ function getKey(element) {
|
|
|
88
59
|
return element.key;
|
|
89
60
|
}
|
|
90
61
|
function calculateRemovedChildren(currentChildren, previousChildren) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var _d = __read(_c.value, 2), element = _d[1];
|
|
97
|
-
if (!currentKeys.has(getKey(element))) {
|
|
98
|
-
removedChildren.push(element);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
103
|
-
finally {
|
|
104
|
-
try {
|
|
105
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
62
|
+
const currentKeys = new Set(currentChildren.map(_ => _.key));
|
|
63
|
+
const removedChildren = [];
|
|
64
|
+
for (const [, element] of previousChildren.entries()) {
|
|
65
|
+
if (!currentKeys.has(getKey(element))) {
|
|
66
|
+
removedChildren.push(element);
|
|
106
67
|
}
|
|
107
|
-
finally { if (e_1) throw e_1.error; }
|
|
108
68
|
}
|
|
109
69
|
return removedChildren;
|
|
110
70
|
}
|
|
111
71
|
function calculateAddedChildren(currentChildren, previousChildren) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var _d = __read(_c.value, 2), index = _d[0], element = _d[1];
|
|
118
|
-
if (!previousKeys.has(getKey(element))) {
|
|
119
|
-
addedChildren.push({ element: element, index: index });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
124
|
-
finally {
|
|
125
|
-
try {
|
|
126
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
72
|
+
const previousKeys = new Set(previousChildren.map(_ => _.key));
|
|
73
|
+
const addedChildren = [];
|
|
74
|
+
for (const [index, element] of currentChildren.entries()) {
|
|
75
|
+
if (!previousKeys.has(getKey(element))) {
|
|
76
|
+
addedChildren.push({ element, index });
|
|
127
77
|
}
|
|
128
|
-
finally { if (e_2) throw e_2.error; }
|
|
129
78
|
}
|
|
130
79
|
return addedChildren;
|
|
131
80
|
}
|
|
132
81
|
function getValidChildren(children) {
|
|
133
|
-
|
|
134
|
-
React.Children.forEach(children,
|
|
135
|
-
var _a;
|
|
82
|
+
const validElements = [];
|
|
83
|
+
React.Children.forEach(children, element => {
|
|
136
84
|
if (!React.isValidElement(element))
|
|
137
85
|
return;
|
|
138
|
-
invariant(
|
|
139
|
-
invariant(element.key !== null,
|
|
86
|
+
invariant(element.type?.$isAnimatedComponent === true, `<${element.type}> is not a Animated element. All children of <AnimatePresence> should be created from Animated, e.g. <Animated.div />`);
|
|
87
|
+
invariant(element.key !== null, `Animated element must have a specified key`);
|
|
140
88
|
validElements.push(element);
|
|
141
89
|
});
|
|
142
90
|
return validElements;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatePresence.js","sourceRoot":"","sources":["../../../src/core/Animated/AnimatePresence.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimatePresence.js","sourceRoot":"","sources":["../../../src/core/Animated/AnimatePresence.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAU1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,QAAQ,EAAQ,EAAE,EAAE;IACjD,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;I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,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;QACvC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;YAAE,OAAO;QAC3C,SAAS,CACJ,OAAO,CAAC,IAAY,EAAE,oBAAoB,KAAK,IAAI,EACpD,IAAI,OAAO,CAAC,IAAI,uHAAuH,CAC1I,CAAC;QACF,SAAS,CAAC,OAAO,CAAC,GAAG,KAAK,IAAI,EAAE,4CAA4C,CAAC,CAAC;QAE9E,aAAa,CAAC,IAAI,CAAC,OAA6B,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,SAAc,EAAE,OAAe;IACrD,IAAI,SAAS,EAAE,CAAC;QACZ,OAAO;IACX,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1,81 +1,59 @@
|
|
|
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 React from "react";
|
|
24
2
|
import { useCompositeRef } from "../../hooks/useCompositeRef";
|
|
25
3
|
import classNames from "classnames";
|
|
26
4
|
export function createAnimatedComponent(element) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
__onExited
|
|
31
|
-
onExited
|
|
5
|
+
const Animated = React.forwardRef(function (props, ref) {
|
|
6
|
+
const { children, enter, exit, onEntered, onEntering, onExited, onExiting, className, __removed, __onExited, ...restProps } = props;
|
|
7
|
+
const exited = () => {
|
|
8
|
+
__onExited?.();
|
|
9
|
+
onExited?.();
|
|
32
10
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
const animationSettings = { enter, exit, onEntered, onEntering, onExiting, exited };
|
|
12
|
+
const elementRef = React.useRef(null);
|
|
13
|
+
const compositeRef = useCompositeRef(elementRef, typeof ref === "string" ? null : ref);
|
|
14
|
+
const animationSettingsRef = React.useRef(animationSettings);
|
|
37
15
|
animationSettingsRef.current = animationSettings;
|
|
38
|
-
React.useLayoutEffect(
|
|
39
|
-
|
|
16
|
+
React.useLayoutEffect(() => {
|
|
17
|
+
const element = elementRef.current;
|
|
40
18
|
if (!element)
|
|
41
19
|
return;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onEntering
|
|
20
|
+
const { enter, onEntered, onEntering } = animationSettingsRef.current;
|
|
21
|
+
const keyframe = typeof enter === "function" ? enter(element) : enter;
|
|
22
|
+
onEntering?.();
|
|
45
23
|
if (!keyframe) {
|
|
46
|
-
onEntered
|
|
24
|
+
onEntered?.();
|
|
47
25
|
return;
|
|
48
26
|
}
|
|
49
|
-
|
|
50
|
-
animation.onfinish =
|
|
51
|
-
onEntered
|
|
27
|
+
const animation = element.animate(keyframe.frames, keyframe.options);
|
|
28
|
+
animation.onfinish = () => {
|
|
29
|
+
onEntered?.();
|
|
52
30
|
};
|
|
53
|
-
return
|
|
31
|
+
return () => {
|
|
54
32
|
animation.onfinish = null;
|
|
55
33
|
};
|
|
56
34
|
}, []);
|
|
57
|
-
React.useLayoutEffect(
|
|
58
|
-
|
|
35
|
+
React.useLayoutEffect(() => {
|
|
36
|
+
const element = elementRef.current;
|
|
59
37
|
if (typeof __removed !== "boolean" || __removed === false || !element)
|
|
60
38
|
return;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onExiting
|
|
39
|
+
const { exit, onExiting, exited } = animationSettingsRef.current;
|
|
40
|
+
const keyframe = typeof exit === "function" ? exit(element) : exit;
|
|
41
|
+
onExiting?.();
|
|
64
42
|
if (!keyframe) {
|
|
65
43
|
exited();
|
|
66
44
|
return;
|
|
67
45
|
}
|
|
68
|
-
|
|
46
|
+
const animation = element.animate(keyframe.frames, keyframe.options);
|
|
69
47
|
animation.onfinish = exited;
|
|
70
|
-
return
|
|
48
|
+
return () => {
|
|
71
49
|
animation.cancel();
|
|
72
50
|
animation.onfinish = null;
|
|
73
51
|
};
|
|
74
52
|
}, [__removed]);
|
|
75
|
-
return React.createElement(element,
|
|
53
|
+
return React.createElement(element, { ...restProps, ref: compositeRef, className: classNames(className, { removing: __removed }) }, children);
|
|
76
54
|
});
|
|
77
55
|
Object.defineProperty(Animated, "$isAnimatedComponent", { value: true, enumerable: false, writable: false });
|
|
78
|
-
Object.defineProperty(Animated, "displayName", { value:
|
|
56
|
+
Object.defineProperty(Animated, "displayName", { value: `Animated.${element}`, enumerable: false, writable: false });
|
|
79
57
|
return Animated;
|
|
80
58
|
}
|
|
81
59
|
//# sourceMappingURL=createAnimatedComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnimatedComponent.js","sourceRoot":"","sources":["../../../src/core/Animated/createAnimatedComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAnimatedComponent.js","sourceRoot":"","sources":["../../../src/core/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AAS,CAAC,MAAM,EAAE,CAAC;gBACnB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC9B,CAAC,CAAC;QACN,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAEhB,OAAO,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAC,GAAI,SAAiB,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAC,CAAC,EAAC,EAAE,QAAQ,CAAC,CAAC;IACvJ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC;IAC3G,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAC,KAAK,EAAE,YAAY,OAAO,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC;IAEnH,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
package/core/Animated/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createAnimatedComponent } from "./createAnimatedComponent";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- need to cover all type of function
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
get
|
|
6
|
-
|
|
3
|
+
const componentCache = new Map();
|
|
4
|
+
export const RawAnimated = new Proxy({}, {
|
|
5
|
+
get(_, key) {
|
|
6
|
+
let component = componentCache.get(key);
|
|
7
7
|
if (!component) {
|
|
8
8
|
component = createAnimatedComponent(key);
|
|
9
9
|
componentCache.set(key, component);
|
|
@@ -17,6 +17,6 @@ export var RawAnimated = new Proxy({}, {
|
|
|
17
17
|
* Seem like the LSP will try to calculate the props type base on all key of React.JSX.IntrinsicElements
|
|
18
18
|
* Don't know exactly why. But it's slow as hell
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export const Animated = RawAnimated;
|
|
21
21
|
export { AnimatePresence } from "./AnimatePresence";
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Animated/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAyB,MAAM,2BAA2B,CAAC;AAM1F,4GAA4G;AAC5G,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Animated/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAyB,MAAM,2BAA2B,CAAC;AAM1F,4GAA4G;AAC5G,MAAM,cAAc,GAAG,IAAI,GAAG,EAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,WAAW,GAAQ,IAAI,KAAK,CACrC,EAAE,EACF;IACI,GAAG,CAAC,CAAC,EAAE,GAAW;QACd,IAAI,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,SAAS,GAAG,uBAAuB,CAAC,GAAU,CAAC,CAAC;YAChD,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CACJ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiB,WAA2B,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC"}
|