ranui 0.1.8 → 0.1.10-alpha-24
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/README.zh-CN.md +192 -0
- package/dist/assets/image/failImage.d.ts +2 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.js +7 -0
- package/dist/colorpicker.js +11 -0
- package/dist/components/button/index.d.ts +37 -1
- package/dist/components/checkbox/index.d.ts +30 -0
- package/dist/components/colorpicker/index.d.ts +120 -0
- package/dist/components/dropdown/index.d.ts +34 -0
- package/dist/components/input/index.d.ts +209 -1
- package/dist/components/loading/index.d.ts +76 -0
- package/dist/components/math/index.d.ts +16 -0
- package/dist/components/message/index.d.ts +10 -7
- package/dist/components/player/index.d.ts +218 -492
- package/dist/components/popover/content/index.d.ts +16 -0
- package/dist/components/popover/index.d.ts +91 -0
- package/dist/components/preview/constant.d.ts +5 -0
- package/dist/components/preview/index.d.ts +1 -4
- package/dist/components/preview/pdf.d.ts +51 -1
- package/dist/components/preview/types.d.ts +11 -0
- package/dist/components/progress/index.d.ts +12 -7
- package/dist/components/radar/index.d.ts +1 -1
- package/dist/components/scratch/index.d.ts +21 -0
- package/dist/components/select/dropdown-item/index.d.ts +23 -0
- package/dist/components/select/index.d.ts +25 -12
- package/dist/components/select/option/index.d.ts +2 -0
- package/dist/components/tab/index.d.ts +80 -59
- package/dist/components/tabpane/index.d.ts +73 -52
- package/dist/icon.js +6 -0
- package/dist/iconShadowless.js +6 -0
- package/dist/image.js +4 -0
- package/dist/{index-aea75a9f.js → index-BEm1a2pr.js} +3 -6
- package/dist/{index-b2be6bef.js → index-BSyn-jmY.js} +5492 -3716
- package/dist/index-BVD0qcjJ.js +656 -0
- package/dist/{index-b90299ca.js → index-Bb55l8nf.js} +2 -11
- package/dist/{index-48653b79.js → index-BbW0dxzy.js} +12 -16
- package/dist/index-BgUpm4LA.js +103 -0
- package/dist/{index-a1a53af6.js → index-C841uRgZ.js} +16 -51
- package/dist/{index-a43b144f.js → index-CUZna268.js} +41 -69
- package/dist/index-CiA5qRK3.js +381 -0
- package/dist/index-CoJMn8Jm.js +511 -0
- package/dist/{index-5975bbc0.js → index-DAxs7Dd2.js} +6 -13
- package/dist/index-D_cD4u43.js +70 -0
- package/dist/index-DgVgxN1s.js +309 -0
- package/dist/index-DghvN1MU.js +710 -0
- package/dist/index-DvSe_Ms7.js +494 -0
- package/dist/{index-7f513a14.js → index-W52VzrXL.js} +20 -49
- package/dist/index-gBy2cXLV.js +140 -0
- package/dist/index-hdtEL8P_.js +101 -0
- package/dist/index-jVKJoKXA.js +490 -0
- package/dist/index-ltt3w4zP.js +187 -0
- package/dist/index-n4X6wdwJ.js +156 -0
- package/dist/{index-0e7229ea.js → index-s0ioL3L2.js} +23 -43
- package/dist/index.d.ts +276 -14
- package/dist/index.js +24 -24
- package/dist/input.js +7 -0
- package/dist/inputShadowless.js +6 -0
- package/dist/katex-es-CGqSCDjs.js +14634 -0
- package/dist/loading-scene-BMc2wqKm.js +4 -0
- package/dist/loading.js +8 -0
- package/dist/math.js +7 -0
- package/dist/message.js +6 -0
- package/dist/modal.js +4 -0
- package/dist/more-2vsTDpcc.js +31 -0
- package/dist/pdf-Bis_tkvj.js +134 -0
- package/dist/player.js +8 -0
- package/dist/plus-DgJxWGlo.js +56799 -0
- package/dist/popover.js +9 -0
- package/dist/preview.js +7 -0
- package/dist/progress.js +7 -0
- package/dist/radar.js +6 -0
- package/dist/ranui.css +1 -0
- package/dist/search-BWdfjyP8.js +4 -0
- package/dist/select.js +10 -0
- package/dist/{index-f6d6982d.js → selectShadowless.js} +203 -159
- package/dist/{umd/components/form → shadowless/icon}/index.d.ts +1 -0
- package/dist/shadowless/input/index.d.ts +210 -0
- package/dist/{umd/components → shadowless}/select/index.d.ts +22 -15
- package/dist/shadowless/select/option/index.d.ts +2 -0
- package/dist/shadowless.d.ts +3 -0
- package/dist/shadowless.js +8 -0
- package/dist/skeleton.js +4 -0
- package/dist/sort-DWqiUONr.js +4 -0
- package/dist/sprite-CH2zLtZy.js +141 -0
- package/dist/tab.js +6 -0
- package/dist/tabpane.js +4 -0
- package/dist/tsconfig.json +31 -0
- package/dist/typings.d.ts +257 -0
- package/dist/umd/index.css +1 -0
- package/dist/umd/index.umd.cjs +1 -71
- package/dist/umd/shadowless/shadowless.css +1 -0
- package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
- package/dist/utils/color.d.ts +52 -0
- package/dist/utils/image.d.ts +8 -1
- package/dist/utils/index.d.ts +20 -5
- package/dist/utils/math.d.ts +3 -3
- package/dist/vite.config.d.ts +1 -0
- package/dist/without-content-CdJw7vHM.js +4 -0
- package/package.json +115 -67
- package/readme.md +41 -57
- package/typings.d.ts +257 -0
- package/dist/colz-746223ab.js +0 -241
- package/dist/components/button/index.js +0 -7
- package/dist/components/icon/index.js +0 -6
- package/dist/components/image/index.js +0 -4
- package/dist/components/input/index.js +0 -5
- package/dist/components/message/index.js +0 -4
- package/dist/components/modal/index.js +0 -4
- package/dist/components/option/index.d.ts +0 -2
- package/dist/components/option/index.js +0 -95
- package/dist/components/player/index.js +0 -11
- package/dist/components/preview/colz.d.ts +0 -72
- package/dist/components/preview/docx.d.ts +0 -8
- package/dist/components/preview/excel/excel.d.ts +0 -2
- package/dist/components/preview/excel/index.d.ts +0 -1
- package/dist/components/preview/excel/media.d.ts +0 -37
- package/dist/components/preview/index.js +0 -8
- package/dist/components/preview/pptx/index.d.ts +0 -16
- package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/components/preview/pptx/worker.d.ts +0 -1
- package/dist/components/progress/index.js +0 -8
- package/dist/components/radar/index.js +0 -7
- package/dist/components/select/index.js +0 -11
- package/dist/components/skeleton/index.js +0 -4
- package/dist/components/tab/index.js +0 -7
- package/dist/components/tabpane/index.js +0 -4
- package/dist/docx-c5d02d8c.js +0 -21
- package/dist/index-183517e7.js +0 -265
- package/dist/index-4d873a42.js +0 -195
- package/dist/index-57492b9b.js +0 -48
- package/dist/index-7b8840f9.js +0 -18690
- package/dist/index-a216f328.js +0 -662
- package/dist/index-d2d69b06.js +0 -225
- package/dist/index-ecaed5cc.js +0 -439
- package/dist/pdf-bdb7818a.js +0 -113
- package/dist/style.css +0 -1
- package/dist/umd/build/config.d.ts +0 -3
- package/dist/umd/build/config.umd.d.ts +0 -2
- package/dist/umd/components/button/index.d.ts +0 -2
- package/dist/umd/components/icon/index.d.ts +0 -2
- package/dist/umd/components/image/index.d.ts +0 -2
- package/dist/umd/components/input/index.d.ts +0 -2
- package/dist/umd/components/message/index.d.ts +0 -14
- package/dist/umd/components/modal/index.d.ts +0 -2
- package/dist/umd/components/option/index.d.ts +0 -2
- package/dist/umd/components/player/index.d.ts +0 -524
- package/dist/umd/components/preview/colz.d.ts +0 -72
- package/dist/umd/components/preview/docx.d.ts +0 -8
- package/dist/umd/components/preview/excel/excel.d.ts +0 -2
- package/dist/umd/components/preview/excel/index.d.ts +0 -1
- package/dist/umd/components/preview/excel/media.d.ts +0 -37
- package/dist/umd/components/preview/index.d.ts +0 -6
- package/dist/umd/components/preview/pdf.d.ts +0 -1
- package/dist/umd/components/preview/pptx/index.d.ts +0 -16
- package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
- package/dist/umd/components/progress/index.d.ts +0 -36
- package/dist/umd/components/radar/index.d.ts +0 -2
- package/dist/umd/components/skeleton/index.d.ts +0 -2
- package/dist/umd/components/tab/index.d.ts +0 -403
- package/dist/umd/components/tabpane/index.d.ts +0 -347
- package/dist/umd/index.d.ts +0 -14
- package/dist/umd/playwright.config.d.ts +0 -9
- package/dist/umd/plugins/auto-import-file.d.ts +0 -0
- package/dist/umd/plugins/load-style.d.ts +0 -6
- package/dist/umd/plugins/load-svg.d.ts +0 -9
- package/dist/umd/style.css +0 -1
- package/dist/umd/tests/button.spec.d.ts +0 -1
- package/dist/umd/utils/image.d.ts +0 -32
- package/dist/umd/utils/index.d.ts +0 -64
- package/dist/umd/utils/math.d.ts +0 -26
- package/dist/umd/utils/tween.d.ts +0 -21
- package/dist/umd/vite.config.d.ts +0 -6
- package/dist/vendor-f71e6f68.js +0 -92126
- /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
- /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
- /package/dist/{umd/build/config.es.d.ts → build/config.sha.d.ts} +0 -0
- /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
- /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
- /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
- /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
- /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
- /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
- /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
- /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
- /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
- /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
- /package/dist/{info-circle-fill-90ec9aa9.js → info-circle-fill-DjI8gXS3.js} +0 -0
- /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
- /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
- /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
- /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
- /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
- /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
- /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
- /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
- /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
- /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
- /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const hsv2hsl: (h: number, s: number, v: number) => {
|
|
2
|
+
h: number;
|
|
3
|
+
s: number;
|
|
4
|
+
l: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const hex2alpha: (aa: string) => number;
|
|
7
|
+
export declare const hex2hsl: (hex: string) => {
|
|
8
|
+
h: number;
|
|
9
|
+
s: number;
|
|
10
|
+
l: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const hex2hsv: (hex: string) => {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
v: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const hex2rgb: (hex: string) => {
|
|
18
|
+
r: number;
|
|
19
|
+
g: number;
|
|
20
|
+
b: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const rgb2hsv: (r: number, g: number, b: number) => {
|
|
23
|
+
h: number;
|
|
24
|
+
s: number;
|
|
25
|
+
v: number;
|
|
26
|
+
};
|
|
27
|
+
export declare const hsl2hsv: (h: number, s: number, l: number) => {
|
|
28
|
+
h: number;
|
|
29
|
+
s: number;
|
|
30
|
+
v: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const hsl2rgb: (h: number, s: number, l: number) => {
|
|
33
|
+
r: number;
|
|
34
|
+
g: number;
|
|
35
|
+
b: number;
|
|
36
|
+
};
|
|
37
|
+
export declare const hsv2rgb: (h: number, s: number, v: number) => {
|
|
38
|
+
r: number;
|
|
39
|
+
g: number;
|
|
40
|
+
b: number;
|
|
41
|
+
};
|
|
42
|
+
export declare const rgb2hex: (r: number, g: number, b: number) => string;
|
|
43
|
+
export declare const rgba: (r: number, g: number, b: number, a: number) => string;
|
|
44
|
+
export declare const rgba2hex: (r: number, g: number, b: number, a: number) => string;
|
|
45
|
+
export declare const rgba2rgb: (r: number, g: number, b: number, a: number) => {
|
|
46
|
+
r: number;
|
|
47
|
+
g: number;
|
|
48
|
+
b: number;
|
|
49
|
+
};
|
|
50
|
+
export declare const HEX_COLOR_REGEX: RegExp;
|
|
51
|
+
export declare const RGB_REGEX: RegExp;
|
|
52
|
+
export declare const RGBA_REGEX: RegExp;
|
package/dist/utils/image.d.ts
CHANGED
|
@@ -19,13 +19,20 @@ export declare const cutRound: (img: ImgType, radius: number) => ImgType;
|
|
|
19
19
|
* @returns 返回一个离屏 canvas 用于渲染
|
|
20
20
|
*/
|
|
21
21
|
export declare const opacity: (img: ImgType, opacity: number) => ImgType;
|
|
22
|
+
/**
|
|
23
|
+
* 权重矩阵
|
|
24
|
+
* @param radius 模糊半径
|
|
25
|
+
* @param sigma
|
|
26
|
+
* @returns 返回一个权重和为1的矩阵
|
|
27
|
+
*/
|
|
28
|
+
export declare const getMatrix: (radius: number, sigma?: number) => number[];
|
|
22
29
|
/**
|
|
23
30
|
* 高斯模糊
|
|
24
31
|
* @param img 将要处理的图片对象
|
|
25
32
|
* @param radius 模糊半径
|
|
26
33
|
* @returns 返回一个离屏 canvas 用于渲染
|
|
27
34
|
*/
|
|
28
|
-
export declare const blur: (img: ImgType
|
|
35
|
+
export declare const blur: (img: ImgType) => ImgType;
|
|
29
36
|
export declare const getBase64Image: (imageFile: File) => Promise<{
|
|
30
37
|
base64: string | ArrayBuffer | null;
|
|
31
38
|
}>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
export declare const falseList: (string | boolean | null | undefined)[];
|
|
2
2
|
/**
|
|
3
|
-
* @description: 判断这个元素上是否有disabled属性
|
|
3
|
+
* @description: 判断这个元素上是否有 disabled 属性
|
|
4
4
|
* @param {Element} element
|
|
5
5
|
* @return {*}
|
|
6
6
|
*/
|
|
7
7
|
export declare const isDisabled: (element: Element) => boolean;
|
|
8
8
|
/**
|
|
9
|
-
* @description: 查询指定元素的子级元素,删除他们的某一个指定class
|
|
9
|
+
* @description: 查询指定元素的子级元素,删除他们的某一个指定 class
|
|
10
10
|
* @param {Element} parent
|
|
11
11
|
* @param {string} deleteClass
|
|
12
12
|
*/
|
|
13
13
|
export declare const removeClassToElementChild: (parent: Element, deleteClass: string) => void;
|
|
14
14
|
/**
|
|
15
|
-
* @description: 创建icon的文档示例
|
|
15
|
+
* @description: 创建 icon 的文档示例
|
|
16
16
|
*/
|
|
17
17
|
export declare const createIconList: () => void;
|
|
18
|
-
export declare const loadScript: (
|
|
18
|
+
export declare const loadScript: ({ type, content }: {
|
|
19
|
+
type: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}) => Promise<{
|
|
19
22
|
success: boolean;
|
|
20
23
|
}>;
|
|
21
24
|
export interface CustomErrorType {
|
|
22
25
|
new (m: string): void;
|
|
23
26
|
}
|
|
24
|
-
export declare function createCustomError(msg
|
|
27
|
+
export declare function createCustomError(msg?: string): CustomErrorType;
|
|
25
28
|
export declare const vod: {
|
|
26
29
|
FD: {
|
|
27
30
|
label: string;
|
|
@@ -62,3 +65,15 @@ export declare const vod: {
|
|
|
62
65
|
label: string;
|
|
63
66
|
};
|
|
64
67
|
};
|
|
68
|
+
export declare const HTMLElementSSR: () => {
|
|
69
|
+
new (): HTMLElement;
|
|
70
|
+
prototype: HTMLElement;
|
|
71
|
+
} | null;
|
|
72
|
+
export declare const createSignal: <T = unknown>(value: T, options?: {
|
|
73
|
+
subscriber?: Function[];
|
|
74
|
+
equals?: boolean | ((prev: T | undefined, next: T) => boolean);
|
|
75
|
+
}) => [() => T, (newValue: T) => void];
|
|
76
|
+
/**
|
|
77
|
+
* 根据文件扩展名获取 MIME 类型
|
|
78
|
+
*/
|
|
79
|
+
export declare function getMimeTypeFromExtension(fileName: string): string;
|
package/dist/utils/math.d.ts
CHANGED
|
@@ -8,17 +8,17 @@ export declare const getAngle: (deg: number) => number;
|
|
|
8
8
|
* 根据角度计算圆上的点
|
|
9
9
|
* @param { number } deg 运算角度
|
|
10
10
|
* @param { number } r 半径
|
|
11
|
-
* @return { Array<number> } 坐标[x, y]
|
|
11
|
+
* @return { Array<number> } 坐标 [x, y]
|
|
12
12
|
*/
|
|
13
13
|
export declare const getArcPointerByDeg: (deg: number, r: number) => [number, number];
|
|
14
14
|
/**
|
|
15
15
|
* 根据点计算切线方程
|
|
16
16
|
* @param { number } x 横坐标
|
|
17
17
|
* @param { number } y 纵坐标
|
|
18
|
-
* @return { Array<number> } [
|
|
18
|
+
* @return { Array<number> } [斜率,常数]
|
|
19
19
|
*/
|
|
20
20
|
export declare const getTangentByPointer: (x: number, y: number) => Array<number>;
|
|
21
|
-
export declare const fanShapedByArc: (ctx: CanvasRenderingContext2D,
|
|
21
|
+
export declare const fanShapedByArc: (ctx: CanvasRenderingContext2D, maxRadius: number, start: number, end: number, gutter: number) => void;
|
|
22
22
|
export declare const roundRectByArc: (ctx: CanvasRenderingContext2D, ...[x, y, w, h, r]: number[]) => void;
|
|
23
23
|
/**
|
|
24
24
|
* 创建线性渐变色
|
package/dist/vite.config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BuildOptions, UserConfig } from 'vite';
|
|
2
2
|
export declare const umd: BuildOptions;
|
|
3
|
+
export declare const umdShadowless: BuildOptions;
|
|
3
4
|
export declare const es: BuildOptions;
|
|
4
5
|
export declare const viteConfig: UserConfig;
|
|
5
6
|
declare const _default: UserConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const withoutContent = { "success": true, "_identification": true, "data": '<svg t="1742629778506" class="icon" viewBox="0 0 1366 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31273" width="200" height="200"><path d="M1230.155 778.399V472.604l133.84-51.746-94.113-140.41 83.29 13.815 0.676-4.006 6.486-9.634L1204.75 176.19l-2.05 2.985 1.283-3.578L735.283 1.087 734 4.496l-1.197-3.494-550.626 182.523-0.338-0.598-2.303 1.619-0.43-0.083-0.597 0.85L0 311.57l7.076 9.972L8.78 325.8l97.353-40.064-70.926 98.38 140.747 78.94 0.168 312.863h3.838l-1.873 3.415 438.699 244.578 0.083-0.084v0.168l15.428-0.084v0.084l0.253-0.084h0.262v-0.084l597.428-245.262-0.085-0.168z m89.34-505.88l-61.802-10.223-38.106-56.866 99.908 67.09zM742.443 20.782l438.438 163.252-438.438 164.28V20.78z m451.654 175.355l145.522 217.047-605.703 234.1-100.084-241.176 560.265-209.97zM63.934 285.822l85.848-60.698-25.997 36.143-59.851 24.555z m-5.28 93.177L134.1 274.315l1.873-0.768-0.514-1.196 48.852-67.856 428.377 201.357-75.7 241.515L58.653 379zM192.07 768.85l-0.175-296.76 354.386 198.803 68.625-218.92 1.788 553.697L192.07 768.85z m8.184-574.587L726.5 19.843v334.433l-103.323 38.79-422.924-198.803z m1013.96 573.56L632.727 1006.52l-1.795-565.798 94.204 227.107 489.078-189v288.994z" fill="currentColor" p-id="31274"></path></svg>' };
|
|
2
|
+
export {
|
|
3
|
+
withoutContent as default
|
|
4
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ranui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10-alpha-24",
|
|
4
4
|
"description": "UI Component library based on `Web Component`",
|
|
5
5
|
"main": "dist/umd/index.umd.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -9,16 +9,21 @@
|
|
|
9
9
|
"homepage": "https://chaxus.github.io/ran/src/ranui/",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/chaxus/ran
|
|
12
|
+
"url": "git+https://github.com/chaxus/ran",
|
|
13
|
+
"directory": "packages/ranui"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/chaxus/ran/issues"
|
|
13
17
|
},
|
|
14
18
|
"author": "chaxus",
|
|
15
19
|
"license": "MIT",
|
|
16
|
-
"files": [
|
|
17
|
-
"dist/*"
|
|
18
|
-
],
|
|
19
20
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
21
|
+
"node": ">=23.10.0"
|
|
21
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"typings.d.ts"
|
|
26
|
+
],
|
|
22
27
|
"keywords": [
|
|
23
28
|
"ran",
|
|
24
29
|
"component",
|
|
@@ -29,7 +34,8 @@
|
|
|
29
34
|
"web components",
|
|
30
35
|
"webComponents",
|
|
31
36
|
"ranui",
|
|
32
|
-
"@ranui/react"
|
|
37
|
+
"@ranui/react",
|
|
38
|
+
"lib"
|
|
33
39
|
],
|
|
34
40
|
"exports": {
|
|
35
41
|
".": {
|
|
@@ -37,117 +43,158 @@
|
|
|
37
43
|
"import": "./dist/index.js",
|
|
38
44
|
"require": "./dist/umd/index.umd.cjs"
|
|
39
45
|
},
|
|
46
|
+
"./shadowless": {
|
|
47
|
+
"types": "./dist/index.d.ts",
|
|
48
|
+
"import": "./dist/shadowless.js",
|
|
49
|
+
"require": "./dist/umd/shadowless/shadowless.umd.cjs"
|
|
50
|
+
},
|
|
40
51
|
"./button": {
|
|
41
|
-
"types": "./dist/
|
|
42
|
-
"import": "./dist/
|
|
52
|
+
"types": "./dist/index.d.ts",
|
|
53
|
+
"import": "./dist/button.js",
|
|
43
54
|
"require": "./dist/umd/index.umd.cjs"
|
|
44
55
|
},
|
|
45
56
|
"./icon": {
|
|
46
|
-
"types": "./dist/
|
|
47
|
-
"import": "./dist/
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
58
|
+
"import": "./dist/icon.js",
|
|
48
59
|
"require": "./dist/umd/index.umd.cjs"
|
|
49
60
|
},
|
|
50
61
|
"./image": {
|
|
51
|
-
"types": "./dist/
|
|
52
|
-
"import": "./dist/
|
|
62
|
+
"types": "./dist/index.d.ts",
|
|
63
|
+
"import": "./dist/image.js",
|
|
53
64
|
"require": "./dist/umd/index.umd.cjs"
|
|
54
65
|
},
|
|
55
66
|
"./input": {
|
|
56
|
-
"types": "./dist/
|
|
57
|
-
"import": "./dist/
|
|
67
|
+
"types": "./dist/index.d.ts",
|
|
68
|
+
"import": "./dist/input.js",
|
|
58
69
|
"require": "./dist/umd/index.umd.cjs"
|
|
59
70
|
},
|
|
60
71
|
"./message": {
|
|
61
|
-
"types": "./dist/
|
|
62
|
-
"import": "./dist/
|
|
72
|
+
"types": "./dist/index.d.ts",
|
|
73
|
+
"import": "./dist/message.js",
|
|
63
74
|
"require": "./dist/umd/index.umd.cjs"
|
|
64
75
|
},
|
|
65
76
|
"./preview": {
|
|
66
|
-
"types": "./dist/
|
|
67
|
-
"import": "./dist/
|
|
77
|
+
"types": "./dist/index.d.ts",
|
|
78
|
+
"import": "./dist/preview.js",
|
|
68
79
|
"require": "./dist/umd/index.umd.cjs"
|
|
69
80
|
},
|
|
70
81
|
"./skeleton": {
|
|
71
|
-
"types": "./dist/
|
|
72
|
-
"import": "./dist/
|
|
82
|
+
"types": "./dist/index.d.ts",
|
|
83
|
+
"import": "./dist/skeleton.js",
|
|
73
84
|
"require": "./dist/umd/index.umd.cjs"
|
|
74
85
|
},
|
|
75
86
|
"./tab": {
|
|
76
|
-
"types": "./dist/
|
|
77
|
-
"import": "./dist/
|
|
87
|
+
"types": "./dist/index.d.ts",
|
|
88
|
+
"import": "./dist/tab.js",
|
|
78
89
|
"require": "./dist/umd/index.umd.cjs"
|
|
79
90
|
},
|
|
80
91
|
"./tabpane": {
|
|
81
|
-
"types": "./dist/
|
|
82
|
-
"import": "./dist/
|
|
92
|
+
"types": "./dist/index.d.ts",
|
|
93
|
+
"import": "./dist/tabpane.js",
|
|
83
94
|
"require": "./dist/umd/index.umd.cjs"
|
|
84
95
|
},
|
|
85
96
|
"./radar": {
|
|
86
|
-
"types": "./dist/
|
|
87
|
-
"import": "./dist/
|
|
97
|
+
"types": "./dist/index.d.ts",
|
|
98
|
+
"import": "./dist/radar.js",
|
|
88
99
|
"require": "./dist/umd/index.umd.cjs"
|
|
89
100
|
},
|
|
90
101
|
"./modal": {
|
|
91
|
-
"types": "./dist/
|
|
92
|
-
"import": "./dist/
|
|
102
|
+
"types": "./dist/index.d.ts",
|
|
103
|
+
"import": "./dist/modal.js",
|
|
93
104
|
"require": "./dist/umd/index.umd.cjs"
|
|
94
105
|
},
|
|
95
106
|
"./select": {
|
|
96
|
-
"types": "./dist/
|
|
97
|
-
"import": "./dist/
|
|
98
|
-
"require": "./dist/umd/index.umd.cjs"
|
|
99
|
-
},
|
|
100
|
-
"./option": {
|
|
101
|
-
"types": "./dist/components/option/index.d.ts",
|
|
102
|
-
"import": "./dist/components/option/index.js",
|
|
107
|
+
"types": "./dist/index.d.ts",
|
|
108
|
+
"import": "./dist/select.js",
|
|
103
109
|
"require": "./dist/umd/index.umd.cjs"
|
|
104
110
|
},
|
|
105
111
|
"./progress": {
|
|
106
|
-
"types": "./dist/
|
|
107
|
-
"import": "./dist/
|
|
112
|
+
"types": "./dist/index.d.ts",
|
|
113
|
+
"import": "./dist/progress.js",
|
|
108
114
|
"require": "./dist/umd/index.umd.cjs"
|
|
109
115
|
},
|
|
110
116
|
"./player": {
|
|
111
|
-
"types": "./dist/
|
|
112
|
-
"import": "./dist/
|
|
117
|
+
"types": "./dist/index.d.ts",
|
|
118
|
+
"import": "./dist/player.js",
|
|
119
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
120
|
+
},
|
|
121
|
+
"./popover": {
|
|
122
|
+
"types": "./dist/index.d.ts",
|
|
123
|
+
"import": "./dist/popover.js",
|
|
124
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
125
|
+
},
|
|
126
|
+
"./content": {
|
|
127
|
+
"types": "./dist/index.d.ts",
|
|
128
|
+
"import": "./dist/content.js",
|
|
129
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
130
|
+
},
|
|
131
|
+
"./loading": {
|
|
132
|
+
"types": "./dist/index.d.ts",
|
|
133
|
+
"import": "./dist/loading.js",
|
|
134
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
135
|
+
},
|
|
136
|
+
"./colorpicker": {
|
|
137
|
+
"types": "./dist/index.d.ts",
|
|
138
|
+
"import": "./dist/colorpicker.js",
|
|
139
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
140
|
+
},
|
|
141
|
+
"./math": {
|
|
142
|
+
"types": "./dist/index.d.ts",
|
|
143
|
+
"import": "./dist/math.js",
|
|
144
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
145
|
+
},
|
|
146
|
+
"./checkbox": {
|
|
147
|
+
"types": "./dist/index.d.ts",
|
|
148
|
+
"import": "./dist/checkbox.js",
|
|
113
149
|
"require": "./dist/umd/index.umd.cjs"
|
|
114
150
|
},
|
|
115
151
|
"./style": {
|
|
116
152
|
"types": "./dist/index.d.ts",
|
|
117
|
-
"import": "./dist/
|
|
153
|
+
"import": "./dist/ranui.css",
|
|
118
154
|
"require": "./dist/umd/index.umd.cjs"
|
|
155
|
+
},
|
|
156
|
+
"./type": {
|
|
157
|
+
"types": "./dist/index.d.ts",
|
|
158
|
+
"import": "./dist/index.js",
|
|
159
|
+
"require": "./dist/index.js"
|
|
160
|
+
},
|
|
161
|
+
"./typings": {
|
|
162
|
+
"types": "./dist/typings.d.ts",
|
|
163
|
+
"import": "./dist/typings.d.ts",
|
|
164
|
+
"require": "./dist/index.js"
|
|
165
|
+
},
|
|
166
|
+
"./dist/*": {
|
|
167
|
+
"types": "./dist/*",
|
|
168
|
+
"import": "./dist/*",
|
|
169
|
+
"require": "./dist/*"
|
|
119
170
|
}
|
|
120
171
|
},
|
|
121
172
|
"devDependencies": {
|
|
122
|
-
"@babel/core": "^7.
|
|
123
|
-
"@babel/
|
|
124
|
-
"@babel/preset-
|
|
125
|
-
"@
|
|
126
|
-
"@
|
|
127
|
-
"@
|
|
128
|
-
"@types/
|
|
129
|
-
"@
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
173
|
+
"@babel/core": "^7.27.1",
|
|
174
|
+
"@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1",
|
|
175
|
+
"@babel/preset-env": "^7.27.1",
|
|
176
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
177
|
+
"@playwright/test": "^1.52.0",
|
|
178
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
179
|
+
"@types/imagemin-svgo": "^10.0.5",
|
|
180
|
+
"@types/lodash": "^4.17.16",
|
|
181
|
+
"@types/lodash-es": "^4.17.12",
|
|
182
|
+
"@types/react": "^19.1.2",
|
|
183
|
+
"@types/tinycolor2": "^1.4.6",
|
|
184
|
+
"imagemin-svgo": "^11.0.1",
|
|
185
|
+
"less": "^4.3.0",
|
|
186
|
+
"prettier": "^3.5.3",
|
|
187
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
188
|
+
"svgo": "^3.3.2",
|
|
189
|
+
"tsx": "^4.19.4",
|
|
190
|
+
"typescript": "^5.8.3",
|
|
191
|
+
"vite": "^6.3.5"
|
|
138
192
|
},
|
|
139
193
|
"dependencies": {
|
|
140
|
-
"
|
|
141
|
-
"docx-preview": "^0.1.18",
|
|
142
|
-
"exceljs": "^4.3.0",
|
|
143
|
-
"jszip": "^3.10.1",
|
|
144
|
-
"lodash": "^4.17.21",
|
|
145
|
-
"tinycolor2": "^1.6.0",
|
|
146
|
-
"x-data-spreadsheet": "^1.1.9",
|
|
147
|
-
"ranuts": "0.1.0-alpha.10"
|
|
194
|
+
"ranuts": "^0.1.0-alpha-21"
|
|
148
195
|
},
|
|
149
196
|
"scripts": {
|
|
150
|
-
"dev": "vite",
|
|
197
|
+
"dev": "vite --host",
|
|
151
198
|
"build": "sh ./bin/build.sh",
|
|
152
199
|
"build:es": "vite build -c ./build/config.es.ts",
|
|
153
200
|
"build:umd": "vite build -c ./build/config.umd.ts",
|
|
@@ -155,6 +202,7 @@
|
|
|
155
202
|
"test": "sh ./bin/test.sh",
|
|
156
203
|
"test:report": "playwright show-report",
|
|
157
204
|
"test:ui": "playwright test --ui",
|
|
158
|
-
"test:update": "playwright test --update-snapshots"
|
|
205
|
+
"test:update": "playwright test --update-snapshots",
|
|
206
|
+
"tsc": "tsc --noEmit"
|
|
159
207
|
}
|
|
160
208
|
}
|
package/readme.md
CHANGED
|
@@ -7,24 +7,30 @@ UI Component library based on `Web Component`
|
|
|
7
7
|
<a href="https://github.com/chaxus/ran"><img src="https://img.shields.io/github/actions/workflow/status/chaxus/ran/ci.yml" alt="Build Status"></a>
|
|
8
8
|
<a href="https://github.com/chaxus/ran"><img src="https://img.shields.io/npm/v/ranui.svg" alt="npm-v"></a>
|
|
9
9
|
<a href="https://github.com/chaxus/ran"><img src="https://img.shields.io/npm/dt/ranui.svg" alt="npm-d"></a>
|
|
10
|
-
<a href="https://github.com/chaxus/ran"><img src="https://img.badgesize.io/https:/unpkg.com/ranui/dist/umd/
|
|
10
|
+
<a href="https://github.com/chaxus/ran"><img src="https://img.badgesize.io/https:/unpkg.com/ranui/dist/umd/shadowless/shadowless.umd.cjs?label=brotli&compression=brotli" alt="brotli"></a>
|
|
11
11
|
<a href="https://github.com/chaxus/ran"><img src="https://img.shields.io/badge/module%20formats-umd%2C%20esm-green.svg" alt="module formats: umd, esm"></a>
|
|
12
12
|
|
|
13
|
+
**English** | [中文](./README.zh-CN.md)
|
|
14
|
+
|
|
13
15
|
## Feature
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
1. **Cross-Framework Compatibility**: Works seamlessly with React, Vue, Preact, SolidJS, Svelte, and more. Integrates with any JavaScript project following W3C standards.
|
|
18
|
+
2. **Pure Native Experience**: No need for npm, React/Vue, or build tools. Easy to start, like using native div tags, simplifying structure and reducing learning costs.
|
|
19
|
+
3. **Modular Design**: Breaks systems into small, reusable components for enhanced maintainability and scalability.
|
|
20
|
+
4. **Open-Source**: Licensed under MIT, providing free access to all source code for personal or commercial use.
|
|
21
|
+
5. **Interactive Documentation**: Offers detailed, interactive documentation with live examples for efficient learning.
|
|
22
|
+
6. **Type-Checking**: Built on TypeScript with full type support, ensuring robust and maintainable code.
|
|
23
|
+
7. **Stability and Durability**: Framework independent (React/vue), avoid disruptive updates, and ensure continuous project operation.
|
|
18
24
|
|
|
19
25
|
## Install
|
|
20
26
|
|
|
21
27
|
Using npm:
|
|
22
28
|
|
|
23
29
|
```console
|
|
24
|
-
npm install ranui --save
|
|
30
|
+
npm install ranui@latest --save
|
|
25
31
|
```
|
|
26
32
|
|
|
27
|
-
## Document
|
|
33
|
+
## Document and Example
|
|
28
34
|
|
|
29
35
|
[See components and use examples](https://chaxus.github.io/ran/src/ranui/)
|
|
30
36
|
|
|
@@ -36,21 +42,44 @@ Support for on-demand import, which can reduce the size of loaded js
|
|
|
36
42
|
import 'ranui/button';
|
|
37
43
|
```
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
If there is a `style` problem, you can import the style manually
|
|
40
46
|
|
|
41
47
|
```js
|
|
42
|
-
import 'ranui/preview';
|
|
43
48
|
import 'ranui/style';
|
|
44
49
|
```
|
|
45
50
|
|
|
51
|
+
If there is a `type` problem, you can manually import the type
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import 'ranui/typings';
|
|
55
|
+
// or
|
|
56
|
+
import 'ranui/dist/index.d.ts';
|
|
57
|
+
// or
|
|
58
|
+
import 'ranui/type';
|
|
59
|
+
// or
|
|
60
|
+
import 'ranui/dist/typings';
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Not all of them. Just pick one that works
|
|
64
|
+
|
|
46
65
|
Support global import
|
|
47
66
|
|
|
67
|
+
```ts
|
|
68
|
+
import 'ranui';
|
|
69
|
+
```
|
|
70
|
+
|
|
48
71
|
- ES module
|
|
49
72
|
|
|
50
73
|
```js
|
|
51
74
|
import 'ranui';
|
|
52
75
|
```
|
|
53
76
|
|
|
77
|
+
Or
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
import 'ranui/button';
|
|
81
|
+
```
|
|
82
|
+
|
|
54
83
|
- UMD, IIFE, CJS
|
|
55
84
|
|
|
56
85
|
```html
|
|
@@ -93,12 +122,6 @@ document.body.appendChild(Button);
|
|
|
93
122
|
|
|
94
123
|
### jsx
|
|
95
124
|
|
|
96
|
-
Since `react` has composite events, for more convenient use, `ranui` is encapsulated through `react` high-level components to form [@ranui/react](https://www.npmjs.com/package/@ranui/react).
|
|
97
|
-
|
|
98
|
-
In react, it is recommended to use [@ranui/react](https://www.npmjs.com/package/@ranui/react).
|
|
99
|
-
|
|
100
|
-
However, `ranui` can still be used in any `js` or `ts` framework.
|
|
101
|
-
|
|
102
125
|
```jsx
|
|
103
126
|
import 'ranui';
|
|
104
127
|
|
|
@@ -124,12 +147,6 @@ import 'ranui';
|
|
|
124
147
|
|
|
125
148
|
### tsx
|
|
126
149
|
|
|
127
|
-
Since `react` has composite events, for more convenient use, [ranui](https://www.npmjs.com/package/ranui) is encapsulated through `react` high-level components, so there is [@ranui/react](https://www.npmjs.com/package/@ranui/react).
|
|
128
|
-
|
|
129
|
-
In `react`, using [@ranui/react](https://www.npmjs.com/package/@ranui/react) is silky and fully integrated into the `react` ecosystem after being wrapped in higher-order functions.
|
|
130
|
-
|
|
131
|
-
However, [ranui](https://www.npmjs.com/package/ranui) can still be used in any `js` or `ts`.
|
|
132
|
-
|
|
133
150
|
```tsx
|
|
134
151
|
// react 18
|
|
135
152
|
import type { SyntheticEvent } from 'react';
|
|
@@ -165,49 +182,16 @@ const FilePreview = () => {
|
|
|
165
182
|
};
|
|
166
183
|
```
|
|
167
184
|
|
|
168
|
-
`jsx` defines the types of all `HTML-native` components in `TypeScript`.
|
|
169
|
-
|
|
170
|
-
The `web component` type is not in the `jsx` definition.
|
|
171
|
-
|
|
172
|
-
You need to add it manually.
|
|
173
|
-
|
|
174
|
-
Otherwise you'll have type problems, but it actually works.
|
|
175
|
-
|
|
176
|
-
```ts
|
|
177
|
-
// typings.d.ts
|
|
178
|
-
interface RButton {
|
|
179
|
-
type?: string;
|
|
180
|
-
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
interface RPreview {
|
|
184
|
-
src?: string | Blob | ArrayBuffer;
|
|
185
|
-
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
|
186
|
-
ref?: React.MutableRefObject<HTMLDivElement | null>;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
declare namespace JSX {
|
|
190
|
-
interface IntrinsicElements {
|
|
191
|
-
'r-preview': React.DetailedHTMLProps<
|
|
192
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
193
|
-
HTMLDivElement
|
|
194
|
-
> &
|
|
195
|
-
RPreview;
|
|
196
|
-
'r-button': React.DetailedHTMLProps<
|
|
197
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
198
|
-
HTMLDivElement
|
|
199
|
-
> &
|
|
200
|
-
RButton;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
185
|
## Contributors
|
|
206
186
|
|
|
207
187
|
<a href="https://github.com/chaxus/ran/graphs/contributors">
|
|
208
188
|
<img src="https://contrib.rocks/image?repo=chaxus/ran" />
|
|
209
189
|
</a>
|
|
210
190
|
|
|
191
|
+
## Visitors
|
|
192
|
+
|
|
193
|
+

|
|
194
|
+
|
|
211
195
|
## Meta
|
|
212
196
|
|
|
213
197
|
[LICENSE (MIT)](/LICENSE)
|