@consta/uikit 5.27.1 → 5.28.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/ModalDeprecated/index.d.ts +1 -0
- package/ModalDeprecated/index.js +1 -0
- package/Notification/index.d.ts +1 -0
- package/Notification/index.js +1 -0
- package/SidebarDeprecated/index.d.ts +1 -0
- package/SidebarDeprecated/index.js +1 -0
- package/__internal__/src/components/Chips/ChipsChoice/ChipsChoice.js +1 -1
- package/__internal__/src/components/Chips/ChipsChoice/ChipsChoice.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePicker.js +1 -1
- package/__internal__/src/components/DatePicker/DatePicker.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +2 -4
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +2 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.d.ts +3 -6
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.d.ts +1 -0
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/DatePickerFieldTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/helpers.d.ts +2 -0
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTimeRange/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +2 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.d.ts +3 -6
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeTime/DatePickerTypeTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/helpers.d.ts +27 -8
- package/__internal__/src/components/DatePicker/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/types.d.ts +26 -5
- package/__internal__/src/components/DatePicker/types.js +1 -1
- package/__internal__/src/components/DatePicker/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime.js +1 -1
- package/__internal__/src/components/DateTime/DateTime.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDateTime/DateTimeTypeDateTime.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDateTime/DateTimeTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDateTime/useOnChange.d.ts +2 -2
- package/__internal__/src/components/DateTime/DateTimeTypeDateTime/useOnChange.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDateTime/useOnChange.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/DateTimeTypeTime.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/DateTimeTypeTime.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/helpers.d.ts +5 -2
- package/__internal__/src/components/DateTime/DateTimeTypeTime/helpers.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeTime/helpers.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/getDisableDatesKey.d.ts +2 -0
- package/__internal__/src/components/DateTime/helpers/getDisableDatesKey.js +2 -0
- package/__internal__/src/components/DateTime/helpers/getDisableDatesKey.js.map +1 -0
- package/__internal__/src/components/DateTime/helpers/getTimeNumbers.d.ts +2 -0
- package/__internal__/src/components/DateTime/helpers/getTimeNumbers.js +2 -0
- package/__internal__/src/components/DateTime/helpers/getTimeNumbers.js.map +1 -0
- package/__internal__/src/components/DateTime/helpers/getTimeOptionsKey.d.ts +2 -0
- package/__internal__/src/components/DateTime/helpers/getTimeOptionsKey.js +2 -0
- package/__internal__/src/components/DateTime/helpers/getTimeOptionsKey.js.map +1 -0
- package/__internal__/src/components/DateTime/helpers/index.d.ts +3 -0
- package/__internal__/src/components/DateTime/helpers/index.js +1 -1
- package/__internal__/src/components/DateTime/helpers/index.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/types.d.ts +30 -3
- package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/DragNDropFieldInformer/DragNDropFieldInformer.d.ts +11 -2
- package/__internal__/src/components/DragNDropFieldCanary/DragNDropFieldInformer/DragNDropFieldInformer.js.map +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/types.d.ts +2 -2
- package/__internal__/src/components/DragNDropFieldCanary/types.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelect.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js.map +1 -1
- package/__internal__/src/components/FlatSelect/defaultProps.js.map +1 -1
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.css +1 -0
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.d.ts +27 -0
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js +2 -0
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js.map +1 -0
- package/__internal__/src/components/ModalDeprecated/index.d.ts +1 -0
- package/__internal__/src/components/ModalDeprecated/index.js +2 -0
- package/__internal__/src/components/ModalDeprecated/index.js.map +1 -0
- package/__internal__/src/components/Notification/Notification/Notification.css +1 -0
- package/__internal__/src/components/Notification/Notification/Notification.d.ts +4 -0
- package/__internal__/src/components/Notification/Notification/Notification.js +2 -0
- package/__internal__/src/components/Notification/Notification/Notification.js.map +1 -0
- package/__internal__/src/components/Notification/Notification/helpers.d.ts +70 -0
- package/__internal__/src/components/Notification/Notification/helpers.js +2 -0
- package/__internal__/src/components/Notification/Notification/helpers.js.map +1 -0
- package/__internal__/src/components/Notification/Notification/index.d.ts +2 -0
- package/__internal__/src/components/Notification/Notification/index.js +2 -0
- package/__internal__/src/components/Notification/Notification/index.js.map +1 -0
- package/__internal__/src/components/Notification/Notification/types.d.ts +66 -0
- package/__internal__/src/components/Notification/Notification/types.js +2 -0
- package/__internal__/src/components/Notification/Notification/types.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationActions/NotificationActions.d.ts +2 -0
- package/__internal__/src/components/Notification/NotificationActions/NotificationActions.js +2 -0
- package/__internal__/src/components/Notification/NotificationActions/NotificationActions.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationActions/helpers.d.ts +21 -0
- package/__internal__/src/components/Notification/NotificationActions/helpers.js +2 -0
- package/__internal__/src/components/Notification/NotificationActions/helpers.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationActions/index.d.ts +2 -0
- package/__internal__/src/components/Notification/NotificationActions/index.js +2 -0
- package/__internal__/src/components/Notification/NotificationActions/index.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationActions/types.d.ts +30 -0
- package/__internal__/src/components/Notification/NotificationActions/types.js +2 -0
- package/__internal__/src/components/Notification/NotificationActions/types.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationCaption/NotificationCaption.css +1 -0
- package/__internal__/src/components/Notification/NotificationCaption/NotificationCaption.d.ts +7 -0
- package/__internal__/src/components/Notification/NotificationCaption/NotificationCaption.js +2 -0
- package/__internal__/src/components/Notification/NotificationCaption/NotificationCaption.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationCaption/index.d.ts +1 -0
- package/__internal__/src/components/Notification/NotificationCaption/index.js +2 -0
- package/__internal__/src/components/Notification/NotificationCaption/index.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationGroup/NotificationGroup.css +1 -0
- package/__internal__/src/components/Notification/NotificationGroup/NotificationGroup.d.ts +4 -0
- package/__internal__/src/components/Notification/NotificationGroup/NotificationGroup.js +2 -0
- package/__internal__/src/components/Notification/NotificationGroup/NotificationGroup.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationGroup/index.d.ts +2 -0
- package/__internal__/src/components/Notification/NotificationGroup/index.js +2 -0
- package/__internal__/src/components/Notification/NotificationGroup/index.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationGroup/types.d.ts +12 -0
- package/__internal__/src/components/Notification/NotificationGroup/types.js +2 -0
- package/__internal__/src/components/Notification/NotificationGroup/types.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationHeader/NotificationHeader.css +1 -0
- package/__internal__/src/components/Notification/NotificationHeader/NotificationHeader.d.ts +5 -0
- package/__internal__/src/components/Notification/NotificationHeader/NotificationHeader.js +2 -0
- package/__internal__/src/components/Notification/NotificationHeader/NotificationHeader.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationHeader/index.d.ts +2 -0
- package/__internal__/src/components/Notification/NotificationHeader/index.js +2 -0
- package/__internal__/src/components/Notification/NotificationHeader/index.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationHeader/types.d.ts +14 -0
- package/__internal__/src/components/Notification/NotificationHeader/types.js +2 -0
- package/__internal__/src/components/Notification/NotificationHeader/types.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationItem/NotificationItem.css +1 -0
- package/__internal__/src/components/Notification/NotificationItem/NotificationItem.d.ts +6 -0
- package/__internal__/src/components/Notification/NotificationItem/NotificationItem.js +2 -0
- package/__internal__/src/components/Notification/NotificationItem/NotificationItem.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationItem/index.d.ts +2 -0
- package/__internal__/src/components/Notification/NotificationItem/index.js +2 -0
- package/__internal__/src/components/Notification/NotificationItem/index.js.map +1 -0
- package/__internal__/src/components/Notification/NotificationItem/types.d.ts +19 -0
- package/__internal__/src/components/Notification/NotificationItem/types.js +2 -0
- package/__internal__/src/components/Notification/NotificationItem/types.js.map +1 -0
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.d.ts +1 -0
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js +2 -0
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js.map +1 -0
- package/__internal__/src/components/Notification/helpers/groupLabelByDay.d.ts +1 -0
- package/__internal__/src/components/Notification/helpers/groupLabelByDay.js +2 -0
- package/__internal__/src/components/Notification/helpers/groupLabelByDay.js.map +1 -0
- package/__internal__/src/components/Notification/helpers/groupsByDay.d.ts +1 -0
- package/__internal__/src/components/Notification/helpers/groupsByDay.js +2 -0
- package/__internal__/src/components/Notification/helpers/groupsByDay.js.map +1 -0
- package/__internal__/src/components/Notification/helpers/index.d.ts +4 -0
- package/__internal__/src/components/Notification/helpers/index.js +2 -0
- package/__internal__/src/components/Notification/helpers/index.js.map +1 -0
- package/__internal__/src/components/Notification/helpers/sortGroupByDay.d.ts +5 -0
- package/__internal__/src/components/Notification/helpers/sortGroupByDay.js +2 -0
- package/__internal__/src/components/Notification/helpers/sortGroupByDay.js.map +1 -0
- package/__internal__/src/components/Notification/index.d.ts +7 -0
- package/__internal__/src/components/Notification/index.js +2 -0
- package/__internal__/src/components/Notification/index.js.map +1 -0
- package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
- package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
- package/__internal__/src/components/Sidebar/types.d.ts +3 -2
- package/__internal__/src/components/Sidebar/types.js.map +1 -1
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.css +1 -0
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.d.ts +39 -0
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js +2 -0
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js.map +1 -0
- package/__internal__/src/components/SidebarDeprecated/index.d.ts +1 -0
- package/__internal__/src/components/SidebarDeprecated/index.js +2 -0
- package/__internal__/src/components/SidebarDeprecated/index.js.map +1 -0
- package/__internal__/src/utils/getItemClick.d.ts +5 -0
- package/__internal__/src/utils/getItemClick.js +2 -0
- package/__internal__/src/utils/getItemClick.js.map +1 -0
- package/__internal__/src/utils/object/keys.d.ts +1 -0
- package/__internal__/src/utils/object/keys.js +2 -0
- package/__internal__/src/utils/object/keys.js.map +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type DateTimePropType = typeof dateTimePropType[number];
|
|
|
8
8
|
export declare const dateTimePropTypeDefault: "date";
|
|
9
9
|
export type DateTimePropDisableDates = Array<Date | [Date, Date]>;
|
|
10
10
|
export type CapableRangeType = 'date' | 'month' | 'year' | 'date-time';
|
|
11
|
+
export type TypeWithTime = 'time' | 'date-time';
|
|
11
12
|
export type DateTimePropValue<TYPE> = TYPE extends CapableRangeType ? Date | DateRange : Date;
|
|
12
13
|
export type DateTimePropOnChange = (value: Date, props: {
|
|
13
14
|
e: React.MouseEvent<HTMLButtonElement>;
|
|
@@ -26,6 +27,16 @@ export type DateTimePropLocale = Locale & LocaleWords;
|
|
|
26
27
|
export declare const moveTypes: readonly ["year", "month", "day", "time"];
|
|
27
28
|
export type MoveType = typeof moveTypes[number];
|
|
28
29
|
type DateTimePropTimeFor<TYPE> = TYPE extends 'date-time' ? 'start' | 'end' : never;
|
|
30
|
+
export type TimeUnitOptions = {
|
|
31
|
+
step?: number;
|
|
32
|
+
start?: number;
|
|
33
|
+
stop?: number;
|
|
34
|
+
} | number[];
|
|
35
|
+
export type TimeOptions = {
|
|
36
|
+
hours?: TimeUnitOptions;
|
|
37
|
+
minutes?: TimeUnitOptions;
|
|
38
|
+
seconds?: TimeUnitOptions;
|
|
39
|
+
};
|
|
29
40
|
export type DateTimeProps<TYPE extends DateTimePropType = 'date'> = PropsWithHTMLAttributesAndRef<{
|
|
30
41
|
currentVisibleDate?: Date;
|
|
31
42
|
type?: TYPE;
|
|
@@ -40,9 +51,25 @@ export type DateTimeProps<TYPE extends DateTimePropType = 'date'> = PropsWithHTM
|
|
|
40
51
|
children?: never;
|
|
41
52
|
disableDates?: DateTimePropDisableDates;
|
|
42
53
|
onChangeCurrentVisibleDate?: (date: Date) => void;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
timeOptions?: TYPE extends TypeWithTime ? TimeOptions : never;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated Use timeOptions instead.
|
|
57
|
+
* TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования
|
|
58
|
+
* объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.
|
|
59
|
+
*/
|
|
60
|
+
multiplicitySeconds?: TYPE extends TypeWithTime ? number : never;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Use timeOptions instead.
|
|
63
|
+
* TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования
|
|
64
|
+
* объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.
|
|
65
|
+
*/
|
|
66
|
+
multiplicityMinutes?: TYPE extends TypeWithTime ? number : never;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use timeOptions instead.
|
|
69
|
+
* TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования
|
|
70
|
+
* объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.
|
|
71
|
+
*/
|
|
72
|
+
multiplicityHours?: TYPE extends TypeWithTime ? number : never;
|
|
46
73
|
onMove?: (type: MoveType) => void;
|
|
47
74
|
timeFor?: DateTimePropTimeFor<TYPE>;
|
|
48
75
|
}, HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["dateTimePropView","dateTimePropViewDefault","dateTimePropType","dateTimePropTypeDefault","moveTypes"],"sources":["../../../../../../src/components/DateTime/helpers/types.ts"],"sourcesContent":["import { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';\n\nexport const dateTimePropView = ['classic', 'book', 'slider'] as const;\nexport type DateTimePropView = typeof dateTimePropView[number];\nexport const dateTimePropViewDefault = dateTimePropView[0];\n\nexport const dateTimePropType = [\n 'date',\n 'month',\n 'year',\n 'time',\n 'date-time',\n] as const;\nexport type DateTimePropType = typeof dateTimePropType[number];\nexport const dateTimePropTypeDefault = dateTimePropType[0];\n\nexport type DateTimePropDisableDates = Array<Date | [Date, Date]>;\n\nexport type CapableRangeType = 'date' | 'month' | 'year' | 'date-time';\n\nexport type DateTimePropValue<TYPE> = TYPE extends CapableRangeType\n ? Date | DateRange\n : Date;\n\nexport type DateTimePropOnChange = (\n value: Date,\n props: {\n e: React.MouseEvent<HTMLButtonElement>;\n },\n) => void;\n\nexport type DateTimePropOnChangeRange<TYPE> = TYPE extends CapableRangeType\n ? (\n value: DateRange,\n props: {\n e: React.MouseEvent<HTMLButtonElement>;\n },\n ) => void\n : never;\n\ntype LocaleWords = {\n words?: {\n hours?: string;\n minutes?: string;\n seconds?: string;\n };\n};\n\nexport type DateTimePropLocale = Locale & LocaleWords;\n\nexport const moveTypes = ['year', 'month', 'day', 'time'] as const;\nexport type MoveType = typeof moveTypes[number];\n\ntype DateTimePropTimeFor<TYPE> = TYPE extends 'date-time'\n ? 'start' | 'end'\n : never;\n\nexport type DateTimeProps<TYPE extends DateTimePropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n currentVisibleDate?: Date;\n type?: TYPE;\n value?: DateTimePropValue<TYPE>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n events?: Date[];\n view?: TYPE extends CapableRangeType ? DateTimePropView : 'classic';\n locale?: DateTimePropLocale;\n children?: never;\n disableDates?: DateTimePropDisableDates;\n onChangeCurrentVisibleDate?: (date: Date) => void;\n multiplicitySeconds?: number;\n multiplicityMinutes?: number;\n multiplicityHours?: number;\n onMove?: (type: MoveType) => void;\n timeFor?: DateTimePropTimeFor<TYPE>;\n },\n HTMLDivElement\n >;\n\nexport type DateTimeComponent = <TYPE extends DateTimePropType = 'date'>(\n props: DateTimeProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type DateTimeTypeComponent<TYPE extends DateTimePropType> = (\n props: Omit<DateTimeProps<TYPE>, 'type'>,\n) => React.ReactNode | null;\n\nexport type HandleSelectDate = (\n value: Date,\n props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n },\n) => void;\n"],"mappings":"AAGA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAoB,QAApB,CAAzB,CAEP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAC9B,MAD8B,CAE9B,OAF8B,CAG9B,MAH8B,CAI9B,MAJ8B,CAK9B,WAL8B,CAAzB,CAQP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,
|
|
1
|
+
{"version":3,"file":"types.js","names":["dateTimePropView","dateTimePropViewDefault","dateTimePropType","dateTimePropTypeDefault","moveTypes"],"sources":["../../../../../../src/components/DateTime/helpers/types.ts"],"sourcesContent":["import { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';\n\nexport const dateTimePropView = ['classic', 'book', 'slider'] as const;\nexport type DateTimePropView = typeof dateTimePropView[number];\nexport const dateTimePropViewDefault = dateTimePropView[0];\n\nexport const dateTimePropType = [\n 'date',\n 'month',\n 'year',\n 'time',\n 'date-time',\n] as const;\nexport type DateTimePropType = typeof dateTimePropType[number];\nexport const dateTimePropTypeDefault = dateTimePropType[0];\n\nexport type DateTimePropDisableDates = Array<Date | [Date, Date]>;\n\nexport type CapableRangeType = 'date' | 'month' | 'year' | 'date-time';\n\nexport type TypeWithTime = 'time' | 'date-time';\n\nexport type DateTimePropValue<TYPE> = TYPE extends CapableRangeType\n ? Date | DateRange\n : Date;\n\nexport type DateTimePropOnChange = (\n value: Date,\n props: {\n e: React.MouseEvent<HTMLButtonElement>;\n },\n) => void;\n\nexport type DateTimePropOnChangeRange<TYPE> = TYPE extends CapableRangeType\n ? (\n value: DateRange,\n props: {\n e: React.MouseEvent<HTMLButtonElement>;\n },\n ) => void\n : never;\n\ntype LocaleWords = {\n words?: {\n hours?: string;\n minutes?: string;\n seconds?: string;\n };\n};\n\nexport type DateTimePropLocale = Locale & LocaleWords;\n\nexport const moveTypes = ['year', 'month', 'day', 'time'] as const;\nexport type MoveType = typeof moveTypes[number];\n\ntype DateTimePropTimeFor<TYPE> = TYPE extends 'date-time'\n ? 'start' | 'end'\n : never;\n\nexport type TimeUnitOptions =\n | {\n step?: number;\n start?: number;\n stop?: number;\n }\n | number[];\n\nexport type TimeOptions = {\n hours?: TimeUnitOptions;\n minutes?: TimeUnitOptions;\n seconds?: TimeUnitOptions;\n};\n\nexport type DateTimeProps<TYPE extends DateTimePropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n currentVisibleDate?: Date;\n type?: TYPE;\n value?: DateTimePropValue<TYPE>;\n onChange?: DateTimePropOnChange;\n onChangeRange?: DateTimePropOnChangeRange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n events?: Date[];\n view?: TYPE extends CapableRangeType ? DateTimePropView : 'classic';\n locale?: DateTimePropLocale;\n children?: never;\n disableDates?: DateTimePropDisableDates;\n onChangeCurrentVisibleDate?: (date: Date) => void;\n timeOptions?: TYPE extends TypeWithTime ? TimeOptions : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования\n * объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.\n */\n multiplicitySeconds?: TYPE extends TypeWithTime ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования\n * объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.\n */\n multiplicityMinutes?: TYPE extends TypeWithTime ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity* и логику формирования\n * объектов с шагом ({ step: multiplicity }) во всех местах, оставив только работу с timeOptions.\n */\n multiplicityHours?: TYPE extends TypeWithTime ? number : never;\n onMove?: (type: MoveType) => void;\n timeFor?: DateTimePropTimeFor<TYPE>;\n },\n HTMLDivElement\n >;\n\nexport type DateTimeComponent = <TYPE extends DateTimePropType = 'date'>(\n props: DateTimeProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type DateTimeTypeComponent<TYPE extends DateTimePropType> = (\n props: Omit<DateTimeProps<TYPE>, 'type'>,\n) => React.ReactNode | null;\n\nexport type HandleSelectDate = (\n value: Date,\n props: {\n value: Date;\n e: React.MouseEvent<HTMLButtonElement>;\n },\n) => void;\n"],"mappings":"AAGA,MAAO,IAAMA,iBAAgB,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAoB,QAApB,CAAzB,CAEP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAEP,MAAO,IAAME,iBAAgB,CAAG,CAC9B,MAD8B,CAE9B,OAF8B,CAG9B,MAH8B,CAI9B,MAJ8B,CAK9B,WAL8B,CAAzB,CAQP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAsCP,MAAO,IAAME,UAAS,CAAG,CAAC,MAAD,CAAS,OAAT,CAAkB,KAAlB,CAAyB,MAAzB,CAAlB"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import './DragNDropFieldInformer.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export declare const DragNDropFieldInformer: React.ForwardRefExoticComponent<
|
|
3
|
+
import { DragNDropFieldInformerPropStatus } from '../types';
|
|
4
|
+
export declare const DragNDropFieldInformer: React.ForwardRefExoticComponent<{
|
|
5
|
+
status?: DragNDropFieldInformerPropStatus;
|
|
6
|
+
icon?: import("@consta/icons/Icon").IconComponent;
|
|
7
|
+
loading?: boolean | number;
|
|
8
|
+
text?: string;
|
|
9
|
+
withButton?: boolean;
|
|
10
|
+
buttonIcon?: import("@consta/icons/Icon").IconComponent;
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
onButtonClick?: () => void;
|
|
13
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "css" | "status" | "text" | "loading" | "icon" | "onButtonClick" | "buttonIcon" | "withButton" | "buttonLabel"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragNDropFieldInformer.js","names":["React","Button","ProgressSpin","Text","cnCanary","dragNDropFieldInformerPropStatus","textViewMap","alert","warning","iconStatusMap","cnDragNDropFieldInformer","propStatusDefault","DragNDropFieldInformer","forwardRef","props","ref","status","loading","icon","text","withButton","buttonIcon","buttonLabel","onButtonClick","className","otherProps","Icon"],"sources":["../../../../../../src/components/DragNDropFieldCanary/DragNDropFieldInformer/DragNDropFieldInformer.tsx"],"sourcesContent":["import './DragNDropFieldInformer.css';\n\nimport { IconPropView } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { Button } from '##/components/Button';\nimport { ProgressSpin } from '##/components/ProgressSpin';\nimport { Text, TextPropView } from '##/components/Text';\nimport { cnCanary } from '##/utils/bem';\
|
|
1
|
+
{"version":3,"file":"DragNDropFieldInformer.js","names":["React","Button","ProgressSpin","Text","cnCanary","dragNDropFieldInformerPropStatus","textViewMap","alert","warning","iconStatusMap","cnDragNDropFieldInformer","propStatusDefault","DragNDropFieldInformer","forwardRef","props","ref","status","loading","icon","text","withButton","buttonIcon","buttonLabel","onButtonClick","className","otherProps","Icon"],"sources":["../../../../../../src/components/DragNDropFieldCanary/DragNDropFieldInformer/DragNDropFieldInformer.tsx"],"sourcesContent":["import './DragNDropFieldInformer.css';\n\nimport { IconPropView } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { Button } from '##/components/Button';\nimport { ProgressSpin } from '##/components/ProgressSpin';\nimport { Text, TextPropView } from '##/components/Text';\nimport { cnCanary } from '##/utils/bem';\n\nimport {\n DragNDropFieldInformerProps,\n DragNDropFieldInformerPropStatus,\n dragNDropFieldInformerPropStatus,\n} from '../types';\n\nconst textViewMap: Record<DragNDropFieldInformerPropStatus, TextPropView> = {\n default: 'ghost',\n alert: 'alert',\n warning: 'warning',\n};\n\nconst iconStatusMap: Record<DragNDropFieldInformerPropStatus, IconPropView> = {\n default: 'ghost',\n alert: 'alert',\n warning: 'warning',\n};\n\nconst cnDragNDropFieldInformer = cnCanary('DragNDropFieldInformer');\n\nconst propStatusDefault: DragNDropFieldInformerPropStatus =\n dragNDropFieldInformerPropStatus[0];\n\nexport const DragNDropFieldInformer = React.forwardRef<\n HTMLDivElement,\n DragNDropFieldInformerProps\n>((props, ref) => {\n const {\n status = propStatusDefault,\n loading = false,\n icon,\n text = '',\n withButton = false,\n buttonIcon,\n buttonLabel,\n onButtonClick,\n className,\n ...otherProps\n } = props;\n const Icon = icon;\n return (\n <div\n {...otherProps}\n className={cnDragNDropFieldInformer(\n {\n status,\n },\n [className],\n )}\n ref={ref}\n >\n {loading && (\n <ProgressSpin\n value={typeof loading === 'number' ? loading : undefined}\n animation\n size=\"m\"\n className={cnDragNDropFieldInformer('Progress')}\n />\n )}\n {!loading && Icon && (\n <Icon\n view={iconStatusMap[status]}\n size=\"s\"\n className={cnDragNDropFieldInformer('Icon')}\n />\n )}\n {text ? (\n <Text\n align=\"left\"\n lineHeight=\"xs\"\n size=\"xs\"\n className={cnDragNDropFieldInformer('Text')}\n view={textViewMap[status]}\n >\n {text}\n </Text>\n ) : (\n ' '\n )}\n {withButton && (\n <Button\n onlyIcon\n iconLeft={buttonIcon}\n onClick={onButtonClick}\n view=\"ghost\"\n size=\"xs\"\n title={buttonLabel}\n className={cnDragNDropFieldInformer('Button')}\n />\n )}\n </div>\n );\n});\n"],"mappings":"0MAAA,qCAGA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,MAAT,oBACA,OAASC,YAAT,0BACA,OAASC,IAAT,kBACA,OAASC,QAAT,0BAEA,OAGEC,gCAHF,gB,GAMMC,YAAmE,CAAG,CAC1E,QAAS,OADiE,CAE1EC,KAAK,CAAE,OAFmE,CAG1EC,OAAO,CAAE,SAHiE,C,CAMtEC,aAAqE,CAAG,CAC5E,QAAS,OADmE,CAE5EF,KAAK,CAAE,OAFqE,CAG5EC,OAAO,CAAE,SAHmE,C,CAMxEE,wBAAwB,CAAGN,QAAQ,CAAC,wBAAD,C,CAEnCO,iBAAmD,CACvDN,gCAAgC,CAAC,CAAD,C,CAElC,MAAO,IAAMO,uBAAsB,CAAGZ,KAAK,CAACa,UAAN,CAGpC,SAACC,CAAD,CAAQC,CAAR,CAAgB,OAYZD,CAZY,CAEdE,MAFc,CAEdA,CAFc,YAELL,iBAFK,KAYZG,CAZY,CAGdG,OAHc,CAGdA,CAHc,eAIdC,CAJc,CAYZJ,CAZY,CAIdI,IAJc,GAYZJ,CAZY,CAKdK,IALc,CAKdA,CALc,YAKP,EALO,KAYZL,CAZY,CAMdM,UANc,CAOdC,CAPc,CAYZP,CAZY,CAOdO,UAPc,CAQdC,CARc,CAYZR,CAZY,CAQdQ,WARc,CASdC,CATc,CAYZT,CAZY,CASdS,aATc,CAUdC,CAVc,CAYZV,CAZY,CAUdU,SAVc,CAWXC,CAXW,0BAYZX,CAZY,YAaVY,CAAI,CAAGR,CAbG,CAchB,MACE,4CACMO,CADN,EAEE,SAAS,CAAEf,wBAAwB,CACjC,CACEM,MAAM,CAANA,CADF,CADiC,CAIjC,CAACQ,CAAD,CAJiC,CAFrC,CAQE,GAAG,CAAET,CARP,GAUGE,CAAO,EACN,oBAAC,YAAD,EACE,KAAK,CAAqB,QAAnB,QAAOA,EAAP,CAA8BA,CAA9B,OADT,CAEE,SAAS,GAFX,CAGE,IAAI,CAAC,GAHP,CAIE,SAAS,CAAEP,wBAAwB,CAAC,UAAD,CAJrC,EAXJ,CAkBG,CAACO,CAAD,EAAYS,CAAZ,EACC,oBAAC,CAAD,EACE,IAAI,CAAEjB,aAAa,CAACO,CAAD,CADrB,CAEE,IAAI,CAAC,GAFP,CAGE,SAAS,CAAEN,wBAAwB,CAAC,MAAD,CAHrC,EAnBJ,CAyBGS,CAAI,CACH,oBAAC,IAAD,EACE,KAAK,CAAC,MADR,CAEE,UAAU,CAAC,IAFb,CAGE,IAAI,CAAC,IAHP,CAIE,SAAS,CAAET,wBAAwB,CAAC,MAAD,CAJrC,CAKE,IAAI,CAAEJ,WAAW,CAACU,CAAD,CALnB,EAOGG,CAPH,CADG,CAWH,GApCJ,CAsCG,eACC,oBAAC,MAAD,EACE,QAAQ,GADV,CAEE,QAAQ,CAAEE,CAFZ,CAGE,OAAO,CAAEE,CAHX,CAIE,IAAI,CAAC,OAJP,CAKE,IAAI,CAAC,IALP,CAME,KAAK,CAAED,CANT,CAOE,SAAS,CAAEZ,wBAAwB,CAAC,QAAD,CAPrC,EAvCJ,CAmDH,CArEqC,CAA/B"}
|
|
@@ -68,7 +68,7 @@ export type DragNDropFieldPropLocale = {
|
|
|
68
68
|
};
|
|
69
69
|
export declare const dragNDropFieldInformerPropStatus: readonly ["default", "alert", "warning"];
|
|
70
70
|
export type DragNDropFieldInformerPropStatus = typeof dragNDropFieldInformerPropStatus[number];
|
|
71
|
-
export type DragNDropFieldInformerProps = {
|
|
71
|
+
export type DragNDropFieldInformerProps = PropsWithHTMLAttributes<{
|
|
72
72
|
status?: DragNDropFieldInformerPropStatus;
|
|
73
73
|
icon?: IconComponent;
|
|
74
74
|
loading?: boolean | number;
|
|
@@ -77,4 +77,4 @@ export type DragNDropFieldInformerProps = {
|
|
|
77
77
|
buttonIcon?: IconComponent;
|
|
78
78
|
buttonLabel?: string;
|
|
79
79
|
onButtonClick?: () => void;
|
|
80
|
-
}
|
|
80
|
+
}, HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["dragNDropFieldInformerPropStatus"],"sources":["../../../../../src/components/DragNDropFieldCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { Accept, DropEvent, FileRejection, FileWithPath } from 'react-dropzone';\n\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type DragNDropFieldChildrenRenderFn = (props: {\n openFileDialog: () => void;\n isFocused: boolean;\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFileDialogActive: boolean;\n acceptedFiles: readonly FileWithPath[];\n fileRejections: readonly FileRejection[];\n}) => React.ReactNode;\n\nexport type DragNDropFieldContentProps = {\n openFileDialog: () => void;\n locale: Required<DragNDropFieldPropLocale>;\n isFocused: boolean;\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFileDialogActive: boolean;\n acceptedFiles: readonly FileWithPath[];\n fileRejections: readonly FileRejection[];\n} & Pick<\n DragNDropFieldProps,\n 'accept' | 'maxSize' | 'multiple' | 'disabled' | 'minSize'\n>;\n\nexport type FileSizes = {\n minSize?: number;\n maxSize?: number;\n};\n\nexport type DragNDropFieldProps = PropsWithHTMLAttributes<\n {\n accept?: Accept;\n maxSize?: number;\n minSize?: number;\n maxFiles?: number;\n multiple?: boolean;\n disabled?: boolean;\n children?: React.ReactNode | DragNDropFieldChildrenRenderFn;\n locale?: DragNDropFieldPropLocale;\n onDrop?: <T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ) => void;\n onDropAccepted?: <T extends File>(files: T[]) => void;\n onDropRejected?: (\n fileRejections: FileRejection[],\n event: DropEvent,\n ) => void;\n onError?: (err: Error) => void;\n },\n HTMLDivElement\n>;\n\nexport type LocaleError =\n | string\n | ((props: { file: File; sizes?: FileSizes }) => string);\n\nexport type LocaleLabel = string | ((props: { fileText: string }) => string);\n\nexport type DragNDropFieldPropLocale = {\n 'file-invalid-type'?: LocaleError;\n 'file-too-large'?: LocaleError;\n 'file-too-small'?: LocaleError;\n 'too-many-files'?: string;\n 'general-error'?: string;\n 'fit-files'?: string;\n 'file'?: string;\n 'files'?: string;\n 'before'?: string;\n 'from'?: string;\n 'gigabyte'?: string;\n 'megabyte'?: string;\n 'kilobyte'?: string;\n 'byte'?: string;\n 'call-to-action'?: LocaleLabel;\n 'action-button'?: LocaleLabel;\n 'drag-active-message'?: string;\n};\n\nexport const dragNDropFieldInformerPropStatus = [\n 'default',\n 'alert',\n 'warning',\n] as const;\n\nexport type DragNDropFieldInformerPropStatus =\n typeof dragNDropFieldInformerPropStatus[number];\n\nexport type DragNDropFieldInformerProps = {\n
|
|
1
|
+
{"version":3,"file":"types.js","names":["dragNDropFieldInformerPropStatus"],"sources":["../../../../../src/components/DragNDropFieldCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { Accept, DropEvent, FileRejection, FileWithPath } from 'react-dropzone';\n\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type DragNDropFieldChildrenRenderFn = (props: {\n openFileDialog: () => void;\n isFocused: boolean;\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFileDialogActive: boolean;\n acceptedFiles: readonly FileWithPath[];\n fileRejections: readonly FileRejection[];\n}) => React.ReactNode;\n\nexport type DragNDropFieldContentProps = {\n openFileDialog: () => void;\n locale: Required<DragNDropFieldPropLocale>;\n isFocused: boolean;\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFileDialogActive: boolean;\n acceptedFiles: readonly FileWithPath[];\n fileRejections: readonly FileRejection[];\n} & Pick<\n DragNDropFieldProps,\n 'accept' | 'maxSize' | 'multiple' | 'disabled' | 'minSize'\n>;\n\nexport type FileSizes = {\n minSize?: number;\n maxSize?: number;\n};\n\nexport type DragNDropFieldProps = PropsWithHTMLAttributes<\n {\n accept?: Accept;\n maxSize?: number;\n minSize?: number;\n maxFiles?: number;\n multiple?: boolean;\n disabled?: boolean;\n children?: React.ReactNode | DragNDropFieldChildrenRenderFn;\n locale?: DragNDropFieldPropLocale;\n onDrop?: <T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ) => void;\n onDropAccepted?: <T extends File>(files: T[]) => void;\n onDropRejected?: (\n fileRejections: FileRejection[],\n event: DropEvent,\n ) => void;\n onError?: (err: Error) => void;\n },\n HTMLDivElement\n>;\n\nexport type LocaleError =\n | string\n | ((props: { file: File; sizes?: FileSizes }) => string);\n\nexport type LocaleLabel = string | ((props: { fileText: string }) => string);\n\nexport type DragNDropFieldPropLocale = {\n 'file-invalid-type'?: LocaleError;\n 'file-too-large'?: LocaleError;\n 'file-too-small'?: LocaleError;\n 'too-many-files'?: string;\n 'general-error'?: string;\n 'fit-files'?: string;\n 'file'?: string;\n 'files'?: string;\n 'before'?: string;\n 'from'?: string;\n 'gigabyte'?: string;\n 'megabyte'?: string;\n 'kilobyte'?: string;\n 'byte'?: string;\n 'call-to-action'?: LocaleLabel;\n 'action-button'?: LocaleLabel;\n 'drag-active-message'?: string;\n};\n\nexport const dragNDropFieldInformerPropStatus = [\n 'default',\n 'alert',\n 'warning',\n] as const;\n\nexport type DragNDropFieldInformerPropStatus =\n typeof dragNDropFieldInformerPropStatus[number];\n\nexport type DragNDropFieldInformerProps = PropsWithHTMLAttributes<\n {\n status?: DragNDropFieldInformerPropStatus;\n icon?: IconComponent;\n loading?: boolean | number;\n text?: string;\n withButton?: boolean;\n buttonIcon?: IconComponent;\n buttonLabel?: string;\n onButtonClick?: () => void;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAuFA,MAAO,IAAMA,iCAAgC,CAAG,CAC9C,SAD8C,CAE9C,OAF8C,CAG9C,SAH8C,CAAzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatSelect.js","names":["React","forwardRef","FieldInput","useForkRef","cnMixSpace","cn","useSendToAtom","withCtx","withDefault","FlatSelectControlLayout","FlatSelectFooter","FlatSelectList","FlatSelectRoot","useFlatSelect","useRenderItem","cnFlatSelect","FlatSelectRender","p","ref","props","propsAtom","form","disabled","value","isLoading","listRefProp","listRef","renderItemProp","renderItem","getGroupLabel","labelForCreate","labelForEmptyItems","virtualScroll","onScrollToBottom","style","className","placeholder","iconClear","input","inputValue","inputDefaultValue","inputRefProp","inputRef","size","viewProp","view","borderedProp","bordered","getGroupKey","getItemDisabled","getItemGroupKey","getItemKey","getItemLabel","items","onChangeProp","onChange","onCreateProp","onCreate","onInput","multiple","groups","onOpen","ignoreOutsideClicksRefs","clearButton","selectAll","selectAllLabel","autoFocus","footer","listClassName","anchorRef","IconLeft","iconLeft","direction","spareDirection","possibleDirections","otherProps","getOptionActions","openAtom","visibleItemsAtom","inputFocusAtom","handleInputFocus","handleInputBlur","handleInputChange","clearValue","optionsRefs","disabledAtom","clearButtonAtom","highlightedIndexAtom","getItemKeyAtom","valueAtom","onChangeAll","inputValueAtom","hasItemsAtom","groupsCounterAtom","dropdownZIndexAtom","rootRef","fieldInputRef","border","pV","pH","borderTop","borderHorizontal","borderBottom","formTop","formBottom","FlatSelect"],"sources":["../../../../../src/components/FlatSelect/FlatSelect.tsx"],"sourcesContent":["import './FlatSelect.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { FieldInput } from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { useSendToAtom, withCtx } from '##/utils/state';\n\nimport { withDefault } from './defaultProps';\nimport { FlatSelectControlLayout } from './FlatSelectControlLayout';\nimport { FlatSelectFooter } from './FlatSelectFooter';\nimport { FlatSelectList } from './FlatSelectList';\nimport { FlatSelectRoot } from './FlatSelectRoot';\nimport {\n FlatSelectComponent,\n FlatSelectGroupDefault,\n FlatSelectItemDefault,\n FlatSelectProps,\n} from './types';\nimport { useFlatSelect } from './useFlatSelect';\nimport { useRenderItem } from './useRenderItem';\n\nexport const cnFlatSelect = cn('FlatSelect');\n\nconst FlatSelectRender = (\n p: FlatSelectProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const props = withDefault(p);\n const propsAtom = useSendToAtom(props);\n\n const {\n form,\n disabled,\n value,\n isLoading,\n listRef: listRefProp,\n renderItem: renderItemProp,\n getGroupLabel,\n labelForCreate,\n labelForEmptyItems,\n virtualScroll,\n onScrollToBottom,\n style,\n className,\n placeholder,\n iconClear,\n input,\n inputValue,\n inputDefaultValue,\n inputRef: inputRefProp,\n size,\n view: viewProp,\n bordered: borderedProp,\n getGroupKey,\n getItemDisabled,\n getItemGroupKey,\n getItemKey,\n getItemLabel,\n items,\n onChange: onChangeProp,\n onCreate: onCreateProp,\n onInput,\n multiple,\n groups,\n onOpen,\n ignoreOutsideClicksRefs,\n clearButton,\n selectAll,\n selectAllLabel,\n autoFocus,\n footer,\n listClassName,\n anchorRef,\n iconLeft: IconLeft,\n direction,\n spareDirection,\n possibleDirections,\n ...otherProps\n } = props;\n\n const {\n getOptionActions,\n openAtom,\n visibleItemsAtom,\n inputFocusAtom,\n handleInputFocus,\n handleInputBlur,\n inputRef,\n handleInputChange,\n clearValue,\n optionsRefs,\n disabledAtom,\n listRef,\n clearButtonAtom,\n highlightedIndexAtom,\n getItemKeyAtom,\n valueAtom,\n onChangeAll,\n onChange,\n inputValueAtom,\n hasItemsAtom,\n groupsCounterAtom,\n dropdownZIndexAtom,\n rootRef,\n } = useFlatSelect<FlatSelectItemDefault, FlatSelectGroupDefault, false>({\n propsAtom,\n });\n\n const renderItem = useRenderItem({\n getItemLabel,\n getItemDisabled,\n multiple,\n disabled,\n size,\n renderItem: renderItemProp,\n });\n\n const view = !input || anchorRef || borderedProp ? 'clear' : viewProp;\n const bordered = anchorRef ? true : borderedProp;\n const fieldInputRef = useForkRef([inputRef, inputRefProp]);\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <FlatSelectRoot\n {...otherProps}\n ref={useForkRef([ref, rootRef])}\n className={cnFlatSelect(\n {\n view,\n bordered: view === 'clear' ? bordered : undefined,\n form: bordered ? form : undefined,\n size,\n },\n\n [className],\n )}\n style={{\n ...style,\n ['--flat-select-control-height' as string]: `var(--control-height-${size})`,\n }}\n anchorRef={anchorRef}\n openAtom={openAtom}\n tabIndex={0}\n direction={direction}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n >\n {input && (\n <div\n className={cnFlatSelect(\n 'Input',\n {\n border: view === 'clear' ? bordered : undefined,\n form: bordered ? form : undefined,\n },\n [view === 'clear' ? cnMixSpace({ pV: '2xs', pH: 's' }) : undefined],\n )}\n >\n <FlatSelectControlLayout\n form={form}\n disabled={disabled}\n separator\n onClear={clearValue}\n focusAtom={inputFocusAtom}\n iconClear={iconClear}\n leftSide={IconLeft && <IconLeft size=\"s\" />}\n clearButtonAtom={clearButtonAtom}\n size={size}\n view={view}\n valueAtom={inputValueAtom}\n >\n <FieldInput\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n ref={fieldInputRef}\n onChange={handleInputChange}\n value={inputValue}\n defaultValue={inputDefaultValue}\n disabled={disabled}\n placeholder={placeholder}\n />\n </FlatSelectControlLayout>\n </div>\n )}\n <FlatSelectList\n className={cnFlatSelect(\n 'List',\n {\n borderTop: view === 'clear' && !input ? bordered : undefined,\n borderHorizontal: view === 'clear' ? bordered : undefined,\n borderBottom: view === 'clear' && !footer ? bordered : undefined,\n formTop: bordered && !input ? form : undefined,\n formBottom: bordered && !footer ? form : undefined,\n },\n [listClassName],\n )}\n view={view}\n size={size}\n form={form}\n valueAtom={valueAtom}\n getItemKeyAtom={getItemKeyAtom}\n openAtom={openAtom}\n getOptionActions={getOptionActions}\n listRef={useForkRef([listRef, listRefProp])}\n renderItem={renderItem}\n getGroupLabel={getGroupLabel}\n visibleItemsAtom={visibleItemsAtom}\n labelForCreate={labelForCreate}\n isLoading={isLoading}\n labelForEmptyItems={labelForEmptyItems}\n itemsRefs={optionsRefs}\n virtualScroll={virtualScroll}\n onScrollToBottom={onScrollToBottom}\n highlightedIndexAtom={highlightedIndexAtom}\n onChangeAll={onChangeAll}\n onChange={onChange}\n inputValueAtom={inputValueAtom}\n hasItemsAtom={hasItemsAtom}\n groupsCounterAtom={groupsCounterAtom}\n dropdownZIndexAtom={dropdownZIndexAtom}\n selectAllLabel={selectAllLabel}\n disabledAtom={disabledAtom}\n />\n {footer && (\n <FlatSelectFooter\n view={view}\n bordered={bordered}\n form={form}\n footer={footer}\n />\n )}\n </FlatSelectRoot>\n );\n};\n\nexport const FlatSelect = withCtx(\n forwardRef(FlatSelectRender),\n) as FlatSelectComponent;\n"],"mappings":"i2CAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,UAAT,0BACA,OAASC,UAAT,8BACA,OAASC,UAAT,2BACA,OAASC,EAAT,uBACA,OAASC,aAAT,CAAwBC,OAAxB,yBAEA,OAASC,WAAT,sBACA,OAASC,uBAAT,iCACA,OAASC,gBAAT,0BACA,OAASC,cAAT,wBACA,OAASC,cAAT,wBAOA,OAASC,aAAT,uBACA,OAASC,aAAT,uBAEA,MAAO,IAAMC,aAAY,CAAGV,EAAE,CAAC,YAAD,CAAvB,CAEP,GAAMW,iBAAgB,CAAG,SACvBC,CADuB,CAEvBC,CAFuB,CAGpB,IACGC,EAAK,CAAGX,WAAW,CAACS,CAAD,CADtB,CAEGG,CAAS,CAAGd,aAAa,CAACa,CAAD,CAF5B,CAKDE,CALC,CAoDCF,CApDD,CAKDE,IALC,CAMDC,CANC,CAoDCH,CApDD,CAMDG,QANC,CAODC,CAPC,CAoDCJ,CApDD,CAODI,KAPC,CAQDC,CARC,CAoDCL,CApDD,CAQDK,SARC,CAS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AGlG,OAAO,CAC/BN,UAAU,CAACe,gBAAD,CADqB,CAA1B"}
|
|
1
|
+
{"version":3,"file":"FlatSelect.js","names":["React","forwardRef","FieldInput","useForkRef","cnMixSpace","cn","useSendToAtom","withCtx","withDefault","FlatSelectControlLayout","FlatSelectFooter","FlatSelectList","FlatSelectRoot","useFlatSelect","useRenderItem","cnFlatSelect","FlatSelectRender","p","ref","props","propsAtom","form","disabled","value","isLoading","listRefProp","listRef","renderItemProp","renderItem","getGroupLabel","labelForCreate","labelForEmptyItems","virtualScroll","onScrollToBottom","style","className","placeholder","iconClear","input","inputValue","inputDefaultValue","inputRefProp","inputRef","size","viewProp","view","borderedProp","bordered","getGroupKey","getItemDisabled","getItemGroupKey","getItemKey","getItemLabel","items","onChangeProp","onChange","onCreateProp","onCreate","onInput","multiple","groups","onOpen","ignoreOutsideClicksRefs","clearButton","selectAll","selectAllLabel","autoFocus","footer","listClassName","anchorRef","IconLeft","iconLeft","direction","spareDirection","possibleDirections","otherProps","getOptionActions","openAtom","visibleItemsAtom","inputFocusAtom","handleInputFocus","handleInputBlur","handleInputChange","clearValue","optionsRefs","disabledAtom","clearButtonAtom","highlightedIndexAtom","getItemKeyAtom","valueAtom","onChangeAll","inputValueAtom","hasItemsAtom","groupsCounterAtom","dropdownZIndexAtom","rootRef","fieldInputRef","border","pV","pH","borderTop","borderHorizontal","borderBottom","formTop","formBottom","FlatSelect"],"sources":["../../../../../src/components/FlatSelect/FlatSelect.tsx"],"sourcesContent":["import './FlatSelect.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { FieldInput } from '##/components/FieldComponents';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { useSendToAtom, withCtx } from '##/utils/state';\n\nimport { withDefault } from './defaultProps';\nimport { FlatSelectControlLayout } from './FlatSelectControlLayout';\nimport { FlatSelectFooter } from './FlatSelectFooter';\nimport { FlatSelectList } from './FlatSelectList';\nimport { FlatSelectRoot } from './FlatSelectRoot';\nimport {\n FlatSelectComponent,\n FlatSelectGroupDefault,\n FlatSelectItemDefault,\n FlatSelectProps,\n} from './types';\nimport { useFlatSelect } from './useFlatSelect';\nimport { useRenderItem } from './useRenderItem';\n\nexport const cnFlatSelect = cn('FlatSelect');\n\nconst FlatSelectRender = (\n p: FlatSelectProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const props = withDefault(p);\n const propsAtom = useSendToAtom(props);\n\n const {\n form,\n disabled,\n value,\n isLoading,\n listRef: listRefProp,\n renderItem: renderItemProp,\n getGroupLabel,\n labelForCreate,\n labelForEmptyItems,\n virtualScroll,\n onScrollToBottom,\n style,\n className,\n placeholder,\n iconClear,\n input,\n inputValue,\n inputDefaultValue,\n inputRef: inputRefProp,\n size,\n view: viewProp,\n bordered: borderedProp,\n getGroupKey,\n getItemDisabled,\n getItemGroupKey,\n getItemKey,\n getItemLabel,\n items,\n onChange: onChangeProp,\n onCreate: onCreateProp,\n onInput,\n multiple,\n groups,\n onOpen,\n ignoreOutsideClicksRefs,\n clearButton,\n selectAll,\n selectAllLabel,\n autoFocus,\n footer,\n listClassName,\n anchorRef,\n iconLeft: IconLeft,\n direction,\n spareDirection,\n possibleDirections,\n ...otherProps\n } = props;\n\n const {\n getOptionActions,\n openAtom,\n visibleItemsAtom,\n inputFocusAtom,\n handleInputFocus,\n handleInputBlur,\n inputRef,\n handleInputChange,\n clearValue,\n optionsRefs,\n disabledAtom,\n listRef,\n clearButtonAtom,\n highlightedIndexAtom,\n getItemKeyAtom,\n valueAtom,\n onChangeAll,\n onChange,\n inputValueAtom,\n hasItemsAtom,\n groupsCounterAtom,\n dropdownZIndexAtom,\n rootRef,\n } = useFlatSelect<FlatSelectItemDefault, FlatSelectGroupDefault, false>({\n propsAtom,\n });\n\n const renderItem = useRenderItem({\n getItemLabel,\n getItemDisabled,\n multiple,\n disabled,\n size,\n renderItem: renderItemProp,\n });\n\n const view = !input || anchorRef || borderedProp ? 'clear' : viewProp;\n const bordered = anchorRef ? true : borderedProp;\n const fieldInputRef = useForkRef([inputRef, inputRefProp]);\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <FlatSelectRoot\n {...otherProps}\n ref={useForkRef([ref, rootRef])}\n className={cnFlatSelect(\n {\n view,\n bordered: view === 'clear' ? bordered : undefined,\n form: bordered ? form : undefined,\n size,\n },\n [className],\n )}\n style={{\n ...style,\n ['--flat-select-control-height' as string]: `var(--control-height-${size})`,\n }}\n anchorRef={anchorRef}\n openAtom={openAtom}\n tabIndex={0}\n direction={direction}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n >\n {input && (\n <div\n className={cnFlatSelect(\n 'Input',\n {\n border: view === 'clear' ? bordered : undefined,\n form: bordered ? form : undefined,\n },\n [view === 'clear' ? cnMixSpace({ pV: '2xs', pH: 's' }) : undefined],\n )}\n >\n <FlatSelectControlLayout\n form={form}\n disabled={disabled}\n separator\n onClear={clearValue}\n focusAtom={inputFocusAtom}\n iconClear={iconClear}\n leftSide={IconLeft && <IconLeft size=\"s\" />}\n clearButtonAtom={clearButtonAtom}\n size={size}\n view={view}\n valueAtom={inputValueAtom}\n >\n <FieldInput\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n ref={fieldInputRef}\n onChange={handleInputChange}\n value={inputValue}\n defaultValue={inputDefaultValue}\n disabled={disabled}\n placeholder={placeholder}\n />\n </FlatSelectControlLayout>\n </div>\n )}\n <FlatSelectList\n className={cnFlatSelect(\n 'List',\n {\n borderTop: view === 'clear' && !input ? bordered : undefined,\n borderHorizontal: view === 'clear' ? bordered : undefined,\n borderBottom: view === 'clear' && !footer ? bordered : undefined,\n formTop: bordered && !input ? form : undefined,\n formBottom: bordered && !footer ? form : undefined,\n },\n [listClassName],\n )}\n view={view}\n size={size}\n form={form}\n valueAtom={valueAtom}\n getItemKeyAtom={getItemKeyAtom}\n openAtom={openAtom}\n getOptionActions={getOptionActions}\n listRef={useForkRef([listRef, listRefProp])}\n renderItem={renderItem}\n getGroupLabel={getGroupLabel}\n visibleItemsAtom={visibleItemsAtom}\n labelForCreate={labelForCreate}\n isLoading={isLoading}\n labelForEmptyItems={labelForEmptyItems}\n itemsRefs={optionsRefs}\n virtualScroll={virtualScroll}\n onScrollToBottom={onScrollToBottom}\n highlightedIndexAtom={highlightedIndexAtom}\n onChangeAll={onChangeAll}\n onChange={onChange}\n inputValueAtom={inputValueAtom}\n hasItemsAtom={hasItemsAtom}\n groupsCounterAtom={groupsCounterAtom}\n dropdownZIndexAtom={dropdownZIndexAtom}\n selectAllLabel={selectAllLabel}\n disabledAtom={disabledAtom}\n />\n {footer && (\n <FlatSelectFooter\n view={view}\n bordered={bordered}\n form={form}\n footer={footer}\n />\n )}\n </FlatSelectRoot>\n );\n};\n\nexport const FlatSelect = withCtx(\n forwardRef(FlatSelectRender),\n) as FlatSelectComponent;\n"],"mappings":"i2CAAA,yBAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,UAAT,0BACA,OAASC,UAAT,8BACA,OAASC,UAAT,2BACA,OAASC,EAAT,uBACA,OAASC,aAAT,CAAwBC,OAAxB,yBAEA,OAASC,WAAT,sBACA,OAASC,uBAAT,iCACA,OAASC,gBAAT,0BACA,OAASC,cAAT,wBACA,OAASC,cAAT,wBAOA,OAASC,aAAT,uBACA,OAASC,aAAT,uBAEA,MAAO,IAAMC,aAAY,CAAGV,EAAE,CAAC,YAAD,CAAvB,CAEP,GAAMW,iBAAgB,CAAG,SACvBC,CADuB,CAEvBC,CAFuB,CAGpB,IACGC,EAAK,CAAGX,WAAW,CAACS,CAAD,CADtB,CAEGG,CAAS,CAAGd,aAAa,CAACa,CAAD,CAF5B,CAKDE,CALC,CAoDCF,CApDD,CAKDE,IALC,CAMDC,CANC,CAoDCH,CApDD,CAMDG,QANC,CAODC,CAPC,CAoDCJ,CApDD,CAODI,KAPC,CAQDC,CARC,CAoDCL,CApDD,CAQDK,SARC,CASQC,CATR,C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AO,CAC/BN,UAAU,CAACe,gBAAD,CADqB,CAA1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatSelectRoot.js","names":["useAtom","React","forwardRef","useRef","Transition","Popover","useForkRef","animateTimeout","cnMixPopoverAnimate","cn","cnFlatSelectRoot","FlatSelectRoot","props","ref","className","anchorRef","openAtom","direction","spareDirection","possibleDirections","otherProps","contentRef","contentForkedRef","withAnchor","open","animate"],"sources":["../../../../../../src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.tsx"],"sourcesContent":["import './FlatSelectRoot.css';\n\nimport { AtomMut } from '@reatom/framework';\nimport { useAtom } from '@reatom/npm-react';\nimport React, { forwardRef, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Direction, Popover } from '##/components/Popover';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type FlatSelectRootProps = PropsWithHTMLAttributesAndRef<\n {\n anchorRef?: React.RefObject<HTMLElement>;\n openAtom: AtomMut<boolean>;\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n },\n HTMLDivElement\n>;\n\nexport const cnFlatSelectRoot = cn('FlatSelectRoot');\n\nexport const FlatSelectRoot: React.FC<FlatSelectRootProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n anchorRef,\n openAtom,\n direction = 'downStartLeft',\n spareDirection = 'downStartLeft',\n possibleDirections = [\n 'downStartLeft',\n 'downStartRight',\n 'upStartLeft',\n 'upStartRight',\n 'leftStartDown',\n 'leftStartUp',\n ],\n ...otherProps\n } = props;\n const contentRef = useRef(null);\n const contentForkedRef = useForkRef([contentRef, ref]);\n const withAnchor = !!anchorRef;\n const [open] = useAtom(openAtom);\n\n if (withAnchor) {\n return (\n <Transition\n in={open}\n unmountOnExit\n timeout={animateTimeout}\n nodeRef={contentRef}\n >\n {(animate) => (\n <Popover\n {...otherProps}\n className={cnFlatSelectRoot({ withAnchor }, [\n className,\n cnMixPopoverAnimate({ animate }),\n ])}\n ref={contentForkedRef}\n anchorRef={anchorRef}\n equalAnchorWidth\n offset=\"2xs\"\n direction={direction}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n />\n )}\n </Transition>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnFlatSelectRoot(null, [className])}\n ref={ref}\n />\n );\n },\n);\n"],"mappings":"2PAAA,6BAGA,OAASA,OAAT,KAAwB,mBAAxB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAAoBC,OAApB,qBACA,OAASC,UAAT,iCACA,OAASC,cAAT,CAAyBC,mBAAzB,uCACA,OAASC,EAAT,0BAcA,MAAO,IAAMC,iBAAgB,CAAGD,EAAE,CAAC,gBAAD,CAA3B,CAEP,MAAO,IAAME,eAA6C,CAAGT,UAAU,CACrE,SAACU,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAgBVF,CAhBU,CAEZE,SAFY,CAGZC,CAHY,CAgBVH,CAhBU,CAGZG,SAHY,CAIZC,CAJY,CAgBVJ,CAhBU,CAIZI,QAJY,GAgBVJ,CAhBU,CAKZK,SALY,CAKZA,CALY,YAKA,eALA,KAgBVL,CAhBU,CAMZM,cANY,CAMZA,CANY,YAMK,eANL,KAgBVN,CAhBU,CAOZO,kBAPY,CAOZA,CAPY,YAOS,CACnB,eADmB,CAEnB,gBAFmB,CAGnB,aAHmB,CAInB,cAJmB,CAKnB,eALmB,CAMnB,aANmB,CAPT,GAeTC,CAfS,0BAgBVR,CAhBU,
|
|
1
|
+
{"version":3,"file":"FlatSelectRoot.js","names":["useAtom","React","forwardRef","useRef","Transition","Popover","useForkRef","animateTimeout","cnMixPopoverAnimate","cn","cnFlatSelectRoot","FlatSelectRoot","props","ref","className","anchorRef","openAtom","direction","spareDirection","possibleDirections","otherProps","contentRef","contentForkedRef","withAnchor","open","animate"],"sources":["../../../../../../src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.tsx"],"sourcesContent":["import './FlatSelectRoot.css';\n\nimport { AtomMut } from '@reatom/framework';\nimport { useAtom } from '@reatom/npm-react';\nimport React, { forwardRef, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Direction, Popover } from '##/components/Popover';\nimport { useForkRef } from '##/hooks/useForkRef';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type FlatSelectRootProps = PropsWithHTMLAttributesAndRef<\n {\n anchorRef?: React.RefObject<HTMLElement>;\n openAtom: AtomMut<boolean>;\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n },\n HTMLDivElement\n>;\n\nexport const cnFlatSelectRoot = cn('FlatSelectRoot');\n\nexport const FlatSelectRoot: React.FC<FlatSelectRootProps> = forwardRef(\n (props, ref) => {\n const {\n className,\n anchorRef,\n openAtom,\n direction = 'downStartLeft',\n spareDirection = 'downStartLeft',\n possibleDirections = [\n 'downStartLeft',\n 'downStartRight',\n 'upStartLeft',\n 'upStartRight',\n 'leftStartDown',\n 'leftStartUp',\n ],\n ...otherProps\n } = props;\n\n const contentRef = useRef(null);\n const contentForkedRef = useForkRef([contentRef, ref]);\n const withAnchor = !!anchorRef;\n const [open] = useAtom(openAtom);\n\n if (withAnchor) {\n return (\n <Transition\n in={open}\n unmountOnExit\n timeout={animateTimeout}\n nodeRef={contentRef}\n >\n {(animate) => (\n <Popover\n {...otherProps}\n className={cnFlatSelectRoot({ withAnchor }, [\n className,\n cnMixPopoverAnimate({ animate }),\n ])}\n ref={contentForkedRef}\n anchorRef={anchorRef}\n equalAnchorWidth\n offset=\"2xs\"\n direction={direction}\n spareDirection={spareDirection}\n possibleDirections={possibleDirections}\n />\n )}\n </Transition>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnFlatSelectRoot(null, [className])}\n ref={ref}\n />\n );\n },\n);\n"],"mappings":"2PAAA,6BAGA,OAASA,OAAT,KAAwB,mBAAxB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAAoBC,OAApB,qBACA,OAASC,UAAT,iCACA,OAASC,cAAT,CAAyBC,mBAAzB,uCACA,OAASC,EAAT,0BAcA,MAAO,IAAMC,iBAAgB,CAAGD,EAAE,CAAC,gBAAD,CAA3B,CAEP,MAAO,IAAME,eAA6C,CAAGT,UAAU,CACrE,SAACU,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAgBVF,CAhBU,CAEZE,SAFY,CAGZC,CAHY,CAgBVH,CAhBU,CAGZG,SAHY,CAIZC,CAJY,CAgBVJ,CAhBU,CAIZI,QAJY,GAgBVJ,CAhBU,CAKZK,SALY,CAKZA,CALY,YAKA,eALA,KAgBVL,CAhBU,CAMZM,cANY,CAMZA,CANY,YAMK,eANL,KAgBVN,CAhBU,CAOZO,kBAPY,CAOZA,CAPY,YAOS,CACnB,eADmB,CAEnB,gBAFmB,CAGnB,aAHmB,CAInB,cAJmB,CAKnB,eALmB,CAMnB,aANmB,CAPT,GAeTC,CAfS,0BAgBVR,CAhBU,YAkBRS,CAAU,CAAGlB,MAAM,CAAC,IAAD,CAlBX,CAmBRmB,CAAgB,CAAGhB,UAAU,CAAC,CAACe,CAAD,CAAaR,CAAb,CAAD,CAnBrB,CAoBRU,CAAU,CAAG,CAAC,CAACR,CApBP,GAqBCf,OAAO,CAACgB,CAAD,CArBR,uBAqBPQ,CArBO,YAuBVD,EAvBU,CAyBV,oBAAC,UAAD,EACE,GAAIC,CADN,CAEE,aAAa,GAFf,CAGE,OAAO,CAAEjB,cAHX,CAIE,OAAO,CAAEc,CAJX,EAMG,SAACI,CAAD,QACC,qBAAC,OAAD,kBACML,CADN,EAEE,SAAS,CAAEV,gBAAgB,CAAC,CAAEa,UAAU,CAAVA,CAAF,CAAD,CAAiB,CAC1CT,CAD0C,CAE1CN,mBAAmB,CAAC,CAAEiB,OAAO,CAAPA,CAAF,CAAD,CAFuB,CAAjB,CAF7B,CAME,GAAG,CAAEH,CANP,CAOE,SAAS,CAAEP,CAPb,CAQE,gBAAgB,GARlB,CASE,MAAM,CAAC,KATT,CAUE,SAAS,CAAEE,CAVb,CAWE,cAAc,CAAEC,CAXlB,CAYE,kBAAkB,CAAEC,CAZtB,GADD,CANH,CAzBU,CAoDZ,2CACMC,CADN,EAEE,SAAS,CAAEV,gBAAgB,CAAC,IAAD,CAAO,CAACI,CAAD,CAAP,CAF7B,CAGE,GAAG,CAAED,CAHP,GAMH,CA3DoE,CAAhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","names":["objectWithDefault","defaultLabelForEmptyItems","defaultSelectAllLabel","getItemKey","item","id","getGroupKey","group","getGroupLabel","label","getItemDisabled","disabled","getItemGroupKey","groupId","getItemLabel","defaultProps","form","labelForEmptyItems","selectAllLabel","view","size","withDefault","props"],"sources":["../../../../../src/components/FlatSelect/defaultProps.ts"],"sourcesContent":["import {\n objectWithDefault,\n WithDefaultReturn,\n} from '@consta/uikit/__internal__/src/utils/object';\n\nimport {\n FlatSelectGroupDefault,\n FlatSelectItemDefault,\n FlatSelectPropsInit,\n} from '.';\n\
|
|
1
|
+
{"version":3,"file":"defaultProps.js","names":["objectWithDefault","defaultLabelForEmptyItems","defaultSelectAllLabel","getItemKey","item","id","getGroupKey","group","getGroupLabel","label","getItemDisabled","disabled","getItemGroupKey","groupId","getItemLabel","defaultProps","form","labelForEmptyItems","selectAllLabel","view","size","withDefault","props"],"sources":["../../../../../src/components/FlatSelect/defaultProps.ts"],"sourcesContent":["import {\n objectWithDefault,\n WithDefaultReturn,\n} from '@consta/uikit/__internal__/src/utils/object';\n\nimport {\n FlatSelectGroupDefault,\n FlatSelectItemDefault,\n FlatSelectPropsInit,\n} from '.';\n\nexport const defaultLabelForEmptyItems = 'Список пуст';\nexport const defaultSelectAllLabel = 'Выбрать все';\n\nconst getItemKey = (item: FlatSelectItemDefault) => item.id;\nconst getGroupKey = (group: FlatSelectGroupDefault) => group.id;\nconst getGroupLabel = (group: FlatSelectGroupDefault) => group.label;\nconst getItemDisabled = (item: FlatSelectItemDefault) => item.disabled;\nconst getItemGroupKey = (item: FlatSelectItemDefault) => item.groupId;\nconst getItemLabel = (item: FlatSelectItemDefault) => item.label;\n\nconst defaultProps = {\n form: 'default',\n getItemKey,\n getGroupKey,\n getGroupLabel,\n getItemDisabled,\n getItemGroupKey,\n getItemLabel,\n labelForEmptyItems: defaultLabelForEmptyItems,\n selectAllLabel: defaultSelectAllLabel,\n view: 'default',\n size: 'm',\n} as const;\n\nexport const withDefault = <\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: FlatSelectPropsInit<ITEM, GROUP, MULTIPLE>,\n): PropsWithDefault<ITEM, GROUP, MULTIPLE> =>\n objectWithDefault(defaultProps as any, props);\n\nexport type PropsWithDefaultMultiple = WithDefaultReturn<\n FlatSelectPropsInit<FlatSelectItemDefault, FlatSelectGroupDefault, true>,\n keyof typeof defaultProps\n>;\n\nexport type PropsWithDefaultSingle = WithDefaultReturn<\n FlatSelectPropsInit<FlatSelectItemDefault, FlatSelectGroupDefault, false>,\n keyof typeof defaultProps\n>;\n\nexport type PropsWithDefault<\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = WithDefaultReturn<\n FlatSelectPropsInit<ITEM, GROUP, MULTIPLE>,\n keyof typeof defaultProps\n>;\n"],"mappings":"AAAA,OACEA,iBADF,KAGO,6CAHP,CAWA,MAAO,IAAMC,0BAAyB,CAAG,+DAAlC,CACP,MAAO,IAAMC,sBAAqB,CAAG,+DAA9B,C,GAEDC,WAAU,CAAG,SAACC,CAAD,QAAiCA,EAAI,CAACC,EAAtC,C,CACbC,WAAW,CAAG,SAACC,CAAD,QAAmCA,EAAK,CAACF,EAAzC,C,CACdG,aAAa,CAAG,SAACD,CAAD,QAAmCA,EAAK,CAACE,KAAzC,C,CAChBC,eAAe,CAAG,SAACN,CAAD,QAAiCA,EAAI,CAACO,QAAtC,C,CAClBC,eAAe,CAAG,SAACR,CAAD,QAAiCA,EAAI,CAACS,OAAtC,C,CAClBC,YAAY,CAAG,SAACV,CAAD,QAAiCA,EAAI,CAACK,KAAtC,C,CAEfM,YAAY,CAAG,CACnBC,IAAI,CAAE,SADa,CAEnBb,UAAU,CAAVA,UAFmB,CAGnBG,WAAW,CAAXA,WAHmB,CAInBE,aAAa,CAAbA,aAJmB,CAKnBE,eAAe,CAAfA,eALmB,CAMnBE,eAAe,CAAfA,eANmB,CAOnBE,YAAY,CAAZA,YAPmB,CAQnBG,kBAAkB,gEARC,CASnBC,cAAc,gEATK,CAUnBC,IAAI,CAAE,SAVa,CAWnBC,IAAI,CAAE,GAXa,C,CAcrB,MAAO,IAAMC,YAAW,CAAG,SAKzBC,CALyB,QAOzBtB,kBAAiB,CAACe,YAAD,CAAsBO,CAAtB,CAPQ,CAApB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.deprecated--Modal{--modal-window-animate-space:var(--space-xl);bottom:0;display:flex;justify-content:center;left:0;padding:var(--space-5xl);position:fixed;right:0;top:0}.deprecated--Modal:not(.Modal_hasOverlay){pointer-events:none}.deprecated--Modal-Window{background-color:var(--color-bg-default);border-radius:var(--control-radius);box-shadow:var(--shadow-modal);max-height:90%;max-width:90%;min-height:200px;overflow:auto;pointer-events:auto;position:absolute}.deprecated--Modal-Window_position_center{align-self:safe center}.deprecated--Modal-Window_position_top{align-self:safe flex-start}.deprecated--Modal-Overlay{background:var(--color-bg-tone);border:none;height:100%;left:0;padding:0;position:absolute;top:0;transition:.2s;width:100%}.deprecated--Modal-Overlay_animate_exited,.deprecated--Modal-Overlay_animate_exiting{opacity:0}.deprecated--Modal-Overlay_animate_entered,.deprecated--Modal-Overlay_animate_entering{opacity:1}.deprecated--Modal-Overlay_animate_entered,.deprecated--Modal-Overlay_animate_entering,.deprecated--Modal-Overlay_animate_exiting{transition:opacity .2s}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './ModalDeprecated.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
declare const modalPropWidth: readonly ["auto"];
|
|
5
|
+
type ModalPropWidth = typeof modalPropWidth[number];
|
|
6
|
+
declare const modalPropPosition: readonly ["center", "top"];
|
|
7
|
+
type ModalPropPosition = typeof modalPropPosition[number];
|
|
8
|
+
type ModalProps = PropsWithHTMLAttributes<{
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
hasOverlay?: boolean;
|
|
13
|
+
/** @deprecated use onClickOutside */
|
|
14
|
+
onOverlayClick?: (event: MouseEvent) => void;
|
|
15
|
+
onClickOutside?: (event: MouseEvent) => void;
|
|
16
|
+
onEsc?: (event: KeyboardEvent) => void;
|
|
17
|
+
rootClassName?: string;
|
|
18
|
+
width?: ModalPropWidth;
|
|
19
|
+
position?: ModalPropPosition;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
container?: HTMLDivElement | undefined;
|
|
22
|
+
afterClose?: () => void;
|
|
23
|
+
refsForExcludeClickOutside?: React.RefObject<HTMLElement>[];
|
|
24
|
+
}, HTMLDivElement>;
|
|
25
|
+
export declare const cnModal: import("@bem-react/classname").ClassNameFormatter;
|
|
26
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["isOpen","onClose","onOpen","hasOverlay","onOverlayClick","onClickOutside","onEsc","className","width","position","children","container","refsForExcludeClickOutside","rootClassName","afterClose","style"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"./ModalDeprecated.css";import React,{useEffect,useRef}from"react";import{Transition}from"react-transition-group";import{PortalWithTheme,PortalWithThemeConsumer}from"../PortalWithTheme";import{useTheme}from"../Theme/Theme";import{useGlobalKeys}from"../../hooks/useGlobalKeys";import{animateTimeout,cnMixPopoverAnimate}from"../../mixs/MixPopoverAnimate";import{cnMixScrollBar}from"../../mixs/MixScrollBar";import{cnDeprecated as cn}from"../../utils/bem";var modalPropWidth=["auto"],modalPropWidthDefault=modalPropWidth[0],modalPropPosition=["center","top"],modalPropPositionDefault=modalPropPosition[0];export var cnModal=cn("Modal");export var Modal=function(a){var b=a.isOpen,c=a.onClose,d=a.onOpen,e=a.hasOverlay,f=void 0===e||e,g=a.onOverlayClick,h=a.onClickOutside,i=a.onEsc,j=a.className,k=a.width,l=void 0===k?modalPropWidthDefault:k,m=a.position,n=void 0===m?modalPropPositionDefault:m,o=a.children,p=a.container,q=void 0===p?window.document.body:p,r=a.refsForExcludeClickOutside,s=a.rootClassName,t=a.afterClose,u=a.style,v=_objectWithoutProperties(a,_excluded),w=useRef(null),x=useRef(null),y=useTheme(),z=y.theme;return useEffect(function(){b?null===d||void 0===d?void 0:d():null===c||void 0===c?void 0:c()},[b]),useGlobalKeys({Escape:function Escape(a){return b&&i&&i(a)}}),React.createElement(Transition,{in:b,unmountOnExit:!0,nodeRef:x,timeout:animateTimeout,onExited:t},function(a){return React.createElement(PortalWithTheme,{preset:z,container:q,className:cnModal({hasOverlay:f},[s]),ref:x,style:"number"==typeof(null===u||void 0===u?void 0:u.zIndex)?{zIndex:u.zIndex}:void 0},f&&React.createElement("div",{className:cnModal("Overlay",{animate:a}),"aria-label":"Overlay"}),React.createElement("div",Object.assign({},v,{style:_objectSpread(_objectSpread({},u),{},{zIndex:void 0}),className:cnModal("Window",{width:l,position:n},[cnMixPopoverAnimate({animate:a}),j,cnMixScrollBar()]),ref:w}),React.createElement(PortalWithThemeConsumer,{onClickOutside:h||g,ignoreClicksInsideRefs:[].concat(_toConsumableArray(r||[]),[w])},o)))})};
|
|
2
|
+
//# sourceMappingURL=ModalDeprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalDeprecated.js","names":["React","useEffect","useRef","Transition","PortalWithTheme","PortalWithThemeConsumer","useTheme","useGlobalKeys","animateTimeout","cnMixPopoverAnimate","cnMixScrollBar","cnDeprecated","cn","modalPropWidth","modalPropWidthDefault","modalPropPosition","modalPropPositionDefault","cnModal","Modal","props","isOpen","onClose","onOpen","hasOverlay","onOverlayClick","onClickOutside","onEsc","className","width","position","children","container","window","document","body","refsForExcludeClickOutside","rootClassName","afterClose","style","otherProps","ref","portalRef","theme","Escape","e","animate","zIndex"],"sources":["../../../../../src/components/ModalDeprecated/ModalDeprecated.tsx"],"sourcesContent":["import './ModalDeprecated.css';\n\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport {\n PortalWithTheme,\n PortalWithThemeConsumer,\n} from '##/components/PortalWithTheme';\nimport { useTheme } from '##/components/Theme/Theme';\nimport { useGlobalKeys } from '##/hooks/useGlobalKeys';\nimport { animateTimeout, cnMixPopoverAnimate } from '##/mixs/MixPopoverAnimate';\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnDeprecated as cn } from '##/utils/bem';\nimport { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nconst modalPropWidth = ['auto'] as const;\ntype ModalPropWidth = typeof modalPropWidth[number];\nconst modalPropWidthDefault: ModalPropWidth = modalPropWidth[0];\n\nconst modalPropPosition = ['center', 'top'] as const;\ntype ModalPropPosition = typeof modalPropPosition[number];\nconst modalPropPositionDefault: ModalPropPosition = modalPropPosition[0];\n\ntype ModalProps = PropsWithHTMLAttributes<\n {\n isOpen?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n hasOverlay?: boolean;\n /** @deprecated use onClickOutside */\n onOverlayClick?: (event: MouseEvent) => void;\n onClickOutside?: (event: MouseEvent) => void;\n onEsc?: (event: KeyboardEvent) => void;\n rootClassName?: string;\n width?: ModalPropWidth;\n position?: ModalPropPosition;\n children?: React.ReactNode;\n container?: HTMLDivElement | undefined;\n afterClose?: () => void;\n refsForExcludeClickOutside?: React.RefObject<HTMLElement>[];\n },\n HTMLDivElement\n>;\n\nexport const cnModal = cn('Modal');\n\nexport const Modal: React.FC<ModalProps> = (props) => {\n const {\n isOpen,\n onClose,\n onOpen,\n hasOverlay = true,\n onOverlayClick,\n onClickOutside,\n onEsc,\n className,\n width = modalPropWidthDefault,\n position = modalPropPositionDefault,\n children,\n container = window.document.body,\n refsForExcludeClickOutside,\n rootClassName,\n afterClose,\n style,\n ...otherProps\n } = props;\n\n const ref = useRef<HTMLDivElement | null>(null);\n const portalRef = useRef<HTMLDivElement | null>(null);\n const { theme } = useTheme();\n\n useEffect(() => {\n if (isOpen) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [isOpen]);\n\n useGlobalKeys({\n Escape: (e: KeyboardEvent) => isOpen && onEsc && onEsc(e),\n });\n\n return (\n <Transition\n in={isOpen}\n unmountOnExit\n nodeRef={portalRef}\n timeout={animateTimeout}\n onExited={afterClose}\n >\n {(animate) => (\n <PortalWithTheme\n preset={theme}\n container={container}\n className={cnModal({ hasOverlay }, [rootClassName])}\n ref={portalRef}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex }\n : undefined\n }\n >\n {hasOverlay && (\n <div\n className={cnModal('Overlay', { animate })}\n aria-label=\"Overlay\"\n />\n )}\n <div\n {...otherProps}\n style={{\n ...style,\n zIndex: undefined,\n }}\n className={cnModal('Window', { width, position }, [\n cnMixPopoverAnimate({ animate }),\n className,\n cnMixScrollBar(),\n ])}\n ref={ref}\n >\n <PortalWithThemeConsumer\n onClickOutside={onClickOutside || onOverlayClick}\n ignoreClicksInsideRefs={[\n ...(refsForExcludeClickOutside || []),\n ref,\n ]}\n >\n {children}\n </PortalWithThemeConsumer>\n </div>\n </PortalWithTheme>\n )}\n </Transition>\n );\n};\n"],"mappings":"8hCAAA,8BAEA,MAAOA,MAAP,EAAgBC,SAAhB,CAA2BC,MAA3B,KAAyC,OAAzC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OACEC,eADF,CAEEC,uBAFF,0BAIA,OAASC,QAAT,sBACA,OAASC,aAAT,iCACA,OAASC,cAAT,CAAyBC,mBAAzB,oCACA,OAASC,cAAT,+BACA,OAASC,YAAY,GAAIC,GAAzB,uB,GAGMC,eAAc,CAAG,CAAC,MAAD,C,CAEjBC,qBAAqC,CAAGD,cAAc,CAAC,CAAD,C,CAEtDE,iBAAiB,CAAG,CAAC,QAAD,CAAW,KAAX,C,CAEpBC,wBAA2C,CAAGD,iBAAiB,CAAC,CAAD,C,CAuBrE,MAAO,IAAME,QAAO,CAAGL,EAAE,CAAC,OAAD,CAAlB,CAEP,MAAO,IAAMM,MAA2B,CAAG,SAACC,CAAD,CAAW,IAElDC,EAFkD,CAmBhDD,CAnBgD,CAElDC,MAFkD,CAGlDC,CAHkD,CAmBhDF,CAnBgD,CAGl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+1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/ModalDeprecated/index.ts"],"sourcesContent":["export * from './ModalDeprecated';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Notification{display:flex;flex-direction:column}.Notification-GroupLabel{background:var(--color-bg-secondary)}.Notification-Header{align-items:center;border-bottom:1px solid var(--color-bg-border);display:flex;flex:none}.Notification-HeaderItem{flex:none;margin-right:var(--space-xs)}.Notification-HeaderItem:last-child{margin-right:0}.Notification-HeaderItem:first-child{flex:1}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","items","groups","getItemLabel","getGroupId","getGroupLabel","getItemActions","getItemContent","getItemGroup","getItemRead","getItemUserName","getItemUserImage","getItemCaption","sortGroups","getGroupActions","itemSpace","groupSpace","itemRender","getItemClassName","groupRender","onItemClick","scrollContainerRef"];import"./Notification.css";import React,{forwardRef,Fragment}from"react";import{cnMixSpace}from"../../../mixs/MixSpace";import{cn}from"../../../utils/bem";import{getGroups}from"../../../utils/getGroups";import{NotificationGroup}from"../NotificationGroup";import{NotificationItem}from"../NotificationItem";import{withDefaultGetters}from"./helpers";export var cnNotification=cn("Notification");function NotificationRender(a,b){var c,d=withDefaultGetters(a),e=d.className,f=d.items,g=d.groups,h=d.getItemLabel,i=d.getGroupId,j=d.getGroupLabel,k=d.getItemActions,l=d.getItemContent,m=d.getItemGroup,n=d.getItemRead,o=d.getItemUserName,p=d.getItemUserImage,q=d.getItemCaption,r=d.sortGroups,s=d.getGroupActions,t=d.itemSpace,u=d.groupSpace,v=d.itemRender,w=d.getItemClassName,x=d.groupRender,y=d.onItemClick,z=d.scrollContainerRef,A=_objectWithoutProperties(d,_excluded),B=getGroups(f,m,g,i,r),C="number"==typeof(null===(c=a.style)||void 0===c?void 0:c.zIndex)?a.style.zIndex+1:void 0;return React.createElement("div",Object.assign({},A,{ref:b,className:cnNotification(null,[e])}),B.map(function(a,b){return React.createElement(Fragment,{key:cnNotification("Group",{groupIndex:b})},x?x(a):React.createElement(NotificationGroup,{className:cnNotification("Group",[cnMixSpace(u||{pV:"xs",pH:"s",mB:"s"})]),key:cnNotification("Group",{groupIndex:b}),title:j(a),actions:null===s||void 0===s?void 0:s(a)}),a.items.map(function(a,b){return v?v(a):React.createElement(NotificationItem,{className:cnNotification("Item",[cnMixSpace(t||{pH:"s",mB:"s"}),null===w||void 0===w?void 0:w(a)]),key:cnNotification("Item",{itemIndex:b}),title:h(a),content:l(a),userName:o(a),userImageUrl:p(a),actions:k(a),caption:q(a),read:n(a),style:{zIndex:C},scrollContainerRef:z,onClick:y?function(b){return y(a,{e:b})}:void 0})}))}))}export var Notification=forwardRef(NotificationRender);
|
|
2
|
+
//# sourceMappingURL=Notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["React","forwardRef","Fragment","cnMixSpace","cn","getGroups","NotificationGroup","NotificationItem","withDefaultGetters","cnNotification","NotificationRender","props","ref","className","items","groups","getItemLabel","getGroupId","getGroupLabel","getItemActions","getItemContent","getItemGroup","getItemRead","getItemUserName","getItemUserImage","getItemCaption","sortGroups","getGroupActions","itemSpace","groupSpace","itemRender","getItemClassName","groupRender","onItemClick","scrollContainerRef","otherProps","resultGroups","elementZIndex","style","zIndex","map","group","groupIndex","pV","pH","mB","item","itemIndex","e","Notification"],"sources":["../../../../../../src/components/Notification/Notification/Notification.tsx"],"sourcesContent":["import './Notification.css';\n\nimport React, { forwardRef, Fragment } from 'react';\n\nimport { cnMixSpace } from '##/mixs/MixSpace';\nimport { cn } from '##/utils/bem';\nimport { getGroups } from '##/utils/getGroups';\n\nimport { NotificationGroup } from '../NotificationGroup';\nimport { NotificationItem } from '../NotificationItem';\nimport { withDefaultGetters } from './helpers';\nimport { NotificationComponent, NotificationProps } from './types';\n\nexport const cnNotification = cn('Notification');\n\nfunction NotificationRender(\n props: NotificationProps,\n ref: React.Ref<HTMLDivElement>,\n) {\n const {\n className,\n items,\n groups,\n getItemLabel,\n getGroupId,\n getGroupLabel,\n getItemActions,\n getItemContent,\n getItemGroup,\n getItemRead,\n getItemUserName,\n getItemUserImage,\n getItemCaption,\n sortGroups,\n getGroupActions,\n itemSpace,\n groupSpace,\n itemRender,\n getItemClassName,\n groupRender,\n onItemClick,\n scrollContainerRef,\n ...otherProps\n } = withDefaultGetters(props);\n\n const resultGroups = getGroups(\n items,\n getItemGroup,\n groups,\n getGroupId,\n sortGroups,\n );\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnNotification(null, [className])}\n >\n {resultGroups.map((group, groupIndex) => (\n <Fragment key={cnNotification('Group', { groupIndex })}>\n {groupRender ? (\n groupRender(group)\n ) : (\n <NotificationGroup\n className={cnNotification('Group', [\n cnMixSpace(groupSpace || { pV: 'xs', pH: 's', mB: 's' }),\n ])}\n key={cnNotification('Group', { groupIndex })}\n title={getGroupLabel(group)}\n actions={getGroupActions?.(group)}\n />\n )}\n {group.items.map((item, itemIndex) => {\n return itemRender ? (\n itemRender(item)\n ) : (\n <NotificationItem\n className={cnNotification('Item', [\n cnMixSpace(itemSpace || { pH: 's', mB: 's' }),\n getItemClassName?.(item),\n ])}\n key={cnNotification('Item', { itemIndex })}\n title={getItemLabel(item)}\n content={getItemContent(item)}\n userName={getItemUserName(item)}\n userImageUrl={getItemUserImage(item)}\n actions={getItemActions(item)}\n caption={getItemCaption(item)}\n read={getItemRead(item)}\n style={{ zIndex: elementZIndex }}\n scrollContainerRef={scrollContainerRef}\n onClick={\n onItemClick ? (e) => onItemClick(item, { e }) : undefined\n }\n />\n );\n })}\n </Fragment>\n ))}\n </div>\n );\n}\n\nexport const Notification = forwardRef(\n NotificationRender,\n) as NotificationComponent;\n"],"mappings":"4aAAA,2BAEA,MAAOA,MAAP,EAAgBC,UAAh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AQ,CAAEvB,CAAe,CAACuB,CAAD,CAR3B,CASE,YAAY,CAAEtB,CAAgB,CAACsB,CAAD,CAThC,CAUE,OAAO,CAAE3B,CAAc,CAAC2B,CAAD,CAVzB,CAWE,OAAO,CAAErB,CAAc,CAACqB,CAAD,CAXzB,CAYE,IAAI,CAAExB,CAAW,CAACwB,CAAD,CAZnB,CAaE,KAAK,CAAE,CAAEP,MAAM,CAAEF,CAAV,CAbT,CAcE,kBAAkB,CAAEH,CAdtB,CAeE,OAAO,CACLD,CAAW,CAAG,SAACe,CAAD,QAAOf,EAAW,CAACa,CAAD,CAAO,CAAEE,CAAC,CAADA,CAAF,CAAP,CAAlB,CAAH,OAhBf,EAoBH,CAxBA,CAbH,CADgB,CAAjB,CALH,CAgDH,CAED,MAAO,IAAMC,aAAY,CAAGhD,UAAU,CACpCS,kBADoC,CAA/B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { NotificationDefaultGroup, NotificationDefaultItem, NotificationPropGetGroupActions, NotificationPropGetGroupId, NotificationPropGetGroupLabel, NotificationPropGetItemActions, NotificationPropGetItemCaption, NotificationPropGetItemContent, NotificationPropGetItemGroup, NotificationPropGetItemLabel, NotificationPropGetItemRead, NotificationPropGetItemUserImage, NotificationProps } from './types';
|
|
2
|
+
export declare function withDefaultGetters<ITEM, GROUP>(props: NotificationProps<ITEM, GROUP>): import("react").PropsWithoutRef<{
|
|
3
|
+
children?: never;
|
|
4
|
+
items: ITEM[];
|
|
5
|
+
getItemLabel?: NotificationPropGetItemLabel<ITEM> | undefined;
|
|
6
|
+
getItemClassName?: import("./types").NotificationPropGetItemClassName<ITEM> | undefined;
|
|
7
|
+
getItemContent?: NotificationPropGetItemContent<ITEM> | undefined;
|
|
8
|
+
getItemRead?: NotificationPropGetItemRead<ITEM> | undefined;
|
|
9
|
+
getItemCaption?: NotificationPropGetItemCaption<ITEM> | undefined;
|
|
10
|
+
itemRender?: import("./types").NotificationPropGetItemRender<ITEM> | undefined;
|
|
11
|
+
getItemActions?: NotificationPropGetItemActions<ITEM> | undefined;
|
|
12
|
+
getItemGroup?: NotificationPropGetItemGroup<ITEM> | undefined;
|
|
13
|
+
getItemUserName?: import("./types").NotificationPropGetItemUserName<ITEM> | undefined;
|
|
14
|
+
getItemUserImage?: NotificationPropGetItemUserImage<ITEM> | undefined;
|
|
15
|
+
onItemClick?: import("./types").NotificationPropOnItemClick<ITEM> | undefined;
|
|
16
|
+
getGroupId?: NotificationPropGetGroupId<GROUP> | undefined;
|
|
17
|
+
getGroupActions?: NotificationPropGetGroupActions<ITEM, GROUP> | undefined;
|
|
18
|
+
getGroupLabel?: NotificationPropGetGroupLabel<ITEM, GROUP> | undefined;
|
|
19
|
+
groupRender?: import("./types").NotificationPropGetGroupRender<ITEM, GROUP> | undefined;
|
|
20
|
+
groups?: GROUP[] | undefined;
|
|
21
|
+
sortGroups?: import("./types").NotificationPropSortGroups<ITEM, GROUP> | undefined;
|
|
22
|
+
itemSpace?: import("../../../mixs/MixSpace").MixSpaceProps;
|
|
23
|
+
groupSpace?: import("../../../mixs/MixSpace").MixSpaceProps;
|
|
24
|
+
scrollContainerRef?: React.RefObject<HTMLDivElement>;
|
|
25
|
+
} & (GROUP extends {
|
|
26
|
+
id: NotificationDefaultGroup["id"];
|
|
27
|
+
} ? {} : {
|
|
28
|
+
getGroupId: NotificationPropGetGroupId<GROUP>;
|
|
29
|
+
})> & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | keyof import("react").PropsWithoutRef<{
|
|
30
|
+
children?: never;
|
|
31
|
+
items: ITEM[];
|
|
32
|
+
getItemLabel?: NotificationPropGetItemLabel<ITEM> | undefined;
|
|
33
|
+
getItemClassName?: import("./types").NotificationPropGetItemClassName<ITEM> | undefined;
|
|
34
|
+
getItemContent?: NotificationPropGetItemContent<ITEM> | undefined;
|
|
35
|
+
getItemRead?: NotificationPropGetItemRead<ITEM> | undefined;
|
|
36
|
+
getItemCaption?: NotificationPropGetItemCaption<ITEM> | undefined;
|
|
37
|
+
itemRender?: import("./types").NotificationPropGetItemRender<ITEM> | undefined;
|
|
38
|
+
getItemActions?: NotificationPropGetItemActions<ITEM> | undefined;
|
|
39
|
+
getItemGroup?: NotificationPropGetItemGroup<ITEM> | undefined;
|
|
40
|
+
getItemUserName?: import("./types").NotificationPropGetItemUserName<ITEM> | undefined;
|
|
41
|
+
getItemUserImage?: NotificationPropGetItemUserImage<ITEM> | undefined;
|
|
42
|
+
onItemClick?: import("./types").NotificationPropOnItemClick<ITEM> | undefined;
|
|
43
|
+
getGroupId?: NotificationPropGetGroupId<GROUP> | undefined;
|
|
44
|
+
getGroupActions?: NotificationPropGetGroupActions<ITEM, GROUP> | undefined;
|
|
45
|
+
getGroupLabel?: NotificationPropGetGroupLabel<ITEM, GROUP> | undefined;
|
|
46
|
+
groupRender?: import("./types").NotificationPropGetGroupRender<ITEM, GROUP> | undefined;
|
|
47
|
+
groups?: GROUP[] | undefined;
|
|
48
|
+
sortGroups?: import("./types").NotificationPropSortGroups<ITEM, GROUP> | undefined;
|
|
49
|
+
itemSpace?: import("../../../mixs/MixSpace").MixSpaceProps;
|
|
50
|
+
groupSpace?: import("../../../mixs/MixSpace").MixSpaceProps;
|
|
51
|
+
scrollContainerRef?: React.RefObject<HTMLDivElement>;
|
|
52
|
+
} & (GROUP extends {
|
|
53
|
+
id: NotificationDefaultGroup["id"];
|
|
54
|
+
} ? {} : {
|
|
55
|
+
getGroupId: NotificationPropGetGroupId<GROUP>;
|
|
56
|
+
})>> & {
|
|
57
|
+
getGroupId: NotificationPropGetGroupId<NotificationDefaultGroup> | NotificationPropGetGroupId<GROUP>;
|
|
58
|
+
getGroupLabel: NotificationPropGetGroupLabel<NotificationDefaultItem, NotificationDefaultGroup> | NotificationPropGetGroupLabel<ITEM, GROUP>;
|
|
59
|
+
getGroupActions: NotificationPropGetGroupActions<NotificationDefaultItem, NotificationDefaultGroup> | NotificationPropGetGroupActions<ITEM, GROUP>;
|
|
60
|
+
getItemActions: NotificationPropGetItemActions<NotificationDefaultItem> | NotificationPropGetItemActions<ITEM>;
|
|
61
|
+
getItemCaption: NotificationPropGetItemCaption<NotificationDefaultItem> | NotificationPropGetItemCaption<ITEM>;
|
|
62
|
+
getItemContent: NotificationPropGetItemContent<NotificationDefaultItem> | NotificationPropGetItemContent<ITEM>;
|
|
63
|
+
getItemGroup: NotificationPropGetItemGroup<NotificationDefaultItem> | NotificationPropGetItemGroup<ITEM>;
|
|
64
|
+
getItemUserImage: NotificationPropGetItemUserImage<NotificationDefaultItem> | NotificationPropGetItemUserImage<ITEM>;
|
|
65
|
+
getItemUserName: NotificationPropGetItemUserImage<NotificationDefaultItem> | import("./types").NotificationPropGetItemUserName<ITEM>;
|
|
66
|
+
getItemLabel: NotificationPropGetItemLabel<NotificationDefaultItem> | NotificationPropGetItemLabel<ITEM>;
|
|
67
|
+
getItemRead: NotificationPropGetItemRead<NotificationDefaultItem> | NotificationPropGetItemRead<ITEM>;
|
|
68
|
+
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
69
|
+
key?: import("react").Key | null | undefined;
|
|
70
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}var defaultGetGroupId=function(a){return a.id},defaultGetGroupLabel=function(a){var b;return null===(b=a.group)||void 0===b?void 0:b.label},defaultGetGroupActions=function(a){var b;return null===(b=a.group)||void 0===b?void 0:b.actions},defaultGetItemActions=function(a){return a.actions},defaultGetItemCaption=function(a){return a.caption},defaultGetItemUserName=function(a){return a.userName},defaultGetItemUserImage=function(a){return a.userImage},defaultGetItemDescription=function(a){return a.content},defaultGetItemGroup=function(a){return a.group},defaultGetItemLabel=function(a){return a.label},defaultGetItemRead=function(a){return a.read};export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getGroupId:a.getGroupId||defaultGetGroupId,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel,getGroupActions:a.getGroupActions||defaultGetGroupActions,getItemActions:a.getItemActions||defaultGetItemActions,getItemCaption:a.getItemCaption||defaultGetItemCaption,getItemContent:a.getItemContent||defaultGetItemDescription,getItemGroup:a.getItemGroup||defaultGetItemGroup,getItemUserImage:a.getItemUserImage||defaultGetItemUserImage,getItemUserName:a.getItemUserName||defaultGetItemUserName,getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemRead:a.getItemRead||defaultGetItemRead})}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetGroupId","group","id","defaultGetGroupLabel","label","defaultGetGroupActions","actions","defaultGetItemActions","item","defaultGetItemCaption","caption","defaultGetItemUserName","userName","defaultGetItemUserImage","userImage","defaultGetItemDescription","content","defaultGetItemGroup","defaultGetItemLabel","defaultGetItemRead","read","withDefaultGetters","props","getGroupId","getGroupLabel","getGroupActions","getItemActions","getItemCaption","getItemContent","getItemGroup","getItemUserImage","getItemUserName","getItemLabel","getItemRead"],"sources":["../../../../../../src/components/Notification/Notification/helpers.ts"],"sourcesContent":["import {\n NotificationDefaultGroup,\n NotificationDefaultItem,\n NotificationPropGetGroupActions,\n NotificationPropGetGroupId,\n NotificationPropGetGroupLabel,\n NotificationPropGetItemActions,\n NotificationPropGetItemCaption,\n NotificationPropGetItemContent,\n NotificationPropGetItemGroup,\n NotificationPropGetItemLabel,\n NotificationPropGetItemRead,\n NotificationPropGetItemUserImage,\n NotificationProps,\n} from './types';\n\nconst defaultGetGroupId: NotificationPropGetGroupId<\n NotificationDefaultGroup\n> = (group) => group.id;\nconst defaultGetGroupLabel: NotificationPropGetGroupLabel<\n NotificationDefaultItem,\n NotificationDefaultGroup\n> = (group) => group.group?.label;\nconst defaultGetGroupActions: NotificationPropGetGroupActions<\n NotificationDefaultItem,\n NotificationDefaultGroup\n> = (group) => group.group?.actions;\nconst defaultGetItemActions: NotificationPropGetItemActions<\n NotificationDefaultItem\n> = (item) => item.actions;\n\nconst defaultGetItemCaption: NotificationPropGetItemCaption<\n NotificationDefaultItem\n> = (item) => item.caption;\n\nconst defaultGetItemUserName: NotificationPropGetItemUserImage<\n NotificationDefaultItem\n> = (item) => item.userName;\n\nconst defaultGetItemUserImage: NotificationPropGetItemUserImage<\n NotificationDefaultItem\n> = (item) => item.userImage;\n\nconst defaultGetItemDescription: NotificationPropGetItemContent<\n NotificationDefaultItem\n> = (item) => item.content;\nconst defaultGetItemGroup: NotificationPropGetItemGroup<\n NotificationDefaultItem\n> = (item) => item.group;\n\nconst defaultGetItemLabel: NotificationPropGetItemLabel<\n NotificationDefaultItem\n> = (item) => item.label;\nconst defaultGetItemRead: NotificationPropGetItemRead<\n NotificationDefaultItem\n> = (item) => item.read;\n\nexport function withDefaultGetters<ITEM, GROUP>(\n props: NotificationProps<ITEM, GROUP>,\n) {\n return {\n ...props,\n getGroupId: props.getGroupId || defaultGetGroupId,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupActions: props.getGroupActions || defaultGetGroupActions,\n getItemActions: props.getItemActions || defaultGetItemActions,\n getItemCaption: props.getItemCaption || defaultGetItemCaption,\n getItemContent: props.getItemContent || defaultGetItemDescription,\n getItemGroup: props.getItemGroup || defaultGetItemGroup,\n getItemUserImage: props.getItemUserImage || defaultGetItemUserImage,\n getItemUserName: props.getItemUserName || defaultGetItemUserName,\n getItemLabel: props.getItemLabel || def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ARtC,CASEa,gBAAgB,CAAER,CAAK,CAACQ,gBAAN,EAA0BjB,uBAT9C,CAUEkB,eAAe,CAAET,CAAK,CAACS,eAAN,EAAyBpB,sBAV5C,CAWEqB,YAAY,CAAEV,CAAK,CAACU,YAAN,EAAsBd,mBAXtC,CAYEe,WAAW,CAAEX,CAAK,CAACW,WAAN,EAAqBd,kBAZpC,EAcD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/Notification/Notification/index.ts"],"sourcesContent":["export * from './Notification';\nexport * from './types';\n"],"mappings":"AAAA,4BACA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { MixSpaceProps } from '../../../mixs/MixSpace';
|
|
2
|
+
import { Group } from '../../../utils/getGroups';
|
|
3
|
+
import { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
import { NotificationItemAction } from '../NotificationItem';
|
|
5
|
+
export type NotificationDefaultGroup = {
|
|
6
|
+
label: string;
|
|
7
|
+
id: string;
|
|
8
|
+
actions?: NotificationItemAction[];
|
|
9
|
+
};
|
|
10
|
+
export type NotificationDefaultItem = {
|
|
11
|
+
label: string;
|
|
12
|
+
userName?: string;
|
|
13
|
+
userImage?: string;
|
|
14
|
+
content?: React.ReactNode;
|
|
15
|
+
read?: boolean;
|
|
16
|
+
caption?: string;
|
|
17
|
+
actions?: NotificationItemAction[];
|
|
18
|
+
group?: string;
|
|
19
|
+
};
|
|
20
|
+
export type NotificationPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
21
|
+
export type NotificationPropGetItemContent<ITEM> = (item: ITEM) => React.ReactNode;
|
|
22
|
+
export type NotificationPropGetItemRead<ITEM> = (item: ITEM) => boolean | undefined;
|
|
23
|
+
export type NotificationPropGetItemCaption<ITEM> = (item: ITEM) => React.ReactNode;
|
|
24
|
+
export type NotificationPropGetItemUserName<ITEM> = (item: ITEM) => string | undefined;
|
|
25
|
+
export type NotificationPropGetItemUserImage<ITEM> = (item: ITEM) => string | undefined;
|
|
26
|
+
export type NotificationPropGetItemActions<ITEM> = (item: ITEM) => NotificationItemAction[] | undefined;
|
|
27
|
+
export type NotificationPropGetItemGroup<ITEM> = (item: ITEM) => string | number | undefined;
|
|
28
|
+
export type NotificationPropGetGroupId<GROUP> = (group: GROUP) => string | undefined;
|
|
29
|
+
export type NotificationPropGetGroupLabel<ITEM, GROUP> = (group: Group<ITEM, GROUP>) => string | undefined;
|
|
30
|
+
export type NotificationPropGetGroupActions<ITEM, GROUP> = (group: Group<ITEM, GROUP>) => NotificationItemAction[] | undefined;
|
|
31
|
+
export type NotificationPropSortGroups<ITEM, GROUP> = (a: Group<ITEM, GROUP>, b: Group<ITEM, GROUP>) => number;
|
|
32
|
+
export type NotificationPropGetItemRender<ITEM> = (item: ITEM) => React.ReactNode;
|
|
33
|
+
export type NotificationPropGetGroupRender<ITEM, GROUP> = (group: Group<ITEM, GROUP>) => React.ReactNode;
|
|
34
|
+
export type NotificationPropGetItemClassName<ITEM> = (item: ITEM) => string;
|
|
35
|
+
export type NotificationPropOnItemClick<ITEM> = (item: ITEM, props: {
|
|
36
|
+
e: React.MouseEvent;
|
|
37
|
+
}) => void;
|
|
38
|
+
export type NotificationProps<ITEM = NotificationDefaultItem, GROUP = NotificationDefaultGroup> = PropsWithHTMLAttributesAndRef<{
|
|
39
|
+
children?: never;
|
|
40
|
+
items: ITEM[];
|
|
41
|
+
getItemLabel?: NotificationPropGetItemLabel<ITEM>;
|
|
42
|
+
getItemClassName?: NotificationPropGetItemClassName<ITEM>;
|
|
43
|
+
getItemContent?: NotificationPropGetItemContent<ITEM>;
|
|
44
|
+
getItemRead?: NotificationPropGetItemRead<ITEM>;
|
|
45
|
+
getItemCaption?: NotificationPropGetItemCaption<ITEM>;
|
|
46
|
+
itemRender?: NotificationPropGetItemRender<ITEM>;
|
|
47
|
+
getItemActions?: NotificationPropGetItemActions<ITEM>;
|
|
48
|
+
getItemGroup?: NotificationPropGetItemGroup<ITEM>;
|
|
49
|
+
getItemUserName?: NotificationPropGetItemUserName<ITEM>;
|
|
50
|
+
getItemUserImage?: NotificationPropGetItemUserImage<ITEM>;
|
|
51
|
+
onItemClick?: NotificationPropOnItemClick<ITEM>;
|
|
52
|
+
getGroupId?: NotificationPropGetGroupId<GROUP>;
|
|
53
|
+
getGroupActions?: NotificationPropGetGroupActions<ITEM, GROUP>;
|
|
54
|
+
getGroupLabel?: NotificationPropGetGroupLabel<ITEM, GROUP>;
|
|
55
|
+
groupRender?: NotificationPropGetGroupRender<ITEM, GROUP>;
|
|
56
|
+
groups?: GROUP[];
|
|
57
|
+
sortGroups?: NotificationPropSortGroups<ITEM, GROUP> | undefined;
|
|
58
|
+
itemSpace?: MixSpaceProps;
|
|
59
|
+
groupSpace?: MixSpaceProps;
|
|
60
|
+
scrollContainerRef?: React.RefObject<HTMLDivElement>;
|
|
61
|
+
} & (GROUP extends {
|
|
62
|
+
id: NotificationDefaultGroup['id'];
|
|
63
|
+
} ? {} : {
|
|
64
|
+
getGroupId: NotificationPropGetGroupId<GROUP>;
|
|
65
|
+
}), HTMLDivElement>;
|
|
66
|
+
export type NotificationComponent = <ITEM = NotificationDefaultItem, GROUP = NotificationDefaultGroup>(props: NotificationProps<ITEM, GROUP>) => React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/Notification/Notification/types.ts"],"sourcesContent":["import { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport { NotificationItemAction } from '../NotificationItem';\n\nexport type NotificationDefaultGroup = {\n label: string;\n id: string;\n actions?: NotificationItemAction[];\n};\n\nexport type NotificationDefaultItem = {\n label: string;\n userName?: string;\n userImage?: string;\n content?: React.ReactNode;\n read?: boolean;\n caption?: string;\n actions?: NotificationItemAction[];\n group?: string;\n};\n\nexport type NotificationPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NotificationPropGetItemContent<ITEM> = (\n item: ITEM,\n) => React.ReactNode;\n\nexport type NotificationPropGetItemRead<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type NotificationPropGetItemCaption<ITEM> = (\n item: ITEM,\n) => React.ReactNode;\n\nexport type NotificationPropGetItemUserName<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type NotificationPropGetItemUserImage<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type NotificationPropGetItemActions<ITEM> = (\n item: ITEM,\n) => NotificationItemAction[] | undefined;\n\nexport type NotificationPropGetItemGroup<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type NotificationPropGetGroupId<GROUP> = (\n group: GROUP,\n) => string | undefined;\n\nexport type NotificationPropGetGroupLabel<ITEM, GROUP> = (\n group: Group<ITEM, GROUP>,\n) => string | undefined;\nexport type NotificationPropGetGroupActions<ITEM, GROUP> = (\n group: Group<ITEM, GROUP>,\n) => NotificationItemAction[] | undefined;\n\nexport type NotificationPropSortGroups<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\nexport type NotificationPropGetItemRender<ITEM> = (\n item: ITEM,\n) => React.ReactNode;\n\nexport type NotificationPropGetGroupRender<ITEM, GROUP> = (\n group: Group<ITEM, GROUP>,\n) => React.ReactNode;\n\nexport type NotificationPropGetItemClassName<ITEM> = (item: ITEM) => string;\n\nexport type NotificationPropOnItemClick<ITEM> = (\n item: ITEM,\n props: { e: React.MouseEvent },\n) => void;\n\nexport type NotificationProps<\n ITEM = NotificationDefaultItem,\n GROUP = NotificationDefaultGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n children?: never;\n items: ITEM[];\n getItemLabel?: NotificationPropGetItemLabel<ITEM>;\n getItemClassName?: NotificationPropGetItemClassName<ITEM>;\n getItemContent?: NotificationPropGetItemContent<ITEM>;\n getItemRead?: NotificationPropGetItemRead<ITEM>;\n getItemCaption?: NotificationPropGetItemCaption<ITEM>;\n itemRender?: NotificationPropGetItemRender<ITEM>;\n getItemActions?: NotificationPropGetItemActions<ITEM>;\n getItemGroup?: NotificationPropGetItemGroup<ITEM>;\n getItemUserName?: NotificationPropGetItemUserName<ITEM>;\n getItemUserImage?: NotificationPropGetItemUserImage<ITEM>;\n onItemClick?: NotificationPropOnItemClick<ITEM>;\n getGroupId?: NotificationPropGetGroupId<GROUP>;\n getGroupActions?: NotificationPropGetGroupActions<ITEM, GROUP>;\n getGroupLabel?: NotificationPropGetGroupLabel<ITEM, GROUP>;\n groupRender?: NotificationPropGetGroupRender<ITEM, GROUP>;\n groups?: GROUP[];\n sortGroups?: NotificationPropSortGroups<ITEM, GROUP> | undefined;\n itemSpace?: MixSpaceProps;\n groupSpace?: MixSpaceProps;\n scrollContainerRef?: React.RefObject<HTMLDivElement>;\n } & (GROUP extends { id: NotificationDefaultGroup['id'] }\n ? {}\n : { getGroupId: NotificationPropGetGroupId<GROUP> }),\n HTMLDivElement\n>;\n\nexport type NotificationComponent = <\n ITEM = NotificationDefaultItem,\n GROUP = NotificationDefaultGroup,\n>(\n props: NotificationProps<ITEM, GROUP>,\n) => React.ReactNode;\n"],"mappings":""}
|