@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":"TablePopover.js","sourceRoot":"","sources":["../../../src/core/MultipleSelector/TablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TablePopover.js","sourceRoot":"","sources":["../../../src/core/MultipleSelector/TablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAYhE,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,CAAyB,KAAqB,EAAE,EAAE;IACzG,MAAM,EAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IAElH,iBAAiB,CAAC,GAAG,EAAE;QACnB,aAAa,EAAE,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,CAAC,IAAa,EAAU,EAAE;QACxC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,MAAM,CAAS,CAAC;IAC/E,CAAC,CAA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S;QACX,CAAC,CAAC;YACI,eAAe;YACf,QAAQ,EAAE,WAAuC;SACpD,CAAC;IACR,MAAM,KAAK,GAAG,oBAAC,KAAK,IAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAC,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,GAAG,CAAC;IAC5J,OAAO,6BAAK,SAAS,EAAC,mCAAmC,IAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAO,CAAC;AACzG,CAAC,CAAC,CAAC"}
|
|
@@ -24,12 +24,4 @@ export interface Props<RowType extends object> extends ControlledFormValue<RowTy
|
|
|
24
24
|
popoverOpen?: boolean;
|
|
25
25
|
onPopoverOpenChange?: (open: boolean) => void;
|
|
26
26
|
}
|
|
27
|
-
export declare
|
|
28
|
-
static displayName: string;
|
|
29
|
-
buttonText: () => string;
|
|
30
|
-
onClose: (index: number) => void;
|
|
31
|
-
renderSelectedAsTags: (labels: string[]) => React.JSX.Element;
|
|
32
|
-
renderSelectedItems: () => React.JSX.Element | undefined;
|
|
33
|
-
renderPopover: () => React.JSX.Element;
|
|
34
|
-
render(): React.JSX.Element;
|
|
35
|
-
}
|
|
27
|
+
export declare const MultipleSelector: <RowType extends object>(props: Props<RowType>) => React.JSX.Element;
|
|
@@ -5,52 +5,44 @@ import { Tags } from "../Tags";
|
|
|
5
5
|
import { i18n } from "../../internal/i18n/core";
|
|
6
6
|
import { TextUtil } from "../../internal/TextUtil";
|
|
7
7
|
import { TablePopover } from "./TablePopover";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const length = value.length;
|
|
8
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
9
|
+
export const MultipleSelector = ReactUtil.memo("MultipleSelector", (props) => {
|
|
10
|
+
const { value, onChange, renderButtonText, renderTags, popoverPlacement, disabled, popoverClassName, popoverStyle, popoverOpen, onPopoverOpenChange, onPopoverFirstRender, dataSource, tableColumns, rowKey, scrollY, } = props;
|
|
11
|
+
const t = i18n();
|
|
12
|
+
const buttonText = () => {
|
|
14
13
|
if (renderButtonText) {
|
|
15
|
-
return typeof renderButtonText === "string" ? renderButtonText : renderButtonText(length);
|
|
14
|
+
return typeof renderButtonText === "string" ? renderButtonText : renderButtonText(value.length);
|
|
16
15
|
}
|
|
17
16
|
else {
|
|
18
17
|
return value.length === 0 ? t.select : TextUtil.interpolate(t.edit, value.length.toString());
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
|
-
onClose = (index) => {
|
|
22
|
-
const { value, onChange } = this.props;
|
|
20
|
+
const onClose = (index) => {
|
|
23
21
|
const newValue = [...value];
|
|
24
22
|
newValue.splice(index, 1);
|
|
25
23
|
onChange(newValue);
|
|
26
24
|
};
|
|
27
|
-
renderSelectedAsTags = (labels) => {
|
|
28
|
-
const { disabled } = this.props;
|
|
25
|
+
const renderSelectedAsTags = (labels) => {
|
|
29
26
|
return (React.createElement("div", { className: "g-multiple-selector-selected-tags" },
|
|
30
|
-
React.createElement(Tags, { maxWidth: 600, color: "blue", items: labels, onClose: disabled ? undefined :
|
|
27
|
+
React.createElement(Tags, { maxWidth: 600, color: "blue", items: labels, onClose: disabled ? undefined : onClose, useItemsAsKey: true })));
|
|
31
28
|
};
|
|
32
|
-
renderSelectedItems = () => {
|
|
33
|
-
const { value, renderTags } = this.props;
|
|
29
|
+
const renderSelectedItems = () => {
|
|
34
30
|
if (renderTags) {
|
|
35
31
|
if (typeof renderTags === "function") {
|
|
36
32
|
const renderedResult = renderTags(value);
|
|
37
|
-
return Array.isArray(renderedResult) ?
|
|
33
|
+
return Array.isArray(renderedResult) ? renderSelectedAsTags(renderedResult) : renderedResult;
|
|
38
34
|
}
|
|
39
35
|
else {
|
|
40
|
-
return
|
|
36
|
+
return renderSelectedAsTags(value.map(_ => _[renderTags]));
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
|
-
renderPopover = () => {
|
|
45
|
-
const { renderPopover, value, onChange, disabled, onPopoverFirstRender, dataSource, tableColumns, rowKey, scrollY } = this.props;
|
|
40
|
+
const renderPopover = () => {
|
|
46
41
|
return (React.createElement(TablePopover, { dataSource: dataSource, columns: tableColumns, rowKey: rowKey, value: value, onChange: onChange, onFirstRender: onPopoverFirstRender, selectionDisabled: disabled === "table", scrollY: scrollY || 500 }, renderPopover));
|
|
47
42
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
React.createElement(Button, { disabled: disabled === "button" }, this.buttonText()))));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
43
|
+
return (React.createElement("div", { className: "g-multiple-selector" },
|
|
44
|
+
renderSelectedItems(),
|
|
45
|
+
React.createElement(Popover, { placement: popoverPlacement || "bottomLeft", trigger: "click", content: renderPopover(), classNames: { root: popoverClassName }, styles: { root: popoverStyle }, open: popoverOpen, onOpenChange: onPopoverOpenChange },
|
|
46
|
+
React.createElement(Button, { disabled: disabled === "button" }, buttonText()))));
|
|
47
|
+
});
|
|
56
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MultipleSelector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAA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AK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,oBAAoB,EACnC,iBAAiB,EAAE,QAAQ,KAAK,OAAO,EACvC,OAAO,EAAE,OAAO,IAAI,GAAG,IAEtB,aAAa,CACH,CAClB,CAAC;IACN,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAC,qBAAqB;QAC/B,mBAAmB,EAAE;QACtB,oBAAC,OAAO,IACJ,SAAS,EAAE,gBAAgB,IAAI,YAAY,EAC3C,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,aAAa,EAAE,EACxB,UAAU,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EACpC,MAAM,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC,EAC5B,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,mBAAmB;YAEjC,oBAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,KAAK,QAAQ,IAAG,UAAU,EAAE,CAAU,CAC1D,CACR,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { TableColumns } from "../Table";
|
|
3
|
-
import type { PickOptional } from "../../internal/type";
|
|
4
3
|
import "./index.less";
|
|
5
4
|
/**
|
|
6
5
|
* A MutableTable is a table supporting add/minus rows.
|
|
@@ -30,15 +29,4 @@ export interface Props<RowType extends object> {
|
|
|
30
29
|
bordered?: boolean;
|
|
31
30
|
disabled?: boolean;
|
|
32
31
|
}
|
|
33
|
-
export declare
|
|
34
|
-
static displayName: string;
|
|
35
|
-
static defaultProps: PickOptional<Props<any>>;
|
|
36
|
-
private readonly ref;
|
|
37
|
-
private readonly defaultSequenceColumn;
|
|
38
|
-
constructor(props: Props<RowType>);
|
|
39
|
-
componentDidUpdate(prevProps: Props<RowType>): void;
|
|
40
|
-
getColumns: () => TableColumns<RowType>;
|
|
41
|
-
onDeleteRow: (index: number) => void;
|
|
42
|
-
onAddRow: (nextRow: RowType | true) => void;
|
|
43
|
-
render(): React.JSX.Element;
|
|
44
|
-
}
|
|
32
|
+
export declare const MutableTable: <RowType extends object>(props: Props<RowType>) => React.JSX.Element;
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Table } from "../Table";
|
|
3
3
|
import { i18n } from "../../internal/i18n/core";
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
5
|
import "./index.less";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
super(props);
|
|
19
|
-
this.ref = React.createRef();
|
|
20
|
-
}
|
|
21
|
-
componentDidUpdate(prevProps) {
|
|
22
|
-
if (prevProps.dataSource.length < this.props.dataSource.length && Number(this.props.scrollY) > 0) {
|
|
23
|
-
const tableContainerRef = this.ref.current.querySelector(".ant-table-body");
|
|
6
|
+
const defaultSequenceColumn = {
|
|
7
|
+
title: i18n().sequence,
|
|
8
|
+
renderer: (index) => (index + 1).toString(),
|
|
9
|
+
width: 90,
|
|
10
|
+
align: "center",
|
|
11
|
+
};
|
|
12
|
+
export const MutableTable = ReactUtil.memo("MutableTable", (props) => {
|
|
13
|
+
const { dataSource, shouldRenderIfUpdate, scrollX = "none", scrollY, bordered, columns, sequenceColumn, fixedRowCount, disabled, nextRow, onChange, onRowCountChange } = props;
|
|
14
|
+
const previousDataSourceLength = React.useRef(dataSource.length);
|
|
15
|
+
const ref = React.useRef(null);
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (previousDataSourceLength.current < dataSource.length && Number(scrollY) > 0) {
|
|
18
|
+
const tableContainerRef = ref.current.querySelector(".ant-table-body");
|
|
24
19
|
if (tableContainerRef) {
|
|
25
20
|
tableContainerRef.scrollTop = tableContainerRef.scrollHeight;
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
previousDataSourceLength.current = dataSource.length;
|
|
24
|
+
}, [dataSource.length, scrollY]);
|
|
25
|
+
const getColumns = () => {
|
|
31
26
|
const newColumns = [...columns];
|
|
32
27
|
const t = i18n();
|
|
33
28
|
if (sequenceColumn) {
|
|
34
|
-
const finalSequenceColumn = sequenceColumn === "default" ?
|
|
29
|
+
const finalSequenceColumn = sequenceColumn === "default" ? defaultSequenceColumn : { ...defaultSequenceColumn, ...sequenceColumn };
|
|
35
30
|
newColumns.unshift({
|
|
36
31
|
title: finalSequenceColumn.title,
|
|
37
32
|
width: finalSequenceColumn.width,
|
|
@@ -48,14 +43,13 @@ export class MutableTable extends React.PureComponent {
|
|
|
48
43
|
renderData: (_, index) => {
|
|
49
44
|
const dataSourceLength = dataSource.length;
|
|
50
45
|
return (React.createElement("div", { className: "operation" },
|
|
51
|
-
(!fixedRowCount || fixedRowCount <= index) && (React.createElement("button", { type: "button", disabled: disabled || dataSourceLength === 1, onClick: () =>
|
|
52
|
-
index === dataSourceLength - 1 && (React.createElement("button", { disabled: disabled || nextRow === undefined, type: "button", onClick: () =>
|
|
46
|
+
(!fixedRowCount || fixedRowCount <= index) && (React.createElement("button", { type: "button", disabled: disabled || dataSourceLength === 1, onClick: () => onDeleteRow(index) }, "\uFF0D")),
|
|
47
|
+
index === dataSourceLength - 1 && (React.createElement("button", { disabled: disabled || nextRow === undefined, type: "button", onClick: () => onAddRow(nextRow) }, "\uFF0B"))));
|
|
53
48
|
},
|
|
54
49
|
});
|
|
55
50
|
return newColumns;
|
|
56
51
|
};
|
|
57
|
-
onDeleteRow = (index) => {
|
|
58
|
-
const { dataSource, onChange, onRowCountChange } = this.props;
|
|
52
|
+
const onDeleteRow = (index) => {
|
|
59
53
|
if (onRowCountChange) {
|
|
60
54
|
onRowCountChange("remove-row");
|
|
61
55
|
}
|
|
@@ -65,8 +59,7 @@ export class MutableTable extends React.PureComponent {
|
|
|
65
59
|
onChange(newData);
|
|
66
60
|
}
|
|
67
61
|
};
|
|
68
|
-
onAddRow = (nextRow) => {
|
|
69
|
-
const { dataSource, onChange, onRowCountChange } = this.props;
|
|
62
|
+
const onAddRow = (nextRow) => {
|
|
70
63
|
if (onRowCountChange) {
|
|
71
64
|
onRowCountChange("add-row");
|
|
72
65
|
}
|
|
@@ -76,10 +69,7 @@ export class MutableTable extends React.PureComponent {
|
|
|
76
69
|
onChange(newData);
|
|
77
70
|
}
|
|
78
71
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
React.createElement(Table, { className: "g-mutable-table", scrollX: scrollX, scrollY: scrollY, rowKey: "index", columns: this.getColumns(), dataSource: dataSource, shouldRenderIfUpdate: shouldRenderIfUpdate, bordered: bordered })));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
72
|
+
return (React.createElement("div", { className: "g-mutable-table-wrapper", ref: ref },
|
|
73
|
+
React.createElement(Table, { className: "g-mutable-table", scrollX: scrollX, scrollY: scrollY, rowKey: "index", columns: getColumns(), dataSource: dataSource, shouldRenderIfUpdate: shouldRenderIfUpdate, bordered: bordered })));
|
|
74
|
+
});
|
|
85
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MutableTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MutableTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;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AQ,EAAE,QAAQ,GACpB,CACA,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { PickOptional } from "../../internal/type";
|
|
3
2
|
import type { Props as NumberInputProps } from "./index";
|
|
4
3
|
type OmitPropsKeys = "displayRenderer" | "scale" | "step" | "min" | "max" | "value" | "onChange";
|
|
5
4
|
export interface Props<AllowNull extends boolean> extends Omit<NumberInputProps<AllowNull>, OmitPropsKeys> {
|
|
@@ -48,11 +47,5 @@ export interface Props<AllowNull extends boolean> extends Omit<NumberInputProps<
|
|
|
48
47
|
*/
|
|
49
48
|
onChange: (newValue: AllowNull extends true ? number | null : number) => void;
|
|
50
49
|
}
|
|
51
|
-
export declare
|
|
52
|
-
static displayName: string;
|
|
53
|
-
static defaultProps: PickOptional<Props<any>>;
|
|
54
|
-
percentageDisplayRenderer: (value: number) => string;
|
|
55
|
-
onPercentageChange: Props<AllowNull>["onChange"];
|
|
56
|
-
render(): React.JSX.Element;
|
|
57
|
-
}
|
|
50
|
+
export declare const NumberInputPercentage: <AllowNull extends boolean>(props: Props<AllowNull>) => React.JSX.Element;
|
|
58
51
|
export {};
|
|
@@ -2,32 +2,15 @@ import React from "react";
|
|
|
2
2
|
import { classNames } from "../../util/ClassNames";
|
|
3
3
|
import { NumberInput } from "./index";
|
|
4
4
|
import { truncate } from "./util";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
max: 1,
|
|
11
|
-
};
|
|
12
|
-
percentageDisplayRenderer = (value) => {
|
|
13
|
-
const percentageValue = value;
|
|
14
|
-
const percentageScale = this.props.percentageScale;
|
|
15
|
-
return `${percentageValue.toFixed(percentageScale)} %`;
|
|
16
|
-
};
|
|
17
|
-
onPercentageChange = newPercentageValue => {
|
|
18
|
-
const scale = this.props.percentageScale + 2;
|
|
19
|
-
const onChange = this.props.onChange;
|
|
5
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
6
|
+
export const NumberInputPercentage = ReactUtil.memo("NumberInputPercentage", (props) => {
|
|
7
|
+
const { value, percentageScale = 0, percentageStep, min = 0, max = 1, onChange, className, ...restProps } = props;
|
|
8
|
+
const onPercentageChange = newPercentageValue => {
|
|
9
|
+
const scale = percentageScale + 2;
|
|
20
10
|
const newValue = typeof newPercentageValue === "number" ? truncate(newPercentageValue / 100, scale) : newPercentageValue;
|
|
21
11
|
onChange(newValue);
|
|
22
12
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
onChange, className, ...restProps } = this.props;
|
|
27
|
-
const percentageValue = (typeof value === "number" ? value * 100 : value);
|
|
28
|
-
const percentageMin = min * 100;
|
|
29
|
-
const percentageMax = max * 100;
|
|
30
|
-
return (React.createElement(NumberInput, { className: classNames("percentage", className), value: percentageValue, onChange: this.onPercentageChange, min: percentageMin, max: percentageMax, scale: percentageScale, step: percentageStep, displayRenderer: this.percentageDisplayRenderer, ...restProps }));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
13
|
+
const percentageValue = (typeof value === "number" ? value * 100 : value);
|
|
14
|
+
return (React.createElement(NumberInput, { className: classNames("percentage", className), value: percentageValue, onChange: onPercentageChange, min: min * 100, max: max * 100, scale: percentageScale, step: percentageStep, displayRenderer: _ => `${_.toFixed(percentageScale)} %`, ...restProps }));
|
|
15
|
+
});
|
|
33
16
|
//# sourceMappingURL=NumberInputPercentage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputPercentage.js","sourceRoot":"","sources":["../../../src/core/NumberInput/NumberInputPercentage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|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AAG,EAAE,GAAG,GAAG,GAAG,EACd,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,cAAc,EACpB,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,KACnD,SAAS,GACf,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FocusType } from "../Input";
|
|
3
|
-
import {
|
|
4
|
-
import type { InputRef as AntInputRef } from "antd/es";
|
|
3
|
+
import type { InputRef } from "antd/es";
|
|
5
4
|
import type { ControlledFormValue } from "../../internal/type";
|
|
6
5
|
import "./index.less";
|
|
7
|
-
type
|
|
8
|
-
type PropsWithDefault<AllowNull extends boolean = true> = {
|
|
9
|
-
[K in Exclude<keyof Props<AllowNull>, DefaultPropsKeys>]: Props<AllowNull>[K];
|
|
10
|
-
} & {
|
|
11
|
-
[K in DefaultPropsKeys]: NonNullable<Props<AllowNull>[K]>;
|
|
12
|
-
};
|
|
13
|
-
export type InputRef = AntInputRef;
|
|
6
|
+
export type { InputRef };
|
|
14
7
|
export interface Props<AllowNull extends boolean> extends ControlledFormValue<AllowNull extends true ? number | null : number> {
|
|
15
8
|
/** Whether `null` is allowed in `value` */
|
|
16
9
|
allowNull: AllowNull;
|
|
@@ -49,27 +42,6 @@ export interface Props<AllowNull extends boolean> extends ControlledFormValue<Al
|
|
|
49
42
|
/** Set cursor and input behavior when focus */
|
|
50
43
|
focus?: FocusType;
|
|
51
44
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
export declare class NumberInput<AllowNull extends boolean> extends React.PureComponent<Props<AllowNull>, State> {
|
|
57
|
-
static displayName: string;
|
|
58
|
-
static defaultProps: Pick<Props<any>, DefaultPropsKeys>;
|
|
59
|
-
static Percentage: typeof NumberInputPercentage;
|
|
60
|
-
private inputRef;
|
|
61
|
-
constructor(props: PropsWithDefault<AllowNull>);
|
|
62
|
-
componentDidUpdate(prevProps: PropsWithDefault<AllowNull>): void;
|
|
63
|
-
getStep: () => number;
|
|
64
|
-
triggerParentOnChangeIfValid: (uncheckedValue: string) => void;
|
|
65
|
-
stopPropagation: (event: React.MouseEvent) => void;
|
|
66
|
-
onMinusClick: () => void;
|
|
67
|
-
onAddClick: () => void;
|
|
68
|
-
onInputFocus: () => void;
|
|
69
|
-
onInputBlur: () => void;
|
|
70
|
-
onInputChange: (newValue: string) => void;
|
|
71
|
-
onInputPress: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
72
|
-
render(): React.JSX.Element;
|
|
73
|
-
private get typeSafeProps();
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
45
|
+
export declare const NumberInput: (<AllowNull extends boolean>(props: Props<AllowNull>) => React.JSX.Element) & {
|
|
46
|
+
Percentage: <AllowNull extends boolean>(props: import("./NumberInputPercentage").Props<AllowNull>) => React.JSX.Element;
|
|
47
|
+
};
|
|
@@ -6,93 +6,65 @@ import { Space } from "../Space";
|
|
|
6
6
|
import { canAdd, canMinus, clamp, getDisplayValue, rectifyInputIfValid, truncate } from "./util";
|
|
7
7
|
import { NumberInputPercentage } from "./NumberInputPercentage";
|
|
8
8
|
import "./index.less";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
componentDidUpdate(prevProps) {
|
|
24
|
-
const { value, max, min, scale, onChange } = this.typeSafeProps;
|
|
25
|
-
const { isEditing } = this.state;
|
|
26
|
-
if (!isEditing && value !== prevProps.value) {
|
|
27
|
-
this.setState({ editingValue: value === null ? "" : truncate(value, scale).toString() });
|
|
28
|
-
}
|
|
29
|
-
const shouldCallOnChange = max < prevProps.max || min > prevProps.min || scale !== prevProps.scale;
|
|
9
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
10
|
+
export const NumberInput = ReactUtil.compound("NumberInput", {
|
|
11
|
+
Percentage: NumberInputPercentage,
|
|
12
|
+
}, (props) => {
|
|
13
|
+
const { value, allowNull, disabled, className, editable = true, stepperMode, placeholder, inputStyle, suffix, prefix, allowClear, inputRef, autoFocus, focus, scale = 0, min = -99_999_999, max = 99_999_999, step = truncate(10 ** (-1 * scale), scale), onChange, displayRenderer, } = props;
|
|
14
|
+
const [editingValue, setEditingValue] = React.useState(value !== null ? value.toFixed(scale) : "");
|
|
15
|
+
const [isEditing, setIsEditing] = React.useState(false);
|
|
16
|
+
const prevRef = React.useRef({ max, min, scale });
|
|
17
|
+
const ref = React.useRef(null);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
!isEditing && setEditingValue(value === null ? "" : truncate(value, scale).toString());
|
|
20
|
+
}, [isEditing, value, scale]);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const shouldCallOnChange = max < prevRef.current.max || min > prevRef.current.min || scale !== prevRef.current.scale;
|
|
30
23
|
if (shouldCallOnChange) {
|
|
31
24
|
value === null ? onChange(value) : onChange(clamp({ value: truncate(value, scale), min, max }));
|
|
32
25
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return truncate(10 ** (-1 * scale), scale);
|
|
40
|
-
};
|
|
41
|
-
triggerParentOnChangeIfValid = (uncheckedValue) => {
|
|
42
|
-
this.setState({ editingValue: uncheckedValue });
|
|
43
|
-
const typeSafeProps = this.typeSafeProps;
|
|
44
|
-
const { onChange, scale } = typeSafeProps;
|
|
45
|
-
const checkedValue = rectifyInputIfValid(uncheckedValue, typeSafeProps);
|
|
26
|
+
prevRef.current = { max, min, scale };
|
|
27
|
+
}, [max, min, scale, value, onChange]);
|
|
28
|
+
const triggerParentOnChangeIfValid = (uncheckedValue) => {
|
|
29
|
+
setEditingValue(uncheckedValue);
|
|
30
|
+
const checkedValue = rectifyInputIfValid(uncheckedValue, { min, max, scale, allowNull });
|
|
46
31
|
// if `null` is not allowed, `checkedValue` will be invalid
|
|
47
|
-
if (checkedValue === "@@INVALID")
|
|
32
|
+
if (checkedValue === "@@INVALID")
|
|
48
33
|
return;
|
|
49
|
-
|
|
50
|
-
const normalizedParentValue = typeSafeProps.value === null ? null : truncate(typeSafeProps.value, scale);
|
|
34
|
+
const normalizedParentValue = value === null ? null : truncate(value, scale);
|
|
51
35
|
// Only call onChange if values are different
|
|
52
36
|
if (checkedValue !== normalizedParentValue) {
|
|
53
37
|
onChange(checkedValue);
|
|
54
38
|
}
|
|
55
39
|
};
|
|
56
|
-
stopPropagation = (event) => event.stopPropagation();
|
|
57
|
-
onMinusClick = () => {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
const nextValue = parentValue === null ? 0 : parentValue - step; // parentValue is kept in sync with latest valid user input, safe to use the parentValue for stepping
|
|
61
|
-
this.triggerParentOnChangeIfValid(nextValue.toString()); // The value is checked excessively but it's better than having a unguarded class method
|
|
40
|
+
const stopPropagation = (event) => event.stopPropagation();
|
|
41
|
+
const onMinusClick = () => {
|
|
42
|
+
const nextValue = value === null ? 0 : value - step; // parentValue is kept in sync with latest valid user input, safe to use the parentValue for stepping
|
|
43
|
+
triggerParentOnChangeIfValid(nextValue.toString()); // The value is checked excessively but it's better than having a unguarded class method
|
|
62
44
|
};
|
|
63
|
-
onAddClick = () => {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const prevValue = parentValue === null ? 0 : parentValue + step; // parentValue is kept in sync with latest valid user input, safe to use the parentValue for stepping
|
|
67
|
-
this.triggerParentOnChangeIfValid(prevValue.toString()); // The value is checked excessively but it's better than having a unguarded class method
|
|
45
|
+
const onAddClick = () => {
|
|
46
|
+
const prevValue = value === null ? 0 : value + step; // parentValue is kept in sync with latest valid user input, safe to use the parentValue for stepping
|
|
47
|
+
triggerParentOnChangeIfValid(prevValue.toString()); // The value is checked excessively but it's better than having a unguarded class method
|
|
68
48
|
};
|
|
69
|
-
onInputFocus = () => {
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
const onInputFocus = () => {
|
|
50
|
+
setIsEditing(true);
|
|
51
|
+
setEditingValue(value === null ? "" : truncate(value, scale).toString());
|
|
72
52
|
};
|
|
73
|
-
onInputBlur = () => {
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
const onInputBlur = () => {
|
|
54
|
+
triggerParentOnChangeIfValid(editingValue);
|
|
55
|
+
setIsEditing(false);
|
|
76
56
|
};
|
|
77
|
-
onInputChange = (newValue) =>
|
|
78
|
-
|
|
57
|
+
const onInputChange = (newValue) => triggerParentOnChangeIfValid(newValue);
|
|
58
|
+
const onInputKeyDown = (event) => {
|
|
79
59
|
if (event.key === "Enter") {
|
|
80
|
-
(
|
|
60
|
+
(inputRef || ref).current?.blur();
|
|
81
61
|
}
|
|
82
62
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
stepperMode && (React.createElement(Button, { type: stepperMode === "no-border" ? "text" : "default", className: "add", disabled: disabled || !canAdd({ ...this.typeSafeProps, step: this.getStep() }), onClick: this.onAddClick }, "\uFF0B"))));
|
|
91
|
-
return stepperMode === "outlined" ? (React.createElement(Space.Compact, { className: containerClassName, onClick: this.stopPropagation }, content)) : (React.createElement(Space, { className: containerClassName, onClick: this.stopPropagation, size: 0 }, content));
|
|
92
|
-
}
|
|
93
|
-
get typeSafeProps() {
|
|
94
|
-
// Use a less restrictive type here (allow null) for type inference in various places to work
|
|
95
|
-
return this.props;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
63
|
+
const containerClassName = classNames("g-number-input", stepperMode, { disabled }, className);
|
|
64
|
+
const content = (React.createElement(React.Fragment, null,
|
|
65
|
+
stepperMode && (React.createElement(Button, { type: stepperMode === "no-border" ? "text" : "default", className: "minus", disabled: disabled || !canMinus({ value, step, min, scale }), onClick: onMinusClick }, "\uFF0D")),
|
|
66
|
+
React.createElement(Input, { inputRef: inputRef || ref, style: inputStyle, placeholder: placeholder, disabled: disabled, value: isEditing ? editingValue : getDisplayValue({ value, scale, displayRenderer }), readOnly: !editable, onFocus: onInputFocus, onBlur: onInputBlur, onChange: onInputChange, onKeyDown: onInputKeyDown, suffix: suffix, prefix: prefix, inputMode: "decimal", allowClear: allowClear, focus: focus, autoFocus: autoFocus, variant: stepperMode === "no-border" ? "borderless" : "outlined" }),
|
|
67
|
+
stepperMode && (React.createElement(Button, { type: stepperMode === "no-border" ? "text" : "default", className: "add", disabled: disabled || !canAdd({ value, step, max, scale }), onClick: onAddClick }, "\uFF0B"))));
|
|
68
|
+
return stepperMode === "outlined" ? (React.createElement(Space.Compact, { className: containerClassName, onClick: stopPropagation }, content)) : (React.createElement(Space, { className: containerClassName, onClick: stopPropagation, size: 0 }, content));
|
|
69
|
+
});
|
|
98
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/NumberInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAC/F,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAG9D,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/NumberInput/index.tsx"],"names":[],"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AO,EAAE,YAAY,EACrB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAC,SAAS,EACnB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,GAClE;QACD,WAAW,IAAI,CACZ,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAE,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAC,CAAC,EAAE,OAAO,EAAE,UAAU,aAEpJ,CACZ,CACY,CACpB,CAAC;IAEF,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,CAChC,oBAAC,KAAK,CAAC,OAAO,IAAC,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,IACjE,OAAO,CACI,CACnB,CAAC,CAAC,CAAC,CACA,oBAAC,KAAK,IAAC,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,IAClE,OAAO,CACJ,CACX,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -6,16 +6,5 @@ interface Props {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
overflow: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class OverflowableText extends React.PureComponent<Props, States> {
|
|
13
|
-
static displayName: string;
|
|
14
|
-
private readonly textRef;
|
|
15
|
-
constructor(props: Props);
|
|
16
|
-
componentDidUpdate(prevProps: Props): void;
|
|
17
|
-
componentDidMount(): void;
|
|
18
|
-
updateTextOverflow: () => void;
|
|
19
|
-
render(): React.JSX.Element;
|
|
20
|
-
}
|
|
9
|
+
export declare const OverflowableText: ({ children, style, maxWidth, className }: Props) => React.JSX.Element;
|
|
21
10
|
export {};
|