@pinnacle0/web-ui 0.3.35 → 0.3.36
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/config/jest-stubs/style-stub.js +13 -0
- package/config/jest.config.ts +57 -0
- package/config/tsconfig.script.json +12 -0
- package/config/tsconfig.src.json +15 -0
- package/config/tsconfig.test.json +20 -0
- package/package.json +1 -1
- package/script/build.ts +103 -0
- package/script/format.ts +7 -0
- package/script/start-mobile.ts +13 -0
- package/script/start.ts +31 -0
- package/{admin → src/admin}/AdminApp/Default/NavigatorSide/index.less +0 -0
- package/src/admin/AdminApp/Default/NavigatorSide/index.tsx +68 -0
- package/src/admin/AdminApp/Default/SoundSwitch.tsx +32 -0
- package/{admin → src/admin}/AdminApp/Default/SquareLogo/index.less +0 -0
- package/src/admin/AdminApp/Default/SquareLogo/index.tsx +32 -0
- package/src/admin/AdminApp/Menu.tsx +154 -0
- package/src/admin/AdminApp/Navigator.tsx +186 -0
- package/src/admin/AdminApp/NotFound.tsx +24 -0
- package/src/admin/AdminApp/RouteSwitch.tsx +61 -0
- package/src/admin/AdminApp/WithErrorBoundary.tsx +36 -0
- package/{admin → src/admin}/AdminApp/asset/alert.mp3 +0 -0
- package/src/admin/AdminApp/context.ts +13 -0
- package/{admin → src/admin}/AdminApp/index.less +0 -0
- package/src/admin/AdminApp/index.tsx +96 -0
- package/src/admin/AdminPage/Filter.tsx +76 -0
- package/src/admin/AdminPage/Result.tsx +41 -0
- package/src/admin/AdminPage/SaveBar.tsx +33 -0
- package/src/admin/AdminPage/Summary.tsx +15 -0
- package/src/admin/AdminPage/TopBar.tsx +15 -0
- package/{admin → src/admin}/AdminPage/index.less +0 -0
- package/src/admin/AdminPage/index.tsx +29 -0
- package/src/admin/AdminPermissionSelector.tsx +299 -0
- package/{admin → src/admin}/RichEditor/index.less +0 -0
- package/src/admin/RichEditor/index.tsx +123 -0
- package/src/core/Amount/AmountPercentage.tsx +27 -0
- package/{core → src/core}/Amount/index.less +0 -0
- package/src/core/Amount/index.tsx +71 -0
- package/src/core/AmountConditionInput.tsx +63 -0
- package/src/core/AmountRangeInput.tsx +66 -0
- package/src/core/AuthenticationCodeInput.tsx +85 -0
- package/src/core/AutoCompleteInput.tsx +16 -0
- package/{core → src/core}/Badge/index.less +0 -0
- package/src/core/Badge/index.tsx +15 -0
- package/src/core/BoolRadio.tsx +62 -0
- package/src/core/BoolSelect.tsx +50 -0
- package/src/core/BoolSwitch.tsx +37 -0
- package/{core → src/core}/Breadcrumb/index.less +0 -0
- package/src/core/Breadcrumb/index.tsx +46 -0
- package/{core → src/core}/Button/index.less +0 -0
- package/src/core/Button/index.tsx +59 -0
- package/src/core/Card.tsx +16 -0
- package/src/core/Carousel.tsx +19 -0
- package/{core → src/core}/Carousel3D/index.less +0 -0
- package/src/core/Carousel3D/index.tsx +150 -0
- package/src/core/Cascader/InitialNullable.tsx +20 -0
- package/src/core/Cascader/Nullable.tsx +28 -0
- package/{core → src/core}/Cascader/index.less +0 -0
- package/src/core/Cascader/index.tsx +93 -0
- package/{core → src/core}/Checkbox/index.less +0 -0
- package/src/core/Checkbox/index.tsx +24 -0
- package/src/core/Collapse.tsx +19 -0
- package/src/core/Countdown/SlidingDigit.tsx +39 -0
- package/{core → src/core}/Countdown/index.less +0 -0
- package/src/core/Countdown/index.tsx +125 -0
- package/{core → src/core}/DarkOverlay/index.less +0 -0
- package/src/core/DarkOverlay/index.tsx +24 -0
- package/src/core/DateCalendar.tsx +106 -0
- package/{core → src/core}/DatePicker/index.less +0 -0
- package/src/core/DatePicker/index.tsx +54 -0
- package/{core → src/core}/DateRangePicker/index.less +0 -0
- package/src/core/DateRangePicker/index.tsx +58 -0
- package/{core → src/core}/DateTimePicker/index.less +0 -0
- package/src/core/DateTimePicker/index.tsx +61 -0
- package/{core → src/core}/DateTimeRangePicker/index.less +0 -0
- package/src/core/DateTimeRangePicker/index.tsx +60 -0
- package/{core → src/core}/Descriptions/index.less +0 -0
- package/src/core/Descriptions/index.tsx +45 -0
- package/src/core/DocumentTitle.tsx +58 -0
- package/src/core/Drawer.tsx +14 -0
- package/src/core/Dropdown.tsx +10 -0
- package/src/core/EnumCheckboxGroup/Map.tsx +21 -0
- package/src/core/EnumCheckboxGroup/index.tsx +23 -0
- package/src/core/EnumRadio/InitialNullable.tsx +24 -0
- package/src/core/EnumRadio/Map.tsx +21 -0
- package/src/core/EnumRadio/Nullable.tsx +31 -0
- package/src/core/EnumRadio/index.tsx +45 -0
- package/src/core/EnumSelect/InitialNullable.tsx +20 -0
- package/src/core/EnumSelect/Map.tsx +21 -0
- package/src/core/EnumSelect/Nullable.tsx +31 -0
- package/{core → src/core}/EnumSelect/index.less +0 -0
- package/src/core/EnumSelect/index.tsx +74 -0
- package/src/core/FlatList/VirtualFlatList/Item.tsx +28 -0
- package/{core → src/core}/FlatList/VirtualFlatList/index.less +0 -0
- package/src/core/FlatList/VirtualFlatList/index.tsx +142 -0
- package/src/core/FlatList/VirtualFlatList/type.ts +26 -0
- package/src/core/FlatList/index.tsx +95 -0
- package/{core → src/core}/FlatList/shared/Footer/index.less +0 -0
- package/src/core/FlatList/shared/Footer/index.tsx +23 -0
- package/src/core/FlatList/shared/GetRowKey.ts +11 -0
- package/{core → src/core}/FlatList/shared/Spinner/index.less +0 -0
- package/src/core/FlatList/shared/Spinner/index.tsx +18 -0
- package/src/core/FlatList/shared/Wrapper/Loading.tsx +17 -0
- package/{core → src/core}/FlatList/shared/Wrapper/index.less +0 -0
- package/src/core/FlatList/shared/Wrapper/index.tsx +123 -0
- package/src/core/FlatList/shared/hooks/useBounceSwipe.ts +120 -0
- package/src/core/FlatList/shared/hooks/useElementScrollState.ts +43 -0
- package/src/core/FlatList/shared/hooks/useLoadingWithDelay.ts +40 -0
- package/src/core/FlatList/type.tsx +56 -0
- package/{core → src/core}/Foldable/index.less +0 -0
- package/src/core/Foldable/index.tsx +38 -0
- package/src/core/Form/Item.tsx +87 -0
- package/src/core/Form/context.ts +16 -0
- package/{core → src/core}/Form/index.less +0 -0
- package/src/core/Form/index.tsx +109 -0
- package/src/core/Grid.tsx +7 -0
- package/{core → src/core}/HTMLContent/index.less +0 -0
- package/src/core/HTMLContent/index.tsx +17 -0
- package/{core → src/core}/ImageUploader/index.less +0 -0
- package/src/core/ImageUploader/index.tsx +104 -0
- package/{core → src/core}/Input/index.less +0 -0
- package/src/core/Input/index.tsx +63 -0
- package/src/core/LabelledSelect.tsx +15 -0
- package/src/core/Link.tsx +57 -0
- package/src/core/LocalImporter.tsx +62 -0
- package/src/core/LocaleProvider.tsx +31 -0
- package/src/core/LocaleSelect.tsx +36 -0
- package/{core → src/core}/Markdown/index.less +0 -0
- package/src/core/Markdown/index.tsx +42 -0
- package/{core → src/core}/Modal/index.less +0 -0
- package/src/core/Modal/index.tsx +37 -0
- package/{core → src/core}/MultipleCascader/index.less +0 -0
- package/src/core/MultipleCascader/index.tsx +114 -0
- package/src/core/MultipleEnumSelect.tsx +28 -0
- package/src/core/MultipleSelector/TablePopover.tsx +62 -0
- package/src/core/MultipleSelector/index.tsx +106 -0
- package/{core → src/core}/MutableTable/index.less +0 -0
- package/src/core/MutableTable/index.tsx +151 -0
- package/src/core/NumberInput/NumberInputPercentage.tsx +103 -0
- package/{core → src/core}/NumberInput/index.less +0 -0
- package/src/core/NumberInput/index.tsx +192 -0
- package/src/core/NumberInput/util.ts +55 -0
- package/{core → src/core}/OverflowableText/index.less +0 -0
- package/src/core/OverflowableText/index.tsx +66 -0
- package/{core → src/core}/PagedList/index.less +0 -0
- package/src/core/PagedList/index.tsx +93 -0
- package/{core → src/core}/Pagination/index.less +0 -0
- package/src/core/Pagination/index.tsx +59 -0
- package/{core → src/core}/Popover/index.less +0 -0
- package/src/core/Popover/index.tsx +15 -0
- package/src/core/Progress.tsx +14 -0
- package/{core → src/core}/Radio/index.less +0 -0
- package/src/core/Radio/index.tsx +21 -0
- package/src/core/RelativeTime.tsx +59 -0
- package/src/core/ResizeObserver.tsx +2 -0
- package/src/core/SearchableSelect.tsx +17 -0
- package/{core → src/core}/Select/index.less +0 -0
- package/src/core/Select/index.tsx +25 -0
- package/src/core/SignedAmountInput.tsx +59 -0
- package/src/core/Skeleton.tsx +14 -0
- package/src/core/Slider/RangeSlider.tsx +17 -0
- package/{core → src/core}/Slider/index.less +0 -0
- package/src/core/Slider/index.tsx +50 -0
- package/src/core/Space.tsx +14 -0
- package/src/core/Spin.tsx +25 -0
- package/{core → src/core}/StepFormContainer/index.less +0 -0
- package/src/core/StepFormContainer/index.tsx +66 -0
- package/{core → src/core}/Steps/index.less +0 -0
- package/src/core/Steps/index.tsx +17 -0
- package/{core → src/core}/Table/index.less +0 -0
- package/src/core/Table/index.tsx +221 -0
- package/src/core/Tabs/Single.tsx +25 -0
- package/{core → src/core}/Tabs/index.less +0 -0
- package/src/core/Tabs/index.tsx +82 -0
- package/src/core/Tag.tsx +17 -0
- package/{core → src/core}/TagInput/index.less +0 -0
- package/src/core/TagInput/index.tsx +94 -0
- package/src/core/Tags.tsx +34 -0
- package/{core → src/core}/TimePicker/index.less +0 -0
- package/src/core/TimePicker/index.tsx +44 -0
- package/{core → src/core}/TimeRangePicker/index.less +0 -0
- package/src/core/TimeRangePicker/index.tsx +42 -0
- package/src/core/Tooltip.tsx +17 -0
- package/{core → src/core}/TypedTabs/index.less +0 -0
- package/src/core/TypedTabs/index.tsx +43 -0
- package/src/core/Uploader.tsx +118 -0
- package/{core → src/core}/VerticalMarquee/index.less +0 -0
- package/src/core/VerticalMarquee/index.tsx +51 -0
- package/src/core/VirtualTable/TableHeader.tsx +41 -0
- package/src/core/VirtualTable/TableRow.tsx +90 -0
- package/src/core/VirtualTable/hooks/useColumnWidths.ts +24 -0
- package/src/core/VirtualTable/hooks/useDebounce.ts +18 -0
- package/src/core/VirtualTable/hooks/useLayout.tsx +58 -0
- package/src/core/VirtualTable/hooks/useRowExpand.tsx +27 -0
- package/src/core/VirtualTable/hooks/useRowSelection.tsx +72 -0
- package/src/core/VirtualTable/hooks/useScrollBarSize.ts +23 -0
- package/src/core/VirtualTable/hooks/useScrollToEdge.ts +36 -0
- package/src/core/VirtualTable/hooks/useStickyPosition.ts +28 -0
- package/src/core/VirtualTable/hooks/useTransformColumn.ts +19 -0
- package/{core → src/core}/VirtualTable/index.less +0 -0
- package/src/core/VirtualTable/index.tsx +143 -0
- package/src/core/VirtualTable/type.ts +59 -0
- package/{core → src/core}/WithExplanation/index.less +0 -0
- package/src/core/WithExplanation/index.tsx +47 -0
- package/src/core/WithTooltipList.tsx +89 -0
- package/src/core/YearMonthSelector.tsx +53 -0
- package/{css → src/css}/global.less +0 -0
- package/{css → src/css}/variable.less +0 -0
- package/src/hooks/useOrientationMode.ts +18 -0
- package/src/hooks/useSwipe/controller.ts +133 -0
- package/src/hooks/useSwipe/index.ts +11 -0
- package/src/hooks/useSwipe/type.ts +45 -0
- package/src/hooks/useTransform.ts +78 -0
- package/src/internal/ArrayUtil.ts +53 -0
- package/src/internal/ExpirableLocalStorage.ts +262 -0
- package/src/internal/Memo.ts +28 -0
- package/src/internal/NumberUtil.ts +38 -0
- package/src/internal/StorageHelper.ts +152 -0
- package/src/internal/TextUtil.ts +11 -0
- package/src/internal/i18n/admin/en.ts +18 -0
- package/src/internal/i18n/admin/index.ts +13 -0
- package/src/internal/i18n/admin/zh.ts +18 -0
- package/src/internal/i18n/core/en.ts +37 -0
- package/src/internal/i18n/core/index.ts +13 -0
- package/src/internal/i18n/core/zh.ts +37 -0
- package/src/internal/i18n/util/en.ts +9 -0
- package/src/internal/i18n/util/index.ts +13 -0
- package/src/internal/i18n/util/zh.ts +9 -0
- package/src/internal/type.ts +12 -0
- package/src/util/AdminNavigatorBase.ts +99 -0
- package/src/util/BrowserBookmarkUtil.ts +24 -0
- package/src/util/BrowserUtil.ts +122 -0
- package/src/util/CanvasUtil.ts +61 -0
- package/src/util/ClassNames.ts +2 -0
- package/src/util/Clipboard.ts +61 -0
- package/src/util/ExpirableLocalStorageUtil.ts +3 -0
- package/src/util/ExportUtil.ts +34 -0
- package/src/util/ImportUtil.ts +41 -0
- package/src/util/LocalStorageUtil.ts +3 -0
- package/src/util/LocaleUtil.ts +47 -0
- package/{util → src/util}/MediaUtil/index.less +0 -0
- package/src/util/MediaUtil/index.tsx +69 -0
- package/{util → src/util}/MessageUtil/index.less +0 -0
- package/src/util/MessageUtil/index.tsx +23 -0
- package/{util → src/util}/ModalUtil/index.less +0 -0
- package/src/util/ModalUtil/index.tsx +179 -0
- package/src/util/NotificationUtil.tsx +42 -0
- package/src/util/OrientationUtil.ts +51 -0
- package/src/util/PromptUtil/PromptBody.tsx +62 -0
- package/{util → src/util}/PromptUtil/index.less +0 -0
- package/src/util/PromptUtil/index.tsx +50 -0
- package/src/util/RecentUsedStorageUtil.ts +46 -0
- package/src/util/SessionStorageUtil.ts +3 -0
- package/src/util/SwipeUtil.ts +25 -0
- package/src/util/UploadUtil/index.ts +73 -0
- package/src/util/UploadUtil/type.ts +46 -0
- package/test/mobile-ui-test/package.json +5 -0
- package/test/mobile-ui-test/src/component/FlatListDemo/fetch.ts +18 -0
- package/test/mobile-ui-test/src/component/FlatListDemo/index.less +22 -0
- package/test/mobile-ui-test/src/component/FlatListDemo/index.tsx +149 -0
- package/test/mobile-ui-test/src/component/Main.tsx +6 -0
- package/test/mobile-ui-test/src/index.html +12 -0
- package/test/mobile-ui-test/src/index.less +18 -0
- package/test/mobile-ui-test/src/index.tsx +6 -0
- package/test/mobile-ui-test/static/robots.txt +2 -0
- package/test/mobile-ui-test/tsconfig.json +4 -0
- package/test/ui-test/package.json +5 -0
- package/test/ui-test/src/asset/logo.png +0 -0
- package/test/ui-test/src/component/DemoHelper/index.less +33 -0
- package/test/ui-test/src/component/DemoHelper/index.tsx +55 -0
- package/test/ui-test/src/component/Main.tsx +33 -0
- package/test/ui-test/src/component/WebUILogo.tsx +7 -0
- package/test/ui-test/src/component/WebUINavigatorSide.tsx +20 -0
- package/test/ui-test/src/component/admin/ConfigPageDemo.tsx +39 -0
- package/test/ui-test/src/component/admin/NavigationHistoryDemo.tsx +30 -0
- package/test/ui-test/src/component/admin/PermissionSelectorDemo.tsx +65 -0
- package/test/ui-test/src/component/admin/RenderErrorDemo.tsx +5 -0
- package/test/ui-test/src/component/admin/ResultPageDemo.tsx +13 -0
- package/test/ui-test/src/component/admin/RichEditorDemo.tsx +20 -0
- package/test/ui-test/src/component/admin/SeparateTabDetailDemo.tsx +44 -0
- package/test/ui-test/src/component/admin/TablePageDemo.tsx +85 -0
- package/test/ui-test/src/component/core/AmountDemo.tsx +117 -0
- package/test/ui-test/src/component/core/ButtonDemo/__tests__/__snapshots__/dom-snapshot.test.tsx.snap +12 -0
- package/test/ui-test/src/component/core/ButtonDemo/__tests__/dom-snapshot.test.tsx +10 -0
- package/test/ui-test/src/component/core/ButtonDemo/__tests__/smoke.test.tsx +71 -0
- package/test/ui-test/src/component/core/ButtonDemo/index.tsx +39 -0
- package/test/ui-test/src/component/core/CalendarDemo.tsx +98 -0
- package/test/ui-test/src/component/core/CarouselDemo/index.tsx +51 -0
- package/test/ui-test/src/component/core/CascaderDemo/index.tsx +120 -0
- package/test/ui-test/src/component/core/FoldableDemo.tsx +31 -0
- package/test/ui-test/src/component/core/FormDemo.tsx +204 -0
- package/test/ui-test/src/component/core/InputDemo/index.tsx +123 -0
- package/test/ui-test/src/component/core/MiscellaneousDemo/TagInputDemo.tsx +8 -0
- package/test/ui-test/src/component/core/MiscellaneousDemo/index.tsx +157 -0
- package/test/ui-test/src/component/core/ModalDemo/index.tsx +75 -0
- package/test/ui-test/src/component/core/OverflowableTextDemo.tsx +78 -0
- package/test/ui-test/src/component/core/RelativeTimeDemo.tsx +35 -0
- package/test/ui-test/src/component/core/SelectDemo/index.tsx +141 -0
- package/test/ui-test/src/component/core/SliderDemo.tsx +44 -0
- package/test/ui-test/src/component/core/StepContainerDemo.tsx +53 -0
- package/test/ui-test/src/component/core/TableDemo.tsx +81 -0
- package/test/ui-test/src/component/core/TabsDemo.tsx +136 -0
- package/test/ui-test/src/component/core/UploaderImporterDemo.tsx +52 -0
- package/test/ui-test/src/component/core/VirtualTableDemo.tsx +232 -0
- package/test/ui-test/src/dummy/dummyCallback.ts +13 -0
- package/test/ui-test/src/dummy/dummyList.ts +63 -0
- package/test/ui-test/src/dummy/dummyTableData.tsx +60 -0
- package/test/ui-test/src/dummy/dummyUpload.tsx +43 -0
- package/test/ui-test/src/index.html +11 -0
- package/test/ui-test/src/index.tsx +5 -0
- package/test/ui-test/src/type.ts +8 -0
- package/test/ui-test/src/util/NavigationService.tsx +217 -0
- package/test/ui-test/src/util/withUncontrolledInitialValue.tsx +14 -0
- package/test/ui-test/static/robots.txt +2 -0
- package/test/ui-test/tsconfig.json +3 -0
- package/test/unit-test/ClassNames.test.ts +17 -0
- package/test/unit-test/ExpirableLocalStorageUtil.test.ts +42 -0
- package/test/unit-test/NumberInput.util.test.ts +344 -0
- package/test/unit-test/NumberUtil.test.ts +57 -0
- package/test/unit-test/TextUtil.test.ts +10 -0
- package/tsconfig.json +15 -0
- package/admin/AdminApp/Default/NavigatorSide/index.d.ts +0 -20
- package/admin/AdminApp/Default/NavigatorSide/index.js +0 -74
- package/admin/AdminApp/Default/NavigatorSide/index.js.map +0 -1
- package/admin/AdminApp/Default/SoundSwitch.d.ts +0 -14
- package/admin/AdminApp/Default/SoundSwitch.js +0 -41
- package/admin/AdminApp/Default/SoundSwitch.js.map +0 -1
- package/admin/AdminApp/Default/SquareLogo/index.d.ts +0 -15
- package/admin/AdminApp/Default/SquareLogo/index.js +0 -39
- package/admin/AdminApp/Default/SquareLogo/index.js.map +0 -1
- package/admin/AdminApp/Menu.d.ts +0 -52
- package/admin/AdminApp/Menu.js +0 -174
- package/admin/AdminApp/Menu.js.map +0 -1
- package/admin/AdminApp/Navigator.d.ts +0 -30
- package/admin/AdminApp/Navigator.js +0 -200
- package/admin/AdminApp/Navigator.js.map +0 -1
- package/admin/AdminApp/NotFound.d.ts +0 -10
- package/admin/AdminApp/NotFound.js +0 -37
- package/admin/AdminApp/NotFound.js.map +0 -1
- package/admin/AdminApp/RouteSwitch.d.ts +0 -19
- package/admin/AdminApp/RouteSwitch.js +0 -64
- package/admin/AdminApp/RouteSwitch.js.map +0 -1
- package/admin/AdminApp/WithErrorBoundary.d.ts +0 -15
- package/admin/AdminApp/WithErrorBoundary.js +0 -39
- package/admin/AdminApp/WithErrorBoundary.js.map +0 -1
- package/admin/AdminApp/context.d.ts +0 -7
- package/admin/AdminApp/context.js +0 -7
- package/admin/AdminApp/context.js.map +0 -1
- package/admin/AdminApp/index.d.ts +0 -39
- package/admin/AdminApp/index.js +0 -76
- package/admin/AdminApp/index.js.map +0 -1
- package/admin/AdminPage/Filter.d.ts +0 -23
- package/admin/AdminPage/Filter.js +0 -60
- package/admin/AdminPage/Filter.js.map +0 -1
- package/admin/AdminPage/Result.d.ts +0 -19
- package/admin/AdminPage/Result.js +0 -43
- package/admin/AdminPage/Result.js.map +0 -1
- package/admin/AdminPage/SaveBar.d.ts +0 -10
- package/admin/AdminPage/SaveBar.js +0 -37
- package/admin/AdminPage/SaveBar.js.map +0 -1
- package/admin/AdminPage/Summary.d.ts +0 -9
- package/admin/AdminPage/Summary.js +0 -30
- package/admin/AdminPage/Summary.js.map +0 -1
- package/admin/AdminPage/TopBar.d.ts +0 -9
- package/admin/AdminPage/TopBar.js +0 -30
- package/admin/AdminPage/TopBar.js.map +0 -1
- package/admin/AdminPage/index.d.ts +0 -21
- package/admin/AdminPage/index.js +0 -42
- package/admin/AdminPage/index.js.map +0 -1
- package/admin/AdminPermissionSelector.d.ts +0 -45
- package/admin/AdminPermissionSelector.js +0 -213
- package/admin/AdminPermissionSelector.js.map +0 -1
- package/admin/RichEditor/index.d.ts +0 -34
- package/admin/RichEditor/index.js +0 -104
- package/admin/RichEditor/index.js.map +0 -1
- package/core/Amount/AmountPercentage.d.ts +0 -19
- package/core/Amount/AmountPercentage.js +0 -54
- package/core/Amount/AmountPercentage.js.map +0 -1
- package/core/Amount/index.d.ts +0 -26
- package/core/Amount/index.js +0 -65
- package/core/Amount/index.js.map +0 -1
- package/core/AmountConditionInput.d.ts +0 -28
- package/core/AmountConditionInput.js +0 -66
- package/core/AmountConditionInput.js.map +0 -1
- package/core/AmountRangeInput.d.ts +0 -23
- package/core/AmountRangeInput.js +0 -59
- package/core/AmountRangeInput.js.map +0 -1
- package/core/AuthenticationCodeInput.d.ts +0 -25
- package/core/AuthenticationCodeInput.js +0 -149
- package/core/AuthenticationCodeInput.js.map +0 -1
- package/core/AutoCompleteInput.d.ts +0 -10
- package/core/AutoCompleteInput.js +0 -43
- package/core/AutoCompleteInput.js.map +0 -1
- package/core/Badge/index.d.ts +0 -10
- package/core/Badge/index.js +0 -43
- package/core/Badge/index.js.map +0 -1
- package/core/BoolRadio.d.ts +0 -20
- package/core/BoolRadio.js +0 -49
- package/core/BoolRadio.js.map +0 -1
- package/core/BoolSelect.d.ts +0 -19
- package/core/BoolSelect.js +0 -48
- package/core/BoolSelect.js.map +0 -1
- package/core/BoolSwitch.d.ts +0 -17
- package/core/BoolSwitch.js +0 -56
- package/core/BoolSwitch.js.map +0 -1
- package/core/Breadcrumb/index.d.ts +0 -17
- package/core/Breadcrumb/index.js +0 -45
- package/core/Breadcrumb/index.js.map +0 -1
- package/core/Button/index.d.ts +0 -37
- package/core/Button/index.js +0 -60
- package/core/Button/index.js.map +0 -1
- package/core/Card.d.ts +0 -10
- package/core/Card.js +0 -43
- package/core/Card.js.map +0 -1
- package/core/Carousel.d.ts +0 -11
- package/core/Carousel.js +0 -54
- package/core/Carousel.js.map +0 -1
- package/core/Carousel3D/index.d.ts +0 -27
- package/core/Carousel3D/index.js +0 -116
- package/core/Carousel3D/index.js.map +0 -1
- package/core/Cascader/InitialNullable.d.ts +0 -10
- package/core/Cascader/InitialNullable.js +0 -54
- package/core/Cascader/InitialNullable.js.map +0 -1
- package/core/Cascader/Nullable.d.ts +0 -12
- package/core/Cascader/Nullable.js +0 -86
- package/core/Cascader/Nullable.js.map +0 -1
- package/core/Cascader/index.d.ts +0 -37
- package/core/Cascader/index.js +0 -117
- package/core/Cascader/index.js.map +0 -1
- package/core/Checkbox/index.d.ts +0 -15
- package/core/Checkbox/index.js +0 -47
- package/core/Checkbox/index.js.map +0 -1
- package/core/Collapse.d.ts +0 -12
- package/core/Collapse.js +0 -43
- package/core/Collapse.js.map +0 -1
- package/core/Countdown/SlidingDigit.d.ts +0 -15
- package/core/Countdown/SlidingDigit.js +0 -43
- package/core/Countdown/SlidingDigit.js.map +0 -1
- package/core/Countdown/index.d.ts +0 -39
- package/core/Countdown/index.js +0 -106
- package/core/Countdown/index.js.map +0 -1
- package/core/DarkOverlay/index.d.ts +0 -12
- package/core/DarkOverlay/index.js +0 -32
- package/core/DarkOverlay/index.js.map +0 -1
- package/core/DateCalendar.d.ts +0 -18
- package/core/DateCalendar.js +0 -85
- package/core/DateCalendar.js.map +0 -1
- package/core/DatePicker/index.d.ts +0 -18
- package/core/DatePicker/index.js +0 -53
- package/core/DatePicker/index.js.map +0 -1
- package/core/DateRangePicker/index.d.ts +0 -18
- package/core/DateRangePicker/index.js +0 -59
- package/core/DateRangePicker/index.js.map +0 -1
- package/core/DateTimePicker/index.d.ts +0 -19
- package/core/DateTimePicker/index.js +0 -59
- package/core/DateTimePicker/index.js.map +0 -1
- package/core/DateTimeRangePicker/index.d.ts +0 -20
- package/core/DateTimeRangePicker/index.js +0 -59
- package/core/DateTimeRangePicker/index.js.map +0 -1
- package/core/Descriptions/index.d.ts +0 -27
- package/core/Descriptions/index.js +0 -51
- package/core/Descriptions/index.js.map +0 -1
- package/core/DocumentTitle.d.ts +0 -28
- package/core/DocumentTitle.js +0 -53
- package/core/DocumentTitle.js.map +0 -1
- package/core/Drawer.d.ts +0 -9
- package/core/Drawer.js +0 -41
- package/core/Drawer.js.map +0 -1
- package/core/Dropdown.d.ts +0 -9
- package/core/Dropdown.js +0 -10
- package/core/Dropdown.js.map +0 -1
- package/core/EnumCheckboxGroup/Map.d.ts +0 -10
- package/core/EnumCheckboxGroup/Map.js +0 -55
- package/core/EnumCheckboxGroup/Map.js.map +0 -1
- package/core/EnumCheckboxGroup/index.d.ts +0 -12
- package/core/EnumCheckboxGroup/index.js +0 -36
- package/core/EnumCheckboxGroup/index.js.map +0 -1
- package/core/EnumRadio/InitialNullable.d.ts +0 -11
- package/core/EnumRadio/InitialNullable.js +0 -56
- package/core/EnumRadio/InitialNullable.js.map +0 -1
- package/core/EnumRadio/Map.d.ts +0 -10
- package/core/EnumRadio/Map.js +0 -55
- package/core/EnumRadio/Map.js.map +0 -1
- package/core/EnumRadio/Nullable.d.ts +0 -12
- package/core/EnumRadio/Nullable.js +0 -88
- package/core/EnumRadio/Nullable.js.map +0 -1
- package/core/EnumRadio/index.d.ts +0 -24
- package/core/EnumRadio/index.js +0 -45
- package/core/EnumRadio/index.js.map +0 -1
- package/core/EnumSelect/InitialNullable.d.ts +0 -10
- package/core/EnumSelect/InitialNullable.js +0 -54
- package/core/EnumSelect/InitialNullable.js.map +0 -1
- package/core/EnumSelect/Map.d.ts +0 -10
- package/core/EnumSelect/Map.js +0 -55
- package/core/EnumSelect/Map.js.map +0 -1
- package/core/EnumSelect/Nullable.d.ts +0 -12
- package/core/EnumSelect/Nullable.js +0 -88
- package/core/EnumSelect/Nullable.js.map +0 -1
- package/core/EnumSelect/index.d.ts +0 -29
- package/core/EnumSelect/index.js +0 -61
- package/core/EnumSelect/index.js.map +0 -1
- package/core/FlatList/VirtualFlatList/Item.d.ts +0 -11
- package/core/FlatList/VirtualFlatList/Item.js +0 -20
- package/core/FlatList/VirtualFlatList/Item.js.map +0 -1
- package/core/FlatList/VirtualFlatList/index.d.ts +0 -7
- package/core/FlatList/VirtualFlatList/index.js +0 -110
- package/core/FlatList/VirtualFlatList/index.js.map +0 -1
- package/core/FlatList/VirtualFlatList/type.d.ts +0 -20
- package/core/FlatList/VirtualFlatList/type.js +0 -2
- package/core/FlatList/VirtualFlatList/type.js.map +0 -1
- package/core/FlatList/index.d.ts +0 -3
- package/core/FlatList/index.js +0 -60
- package/core/FlatList/index.js.map +0 -1
- package/core/FlatList/shared/Footer/index.d.ts +0 -8
- package/core/FlatList/shared/Footer/index.js +0 -13
- package/core/FlatList/shared/Footer/index.js.map +0 -1
- package/core/FlatList/shared/GetRowKey.d.ts +0 -2
- package/core/FlatList/shared/GetRowKey.js +0 -12
- package/core/FlatList/shared/GetRowKey.js.map +0 -1
- package/core/FlatList/shared/Spinner/index.d.ts +0 -8
- package/core/FlatList/shared/Spinner/index.js +0 -10
- package/core/FlatList/shared/Spinner/index.js.map +0 -1
- package/core/FlatList/shared/Wrapper/Loading.d.ts +0 -8
- package/core/FlatList/shared/Wrapper/Loading.js +0 -7
- package/core/FlatList/shared/Wrapper/Loading.js.map +0 -1
- package/core/FlatList/shared/Wrapper/index.d.ts +0 -14
- package/core/FlatList/shared/Wrapper/index.js +0 -109
- package/core/FlatList/shared/Wrapper/index.js.map +0 -1
- package/core/FlatList/shared/hooks/useBounceSwipe.d.ts +0 -22
- package/core/FlatList/shared/hooks/useBounceSwipe.js +0 -111
- package/core/FlatList/shared/hooks/useBounceSwipe.js.map +0 -1
- package/core/FlatList/shared/hooks/useElementScrollState.d.ts +0 -8
- package/core/FlatList/shared/hooks/useElementScrollState.js +0 -38
- package/core/FlatList/shared/hooks/useElementScrollState.js.map +0 -1
- package/core/FlatList/shared/hooks/useLoadingWithDelay.d.ts +0 -9
- package/core/FlatList/shared/hooks/useLoadingWithDelay.js +0 -52
- package/core/FlatList/shared/hooks/useLoadingWithDelay.js.map +0 -1
- package/core/FlatList/type.d.ts +0 -48
- package/core/FlatList/type.js +0 -2
- package/core/FlatList/type.js.map +0 -1
- package/core/Foldable/index.d.ts +0 -18
- package/core/Foldable/index.js +0 -41
- package/core/Foldable/index.js.map +0 -1
- package/core/Form/Item.d.ts +0 -29
- package/core/Form/Item.js +0 -106
- package/core/Form/Item.js.map +0 -1
- package/core/Form/context.d.ts +0 -14
- package/core/Form/context.js +0 -7
- package/core/Form/context.js.map +0 -1
- package/core/Form/index.d.ts +0 -36
- package/core/Form/index.js +0 -143
- package/core/Form/index.js.map +0 -1
- package/core/Grid.d.ts +0 -6
- package/core/Grid.js +0 -7
- package/core/Grid.js.map +0 -1
- package/core/HTMLContent/index.d.ts +0 -11
- package/core/HTMLContent/index.js +0 -32
- package/core/HTMLContent/index.js.map +0 -1
- package/core/ImageUploader/index.d.ts +0 -24
- package/core/ImageUploader/index.js +0 -148
- package/core/ImageUploader/index.js.map +0 -1
- package/core/Input/index.d.ts +0 -39
- package/core/Input/index.js +0 -88
- package/core/Input/index.js.map +0 -1
- package/core/LabelledSelect.d.ts +0 -11
- package/core/LabelledSelect.js +0 -42
- package/core/LabelledSelect.js.map +0 -1
- package/core/Link.d.ts +0 -15
- package/core/Link.js +0 -48
- package/core/Link.js.map +0 -1
- package/core/LocalImporter.d.ts +0 -21
- package/core/LocalImporter.js +0 -93
- package/core/LocalImporter.js.map +0 -1
- package/core/LocaleProvider.d.ts +0 -12
- package/core/LocaleProvider.js +0 -38
- package/core/LocaleProvider.js.map +0 -1
- package/core/LocaleSelect.d.ts +0 -11
- package/core/LocaleSelect.js +0 -45
- package/core/LocaleSelect.js.map +0 -1
- package/core/Markdown/index.d.ts +0 -20
- package/core/Markdown/index.js +0 -40
- package/core/Markdown/index.js.map +0 -1
- package/core/Modal/index.d.ts +0 -16
- package/core/Modal/index.js +0 -67
- package/core/Modal/index.js.map +0 -1
- package/core/MultipleCascader/index.d.ts +0 -31
- package/core/MultipleCascader/index.js +0 -151
- package/core/MultipleCascader/index.js.map +0 -1
- package/core/MultipleEnumSelect.d.ts +0 -17
- package/core/MultipleEnumSelect.js +0 -40
- package/core/MultipleEnumSelect.js.map +0 -1
- package/core/MultipleSelector/TablePopover.d.ts +0 -20
- package/core/MultipleSelector/TablePopover.js +0 -95
- package/core/MultipleSelector/TablePopover.js.map +0 -1
- package/core/MultipleSelector/index.d.ts +0 -33
- package/core/MultipleSelector/index.js +0 -103
- package/core/MultipleSelector/index.js.map +0 -1
- package/core/MutableTable/index.d.ts +0 -44
- package/core/MutableTable/index.js +0 -139
- package/core/MutableTable/index.js.map +0 -1
- package/core/NumberInput/NumberInputPercentage.d.ts +0 -58
- package/core/NumberInput/NumberInputPercentage.js +0 -75
- package/core/NumberInput/NumberInputPercentage.js.map +0 -1
- package/core/NumberInput/index.d.ts +0 -70
- package/core/NumberInput/index.js +0 -130
- package/core/NumberInput/index.js.map +0 -1
- package/core/NumberInput/util.d.ts +0 -34
- package/core/NumberInput/util.js +0 -57
- package/core/NumberInput/util.js.map +0 -1
- package/core/OverflowableText/index.d.ts +0 -22
- package/core/OverflowableText/index.js +0 -64
- package/core/OverflowableText/index.js.map +0 -1
- package/core/PagedList/index.d.ts +0 -27
- package/core/PagedList/index.js +0 -81
- package/core/PagedList/index.js.map +0 -1
- package/core/Pagination/index.d.ts +0 -21
- package/core/Pagination/index.js +0 -51
- package/core/Pagination/index.js.map +0 -1
- package/core/Popover/index.d.ts +0 -11
- package/core/Popover/index.js +0 -43
- package/core/Popover/index.js.map +0 -1
- package/core/Progress.d.ts +0 -10
- package/core/Progress.js +0 -42
- package/core/Progress.js.map +0 -1
- package/core/Radio/index.d.ts +0 -13
- package/core/Radio/index.js +0 -45
- package/core/Radio/index.js.map +0 -1
- package/core/RelativeTime.d.ts +0 -18
- package/core/RelativeTime.js +0 -60
- package/core/RelativeTime.js.map +0 -1
- package/core/ResizeObserver.d.ts +0 -2
- package/core/ResizeObserver.js +0 -2
- package/core/ResizeObserver.js.map +0 -1
- package/core/SearchableSelect.d.ts +0 -15
- package/core/SearchableSelect.js +0 -42
- package/core/SearchableSelect.js.map +0 -1
- package/core/Select/index.d.ts +0 -16
- package/core/Select/index.js +0 -45
- package/core/Select/index.js.map +0 -1
- package/core/SignedAmountInput.d.ts +0 -20
- package/core/SignedAmountInput.js +0 -56
- package/core/SignedAmountInput.js.map +0 -1
- package/core/Skeleton.d.ts +0 -9
- package/core/Skeleton.js +0 -42
- package/core/Skeleton.js.map +0 -1
- package/core/Slider/RangeSlider.d.ts +0 -11
- package/core/Slider/RangeSlider.js +0 -53
- package/core/Slider/RangeSlider.js.map +0 -1
- package/core/Slider/index.d.ts +0 -16
- package/core/Slider/index.js +0 -79
- package/core/Slider/index.js.map +0 -1
- package/core/Space.d.ts +0 -10
- package/core/Space.js +0 -42
- package/core/Space.js.map +0 -1
- package/core/Spin.d.ts +0 -12
- package/core/Spin.js +0 -55
- package/core/Spin.js.map +0 -1
- package/core/StepFormContainer/index.d.ts +0 -27
- package/core/StepFormContainer/index.js +0 -50
- package/core/StepFormContainer/index.js.map +0 -1
- package/core/Steps/index.d.ts +0 -11
- package/core/Steps/index.js +0 -44
- package/core/Steps/index.js.map +0 -1
- package/core/Table/index.d.ts +0 -89
- package/core/Table/index.js +0 -152
- package/core/Table/index.js.map +0 -1
- package/core/Tabs/Single.d.ts +0 -11
- package/core/Tabs/Single.js +0 -54
- package/core/Tabs/Single.js.map +0 -1
- package/core/Tabs/index.d.ts +0 -30
- package/core/Tabs/index.js +0 -96
- package/core/Tabs/index.js.map +0 -1
- package/core/Tag.d.ts +0 -11
- package/core/Tag.js +0 -42
- package/core/Tag.js.map +0 -1
- package/core/TagInput/index.d.ts +0 -27
- package/core/TagInput/index.js +0 -107
- package/core/TagInput/index.js.map +0 -1
- package/core/Tags.d.ts +0 -17
- package/core/Tags.js +0 -38
- package/core/Tags.js.map +0 -1
- package/core/TimePicker/index.d.ts +0 -17
- package/core/TimePicker/index.js +0 -46
- package/core/TimePicker/index.js.map +0 -1
- package/core/TimeRangePicker/index.d.ts +0 -17
- package/core/TimeRangePicker/index.js +0 -45
- package/core/TimeRangePicker/index.js.map +0 -1
- package/core/Tooltip.d.ts +0 -9
- package/core/Tooltip.js +0 -42
- package/core/Tooltip.js.map +0 -1
- package/core/TypedTabs/index.d.ts +0 -23
- package/core/TypedTabs/index.js +0 -76
- package/core/TypedTabs/index.js.map +0 -1
- package/core/Uploader.d.ts +0 -34
- package/core/Uploader.js +0 -97
- package/core/Uploader.js.map +0 -1
- package/core/VerticalMarquee/index.d.ts +0 -19
- package/core/VerticalMarquee/index.js +0 -51
- package/core/VerticalMarquee/index.js.map +0 -1
- package/core/VirtualTable/TableHeader.d.ts +0 -13
- package/core/VirtualTable/TableHeader.js +0 -45
- package/core/VirtualTable/TableHeader.js.map +0 -1
- package/core/VirtualTable/TableRow.d.ts +0 -21
- package/core/VirtualTable/TableRow.js +0 -59
- package/core/VirtualTable/TableRow.js.map +0 -1
- package/core/VirtualTable/hooks/useColumnWidths.d.ts +0 -11
- package/core/VirtualTable/hooks/useColumnWidths.js +0 -38
- package/core/VirtualTable/hooks/useColumnWidths.js.map +0 -1
- package/core/VirtualTable/hooks/useDebounce.d.ts +0 -1
- package/core/VirtualTable/hooks/useDebounce.js +0 -45
- package/core/VirtualTable/hooks/useDebounce.js.map +0 -1
- package/core/VirtualTable/hooks/useLayout.d.ts +0 -17
- package/core/VirtualTable/hooks/useLayout.js +0 -44
- package/core/VirtualTable/hooks/useLayout.js.map +0 -1
- package/core/VirtualTable/hooks/useRowExpand.d.ts +0 -7
- package/core/VirtualTable/hooks/useRowExpand.js +0 -20
- package/core/VirtualTable/hooks/useRowExpand.js.map +0 -1
- package/core/VirtualTable/hooks/useRowSelection.d.ts +0 -10
- package/core/VirtualTable/hooks/useRowSelection.js +0 -83
- package/core/VirtualTable/hooks/useRowSelection.js.map +0 -1
- package/core/VirtualTable/hooks/useScrollBarSize.d.ts +0 -5
- package/core/VirtualTable/hooks/useScrollBarSize.js +0 -36
- package/core/VirtualTable/hooks/useScrollBarSize.js.map +0 -1
- package/core/VirtualTable/hooks/useScrollToEdge.d.ts +0 -8
- package/core/VirtualTable/hooks/useScrollToEdge.js +0 -48
- package/core/VirtualTable/hooks/useScrollToEdge.js.map +0 -1
- package/core/VirtualTable/hooks/useStickyPosition.d.ts +0 -2
- package/core/VirtualTable/hooks/useStickyPosition.js +0 -24
- package/core/VirtualTable/hooks/useStickyPosition.js.map +0 -1
- package/core/VirtualTable/hooks/useTransformColumn.d.ts +0 -11
- package/core/VirtualTable/hooks/useTransformColumn.js +0 -9
- package/core/VirtualTable/hooks/useTransformColumn.js.map +0 -1
- package/core/VirtualTable/index.d.ts +0 -30
- package/core/VirtualTable/index.js +0 -85
- package/core/VirtualTable/index.js.map +0 -1
- package/core/VirtualTable/type.d.ts +0 -57
- package/core/VirtualTable/type.js +0 -2
- package/core/VirtualTable/type.js.map +0 -1
- package/core/WithExplanation/index.d.ts +0 -21
- package/core/WithExplanation/index.js +0 -46
- package/core/WithExplanation/index.js.map +0 -1
- package/core/WithTooltipList.d.ts +0 -23
- package/core/WithTooltipList.js +0 -64
- package/core/WithTooltipList.js.map +0 -1
- package/core/YearMonthSelector.d.ts +0 -16
- package/core/YearMonthSelector.js +0 -53
- package/core/YearMonthSelector.js.map +0 -1
- package/hooks/useOrientationMode.d.ts +0 -2
- package/hooks/useOrientationMode.js +0 -30
- package/hooks/useOrientationMode.js.map +0 -1
- package/hooks/useSwipe/controller.d.ts +0 -20
- package/hooks/useSwipe/controller.js +0 -126
- package/hooks/useSwipe/controller.js.map +0 -1
- package/hooks/useSwipe/index.d.ts +0 -3
- package/hooks/useSwipe/index.js +0 -9
- package/hooks/useSwipe/index.js.map +0 -1
- package/hooks/useSwipe/type.d.ts +0 -38
- package/hooks/useSwipe/type.js +0 -8
- package/hooks/useSwipe/type.js.map +0 -1
- package/hooks/useTransform.d.ts +0 -18
- package/hooks/useTransform.js +0 -50
- package/hooks/useTransform.js.map +0 -1
- package/internal/ArrayUtil.d.ts +0 -29
- package/internal/ArrayUtil.js +0 -76
- package/internal/ArrayUtil.js.map +0 -1
- package/internal/ExpirableLocalStorage.d.ts +0 -123
- package/internal/ExpirableLocalStorage.js +0 -245
- package/internal/ExpirableLocalStorage.js.map +0 -1
- package/internal/Memo.d.ts +0 -9
- package/internal/Memo.js +0 -31
- package/internal/Memo.js.map +0 -1
- package/internal/NumberUtil.d.ts +0 -7
- package/internal/NumberUtil.js +0 -38
- package/internal/NumberUtil.js.map +0 -1
- package/internal/StorageHelper.d.ts +0 -31
- package/internal/StorageHelper.js +0 -152
- package/internal/StorageHelper.js.map +0 -1
- package/internal/TextUtil.d.ts +0 -5
- package/internal/TextUtil.js +0 -15
- package/internal/TextUtil.js.map +0 -1
- package/internal/i18n/admin/en.d.ts +0 -18
- package/internal/i18n/admin/en.js +0 -19
- package/internal/i18n/admin/en.js.map +0 -1
- package/internal/i18n/admin/index.d.ts +0 -18
- package/internal/i18n/admin/index.js +0 -11
- package/internal/i18n/admin/index.js.map +0 -1
- package/internal/i18n/admin/zh.d.ts +0 -18
- package/internal/i18n/admin/zh.js +0 -19
- package/internal/i18n/admin/zh.js.map +0 -1
- package/internal/i18n/core/en.d.ts +0 -37
- package/internal/i18n/core/en.js +0 -38
- package/internal/i18n/core/en.js.map +0 -1
- package/internal/i18n/core/index.d.ts +0 -37
- package/internal/i18n/core/index.js +0 -11
- package/internal/i18n/core/index.js.map +0 -1
- package/internal/i18n/core/zh.d.ts +0 -37
- package/internal/i18n/core/zh.js +0 -38
- package/internal/i18n/core/zh.js.map +0 -1
- package/internal/i18n/util/en.d.ts +0 -9
- package/internal/i18n/util/en.js +0 -10
- package/internal/i18n/util/en.js.map +0 -1
- package/internal/i18n/util/index.d.ts +0 -9
- package/internal/i18n/util/index.js +0 -11
- package/internal/i18n/util/index.js.map +0 -1
- package/internal/i18n/util/zh.d.ts +0 -9
- package/internal/i18n/util/zh.js +0 -10
- package/internal/i18n/util/zh.js.map +0 -1
- package/internal/type.d.ts +0 -15
- package/internal/type.js +0 -2
- package/internal/type.js.map +0 -1
- package/util/AdminNavigatorBase.d.ts +0 -64
- package/util/AdminNavigatorBase.js +0 -101
- package/util/AdminNavigatorBase.js.map +0 -1
- package/util/BrowserBookmarkUtil.d.ts +0 -5
- package/util/BrowserBookmarkUtil.js +0 -25
- package/util/BrowserBookmarkUtil.js.map +0 -1
- package/util/BrowserUtil.d.ts +0 -31
- package/util/BrowserUtil.js +0 -154
- package/util/BrowserUtil.js.map +0 -1
- package/util/CanvasUtil.d.ts +0 -17
- package/util/CanvasUtil.js +0 -94
- package/util/CanvasUtil.js.map +0 -1
- package/util/ClassNames.d.ts +0 -2
- package/util/ClassNames.js +0 -3
- package/util/ClassNames.js.map +0 -1
- package/util/Clipboard.d.ts +0 -22
- package/util/Clipboard.js +0 -118
- package/util/Clipboard.js.map +0 -1
- package/util/ExpirableLocalStorageUtil.d.ts +0 -2
- package/util/ExpirableLocalStorageUtil.js +0 -3
- package/util/ExpirableLocalStorageUtil.js.map +0 -1
- package/util/ExportUtil.d.ts +0 -11
- package/util/ExportUtil.js +0 -28
- package/util/ExportUtil.js.map +0 -1
- package/util/ImportUtil.d.ts +0 -10
- package/util/ImportUtil.js +0 -94
- package/util/ImportUtil.js.map +0 -1
- package/util/LocalStorageUtil.d.ts +0 -2
- package/util/LocalStorageUtil.js +0 -3
- package/util/LocalStorageUtil.js.map +0 -1
- package/util/LocaleUtil.d.ts +0 -22
- package/util/LocaleUtil.js +0 -34
- package/util/LocaleUtil.js.map +0 -1
- package/util/MediaUtil/index.d.ts +0 -10
- package/util/MediaUtil/index.js +0 -60
- package/util/MediaUtil/index.js.map +0 -1
- package/util/MessageUtil/index.d.ts +0 -15
- package/util/MessageUtil/index.js +0 -29
- package/util/MessageUtil/index.js.map +0 -1
- package/util/ModalUtil/index.d.ts +0 -41
- package/util/ModalUtil/index.js +0 -145
- package/util/ModalUtil/index.js.map +0 -1
- package/util/NotificationUtil.d.ts +0 -12
- package/util/NotificationUtil.js +0 -52
- package/util/NotificationUtil.js.map +0 -1
- package/util/OrientationUtil.d.ts +0 -20
- package/util/OrientationUtil.js +0 -50
- package/util/OrientationUtil.js.map +0 -1
- package/util/PromptUtil/PromptBody.d.ts +0 -18
- package/util/PromptUtil/PromptBody.js +0 -100
- package/util/PromptUtil/PromptBody.js.map +0 -1
- package/util/PromptUtil/index.d.ts +0 -19
- package/util/PromptUtil/index.js +0 -48
- package/util/PromptUtil/index.js.map +0 -1
- package/util/RecentUsedStorageUtil.d.ts +0 -12
- package/util/RecentUsedStorageUtil.js +0 -45
- package/util/RecentUsedStorageUtil.js.map +0 -1
- package/util/SessionStorageUtil.d.ts +0 -2
- package/util/SessionStorageUtil.js +0 -3
- package/util/SessionStorageUtil.js.map +0 -1
- package/util/SwipeUtil.d.ts +0 -8
- package/util/SwipeUtil.js +0 -26
- package/util/SwipeUtil.js.map +0 -1
- package/util/UploadUtil/index.d.ts +0 -6
- package/util/UploadUtil/index.js +0 -61
- package/util/UploadUtil/index.js.map +0 -1
- package/util/UploadUtil/type.d.ts +0 -41
- package/util/UploadUtil/type.js +0 -2
- package/util/UploadUtil/type.js.map +0 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Tooltip} from "./Tooltip";
|
|
3
|
+
|
|
4
|
+
export interface TooltipListProps {
|
|
5
|
+
label: string;
|
|
6
|
+
content: string | number | React.ReactElement;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Props {
|
|
10
|
+
list: Array<TooltipListProps | "-">;
|
|
11
|
+
/**
|
|
12
|
+
* If undefined, it will use the first list item as label.
|
|
13
|
+
* If ReactElement, make sure it is inline-block, to make the tooltip arrow centered.
|
|
14
|
+
*/
|
|
15
|
+
children?: string | React.ReactElement;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class WithTooltipList extends React.PureComponent<Props> {
|
|
21
|
+
static displayName = "WithTooltipList";
|
|
22
|
+
|
|
23
|
+
private readonly labelStyle: React.CSSProperties = {display: "inline-block", width: 90};
|
|
24
|
+
private readonly wrapperStyle: React.CSSProperties = {display: "inline-block"};
|
|
25
|
+
|
|
26
|
+
renderTooltip = () => {
|
|
27
|
+
const {list} = this.props;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
{list.map((item, index) =>
|
|
32
|
+
item === "-" ? (
|
|
33
|
+
<hr key={index} />
|
|
34
|
+
) : (
|
|
35
|
+
<p key={item.label}>
|
|
36
|
+
<span style={this.labelStyle}>{item.label}</span>
|
|
37
|
+
<em>{item.content}</em>
|
|
38
|
+
</p>
|
|
39
|
+
)
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
const {list, children, onClick, onVisibleChange} = this.props;
|
|
47
|
+
if (list.length === 0) {
|
|
48
|
+
return children || "-";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const label = children ? (
|
|
52
|
+
children
|
|
53
|
+
) : list[0] === "-" ? (
|
|
54
|
+
"-"
|
|
55
|
+
) : typeof list[0].content === "string" || typeof list[0].content === "number" ? (
|
|
56
|
+
list[0].label + ": " + list[0].content
|
|
57
|
+
) : (
|
|
58
|
+
<React.Fragment>
|
|
59
|
+
{list[0].label}: {list[0].content}
|
|
60
|
+
</React.Fragment>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
if (onClick) {
|
|
64
|
+
/**
|
|
65
|
+
* - Must wrap with a <div> since the child node of <Tooltip> must accept certain methods, since <a>'s onClick is used already.
|
|
66
|
+
* - Wrapper must be inline-block, to make the tooltip arrow centered.
|
|
67
|
+
*
|
|
68
|
+
* Ref: https://ant.design/components/tooltip/#Note
|
|
69
|
+
*/
|
|
70
|
+
return (
|
|
71
|
+
<Tooltip placement="bottom" title={this.renderTooltip()} onVisibleChange={onVisibleChange}>
|
|
72
|
+
<div style={this.wrapperStyle}>
|
|
73
|
+
<a onClick={onClick || this.dummyClick} style={this.wrapperStyle} className="g-with-tooltip-list-anchor">
|
|
74
|
+
{label}
|
|
75
|
+
</a>
|
|
76
|
+
</div>
|
|
77
|
+
</Tooltip>
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
return (
|
|
81
|
+
<Tooltip placement="bottom" title={this.renderTooltip()} onVisibleChange={onVisibleChange} className="g-with-tooltip-list-anchor">
|
|
82
|
+
<a>{label}</a>
|
|
83
|
+
</Tooltip>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private readonly dummyClick = () => {};
|
|
89
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import type {ControlledFormValue} from "../internal/type";
|
|
4
|
+
import type {Moment} from "moment";
|
|
5
|
+
import AntDatePicker from "antd/lib/date-picker";
|
|
6
|
+
|
|
7
|
+
export interface Props<T extends boolean> extends ControlledFormValue<T extends false ? [number, number] : [number, number] | null> {
|
|
8
|
+
allowNull: T;
|
|
9
|
+
disabledRange?: (diffMonthToThisMonth: number, date: Date) => boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class YearMonthSelector<T extends boolean> extends React.PureComponent<Props<T>> {
|
|
15
|
+
static displayName = "DatePicker";
|
|
16
|
+
|
|
17
|
+
isDateDisabled = (current: moment.Moment): boolean => {
|
|
18
|
+
/**
|
|
19
|
+
* This is for compatibility of MySQL.
|
|
20
|
+
* MySQL TIMESTAMP data type is used for values that contain both date and time parts.
|
|
21
|
+
* TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.
|
|
22
|
+
*/
|
|
23
|
+
if (current.valueOf() >= new Date(2038, 0).valueOf()) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const diffMonthToThisMonth = Math.floor(current.diff(moment().startOf("month"), "month", true));
|
|
28
|
+
return this.props.disabledRange?.(diffMonthToThisMonth, current.toDate()) || false;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
onChange = (date: Moment | null, dateString: string) => {
|
|
32
|
+
const {onChange, allowNull} = this.props;
|
|
33
|
+
if (dateString || allowNull) {
|
|
34
|
+
const typedOnChange = onChange as (value: [number, number] | null) => void;
|
|
35
|
+
typedOnChange(date && [date.year(), date.month() + 1]);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
render() {
|
|
40
|
+
const {value, allowNull, disabled, className} = this.props;
|
|
41
|
+
return (
|
|
42
|
+
<AntDatePicker
|
|
43
|
+
className={className}
|
|
44
|
+
disabledDate={this.isDateDisabled}
|
|
45
|
+
value={value ? moment([value[0], value[1] - 1]) : null}
|
|
46
|
+
onChange={this.onChange}
|
|
47
|
+
allowClear={allowNull}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
picker="month"
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {OrientationUtil} from "../util/OrientationUtil";
|
|
3
|
+
import type {OrientationType} from "../util/OrientationUtil";
|
|
4
|
+
|
|
5
|
+
export function useOrientationMode(): OrientationType {
|
|
6
|
+
const [mode, setMode] = React.useState<OrientationType>(OrientationUtil.mode());
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const handler = () => setMode(OrientationUtil.mode());
|
|
10
|
+
OrientationUtil.onOrientationChange(handler);
|
|
11
|
+
|
|
12
|
+
return () => {
|
|
13
|
+
OrientationUtil.removeOnChange(handler);
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
return mode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type {SwipeHookConfig, SwipeHookHandlers, SwipeHookResult, SwipeState, Vector2} from "./type";
|
|
3
|
+
import {SwipeUtil} from "../../util/SwipeUtil";
|
|
4
|
+
|
|
5
|
+
const SWIPE_START_THRESHOLD = 10;
|
|
6
|
+
|
|
7
|
+
export class Controller {
|
|
8
|
+
private startTime: number = 0;
|
|
9
|
+
private startTouch: React.Touch | null = null;
|
|
10
|
+
private started: boolean = false;
|
|
11
|
+
private handlers: SwipeHookHandlers;
|
|
12
|
+
private config: SwipeHookConfig;
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
this.handlers = {};
|
|
16
|
+
this.config = {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private onTouchStart(e: React.TouchEvent) {
|
|
20
|
+
if (e.changedTouches[0] && !this.startTouch) {
|
|
21
|
+
this.startTouch = e.changedTouches[0];
|
|
22
|
+
this.startTime = Date.now();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private onTouchMove(e: React.TouchEvent) {
|
|
27
|
+
const matchedTouches = this.matchTouches(e);
|
|
28
|
+
if (!matchedTouches) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const state = this.computeEvent(matchedTouches.start, matchedTouches.changed, e);
|
|
32
|
+
|
|
33
|
+
if (!this.started && this.testThreshold(state)) {
|
|
34
|
+
this.started = true;
|
|
35
|
+
this.handlers.onStart?.(state);
|
|
36
|
+
return;
|
|
37
|
+
} else if (this.started) {
|
|
38
|
+
this.handlers.onMove?.(state);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private onTouchEnd(e: React.TouchEvent) {
|
|
43
|
+
if (!this.started) {
|
|
44
|
+
this.reset();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const matchedTouches = this.matchTouches(e);
|
|
48
|
+
if (!matchedTouches) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const state = this.computeEvent(matchedTouches.start, matchedTouches.changed, e);
|
|
52
|
+
this.handlers.onEnd?.(state);
|
|
53
|
+
this.reset();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private onTouchCancel(e: React.TouchEvent) {
|
|
57
|
+
if (!this.started) {
|
|
58
|
+
this.reset();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const matchedTouches = this.matchTouches(e);
|
|
62
|
+
if (!matchedTouches) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const state = this.computeEvent(matchedTouches.start, matchedTouches.changed, e);
|
|
66
|
+
this.handlers.onCancel?.(state);
|
|
67
|
+
this.reset();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private testThreshold(state: SwipeState): boolean {
|
|
71
|
+
return state.displacement > SWIPE_START_THRESHOLD && (this.config.threshold?.(state) ?? true);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private cancel(event: React.TouchEvent) {
|
|
75
|
+
if (this.startTouch) {
|
|
76
|
+
this.onTouchCancel(event);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private computeEvent(start: React.Touch, changed: React.Touch, event: React.TouchEvent): SwipeState {
|
|
81
|
+
const s: Vector2 = [start.clientX, start.clientY];
|
|
82
|
+
const e: Vector2 = [changed.clientX, changed.clientY];
|
|
83
|
+
const delta: Vector2 = [e[0] - s[0], e[1] - s[1]];
|
|
84
|
+
const timeElapsed = Date.now() - this.startTime;
|
|
85
|
+
return {
|
|
86
|
+
clientX: changed.clientX,
|
|
87
|
+
clientY: changed.clientY,
|
|
88
|
+
startTouch: start,
|
|
89
|
+
delta,
|
|
90
|
+
direction: SwipeUtil.getDirection(s, e),
|
|
91
|
+
displacement: SwipeUtil.getDisplacement(s, e),
|
|
92
|
+
// TODO/Alvis, need to improve velocity calculation
|
|
93
|
+
velocity: [Math.abs(delta[0]) / timeElapsed, Math.abs(delta[1]) / timeElapsed],
|
|
94
|
+
syntheticEvent: event,
|
|
95
|
+
cancel: (() => this.cancel(event)).bind(this),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private matchTouches(e: React.TouchEvent): {start: React.Touch; changed: React.Touch} | null {
|
|
100
|
+
if (!this.startTouch) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const touch = Array.from(e.changedTouches).find(_ => _.identifier === this.startTouch!.identifier);
|
|
104
|
+
if (!touch) {
|
|
105
|
+
return null;
|
|
106
|
+
} else {
|
|
107
|
+
return {
|
|
108
|
+
start: this.startTouch,
|
|
109
|
+
changed: touch,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private reset() {
|
|
115
|
+
this.startTime = 0;
|
|
116
|
+
this.startTouch = null;
|
|
117
|
+
this.started = false;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
update(handlers: SwipeHookHandlers, config: SwipeHookConfig = {}) {
|
|
121
|
+
this.handlers = handlers;
|
|
122
|
+
this.config = config;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
createHandlers(): SwipeHookResult {
|
|
126
|
+
return {
|
|
127
|
+
onTouchStart: this.onTouchStart.bind(this),
|
|
128
|
+
onTouchMove: this.onTouchMove.bind(this),
|
|
129
|
+
onTouchEnd: this.onTouchEnd.bind(this),
|
|
130
|
+
onTouchCancel: this.onTouchCancel.bind(this),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Controller} from "./controller";
|
|
3
|
+
import type {SwipeHookConfig, SwipeHookHandlers, SwipeHookResult} from "./type";
|
|
4
|
+
|
|
5
|
+
export const useSwipe = (handlers: SwipeHookHandlers, config?: SwipeHookConfig): SwipeHookResult => {
|
|
6
|
+
const controller = React.useMemo(() => new Controller(), []);
|
|
7
|
+
controller.update(handlers, config);
|
|
8
|
+
return controller.createHandlers.apply(controller);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export * from "./type";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
|
|
3
|
+
export type TouchHandlers = Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEndCapture" | "onTouchCancelCapture">;
|
|
4
|
+
|
|
5
|
+
export interface SwipeHookResult {
|
|
6
|
+
onTouchMove: React.TouchEventHandler;
|
|
7
|
+
onTouchStart: React.TouchEventHandler;
|
|
8
|
+
onTouchEnd: React.TouchEventHandler;
|
|
9
|
+
onTouchCancel: React.TouchEventHandler;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SwipeState {
|
|
13
|
+
syntheticEvent: React.TouchEvent;
|
|
14
|
+
startTouch: React.Touch;
|
|
15
|
+
clientX: number;
|
|
16
|
+
clientY: number;
|
|
17
|
+
displacement: number;
|
|
18
|
+
delta: Vector2;
|
|
19
|
+
velocity: Vector2;
|
|
20
|
+
direction: Direction;
|
|
21
|
+
cancel: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SwipeHookHandler = (event: SwipeState) => void;
|
|
25
|
+
|
|
26
|
+
export interface SwipeHookHandlers {
|
|
27
|
+
onStart?: SwipeHookHandler;
|
|
28
|
+
onEnd?: SwipeHookHandler;
|
|
29
|
+
onMove?: SwipeHookHandler;
|
|
30
|
+
onCancel?: SwipeHookHandler;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SwipeHookConfig {
|
|
34
|
+
threshold?: (state: SwipeState) => boolean;
|
|
35
|
+
preventDefault?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum Direction {
|
|
39
|
+
UP = "UP",
|
|
40
|
+
DOWN = "DOWN",
|
|
41
|
+
LEFT = "LEFT",
|
|
42
|
+
RIGHT = "RIGHT",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type Vector2 = [number, number];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
interface TransitionOption {
|
|
4
|
+
// transition related properties
|
|
5
|
+
property?: string;
|
|
6
|
+
// in ms
|
|
7
|
+
duration?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
timingFunction?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Option extends TransitionOption {
|
|
13
|
+
// transform related properties
|
|
14
|
+
x?: string | number;
|
|
15
|
+
y?: string | number;
|
|
16
|
+
z?: string | number;
|
|
17
|
+
immediate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const useTransform = (ref: React.RefObject<HTMLElement>, option?: Option) => {
|
|
21
|
+
const initialOptionRef = React.useRef(option);
|
|
22
|
+
initialOptionRef.current = option;
|
|
23
|
+
|
|
24
|
+
const clearTransition = React.useCallback((el: HTMLElement) => {
|
|
25
|
+
el.style.transitionDuration = "";
|
|
26
|
+
el.style.transitionProperty = "";
|
|
27
|
+
el.style.transitionTimingFunction = "";
|
|
28
|
+
el.style.transitionDuration = "";
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
const setTransition = React.useCallback(
|
|
32
|
+
(el: HTMLElement, option?: Option) => {
|
|
33
|
+
if (option) {
|
|
34
|
+
const {delay, duration, property, timingFunction} = option;
|
|
35
|
+
delay && (el.style.transitionDelay = delay + "ms");
|
|
36
|
+
duration && (el.style.transitionDuration = duration + "ms");
|
|
37
|
+
property && (el.style.transitionProperty = property);
|
|
38
|
+
timingFunction && (el.style.transitionTimingFunction = timingFunction);
|
|
39
|
+
} else {
|
|
40
|
+
clearTransition(el);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
[clearTransition]
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const to = React.useCallback(
|
|
47
|
+
(option: Option) => {
|
|
48
|
+
if (ref.current) {
|
|
49
|
+
const format = (value?: number | string): string => (value ? (typeof value === "number" ? `${value}px` : value) : "0px");
|
|
50
|
+
const el = ref.current;
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
el.style.transform = `translate3d(${format(option.x)}, ${format(option.y)}, ${format(option.z)}) `;
|
|
53
|
+
option.immediate ? clearTransition(el) : setTransition(el, option);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[ref, setTransition, clearTransition]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const clear = React.useCallback(() => {
|
|
61
|
+
if (ref.current) {
|
|
62
|
+
const el = ref.current;
|
|
63
|
+
requestAnimationFrame(() => {
|
|
64
|
+
el.style.transform = "";
|
|
65
|
+
setTransition(el, initialOptionRef.current);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [ref, setTransition]);
|
|
69
|
+
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
if (initialOptionRef.current) {
|
|
72
|
+
to(initialOptionRef.current);
|
|
73
|
+
}
|
|
74
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- only run on mount
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
77
|
+
return {to, clear};
|
|
78
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return b's the occurrence percentage in a.
|
|
3
|
+
* The ordering of a & b matters.
|
|
4
|
+
*/
|
|
5
|
+
function intersectionPercentage<T>(a: T[], b: T[]): number {
|
|
6
|
+
if (a.length === 0) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
return (a.filter(_ => b.includes(_)).length / a.length) * 100;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function toObject<T, V>(array: ReadonlyArray<T>, mapperCallback: (item: T, index: number) => [string, V]): {[key: string]: V} {
|
|
13
|
+
const result: {[key: string]: V} = {};
|
|
14
|
+
array.forEach((item, index) => {
|
|
15
|
+
const mappedKV = mapperCallback(item, index);
|
|
16
|
+
result[mappedKV[0]] = mappedKV[1];
|
|
17
|
+
});
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Accepts a list of item and a callback, maps each item with the callback,
|
|
23
|
+
* then removes value of `null`, `undefined`, `NaN` from the resulting list.
|
|
24
|
+
* Other falsy values are **NOT** removed.
|
|
25
|
+
*
|
|
26
|
+
* @param array List of items to be filtered
|
|
27
|
+
* @param callback Callback to transform item
|
|
28
|
+
*/
|
|
29
|
+
function compactMap<T, V>(array: ReadonlyArray<T>, callback: (item: T, index: number) => V): Array<NonNullable<V>> {
|
|
30
|
+
return array.map(callback).filter(_ => _ !== null && _ !== undefined && (typeof _ !== "number" || !Number.isNaN(_))) as Array<NonNullable<V>>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* If element exists in array, it will return a new array without this element.
|
|
35
|
+
* If element not exists in array, it will return a new array with this element in the last.
|
|
36
|
+
*/
|
|
37
|
+
function toggleElement<T>(array: ReadonlyArray<T>, element: T): T[] {
|
|
38
|
+
const index = array.indexOf(element);
|
|
39
|
+
if (index >= 0) {
|
|
40
|
+
const clonedArray = [...array];
|
|
41
|
+
clonedArray.splice(index, 1);
|
|
42
|
+
return clonedArray;
|
|
43
|
+
} else {
|
|
44
|
+
return [...array, element];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const ArrayUtil = Object.freeze({
|
|
49
|
+
intersectionPercentage,
|
|
50
|
+
toObject,
|
|
51
|
+
compactMap,
|
|
52
|
+
toggleElement,
|
|
53
|
+
});
|