ranui 0.1.9 → 0.1.10-alpha.10
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 +190 -0
- package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
- package/dist/arrow-down-B_hCY3Wt.js +662 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.js +7 -0
- package/dist/colorpicker.js +11 -0
- package/dist/{colz-746223ab.js → colz-DJZvo_8B.js} +4 -13
- package/dist/docx-CHkPTdGU.js +3665 -0
- package/dist/drop-4j4abxje.js +36 -0
- package/dist/icon.js +6 -0
- package/dist/iconShadowless.js +6 -0
- package/dist/image.js +4 -0
- package/dist/{index-4443363f.js → index-15M0olqa.js} +40 -68
- package/dist/index-1v568_nq.js +140 -0
- package/dist/index-B897keW5.js +279 -0
- package/dist/{index-e03d23e7.js → index-BZR0HaP2.js} +2 -5
- package/dist/{index-e2e5d725.js → index-B_GuEcTd.js} +1280 -2146
- package/dist/index-Bc2Bcl8D.js +63701 -0
- package/dist/index-C4Sv0T51.js +495 -0
- package/dist/{index-2d16a084.js → index-C6RcMHoH.js} +12 -22
- package/dist/index-C9z10IgG.js +103 -0
- package/dist/{index-3cf72afd.js → index-CFjEuvBW.js} +23 -45
- package/dist/{index-7b8840f9.js → index-CGEx9VOA.js} +1086 -2670
- package/dist/index-CGYfjKUV.js +72 -0
- package/dist/index-CVtBLEpV.js +712 -0
- package/dist/index-CiWwvEMM.js +511 -0
- package/dist/index-CtVOgBDk.js +659 -0
- package/dist/index-D4qUro5V.js +279 -0
- package/dist/index-D4y9c1Dj.js +310 -0
- package/dist/{index-b7790662.js → index-DAxs7Dd2.js} +6 -13
- package/dist/index-DC5EA657.js +91 -0
- package/dist/index-DJZmDHz-.js +146 -0
- package/dist/{index-0d5b9435.js → index-D_CA5VDZ.js} +11 -15
- package/dist/{index-01b17e26.js → index-KS2nvVcO.js} +2 -5
- package/dist/{index-1048a998.js → index-WfFw4LJT.js} +105 -62
- package/dist/{index-458debf7.js → index-mhFL9MJp.js} +15 -49
- package/dist/index.d.ts +211 -14
- package/dist/index.js +24 -24
- package/dist/info-circle-fill-CFeVMdci.js +4 -0
- package/dist/input.js +6 -0
- package/dist/inputShadowless.js +6 -0
- package/dist/jszip.min-Dhs3nUkD.js +2346 -0
- package/dist/katex-es-B5r5vt3m.js +14628 -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/{pdf-bdb7818a.js → pdf-Cx0VWKFo.js} +13 -8
- package/dist/player.js +8 -0
- package/dist/popover.js +8 -0
- package/dist/preview.js +7 -0
- package/dist/progress.js +7 -0
- package/dist/radar.js +6 -0
- package/dist/select.js +10 -0
- package/dist/{index-1b73beee.js → selectShadowless.js} +161 -165
- package/dist/shadowless.js +8 -0
- package/dist/skeleton.js +4 -0
- package/dist/sprite-CH2zLtZy.js +141 -0
- package/dist/style.css +1 -1
- package/dist/tab.js +6 -0
- package/dist/tabpane.js +4 -0
- package/dist/tsconfig.json +31 -0
- package/dist/typings.d.ts +211 -0
- package/dist/umd/index.umd.cjs +21 -32
- package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
- package/dist/umd/shadowless/style.css +1 -0
- package/dist/umd/style.css +1 -1
- package/package.json +113 -69
- package/readme.md +38 -56
- package/typings.d.ts +211 -0
- package/dist/build/config.d.ts +0 -3
- package/dist/build/config.es.d.ts +0 -2
- package/dist/build/config.umd.d.ts +0 -2
- package/dist/components/button/index.d.ts +0 -35
- package/dist/components/button/index.js +0 -8
- package/dist/components/form/index.d.ts +0 -2
- package/dist/components/icon/index.d.ts +0 -2
- package/dist/components/icon/index.js +0 -6
- package/dist/components/image/index.d.ts +0 -2
- package/dist/components/image/index.js +0 -4
- package/dist/components/input/index.d.ts +0 -185
- package/dist/components/input/index.js +0 -6
- package/dist/components/message/index.d.ts +0 -14
- package/dist/components/message/index.js +0 -4
- package/dist/components/modal/index.d.ts +0 -2
- 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.d.ts +0 -213
- package/dist/components/player/index.js +0 -12
- 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.d.ts +0 -6
- package/dist/components/preview/index.js +0 -8
- package/dist/components/preview/pdf.d.ts +0 -1
- 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.d.ts +0 -36
- package/dist/components/progress/index.js +0 -8
- package/dist/components/radar/index.d.ts +0 -2
- package/dist/components/radar/index.js +0 -7
- package/dist/components/scratch/index.d.ts +0 -19
- package/dist/components/select/index.d.ts +0 -105
- package/dist/components/select/index.js +0 -11
- package/dist/components/skeleton/index.d.ts +0 -2
- package/dist/components/skeleton/index.js +0 -4
- package/dist/components/tab/index.d.ts +0 -408
- package/dist/components/tab/index.js +0 -7
- package/dist/components/tabpane/index.d.ts +0 -352
- package/dist/components/tabpane/index.js +0 -4
- package/dist/docx-c5d02d8c.js +0 -21
- package/dist/index-57492b9b.js +0 -48
- package/dist/index-7216d6b0.js +0 -175
- package/dist/index-73ce455b.js +0 -264
- package/dist/index-7913ec46.js +0 -239
- package/dist/index-c14450a9.js +0 -662
- package/dist/info-circle-fill-90ec9aa9.js +0 -14
- package/dist/playwright.config.d.ts +0 -9
- package/dist/plugins/auto-import-file.d.ts +0 -0
- package/dist/plugins/load-style.d.ts +0 -6
- package/dist/plugins/load-svg.d.ts +0 -9
- package/dist/tests/button.spec.d.ts +0 -1
- package/dist/umd/build/config.d.ts +0 -3
- package/dist/umd/build/config.es.d.ts +0 -2
- package/dist/umd/build/config.umd.d.ts +0 -2
- package/dist/umd/components/button/index.d.ts +0 -35
- package/dist/umd/components/form/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 -185
- 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 -213
- 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/scratch/index.d.ts +0 -19
- package/dist/umd/components/select/index.d.ts +0 -105
- package/dist/umd/components/skeleton/index.d.ts +0 -2
- package/dist/umd/components/tab/index.d.ts +0 -408
- package/dist/umd/components/tabpane/index.d.ts +0 -352
- 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/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/utils/image.d.ts +0 -32
- package/dist/utils/index.d.ts +0 -64
- package/dist/utils/math.d.ts +0 -26
- package/dist/utils/tween.d.ts +0 -21
- package/dist/vendor-f71e6f68.js +0 -92126
- package/dist/vite.config.d.ts +0 -6
- /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
- /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +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/{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
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# ranui
|
|
2
|
+
|
|
3
|
+
基于 `Web Components` 组件方案
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
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
|
+
<a href="https://github.com/chaxus/ran"><img src="https://img.shields.io/npm/v/ranui.svg" alt="npm-v"></a>
|
|
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/shadowless/shadowless.umd.cjs?label=brotli&compression=brotli" alt="brotli"></a>
|
|
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
|
+
|
|
13
|
+
**中文** | [English](./README.md)
|
|
14
|
+
|
|
15
|
+
## 特点
|
|
16
|
+
|
|
17
|
+
1. **跨框架兼容:** 与 React, Vue, Preact, SolidJS, Svelte 等兼容。可以和遵循 W3C 标准的任何 JavaScript 项目集成。
|
|
18
|
+
2. **原生体验:** 易于入门,像使用本地 div 标签,简化项目大小和减少学习成本。
|
|
19
|
+
3. **模块化设计:** 可选导入和全量导入,以增强可维护性和可伸缩性。
|
|
20
|
+
4. **交互式丰富文档:** 提供详细的交互式文档,并附有有效的示例子。
|
|
21
|
+
5. **支持类型校验:** 基于 TypeScript 构建,具有类型支持,确保代码的健壮性和可维护性。
|
|
22
|
+
6. **持久和稳定:** 与框架 (React/vue) 无关,避免破坏性的更新,并确保持续的项目运行。
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
使用 npm:
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
npm install ranui --save
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 文档和示例
|
|
33
|
+
|
|
34
|
+
[See components and use examples](https://chaxus.github.io/ran/cn/src/ranui/)
|
|
35
|
+
|
|
36
|
+
## 引入方式
|
|
37
|
+
|
|
38
|
+
支持按需导入,以显著减少包体积大小
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import 'ranui/button';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
如果遇到样式问题,可以选择手动导入样式文件
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import 'ranui/style';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
如果遇到类型问题,可以选择手动导入类型文件
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import 'ranui/types';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
或者
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import 'ranui/dist/typings';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
也支持全量导入
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import 'ranui';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- ES module
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
import 'ranui';
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
或者
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
import 'ranui/button';
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- UMD, IIFE, CJS
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<script src="./ranui/dist/umd/index.umd.cjs"></script>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 使用方式
|
|
87
|
+
|
|
88
|
+
它是基于`Web Components`的组件,你可以不用关注框架就可以使用它。
|
|
89
|
+
|
|
90
|
+
在大多数情况下,您可以像使用本地 `div` 标签一样使用它
|
|
91
|
+
|
|
92
|
+
下面是一些例子:
|
|
93
|
+
|
|
94
|
+
- html
|
|
95
|
+
- js
|
|
96
|
+
- jsx
|
|
97
|
+
- vue
|
|
98
|
+
- tsx
|
|
99
|
+
|
|
100
|
+
### html
|
|
101
|
+
|
|
102
|
+
```html
|
|
103
|
+
<script src="./ranui/dist/umd/index.umd.cjs"></script>
|
|
104
|
+
|
|
105
|
+
<body>
|
|
106
|
+
<r-button>Button</r-button>
|
|
107
|
+
</body>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### js
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
import 'ranui';
|
|
114
|
+
|
|
115
|
+
const Button = document.createElement('r-button');
|
|
116
|
+
Button.appendChild('this is button text');
|
|
117
|
+
document.body.appendChild(Button);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### jsx
|
|
121
|
+
|
|
122
|
+
```jsx
|
|
123
|
+
import 'ranui';
|
|
124
|
+
|
|
125
|
+
const App = () => {
|
|
126
|
+
return (
|
|
127
|
+
<>
|
|
128
|
+
<r-button>Button</r-button>
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### vue
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<template>
|
|
138
|
+
<r-button></r-button>
|
|
139
|
+
</template>
|
|
140
|
+
<script>
|
|
141
|
+
import 'ranui';
|
|
142
|
+
</script>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### tsx
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
// react 18
|
|
149
|
+
import type { SyntheticEvent } from 'react';
|
|
150
|
+
import React, { useRef } from 'react';
|
|
151
|
+
import 'ranui';
|
|
152
|
+
|
|
153
|
+
const FilePreview = () => {
|
|
154
|
+
const ref = useRef<HTMLDivElement | null>(null);
|
|
155
|
+
const uploadFile = (e: SyntheticEvent<HTMLDivElement>) => {
|
|
156
|
+
if (ref.current) {
|
|
157
|
+
const uploadFile = document.createElement('input');
|
|
158
|
+
uploadFile.setAttribute('type', 'file');
|
|
159
|
+
uploadFile.click();
|
|
160
|
+
uploadFile.onchange = (e) => {
|
|
161
|
+
const { files = [] } = uploadFile;
|
|
162
|
+
if (files && files?.length > 0 && ref.current) {
|
|
163
|
+
ref.current.setAttribute('src', '');
|
|
164
|
+
const file = files[0];
|
|
165
|
+
const url = URL.createObjectURL(file);
|
|
166
|
+
ref.current.setAttribute('src', url);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
return (
|
|
172
|
+
<div>
|
|
173
|
+
<r-preview ref={ref}></r-preview>
|
|
174
|
+
<r-button type="primary" onClick={uploadFile}>
|
|
175
|
+
choose file to preview
|
|
176
|
+
</r-button>
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 贡献者
|
|
183
|
+
|
|
184
|
+
<a href="https://github.com/chaxus/ran/graphs/contributors">
|
|
185
|
+
<img src="https://contrib.rocks/image?repo=chaxus/ran" />
|
|
186
|
+
</a>
|
|
187
|
+
|
|
188
|
+
## Meta
|
|
189
|
+
|
|
190
|
+
[LICENSE (MIT)](/LICENSE)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
function commonjsRequire(path) {
|
|
6
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
commonjsRequire as a,
|
|
10
|
+
commonjsGlobal as c,
|
|
11
|
+
getDefaultExportFromCjs as g
|
|
12
|
+
};
|