@max-ts/components 1.1.1 → 1.1.2
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/lib/components/ActionGroup/ActionGroup.d.ts +2 -2
- package/lib/components/ActionGroup/MainActions/MainActions.d.ts +2 -0
- package/lib/components/ActionGroup/SecondaryActions/SecondaryActions.d.ts +1 -0
- package/lib/components/ActionGroup/SecondaryVisibleActions/SecondaryVisibleActions.d.ts +6 -5
- package/lib/index.mjs +4 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { ElementType } from 'react';
|
|
|
2
2
|
import { MainAction } from './MainActions';
|
|
3
3
|
import { SecondaryAction } from './SecondaryActions';
|
|
4
4
|
import { SecondaryVisibleAction } from './SecondaryVisibleActions';
|
|
5
|
-
export type ActionGroupProps<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType> = {
|
|
5
|
+
export type ActionGroupProps<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TSecondaryVisibleActionComponent extends ElementType = ElementType> = {
|
|
6
6
|
/**
|
|
7
7
|
* Основные действия
|
|
8
8
|
*/
|
|
@@ -14,7 +14,7 @@ export type ActionGroupProps<TMainActionComponent extends ElementType = ElementT
|
|
|
14
14
|
/**
|
|
15
15
|
* Видимые второстепенные действия
|
|
16
16
|
*/
|
|
17
|
-
secondaryVisible?: SecondaryVisibleAction[];
|
|
17
|
+
secondaryVisible?: SecondaryVisibleAction<TSecondaryVisibleActionComponent>[];
|
|
18
18
|
/**
|
|
19
19
|
* Название класса, применяется к корневому компоненту
|
|
20
20
|
*/
|
|
@@ -25,6 +25,7 @@ type SingleAction<TMainActionComponent extends ElementType> = Omit<ButtonProps<T
|
|
|
25
25
|
* Если true, блокирует взаимодействие с actions
|
|
26
26
|
*/
|
|
27
27
|
isBlockingOperation?: boolean;
|
|
28
|
+
component?: TMainActionComponent;
|
|
28
29
|
};
|
|
29
30
|
type MultipleAction<TMainActionComponent extends ElementType> = Omit<DropdownButtonProps<TMainActionComponent>, 'children' | 'name' | 'component'> & {
|
|
30
31
|
/**
|
|
@@ -51,6 +52,7 @@ type MultipleAction<TMainActionComponent extends ElementType> = Omit<DropdownBut
|
|
|
51
52
|
* Текст тултипа при наведении на кнопку
|
|
52
53
|
*/
|
|
53
54
|
note?: string;
|
|
55
|
+
component?: TMainActionComponent;
|
|
54
56
|
};
|
|
55
57
|
/** Модель основного экшена */
|
|
56
58
|
export type MainAction<TMainActionComponent extends ElementType> = SingleAction<TMainActionComponent> | MultipleAction<TMainActionComponent>;
|
|
@@ -10,6 +10,7 @@ export type SecondaryAction<TSecondaryActionComponent extends ElementType> = Lis
|
|
|
10
10
|
* Текст тултипа при наведении на элемент меню
|
|
11
11
|
*/
|
|
12
12
|
note?: string;
|
|
13
|
+
component?: TSecondaryActionComponent;
|
|
13
14
|
};
|
|
14
15
|
export type SecondaryActionProps<TSecondaryActionComponent extends ElementType> = {
|
|
15
16
|
actions: SecondaryAction<TSecondaryActionComponent>[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '../..';
|
|
3
3
|
/** Модель второстепенного видимого экшена */
|
|
4
|
-
export type SecondaryVisibleAction = Omit<ButtonProps<'button'>, 'children'> & {
|
|
4
|
+
export type SecondaryVisibleAction<TComponent extends ElementType> = Omit<ButtonProps<'button'>, 'children'> & {
|
|
5
5
|
/** Название действия */
|
|
6
6
|
name: string;
|
|
7
7
|
/** Иконка */
|
|
@@ -12,9 +12,10 @@ export type SecondaryVisibleAction = Omit<ButtonProps<'button'>, 'children'> & {
|
|
|
12
12
|
* Если true, блокирует взаимодействие с actions
|
|
13
13
|
*/
|
|
14
14
|
isBlockingOperation?: boolean;
|
|
15
|
+
component?: TComponent;
|
|
15
16
|
};
|
|
16
|
-
export type MainActionProps = {
|
|
17
|
-
actions: SecondaryVisibleAction[];
|
|
17
|
+
export type MainActionProps<TComponent extends ElementType> = {
|
|
18
|
+
actions: SecondaryVisibleAction<TComponent>[];
|
|
18
19
|
size?: 'small' | 'medium' | 'large';
|
|
19
20
|
};
|
|
20
|
-
export declare const SecondaryVisibleActions: ({ actions, size }: MainActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const SecondaryVisibleActions: <TComponent extends ElementType = ElementType>({ actions, size, }: MainActionProps<TComponent>) => import("react/jsx-runtime").JSX.Element;
|
package/lib/index.mjs
CHANGED
|
@@ -2185,7 +2185,10 @@ const Jc = m(
|
|
|
2185
2185
|
)
|
|
2186
2186
|
))
|
|
2187
2187
|
}
|
|
2188
|
-
) : null, lu = ({
|
|
2188
|
+
) : null, lu = ({
|
|
2189
|
+
actions: e,
|
|
2190
|
+
size: t
|
|
2191
|
+
}) => /* @__PURE__ */ l.jsx(l.Fragment, { children: e.map((n) => {
|
|
2189
2192
|
const {
|
|
2190
2193
|
name: r,
|
|
2191
2194
|
icon: o,
|