@pinnacle0/web-ui 0.6.45 → 0.7.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 +1 -1
- package/admin/AdminApp/Default/NavigatorSide/index.js.map +1 -1
- package/core/Amount/AmountPercentage.d.ts +1 -4
- package/core/Amount/AmountPercentage.js +5 -8
- package/core/Amount/AmountPercentage.js.map +1 -1
- package/core/Amount/index.d.ts +3 -8
- package/core/Amount/index.js +27 -35
- package/core/Amount/index.js.map +1 -1
- package/core/AuthenticationCodeInput/index.less +1 -1
- package/core/AutoCompleteInput/index.d.ts +2 -5
- package/core/AutoCompleteInput/index.js +5 -7
- package/core/AutoCompleteInput/index.js.map +1 -1
- package/core/BoolSwitch/index.d.ts +5 -7
- package/core/BoolSwitch/index.js +11 -13
- package/core/BoolSwitch/index.js.map +1 -1
- package/core/Breadcrumb/index.d.ts +1 -5
- package/core/Breadcrumb/index.js +8 -16
- package/core/Breadcrumb/index.js.map +1 -1
- package/core/Button/index.d.ts +2 -2
- package/core/Button/index.js +3 -2
- package/core/Button/index.js.map +1 -1
- package/core/Card/index.d.ts +3 -6
- package/core/Card/index.js +4 -7
- package/core/Card/index.js.map +1 -1
- package/core/Carousel/index.d.ts +1 -4
- package/core/Carousel/index.js +4 -7
- package/core/Carousel/index.js.map +1 -1
- package/core/Carousel3D/index.d.ts +1 -21
- package/core/Carousel3D/index.js +76 -83
- package/core/Carousel3D/index.js.map +1 -1
- package/core/Cascader/InitialNullable.d.ts +1 -4
- package/core/Cascader/InitialNullable.js +5 -8
- package/core/Cascader/InitialNullable.js.map +1 -1
- package/core/Cascader/Nullable.d.ts +2 -7
- package/core/Cascader/Nullable.js +10 -12
- package/core/Cascader/Nullable.js.map +1 -1
- package/core/Cascader/index.d.ts +4 -13
- package/core/Cascader/index.js +18 -20
- package/core/Cascader/index.js.map +1 -1
- package/core/Checkbox/index.d.ts +4 -7
- package/core/Checkbox/index.js +4 -9
- package/core/Checkbox/index.js.map +1 -1
- package/core/Collapse/index.d.ts +2 -7
- package/core/Collapse/index.js +4 -6
- package/core/Collapse/index.js.map +1 -1
- package/core/Countdown/SlidingDigit.d.ts +1 -10
- package/core/Countdown/SlidingDigit.js +16 -21
- package/core/Countdown/SlidingDigit.js.map +1 -1
- package/core/Countdown/index.d.ts +1 -18
- package/core/Countdown/index.js +53 -74
- package/core/Countdown/index.js.map +1 -1
- package/core/DarkOverlay/index.d.ts +1 -4
- package/core/DarkOverlay/index.js +4 -7
- package/core/DarkOverlay/index.js.map +1 -1
- package/core/DateCalendar/index.d.ts +2 -13
- package/core/DateCalendar/index.js +12 -14
- package/core/DateCalendar/index.js.map +1 -1
- package/core/DatePicker/index.d.ts +1 -7
- package/core/DatePicker/index.js +9 -16
- package/core/DatePicker/index.js.map +1 -1
- package/core/DateRangePicker/index.d.ts +1 -14
- package/core/DateRangePicker/index.js +25 -34
- package/core/DateRangePicker/index.js.map +1 -1
- package/core/DateTimePicker/index.d.ts +1 -7
- package/core/DateTimePicker/index.js +12 -21
- package/core/DateTimePicker/index.js.map +1 -1
- package/core/DateTimeRangePicker/index.d.ts +1 -17
- package/core/DateTimeRangePicker/index.js +21 -31
- package/core/DateTimeRangePicker/index.js.map +1 -1
- package/core/Descriptions/index.d.ts +3 -8
- package/core/Descriptions/index.js +7 -13
- package/core/Descriptions/index.js.map +1 -1
- package/core/Descriptions/index.less +0 -8
- package/core/DocumentTitle/index.d.ts +4 -13
- package/core/DocumentTitle/index.js +18 -31
- package/core/DocumentTitle/index.js.map +1 -1
- package/core/Drawer/index.d.ts +1 -3
- package/core/Drawer/index.js +4 -5
- package/core/Drawer/index.js.map +1 -1
- package/core/Dropdown/index.d.ts +3 -4
- package/core/Dropdown/index.js +4 -3
- package/core/Dropdown/index.js.map +1 -1
- package/core/EnumCheckboxGroup/Map.d.ts +1 -4
- package/core/EnumCheckboxGroup/Map.js +5 -9
- package/core/EnumCheckboxGroup/Map.js.map +1 -1
- package/core/EnumCheckboxGroup/index.d.ts +3 -4
- package/core/EnumCheckboxGroup/index.js +11 -12
- package/core/EnumCheckboxGroup/index.js.map +1 -1
- package/core/EnumRadio/InitialNullable.d.ts +1 -5
- package/core/EnumRadio/InitialNullable.js +6 -9
- package/core/EnumRadio/InitialNullable.js.map +1 -1
- package/core/EnumRadio/Map.d.ts +1 -4
- package/core/EnumRadio/Map.js +6 -9
- package/core/EnumRadio/Map.js.map +1 -1
- package/core/EnumRadio/Nullable.d.ts +1 -5
- package/core/EnumRadio/Nullable.js +12 -14
- package/core/EnumRadio/Nullable.js.map +1 -1
- package/core/EnumRadio/index.d.ts +5 -12
- package/core/EnumRadio/index.js +9 -17
- package/core/EnumRadio/index.js.map +1 -1
- package/core/EnumSelect/InitialNullable.d.ts +1 -4
- package/core/EnumSelect/InitialNullable.js +4 -8
- package/core/EnumSelect/InitialNullable.js.map +1 -1
- package/core/EnumSelect/Map.d.ts +1 -4
- package/core/EnumSelect/Map.js +6 -9
- package/core/EnumSelect/Map.js.map +1 -1
- package/core/EnumSelect/Nullable.d.ts +1 -5
- package/core/EnumSelect/Nullable.js +12 -14
- package/core/EnumSelect/Nullable.js.map +1 -1
- package/core/EnumSelect/index.d.ts +5 -15
- package/core/EnumSelect/index.js +19 -27
- package/core/EnumSelect/index.js.map +1 -1
- package/core/EnumSelect/index.less +1 -1
- package/core/FlatList/Content/Footer/index.js +3 -2
- package/core/FlatList/Content/Footer/index.js.map +1 -1
- package/core/FlatList/Content/index.d.ts +1 -1
- package/core/FlatList/Content/index.js +10 -8
- package/core/FlatList/Content/index.js.map +1 -1
- package/core/FlatList/FloatingLoader/index.js +3 -2
- package/core/FlatList/FloatingLoader/index.js.map +1 -1
- package/core/FlatList/Refresh/index.js +3 -2
- package/core/FlatList/Refresh/index.js.map +1 -1
- package/core/FlatList/index.d.ts +1 -1
- package/core/FlatList/index.js +10 -9
- package/core/FlatList/index.js.map +1 -1
- package/core/FlatList/shared/Loader/index.js +3 -2
- package/core/FlatList/shared/Loader/index.js.map +1 -1
- package/core/Form/Item.d.ts +1 -16
- package/core/Form/Item.js +28 -40
- package/core/Form/Item.js.map +1 -1
- package/core/Form/index.d.ts +6 -17
- package/core/Form/index.js +29 -46
- package/core/Form/index.js.map +1 -1
- package/core/Form/index.less +1 -1
- package/core/Grid/index.d.ts +2 -2
- package/core/Grid/index.js +2 -1
- package/core/Grid/index.js.map +1 -1
- package/core/HTMLContent/index.d.ts +1 -4
- package/core/HTMLContent/index.js +4 -7
- package/core/HTMLContent/index.js.map +1 -1
- package/core/Image/index.d.ts +3 -6
- package/core/Image/index.js +6 -7
- package/core/Image/index.js.map +1 -1
- package/core/ImageUploader/index.d.ts +2 -11
- package/core/ImageUploader/index.js +17 -25
- package/core/ImageUploader/index.js.map +1 -1
- package/core/Input/index.d.ts +12 -18
- package/core/Input/index.js +37 -41
- package/core/Input/index.js.map +1 -1
- package/core/LabelledSelect/index.d.ts +3 -5
- package/core/LabelledSelect/index.js +4 -7
- package/core/LabelledSelect/index.js.map +1 -1
- package/core/Link/index.d.ts +1 -4
- package/core/Link/index.js +16 -19
- package/core/Link/index.js.map +1 -1
- package/core/LocalImporter/index.d.ts +1 -10
- package/core/LocalImporter/index.js +11 -18
- package/core/LocalImporter/index.js.map +1 -1
- package/core/LocaleSelect/index.d.ts +1 -10
- package/core/LocaleSelect/index.js +16 -18
- package/core/LocaleSelect/index.js.map +1 -1
- package/core/Markdown/index.d.ts +1 -7
- package/core/Markdown/index.js +13 -16
- package/core/Markdown/index.js.map +1 -1
- package/core/Modal/index.less +1 -1
- package/core/MultipleCascader/index.d.ts +1 -9
- package/core/MultipleCascader/index.js +15 -19
- package/core/MultipleCascader/index.js.map +1 -1
- package/core/MultipleEnumSelect/index.d.ts +1 -8
- package/core/MultipleEnumSelect/index.js +9 -15
- package/core/MultipleEnumSelect/index.js.map +1 -1
- package/core/MultipleSelector/TablePopover.d.ts +1 -7
- package/core/MultipleSelector/TablePopover.js +23 -26
- package/core/MultipleSelector/TablePopover.js.map +1 -1
- package/core/MultipleSelector/index.d.ts +1 -9
- package/core/MultipleSelector/index.js +18 -26
- package/core/MultipleSelector/index.js.map +1 -1
- package/core/MutableTable/index.d.ts +1 -13
- package/core/MutableTable/index.js +25 -35
- package/core/MutableTable/index.js.map +1 -1
- package/core/NumberInput/NumberInputPercentage.d.ts +1 -8
- package/core/NumberInput/NumberInputPercentage.js +8 -25
- package/core/NumberInput/NumberInputPercentage.js.map +1 -1
- package/core/NumberInput/index.d.ts +5 -33
- package/core/NumberInput/index.js +44 -72
- package/core/NumberInput/index.js.map +1 -1
- package/core/OverflowableText/index.d.ts +1 -12
- package/core/OverflowableText/index.js +11 -28
- package/core/OverflowableText/index.js.map +1 -1
- package/core/Pagination/index.d.ts +1 -7
- package/core/Pagination/index.js +17 -19
- package/core/Pagination/index.js.map +1 -1
- package/core/Popover/index.d.ts +0 -1
- package/core/Popover/index.js +2 -5
- package/core/Popover/index.js.map +1 -1
- package/core/Progress/index.d.ts +1 -4
- package/core/Progress/index.js +4 -6
- package/core/Progress/index.js.map +1 -1
- package/core/Radio/index.d.ts +5 -7
- package/core/Radio/index.js +2 -8
- package/core/Radio/index.js.map +1 -1
- package/core/RelativeTime/index.d.ts +1 -15
- package/core/RelativeTime/index.js +17 -31
- package/core/RelativeTime/index.js.map +1 -1
- package/core/Resizable/index.js +3 -2
- package/core/Resizable/index.js.map +1 -1
- package/core/SearchableSelect/index.d.ts +3 -5
- package/core/SearchableSelect/index.js +4 -7
- package/core/SearchableSelect/index.js.map +1 -1
- package/core/Select/index.d.ts +8 -7
- package/core/Select/index.js +8 -8
- package/core/Select/index.js.map +1 -1
- package/core/SignedAmountInput/index.d.ts +1 -8
- package/core/SignedAmountInput/index.js +16 -24
- package/core/SignedAmountInput/index.js.map +1 -1
- package/core/Skeleton/index.d.ts +1 -4
- package/core/Skeleton/index.js +4 -7
- package/core/Skeleton/index.js.map +1 -1
- package/core/Slider/RangeSlider.d.ts +2 -6
- package/core/Slider/RangeSlider.js +4 -7
- package/core/Slider/RangeSlider.js.map +1 -1
- package/core/Slider/index.d.ts +3 -7
- package/core/Slider/index.js +15 -20
- package/core/Slider/index.js.map +1 -1
- package/core/Space/index.d.ts +3 -5
- package/core/Space/index.js +4 -7
- package/core/Space/index.js.map +1 -1
- package/core/Spin/index.d.ts +3 -6
- package/core/Spin/index.js +4 -7
- package/core/Spin/index.js.map +1 -1
- package/core/StepFormContainer/index.d.ts +2 -7
- package/core/StepFormContainer/index.js +13 -17
- package/core/StepFormContainer/index.js.map +1 -1
- package/core/Steps/index.d.ts +3 -6
- package/core/Steps/index.js +4 -6
- package/core/Steps/index.js.map +1 -1
- package/core/Table/index.d.ts +6 -34
- package/core/Table/index.js +64 -80
- package/core/Table/index.js.map +1 -1
- package/core/Tabs/Single.d.ts +1 -4
- package/core/Tabs/Single.js +4 -7
- package/core/Tabs/Single.js.map +1 -1
- package/core/Tabs/index.d.ts +3 -13
- package/core/Tabs/index.js +27 -35
- package/core/Tabs/index.js.map +1 -1
- package/core/Tag/index.d.ts +2 -5
- package/core/Tag/index.js +4 -6
- package/core/Tag/index.js.map +1 -1
- package/core/TagInput/index.d.ts +2 -15
- package/core/TagInput/index.js +25 -41
- package/core/TagInput/index.js.map +1 -1
- package/core/Tags/index.d.ts +1 -6
- package/core/Tags/index.js +9 -13
- package/core/Tags/index.js.map +1 -1
- package/core/TimePicker/index.d.ts +1 -7
- package/core/TimePicker/index.js +8 -11
- package/core/TimePicker/index.js.map +1 -1
- package/core/TimeRangePicker/index.d.ts +1 -14
- package/core/TimeRangePicker/index.js +21 -27
- package/core/TimeRangePicker/index.js.map +1 -1
- package/core/Tooltip/index.d.ts +3 -4
- package/core/Tooltip/index.js +2 -5
- package/core/Tooltip/index.js.map +1 -1
- package/core/TypedTabs/index.d.ts +1 -4
- package/core/TypedTabs/index.js +16 -18
- package/core/TypedTabs/index.js.map +1 -1
- package/core/Uploader/index.d.ts +1 -17
- package/core/Uploader/index.js +25 -31
- package/core/Uploader/index.js.map +1 -1
- package/core/VirtualList/index.d.ts +1 -1
- package/core/VirtualList/index.js +3 -2
- package/core/VirtualList/index.js.map +1 -1
- package/core/VirtualTable/{TableHeader.js → OldVirtualTable/TableHeader.js} +2 -2
- package/core/VirtualTable/OldVirtualTable/TableHeader.js.map +1 -0
- package/core/VirtualTable/{TableRow.js → OldVirtualTable/TableRow.js} +2 -2
- package/core/VirtualTable/OldVirtualTable/TableRow.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnWidths.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useColumnWidths.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnsStickyPosition.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useColumnsStickyPosition.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useRowSelection.d.ts +1 -1
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useRowSelection.js +2 -2
- package/core/VirtualTable/OldVirtualTable/hooks/useRowSelection.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/hooks/useScroll.js.map +1 -0
- package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScrollBarSize.js +1 -1
- package/core/VirtualTable/OldVirtualTable/hooks/useScrollBarSize.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/index.d.ts +28 -0
- package/core/VirtualTable/OldVirtualTable/index.js +58 -0
- package/core/VirtualTable/OldVirtualTable/index.js.map +1 -0
- package/core/VirtualTable/OldVirtualTable/index.old.less +160 -0
- package/core/VirtualTable/OldVirtualTable/type.js.map +1 -0
- package/core/VirtualTable/index.d.ts +24 -23
- package/core/VirtualTable/index.js +54 -50
- package/core/VirtualTable/index.js.map +1 -1
- package/core/VirtualTable/index.less +28 -140
- package/core/WithExplanation/index.d.ts +1 -6
- package/core/WithExplanation/index.js +11 -20
- package/core/WithExplanation/index.js.map +1 -1
- package/core/WithTooltipList/index.d.ts +1 -9
- package/core/WithTooltipList/index.js +28 -27
- package/core/WithTooltipList/index.js.map +1 -1
- package/core/YearMonthSelector/index.d.ts +1 -7
- package/core/YearMonthSelector/index.js +9 -15
- package/core/YearMonthSelector/index.js.map +1 -1
- package/css/global.less +0 -9
- package/hooks/useParentResizeObserver/index.d.ts +2 -0
- package/hooks/useParentResizeObserver/index.js +17 -0
- package/hooks/useParentResizeObserver/index.js.map +1 -0
- package/hooks/useResizeObserver/index.d.ts +1 -1
- package/hooks/useResizeObserver/index.js +6 -10
- package/hooks/useResizeObserver/index.js.map +1 -1
- package/package.json +9 -9
- package/util/ModalUtil/index.less +1 -1
- package/util/PromptUtil/PromptBody.d.ts +4 -13
- package/util/PromptUtil/PromptBody.js +19 -28
- package/util/PromptUtil/PromptBody.js.map +1 -1
- package/util/PromptUtil/index.js +1 -1
- package/util/PromptUtil/index.js.map +1 -1
- package/util/ReactUtil/index.d.ts +20 -0
- package/util/ReactUtil/index.js +35 -0
- package/util/ReactUtil/index.js.map +1 -1
- package/core/VirtualTable/TableHeader.js.map +0 -1
- package/core/VirtualTable/TableRow.js.map +0 -1
- package/core/VirtualTable/hooks/useColumnWidths.js.map +0 -1
- package/core/VirtualTable/hooks/useColumnsStickyPosition.js.map +0 -1
- package/core/VirtualTable/hooks/useRowSelection.js.map +0 -1
- package/core/VirtualTable/hooks/useScroll.js.map +0 -1
- package/core/VirtualTable/hooks/useScrollBarSize.js.map +0 -1
- package/core/VirtualTable/type.js.map +0 -1
- /package/core/VirtualTable/{TableHeader.d.ts → OldVirtualTable/TableHeader.d.ts} +0 -0
- /package/core/VirtualTable/{TableRow.d.ts → OldVirtualTable/TableRow.d.ts} +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnWidths.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useColumnsStickyPosition.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScroll.d.ts +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScroll.js +0 -0
- /package/core/VirtualTable/{hooks → OldVirtualTable/hooks}/useScrollBarSize.d.ts +0 -0
- /package/core/VirtualTable/{type.d.ts → OldVirtualTable/type.d.ts} +0 -0
- /package/core/VirtualTable/{type.js → OldVirtualTable/type.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/EnumRadio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAc/C,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,EAAC,EAAE,CAAyC,KAAkB,EAAE,EAAE;IACtJ,MAAM,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IAE1G,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE9E,OAAO,CACH,oBAAC,KAAK,CAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,IAC/K,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACX,iFAAiF;IACjF,oBAAC,SAAS,IAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,IACjC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAClC,CACf,CAAC,CACQ,CACjB,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -4,7 +4,4 @@ export interface Props<Enum extends string | boolean | number> extends BaseProps
|
|
|
4
4
|
value: Enum | null;
|
|
5
5
|
onChange: (newValue: Enum) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
static displayName: string;
|
|
9
|
-
render(): React.JSX.Element;
|
|
10
|
-
}
|
|
7
|
+
export declare const InitialNullable: <Enum extends string | boolean | number>({ value, ...restProps }: Props<Enum>) => React.JSX.Element;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumSelect } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const wrappedValue = value;
|
|
8
|
-
return React.createElement(EnumSelect, { value: wrappedValue, ...restProps });
|
|
9
|
-
}
|
|
10
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const InitialNullable = ReactUtil.memo("InitialNullable", ({ value, ...restProps }) => {
|
|
5
|
+
return React.createElement(EnumSelect, { value: value, ...restProps });
|
|
6
|
+
});
|
|
11
7
|
//# sourceMappingURL=InitialNullable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitialNullable.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/InitialNullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"InitialNullable.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/InitialNullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAyC,EAAC,KAAK,EAAE,GAAG,SAAS,EAAc,EAAE,EAAE;IAC5I,OAAO,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAa,KAAM,SAAS,GAAI,CAAC;AAC/D,CAAC,CAAC,CAAC"}
|
package/core/EnumSelect/Map.d.ts
CHANGED
|
@@ -4,7 +4,4 @@ import type { ControlledFormValue } from "../../internal/type";
|
|
|
4
4
|
export interface Props<T extends string> extends Omit<BaseProps<any>, "list" | "translator">, ControlledFormValue<T> {
|
|
5
5
|
map: Record<T, React.ReactElement | string | number | null>;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
static displayName: string;
|
|
9
|
-
render(): React.JSX.Element;
|
|
10
|
-
}
|
|
7
|
+
export declare const Map: <T extends string>({ map, ...restProps }: Props<T>) => React.JSX.Element;
|
package/core/EnumSelect/Map.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumSelect } from "./index";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return React.createElement(EnumSelect, { list: list, translator: translator, ...restProps });
|
|
10
|
-
}
|
|
11
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const Map = ReactUtil.memo("Map", ({ map, ...restProps }) => {
|
|
5
|
+
const list = Object.keys(map);
|
|
6
|
+
const translator = (_) => map[_];
|
|
7
|
+
return React.createElement(EnumSelect, { list: list, translator: translator, ...restProps });
|
|
8
|
+
});
|
|
12
9
|
//# sourceMappingURL=Map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAM/C,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAmB,EAAC,GAAG,EAAE,GAAG,SAAS,EAAW,EAAE,EAAE;IACzF,MAAM,IAAI,GAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAQ,CAAC;IAC1C,MAAM,UAAU,GAAG,CAAC,CAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,oBAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,KAAM,SAAS,GAAI,CAAC;AAC7E,CAAC,CAAC,CAAC"}
|
|
@@ -5,8 +5,4 @@ export interface Props<Enum extends string | boolean | number> extends BaseProps
|
|
|
5
5
|
nullText?: React.ReactElement | string | number | null;
|
|
6
6
|
nullPositionIndex?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
static displayName: string;
|
|
10
|
-
private readonly nullValue;
|
|
11
|
-
render(): React.JSX.Element;
|
|
12
|
-
}
|
|
8
|
+
export declare const Nullable: <Enum extends string | boolean | number>(props: Props<Enum>) => React.JSX.Element;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumSelect } from "./index";
|
|
3
3
|
import { i18n } from "../../internal/i18n/core";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
5
|
+
const NULL_VALUE = "@@NULL";
|
|
6
|
+
export const Nullable = ReactUtil.memo("Nullable", (props) => {
|
|
7
|
+
const { value, onChange, nullText, nullPositionIndex, list, translator, ...restProps } = props;
|
|
8
|
+
const t = i18n();
|
|
9
|
+
const wrappedValue = value === null ? NULL_VALUE : value;
|
|
10
|
+
const wrappedOnChange = (value) => onChange(value === NULL_VALUE ? null : value);
|
|
11
|
+
const wrappedList = [...list];
|
|
12
|
+
wrappedList.splice(nullPositionIndex || 0, 0, NULL_VALUE);
|
|
13
|
+
const wrappedTranslator = (value) => (value === NULL_VALUE ? (nullText ?? t.all) : translator ? translator(value) : value.toString());
|
|
14
|
+
return React.createElement(EnumSelect, { value: wrappedValue, onChange: wrappedOnChange, list: wrappedList, translator: wrappedTranslator, ...restProps });
|
|
15
|
+
});
|
|
18
16
|
//# sourceMappingURL=Nullable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nullable.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/Nullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Nullable.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/Nullable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,MAAM,UAAU,GAAG,QAAQ,CAAC;AAQ5B,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,CAAyC,KAAkB,EAAE,EAAE;IAC9G,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,EAAC,GAAG,KAAK,CAAC;IAC7F,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IAEjB,MAAM,YAAY,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IACzD,MAAM,eAAe,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAElG,MAAM,WAAW,GAA2B,CAAC,GAAG,IAAI,CAAC,CAAC;IACtD,WAAW,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IAE1D,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEvJ,OAAO,oBAAC,UAAU,IAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,KAAM,SAAS,GAAI,CAAC;AAC3I,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { LabeledValue } from "antd/es/select";
|
|
3
2
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
|
-
import { Nullable } from "./Nullable";
|
|
5
|
-
import { InitialNullable } from "./InitialNullable";
|
|
6
|
-
import { Map } from "./Map";
|
|
7
3
|
import "./index.less";
|
|
8
4
|
export interface BaseProps<Enum extends string | boolean | number> {
|
|
9
5
|
list: readonly Enum[];
|
|
@@ -20,14 +16,8 @@ export interface BaseProps<Enum extends string | boolean | number> {
|
|
|
20
16
|
}
|
|
21
17
|
export interface Props<Enum extends string | boolean | number> extends BaseProps<Enum>, ControlledFormValue<Enum> {
|
|
22
18
|
}
|
|
23
|
-
export declare
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
static InitialNullable: typeof InitialNullable;
|
|
29
|
-
static Map: typeof Map;
|
|
30
|
-
getAntSelectValue: () => LabeledValue | undefined;
|
|
31
|
-
onChange: ({ value: antValue }: LabeledValue) => void;
|
|
32
|
-
render(): React.JSX.Element;
|
|
33
|
-
}
|
|
19
|
+
export declare const EnumSelect: (<Enum extends string | boolean | number>(props: Props<Enum>) => React.JSX.Element) & {
|
|
20
|
+
Nullable: <Enum extends string | boolean | number>(props: import("./Nullable").Props<Enum>) => React.JSX.Element;
|
|
21
|
+
InitialNullable: <Enum extends string | boolean | number>({ value, ...restProps }: import("./InitialNullable").Props<Enum>) => React.JSX.Element;
|
|
22
|
+
Map: <T extends string>({ map, ...restProps }: import("./Map").Props<T>) => React.JSX.Element;
|
|
23
|
+
};
|
package/core/EnumSelect/index.js
CHANGED
|
@@ -4,25 +4,20 @@ import { Nullable } from "./Nullable";
|
|
|
4
4
|
import { InitialNullable } from "./InitialNullable";
|
|
5
5
|
import { Map } from "./Map";
|
|
6
6
|
import "./index.less";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const value = this.props.value;
|
|
16
|
-
if (value === null) {
|
|
17
|
-
// Special case for InitialNullable, to show placeholder, no pre-selection
|
|
7
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
8
|
+
const TRUE_VALUE = "@@TRUE";
|
|
9
|
+
const FALSE_VALUE = "@@FALSE";
|
|
10
|
+
export const EnumSelect = ReactUtil.compound("EnumSelect", { Nullable, InitialNullable, Map }, (props) => {
|
|
11
|
+
const { list, value, translator, prefix, onChange, disabled, className = "", style, dropdownStyle, listHeight, listItemHeight, placeholder, suffixIcon } = props;
|
|
12
|
+
const getAntSelectValue = () => {
|
|
13
|
+
// Special case for InitialNullable, to show placeholder, no pre-selection
|
|
14
|
+
if (value === null)
|
|
18
15
|
return undefined;
|
|
19
|
-
}
|
|
20
|
-
const { translator, prefix } = this.props;
|
|
21
16
|
const antValue = value.toString();
|
|
22
17
|
let antLabel = translator ? translator(value) : antValue;
|
|
23
18
|
if (prefix) {
|
|
24
19
|
antLabel = (React.createElement("div", { className: "prefixed-label-wrapper" },
|
|
25
|
-
|
|
20
|
+
prefix,
|
|
26
21
|
antLabel));
|
|
27
22
|
}
|
|
28
23
|
return {
|
|
@@ -30,18 +25,15 @@ export class EnumSelect extends React.PureComponent {
|
|
|
30
25
|
label: antLabel,
|
|
31
26
|
};
|
|
32
27
|
};
|
|
33
|
-
|
|
34
|
-
const enumValue = antValue ===
|
|
35
|
-
|
|
28
|
+
const onAntChange = ({ value: antValue }) => {
|
|
29
|
+
const enumValue = antValue === TRUE_VALUE ? true : antValue === FALSE_VALUE ? false : antValue;
|
|
30
|
+
onChange(enumValue);
|
|
36
31
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
32
|
+
return (React.createElement(Select, { disabled: disabled, labelInValue: true, value: getAntSelectValue(), onChange: onAntChange, className: `g-enum-select ${className}`, listHeight: listHeight, listItemHeight: listItemHeight, style: style, styles: { popup: { root: dropdownStyle } }, placeholder: prefix ? (React.createElement("div", { className: "prefixed-placeholder-wrapper" },
|
|
33
|
+
prefix,
|
|
34
|
+
placeholder)) : (placeholder), suffixIcon: suffixIcon, optionLabelProp: prefix ? "label" : undefined }, list.map(_ => {
|
|
35
|
+
const label = translator ? translator(_) : _.toString();
|
|
36
|
+
return (React.createElement(Select.Option, { title: null, key: _.toString(), value: _ === true ? TRUE_VALUE : _ === false ? FALSE_VALUE : _, label: label }, label));
|
|
37
|
+
})));
|
|
38
|
+
});
|
|
47
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/EnumSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,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,CAAC,MAAM,IAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,IACtH,KAAK,CACM,CACnB,CAAC;IACN,CAAC,CAAC,CACG,CACZ,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { classNames } from "../../../../util/ClassNames";
|
|
3
3
|
import { Loader } from "../../shared/Loader";
|
|
4
|
+
import { ReactUtil } from "../../../../util/ReactUtil";
|
|
4
5
|
import "./index.less";
|
|
5
|
-
export const Footer = ({ loading, hasNextPage, hasNextPageMessage, endOfListMessage }) => {
|
|
6
|
+
export const Footer = ReactUtil.memo("Footer", ({ loading, hasNextPage, hasNextPageMessage, endOfListMessage }) => {
|
|
6
7
|
const ref = React.useRef(null);
|
|
7
8
|
const end = endOfListMessage ?? "All data loaded";
|
|
8
9
|
const next = hasNextPageMessage ?? "Pull up to load more";
|
|
9
10
|
return (React.createElement("div", { ref: ref, className: classNames("g-flat-list-footer", { loading }) }, loading ? React.createElement(Loader, null) : hasNextPage ? next : end));
|
|
10
|
-
};
|
|
11
|
+
});
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/FlatList/Content/Footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,cAAc,CAAC;AAQtB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAQ,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/FlatList/Content/Footer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,cAAc,CAAC;AAQtB,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAQ,EAAE,EAAE;IACnH,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,gBAAgB,IAAI,iBAAiB,CAAC;IAClD,MAAM,IAAI,GAAG,kBAAkB,IAAI,sBAAsB,CAAC;IAE1D,OAAO,CACH,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,EAAC,OAAO,EAAC,CAAC,IAChE,OAAO,CAAC,CAAC,CAAC,oBAAC,MAAM,OAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAC9C,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@ import type { FlatListProps } from "../type";
|
|
|
3
3
|
interface Props<T> extends Pick<FlatListProps<T>, "data" | "renderItem" | "gap" | "emptyPlaceholder" | "rowKey" | "endOfListMessage" | "onPullUpLoading" | "endReachThreshold" | "loading"> {
|
|
4
4
|
hasNextPageMessage?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const Content: <T extends object>(props: Props<T>) => React.JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Footer } from "./Footer";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const markerId = React.useRef(createKey());
|
|
7
|
-
const { first, second } = React.useMemo(() => splitByLast(data, endReachThreshold), [data, endReachThreshold]);
|
|
3
|
+
import { ReactUtil } from "../../../util/ReactUtil";
|
|
4
|
+
export const Content = ReactUtil.memo("Content", (props) => {
|
|
5
|
+
const { data, emptyPlaceholder, renderItem, gap, rowKey, loading = false, endOfListMessage, onPullUpLoading, hasNextPageMessage, endReachThreshold = 4 } = props;
|
|
8
6
|
const [dataKey, setDataKey] = React.useState(createKey());
|
|
9
|
-
const
|
|
7
|
+
const markerId = React.useRef(createKey());
|
|
10
8
|
const previousMarker = React.useRef(null);
|
|
11
9
|
const onPullUpLoadingRef = React.useRef(onPullUpLoading);
|
|
10
|
+
const loadedDataKey = React.useRef(createKey());
|
|
11
|
+
const itemStyle = useGap(gap);
|
|
12
12
|
onPullUpLoadingRef.current = onPullUpLoading;
|
|
13
|
+
React.useEffect(() => setDataKey(createKey()), [data]);
|
|
14
|
+
const { first, second } = React.useMemo(() => splitByLast(data, endReachThreshold), [data, endReachThreshold]);
|
|
13
15
|
const observer = React.useMemo(() => new IntersectionObserver(mutations => {
|
|
14
16
|
const mutation = mutations[0];
|
|
15
17
|
if (!mutation.isIntersecting)
|
|
@@ -27,8 +29,8 @@ export function Content({ data, emptyPlaceholder, renderItem, gap, rowKey, loadi
|
|
|
27
29
|
previousMarker.current = node;
|
|
28
30
|
}
|
|
29
31
|
};
|
|
30
|
-
React.useEffect(() => setDataKey(createKey()), [data]);
|
|
31
32
|
const createItem = (source) => {
|
|
33
|
+
const Item = renderItem;
|
|
32
34
|
return source.map(({ data, index }) => (React.createElement("div", { className: "g-flat-list-item", key: rowKey === "index" ? index : String(data[rowKey]), style: itemStyle },
|
|
33
35
|
React.createElement(Item, { data: data, index: index }))));
|
|
34
36
|
};
|
|
@@ -37,7 +39,7 @@ export function Content({ data, emptyPlaceholder, renderItem, gap, rowKey, loadi
|
|
|
37
39
|
React.createElement("div", { key: markerId.current, ref: markerRef, id: markerId.current, "data-key": dataKey }),
|
|
38
40
|
createItem(second),
|
|
39
41
|
data.length > 0 && React.createElement(Footer, { loading: loading, hasNextPage: onPullUpLoading !== undefined, endOfListMessage: endOfListMessage, hasNextPageMessage: hasNextPageMessage })))));
|
|
40
|
-
}
|
|
42
|
+
});
|
|
41
43
|
function useGap(gap) {
|
|
42
44
|
if (!gap)
|
|
43
45
|
return {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/Content/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/Content/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAMlD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAmB,KAAe,EAAE,EAAE;IACnF,MAAM,EAAC,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,GAAG,CAAC,EAAC,GAAG,KAAK,CAAC;IAC/J,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC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C,CAAC;AAClE,CAAC;AAED,SAAS,SAAS;IACd,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { classNames } from "../../../util/ClassNames";
|
|
3
3
|
import { Loader } from "../shared/Loader";
|
|
4
|
+
import { ReactUtil } from "../../../util/ReactUtil";
|
|
4
5
|
import "./index.less";
|
|
5
|
-
export const FloatingLoader = ({ show }) => {
|
|
6
|
+
export const FloatingLoader = ReactUtil.memo("FloatingLoader", ({ show }) => {
|
|
6
7
|
return (React.createElement("div", { className: classNames("g-flat-list-floating-loader", { show }) },
|
|
7
8
|
React.createElement(Loader, null)));
|
|
8
|
-
};
|
|
9
|
+
});
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/FloatingLoader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,cAAc,CAAC;AAMtB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAC,IAAI,EAAQ,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/FloatingLoader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,cAAc,CAAC;AAMtB,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,EAAC,IAAI,EAAQ,EAAE,EAAE;IAC7E,OAAO,CACH,6BAAK,SAAS,EAAE,UAAU,CAAC,6BAA6B,EAAE,EAAC,IAAI,EAAC,CAAC;QAC7D,oBAAC,MAAM,OAAG,CACR,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { classNames } from "../../../util/ClassNames";
|
|
3
3
|
import { Loader } from "../shared/Loader";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
|
|
5
|
+
import { ReactUtil } from "../../../util/ReactUtil";
|
|
6
|
+
export const Refresh = ReactUtil.memo("Refresh", ({ message, refreshing, ref }) => {
|
|
6
7
|
return (React.createElement("div", { ref: ref, className: classNames("g-flat-list-refresh", { refreshing }) }, refreshing ? React.createElement(Loader, null) : React.createElement("span", null, message ?? "release to refresh")));
|
|
7
|
-
};
|
|
8
|
+
});
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/Refresh/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExC,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/FlatList/Refresh/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAQlD,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAQ,EAAE,EAAE;IACnF,OAAO,CACH,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAC,UAAU,EAAC,CAAC,IACpE,UAAU,CAAC,CAAC,CAAC,oBAAC,MAAM,OAAG,CAAC,CAAC,CAAC,kCAAO,OAAO,IAAI,oBAAoB,CAAQ,CACvE,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/core/FlatList/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import React from "react";
|
|
|
2
2
|
import type { FlatListProps } from "./type";
|
|
3
3
|
import "./index.less";
|
|
4
4
|
export * from "./type";
|
|
5
|
-
export declare const FlatList: <T>({ renderItem, data, rowKey, id, className, gap, refreshing: exactRefreshing, loading, onPullDownRefresh, onPullUpLoading, endReachThreshold, emptyPlaceholder, pullDownMessage, pullUpMessage, endOfListMessage, style, wrapperStyle, }: FlatListProps<T>) => React.JSX.Element;
|
|
5
|
+
export declare const FlatList: <T extends object>({ renderItem, data, rowKey, id, className, gap, refreshing: exactRefreshing, loading, onPullDownRefresh, onPullUpLoading, endReachThreshold, emptyPlaceholder, pullDownMessage, pullUpMessage, endOfListMessage, style, wrapperStyle, }: FlatListProps<T>) => React.JSX.Element;
|
package/core/FlatList/index.js
CHANGED
|
@@ -5,23 +5,26 @@ import { useScrollListSwipe } from "./hook/useScrollListSwipe";
|
|
|
5
5
|
import { Content } from "./Content";
|
|
6
6
|
import { FloatingLoader } from "./FloatingLoader";
|
|
7
7
|
import { Refresh } from "./Refresh";
|
|
8
|
-
import "./index.less";
|
|
9
8
|
import { useRefreshing } from "./hook/useRefreshing";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
10
11
|
export * from "./type";
|
|
11
12
|
const PULL_DOWN_REFRESH_THRESHOLD = 50;
|
|
12
|
-
export const FlatList =
|
|
13
|
+
export const FlatList = ReactUtil.memo("FlatList", ({ renderItem, data, rowKey, id, className, gap, refreshing: exactRefreshing, loading, onPullDownRefresh, onPullUpLoading, endReachThreshold, emptyPlaceholder, pullDownMessage, pullUpMessage, endOfListMessage, style, wrapperStyle, }) => {
|
|
14
|
+
const refreshing = useRefreshing(exactRefreshing ?? false, 1000);
|
|
15
|
+
const [showFloatingLoader, setShowFloatingLoader] = React.useState(refreshing);
|
|
13
16
|
const scrollRef = React.useRef(null);
|
|
14
17
|
const animatedRef = React.useRef(null);
|
|
15
18
|
const refreshHeight = React.useRef(0);
|
|
16
19
|
const previousBoundary = React.useRef(null);
|
|
17
|
-
const refreshing = useRefreshing(exactRefreshing ?? false, 1000);
|
|
18
|
-
const [showFloatingLoader, setShowFloatingLoader] = React.useState(refreshing);
|
|
19
20
|
const transit = useTransform(animatedRef, {
|
|
20
21
|
timingFunction: "cubic-bezier(0, 0.89, 0.26, 1.02)",
|
|
21
22
|
duration: 800,
|
|
22
23
|
});
|
|
23
24
|
const transitRef = React.useRef(transit);
|
|
24
|
-
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
transitRef.current = transit;
|
|
27
|
+
}, [transit]);
|
|
25
28
|
const bind = useScrollListSwipe({
|
|
26
29
|
scrollElementRef: scrollRef,
|
|
27
30
|
onStart: ({ boundary }) => {
|
|
@@ -45,9 +48,7 @@ export const FlatList = function ({ renderItem, data, rowKey, id, className, gap
|
|
|
45
48
|
}, []);
|
|
46
49
|
const handleScroll = () => {
|
|
47
50
|
transit.clear();
|
|
48
|
-
|
|
49
|
-
setShowFloatingLoader(true);
|
|
50
|
-
}
|
|
51
|
+
refreshing && setShowFloatingLoader(true);
|
|
51
52
|
};
|
|
52
53
|
React.useEffect(() => {
|
|
53
54
|
if (refreshing) {
|
|
@@ -71,5 +72,5 @@ export const FlatList = function ({ renderItem, data, rowKey, id, className, gap
|
|
|
71
72
|
React.createElement(Refresh, { ref: updateRefreshHeight, refreshing: refreshing, message: pullDownMessage }))),
|
|
72
73
|
React.createElement("div", { className: "g-flat-list-scrollable", ref: scrollRef, style: style, onScroll: handleScroll },
|
|
73
74
|
React.createElement(Content, { data: data, rowKey: rowKey, renderItem: renderItem, gap: gap, emptyPlaceholder: emptyPlaceholder, loading: loading, endOfListMessage: endOfListMessage, hasNextPageMessage: pullUpMessage, onPullUpLoading: !exactRefreshing ? onPullUpLoading : undefined, endReachThreshold: endReachThreshold })))));
|
|
74
|
-
};
|
|
75
|
+
});
|
|
75
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/FlatList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/FlatList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AA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E,IAAI,EACV,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,EACR,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,aAAa,EACjC,eAAe,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EAC/D,iBAAiB,EAAE,iBAAiB,GACtC,CACA,CACJ,CACJ,CACT,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ReactUtil } from "../../../../util/ReactUtil";
|
|
2
3
|
import "./index.less";
|
|
3
|
-
export const Loader = () => {
|
|
4
|
+
export const Loader = ReactUtil.memo("Loader", () => {
|
|
4
5
|
return (React.createElement("div", { className: "g-flat-list-loader" },
|
|
5
6
|
React.createElement("div", { className: "dot" }),
|
|
6
7
|
React.createElement("div", { className: "dot" }),
|
|
7
8
|
React.createElement("div", { className: "dot" })));
|
|
8
|
-
};
|
|
9
|
+
});
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/FlatList/shared/Loader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/FlatList/shared/Loader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AACrD,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IAChD,OAAO,CACH,6BAAK,SAAS,EAAC,oBAAoB;QAC/B,6BAAK,SAAS,EAAC,KAAK,GAAG;QACvB,6BAAK,SAAS,EAAC,KAAK,GAAG;QACvB,6BAAK,SAAS,EAAC,KAAK,GAAG,CACrB,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/core/Form/Item.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FormValidationContext } from "./context";
|
|
3
2
|
export type FormValidator = () => string | null | Promise<string | null>;
|
|
4
3
|
export interface Props {
|
|
5
4
|
children: React.ReactNode;
|
|
@@ -11,18 +10,4 @@ export interface Props {
|
|
|
11
10
|
labelStyle?: React.CSSProperties;
|
|
12
11
|
widthMode?: "fill" | "auto" | "shrink";
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
errorMessage: string | null;
|
|
16
|
-
}
|
|
17
|
-
export declare class Item extends React.PureComponent<Props, State> {
|
|
18
|
-
static displayName: string;
|
|
19
|
-
static contextType: React.Context<import("./context").FormValidationContextType>;
|
|
20
|
-
context: React.ContextType<typeof FormValidationContext>;
|
|
21
|
-
private readonly overlayStyle;
|
|
22
|
-
constructor(props: Props);
|
|
23
|
-
componentDidMount(): void;
|
|
24
|
-
componentWillUnmount(): void;
|
|
25
|
-
validate: () => Promise<boolean>;
|
|
26
|
-
render(): React.JSX.Element;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
13
|
+
export declare const Item: (props: Props) => React.JSX.Element;
|