@pinnacle0/web-ui 0.5.83 → 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.d.ts +0 -1
- package/util/BrowserUtil/index.js +29 -80
- 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/Input.js
CHANGED
|
@@ -1,84 +1,23 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
};
|
|
38
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
-
if (!m) return o;
|
|
41
|
-
var i = m.call(o), r, ar = [], e;
|
|
42
|
-
try {
|
|
43
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
-
}
|
|
45
|
-
catch (error) { e = { error: error }; }
|
|
46
|
-
finally {
|
|
47
|
-
try {
|
|
48
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
-
}
|
|
50
|
-
finally { if (e) throw e.error; }
|
|
51
|
-
}
|
|
52
|
-
return ar;
|
|
53
|
-
};
|
|
54
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
-
if (ar || !(i in from)) {
|
|
57
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
-
ar[i] = from[i];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
-
};
|
|
63
1
|
import React from "react";
|
|
64
2
|
import AntInput from "antd/es/input";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
3
|
+
export class Input extends React.PureComponent {
|
|
4
|
+
static displayName = "Input";
|
|
5
|
+
static Readonly = (props) => React.createElement(AntInput, { onChange: () => { }, readOnly: true, disabled: true, ...props });
|
|
6
|
+
static Search = ({ onChange, ...rest }) => React.createElement(AntInput.Search, { onChange: e => Input.onChange(e, onChange), ...rest });
|
|
7
|
+
static TextArea = ({ onChange, ...rest }) => React.createElement(AntInput.TextArea, { onChange: e => Input.onChange(e, onChange), ...rest });
|
|
8
|
+
static Password = ({ onChange, ...rest }) => React.createElement(AntInput.Password, { onChange: e => Input.onChange(e, onChange), ...rest });
|
|
9
|
+
static Nullable = ({ value, onChange, ...rest }) => React.createElement(Input, { value: value || "", onChange: value => onChange(value.trim() ? value : null), ...rest });
|
|
10
|
+
static NullableTextArea = ({ value, onChange, ...rest }) => React.createElement(Input.TextArea, { value: value || "", onChange: value => onChange(value.trim() ? value : null), ...rest });
|
|
11
|
+
static onChange = (e, onValueChange, autoTrim) => {
|
|
12
|
+
if (autoTrim) {
|
|
13
|
+
e.target.value = e.target.value.trim();
|
|
14
|
+
}
|
|
15
|
+
onValueChange(e.target.value);
|
|
16
|
+
};
|
|
17
|
+
antInputRef = React.createRef();
|
|
18
|
+
getRef = () => this.props.inputRef ?? this.antInputRef;
|
|
19
|
+
createFocusOptions(focus) {
|
|
20
|
+
const type = focus || this.props.focus;
|
|
82
21
|
if (!type)
|
|
83
22
|
return undefined;
|
|
84
23
|
if (type === "prevent-scroll") {
|
|
@@ -87,50 +26,25 @@ var Input = /** @class */ (function (_super) {
|
|
|
87
26
|
else {
|
|
88
27
|
return { cursor: type === "cursor-at-start" ? "start" : type === "cursor-at-last" ? "end" : "all" };
|
|
89
28
|
}
|
|
29
|
+
}
|
|
30
|
+
handleClick = event => {
|
|
31
|
+
this.getRef().current?.focus(this.createFocusOptions());
|
|
32
|
+
this.props.onClick?.(event);
|
|
90
33
|
};
|
|
91
|
-
|
|
92
|
-
var _a;
|
|
34
|
+
componentDidMount() {
|
|
93
35
|
if (this.props.autoFocus) {
|
|
94
|
-
|
|
36
|
+
this.getRef().current?.focus(this.createFocusOptions());
|
|
95
37
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
38
|
+
}
|
|
39
|
+
blur = () => this.getRef().current?.blur();
|
|
40
|
+
focus = (focusType) => (this.props.inputRef || this.antInputRef).current?.focus(this.createFocusOptions(focusType));
|
|
41
|
+
render() {
|
|
42
|
+
const { onChange,
|
|
99
43
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- not included in restProps
|
|
100
|
-
autoFocus
|
|
44
|
+
autoFocus, autoTrim, inputRef,
|
|
101
45
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- not included in restProps
|
|
102
|
-
onClick
|
|
103
|
-
return React.createElement(AntInput,
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
Input.Readonly = function (props) { return React.createElement(AntInput, __assign({ onChange: function () { }, readOnly: true, disabled: true }, props)); };
|
|
107
|
-
Input.Search = function (_a) {
|
|
108
|
-
var onChange = _a.onChange, rest = __rest(_a, ["onChange"]);
|
|
109
|
-
return React.createElement(AntInput.Search, __assign({ onChange: function (e) { return Input.onChange(e, onChange); } }, rest));
|
|
110
|
-
};
|
|
111
|
-
Input.TextArea = function (_a) {
|
|
112
|
-
var onChange = _a.onChange, rest = __rest(_a, ["onChange"]);
|
|
113
|
-
return React.createElement(AntInput.TextArea, __assign({ onChange: function (e) { return Input.onChange(e, onChange); } }, rest));
|
|
114
|
-
};
|
|
115
|
-
Input.Password = function (_a) {
|
|
116
|
-
var onChange = _a.onChange, rest = __rest(_a, ["onChange"]);
|
|
117
|
-
return React.createElement(AntInput.Password, __assign({ onChange: function (e) { return Input.onChange(e, onChange); } }, rest));
|
|
118
|
-
};
|
|
119
|
-
Input.Nullable = function (_a) {
|
|
120
|
-
var value = _a.value, onChange = _a.onChange, rest = __rest(_a, ["value", "onChange"]);
|
|
121
|
-
return React.createElement(Input, __assign({ value: value || "", onChange: function (value) { return onChange(value.trim() ? value : null); } }, rest));
|
|
122
|
-
};
|
|
123
|
-
Input.NullableTextArea = function (_a) {
|
|
124
|
-
var value = _a.value, onChange = _a.onChange, rest = __rest(_a, ["value", "onChange"]);
|
|
125
|
-
return React.createElement(Input.TextArea, __assign({ value: value || "", onChange: function (value) { return onChange(value.trim() ? value : null); } }, rest));
|
|
126
|
-
};
|
|
127
|
-
Input.onChange = function (e, onValueChange, autoTrim) {
|
|
128
|
-
if (autoTrim) {
|
|
129
|
-
e.target.value = e.target.value.trim();
|
|
130
|
-
}
|
|
131
|
-
onValueChange(e.target.value);
|
|
132
|
-
};
|
|
133
|
-
return Input;
|
|
134
|
-
}(React.PureComponent));
|
|
135
|
-
export { Input };
|
|
46
|
+
onClick, ...restProps } = this.props;
|
|
47
|
+
return React.createElement(AntInput, { ...restProps, ref: inputRef || this.antInputRef, onClick: this.handleClick, onChange: e => Input.onChange(e, onChange, autoTrim) });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
136
50
|
//# sourceMappingURL=Input.js.map
|
package/core/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/core/Input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/core/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,eAAe,CAAC;AA8BrC,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAoB;IACjD,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC;IAE7B,MAAM,CAAC,QAAQ,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,oBAAC,QAAQ,IAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,QAAQ,QAAC,QAAQ,WAAK,KAAK,GAAI,CAAC;IAE/G,MAAM,CAAC,MAAM,GAAG,CAAC,EAAC,QAAQ,EAAE,GAAG,IAAI,EAAmB,EAAE,EAAE,CAAC,oBAAC,QAAQ,CAAC,MAAM,IAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAM,IAAI,GAAI,CAAC;IAErI,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAC,QAAQ,EAAE,GAAG,IAAI,EAAqB,EAAE,EAAE,CAAC,oBAAC,QAAQ,CAAC,QAAQ,IAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAM,IAAI,GAAI,CAAC;IAE3I,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAC,QAAQ,EAAE,GAAG,IAAI,EAAqB,EAAE,EAAE,CAAC,oBAAC,QAAQ,CAAC,QAAQ,IAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QA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AI,CAAC,KAAK,CAAC;QACf,OAAO,oBAAC,QAAQ,OAAK,SAAS,EAAE,GAAG,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAI,CAAC;IAC3J,CAAC"}
|
package/core/LabelledSelect.js
CHANGED
|
@@ -1,42 +1,10 @@
|
|
|
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 { Select } from "./Select";
|
|
28
2
|
import React from "react";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
export class LabelledSelect extends React.PureComponent {
|
|
4
|
+
static displayName = "LabelledSelect";
|
|
5
|
+
static Option = Select.Option;
|
|
6
|
+
render() {
|
|
7
|
+
return React.createElement(Select, { optionLabelProp: "label", ...this.props });
|
|
33
8
|
}
|
|
34
|
-
|
|
35
|
-
return React.createElement(Select, __assign({ optionLabelProp: "label" }, this.props));
|
|
36
|
-
};
|
|
37
|
-
LabelledSelect.displayName = "LabelledSelect";
|
|
38
|
-
LabelledSelect.Option = Select.Option;
|
|
39
|
-
return LabelledSelect;
|
|
40
|
-
}(React.PureComponent));
|
|
41
|
-
export { LabelledSelect };
|
|
9
|
+
}
|
|
42
10
|
//# sourceMappingURL=LabelledSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelledSelect.js","sourceRoot":"","sources":["../../src/core/LabelledSelect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabelledSelect.js","sourceRoot":"","sources":["../../src/core/LabelledSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,OAAO,cAA8C,SAAQ,KAAK,CAAC,aAA+B;IACpG,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC;IAEtC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAkE,CAAC;IAE1F,MAAM;QACF,OAAO,oBAAC,MAAM,IAAC,eAAe,EAAC,OAAO,KAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IAC9D,CAAC"}
|
package/core/Link.js
CHANGED
|
@@ -1,29 +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
1
|
import React from "react";
|
|
17
2
|
import { NavLink as ReactRouterLink } from "react-router-dom";
|
|
18
3
|
import { classNames } from "../util/ClassNames";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Link.prototype.render = function () {
|
|
25
|
-
var _a = this.props, to = _a.to, children = _a.children, newTab = _a.newTab, replace = _a.replace, className = _a.className, style = _a.style;
|
|
26
|
-
var fullClassNames = classNames({
|
|
4
|
+
export class Link extends React.PureComponent {
|
|
5
|
+
static displayName = "Link";
|
|
6
|
+
render() {
|
|
7
|
+
const { to, children, newTab, replace, className, style } = this.props;
|
|
8
|
+
const fullClassNames = classNames({
|
|
27
9
|
"g-text-link": typeof children === "string" || typeof children === "number",
|
|
28
10
|
}, className);
|
|
29
11
|
if (typeof to === "object") {
|
|
@@ -40,9 +22,6 @@ var Link = /** @class */ (function (_super) {
|
|
|
40
22
|
else {
|
|
41
23
|
return (React.createElement("a", { onClick: to, className: fullClassNames, style: style }, children));
|
|
42
24
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return Link;
|
|
46
|
-
}(React.PureComponent));
|
|
47
|
-
export { Link };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
48
27
|
//# sourceMappingURL=Link.js.map
|
package/core/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["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H,2BAAG,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,IAC5G,QAAQ,CACT,CACP,CAAC;YACN,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,OAAO,CACH,2BAAG,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,IAClD,QAAQ,CACT,CACP,CAAC;QACN,CAAC;IACL,CAAC"}
|
package/core/LocalImporter.js
CHANGED
|
@@ -1,92 +1,30 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
1
|
import React from "react";
|
|
53
2
|
import AntUpload from "antd/es/upload";
|
|
54
3
|
import { i18n } from "../internal/i18n/core";
|
|
55
4
|
import { TextUtil } from "../internal/TextUtil";
|
|
56
5
|
import { Spin } from "./Spin";
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0:
|
|
65
|
-
_a.trys.push([0, , 2, 3]);
|
|
66
|
-
this.setState({ importing: true });
|
|
67
|
-
return [4 /*yield*/, this.props.onImport(file)];
|
|
68
|
-
case 1:
|
|
69
|
-
_a.sent();
|
|
70
|
-
return [3 /*break*/, 3];
|
|
71
|
-
case 2:
|
|
72
|
-
this.setState({ importing: false });
|
|
73
|
-
return [7 /*endfinally*/];
|
|
74
|
-
case 3: return [2 /*return*/, false];
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}); };
|
|
78
|
-
_this.state = { importing: false };
|
|
79
|
-
return _this;
|
|
6
|
+
export class LocalImporter extends React.PureComponent {
|
|
7
|
+
static displayName = "LocalImporter";
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = { importing: false };
|
|
80
11
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
12
|
+
beforeUpload = async (file) => {
|
|
13
|
+
try {
|
|
14
|
+
this.setState({ importing: true });
|
|
15
|
+
await this.props.onImport(file);
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
this.setState({ importing: false });
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
87
21
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
22
|
+
render() {
|
|
23
|
+
const { type, children, className, disabled, style } = this.props;
|
|
24
|
+
const { importing } = this.state;
|
|
25
|
+
const t = i18n();
|
|
26
|
+
return (React.createElement(AntUpload.Dragger, { showUploadList: false, multiple: false, accept: type === "txt" ? ".txt" : ".csv", className: className, disabled: disabled, style: style, height: Number(style?.height), beforeUpload: this.beforeUpload },
|
|
27
|
+
React.createElement(Spin, { spinning: importing, size: "small" }, children || TextUtil.interpolate(t.localImporterHint, type))));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
92
30
|
//# sourceMappingURL=LocalImporter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalImporter.js","sourceRoot":"","sources":["../../src/core/LocalImporter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalImporter.js","sourceRoot":"","sources":["../../src/core/LocalImporter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAe5B,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAA2B;IAChE,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC;IAErC,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC;IACpC,CAAC;IAED,YAAY,GAAG,KAAK,EAAE,IAAU,EAAkB,EAAE;QAChD,IAAI,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;YACjC,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,QAAQ,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM;QACF,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAChE,MAAM,EAAC,SAAS,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC/B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;QACjB,OAAO,CACH,oBAAC,SAAS,CAAC,OAAO,IACd,cAAc,EAAE,KAAK,EACrB,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EACxC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,EAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAE/B,oBAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,OAAO,IAClC,QAAQ,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACzD,CACS,CACvB,CAAC;IACN,CAAC"}
|
package/core/LocaleSelect.js
CHANGED
|
@@ -1,70 +1,23 @@
|
|
|
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 { EnumSelect } from "./EnumSelect";
|
|
43
3
|
import { LocaleUtil } from "../util/LocaleUtil";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
LocaleSelect.prototype.render = function () {
|
|
61
|
-
var currentLocale = LocaleUtil.current();
|
|
4
|
+
export class LocaleSelect extends React.PureComponent {
|
|
5
|
+
static displayName = "LocaleSelect";
|
|
6
|
+
allLocales = ["zh", "en"];
|
|
7
|
+
selectStyle = { width: 120 };
|
|
8
|
+
translator = (locale) => {
|
|
9
|
+
switch (locale) {
|
|
10
|
+
case "en":
|
|
11
|
+
return "English";
|
|
12
|
+
case "zh":
|
|
13
|
+
return "中文";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
render() {
|
|
17
|
+
const currentLocale = LocaleUtil.current();
|
|
62
18
|
return (React.createElement(EnumSelect, { list: this.allLocales, translator: this.translator, style: this.selectStyle, value: currentLocale,
|
|
63
19
|
// Do not use onChange={LocaleUtil.change}, due to "this" issue
|
|
64
|
-
onChange:
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return LocaleSelect;
|
|
68
|
-
}(React.PureComponent));
|
|
69
|
-
export { LocaleSelect };
|
|
20
|
+
onChange: newLocale => LocaleUtil.change(newLocale) }));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
70
23
|
//# sourceMappingURL=LocaleSelect.js.map
|
package/core/LocaleSelect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleSelect.js","sourceRoot":"","sources":["../../src/core/LocaleSelect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocaleSelect.js","sourceRoot":"","sources":["../../src/core/LocaleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAExC,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAI9C,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,aAAoB;IACxD,MAAM,CAAC,WAAW,GAAG,cAAc,CAAC;IAEnB,UAAU,GAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,WAAW,GAAwB,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC;IAEjE,UAAU,GAAG,CAAC,MAAc,EAAU,EAAE;QACpC,QAAQ,MAAM,EAAE,CAAC;YACb,KAAK,IAAI;gBACL,OAAO,SAAS,CAAC;YACrB,KAAK,IAAI;gBACL,OAAO,IAAI,CAAC;QACpB,CAAC;IACL,CAAC,CAAC;IAEF,MAAM;QACF,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;QAC3C,OAAO,CACH,oBAAC,UAAU,IACP,IAAI,EAAE,IAAI,CAAC,UAAU,EACrB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,WAAW,EACvB,KAAK,EAAE,aAAa;YACpB,+DAA+D;YAC/D,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,GACrD,CACL,CAAC;IACN,CAAC"}
|