@antscorp/antsomi-ui 2.0.118 → 3.0.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/es/components/atoms/Alert/Alert.d.ts +1 -1
- package/es/components/atoms/Checkbox/Checkbox.d.ts +1 -1
- package/es/components/atoms/Eyedropper/styled.d.ts +1 -1
- package/es/components/atoms/FloatButton/index.d.ts +6 -1
- package/es/components/atoms/Input/Input.d.ts +1 -0
- package/es/components/atoms/Input/styled.d.ts +2 -0
- package/es/components/atoms/NotificationStatus/NotificationStatus.d.ts +1 -1
- package/es/components/atoms/Popover/Popover.d.ts +1 -1
- package/es/components/atoms/PreviewTabs/styled.d.ts +3 -1
- package/es/components/atoms/Radio/index.d.ts +2 -2
- package/es/components/atoms/Segmented/Segmented.d.ts +1 -1
- package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +10 -1
- package/es/components/atoms/Space/Space.d.ts +1 -0
- package/es/components/atoms/Steps/styled.d.ts +3 -1
- package/es/components/atoms/Switch/styled.d.ts +1 -1
- package/es/components/atoms/Tag/Tag.d.ts +3 -2
- package/es/components/molecules/AccessDenied/styled.d.ts +3 -1
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +123 -114
- package/es/components/molecules/AddDynamicContent/styled.d.ts +3 -2
- package/es/components/molecules/ApplyPopupContent/styled.d.ts +3 -1
- package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +5 -3
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +12 -2
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +1 -1
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +6 -2
- package/es/components/molecules/CalendarSelection/styled.d.ts +1 -1
- package/es/components/molecules/DatePicker/DatePicker.d.ts +73 -7
- package/es/components/molecules/DatePicker/DatePicker.js +7 -6
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +46 -26
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +20 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -0
- package/es/components/molecules/DatePickerV2/index.js +7 -3
- package/es/components/molecules/DisplayFormat/styled.d.ts +2 -1
- package/es/components/molecules/DrawerDetail/DrawerDetail.js +3 -4
- package/es/components/molecules/DrawerDetail/styled.d.ts +3 -1
- package/es/components/molecules/DrawerDetail/types.d.ts +1 -1
- package/es/components/molecules/EditingList/styled.d.ts +6 -2
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +1 -1
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmptyData/styled.d.ts +3 -1
- package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +26 -8
- package/es/components/molecules/FontSizeInput/styled.d.ts +1 -1
- package/es/components/molecules/ImageEditor/styled.d.ts +3 -1
- package/es/components/molecules/InputSelectAttribute/index.js +2 -2
- package/es/components/molecules/ItemNotFound/styled.d.ts +3 -1
- package/es/components/molecules/MatchAnySelect/MatchesAnySelect.js +5 -6
- package/es/components/molecules/MatchAnySelect/styled.d.ts +3 -7
- package/es/components/molecules/Modal/Modal.d.ts +1 -1
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/PreviewModal/styled.d.ts +3 -1
- package/es/components/molecules/ProcessLoading/styled.d.ts +3 -1
- package/es/components/molecules/RadioGroup/styled.d.ts +1 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +3 -1
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +6 -2
- package/es/components/molecules/SearchPopover/styled.d.ts +1 -0
- package/es/components/molecules/Select/styled.d.ts +3 -1
- package/es/components/molecules/SelectAccount/AccountList.js +2 -2
- package/es/components/molecules/SelectAccount/AccountListOnlyOne.js +2 -2
- package/es/components/molecules/SelectAccount/hook/useGetAbstractUsers.d.ts +2 -2
- package/es/components/molecules/SelectAccount/styled.d.ts +1 -1
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -3
- package/es/components/molecules/ShareAccess/reducer.js +1 -0
- package/es/components/molecules/ShareAccess/types.d.ts +5 -0
- package/es/components/molecules/ShareAccess/utils.js +11 -2
- package/es/components/molecules/Tabs/Tabs.d.ts +1 -1
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +1 -1
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +3 -1
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +2 -2
- package/es/components/molecules/TemplateSaveAs/styled.d.ts +3 -1
- package/es/components/molecules/Tree/Tree.d.ts +2 -4
- package/es/components/molecules/Tree/styled.d.ts +3 -7
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
- package/es/components/molecules/UnsubscribePreview/components/styled.d.ts +6 -3
- package/es/components/molecules/UploadImage/index.js +3 -2
- package/es/components/molecules/VirtualizedMenu/config.js +3 -1
- package/es/components/organism/AccountProfile/components/AccountSetting/styled.d.ts +2 -2
- package/es/components/organism/ActivityTimeline/components/List/styled.d.ts +3 -1
- package/es/components/organism/ActivityTimeline/components/Slide/styled.d.ts +1 -1
- package/es/components/organism/ActivityTimeline/styled.d.ts +6 -2
- package/es/components/organism/AlgorithmsSetting/index.js +3 -3
- package/es/components/organism/AlgorithmsSetting/styled.d.ts +1 -1
- package/es/components/organism/BasicLogin/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/BasicLogin/styled.d.ts +9 -6
- package/es/components/organism/ContentSources/Settings.js +40 -41
- package/es/components/organism/DataTable/components/ModifyColumn/styled.d.ts +6 -2
- package/es/components/organism/DataTable/components/Pagination/styled.d.ts +3 -1
- package/es/components/organism/DataTable/components/Table/index.d.ts +1 -1
- package/es/components/organism/DataTable/components/Table/styled.d.ts +2 -2
- package/es/components/organism/DataTable/components/Toolbar/GroupByPopover.d.ts +1 -1
- package/es/components/organism/DataTable/components/Toolbar/styled.d.ts +15 -5
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +7 -5
- package/es/components/organism/DataTable/styled/index.d.ts +6 -2
- package/es/components/organism/DataTable/types/index.d.ts +2 -1
- package/es/components/organism/DataTable/types/toolbar.d.ts +1 -1
- package/es/components/organism/Filter/components/FilterCondition/index.js +1 -1
- package/es/components/organism/Filter/components/FilterCondition/styled.d.ts +3 -1
- package/es/components/organism/Filter/styled.d.ts +12 -4
- package/es/components/organism/FilterSetting/components/common/InputArray/index.js +2 -2
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.d.ts +2 -1
- package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +4 -4
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.d.ts +0 -1
- package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +3 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.d.ts +1 -1
- package/es/components/organism/FilterSetting/components/common/TextTreeSelect/index.js +2 -2
- package/es/components/organism/Help/queries/useGetListUser.js +4 -1
- package/es/components/organism/Help/styled.d.ts +3 -4
- package/es/components/organism/LeftMenu/components/HomeMenu/styled.d.ts +4 -2
- package/es/components/organism/LeftMenu/components/HomeMenu/useHomeMenu.js +1 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.d.ts +3 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.d.ts +6 -2
- package/es/components/organism/LeftMenu/hooks/usePermission.d.ts +1 -1
- package/es/components/organism/LeftMenu/styled.d.ts +6 -2
- package/es/components/organism/Login/components/ChooseMethod/styled.d.ts +3 -1
- package/es/components/organism/Login/components/VerifyAccount/styled.d.ts +1 -3
- package/es/components/organism/Login/components/WidgetLayout/styled.d.ts +3 -1
- package/es/components/organism/Login/styled.d.ts +9 -6
- package/es/components/organism/ModifyColumnModal/styled.d.ts +6 -2
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +3 -1
- package/es/components/organism/PreviewTemplateModal/styled.d.ts +1 -1
- package/es/components/organism/SQLGeneration/components/styled.d.ts +2 -1
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +2 -2
- package/es/components/organism/TextEditor/styled.d.ts +3 -1
- package/es/components/organism/TicketEditor/styled.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useFetchAccountPermission.js +4 -1
- package/es/components/organism/TicketEditorV2/queries/useGetDetailTicket.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListComments.d.ts +1 -1
- package/es/components/organism/TicketEditorV2/queries/useGetListUser.js +4 -1
- package/es/components/organism/TicketEditorV2/styled.d.ts +1 -1
- package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.d.ts +3 -1
- package/es/components/template/Layout/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -1
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +2 -3
- package/es/components/template/TemplateListing/styled/index.d.ts +3 -1
- package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
- package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
- package/es/queries/AI/index.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.d.ts +3 -3
- package/es/queries/AI/useSqlGeneration.js +2 -2
- package/es/queries/Account/useGetAccountList.d.ts +3 -3
- package/es/queries/Account/useGetAccountList.js +2 -1
- package/es/queries/BusinessObject/useGetBODetail.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListAllEvents.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListBO.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListEventAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +1 -1
- package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +1 -1
- package/es/queries/CustomFunction/useCustomFunction.d.ts +3 -3
- package/es/queries/CustomFunction/useCustomFunction.js +8 -4
- package/es/queries/DataTable/index.d.ts +25 -25
- package/es/queries/DataTable/index.js +26 -19
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +1 -1
- package/es/queries/LeftMenu/index.d.ts +9 -9
- package/es/queries/LeftMenu/index.js +4 -6
- package/es/queries/Permission/index.d.ts +2 -2
- package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +1 -1
- package/es/queries/TemplateListing/index.d.ts +5 -5
- package/es/queries/TemplateListing/index.js +28 -14
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +1 -1
- package/es/queries/ThirdParty/useGetListFallbackBO.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.d.ts +1 -1
- package/es/queries/ThirdParty/useStoreSavedMedia.js +1 -0
- package/es/queries/Unsubscribe/useGetUnsubscribeList.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeList.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.d.ts +1 -1
- package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.js +2 -2
- package/es/queries/Unsubscribe/useGetUnsubscribePreferences.d.ts +1 -1
- package/es/queries/User/index.d.ts +1 -1
- package/es/queries/User/index.js +11 -7
- package/es/queries/User/userGetUserInfo.js +6 -3
- package/es/utils/color.d.ts +2 -0
- package/es/utils/color.js +30 -0
- package/package.json +40 -47
|
@@ -1,8 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
5
|
-
AdvancedPicker:
|
|
6
|
-
AdvancedRangePicker:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
import { DatePickerProps } from 'antd';
|
|
4
|
+
export declare const DatePicker: ((props: DatePickerProps<Dayjs>) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
|
+
AdvancedPicker: import("react").ForwardRefExoticComponent<import("./components/AdvancedPicker").AdvancedPickerProps & import("react").RefAttributes<import("./components/AdvancedPicker").AdvancedPickerHandle>>;
|
|
6
|
+
AdvancedRangePicker: import("react").FC<import("./components/AdvancedRangePicker/AdvancedRangePicker").AdvancedRangePickerProps>;
|
|
7
|
+
displayName?: string | undefined;
|
|
8
|
+
WeekPicker: (<ValueType = Dayjs>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
9
|
+
displayName?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
MonthPicker: (<ValueType_1 = Dayjs>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_1>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
12
|
+
displayName?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
YearPicker: (<ValueType_2 = Dayjs>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_2>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
15
|
+
displayName?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
RangePicker: import("react").ForwardRefExoticComponent<Omit<import("rc-picker").RangePickerProps<Dayjs>, "classNames" | "styles" | "locale" | "generateConfig" | "hideHeader"> & {
|
|
18
|
+
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
19
|
+
size?: import("antd/es/button").ButtonSize;
|
|
20
|
+
placement?: "bottomLeft" | "topLeft" | "topRight" | "bottomRight" | undefined;
|
|
21
|
+
bordered?: boolean | undefined;
|
|
22
|
+
status?: "" | "warning" | "error" | undefined;
|
|
23
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
24
|
+
dropdownClassName?: string | undefined;
|
|
25
|
+
popupClassName?: string | undefined;
|
|
26
|
+
rootClassName?: string | undefined;
|
|
27
|
+
popupStyle?: import("react").CSSProperties | undefined;
|
|
28
|
+
styles?: import("antd/es/date-picker/generatePicker/interface").PickerStyles | undefined;
|
|
29
|
+
classNames?: import("antd/es/date-picker/generatePicker/interface").PickerClassNames | undefined;
|
|
30
|
+
} & import("react").RefAttributes<import("rc-picker").PickerRef>>;
|
|
31
|
+
TimePicker: (<ValueType_3 = Dayjs>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker/interface").GenericTimePickerProps<Dayjs>, "picker">, ValueType_3>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
32
|
+
displayName?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
QuarterPicker: (<ValueType_4 = Dayjs>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<Dayjs, Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs>, "picker">, ValueType_4>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
35
|
+
displayName?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
|
|
38
|
+
_InternalRangePanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
|
|
39
|
+
generatePicker: <DateType extends import("antd/es/_util/type").AnyObject = import("antd/es/_util/type").AnyObject>(generateConfig: import("rc-picker/lib/generate").GenerateConfig<DateType>) => (<ValueType_5 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, import("antd/es/date-picker/generatePicker").PickerProps<DateType>, ValueType_5>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
40
|
+
displayName?: string | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
displayName?: string | undefined;
|
|
43
|
+
WeekPicker: (<ValueType_6 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, Omit<import("antd/es/date-picker/generatePicker").PickerProps<DateType>, "picker">, ValueType_6>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
44
|
+
displayName?: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
MonthPicker: (<ValueType_7 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, Omit<import("antd/es/date-picker/generatePicker").PickerProps<DateType>, "picker">, ValueType_7>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
47
|
+
displayName?: string | undefined;
|
|
48
|
+
};
|
|
49
|
+
YearPicker: (<ValueType_8 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, Omit<import("antd/es/date-picker/generatePicker").PickerProps<DateType>, "picker">, ValueType_8>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
50
|
+
displayName?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
RangePicker: import("react").ForwardRefExoticComponent<Omit<import("rc-picker").RangePickerProps<DateType>, "classNames" | "styles" | "locale" | "generateConfig" | "hideHeader"> & {
|
|
53
|
+
locale?: import("antd/es/date-picker/generatePicker").PickerLocale | undefined;
|
|
54
|
+
size?: import("antd/es/button").ButtonSize;
|
|
55
|
+
placement?: "bottomLeft" | "topLeft" | "topRight" | "bottomRight" | undefined;
|
|
56
|
+
bordered?: boolean | undefined;
|
|
57
|
+
status?: "" | "warning" | "error" | undefined;
|
|
58
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
59
|
+
dropdownClassName?: string | undefined;
|
|
60
|
+
popupClassName?: string | undefined;
|
|
61
|
+
rootClassName?: string | undefined;
|
|
62
|
+
popupStyle?: import("react").CSSProperties | undefined;
|
|
63
|
+
styles?: import("antd/es/date-picker/generatePicker/interface").PickerStyles | undefined;
|
|
64
|
+
classNames?: import("antd/es/date-picker/generatePicker/interface").PickerClassNames | undefined;
|
|
65
|
+
} & import("react").RefAttributes<import("rc-picker").PickerRef>>;
|
|
66
|
+
TimePicker: (<ValueType_9 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, Omit<import("antd/es/date-picker/generatePicker/interface").GenericTimePickerProps<DateType>, "picker">, ValueType_9>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
67
|
+
displayName?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
QuarterPicker: (<ValueType_10 = DateType>(props: import("antd/es/date-picker/generatePicker/interface").PickerPropsWithMultiple<DateType, Omit<import("antd/es/date-picker/generatePicker").PickerProps<DateType>, "picker">, ValueType_10>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
70
|
+
displayName?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
7
73
|
};
|
|
8
|
-
export
|
|
74
|
+
export type TDatePicker = typeof DatePicker;
|
|
@@ -5,9 +5,10 @@ import { AdvancedPicker } from './components/AdvancedPicker';
|
|
|
5
5
|
import { AdvancedRangePicker } from './components/AdvancedRangePicker';
|
|
6
6
|
import { EventIcon } from '@antscorp/antsomi-ui/es/components/icons';
|
|
7
7
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const DEFAULT_SUFFIX_ICON = _jsx(EventIcon, { width: 20, height: 20, color: globalToken?.bw8 });
|
|
9
|
+
const DatePickerWrapper = (props) => (_jsx(AntdDatePicker, { suffixIcon: DEFAULT_SUFFIX_ICON, ...props }));
|
|
10
|
+
export const DatePicker = Object.assign(DatePickerWrapper, {
|
|
11
|
+
...AntdDatePicker,
|
|
12
|
+
AdvancedPicker,
|
|
13
|
+
AdvancedRangePicker,
|
|
14
|
+
});
|
|
@@ -24,6 +24,7 @@ import { DatePickerCustomInput, DatePickerHeader, DropdownContent, DropdownHeade
|
|
|
24
24
|
import { CALCULATION_DATES, CALCULATION_TYPES, DATE_TYPES, DEFAULT_DATE_FORMAT, VALUE_TYPES, ADVANCED_PICKER_TYPE, WEEK_ARR, DAY_LABEL_SHORT, MONTH_LABEL_FULL, DAY_OF_MONTH, ANCHOR_LEAP_YEAR, GRANULARITY_MAPPING, } from './constants';
|
|
25
25
|
import { globalToken, THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
26
26
|
import { useOutsideClick } from '@antscorp/antsomi-ui/es/hooks/useOutsideClick';
|
|
27
|
+
import { toNumber } from 'lodash';
|
|
27
28
|
const isDisabledSpecificTime = (current, info, disabledTime, date) => {
|
|
28
29
|
if (typeof current !== 'number' || !disabledTime)
|
|
29
30
|
return false;
|
|
@@ -39,6 +40,13 @@ const isDisabledSpecificTime = (current, info, disabledTime, date) => {
|
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
const PATH = '@antscorp/antsomi-ui/es/components/molecules/DatePicker/components/Advanced/DatePickerAdvanced.tsx';
|
|
43
|
+
const isCustomPickerKey = (v) => v === 'WEEK' || v === 'DAY_OF_WEEK' || v === 'MONTH_DAY' || v === 'DAY';
|
|
44
|
+
const TIME_UNIT_SETTERS = {
|
|
45
|
+
hour: (d, v) => d.hour(v),
|
|
46
|
+
minute: (d, v) => d.minute(v),
|
|
47
|
+
second: (d, v) => d.second(v),
|
|
48
|
+
millisecond: (d, v) => d.millisecond(v),
|
|
49
|
+
};
|
|
42
50
|
const { useToken } = theme;
|
|
43
51
|
const { Text } = Typography;
|
|
44
52
|
export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
@@ -105,14 +113,16 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
105
113
|
}
|
|
106
114
|
if (showCalculationTypeCondition && option.dateType) {
|
|
107
115
|
if (showCalculationTypeCondition.dateType[option.dateType.value]) {
|
|
108
|
-
const draftCalculationTypes = showCalculationTypeCondition.dateType[option.dateType.value]
|
|
109
|
-
|
|
116
|
+
const draftCalculationTypes = (showCalculationTypeCondition.dateType[option.dateType.value] ?? []).flatMap(dateType => {
|
|
117
|
+
const match = CALCULATION_TYPES.find(({ value }) => value === dateType);
|
|
118
|
+
return match ? [match] : [];
|
|
119
|
+
});
|
|
120
|
+
const firstCalcType = draftCalculationTypes[0];
|
|
121
|
+
if (firstCalcType &&
|
|
122
|
+
!draftCalculationTypes.find(({ value }) => value === option.calculationType.value)) {
|
|
110
123
|
setState(state => ({
|
|
111
124
|
...state,
|
|
112
|
-
option: {
|
|
113
|
-
...state.option,
|
|
114
|
-
calculationType: draftCalculationTypes[0],
|
|
115
|
-
},
|
|
125
|
+
option: { ...state.option, calculationType: firstCalcType },
|
|
116
126
|
}));
|
|
117
127
|
}
|
|
118
128
|
return draftCalculationTypes;
|
|
@@ -257,10 +267,7 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
257
267
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
258
268
|
}, [propsOption, newCalculationDates, propsDate, format]);
|
|
259
269
|
// Handlers
|
|
260
|
-
const disableDate = useCallback((current) =>
|
|
261
|
-
? current > dayjs(disableAfterDate, format).date() ||
|
|
262
|
-
current < dayjs(disableBeforeDate, format).date()
|
|
263
|
-
: current > dayjs(disableAfterDate, format) || current < dayjs(disableBeforeDate, format), [disableAfterDate, disableBeforeDate, format]);
|
|
270
|
+
const disableDate = useCallback((current) => current > dayjs(disableAfterDate, format) || current < dayjs(disableBeforeDate, format), [disableAfterDate, disableBeforeDate, format]);
|
|
264
271
|
const toggleOpenDropdown = (isOpen) => {
|
|
265
272
|
try {
|
|
266
273
|
setState(() => ({
|
|
@@ -340,32 +347,34 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
340
347
|
const getCellSelected = (item, index) => {
|
|
341
348
|
switch (valueType) {
|
|
342
349
|
case 'WEEK':
|
|
343
|
-
return currWeek === item;
|
|
350
|
+
return typeof item === 'number' && currWeek === item;
|
|
344
351
|
case 'DAY_OF_WEEK':
|
|
345
352
|
return index === currDay;
|
|
346
353
|
case 'MONTH_DAY':
|
|
347
|
-
return item === currDayOfMonth && currMonth === currMonthSelected;
|
|
354
|
+
return (typeof item === 'number' && item === currDayOfMonth && currMonth === currMonthSelected);
|
|
348
355
|
case 'DAY':
|
|
349
|
-
return item === currDayOfMonth;
|
|
356
|
+
return typeof item === 'number' && item === currDayOfMonth;
|
|
350
357
|
default:
|
|
351
358
|
return false;
|
|
352
359
|
}
|
|
353
360
|
};
|
|
354
361
|
const getNewDate = (item, index) => {
|
|
362
|
+
const n = typeof item === 'number' ? item : 0;
|
|
355
363
|
switch (valueType) {
|
|
356
364
|
case 'WEEK':
|
|
357
|
-
return dayjs(date).isoWeek(
|
|
365
|
+
return dayjs(date).isoWeek(n);
|
|
358
366
|
case 'DAY_OF_WEEK':
|
|
359
367
|
return dayjs(date).day(index);
|
|
360
368
|
case 'MONTH_DAY':
|
|
361
|
-
return dayjs(date).year(ANCHOR_LEAP_YEAR).month(currMonthSelected).date(
|
|
369
|
+
return dayjs(date).year(ANCHOR_LEAP_YEAR).month(currMonthSelected).date(n);
|
|
362
370
|
case 'DAY':
|
|
363
|
-
return dayjs(date).year(ANCHOR_LEAP_YEAR).month(0).date(
|
|
371
|
+
return dayjs(date).year(ANCHOR_LEAP_YEAR).month(0).date(n);
|
|
364
372
|
default:
|
|
365
373
|
return dayjs(date);
|
|
366
374
|
}
|
|
367
375
|
};
|
|
368
|
-
|
|
376
|
+
const pickerItems = isCustomPickerKey(valueType) ? customPickerArr[valueType] : [];
|
|
377
|
+
return (_jsxs("div", { style: contentStyle, ref: refDropdown, children: [_jsx(DropdownHeader, { className: "dropdown-header", children: _jsx(DropdownLabel, { valueType: valueType, date: date, format: format, type: type, operatorKey: operatorKey }) }), _jsxs(DropdownContent, { className: "dropdown-content", children: [renderDateTypeOptions(), isShowFixed ? (_jsxs(_Fragment, { children: [valueType === 'MONTH_DAY' ? (_jsxs("div", { className: "month-controller", children: [_jsx(Icon, { type: "icon-ants-angle-left", style: { fontSize: '14px', color: '#D2D2D2' }, onClick: () => setCurrMonthSelected(prev => (prev === 0 ? 11 : prev - 1)) }), MONTH_LABEL_FULL[currMonthSelected], _jsx(Icon, { type: "icon-ants-angle-right", style: { fontSize: '14px', color: '#D2D2D2' }, onClick: () => setCurrMonthSelected(prev => (prev === 11 ? 0 : prev + 1)) })] })) : null, _jsx("div", { className: `custom-picker-content${['MONTH_DAY', 'DAY'].includes(valueType) ? ' day-of-month-container' : ''}`, children: pickerItems.map((item, index) => (_jsx("div", { className: clsx('custom-picker-item', {
|
|
369
378
|
'custom-picker-item-selected': getCellSelected(item, index),
|
|
370
379
|
}), onClick: () => {
|
|
371
380
|
const newDate = getNewDate(item, index);
|
|
@@ -376,14 +385,18 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
376
385
|
}, children: item }, `day_${item}`))) })] })) : (_jsxs(_Fragment, { children: [_jsx(Select, { getPopupContainer: triggerNode => triggerNode.parentNode, options: newCalculationTypes, value: option.calculationType.value, onChange: value => {
|
|
377
386
|
const calculationType = CALCULATION_TYPES.find(calculationType => calculationType.value === value);
|
|
378
387
|
onChangeOption({ calculationType });
|
|
379
|
-
} }), _jsx(InputNumber, { value: option.value, style: { width: '100%' }, min: 0, showHandler: false, onChange: value =>
|
|
388
|
+
} }), _jsx(InputNumber, { value: option.value, style: { width: '100%' }, min: 0, showHandler: false, onChange: value => {
|
|
389
|
+
if (typeof toNumber(value) === 'number') {
|
|
390
|
+
onChangeOption({ value: Math.floor(toNumber(value)) });
|
|
391
|
+
}
|
|
392
|
+
} }), _jsx(Select, { getPopupContainer: triggerNode => triggerNode.parentNode, options: newCalculationDates, value: option.calculationDate.value, onChange: value => {
|
|
380
393
|
const calculationDate = newCalculationDates.find(calculationDate => calculationDate.value === value);
|
|
381
394
|
onChangeOption({ calculationDate });
|
|
382
395
|
} })] })), _jsx(ErrorMessage, { errorMessage: errorMessage })] }), renderDropdownFooter()] }));
|
|
383
396
|
};
|
|
384
397
|
const cellRender = useCallback((current, info) => {
|
|
385
398
|
const isDisabledTime = isDisabledSpecificTime(current, info, disabledTime, dayjs(date));
|
|
386
|
-
const isDisableDate =
|
|
399
|
+
const isDisableDate = info.type === 'date' && dayjs.isDayjs(current) && disableDate(current);
|
|
387
400
|
return (_jsx("div", { className: "antsomi-picker-cell-inner", style: {
|
|
388
401
|
pointerEvents: 'all',
|
|
389
402
|
width: '100%',
|
|
@@ -404,11 +417,13 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
404
417
|
if (info.type === 'time' && typeof current === 'number') {
|
|
405
418
|
e.preventDefault();
|
|
406
419
|
e.stopPropagation();
|
|
407
|
-
if (info.subType && info.subType !== 'meridiem') {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
420
|
+
if (info.subType && info.subType !== 'meridiem' && typeof current === 'number') {
|
|
421
|
+
const setter = TIME_UNIT_SETTERS[info.subType];
|
|
422
|
+
if (setter)
|
|
423
|
+
setState(state => ({
|
|
424
|
+
...state,
|
|
425
|
+
date: setter(dayjs(date), current).format(format),
|
|
426
|
+
}));
|
|
412
427
|
}
|
|
413
428
|
return;
|
|
414
429
|
}
|
|
@@ -422,9 +437,14 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
422
437
|
// onChangeDatePicker(current);
|
|
423
438
|
}, children: getCellRender(current, valueType, info) }));
|
|
424
439
|
}, [valueType, format, date, disabledTime, disableDate]);
|
|
440
|
+
const _pickerTitle = React.useRef(selectedDateTitle);
|
|
441
|
+
_pickerTitle.current = selectedDateTitle;
|
|
442
|
+
const _pickerToggle = React.useRef(toggleOpenDropdown);
|
|
443
|
+
_pickerToggle.current = toggleOpenDropdown;
|
|
444
|
+
const PickerCustomInput = React.useRef(() => (_jsx(DatePickerCustomInput, { readOnly: true, placeholder: "Select Date", value: _pickerTitle.current, onClick: () => _pickerToggle.current() }))).current;
|
|
425
445
|
if (isViewMode)
|
|
426
446
|
return (_jsxs(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", ref: refDropdown, children: [!!label && typeof label === 'string' ? (_jsx(Text, { style: { color: '#666666' }, children: label })) : (label), _jsx("span", { className: "date-picker__title--view-mode", children: selectedDateTitle })] }));
|
|
427
|
-
return (_jsxs(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", children: [!!label && typeof label === 'string' ? (_jsx(Text, { style: { color: '#666666' }, children: label })) : (label), isShowFixed && !['WEEK', 'DAY_OF_WEEK', 'MONTH_DAY', 'DAY'].includes(valueType) ? (_jsx(Tooltip, { title: selectedDateTitle, children: _jsx(DatePicker, { disabled: disabled, open: !disabled && isOpen,
|
|
447
|
+
return (_jsxs(Space, { direction: "vertical", size: 5, className: "antsomi-advanced-picker-container", children: [!!label && typeof label === 'string' ? (_jsx(Text, { style: { color: '#666666' }, children: label })) : (label), isShowFixed && !['WEEK', 'DAY_OF_WEEK', 'MONTH_DAY', 'DAY'].includes(valueType) ? (_jsx(Tooltip, { title: selectedDateTitle, children: _jsx(DatePicker, { disabled: disabled, open: !disabled && isOpen, styles: { popup: { root: popupStyle } }, allowClear: false, inputReadOnly: true, style: { textOverflow: 'ellipsis', ...inputStyle }, status: errorMessage ? 'error' : '', components: { input: PickerCustomInput }, value: currDate, disabledDate: disableDate, format: formatDisplay, showNow: false, popupClassName: clsx('antsomi-picker-dropdown__advanced', {
|
|
428
448
|
'--error': errorMessage,
|
|
429
449
|
'hide-picker-header': ['QUARTER', 'MONTH'].includes(valueType),
|
|
430
450
|
'only-show-time-picker': ['HOUR', 'MINUTE'].includes(valueType),
|
|
@@ -439,7 +459,7 @@ export const AdvancedPicker = React.forwardRef((props, ref) => {
|
|
|
439
459
|
}
|
|
440
460
|
: undefined, suffixIcon: _jsx(CalendarIconWrapper, { style: {
|
|
441
461
|
pointerEvents: disabled ? 'none' : 'all',
|
|
442
|
-
}, onClick: () => toggleOpenDropdown(), children: _jsx(EventIcon, { width: 20, height: 20, fill: errorMessage ? THEME.token?.colorError : THEME.token?.bw10 }) }), cellRender: cellRender, onOpenChange: () => toggleOpenDropdown() }) })) : (_jsx(Dropdown, { disabled: disabled, open: !disabled && isOpen,
|
|
462
|
+
}, onClick: () => toggleOpenDropdown(), children: _jsx(EventIcon, { width: 20, height: 20, fill: errorMessage ? THEME.token?.colorError : THEME.token?.bw10 }) }), cellRender: cellRender, onOpenChange: () => toggleOpenDropdown() }) })) : (_jsx(Dropdown, { disabled: disabled, open: !disabled && isOpen, popupRender: dropdownRender, trigger: ['click'],
|
|
443
463
|
// onOpenChange={(open, info) => {
|
|
444
464
|
// console.log('🚀🚀🚀 ', 4, { open, info });
|
|
445
465
|
// toggleOpenDropdown();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DatePickerProps } from 'antd';
|
|
1
2
|
import { VALUE_TYPES } from './constants';
|
|
2
3
|
export type TOption = {
|
|
3
4
|
dateType: TDateType;
|
|
@@ -34,3 +35,22 @@ export type TAdvancedType = 'startDate' | 'endDate';
|
|
|
34
35
|
* @type MINUTE -> 'MM'
|
|
35
36
|
*/
|
|
36
37
|
export type ValueTypes = (typeof VALUE_TYPES)[keyof typeof VALUE_TYPES];
|
|
38
|
+
/**
|
|
39
|
+
* Subset of `rc-picker`'s `PanelMode`. We previously imported this from
|
|
40
|
+
* `rc-picker/es/interface`, but that deep path is no longer resolvable
|
|
41
|
+
* from the project root in antd 5.29.3 (rc-picker is now nested under
|
|
42
|
+
* antd's own node_modules). The alias is kept here so callers can keep
|
|
43
|
+
* using a strongly-typed cellRender signature without taking a hard
|
|
44
|
+
* dependency on rc-picker.
|
|
45
|
+
*/
|
|
46
|
+
export type PanelMode = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year' | 'decade';
|
|
47
|
+
/**
|
|
48
|
+
* `info` shape passed to `cellRender` callbacks on antd `DatePicker`
|
|
49
|
+
* (antd 5.29.3). Extracted via `Parameters` so it is always in sync
|
|
50
|
+
* with whatever antd exposes, without requiring a deep rc-picker import
|
|
51
|
+
* and without fragile conditional-type inference.
|
|
52
|
+
*
|
|
53
|
+
* The `_DateType` parameter is kept for call-site backward compat only
|
|
54
|
+
* (callers using `CellRenderInfo<Dayjs>` continue to compile).
|
|
55
|
+
*/
|
|
56
|
+
export type CellRenderInfo<_DateType = unknown> = Parameters<NonNullable<DatePickerProps['cellRender']>>[1];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
|
-
import type { CellRenderInfo } from '
|
|
2
|
+
import type { CellRenderInfo } from './types';
|
|
3
3
|
import { TAdvancedType, TCalculationDate, TDateType, TOperatorKey, ValueTypes } from './types';
|
|
4
4
|
type DateTypeKey = Exclude<TDateType, 'fixed'>;
|
|
5
5
|
/**
|
|
@@ -21,7 +21,7 @@ export declare const calculationDateAdvanced: (dateTypeKey?: DateTypeKey, operat
|
|
|
21
21
|
* @param {ValueTypes} valueType type of value (get from component props)
|
|
22
22
|
* @returns {number | string} label of cell according to valueType
|
|
23
23
|
*/
|
|
24
|
-
export declare const getCellRender: (current: number | Dayjs, valueType: ValueTypes, info: Pick<CellRenderInfo<Dayjs>, 'type'>) => number | string;
|
|
24
|
+
export declare const getCellRender: (current: number | string | Dayjs, valueType: ValueTypes, info: Pick<CellRenderInfo<Dayjs>, 'type'>) => number | string;
|
|
25
25
|
/**
|
|
26
26
|
* Get the type of calendar picker based on valueType
|
|
27
27
|
* @param {ValueTypes} valueType type of value (get from component props)
|
|
@@ -53,6 +53,8 @@ export const calculationDateAdvanced = (dateTypeKey = 'today', operator = 'minus
|
|
|
53
53
|
export const getCellRender = (current, valueType, info) => {
|
|
54
54
|
if (typeof current === 'number')
|
|
55
55
|
return current;
|
|
56
|
+
if (typeof current === 'string')
|
|
57
|
+
return current;
|
|
56
58
|
if (info.type === 'decade')
|
|
57
59
|
return `${current.year()}-${current.year() + 10}`;
|
|
58
60
|
if (info.type === 'year')
|
|
@@ -28,11 +28,15 @@ export const DatePickerV2 = props => {
|
|
|
28
28
|
setFocused(focused);
|
|
29
29
|
}
|
|
30
30
|
}, [focused]);
|
|
31
|
-
return (_jsx(DatePickerWrapper, { children: _jsxs(Space, { direction: "vertical", size: 5, children: [_jsx(AntDatePicker, { ...restOf, onBlur: e => {
|
|
31
|
+
return (_jsx(DatePickerWrapper, { children: _jsxs(Space, { direction: "vertical", size: 5, children: [_jsx(AntDatePicker, { ...restOf, onBlur: (e, info) => {
|
|
32
32
|
if (!isFocused) {
|
|
33
33
|
setFocused(true);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
if (props.onBlur) {
|
|
36
|
+
// antd 5.13+ widens onBlur to a PickerFocusEventHandler
|
|
37
|
+
// `(e, info) => void` (info is unused here but required
|
|
38
|
+
// by the type).
|
|
39
|
+
props.onBlur(e, info);
|
|
40
|
+
}
|
|
37
41
|
}, onChange: date => onChange('date-picker', date) }), requiredMsg ? (_jsx(Text, { color: "#ff4d4f", style: { marginLeft: 8 }, children: requiredMsg })) : null] }) }));
|
|
38
42
|
};
|
|
@@ -3,13 +3,14 @@ export declare const InputSuggestion: import("styled-components").StyledComponen
|
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
} & import("react").RefAttributes<import("antd").RefSelectProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
|
|
5
5
|
displayName?: string | undefined;
|
|
6
|
+
} & {
|
|
6
7
|
Option: import("rc-select/lib/Option").OptionFC;
|
|
7
8
|
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
|
|
8
9
|
}, any, {}, never>;
|
|
9
10
|
export declare const ModalCustom: import("styled-components").StyledComponent<import("react").FC<import("../Modal").ModalProps> & {
|
|
10
11
|
confirm: (props: import("antd").ModalFuncProps) => {
|
|
11
12
|
destroy: () => void;
|
|
12
|
-
update: (configUpdate: import("antd").
|
|
13
|
+
update: (configUpdate: import("antd/es/modal/confirm").ConfigUpdate) => void;
|
|
13
14
|
};
|
|
14
15
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
15
16
|
success: import("antd/es/modal/confirm").ModalFunc;
|
|
@@ -129,10 +129,9 @@ export const DrawerDetail = props => {
|
|
|
129
129
|
}, classNames: {
|
|
130
130
|
body: 'drawer-detail-body',
|
|
131
131
|
...restClassNames,
|
|
132
|
-
},
|
|
133
|
-
transition: 'none',
|
|
134
|
-
|
|
135
|
-
transition: 'none',
|
|
132
|
+
}, styles: {
|
|
133
|
+
wrapper: { transition: 'none' },
|
|
134
|
+
mask: { transition: 'none' },
|
|
136
135
|
}, destroyOnClose: destroyOnClose, ...restProps, children: [showCloseIcon && (_jsx("div", { className: "close-btn", ...restOfCloseIcon, onClick: e => {
|
|
137
136
|
onCloseIconClick(e);
|
|
138
137
|
onClose(e);
|
|
@@ -5,5 +5,7 @@ export declare const Content: import("styled-components").StyledComponent<"div",
|
|
|
5
5
|
export declare const LeftMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
6
|
export declare const CloseBtn: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
7
|
export declare const MenuItem: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export declare const DrawerHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
8
|
+
export declare const DrawerHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
|
+
} & import("react").RefAttributes<HTMLElement>>, any, DrawerHeaderProps, never>;
|
|
9
11
|
export declare const MenuFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { DrawerProps, MenuProps as AntdProps, FlexProps } from 'antd';
|
|
3
|
-
import { ItemType } from 'antd/es/menu/
|
|
3
|
+
import { ItemType } from 'antd/es/menu/interface';
|
|
4
4
|
export type TDefaultSize = 'max' | 'min';
|
|
5
5
|
export interface DrawerDetailProps extends Omit<DrawerProps, 'closeIcon' | 'title'> {
|
|
6
6
|
name?: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const EditingListRoot: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
2
|
+
export declare const EditingListRoot: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
3
5
|
export declare const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const StyledAddBtn: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
6
|
+
export declare const StyledAddBtn: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
} & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
5
9
|
export declare const AmountSelected: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
@@ -93,7 +93,7 @@ const CommonCollection = ({ onEmojiClick, getPopupContainer }) => {
|
|
|
93
93
|
});
|
|
94
94
|
return (_jsx(Scrollbars, { autoHeight: true, autoHeightMax: 150, onScroll: e => onScroll(e, emojiCollection.length), children: _jsx(Flex, { wrap: "wrap", children: content }) }));
|
|
95
95
|
}, [emojiCollection, visibleCount, onScroll, onEmojiClick]);
|
|
96
|
-
return (_jsxs(WrapperCollection, { children: [_jsxs(Flex, { gap: 20, justify: "space-between", align: "flex-end", children: [_jsx(Input, { placeholder: "Search...", suffix: _jsx(SearchIcon, { color: globalToken?.bw8 }),
|
|
96
|
+
return (_jsxs(WrapperCollection, { children: [_jsxs(Flex, { gap: 20, justify: "space-between", align: "flex-end", children: [_jsx(Input, { placeholder: "Search...", suffix: _jsx(SearchIcon, { color: globalToken?.bw8 }), style: { minWidth: 280 }, onChange: handleChangeInput }), _jsx(Select, { placeholder: "Select collection", value: state.collectionActive, style: { width: 200 }, options: collectionOptions, optionRender: renderOption, onChange: handleChangeSelect, getPopupContainer: getPopupContainer })] }), _jsx(EmojiList, { children: renderCommonCollection() })] }));
|
|
97
97
|
};
|
|
98
98
|
CommonCollection.defaultProps = {
|
|
99
99
|
onEmojiClick: () => { },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const EmojiTabs: import("styled-components").StyledComponent<import("react").
|
|
2
|
+
export declare const EmojiTabs: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/tabs").TabsProps & import("react").RefAttributes<import("antd/es/tabs").TabsRef>> & {
|
|
3
3
|
TabPane: import("react").FC<import("antd").TabPaneProps>;
|
|
4
4
|
}, any, {
|
|
5
5
|
shadow?: boolean | undefined;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const EmojiPopoverStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/popover").PopoverProps & import("react").RefAttributes<
|
|
7
|
+
export declare const EmojiPopoverStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/popover").PopoverProps & import("react").RefAttributes<import("antd/es/tooltip").TooltipRef>> & {
|
|
8
8
|
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/popover/PurePanel").PurePanelProps>;
|
|
9
9
|
}, any, {}, never>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const EmptyWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
2
|
+
export declare const EmptyWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
3
5
|
export declare const EmptyIcon: import("styled-components").StyledComponent<"div", any, {
|
|
4
6
|
$size?: TUISize | undefined;
|
|
5
7
|
}, never>;
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { InputNumber } from 'antd';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
3
|
+
import { forwardRef, useCallback, useRef } from 'react';
|
|
4
4
|
import { ControlButton, InputRoot } from '../styled';
|
|
5
5
|
import { CLS } from '../utils';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { AddIcon, MinusIcon } from '../../../icons';
|
|
8
|
-
export const FontSizeControl = forwardRef(({ onIncrement, onDecrement, ...rest }, ref) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export const FontSizeControl = forwardRef(({ onIncrement, onDecrement, ...rest }, ref) => {
|
|
9
|
+
const inputElRef = useRef(null);
|
|
10
|
+
// antd 5.13+ widened InputNumber's ref to a richer handle
|
|
11
|
+
// (`InputNumberRef` from rc-input-number). We forward the inner
|
|
12
|
+
// HTMLInputElement to the consumer's ref so the public API stays
|
|
13
|
+
// a plain HTMLInputElement handle, while letting the inner ref
|
|
14
|
+
// satisfy the stricter InputNumber typing.
|
|
15
|
+
const handleInnerRef = useCallback((node) => {
|
|
16
|
+
inputElRef.current = node;
|
|
17
|
+
if (typeof ref === 'function') {
|
|
18
|
+
ref(node);
|
|
19
|
+
}
|
|
20
|
+
else if (ref) {
|
|
21
|
+
ref.current = node;
|
|
22
|
+
}
|
|
23
|
+
}, [ref]);
|
|
24
|
+
return (_jsxs(InputRoot, { children: [_jsx(ControlButton, { type: "text", onClick: onDecrement, disabled: rest.disabled ||
|
|
25
|
+
typeof rest.value !== 'number' ||
|
|
26
|
+
typeof rest.min !== 'number' ||
|
|
27
|
+
rest.value <= rest.min, children: _jsx(MinusIcon, { size: 14 }) }), _jsx(InputNumber, { ref: handleInnerRef, className: clsx(CLS.Input, rest.className), parser: value => value?.replace(/[^\d]/g, ''), controls: false, ...rest }), _jsx(ControlButton, { type: "text", onClick: onIncrement, disabled: rest.disabled ||
|
|
28
|
+
typeof rest.value !== 'number' ||
|
|
29
|
+
typeof rest.max !== 'number' ||
|
|
30
|
+
rest.value >= rest.max, children: _jsx(AddIcon, { size: 14 }) })] }));
|
|
31
|
+
});
|
|
32
|
+
FontSizeControl.displayName = 'FontSizeControl';
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
export declare const StyledListFont: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
3
3
|
export declare const StyledListItemFont: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
4
4
|
export declare const InputRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const ControlButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<
|
|
5
|
+
export declare const ControlButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>> & {
|
|
6
6
|
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
7
7
|
}, any, {}, never>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const StageWrapperStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
2
|
+
export declare const StageWrapperStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("react").RefAttributes<HTMLElement>>, any, {
|
|
3
5
|
$width: number;
|
|
4
6
|
$height: number;
|
|
5
7
|
}, never>;
|
|
@@ -113,8 +113,8 @@ const InputSelectAttribute = (props) => {
|
|
|
113
113
|
}, style: { maxWidth: 150 }, children: get(mapCodeBySource, [value?.code, 'label'], value?.code) })) })) }), _jsx(Icon, { type: "icon-ants-remove", style: { fontSize: 10, color: '#222', cursor: 'pointer' }, onClick: onDeselect })] }));
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
element = (_jsx(StyledSelect, { mode: "multiple", options: [{ value: '', label: 'Or select a field' }], notFoundContent: null, onSelect: onOpenModal, style: { width: '100%', borderTop: 'none', borderLeft: 'none', borderRight: 'none' }, onDeselect: onDeselect, autoClearSearchValue: false, searchValue: typeof value === 'string' ? value : '', onSearch: onChangeInput, status: errorMsg ? 'error' : undefined, placeholder: typeof value === 'string' ? value : translate(translations.inputYourValue.title), "$isPlaceholder": !value, "$isError": !!errorMsg,
|
|
117
|
-
...(openModal ? { display: 'none' } : {}),
|
|
116
|
+
element = (_jsx(StyledSelect, { mode: "multiple", options: [{ value: '', label: 'Or select a field' }], notFoundContent: null, onSelect: onOpenModal, style: { width: '100%', borderTop: 'none', borderLeft: 'none', borderRight: 'none' }, onDeselect: onDeselect, autoClearSearchValue: false, searchValue: typeof value === 'string' ? value : '', onSearch: onChangeInput, status: errorMsg ? 'error' : undefined, placeholder: typeof value === 'string' ? value : translate(translations.inputYourValue.title), "$isPlaceholder": !value, "$isError": !!errorMsg, styles: {
|
|
117
|
+
popup: { root: { ...(openModal ? { display: 'none' } : {}) } },
|
|
118
118
|
} }));
|
|
119
119
|
}
|
|
120
120
|
return element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ContainerModule: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> &
|
|
2
|
+
export declare const ContainerModule: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").FlexProps<import("antd/es/_util/type").AnyObject> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("react").RefAttributes<HTMLElement>>, any, {
|
|
3
5
|
$height: string;
|
|
4
6
|
}, never>;
|
|
@@ -395,7 +395,7 @@ export function MatchesAny(props) {
|
|
|
395
395
|
return (_jsx(ConfigProvider, { theme: MATCHES_ANY_THEME, children: _jsxs(MatchesAnyWrapper, { ...restOfProps, vertical: true, justify: "space-between", children: [_jsxs(Flex, { style: { width: '100%', height: '100%' }, children: [renderSelectList(), renderSelectedList()] }), _jsxs(Flex, { className: "matches-any__footer", align: "center", justify: "space-between", children: [_jsxs(Flex, { align: "center", gap: 10, children: [_jsx(Button, { type: "primary", disabled: isDisableApply, onClick: onClickApply, children: translate(translationsLocale._ACT_APPLY) }), _jsx(Button, { onClick: () => onCancel(), children: translate(translationsLocale._ACT_CANCEL) }), _jsxs("div", { children: [isApply && (maxItemsError || itemOverMaxLength) && (_jsx(Typography, { style: { color: globalToken?.colorError }, children: translate(translationsLocale._OPERATOR_MATCH_ANY_EX_VALUE_LIMIT) })), isExistString && (_jsx(Typography, { style: { color: globalToken?.orange6 }, children: translate(translationsLocale._OPERATOR_MATCH_ANY_EX_VALUE_VAL_NUM_VAL) }))] }), isApply && itemOverMaxLength && (_jsx(Button, { type: "text", onClick: handleClickRemoveInvalid, children: translate(translationsLocale._OPERATOR_MATCH_ANY_EX_VALUE_LIMIT_REMOVE_INV) }))] }), showExtendValue && (_jsx(ExtendValuePopup, { getPopupContainer: trigger => trigger.parentElement || document.body, shouldFilterNumber: shouldFilterNumber, onApply: onApplyExtendValue, children: _jsx(Button, { icon: _jsx(Icon, { type: "icon-ants-empty-flag" }), children: t(translations.extendValue.title).toString() }) }))] })] }) }));
|
|
396
396
|
}
|
|
397
397
|
export function MatchesAnySelect(props) {
|
|
398
|
-
const { dataType, maxSelectedItem, maxLengthEachItem, placeholder = 'Select an item',
|
|
398
|
+
const { dataType, maxSelectedItem, maxLengthEachItem, placeholder = 'Select an item', styles, objectName, selectedItems, items, loading, popupClassName, groupSelectProps, renderExtraValues, customItemRenders, popoverProps, listEmptyProps, selectedListEmptyProps, selectedTreeData, error, onChangeSearch, onChange = () => { }, onLoadMore, ...restProps } = props;
|
|
399
399
|
// State
|
|
400
400
|
const [state, setState] = useState(initialState);
|
|
401
401
|
// Variables
|
|
@@ -426,9 +426,8 @@ export function MatchesAnySelect(props) {
|
|
|
426
426
|
}, trigger: ['click'], destroyTooltipOnHide: true, onOpenChange: () => setState(prev => ({ ...prev, isOpenPopover: !isOpenPopover })), zIndex: 1400, ...popoverProps, children: _jsxs(Tooltip, { mouseEnterDelay: 0.5, title: `${selectedItems ? selectedItems?.map(item => item.title).join(', ') : ''}`, overlayInnerStyle: {
|
|
427
427
|
maxHeight: 300,
|
|
428
428
|
overflow: 'auto',
|
|
429
|
-
}, children: [_jsx(Select, { title: "", value: value, placeholder: placeholder, popupMatchSelectWidth: 700,
|
|
430
|
-
...
|
|
431
|
-
display: 'none',
|
|
432
|
-
|
|
433
|
-
}, loading: loading, status: props.status || (error ? 'error' : undefined), ...restProps }), !!error && (_jsx(Text, { className: "ant-form-item-explain-error", type: "danger", children: error }))] }) }));
|
|
429
|
+
}, children: [_jsx(Select, { title: "", value: value, placeholder: placeholder, popupMatchSelectWidth: 700, styles: {
|
|
430
|
+
...styles,
|
|
431
|
+
popup: { root: { display: 'none', padding: 0 } },
|
|
432
|
+
}, loading: loading, status: props.status || (error ? 'error' : undefined), ...restProps }), !!error && (_jsx(Text, { className: "antsomi-form-item-explain-error", type: "danger", children: error }))] }) }));
|
|
434
433
|
}
|