@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/Table.js
CHANGED
|
@@ -1,40 +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 __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
1
|
import React from "react";
|
|
39
2
|
import AntTable from "antd/es/table";
|
|
40
3
|
import FileSearchOutlined from "@ant-design/icons/FileSearchOutlined";
|
|
@@ -50,86 +13,96 @@ var SortOrder;
|
|
|
50
13
|
SortOrder["DESC"] = "DESC";
|
|
51
14
|
SortOrder["ASC"] = "ASC";
|
|
52
15
|
})(SortOrder || (SortOrder = {}));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
16
|
+
export class Table extends React.PureComponent {
|
|
17
|
+
static displayName = "Table";
|
|
18
|
+
static defaultProps = {
|
|
19
|
+
scrollX: "max-content",
|
|
20
|
+
};
|
|
21
|
+
emptyPlaceHolderContainerStyle = { padding: "50px 0" };
|
|
22
|
+
emptyPlaceHolderIconStyle = { display: "block", fontSize: 50, marginBottom: 20 };
|
|
23
|
+
settingIconContainerStyle = { display: "flex", justifyContent: "flex-end", marginBottom: "7px", marginRight: "5px" };
|
|
24
|
+
settingIconStyle = { fontSize: "20px" };
|
|
25
|
+
storageKey = `table-customization-config:${this.props.customizedStorageKey || location.pathname}`;
|
|
26
|
+
canCustomized;
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
const columnsCustomizedKeyList = ArrayUtil.compactMap(props.columns, _ => _.customizedKey || null);
|
|
30
|
+
const defaultConfig = ArrayUtil.toObject(columnsCustomizedKeyList, key => [key, true]);
|
|
31
|
+
const savedConfig = LocalStorageUtil.getObject(this.storageKey, defaultConfig, item => typeof item === "object" && !Array.isArray(item) && columnsCustomizedKeyList.some(_ => item[_] !== undefined));
|
|
32
|
+
this.canCustomized = Object.keys(defaultConfig).length > 0;
|
|
33
|
+
this.state = { customizationConfig: savedConfig };
|
|
34
|
+
}
|
|
35
|
+
hasUniqueSortingColumn = () => this.props.columns.some(_ => _.sortField === true);
|
|
36
|
+
rowKeyByIndex = (record) => this.props.dataSource.indexOf(record);
|
|
37
|
+
transformColumns = (column, index) => {
|
|
38
|
+
const { renderData, onHeaderClick, ...restColumnProps } = column;
|
|
39
|
+
const customizedKey = column.customizedKey;
|
|
40
|
+
return {
|
|
41
|
+
// Ant Table requires key when enabling sorting, using column index here
|
|
42
|
+
key: index.toString(),
|
|
43
|
+
onHeaderCell: onHeaderClick ? () => ({ onClick: onHeaderClick }) : undefined,
|
|
44
|
+
render: (_, record, index) => renderData(record, index),
|
|
45
|
+
hidden: column.hidden || (customizedKey ? this.state.customizationConfig[customizedKey] === false : false),
|
|
46
|
+
...restColumnProps,
|
|
76
47
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
48
|
+
};
|
|
49
|
+
onCustomizationConfigChange = (value, key) => {
|
|
50
|
+
const newConfig = { ...this.state.customizationConfig, [key]: value };
|
|
51
|
+
this.setState({ customizationConfig: newConfig });
|
|
52
|
+
LocalStorageUtil.setObject(this.storageKey, newConfig);
|
|
53
|
+
};
|
|
54
|
+
onSortChange = (_1, _2, sorter) => {
|
|
55
|
+
const { sortConfig } = this.props;
|
|
56
|
+
if (sortConfig) {
|
|
57
|
+
if (!("column" in sorter && sorter.column !== undefined) || !("sortField" in sorter.column) || this.hasUniqueSortingColumn()) {
|
|
58
|
+
// AntD sorter here may be {}, if clicking on the header 3rd time (ASC -> DESC -> undefined);
|
|
59
|
+
sortConfig.onSortChange(sortConfig.currentOrder === SortOrder.ASC ? SortOrder.DESC : SortOrder.ASC, sortConfig.currentOrderBy);
|
|
88
60
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
Table.prototype.render = function () {
|
|
114
|
-
var _this = this;
|
|
61
|
+
else {
|
|
62
|
+
const sortField = sorter.column.sortField;
|
|
63
|
+
sortConfig.onSortChange(sorter.order === "ascend" ? SortOrder.ASC : SortOrder.DESC, sortField);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
onRow = (record, index) => {
|
|
68
|
+
const { onRowClick } = this.props;
|
|
69
|
+
return onRowClick
|
|
70
|
+
? {
|
|
71
|
+
onClick: () => onRowClick(record, index),
|
|
72
|
+
}
|
|
73
|
+
: {};
|
|
74
|
+
};
|
|
75
|
+
renderPopoverContent = () => {
|
|
76
|
+
const { columns } = this.props;
|
|
77
|
+
const { customizationConfig } = this.state;
|
|
78
|
+
return columns
|
|
79
|
+
.filter(_ => _.customizedKey && !_.hidden)
|
|
80
|
+
.map((_, index) => (React.createElement("div", { key: index },
|
|
81
|
+
React.createElement(Checkbox, { value: customizationConfig[_.customizedKey] !== false, onChange: checked => this.onCustomizationConfigChange(checked, _.customizedKey) }, _.title))));
|
|
82
|
+
};
|
|
83
|
+
render() {
|
|
115
84
|
//
|
|
116
|
-
|
|
85
|
+
const { sortConfig, loading, columns,
|
|
117
86
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Exclude onRowClick from restProps, because onRowClick also exists in Ant Table props, which is depreciated though
|
|
118
|
-
onRowClick
|
|
119
|
-
|
|
120
|
-
|
|
87
|
+
onRowClick, rowKey, scrollX, scrollY, emptyPlaceholder, emptyIcon, emptyText, ...restProps } = this.props;
|
|
88
|
+
const t = i18n();
|
|
89
|
+
const emptyTextNode = loading ? (React.createElement("div", null)) : (React.createElement("div", { style: this.emptyPlaceHolderContainerStyle }, emptyPlaceholder || (React.createElement(React.Fragment, null,
|
|
121
90
|
emptyIcon || React.createElement(FileSearchOutlined, { style: this.emptyPlaceHolderIconStyle }),
|
|
122
91
|
React.createElement("h2", null, emptyText || t.emptyData)))));
|
|
123
|
-
|
|
92
|
+
let tableColumns;
|
|
124
93
|
if (sortConfig) {
|
|
125
|
-
|
|
126
|
-
tableColumns = columns.map(
|
|
94
|
+
const sortOrder = sortConfig.currentOrder === SortOrder.ASC ? "ascend" : "descend";
|
|
95
|
+
tableColumns = columns.map((column, index) => {
|
|
127
96
|
if (column.sortField) {
|
|
128
|
-
|
|
129
|
-
return
|
|
97
|
+
const isSortingColumn = column.sortField === true || sortConfig.currentOrderBy === column.sortField;
|
|
98
|
+
return {
|
|
99
|
+
...this.transformColumns(column, index),
|
|
100
|
+
sorter: true,
|
|
101
|
+
sortOrder: isSortingColumn ? sortOrder : null,
|
|
102
|
+
};
|
|
130
103
|
}
|
|
131
104
|
else {
|
|
132
|
-
return
|
|
105
|
+
return this.transformColumns(column, index);
|
|
133
106
|
}
|
|
134
107
|
});
|
|
135
108
|
}
|
|
@@ -140,13 +113,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
140
113
|
this.canCustomized && (React.createElement("div", { style: this.settingIconContainerStyle },
|
|
141
114
|
React.createElement(Popover, { trigger: "hover", placement: "bottomLeft", content: this.renderPopoverContent() },
|
|
142
115
|
React.createElement(SettingOutlined, { style: this.settingIconStyle })))),
|
|
143
|
-
React.createElement(AntTable,
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
Table.defaultProps = {
|
|
147
|
-
scrollX: "max-content",
|
|
148
|
-
};
|
|
149
|
-
return Table;
|
|
150
|
-
}(React.PureComponent));
|
|
151
|
-
export { Table };
|
|
116
|
+
React.createElement(AntTable, { tableLayout: "auto", locale: { emptyText: emptyTextNode }, onRow: this.onRow, loading: loading ? { indicator: React.createElement(LoadingOutlined, null) } : false, pagination: false, columns: tableColumns, onChange: this.onSortChange, rowKey: rowKey === "index" ? this.rowKeyByIndex : rowKey, scroll: { x: scrollX === "none" ? undefined : scrollX, y: scrollY }, ...restProps })));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
152
119
|
//# sourceMappingURL=Table.js.map
|
package/core/Table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/core/Table.tsx"],"names":[],"mappings":"
|
|
1
|
+
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EAAC,KAC7D,SAAS,GACf,CACW,CACpB,CAAC;IACN,CAAC"}
|
package/core/Tabs/Single.js
CHANGED
|
@@ -1,53 +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
|
-
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
1
|
import React from "react";
|
|
39
2
|
import { Tabs } from "./index";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
3
|
+
export class Single extends React.PureComponent {
|
|
4
|
+
static displayName = "Single";
|
|
5
|
+
render() {
|
|
6
|
+
const { children, title, ...rest } = this.props;
|
|
7
|
+
return React.createElement(Tabs, { ...rest, items: [{ label: title, key: title, children }] });
|
|
44
8
|
}
|
|
45
|
-
|
|
46
|
-
var _a = this.props, children = _a.children, title = _a.title, rest = __rest(_a, ["children", "title"]);
|
|
47
|
-
return React.createElement(Tabs, __assign({}, rest, { items: [{ label: title, key: title, children: children }] }));
|
|
48
|
-
};
|
|
49
|
-
Single.displayName = "Single";
|
|
50
|
-
return Single;
|
|
51
|
-
}(React.PureComponent));
|
|
52
|
-
export { Single };
|
|
9
|
+
}
|
|
53
10
|
//# sourceMappingURL=Single.js.map
|
package/core/Tabs/Single.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Single.js","sourceRoot":"","sources":["../../../src/core/Tabs/Single.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Single.js","sourceRoot":"","sources":["../../../src/core/Tabs/Single.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAQ7B,MAAM,OAAO,MAAO,SAAQ,KAAK,CAAC,aAAoB;IAClD,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;IAE9B,MAAM;QACF,MAAM,EAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9C,OAAO,oBAAC,IAAI,OAAK,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAC,CAAC,GAAI,CAAC;IAC7E,CAAC"}
|
package/core/Tabs/index.js
CHANGED
|
@@ -1,101 +1,37 @@
|
|
|
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 AntTabs from "antd/es/tabs";
|
|
65
3
|
import { classNames } from "../../util/ClassNames";
|
|
66
4
|
import { Single } from "./Single";
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (initialMaxVisibleTabCount && initialMaxVisibleTabCount >= 1) {
|
|
76
|
-
var tabBarWidth = (_a = _this.tabBarRef) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
|
|
77
|
-
var tabNodes = (_b = _this.tabBarRef) === null || _b === void 0 ? void 0 : _b.querySelectorAll(".ant-tabs-nav-list > .ant-tabs-tab");
|
|
78
|
-
if (tabBarWidth && tabNodes && tabNodes.length > initialMaxVisibleTabCount) {
|
|
79
|
-
var singleTabWidth_1 = tabBarWidth / initialMaxVisibleTabCount;
|
|
80
|
-
Array.from(tabNodes).forEach(function (tabNode) { return (tabNode.style.width = "".concat(singleTabWidth_1, "px")); });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
_this.tabBarCallBackRef = function (tabBar) { return (_this.tabBarRef = tabBar); };
|
|
85
|
-
return _this;
|
|
86
|
-
}
|
|
87
|
-
Tabs.prototype.componentDidMount = function () {
|
|
5
|
+
export class Tabs extends React.PureComponent {
|
|
6
|
+
static displayName = "Tabs";
|
|
7
|
+
static Single = Single;
|
|
8
|
+
static defaultProps = {
|
|
9
|
+
type: "card",
|
|
10
|
+
};
|
|
11
|
+
tabBarRef = null;
|
|
12
|
+
componentDidMount() {
|
|
88
13
|
this.resizeTabs();
|
|
89
14
|
window.addEventListener("resize", this.resizeTabs);
|
|
90
|
-
}
|
|
91
|
-
|
|
15
|
+
}
|
|
16
|
+
componentWillUnmount() {
|
|
92
17
|
window.removeEventListener("resize", this.resizeTabs);
|
|
18
|
+
}
|
|
19
|
+
resizeTabs = () => {
|
|
20
|
+
const { initialMaxVisibleTabCount } = this.props;
|
|
21
|
+
if (initialMaxVisibleTabCount && initialMaxVisibleTabCount >= 1) {
|
|
22
|
+
const tabBarWidth = this.tabBarRef?.getBoundingClientRect().width;
|
|
23
|
+
const tabNodes = this.tabBarRef?.querySelectorAll(".ant-tabs-nav-list > .ant-tabs-tab");
|
|
24
|
+
if (tabBarWidth && tabNodes && tabNodes.length > initialMaxVisibleTabCount) {
|
|
25
|
+
const singleTabWidth = tabBarWidth / initialMaxVisibleTabCount;
|
|
26
|
+
Array.from(tabNodes).forEach(tabNode => (tabNode.style.width = `${singleTabWidth}px`));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
93
29
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
30
|
+
tabBarCallBackRef = (tabBar) => (this.tabBarRef = tabBar);
|
|
31
|
+
render() {
|
|
32
|
+
const { tabBarPrefix, tabBarSuffix, initialMaxVisibleTabCount, className, renderTabBar, type, animated, ...restProps } = this.props;
|
|
97
33
|
// Passing {} or {left:undefined} to <AntTabs tabBarExtraContent> will lead to error
|
|
98
|
-
|
|
34
|
+
let tabBarExtraContent;
|
|
99
35
|
if (tabBarPrefix || tabBarSuffix) {
|
|
100
36
|
tabBarExtraContent = {};
|
|
101
37
|
if (tabBarPrefix)
|
|
@@ -103,16 +39,9 @@ var Tabs = /** @class */ (function (_super) {
|
|
|
103
39
|
if (tabBarSuffix)
|
|
104
40
|
tabBarExtraContent.right = tabBarSuffix;
|
|
105
41
|
}
|
|
106
|
-
return (React.createElement(AntTabs,
|
|
42
|
+
return (React.createElement(AntTabs, { className: classNames("g-tabs", className, { "with-max-visible-tab-count": initialMaxVisibleTabCount }), animated: animated === undefined ? type === "line" : animated, type: type, tabBarExtraContent: tabBarExtraContent,
|
|
107
43
|
// DefaultTabBar is a React.ForwardRef component but mark as a React.ComponentType by antd, needed to change the type to 'any' in order to assign ref
|
|
108
|
-
renderTabBar: renderTabBar || (
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
Tabs.Single = Single;
|
|
112
|
-
Tabs.defaultProps = {
|
|
113
|
-
type: "card",
|
|
114
|
-
};
|
|
115
|
-
return Tabs;
|
|
116
|
-
}(React.PureComponent));
|
|
117
|
-
export { Tabs };
|
|
44
|
+
renderTabBar: renderTabBar || ((oldProps, DefaultTabBar) => React.createElement(DefaultTabBar, { ...oldProps, ref: this.tabBarCallBackRef })), ...restProps }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
118
47
|
//# sourceMappingURL=index.js.map
|
package/core/Tabs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Tabs/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAmChC,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAoB;IAChD,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC;IAE5B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IAEvB,MAAM,CAAC,YAAY,GAAwB;QACvC,IAAI,EAAE,MAAM;KACf,CAAC;IAEM,SAAS,GAA0B,IAAI,CAAC;IAEhD,iBAAiB;QACb,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;IAED,oBAAoB;QAChB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1D,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QACd,MAAM,EAAC,yBAAyB,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC/C,IAAI,yBAAyB,IAAI,yBAAyB,IAAI,CAAC,EAAE,CAAC;YAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,qBAAqB,EAAE,CAAC,KAAK,CAAC;YAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAiB,oCAAoC,CAAC,CAAC;YACxG,IAAI,WAAW,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,yBAAyB,EAAE,CAAC;gBACzE,MAAM,cAAc,GAAG,WAAW,GAAG,yBAAyB,CAAC;gBAC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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 AntTag from "antd/es/tag";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return
|
|
3
|
+
export class Tag extends React.PureComponent {
|
|
4
|
+
static displayName = "Tag";
|
|
5
|
+
render() {
|
|
6
|
+
return React.createElement(AntTag, { ...this.props });
|
|
33
7
|
}
|
|
34
|
-
|
|
35
|
-
return React.createElement(AntTag, __assign({}, this.props));
|
|
36
|
-
};
|
|
37
|
-
Tag.displayName = "Tag";
|
|
38
|
-
return Tag;
|
|
39
|
-
}(React.PureComponent));
|
|
40
|
-
export { Tag };
|
|
8
|
+
}
|
|
41
9
|
//# sourceMappingURL=Tag.js.map
|
package/core/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/core/Tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/core/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,aAAa,CAAC;AAKjC,MAAM,OAAO,GAAI,SAAQ,KAAK,CAAC,aAAoB;IAC/C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;IAE3B,MAAM;QACF,OAAO,oBAAC,MAAM,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IACtC,CAAC"}
|