neko-ui 2.2.0 → 2.3.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.
@@ -56,6 +56,6 @@ export interface MenuOption extends Omit<BaseOption, 'children' | 'options'> {
56
56
  /** 分组子选项 */
57
57
  options?: (string | MenuOption)[];
58
58
  }
59
- export type MenuElement = CustomElement<MenuProps>;
60
- export type MenuMultipleElement = CustomElement<MenuMultipleProps>;
59
+ export type MenuElement = CustomElement<MenuProps, 'onChange' | 'onOpenChange'>;
60
+ export type MenuMultipleElement = CustomElement<MenuMultipleProps, 'onChange' | 'onOpenChange'>;
61
61
  export default Menu;
@@ -65,7 +65,7 @@ export declare enum Placement {
65
65
  right = "right"
66
66
  }
67
67
  declare function Popover(props: PopoverProps): JSX.Element;
68
- export type PopoverElement = CustomElement<PopoverProps>;
68
+ export type PopoverElement = CustomElement<PopoverProps, 'onOpenChange'>;
69
69
  export declare const defaultProps: {
70
70
  class: undefined;
71
71
  css: undefined;
@@ -0,0 +1,11 @@
1
+ import { type JSXElement } from 'solid-js';
2
+ import { ColorScheme } from '../theme';
3
+ declare function Provider(props: ProviderProps): import("solid-js").JSX.Element;
4
+ export interface ProviderProps {
5
+ /** 包裹的子项 */
6
+ children?: JSXElement;
7
+ /** 响应 scheme 变化 */
8
+ onScheme?(scheme: keyof typeof ColorScheme): void;
9
+ }
10
+ export type ProviderElement = CustomElement<ProviderProps, 'onScheme'>;
11
+ export default Provider;
@@ -27,6 +27,6 @@ export interface SelectMultipleProps extends Omit<DropdownMultipleProps, 'items'
27
27
  */
28
28
  value?: (string | number)[];
29
29
  }
30
- export type SelectElement = CustomElement<SelectProps>;
31
- export type SelectMultipleElement = CustomElement<SelectMultipleProps>;
30
+ export type SelectElement = CustomElement<SelectProps, 'onChange' | 'onOpenChange'>;
31
+ export type SelectMultipleElement = CustomElement<SelectMultipleProps, 'onChange' | 'onOpenChange'>;
32
32
  export default Select;
@@ -1,24 +1,6 @@
1
1
  import { type JSXElement } from 'solid-js';
2
2
  import type { BasicConfig, PaginationProps } from '..';
3
3
  declare function Table(_: TableProps): import("solid-js").JSX.Element;
4
- interface Column<T extends Record<string, Any>> extends Cell {
5
- /** 自定义取值的 key */
6
- key?: keyof T;
7
- /** 原始 key */
8
- originKey?: keyof T;
9
- /** 单元格表头标题 */
10
- label?: JSXElement;
11
- /** 自定义渲染单元格 */
12
- render?(item: T[keyof T], row: T, index: number): JSXElement;
13
- /** 单元格横跨的列数 */
14
- colspan?: number;
15
- /** 单元格横跨的行数 */
16
- rowspan?: number;
17
- /** 设置为 'order' 时则当作序号行 */
18
- type?: 'order';
19
- /** 单元格宽 */
20
- width?: number;
21
- }
22
4
  /** API
23
5
  * @since 2.1.0
24
6
  */
@@ -33,7 +15,7 @@ export interface TableProps<T extends Record<string, Any> = Record<string, Any>>
33
15
  * @default '-'
34
16
  */
35
17
  emptyVal?: string;
36
- /** 单元格配置 */
18
+ /** 栏配置 */
37
19
  columns: Record<string, Column<T> | string>;
38
20
  /** 数据源 */
39
21
  data: T[];
@@ -55,6 +37,25 @@ export interface TableProps<T extends Record<string, Any> = Record<string, Any>>
55
37
  size?: BasicConfig['size'];
56
38
  children?: JSXElement;
57
39
  }
40
+ /** 栏 */
41
+ interface Column<T extends Record<string, Any>> extends Cell {
42
+ /** 自定义取值的 key */
43
+ key?: keyof T;
44
+ /** 原始 key */
45
+ originKey?: keyof T;
46
+ /** 单元格表头标题 */
47
+ label?: JSXElement;
48
+ /** 自定义渲染单元格 */
49
+ render?(item: T[keyof T], row: T, index: number): JSXElement;
50
+ /** 单元格横跨的列数 */
51
+ colspan?: number;
52
+ /** 单元格横跨的行数 */
53
+ rowspan?: number;
54
+ /** 设置为 'order' 时则当作序号行 */
55
+ type?: 'order';
56
+ /** 单元格宽 */
57
+ width?: number;
58
+ }
58
59
  /** 单元格布局排列 */
