@pinnacle0/web-ui 0.6.46 → 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 +5 -5
- 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
package/core/Input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,eAAe,CAAC;AAIrC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAgChE,MAAM,iBAAiB,GAAG,CAAC,CAA4D,EAAE,aAAyC,EAAE,QAAkB,EAAE,EAAE;IACtJ,IAAI,QAAQ,EAAE,CAAC;QACX,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IACD,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CACnC,OAAO,EACP;IACI,QAAQ,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,oBAAC,QAAQ,IAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,QAAQ,QAAC,QAAQ,WAAK,KAAK,GAAI;IAEtG,MAAM,EAAE,CAAC,EAAC,QAAQ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AAC,OAAO,EAAE,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;QAClD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,oBAAC,QAAQ,OAAK,SAAS,EAAE,GAAG,EAAE,QAAQ,IAAI,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAI,CAAC;AACpJ,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -2,10 +2,8 @@ import type { Props as SelectProps, SelectValue, SelectOptionProps } from "../Se
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export interface Props<ValueType extends SelectValue> extends Omit<SelectProps<ValueType>, "optionLabelProp"> {
|
|
4
4
|
}
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
static Option: React.ComponentType<SelectOptionProps & {
|
|
5
|
+
export declare const LabelledSelect: (<ValueType extends SelectValue>(props: Props<ValueType>) => React.JSX.Element) & {
|
|
6
|
+
Option: React.ComponentType<SelectOptionProps & {
|
|
8
7
|
label: string;
|
|
9
8
|
}>;
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
1
2
|
import { Select } from "../Select";
|
|
2
3
|
import React from "react";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
render() {
|
|
7
|
-
return React.createElement(Select, { optionLabelProp: "label", ...this.props });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
4
|
+
export const LabelledSelect = ReactUtil.compound("LabelledSelect", { Option: Select.Option }, (props) => {
|
|
5
|
+
return React.createElement(Select, { optionLabelProp: "label", ...props });
|
|
6
|
+
});
|
|
10
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LabelledSelect/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LabelledSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAC5C,gBAAgB,EAChB,EAAC,MAAM,EAAE,MAAM,CAAC,MAAkE,EAAC,EACnF,CAAgC,KAAuB,EAAE,EAAE;IACvD,OAAO,oBAAC,MAAM,IAAC,eAAe,EAAC,OAAO,KAAK,KAAK,GAAI,CAAC;AACzD,CAAC,CACJ,CAAC"}
|
package/core/Link/index.d.ts
CHANGED
|
@@ -8,7 +8,4 @@ export interface Props {
|
|
|
8
8
|
newTab?: boolean;
|
|
9
9
|
replace?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
12
|
-
static displayName: string;
|
|
13
|
-
render(): React.JSX.Element;
|
|
14
|
-
}
|
|
11
|
+
export declare const Link: ({ to, children, newTab, replace, className, style }: Props) => React.JSX.Element;
|
package/core/Link/index.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NavLink as ReactRouterLink } from "react-router-dom";
|
|
3
3
|
import { classNames } from "../../util/ClassNames";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (to.startsWith("/")) {
|
|
16
|
-
return (React.createElement(ReactRouterLink, { to: to, target: !newTab ? "_self" : "_blank", replace: replace, className: fullClassNames, style: style }, children));
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return (React.createElement("a", { href: to, target: newTab === undefined || newTab ? "_blank" : "_self", className: fullClassNames, style: style }, children));
|
|
20
|
-
}
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
5
|
+
export const Link = ReactUtil.memo("Link", ({ to, children, newTab, replace, className, style }) => {
|
|
6
|
+
const fullClassNames = classNames({
|
|
7
|
+
"g-text-link": typeof children === "string" || typeof children === "number",
|
|
8
|
+
}, className);
|
|
9
|
+
if (typeof to === "object") {
|
|
10
|
+
return (React.createElement(ReactRouterLink, { to: to, replace: replace, className: fullClassNames, style: style }, children));
|
|
11
|
+
}
|
|
12
|
+
else if (typeof to === "string") {
|
|
13
|
+
if (to.startsWith("/")) {
|
|
14
|
+
return (React.createElement(ReactRouterLink, { to: to, target: !newTab ? "_self" : "_blank", replace: replace, className: fullClassNames, style: style }, children));
|
|
21
15
|
}
|
|
22
16
|
else {
|
|
23
|
-
return (React.createElement("a", {
|
|
17
|
+
return (React.createElement("a", { href: to, target: newTab === undefined || newTab ? "_blank" : "_self", className: fullClassNames, style: style }, children));
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
|
-
|
|
20
|
+
else {
|
|
21
|
+
return (React.createElement("a", { onClick: to, className: fullClassNames, style: style }, children));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
27
24
|
//# sourceMappingURL=index.js.map
|
package/core/Link/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAA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,EAAE,KAAK,EAAE,KAAK,IAC5G,QAAQ,CACT,CACP,CAAC;QACN,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,OAAO,CACH,2BAAG,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,IAClD,QAAQ,CACT,CACP,CAAC;IACN,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -7,13 +7,4 @@ export interface Props {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
importing: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class LocalImporter extends React.PureComponent<Props, State> {
|
|
14
|
-
static displayName: string;
|
|
15
|
-
constructor(props: Props);
|
|
16
|
-
beforeUpload: (file: File) => Promise<false>;
|
|
17
|
-
render(): React.JSX.Element;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
10
|
+
export declare const LocalImporter: ({ type, children, className, disabled, style, onImport }: Props) => React.JSX.Element;
|
|
@@ -3,28 +3,21 @@ import AntUpload from "antd/es/upload";
|
|
|
3
3
|
import { i18n } from "../../internal/i18n/core";
|
|
4
4
|
import { TextUtil } from "../../internal/TextUtil";
|
|
5
5
|
import { Spin } from "../Spin";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
beforeUpload = async (file) => {
|
|
6
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
7
|
+
export const LocalImporter = ReactUtil.memo("LocalImporter", ({ type, children, className, disabled, style, onImport }) => {
|
|
8
|
+
const [importing, setImporting] = React.useState(false);
|
|
9
|
+
const t = i18n();
|
|
10
|
+
const beforeUpload = async (file) => {
|
|
13
11
|
try {
|
|
14
|
-
|
|
15
|
-
await
|
|
12
|
+
setImporting(true);
|
|
13
|
+
await onImport(file);
|
|
16
14
|
}
|
|
17
15
|
finally {
|
|
18
|
-
|
|
16
|
+
setImporting(false);
|
|
19
17
|
}
|
|
20
18
|
return false;
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const t = i18n();
|
|
26
|
-
return (React.createElement(AntUpload.Dragger, { showUploadList: false, multiple: false, accept: type === "txt" ? ".txt" : ".csv", className: className, disabled: disabled, style: style, height: Number(style?.height), beforeUpload: this.beforeUpload },
|
|
27
|
-
React.createElement(Spin, { spinning: importing, size: "small" }, children || TextUtil.interpolate(t.localImporterHint, type))));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
20
|
+
return (React.createElement(AntUpload.Dragger, { showUploadList: false, multiple: false, accept: type === "txt" ? ".txt" : ".csv", className: className, disabled: disabled, style: style, height: Number(style?.height), beforeUpload: beforeUpload },
|
|
21
|
+
React.createElement(Spin, { spinning: importing, size: "small" }, children || TextUtil.interpolate(t.localImporterHint, type))));
|
|
22
|
+
});
|
|
30
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LocalImporter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LocalImporter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM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3
|
-
export interface Props {
|
|
4
|
-
}
|
|
5
|
-
export declare class LocaleSelect extends React.PureComponent<Props> {
|
|
6
|
-
static displayName: string;
|
|
7
|
-
private readonly allLocales;
|
|
8
|
-
private readonly selectStyle;
|
|
9
|
-
translator: (locale: Locale) => string;
|
|
10
|
-
render(): React.JSX.Element;
|
|
11
|
-
}
|
|
2
|
+
export declare const LocaleSelect: () => React.JSX.Element;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EnumSelect } from "../EnumSelect";
|
|
3
3
|
import { LocaleUtil } from "../../util/LocaleUtil";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Do not use onChange={LocaleUtil.change}, due to "this" issue
|
|
20
|
-
onChange: newLocale => LocaleUtil.change(newLocale) }));
|
|
4
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
5
|
+
const ALL_LOCALES = ["zh", "en"];
|
|
6
|
+
const selectStyle = { width: 120 };
|
|
7
|
+
export const LocaleSelect = ReactUtil.memo("LocaleSelect", () => {
|
|
8
|
+
const currentLocale = LocaleUtil.current();
|
|
9
|
+
return (React.createElement(EnumSelect, { list: ALL_LOCALES, translator: translator, style: selectStyle, value: currentLocale,
|
|
10
|
+
// Do not use onChange={LocaleUtil.change}, due to "this" issue
|
|
11
|
+
onChange: newLocale => LocaleUtil.change(newLocale) }));
|
|
12
|
+
});
|
|
13
|
+
const translator = (locale) => {
|
|
14
|
+
switch (locale) {
|
|
15
|
+
case "en":
|
|
16
|
+
return "English";
|
|
17
|
+
case "zh":
|
|
18
|
+
return "中文";
|
|
21
19
|
}
|
|
22
|
-
}
|
|
20
|
+
};
|
|
23
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LocaleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/LocaleSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,MAAM,WAAW,GAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAwB,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5D,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;IAC3C,OAAO,CACH,oBAAC,UAAU,IACP,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,aAAa;QACpB,+DAA+D;QAC/D,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,GACrD,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,CAAC,MAAc,EAAU,EAAE;IAC1C,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,IAAI;YACL,OAAO,SAAS,CAAC;QACrB,KAAK,IAAI;YACL,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC,CAAC"}
|
package/core/Markdown/index.d.ts
CHANGED
|
@@ -14,11 +14,5 @@ export interface Props {
|
|
|
14
14
|
whitelist?: MarkdownSymbol[];
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
16
|
}
|
|
17
|
-
export declare
|
|
18
|
-
static displayName: string;
|
|
19
|
-
renderBold: (splitContents: string[], symbols: MarkdownSymbol[]) => (string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined)[];
|
|
20
|
-
renderEmphasis: (splitContents: string[], symbols: MarkdownSymbol[]) => (string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined)[];
|
|
21
|
-
processLine: (content: string, _: number, symbols: MarkdownSymbol[]) => React.ReactNode;
|
|
22
|
-
render(): React.JSX.Element;
|
|
23
|
-
}
|
|
17
|
+
export declare const Markdown: ({ children, whitelist, style }: Props) => React.JSX.Element;
|
|
24
18
|
export {};
|
package/core/Markdown/index.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.less";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const Markdown = ReactUtil.memo("Markdown", ({ children, whitelist, style }) => {
|
|
5
|
+
const symbols = whitelist || ["**", "__", "`"];
|
|
6
|
+
const renderBold = (splitContents, symbols) => {
|
|
6
7
|
return splitContents.map((_, segmentIndex) => {
|
|
7
|
-
const text =
|
|
8
|
+
const text = processLine(_, segmentIndex, symbols.slice(1));
|
|
8
9
|
return segmentIndex % 2 === 1 ? React.createElement("b", { key: `bold${segmentIndex}` }, text) : text;
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
renderEmphasis = (splitContents, symbols) => {
|
|
12
|
+
const renderEmphasis = (splitContents, symbols) => {
|
|
12
13
|
return splitContents.map((_, segmentIndex) => {
|
|
13
|
-
const text =
|
|
14
|
+
const text = processLine(_, segmentIndex, symbols.slice(1));
|
|
14
15
|
return segmentIndex % 2 === 1 ? React.createElement("em", { key: `emphasis${segmentIndex}` }, text) : text;
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
|
-
processLine = (content, _, symbols) => {
|
|
18
|
+
const processLine = (content, _, symbols) => {
|
|
18
19
|
switch (symbols[0]) {
|
|
19
20
|
case "**":
|
|
20
|
-
return
|
|
21
|
+
return renderBold(content.split(/\*\*/g), symbols);
|
|
21
22
|
case "__":
|
|
22
|
-
return
|
|
23
|
+
return renderBold(content.split(/__/g), symbols);
|
|
23
24
|
case "`":
|
|
24
|
-
return
|
|
25
|
+
return renderEmphasis(content.split(/`/g), symbols);
|
|
25
26
|
default:
|
|
26
27
|
return content;
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const symbols = whitelist || ["**", "__", "`"];
|
|
32
|
-
return (React.createElement("div", { className: "g-markdown", style: style }, children.split("\n").map((line, index) => (React.createElement("div", { className: "line", key: index }, this.processLine(line, index, symbols))))));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
30
|
+
return (React.createElement("div", { className: "g-markdown", style: style }, children.split("\n").map((line, index) => (React.createElement("div", { className: "line", key: index }, processLine(line, index, symbols))))));
|
|
31
|
+
});
|
|
35
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Markdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/Markdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,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AS,EAAE,OAAyB,EAAmB,EAAE;QAC3F,QAAQ,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,KAAK,IAAI;gBACL,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;YACvD,KAAK,IAAI;gBACL,OAAO,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;YACrD,KAAK,GAAG;gBACJ,OAAO,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;YACxD;gBACI,OAAO,OAAO,CAAC;QACvB,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,KAAK,IACnC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACvC,6BAAK,SAAS,EAAC,MAAM,EAAC,GAAG,EAAE,KAAK,IAC3B,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAChC,CACT,CAAC,CACA,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/core/Modal/index.less
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { DefaultOptionType } from "antd/es/cascader";
|
|
3
2
|
import type { ControlledFormValue } from "../../internal/type";
|
|
4
3
|
import "./index.less";
|
|
5
4
|
/**
|
|
@@ -20,11 +19,4 @@ export interface BaseProps<T extends string | number> {
|
|
|
20
19
|
}
|
|
21
20
|
export interface Props<T extends string | number> extends BaseProps<T>, ControlledFormValue<T[]> {
|
|
22
21
|
}
|
|
23
|
-
export declare
|
|
24
|
-
static displayName: string;
|
|
25
|
-
static nonLeafPrefix: string;
|
|
26
|
-
getAntValue: () => (string | number)[][];
|
|
27
|
-
getAntDataSource: () => DefaultOptionType[];
|
|
28
|
-
onChange: (antValue: (string | number | null)[][]) => void;
|
|
29
|
-
render(): React.JSX.Element;
|
|
30
|
-
}
|
|
22
|
+
export declare const MultipleCascader: <T extends string | number>({ value, placeholder, disabled, style, className, onChange, data }: Props<T>) => React.JSX.Element;
|
|
@@ -2,12 +2,11 @@ import React from "react";
|
|
|
2
2
|
import AntCascader from "antd/es/cascader";
|
|
3
3
|
import { classNames } from "../../util/ClassNames";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getAntValue = () => {
|
|
9
|
-
const data =
|
|
10
|
-
const value = this.props.value;
|
|
5
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
6
|
+
const NON_LEAF_PREFIX = "@@NON_LEAF_";
|
|
7
|
+
export const MultipleCascader = ReactUtil.memo("MultipleCascader", ({ value, placeholder = "", disabled, style, className, onChange, data }) => {
|
|
8
|
+
const getAntValue = () => {
|
|
9
|
+
const data = getAntDataSource();
|
|
11
10
|
const getCascaderValues = (data, value) => {
|
|
12
11
|
for (const item of data) {
|
|
13
12
|
if (item.value === value) {
|
|
@@ -24,22 +23,21 @@ export class MultipleCascader extends React.PureComponent {
|
|
|
24
23
|
};
|
|
25
24
|
return value.map(_ => getCascaderValues(data, _));
|
|
26
25
|
};
|
|
27
|
-
getAntDataSource = () => {
|
|
26
|
+
const getAntDataSource = () => {
|
|
28
27
|
const getAntChildren = (list) => {
|
|
29
28
|
return list.map((node, index) => ({
|
|
30
29
|
label: node.label,
|
|
31
30
|
disabled: node.disabled,
|
|
32
|
-
value: Array.isArray(node.value) ?
|
|
31
|
+
value: Array.isArray(node.value) ? NON_LEAF_PREFIX + `${index}_` + node.label : node.value,
|
|
33
32
|
children: Array.isArray(node.value) && node.value.length > 0 ? getAntChildren(node.value) : undefined,
|
|
34
33
|
}));
|
|
35
34
|
};
|
|
36
|
-
return getAntChildren(
|
|
35
|
+
return getAntChildren(data);
|
|
37
36
|
};
|
|
38
|
-
|
|
39
|
-
const data = this.getAntDataSource();
|
|
37
|
+
const onAntChange = (antValue) => {
|
|
40
38
|
const lastNodes = antValue.map(_ => _[_.length - 1]);
|
|
41
|
-
const branches = lastNodes.filter(_ => `${_}`.startsWith(
|
|
42
|
-
const leaves = lastNodes.filter(_ => !`${_}`.startsWith(
|
|
39
|
+
const branches = lastNodes.filter(_ => `${_}`.startsWith(NON_LEAF_PREFIX));
|
|
40
|
+
const leaves = lastNodes.filter(_ => !`${_}`.startsWith(NON_LEAF_PREFIX));
|
|
43
41
|
const recursion = (data) => {
|
|
44
42
|
if (data.children) {
|
|
45
43
|
return data.children.flatMap(recursion);
|
|
@@ -60,11 +58,9 @@ export class MultipleCascader extends React.PureComponent {
|
|
|
60
58
|
}
|
|
61
59
|
return [];
|
|
62
60
|
};
|
|
63
|
-
|
|
61
|
+
const newData = getAntDataSource();
|
|
62
|
+
onChange([...leaves, ...branches.flatMap(_ => getLeafValue(newData, _))]);
|
|
64
63
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return (React.createElement(AntCascader, { multiple: true, className: classNames("g-multiple-cascader", className), popupClassName: "g-multiple-cascader-popup", style: style, value: this.getAntValue(), onChange: this.onChange, options: this.getAntDataSource(), placeholder: placeholder, disabled: disabled, expandTrigger: "hover", allowClear: true, maxTagCount: "responsive" }));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
64
|
+
return (React.createElement(AntCascader, { multiple: true, className: classNames("g-multiple-cascader", className), classNames: { popup: { root: "g-multiple-cascader-popup" } }, style: style, value: getAntValue(), onChange: onAntChange, options: getAntDataSource(), placeholder: placeholder, disabled: disabled, expandTrigger: "hover", allowClear: true, maxTagCount: "responsive" }));
|
|
65
|
+
});
|
|
70
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MultipleCascader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAA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,EAAC,KAAK,EAAE,EAAC,IAAI,EAAE,2BAA2B,EAAC,EAAC,EACxD,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,EAAE,EACpB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAC,OAAO,EACrB,UAAU,QACV,WAAW,EAAC,YAAY,GAC1B,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -7,12 +7,5 @@ interface Props<Enum extends string | number> extends ControlledFormValue<Enum[]
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
}
|
|
10
|
-
export declare
|
|
11
|
-
static displayName: string;
|
|
12
|
-
getSelectOptions: () => {
|
|
13
|
-
value: Enum;
|
|
14
|
-
label: string;
|
|
15
|
-
}[];
|
|
16
|
-
render(): React.JSX.Element;
|
|
17
|
-
}
|
|
10
|
+
export declare const MultipleEnumSelect: <Enum extends string | number>(props: Props<Enum>) => React.JSX.Element;
|
|
18
11
|
export {};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Select } from "../Select";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
render() {
|
|
13
|
-
const { disabled, value, onChange, maxShownTagCount, style } = this.props;
|
|
14
|
-
// antd: using options prop will get better perf than jsx definition
|
|
15
|
-
return React.createElement(Select, { mode: "multiple", value: value, maxTagCount: maxShownTagCount, onChange: onChange, disabled: disabled, style: style, options: this.getSelectOptions(), optionFilterProp: "label" });
|
|
16
|
-
}
|
|
17
|
-
}
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
export const MultipleEnumSelect = ReactUtil.memo("MultipleEnumSelect", (props) => {
|
|
5
|
+
const { list, translator, disabled, style, value, onChange, maxShownTagCount } = props;
|
|
6
|
+
const options = list.map(value => ({
|
|
7
|
+
value,
|
|
8
|
+
label: translator ? translator(value) : value.toString(),
|
|
9
|
+
}));
|
|
10
|
+
return React.createElement(Select, { mode: "multiple", value: value, maxTagCount: maxShownTagCount, onChange: onChange, disabled: disabled, style: style, options: options, showSearch: { optionFilterProp: "label" } });
|
|
11
|
+
});
|
|
18
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MultipleEnumSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/MultipleEnumSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAU/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAA+B,KAAkB,EAAE,EAAE;IACxH,MAAM,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAC,GAAG,KAAK,CAAC;IACrF,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC/B,KAAK;QACL,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;KAC3D,CAAC,CAAC,CAAC;IAEJ,OAAO,oBAAC,MAAM,IAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAC,gBAAgB,EAAE,OAAO,EAAC,GAAI,CAAC;AACpM,CAAC,CAAC,CAAC"}
|
|
@@ -10,11 +10,5 @@ interface Props<RowType extends object> extends ControlledFormValue<RowType[]> {
|
|
|
10
10
|
onFirstRender?: () => void;
|
|
11
11
|
selectionDisabled?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
14
|
-
static displayName: string;
|
|
15
|
-
componentDidMount(): void;
|
|
16
|
-
rowKey: (item: RowType) => string;
|
|
17
|
-
onChange: (newSelectedKeys: string[]) => void;
|
|
18
|
-
render(): React.JSX.Element;
|
|
19
|
-
}
|
|
13
|
+
export declare const TablePopover: <RowType extends object>(props: Props<RowType>) => React.JSX.Element;
|
|
20
14
|
export {};
|
|
@@ -1,47 +1,44 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Table } from "../Table";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { ReactUtil } from "../../util/ReactUtil";
|
|
4
|
+
import { useDidMountEffect } from "../../hooks/useDidMountEffect";
|
|
5
|
+
export const TablePopover = ReactUtil.memo("TablePopover", (props) => {
|
|
6
|
+
const { dataSource, rowKey, columns, children, selectionDisabled, scrollY, value, onFirstRender, onChange } = props;
|
|
7
|
+
useDidMountEffect(() => {
|
|
8
|
+
onFirstRender?.();
|
|
9
|
+
});
|
|
10
|
+
const getRowKey = (item) => {
|
|
10
11
|
return typeof rowKey === "function" ? rowKey(item) : item[rowKey];
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const prevSelectedKeys = value.map(this.rowKey);
|
|
13
|
+
const onAntChange = (newSelectedKeys) => {
|
|
14
|
+
const prevSelectedKeys = value.map(getRowKey);
|
|
15
15
|
const newSelectedItems = newSelectedKeys
|
|
16
16
|
.filter(_ => !prevSelectedKeys.includes(_))
|
|
17
17
|
// By Ant Design, Parameter `newSelectedKeys` must exist in current data source
|
|
18
|
-
.map(key => dataSource.find(_ =>
|
|
18
|
+
.map(key => dataSource.find(_ => getRowKey(_) === key));
|
|
19
19
|
if (newSelectedItems.length > 0) {
|
|
20
20
|
// Select
|
|
21
21
|
onChange([...value, ...newSelectedItems]);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
// Deselect
|
|
25
|
-
const dataSourceKeys = dataSource.map(
|
|
25
|
+
const dataSourceKeys = dataSource.map(getRowKey);
|
|
26
26
|
const deletedItems = value.filter(_ => {
|
|
27
|
-
const key =
|
|
27
|
+
const key = getRowKey(_);
|
|
28
28
|
return !newSelectedKeys.includes(key) && dataSourceKeys.includes(key);
|
|
29
29
|
});
|
|
30
30
|
const withoutDeletedItems = value.filter(_ => !deletedItems.includes(_));
|
|
31
31
|
onChange(withoutDeletedItems);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return React.createElement("div", { className: "g-multiple-selector-table-popover" }, children ? children(table) : table);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
34
|
+
const selectedRowKeys = value.map(getRowKey);
|
|
35
|
+
const rowSelection = selectionDisabled
|
|
36
|
+
? undefined
|
|
37
|
+
: {
|
|
38
|
+
selectedRowKeys,
|
|
39
|
+
onChange: onAntChange,
|
|
40
|
+
};
|
|
41
|
+
const table = React.createElement(Table, { rowSelection: rowSelection, size: "small", dataSource: dataSource, columns: columns, rowKey: rowKey, scrollY: scrollY, scrollX: "none" });
|
|
42
|
+
return React.createElement("div", { className: "g-multiple-selector-table-popover" }, children ? children(table) : table);
|
|
43
|
+
});
|
|
47
44
|
//# sourceMappingURL=TablePopover.js.map
|