neko-ui 2.3.2 → 2.3.3
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/avatar/group.d.ts +1 -1
- package/lib/avatar/index.d.ts +1 -1
- package/lib/back-top/index.d.ts +1 -0
- package/lib/button/index.d.ts +1 -1
- package/lib/capture-screen/index.d.ts +1 -0
- package/lib/carousel/index.d.ts +1 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/code/index.d.ts +1 -0
- package/lib/color-palette/index.d.ts +1 -0
- package/lib/color-picker/index.d.ts +1 -1
- package/lib/cron/index.d.ts +1 -0
- package/lib/date-picker/index.d.ts +1 -0
- package/lib/dropdown/index.d.ts +1 -1
- package/lib/empty/index.d.ts +1 -0
- package/lib/highlight-text/index.d.ts +1 -0
- package/lib/img/index.d.ts +1 -0
- package/lib/index.d.ts +47 -5
- package/lib/index.js +1 -1
- package/lib/input/index.d.ts +1 -1
- package/lib/input-number/index.d.ts +1 -0
- package/lib/md/index.d.ts +1 -0
- package/lib/menu/index.d.ts +1 -0
- package/lib/pagination/index.d.ts +1 -1
- package/lib/popover/index.d.ts +1 -1
- package/lib/provider/index.d.ts +1 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/report.html +2 -2
- package/lib/segmented/index.d.ts +1 -0
- package/lib/select/index.d.ts +1 -1
- package/lib/skeleton/index.d.ts +1 -0
- package/lib/spin/index.d.ts +1 -0
- package/lib/switch/index.d.ts +1 -0
- package/lib/table/index.d.ts +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tag/index.d.ts +1 -0
- package/lib/tree/index.d.ts +1 -1
- package/lib/typography/index.d.ts +1 -0
- package/package.json +10 -9
package/lib/avatar/group.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
2
|
import '../popover';
|
|
3
|
-
import type { BasicConfig } from '..';
|
|
3
|
+
import type { BasicConfig, CustomElement } from '..';
|
|
4
4
|
import type { AvatarProps } from '../avatar';
|
|
5
5
|
export interface AvatarGroupProps extends Omit<JSX.ButtonHTMLAttributes<HTMLDivElement>, 'onChange' | 'ref'> {
|
|
6
6
|
/** 头像数据 */
|
package/lib/avatar/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
-
import type { BasicConfig } from '../index';
|
|
2
|
+
import type { BasicConfig, CustomElement } from '../index';
|
|
3
3
|
export interface AvatarProps extends Omit<JSX.ButtonHTMLAttributes<HTMLDivElement>, 'onChange' | 'ref' | 'children'> {
|
|
4
4
|
/** 头像 */
|
|
5
5
|
src?: string;
|
package/lib/back-top/index.d.ts
CHANGED
package/lib/button/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
-
import type { BasicConfig } from '
|
|
2
|
+
import type { BasicConfig, CustomElement } from '..';
|
|
3
3
|
export interface ButtonProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'ref'> {
|
|
4
4
|
/** 自定义类名 */
|
|
5
5
|
class?: string;
|
package/lib/carousel/index.d.ts
CHANGED
package/lib/checkbox/index.d.ts
CHANGED
package/lib/code/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type JSX } from 'solid-js';
|
|
|
2
2
|
import '../dropdown';
|
|
3
3
|
import '../input';
|
|
4
4
|
import '../input-number';
|
|
5
|
+
import type { CustomElement } from '..';
|
|
5
6
|
export interface ColorPaletteProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
6
7
|
/** 自定义类名 */
|
|
7
8
|
class?: string;
|
package/lib/cron/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type JSXElement } from 'solid-js';
|
|
2
2
|
import dayjs from './dayjs';
|
|
3
3
|
import { type PopoverProps } from '../popover';
|
|
4
|
+
import type { CustomElement } from '..';
|
|
4
5
|
declare function DatePicker(_props: DatePickerProps): import("solid-js").JSX.Element;
|
|
5
6
|
/** API
|
|
6
7
|
* @since 2.1.0
|
package/lib/dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MenuMultipleProps, MenuProps, PopoverProps } from '..';
|
|
1
|
+
import type { CustomElement, MenuMultipleProps, MenuProps, PopoverProps } from '..';
|
|
2
2
|
export interface BaseDropdownProps extends Omit<PopoverProps, 'content'> {
|
|
3
3
|
/** 打开内容气泡 */
|
|
4
4
|
open?: boolean | null;
|
package/lib/empty/index.d.ts
CHANGED
package/lib/img/index.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -37,7 +37,8 @@ export { default as Tree, type TreeElement, type TreeMultipleElement, type TreeM
|
|
|
37
37
|
export { default as Typography, type TypographyElement, type TypographyProps } from './typography';
|
|
38
38
|
export { default as dayjs } from './date-picker/dayjs';
|
|
39
39
|
export { default as Provider, type ProviderElement, type ProviderProps } from './provider';
|
|
40
|
-
|
|
40
|
+
export { hot, customElement, noShadowDOM, withSolid, getCurrentElement } from 'solid-element';
|
|
41
|
+
import type { AvatarElement, AvatarGroupElement, BackTopElement, ButtonElement, CaptureScreenElement, CarouselElement, CheckboxBoolElement, CheckboxGroupElement, CodeElement, ColorPaletteElement, ColorPickerElement, CronElement, DatePickerElement, DropdownElement, DropdownMultipleElement, EmptyElement, HighlightTextElement, ImgElement, InputElement, InputNumberElement, MdElement, MenuElement, MenuMultipleElement, PaginationElement, PopoverElement, ProviderElement, RadioElement, SegmentedElement, SelectElement, SelectMultipleElement, SkeletonElement, SpinElement, SwitchElement, TableElement, TabsElement, TagElement, TreeElement, TreeMultipleElement, TreeMultipleSchemaElement, TreeMultipleStringElement, TreeSchemaElement, TreeStringElement, TypographyElement } from '.';
|
|
41
42
|
/** 组件列表
|
|
42
43
|
* @author monako97
|
|
43
44
|
* @ignore optional
|
|
@@ -120,19 +121,60 @@ interface CustomElementTags {
|
|
|
120
121
|
*/
|
|
121
122
|
'n-provider': ProviderElement;
|
|
122
123
|
}
|
|
124
|
+
type Any = any;
|
|
125
|
+
interface ICustomElement {
|
|
126
|
+
[prop: string]: Any;
|
|
127
|
+
__initialized?: boolean;
|
|
128
|
+
__released: boolean;
|
|
129
|
+
__releaseCallbacks: Any[];
|
|
130
|
+
__propertyChangedCallbacks: Any[];
|
|
131
|
+
__updating: Record<string, Any>;
|
|
132
|
+
props: Record<string, Any>;
|
|
133
|
+
lookupProp(attrName: string): string | undefined;
|
|
134
|
+
renderRoot: Element | Document | ShadowRoot | DocumentFragment;
|
|
135
|
+
addReleaseCallback(fn: () => void): void;
|
|
136
|
+
addPropertyChangedCallback(fn: (name: string, value: any) => void): void;
|
|
137
|
+
}
|
|
138
|
+
type IEvent<T> = (e: CustomEvent<T>) => void;
|
|
139
|
+
type ICustomEvent<T, K extends keyof T> = T extends {
|
|
140
|
+
[key in K]?: (v: infer V) => void;
|
|
141
|
+
} ? IEvent<V> : T extends {
|
|
142
|
+
[key in K]?: (...args: infer Args) => void;
|
|
143
|
+
} ? IEvent<Args> : never;
|
|
144
|
+
type Hyphenate<T> = T extends `${infer First}${infer Rest}` ? Rest extends Uncapitalize<Rest> ? `${Lowercase<First>}${Hyphenate<Rest>}` : `${Lowercase<First>}-${Hyphenate<Rest>}` : T;
|
|
145
|
+
type TransformKeys<T> = {
|
|
146
|
+
[K in keyof T as T[K] extends symbol | string | number | boolean | undefined | null ? Hyphenate<K> : K]: T[K];
|
|
147
|
+
};
|
|
148
|
+
type Transform<T> = {
|
|
149
|
+
[K in keyof T]: TransformKeys<T[K]>;
|
|
150
|
+
};
|
|
151
|
+
type IOmit<T, Keys extends keyof T> = Omit<T, Keys> & {
|
|
152
|
+
[K in Keys]?: ICustomEvent<T, K>;
|
|
153
|
+
};
|
|
154
|
+
export type CustomElement<T extends Partial<ICustomElement> = ICustomElement, E extends string = 'onChange'> = IOmit<T, E> & {
|
|
155
|
+
ref?: CustomElement<T, E> | {
|
|
156
|
+
current: CustomElement<T, E> | null;
|
|
157
|
+
};
|
|
158
|
+
shadowRoot?: ShadowRoot | Element | null;
|
|
159
|
+
offsetWidth?: number;
|
|
160
|
+
part?: string;
|
|
161
|
+
};
|
|
123
162
|
declare module 'solid-js' {
|
|
124
163
|
namespace JSX {
|
|
125
|
-
interface IntrinsicElements extends HTMLElementTags, CustomElementTags {
|
|
164
|
+
interface IntrinsicElements extends HTMLElementTags, Transform<CustomElementTags> {
|
|
126
165
|
}
|
|
127
166
|
}
|
|
128
|
-
interface HTMLElementTagNameMap extends CustomElementTags {
|
|
167
|
+
interface HTMLElementTagNameMap extends Transform<CustomElementTags> {
|
|
129
168
|
}
|
|
130
169
|
}
|
|
131
170
|
declare global {
|
|
132
171
|
export namespace JSX {
|
|
133
|
-
interface IntrinsicElements extends CustomElementTags
|
|
172
|
+
interface IntrinsicElements extends Transform<CustomElementTags>, Transform<CustomElementTags> {
|
|
134
173
|
}
|
|
135
174
|
}
|
|
136
|
-
interface HTMLElementTagNameMap extends CustomElementTags {
|
|
175
|
+
interface HTMLElementTagNameMap extends Transform<CustomElementTags> {
|
|
137
176
|
}
|
|
138
177
|
}
|
|
178
|
+
export interface ComponentOptions<T> {
|
|
179
|
+
element: T & ICustomElement;
|
|
180
|
+
}
|