59
60
  interface Cell {
60
61
  /** 单元格内容的水平对齐方式
@@ -22,7 +22,7 @@ export interface TabsProps {
22
22
  */
23
23
  type?: 'line' | 'card';
24
24
  /** 值修改时的回调方法 */
25
- onChange?: (val: string) => void;
25
+ onChange?(val: string, item: TabOption, e: Event): void;
26
26
  /** 显示添加按钮 */
27
27
  add?: boolean;
28
28
  /** 删除和添加时的回调方法 */
@@ -40,5 +40,5 @@ export interface TabOption extends Omit<BaseOption, 'options'> {
40
40
  closable?: boolean;
41
41
  }
42
42
  declare function Tabs(props: TabsProps): import("solid-js").JSX.Element;
43
- export type TabsElement = CustomElement<TabsProps>;
43
+ export type TabsElement = CustomElement<TabsProps, 'onChange' | 'onEdit'>;
44
44
  export default Tabs;
@@ -22,5 +22,5 @@ export interface TagProps extends Omit<JSX.HTMLAttributes<HTMLSpanElement>, 'onC
22
22
  onClose?: (e: MouseEvent) => void;
23
23
  }
24
24
  declare function Tag(props: TagProps): JSX.Element;
25
- export type TagElement = CustomElement<TagProps>;
25
+ export type TagElement = CustomElement<TagProps, 'onClose'>;
26
26
  export default Tag;
@@ -77,12 +77,13 @@ export interface TreeMultipleStringProps extends TreeMultipleBaseProps {
77
77
  data: string;
78
78
  }
79
79
  declare function Tree(_: TreeProps | TreeMultipleProps | TreeMultipleSchemaProps | TreeSchemaProps | TreeMultipleStringProps | TreeStringProps): import("solid-js").JSX.Element;
80
- export type TreeElement = CustomElement<TreeProps>;
81
- export type TreeSchemaElement = CustomElement<TreeSchemaProps>;
82
- export type TreeStringElement = CustomElement<TreeStringProps>;
83
- export type TreeMultipleElement = CustomElement<TreeMultipleProps>;
84
- export type TreeMultipleSchemaElement = CustomElement<TreeMultipleSchemaProps>;
85
- export type TreeMultipleStringElement = CustomElement<TreeMultipleStringProps>;
80
+ type CustomEvents = 'onChange' | 'onRowDoubleClick' | 'onRowClick';
81
+ export type TreeElement = CustomElement<TreeProps, CustomEvents>;
82
+ export type TreeSchemaElement = CustomElement<TreeSchemaProps, CustomEvents>;
83
+ export type TreeStringElement = CustomElement<TreeStringProps, CustomEvents>;
84
+ export type TreeMultipleElement = CustomElement<TreeMultipleProps, CustomEvents>;
85
+ export type TreeMultipleSchemaElement = CustomElement<TreeMultipleSchemaProps, CustomEvents>;
86
+ export type TreeMultipleStringElement = CustomElement<TreeMultipleStringProps, CustomEvents>;
86
87
  export interface TreeData<T = string> {
87
88
  /** key(唯一值) */
88
89
  key: T;
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "neko-ui",
3
- "version": "2.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Web Components UI Libraries",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
7
- "build": "mo build library solid-js",
8
- "changelog": "mo changelog CHANGELOG.md && eslint --fix CHANGELOG.md && git add CHANGELOG.md",
7
+ "build": "mo build library solid",
8
+ "changelog": "mo changelog CHANGELOG.md && git add CHANGELOG.md",
9
9
  "lint": "mo eslint components && mo eslint site && mo stylelint components && mo stylelint site && jest --coverage",
10
10
  "precommit": "yarn lint && yarn changelog",
11
11
  "prepare": "mo githooks pre-commit=\"yarn precommit\" commit-msg=\"npx --no -- commitlint --edit \\${1}\"",
12
- "start": "rm -rf lib && mo start library solid-js",
12
+ "start": "rm -rf lib && mo start library solid",
13
13
  "test": "jest --coverage --watchAll",
14
- "postbuild": "tsc --project node_modules/@moneko/solid-js/lib.json"
14
+ "postbuild": "tsc --project node_modules/@moneko/solid/lib.json"
15
15
  },
16
16
  "author": {
17
17
  "name": "moneko",
@@ -38,12 +38,12 @@
38
38
  "devDependencies": {
39
39
  "@commitlint/cli": "17.6.6",
40
40
  "@commitlint/config-conventional": "17.6.6",
41
- "@moneko/cli": "2.0.0-beta.9",
41
+ "@moneko/cli": "2.0.0-beta.18",
42
42
  "@moneko/common": "1.2.0",
43
- "@moneko/core": "3.0.0-beta.106",
43
+ "@moneko/core": "3.0.0-beta.117",
44
44
  "@moneko/css": "1.0.5",
45
45
  "@moneko/postcss": "1.0.30",
46
- "@moneko/solid-js": "1.2.0",
46
+ "@moneko/solid": "1.0.2",
47
47
  "@solidjs/testing-library": "0.8.4",
48
48
  "@swc/jest": "0.2.27",
49
49
  "@testing-library/jest-dom": "5.17.0",
@@ -54,7 +54,7 @@
54
54
  "husky": "8.0.3",
55
55
  "jest": "29.6.1",
56
56
  "jest-environment-jsdom": "29.6.1",
57
- "marked-completed": "1.2.8",
57
+ "marked-completed": "1.2.10",
58
58
  "n-code-live": "1.0.6",
59
59
  "n-katex": "1.0.7",
60
60
  "shadow-dom-testing-library": "1.11.0",