@vitus-labs/elements 0.15.2 → 0.16.0
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/analysis/vitus-labs-elements.browser.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.module.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.native.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.umd.js.html +1 -1
- package/lib/analysis/vitus-labs-elements.umd.min.js.html +1 -1
- package/lib/index.d.ts +50 -91
- package/lib/types/Element/component.d.ts +3 -31
- package/lib/types/Element/types.d.ts +7 -8
- package/lib/types/Element/utils.d.ts +1 -1
- package/lib/types/List/component.d.ts +2 -38
- package/lib/types/List/withActiveState.d.ts +1 -1
- package/lib/types/Overlay/component.d.ts +4 -4
- package/lib/types/Portal/component.d.ts +4 -3
- package/lib/types/Text/component.d.ts +4 -4
- package/lib/types/Util/component.d.ts +3 -2
- package/lib/types/constants.d.ts +1 -1
- package/lib/types/helpers/Content/component.d.ts +1 -1
- package/lib/types/helpers/Iterator/types.d.ts +4 -3
- package/lib/types/helpers/Wrapper/component.d.ts +1 -1
- package/lib/types/types.d.ts +25 -2
- package/lib/vitus-labs-elements.browser.js +50 -64
- package/lib/vitus-labs-elements.browser.js.map +1 -1
- package/lib/vitus-labs-elements.js +67 -83
- package/lib/vitus-labs-elements.js.map +1 -1
- package/lib/vitus-labs-elements.module.js +49 -63
- package/lib/vitus-labs-elements.module.js.map +1 -1
- package/lib/vitus-labs-elements.native.js +47 -61
- package/lib/vitus-labs-elements.native.js.map +1 -1
- package/lib/vitus-labs-elements.umd.js +69 -85
- package/lib/vitus-labs-elements.umd.js.map +1 -1
- package/lib/vitus-labs-elements.umd.min.js +6 -6
- package/lib/vitus-labs-elements.umd.min.js.map +1 -1
- package/package.json +9 -9
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Provider } from '@vitus-labs/unistyle';
|
|
2
|
-
import React, { ComponentType, VFC,
|
|
3
|
-
import { config, HTMLTags } from '@vitus-labs/core';
|
|
2
|
+
import React, { ComponentType, VFC, ForwardedRef, PropsWithChildren, ReactElement, ReactNode, ReactText, ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { renderContent, config, HTMLTags } from '@vitus-labs/core';
|
|
4
4
|
|
|
5
5
|
declare type ExtractNullableKeys<T> = {
|
|
6
6
|
[P in keyof T as T[P] extends null | never | undefined ? never : P]: T[P];
|
|
@@ -12,9 +12,11 @@ declare type SpreadTwo<L, R> = Id<Pick<L, Exclude<keyof L, keyof R>> & R>;
|
|
|
12
12
|
declare type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
|
|
13
13
|
declare type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>;
|
|
14
14
|
declare type SimpleHoc<P extends Record<string, unknown>> = <T extends ComponentType<any>>(WrappedComponent: T) => VFC<MergeTypes<[P, ExtractProps<T>]>>;
|
|
15
|
+
declare type InnerRef = ForwardedRef<any>;
|
|
15
16
|
declare type CssCallback = (css: typeof config.css) => ReturnType<typeof css>;
|
|
16
17
|
declare type Css = CssCallback | string | ReturnType<typeof config.css>;
|
|
17
18
|
declare type isEmpty = null | undefined;
|
|
19
|
+
declare type Content = Parameters<typeof renderContent>['0'];
|
|
18
20
|
declare type ContentAlignX = 'left' | 'center' | 'right' | 'spaceBetween' | 'spaceAround' | 'block' | isEmpty;
|
|
19
21
|
declare type ContentAlignY = 'top' | 'center' | 'bottom' | 'spaceBetween' | 'spaceAround' | 'block' | isEmpty;
|
|
20
22
|
declare type ContentDirection = 'inline' | 'rows' | 'reverseInline' | 'reverseRows' | isEmpty;
|
|
@@ -24,16 +26,37 @@ declare type Direction = ContentDirection | ContentDirection[] | Record<string,
|
|
|
24
26
|
declare type ResponsiveBooltype = boolean | Record<string, boolean> | Array<boolean>;
|
|
25
27
|
declare type Responsive = number | Array<string | number> | Record<string, number | string>;
|
|
26
28
|
declare type ExtendCss = Css | Array<Css> | Record<string, Css>;
|
|
27
|
-
declare type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends ComponentType<infer TProps> ? TProps : TComponentOrTProps;
|
|
29
|
+
declare type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends ComponentType<infer TProps> ? TProps : TComponentOrTProps;
|
|
30
|
+
declare type VLForwardedComponent<P = Record<string, unknown>> = ForwardRefRenderFunction<any, P> & VLStatic;
|
|
31
|
+
declare type VLComponent<P = Record<string, unknown>> = VFC<P> & VLStatic;
|
|
32
|
+
interface ForwardRefRenderFunction<T, P = Record<string, unknown>> {
|
|
33
|
+
(props: PropsWithChildren<P & {
|
|
34
|
+
ref?: ForwardedRef<T>;
|
|
35
|
+
}>, ref: ForwardedRef<T>): ReactElement | null;
|
|
36
|
+
}
|
|
37
|
+
declare type VLStatic = {
|
|
38
|
+
/**
|
|
39
|
+
* React displayName
|
|
40
|
+
*/
|
|
41
|
+
displayName?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* package name
|
|
44
|
+
*/
|
|
45
|
+
pkgName?: string;
|
|
46
|
+
/**
|
|
47
|
+
* component name
|
|
48
|
+
*/
|
|
49
|
+
VITUS_LABS__COMPONENT?: `@vitus-labs/${string}`;
|
|
50
|
+
};
|
|
28
51
|
|
|
29
|
-
declare
|
|
30
|
-
tag:
|
|
31
|
-
innerRef:
|
|
32
|
-
children:
|
|
33
|
-
content:
|
|
34
|
-
label:
|
|
35
|
-
beforeContent:
|
|
36
|
-
afterContent:
|
|
52
|
+
declare type Props$7 = Partial<{
|
|
53
|
+
tag: HTMLTags;
|
|
54
|
+
innerRef: InnerRef;
|
|
55
|
+
children: Content;
|
|
56
|
+
content: Content;
|
|
57
|
+
label: Content;
|
|
58
|
+
beforeContent: Content;
|
|
59
|
+
afterContent: Content;
|
|
37
60
|
block: ResponsiveBooltype;
|
|
38
61
|
equalCols: ResponsiveBooltype;
|
|
39
62
|
gap: Responsive;
|
|
@@ -55,51 +78,22 @@ declare const component: React.ForwardRefExoticComponent<Partial<{
|
|
|
55
78
|
contentCss: ExtendCss;
|
|
56
79
|
beforeContentCss: ExtendCss;
|
|
57
80
|
afterContentCss: ExtendCss;
|
|
58
|
-
}
|
|
81
|
+
}>;
|
|
59
82
|
|
|
60
|
-
declare
|
|
83
|
+
declare const component$2: VLForwardedComponent<Props$7>;
|
|
84
|
+
|
|
85
|
+
declare type Props$6 = Partial<{
|
|
61
86
|
equalBeforeAfter: boolean;
|
|
62
87
|
vertical?: boolean;
|
|
63
88
|
afterContent?: React.ReactNode;
|
|
64
89
|
beforeContent?: React.ReactNode;
|
|
65
90
|
}>;
|
|
66
|
-
declare const withEqualBeforeAfter: SimpleHoc<Props$
|
|
67
|
-
|
|
68
|
-
declare type Props$6 = Partial<{
|
|
69
|
-
tag: HTMLTags;
|
|
70
|
-
innerRef: any;
|
|
71
|
-
children: ReactNode;
|
|
72
|
-
content: ReactNode;
|
|
73
|
-
label: ReactNode;
|
|
74
|
-
beforeContent: ReactNode;
|
|
75
|
-
afterContent: ReactNode;
|
|
76
|
-
block: ResponsiveBooltype;
|
|
77
|
-
equalCols: ResponsiveBooltype;
|
|
78
|
-
gap: Responsive;
|
|
79
|
-
vertical: ResponsiveBooltype;
|
|
80
|
-
direction: Direction;
|
|
81
|
-
contentDirection: Direction;
|
|
82
|
-
beforeContentDirection: Direction;
|
|
83
|
-
afterContentDirection: Direction;
|
|
84
|
-
alignX: AlignX;
|
|
85
|
-
contentAlignX: AlignX;
|
|
86
|
-
beforeContentAlignX: AlignX;
|
|
87
|
-
afterContentAlignX: AlignX;
|
|
88
|
-
alignY: AlignY;
|
|
89
|
-
contentAlignY: AlignY;
|
|
90
|
-
beforeContentAlignY: AlignY;
|
|
91
|
-
afterContentAlignY: AlignY;
|
|
92
|
-
dangerouslySetInnerHTML: any;
|
|
93
|
-
css: ExtendCss;
|
|
94
|
-
contentCss: ExtendCss;
|
|
95
|
-
beforeContentCss: ExtendCss;
|
|
96
|
-
afterContentCss: ExtendCss;
|
|
97
|
-
}>;
|
|
91
|
+
declare const withEqualBeforeAfter: SimpleHoc<Props$6>;
|
|
98
92
|
|
|
99
93
|
declare type MaybeNull = undefined | null;
|
|
100
94
|
declare type TObj = Record<string, unknown>;
|
|
101
95
|
declare type SimpleValue = ReactText;
|
|
102
|
-
declare type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T
|
|
96
|
+
declare type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T> | HTMLTags;
|
|
103
97
|
declare type ExtendedProps = {
|
|
104
98
|
index: number;
|
|
105
99
|
first: boolean;
|
|
@@ -116,7 +110,7 @@ declare type DataArrayObject = Partial<{
|
|
|
116
110
|
}> & Record<string, unknown>;
|
|
117
111
|
declare type PropsCallback = TObj | ((itemProps: Record<string, never> | Record<string, SimpleValue> | DataArrayObject, extendedProps: ExtendedProps) => TObj);
|
|
118
112
|
declare type Props$5 = Partial<{
|
|
119
|
-
children:
|
|
113
|
+
children: ReactNode[];
|
|
120
114
|
data: Array<SimpleValue | DataArrayObject | MaybeNull>;
|
|
121
115
|
component: ElementType;
|
|
122
116
|
valueName: string;
|
|
@@ -127,7 +121,7 @@ declare type Props$5 = Partial<{
|
|
|
127
121
|
}>;
|
|
128
122
|
|
|
129
123
|
declare type Props$4 = MergeTypes<[
|
|
130
|
-
Props$
|
|
124
|
+
Props$7,
|
|
131
125
|
Props$5,
|
|
132
126
|
{
|
|
133
127
|
rootElement?: boolean;
|
|
@@ -135,42 +129,7 @@ declare type Props$4 = MergeTypes<[
|
|
|
135
129
|
content: never;
|
|
136
130
|
}
|
|
137
131
|
]>;
|
|
138
|
-
declare const Component$
|
|
139
|
-
tag?: "object" | "label" | "data" | "a" | "abbr" | "acronym" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "legend" | "li" | "link" | "main" | "map" | "mark" | "meta" | "meter" | "nav" | "noframes" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strike" | "strong" | "style" | "sub" | "summary" | "sup" | "svg" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "tt" | "u" | "ul" | "var" | "video" | "wbr";
|
|
140
|
-
innerRef?: any;
|
|
141
|
-
beforeContent?: React.ReactNode;
|
|
142
|
-
afterContent?: React.ReactNode;
|
|
143
|
-
block?: ResponsiveBooltype;
|
|
144
|
-
equalCols?: ResponsiveBooltype;
|
|
145
|
-
gap?: Responsive;
|
|
146
|
-
vertical?: ResponsiveBooltype;
|
|
147
|
-
direction?: Direction;
|
|
148
|
-
contentDirection?: Direction;
|
|
149
|
-
beforeContentDirection?: Direction;
|
|
150
|
-
afterContentDirection?: Direction;
|
|
151
|
-
alignX?: AlignX;
|
|
152
|
-
contentAlignX?: AlignX;
|
|
153
|
-
beforeContentAlignX?: AlignX;
|
|
154
|
-
afterContentAlignX?: AlignX;
|
|
155
|
-
alignY?: AlignY;
|
|
156
|
-
contentAlignY?: AlignY;
|
|
157
|
-
beforeContentAlignY?: AlignY;
|
|
158
|
-
afterContentAlignY?: AlignY;
|
|
159
|
-
dangerouslySetInnerHTML?: any;
|
|
160
|
-
css?: ExtendCss;
|
|
161
|
-
contentCss?: ExtendCss;
|
|
162
|
-
beforeContentCss?: ExtendCss;
|
|
163
|
-
afterContentCss?: ExtendCss;
|
|
164
|
-
children?: React.ReactNodeArray;
|
|
165
|
-
data?: (React.ReactText | DataArrayObject)[];
|
|
166
|
-
component?: ElementType<any>;
|
|
167
|
-
valueName?: string;
|
|
168
|
-
wrapComponent?: ElementType<any>;
|
|
169
|
-
itemProps?: PropsCallback;
|
|
170
|
-
wrapProps?: PropsCallback;
|
|
171
|
-
itemKey?: string | ((item: React.ReactText | Omit<DataArrayObject, "component">, index: number) => React.ReactText);
|
|
172
|
-
rootElement?: boolean;
|
|
173
|
-
} & React.RefAttributes<any>>;
|
|
132
|
+
declare const Component$2: VLForwardedComponent<Props$4>;
|
|
174
133
|
|
|
175
134
|
declare type Key = string | number;
|
|
176
135
|
declare type Props$3 = {
|
|
@@ -179,11 +138,11 @@ declare type Props$3 = {
|
|
|
179
138
|
activeItems?: Key | Array<string | number>;
|
|
180
139
|
itemProps?: Record<string, unknown> | ((props: Record<string, unknown>) => Record<string, unknown>);
|
|
181
140
|
};
|
|
182
|
-
declare const Component$
|
|
141
|
+
declare const Component$1: SimpleHoc<Props$3>;
|
|
183
142
|
|
|
184
143
|
declare type Props$2 = {
|
|
185
|
-
children:
|
|
186
|
-
trigger:
|
|
144
|
+
children: Content;
|
|
145
|
+
trigger: Content;
|
|
187
146
|
DOMLocation?: HTMLElement;
|
|
188
147
|
refName?: string;
|
|
189
148
|
triggerRefName?: string;
|
|
@@ -200,14 +159,14 @@ declare type Props$2 = {
|
|
|
200
159
|
offsetY?: number;
|
|
201
160
|
throttleDelay?: number;
|
|
202
161
|
};
|
|
203
|
-
declare const Component
|
|
162
|
+
declare const Component: VLComponent<Props$2>;
|
|
204
163
|
|
|
205
164
|
declare type Props$1 = {
|
|
206
165
|
position?: HTMLElement;
|
|
207
166
|
children: ReactNode;
|
|
208
167
|
tag?: string;
|
|
209
168
|
};
|
|
210
|
-
declare const
|
|
169
|
+
declare const component$1: VLComponent<Props$1>;
|
|
211
170
|
|
|
212
171
|
declare type Props = Partial<{
|
|
213
172
|
paragraph: boolean;
|
|
@@ -216,8 +175,8 @@ declare type Props = Partial<{
|
|
|
216
175
|
tag: HTMLTags;
|
|
217
176
|
extendCss: ExtendCss;
|
|
218
177
|
}>;
|
|
219
|
-
declare const
|
|
178
|
+
declare const component: VLForwardedComponent<Props> & {
|
|
220
179
|
isText?: true;
|
|
221
180
|
};
|
|
222
181
|
|
|
223
|
-
export { component as Element, Props$
|
|
182
|
+
export { component$2 as Element, Props$7 as ElementProps, Component$2 as List, Props$4 as ListProps, Component as Overlay, Props$2 as OverlayProps, component$1 as Portal, Props$1 as PortalProps, component as Text, Props as TextProps, Component$1 as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
innerRef: any;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
content: React.ReactNode;
|
|
7
|
-
label: React.ReactNode;
|
|
8
|
-
beforeContent: React.ReactNode;
|
|
9
|
-
afterContent: React.ReactNode;
|
|
10
|
-
block: import("../types").ResponsiveBooltype;
|
|
11
|
-
equalCols: import("../types").ResponsiveBooltype;
|
|
12
|
-
gap: import("../types").Responsive;
|
|
13
|
-
vertical: import("../types").ResponsiveBooltype;
|
|
14
|
-
direction: import("../types").Direction;
|
|
15
|
-
contentDirection: import("../types").Direction;
|
|
16
|
-
beforeContentDirection: import("../types").Direction;
|
|
17
|
-
afterContentDirection: import("../types").Direction;
|
|
18
|
-
alignX: import("../types").AlignX;
|
|
19
|
-
contentAlignX: import("../types").AlignX;
|
|
20
|
-
beforeContentAlignX: import("../types").AlignX;
|
|
21
|
-
afterContentAlignX: import("../types").AlignX;
|
|
22
|
-
alignY: import("../types").AlignY;
|
|
23
|
-
contentAlignY: import("../types").AlignY;
|
|
24
|
-
beforeContentAlignY: import("../types").AlignY;
|
|
25
|
-
afterContentAlignY: import("../types").AlignY;
|
|
26
|
-
dangerouslySetInnerHTML: any;
|
|
27
|
-
css: import("../types").ExtendCss;
|
|
28
|
-
contentCss: import("../types").ExtendCss;
|
|
29
|
-
beforeContentCss: import("../types").ExtendCss;
|
|
30
|
-
afterContentCss: import("../types").ExtendCss;
|
|
31
|
-
}> & React.RefAttributes<any>>;
|
|
1
|
+
import type { VLForwardedComponent } from "../types";
|
|
2
|
+
import type { Props } from './types';
|
|
3
|
+
declare const component: VLForwardedComponent<Props>;
|
|
32
4
|
export default component;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
1
|
import type { HTMLTags } from '@vitus-labs/core';
|
|
3
|
-
import type { AlignX, AlignY, Direction, ResponsiveBooltype, Responsive, ExtendCss } from "../types";
|
|
2
|
+
import type { AlignX, AlignY, Content, Direction, ResponsiveBooltype, Responsive, ExtendCss, InnerRef } from "../types";
|
|
4
3
|
export declare type Props = Partial<{
|
|
5
4
|
tag: HTMLTags;
|
|
6
|
-
innerRef:
|
|
7
|
-
children:
|
|
8
|
-
content:
|
|
9
|
-
label:
|
|
10
|
-
beforeContent:
|
|
11
|
-
afterContent:
|
|
5
|
+
innerRef: InnerRef;
|
|
6
|
+
children: Content;
|
|
7
|
+
content: Content;
|
|
8
|
+
label: Content;
|
|
9
|
+
beforeContent: Content;
|
|
10
|
+
afterContent: Content;
|
|
12
11
|
block: ResponsiveBooltype;
|
|
13
12
|
equalCols: ResponsiveBooltype;
|
|
14
13
|
gap: Responsive;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare type Value<T = unknown> = T extends true ? 'rows' : 'inline';
|
|
2
2
|
declare type TransformVerticalProp = <T extends boolean | Record<string, boolean> | Array<boolean>>(vertical: T) => T extends boolean ? Value<T> : T extends Record<string, boolean> ? Record<keyof T, Value<T[keyof T]>> : T extends Array<boolean> ? Array<Value<T[number]>> : T;
|
|
3
3
|
export declare const transformVerticalProp: TransformVerticalProp;
|
|
4
|
-
declare type GetValue = (tag
|
|
4
|
+
declare type GetValue = (tag?: string) => boolean;
|
|
5
5
|
export declare const isInlineElement: GetValue;
|
|
6
6
|
export declare const getShouldBeEmpty: GetValue;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Props as ElementProps } from "../Element";
|
|
3
2
|
import { Props as IteratorProps } from "../helpers/Iterator";
|
|
4
|
-
import type { MergeTypes } from "../types";
|
|
3
|
+
import type { MergeTypes, VLForwardedComponent } from "../types";
|
|
5
4
|
export declare type Props = MergeTypes<[
|
|
6
5
|
ElementProps,
|
|
7
6
|
IteratorProps,
|
|
@@ -11,40 +10,5 @@ export declare type Props = MergeTypes<[
|
|
|
11
10
|
content: never;
|
|
12
11
|
}
|
|
13
12
|
]>;
|
|
14
|
-
declare const Component:
|
|
15
|
-
tag?: "object" | "label" | "data" | "a" | "abbr" | "acronym" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "legend" | "li" | "link" | "main" | "map" | "mark" | "meta" | "meter" | "nav" | "noframes" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strike" | "strong" | "style" | "sub" | "summary" | "sup" | "svg" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "tt" | "u" | "ul" | "var" | "video" | "wbr";
|
|
16
|
-
innerRef?: any;
|
|
17
|
-
beforeContent?: React.ReactNode;
|
|
18
|
-
afterContent?: React.ReactNode;
|
|
19
|
-
block?: import("../types").ResponsiveBooltype;
|
|
20
|
-
equalCols?: import("../types").ResponsiveBooltype;
|
|
21
|
-
gap?: import("../types").Responsive;
|
|
22
|
-
vertical?: import("../types").ResponsiveBooltype;
|
|
23
|
-
direction?: import("../types").Direction;
|
|
24
|
-
contentDirection?: import("../types").Direction;
|
|
25
|
-
beforeContentDirection?: import("../types").Direction;
|
|
26
|
-
afterContentDirection?: import("../types").Direction;
|
|
27
|
-
alignX?: import("../types").AlignX;
|
|
28
|
-
contentAlignX?: import("../types").AlignX;
|
|
29
|
-
beforeContentAlignX?: import("../types").AlignX;
|
|
30
|
-
afterContentAlignX?: import("../types").AlignX;
|
|
31
|
-
alignY?: import("../types").AlignY;
|
|
32
|
-
contentAlignY?: import("../types").AlignY;
|
|
33
|
-
beforeContentAlignY?: import("../types").AlignY;
|
|
34
|
-
afterContentAlignY?: import("../types").AlignY;
|
|
35
|
-
dangerouslySetInnerHTML?: any;
|
|
36
|
-
css?: import("../types").ExtendCss;
|
|
37
|
-
contentCss?: import("../types").ExtendCss;
|
|
38
|
-
beforeContentCss?: import("../types").ExtendCss;
|
|
39
|
-
afterContentCss?: import("../types").ExtendCss;
|
|
40
|
-
children?: React.ReactNodeArray;
|
|
41
|
-
data?: (React.ReactText | import("../helpers/Iterator/types").DataArrayObject)[];
|
|
42
|
-
component?: import("../helpers/Iterator/types").ElementType<any>;
|
|
43
|
-
valueName?: string;
|
|
44
|
-
wrapComponent?: import("../helpers/Iterator/types").ElementType<any>;
|
|
45
|
-
itemProps?: import("../helpers/Iterator/types").PropsCallback;
|
|
46
|
-
wrapProps?: import("../helpers/Iterator/types").PropsCallback;
|
|
47
|
-
itemKey?: string | ((item: React.ReactText | Omit<import("../helpers/Iterator/types").DataArrayObject, "component">, index: number) => React.ReactText);
|
|
48
|
-
rootElement?: boolean;
|
|
49
|
-
} & React.RefAttributes<any>>;
|
|
13
|
+
declare const Component: VLForwardedComponent<Props>;
|
|
50
14
|
export default Component;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VLComponent, Content } from "../types";
|
|
2
2
|
export declare type Props = {
|
|
3
|
-
children:
|
|
4
|
-
trigger:
|
|
3
|
+
children: Content;
|
|
4
|
+
trigger: Content;
|
|
5
5
|
DOMLocation?: HTMLElement;
|
|
6
6
|
refName?: string;
|
|
7
7
|
triggerRefName?: string;
|
|
@@ -18,5 +18,5 @@ export declare type Props = {
|
|
|
18
18
|
offsetY?: number;
|
|
19
19
|
throttleDelay?: number;
|
|
20
20
|
};
|
|
21
|
-
declare const Component:
|
|
21
|
+
declare const Component: VLComponent<Props>;
|
|
22
22
|
export default Component;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { VLComponent } from "../types";
|
|
2
3
|
export declare type Props = {
|
|
3
4
|
position?: HTMLElement;
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
tag?: string;
|
|
6
7
|
};
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
8
|
+
declare const component: VLComponent<Props>;
|
|
9
|
+
export default component;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import type { HTMLTags } from '@vitus-labs/core';
|
|
3
|
-
import type { ExtendCss } from "../types";
|
|
3
|
+
import type { VLForwardedComponent, ExtendCss } from "../types";
|
|
4
4
|
export declare type Props = Partial<{
|
|
5
5
|
paragraph: boolean;
|
|
6
6
|
label: ReactNode;
|
|
@@ -8,7 +8,7 @@ export declare type Props = Partial<{
|
|
|
8
8
|
tag: HTMLTags;
|
|
9
9
|
extendCss: ExtendCss;
|
|
10
10
|
}>;
|
|
11
|
-
declare const
|
|
11
|
+
declare const component: VLForwardedComponent<Props> & {
|
|
12
12
|
isText?: true;
|
|
13
13
|
};
|
|
14
|
-
export default
|
|
14
|
+
export default component;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { renderContent } from '@vitus-labs/core';
|
|
2
|
+
import type { VLComponent } from "../types";
|
|
2
3
|
export declare type Props = {
|
|
3
4
|
children: Parameters<typeof renderContent>[0];
|
|
4
5
|
className?: string | string[];
|
|
5
6
|
style?: Record<string, unknown>;
|
|
6
7
|
};
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
8
|
+
declare const component: VLComponent<Props>;
|
|
9
|
+
export default component;
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PKG_NAME
|
|
1
|
+
export declare const PKG_NAME: "@vitus-labs/elements";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { StyledComponentPropsWithRef } from 'styled-components';
|
|
3
|
-
import { Direction, AlignX, AlignY, ResponsiveBooltype, Responsive, ExtendCss } from "../../types";
|
|
3
|
+
import type { Direction, AlignX, AlignY, ResponsiveBooltype, Responsive, ExtendCss } from "../../types";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
parentDirection: Direction;
|
|
6
6
|
gap: Responsive;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ComponentType, ForwardRefExoticComponent, ReactText,
|
|
1
|
+
import type { ComponentType, ForwardRefExoticComponent, ReactText, ReactNode } from 'react';
|
|
2
|
+
import { HTMLTags } from '@vitus-labs/core';
|
|
2
3
|
export declare type MaybeNull = undefined | null;
|
|
3
4
|
export declare type TObj = Record<string, unknown>;
|
|
4
5
|
export declare type SimpleValue = ReactText;
|
|
5
|
-
export declare type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T
|
|
6
|
+
export declare type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T> | HTMLTags;
|
|
6
7
|
export declare type ExtendedProps = {
|
|
7
8
|
index: number;
|
|
8
9
|
first: boolean;
|
|
@@ -19,7 +20,7 @@ export declare type DataArrayObject = Partial<{
|
|
|
19
20
|
}> & Record<string, unknown>;
|
|
20
21
|
export declare type PropsCallback = TObj | ((itemProps: Record<string, never> | Record<string, SimpleValue> | DataArrayObject, extendedProps: ExtendedProps) => TObj);
|
|
21
22
|
export declare type Props = Partial<{
|
|
22
|
-
children:
|
|
23
|
+
children: ReactNode[];
|
|
23
24
|
data: Array<SimpleValue | DataArrayObject | MaybeNull>;
|
|
24
25
|
component: ElementType;
|
|
25
26
|
valueName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { StyledComponentPropsWithRef } from 'styled-components';
|
|
3
|
-
import { Direction, AlignX, AlignY, ResponsiveBooltype, ExtendCss } from "../../types";
|
|
3
|
+
import type { Direction, AlignX, AlignY, ResponsiveBooltype, ExtendCss } from "../../types";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
tag: StyledComponentPropsWithRef<any>;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentType, VFC } from 'react';
|
|
2
|
-
import { config } from '@vitus-labs/core';
|
|
1
|
+
import type { ComponentType, VFC, ForwardedRef, PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { config, renderContent } from '@vitus-labs/core';
|
|
3
3
|
declare type ExtractNullableKeys<T> = {
|
|
4
4
|
[P in keyof T as T[P] extends null | never | undefined ? never : P]: T[P];
|
|
5
5
|
};
|
|
@@ -10,9 +10,11 @@ declare type SpreadTwo<L, R> = Id<Pick<L, Exclude<keyof L, keyof R>> & R>;
|
|
|
10
10
|
declare type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
|
|
11
11
|
export declare type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>;
|
|
12
12
|
export declare type SimpleHoc<P extends Record<string, unknown>> = <T extends ComponentType<any>>(WrappedComponent: T) => VFC<MergeTypes<[P, ExtractProps<T>]>>;
|
|
13
|
+
export declare type InnerRef = ForwardedRef<any>;
|
|
13
14
|
export declare type CssCallback = (css: typeof config.css) => ReturnType<typeof css>;
|
|
14
15
|
export declare type Css = CssCallback | string | ReturnType<typeof config.css>;
|
|
15
16
|
export declare type isEmpty = null | undefined;
|
|
17
|
+
export declare type Content = Parameters<typeof renderContent>['0'];
|
|
16
18
|
export declare type ContentAlignX = 'left' | 'center' | 'right' | 'spaceBetween' | 'spaceAround' | 'block' | isEmpty;
|
|
17
19
|
export declare type ContentAlignY = 'top' | 'center' | 'bottom' | 'spaceBetween' | 'spaceAround' | 'block' | isEmpty;
|
|
18
20
|
export declare type ContentDirection = 'inline' | 'rows' | 'reverseInline' | 'reverseRows' | isEmpty;
|
|
@@ -24,4 +26,25 @@ export declare type ResponsiveBooltype = boolean | Record<string, boolean> | Arr
|
|
|
24
26
|
export declare type Responsive = number | Array<string | number> | Record<string, number | string>;
|
|
25
27
|
export declare type ExtendCss = Css | Array<Css> | Record<string, Css>;
|
|
26
28
|
export declare type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends ComponentType<infer TProps> ? TProps : TComponentOrTProps;
|
|
29
|
+
export declare type VLForwardedComponent<P = Record<string, unknown>> = ForwardRefRenderFunction<any, P> & VLStatic;
|
|
30
|
+
export declare type VLComponent<P = Record<string, unknown>> = VFC<P> & VLStatic;
|
|
31
|
+
interface ForwardRefRenderFunction<T, P = Record<string, unknown>> {
|
|
32
|
+
(props: PropsWithChildren<P & {
|
|
33
|
+
ref?: ForwardedRef<T>;
|
|
34
|
+
}>, ref: ForwardedRef<T>): ReactElement | null;
|
|
35
|
+
}
|
|
36
|
+
export declare type VLStatic = {
|
|
37
|
+
/**
|
|
38
|
+
* React displayName
|
|
39
|
+
*/
|
|
40
|
+
displayName?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* package name
|
|
43
|
+
*/
|
|
44
|
+
pkgName?: string;
|
|
45
|
+
/**
|
|
46
|
+
* component name
|
|
47
|
+
*/
|
|
48
|
+
VITUS_LABS__COMPONENT?: `@vitus-labs/${string}`;
|
|
49
|
+
};
|
|
27
50
|
export {};
|