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.
Files changed (198) hide show
  1. package/README.zh-CN.md +190 -0
  2. package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
  3. package/dist/arrow-down-B_hCY3Wt.js +662 -0
  4. package/dist/button.js +7 -0
  5. package/dist/checkbox.js +7 -0
  6. package/dist/colorpicker.js +11 -0
  7. package/dist/{colz-746223ab.js → colz-DJZvo_8B.js} +4 -13
  8. package/dist/docx-CHkPTdGU.js +3665 -0
  9. package/dist/drop-4j4abxje.js +36 -0
  10. package/dist/icon.js +6 -0
  11. package/dist/iconShadowless.js +6 -0
  12. package/dist/image.js +4 -0
  13. package/dist/{index-4443363f.js → index-15M0olqa.js} +40 -68
  14. package/dist/index-1v568_nq.js +140 -0
  15. package/dist/index-B897keW5.js +279 -0
  16. package/dist/{index-e03d23e7.js → index-BZR0HaP2.js} +2 -5
  17. package/dist/{index-e2e5d725.js → index-B_GuEcTd.js} +1280 -2146
  18. package/dist/index-Bc2Bcl8D.js +63701 -0
  19. package/dist/index-C4Sv0T51.js +495 -0
  20. package/dist/{index-2d16a084.js → index-C6RcMHoH.js} +12 -22
  21. package/dist/index-C9z10IgG.js +103 -0
  22. package/dist/{index-3cf72afd.js → index-CFjEuvBW.js} +23 -45
  23. package/dist/{index-7b8840f9.js → index-CGEx9VOA.js} +1086 -2670
  24. package/dist/index-CGYfjKUV.js +72 -0
  25. package/dist/index-CVtBLEpV.js +712 -0
  26. package/dist/index-CiWwvEMM.js +511 -0
  27. package/dist/index-CtVOgBDk.js +659 -0
  28. package/dist/index-D4qUro5V.js +279 -0
  29. package/dist/index-D4y9c1Dj.js +310 -0
  30. package/dist/{index-b7790662.js → index-DAxs7Dd2.js} +6 -13
  31. package/dist/index-DC5EA657.js +91 -0
  32. package/dist/index-DJZmDHz-.js +146 -0
  33. package/dist/{index-0d5b9435.js → index-D_CA5VDZ.js} +11 -15
  34. package/dist/{index-01b17e26.js → index-KS2nvVcO.js} +2 -5
  35. package/dist/{index-1048a998.js → index-WfFw4LJT.js} +105 -62
  36. package/dist/{index-458debf7.js → index-mhFL9MJp.js} +15 -49
  37. package/dist/index.d.ts +211 -14
  38. package/dist/index.js +24 -24
  39. package/dist/info-circle-fill-CFeVMdci.js +4 -0
  40. package/dist/input.js +6 -0
  41. package/dist/inputShadowless.js +6 -0
  42. package/dist/jszip.min-Dhs3nUkD.js +2346 -0
  43. package/dist/katex-es-B5r5vt3m.js +14628 -0
  44. package/dist/loading-scene-BMc2wqKm.js +4 -0
  45. package/dist/loading.js +8 -0
  46. package/dist/math.js +7 -0
  47. package/dist/message.js +6 -0
  48. package/dist/modal.js +4 -0
  49. package/dist/{pdf-bdb7818a.js → pdf-Cx0VWKFo.js} +13 -8
  50. package/dist/player.js +8 -0
  51. package/dist/popover.js +8 -0
  52. package/dist/preview.js +7 -0
  53. package/dist/progress.js +7 -0
  54. package/dist/radar.js +6 -0
  55. package/dist/select.js +10 -0
  56. package/dist/{index-1b73beee.js → selectShadowless.js} +161 -165
  57. package/dist/shadowless.js +8 -0
  58. package/dist/skeleton.js +4 -0
  59. package/dist/sprite-CH2zLtZy.js +141 -0
  60. package/dist/style.css +1 -1
  61. package/dist/tab.js +6 -0
  62. package/dist/tabpane.js +4 -0
  63. package/dist/tsconfig.json +31 -0
  64. package/dist/typings.d.ts +211 -0
  65. package/dist/umd/index.umd.cjs +21 -32
  66. package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
  67. package/dist/umd/shadowless/style.css +1 -0
  68. package/dist/umd/style.css +1 -1
  69. package/package.json +113 -69
  70. package/readme.md +38 -56
  71. package/typings.d.ts +211 -0
  72. package/dist/build/config.d.ts +0 -3
  73. package/dist/build/config.es.d.ts +0 -2
  74. package/dist/build/config.umd.d.ts +0 -2
  75. package/dist/components/button/index.d.ts +0 -35
  76. package/dist/components/button/index.js +0 -8
  77. package/dist/components/form/index.d.ts +0 -2
  78. package/dist/components/icon/index.d.ts +0 -2
  79. package/dist/components/icon/index.js +0 -6
  80. package/dist/components/image/index.d.ts +0 -2
  81. package/dist/components/image/index.js +0 -4
  82. package/dist/components/input/index.d.ts +0 -185
  83. package/dist/components/input/index.js +0 -6
  84. package/dist/components/message/index.d.ts +0 -14
  85. package/dist/components/message/index.js +0 -4
  86. package/dist/components/modal/index.d.ts +0 -2
  87. package/dist/components/modal/index.js +0 -4
  88. package/dist/components/option/index.d.ts +0 -2
  89. package/dist/components/option/index.js +0 -95
  90. package/dist/components/player/index.d.ts +0 -213
  91. package/dist/components/player/index.js +0 -12
  92. package/dist/components/preview/colz.d.ts +0 -72
  93. package/dist/components/preview/docx.d.ts +0 -8
  94. package/dist/components/preview/excel/excel.d.ts +0 -2
  95. package/dist/components/preview/excel/index.d.ts +0 -1
  96. package/dist/components/preview/excel/media.d.ts +0 -37
  97. package/dist/components/preview/index.d.ts +0 -6
  98. package/dist/components/preview/index.js +0 -8
  99. package/dist/components/preview/pdf.d.ts +0 -1
  100. package/dist/components/preview/pptx/index.d.ts +0 -16
  101. package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
  102. package/dist/components/preview/pptx/t_xml.d.ts +0 -1
  103. package/dist/components/preview/pptx/worker.d.ts +0 -1
  104. package/dist/components/progress/index.d.ts +0 -36
  105. package/dist/components/progress/index.js +0 -8
  106. package/dist/components/radar/index.d.ts +0 -2
  107. package/dist/components/radar/index.js +0 -7
  108. package/dist/components/scratch/index.d.ts +0 -19
  109. package/dist/components/select/index.d.ts +0 -105
  110. package/dist/components/select/index.js +0 -11
  111. package/dist/components/skeleton/index.d.ts +0 -2
  112. package/dist/components/skeleton/index.js +0 -4
  113. package/dist/components/tab/index.d.ts +0 -408
  114. package/dist/components/tab/index.js +0 -7
  115. package/dist/components/tabpane/index.d.ts +0 -352
  116. package/dist/components/tabpane/index.js +0 -4
  117. package/dist/docx-c5d02d8c.js +0 -21
  118. package/dist/index-57492b9b.js +0 -48
  119. package/dist/index-7216d6b0.js +0 -175
  120. package/dist/index-73ce455b.js +0 -264
  121. package/dist/index-7913ec46.js +0 -239
  122. package/dist/index-c14450a9.js +0 -662
  123. package/dist/info-circle-fill-90ec9aa9.js +0 -14
  124. package/dist/playwright.config.d.ts +0 -9
  125. package/dist/plugins/auto-import-file.d.ts +0 -0
  126. package/dist/plugins/load-style.d.ts +0 -6
  127. package/dist/plugins/load-svg.d.ts +0 -9
  128. package/dist/tests/button.spec.d.ts +0 -1
  129. package/dist/umd/build/config.d.ts +0 -3
  130. package/dist/umd/build/config.es.d.ts +0 -2
  131. package/dist/umd/build/config.umd.d.ts +0 -2
  132. package/dist/umd/components/button/index.d.ts +0 -35
  133. package/dist/umd/components/form/index.d.ts +0 -2
  134. package/dist/umd/components/icon/index.d.ts +0 -2
  135. package/dist/umd/components/image/index.d.ts +0 -2
  136. package/dist/umd/components/input/index.d.ts +0 -185
  137. package/dist/umd/components/message/index.d.ts +0 -14
  138. package/dist/umd/components/modal/index.d.ts +0 -2
  139. package/dist/umd/components/option/index.d.ts +0 -2
  140. package/dist/umd/components/player/index.d.ts +0 -213
  141. package/dist/umd/components/preview/colz.d.ts +0 -72
  142. package/dist/umd/components/preview/docx.d.ts +0 -8
  143. package/dist/umd/components/preview/excel/excel.d.ts +0 -2
  144. package/dist/umd/components/preview/excel/index.d.ts +0 -1
  145. package/dist/umd/components/preview/excel/media.d.ts +0 -37
  146. package/dist/umd/components/preview/index.d.ts +0 -6
  147. package/dist/umd/components/preview/pdf.d.ts +0 -1
  148. package/dist/umd/components/preview/pptx/index.d.ts +0 -16
  149. package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
  150. package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
  151. package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
  152. package/dist/umd/components/progress/index.d.ts +0 -36
  153. package/dist/umd/components/radar/index.d.ts +0 -2
  154. package/dist/umd/components/scratch/index.d.ts +0 -19
  155. package/dist/umd/components/select/index.d.ts +0 -105
  156. package/dist/umd/components/skeleton/index.d.ts +0 -2
  157. package/dist/umd/components/tab/index.d.ts +0 -408
  158. package/dist/umd/components/tabpane/index.d.ts +0 -352
  159. package/dist/umd/index.d.ts +0 -14
  160. package/dist/umd/playwright.config.d.ts +0 -9
  161. package/dist/umd/plugins/auto-import-file.d.ts +0 -0
  162. package/dist/umd/plugins/load-style.d.ts +0 -6
  163. package/dist/umd/plugins/load-svg.d.ts +0 -9
  164. package/dist/umd/tests/button.spec.d.ts +0 -1
  165. package/dist/umd/utils/image.d.ts +0 -32
  166. package/dist/umd/utils/index.d.ts +0 -64
  167. package/dist/umd/utils/math.d.ts +0 -26
  168. package/dist/umd/utils/tween.d.ts +0 -21
  169. package/dist/umd/vite.config.d.ts +0 -6
  170. package/dist/utils/image.d.ts +0 -32
  171. package/dist/utils/index.d.ts +0 -64
  172. package/dist/utils/math.d.ts +0 -26
  173. package/dist/utils/tween.d.ts +0 -21
  174. package/dist/vendor-f71e6f68.js +0 -92126
  175. package/dist/vite.config.d.ts +0 -6
  176. /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
  177. /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
  178. /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
  179. /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
  180. /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
  181. /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
  182. /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
  183. /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
  184. /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
  185. /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
  186. /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
  187. /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
  188. /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
  189. /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
  190. /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
  191. /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
  192. /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
  193. /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
  194. /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
  195. /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
  196. /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
  197. /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
  198. /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranui",
3
- "version": "0.1.9",
3
+ "version": "0.1.10-alpha.10",
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,12 +9,31 @@
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/tree/main/packages/ranui"
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",
20
+ "engines": {
21
+ "node": "^16.20.2 || >=18.0.0"
22
+ },
23
+ "scripts": {
24
+ "dev": "vite --host",
25
+ "build": "sh ./bin/build.sh",
26
+ "build:es": "vite build -c ./build/config.es.ts",
27
+ "build:umd": "vite build -c ./build/config.umd.ts",
28
+ "prepublish": "npm run build",
29
+ "test": "sh ./bin/test.sh",
30
+ "test:report": "playwright show-report",
31
+ "test:ui": "playwright test --ui",
32
+ "test:update": "playwright test --update-snapshots"
33
+ },
16
34
  "files": [
17
- "dist/*"
35
+ "dist",
36
+ "typings.d.ts"
18
37
  ],
19
38
  "keywords": [
20
39
  "ran",
@@ -34,124 +53,149 @@
34
53
  "import": "./dist/index.js",
35
54
  "require": "./dist/umd/index.umd.cjs"
36
55
  },
56
+ "./shadowless": {
57
+ "types": "./dist/index.d.ts",
58
+ "import": "./dist/shadowless.js",
59
+ "require": "./dist/umd/shadowless/shadowless.umd.cjs"
60
+ },
37
61
  "./button": {
38
- "types": "./dist/components/button/index.d.ts",
39
- "import": "./dist/components/button/index.js",
62
+ "types": "./dist/index.d.ts",
63
+ "import": "./dist/button.js",
40
64
  "require": "./dist/umd/index.umd.cjs"
41
65
  },
42
66
  "./icon": {
43
- "types": "./dist/components/icon/index.d.ts",
44
- "import": "./dist/components/icon/index.js",
67
+ "types": "./dist/index.d.ts",
68
+ "import": "./dist/icon.js",
45
69
  "require": "./dist/umd/index.umd.cjs"
46
70
  },
47
71
  "./image": {
48
- "types": "./dist/components/image/index.d.ts",
49
- "import": "./dist/components/image/index.js",
72
+ "types": "./dist/index.d.ts",
73
+ "import": "./dist/image.js",
50
74
  "require": "./dist/umd/index.umd.cjs"
51
75
  },
52
76
  "./input": {
53
- "types": "./dist/components/input/index.d.ts",
54
- "import": "./dist/components/input/index.js",
77
+ "types": "./dist/index.d.ts",
78
+ "import": "./dist/input.js",
55
79
  "require": "./dist/umd/index.umd.cjs"
56
80
  },
57
81
  "./message": {
58
- "types": "./dist/components/message/index.d.ts",
59
- "import": "./dist/components/message/index.js",
82
+ "types": "./dist/index.d.ts",
83
+ "import": "./dist/message.js",
60
84
  "require": "./dist/umd/index.umd.cjs"
61
85
  },
62
86
  "./preview": {
63
- "types": "./dist/components/preview/index.d.ts",
64
- "import": "./dist/components/preview/index.js",
87
+ "types": "./dist/index.d.ts",
88
+ "import": "./dist/preview.js",
65
89
  "require": "./dist/umd/index.umd.cjs"
66
90
  },
67
91
  "./skeleton": {
68
- "types": "./dist/components/skeleton/index.d.ts",
69
- "import": "./dist/components/skeleton/index.js",
92
+ "types": "./dist/index.d.ts",
93
+ "import": "./dist/skeleton.js",
70
94
  "require": "./dist/umd/index.umd.cjs"
71
95
  },
72
96
  "./tab": {
73
- "types": "./dist/components/tab/index.d.ts",
74
- "import": "./dist/components/tab/index.js",
97
+ "types": "./dist/index.d.ts",
98
+ "import": "./dist/tab.js",
75
99
  "require": "./dist/umd/index.umd.cjs"
76
100
  },
77
101
  "./tabpane": {
78
- "types": "./dist/components/tabpane/index.d.ts",
79
- "import": "./dist/components/tabpane/index.js",
102
+ "types": "./dist/index.d.ts",
103
+ "import": "./dist/tabpane.js",
80
104
  "require": "./dist/umd/index.umd.cjs"
81
105
  },
82
106
  "./radar": {
83
- "types": "./dist/components/radar/index.d.ts",
84
- "import": "./dist/components/radar/index.js",
107
+ "types": "./dist/index.d.ts",
108
+ "import": "./dist/radar.js",
85
109
  "require": "./dist/umd/index.umd.cjs"
86
110
  },
87
111
  "./modal": {
88
- "types": "./dist/components/modal/index.d.ts",
89
- "import": "./dist/components/modal/index.js",
112
+ "types": "./dist/index.d.ts",
113
+ "import": "./dist/modal.js",
90
114
  "require": "./dist/umd/index.umd.cjs"
91
115
  },
92
116
  "./select": {
93
- "types": "./dist/components/select/index.d.ts",
94
- "import": "./dist/components/select/index.js",
95
- "require": "./dist/umd/index.umd.cjs"
96
- },
97
- "./option": {
98
- "types": "./dist/components/option/index.d.ts",
99
- "import": "./dist/components/option/index.js",
117
+ "types": "./dist/index.d.ts",
118
+ "import": "./dist/select.js",
100
119
  "require": "./dist/umd/index.umd.cjs"
101
120
  },
102
121
  "./progress": {
103
- "types": "./dist/components/progress/index.d.ts",
104
- "import": "./dist/components/progress/index.js",
122
+ "types": "./dist/index.d.ts",
123
+ "import": "./dist/progress.js",
105
124
  "require": "./dist/umd/index.umd.cjs"
106
125
  },
107
126
  "./player": {
108
- "types": "./dist/components/player/index.d.ts",
109
- "import": "./dist/components/player/index.js",
127
+ "types": "./dist/index.d.ts",
128
+ "import": "./dist/player.js",
129
+ "require": "./dist/umd/index.umd.cjs"
130
+ },
131
+ "./popover": {
132
+ "types": "./dist/index.d.ts",
133
+ "import": "./dist/popover.js",
134
+ "require": "./dist/umd/index.umd.cjs"
135
+ },
136
+ "./content": {
137
+ "types": "./dist/index.d.ts",
138
+ "import": "./dist/content.js",
139
+ "require": "./dist/umd/index.umd.cjs"
140
+ },
141
+ "./loading": {
142
+ "types": "./dist/index.d.ts",
143
+ "import": "./dist/loading.js",
144
+ "require": "./dist/umd/index.umd.cjs"
145
+ },
146
+ "./colorpicker": {
147
+ "types": "./dist/index.d.ts",
148
+ "import": "./dist/colorpicker.js",
149
+ "require": "./dist/umd/index.umd.cjs"
150
+ },
151
+ "./math": {
152
+ "types": "./dist/index.d.ts",
153
+ "import": "./dist/math.js",
154
+ "require": "./dist/umd/index.umd.cjs"
155
+ },
156
+ "./checkbox": {
157
+ "types": "./dist/index.d.ts",
158
+ "import": "./dist/checkbox.js",
110
159
  "require": "./dist/umd/index.umd.cjs"
111
160
  },
112
161
  "./style": {
113
162
  "types": "./dist/index.d.ts",
114
163
  "import": "./dist/style.css",
115
164
  "require": "./dist/umd/index.umd.cjs"
165
+ },
166
+ "./types": {
167
+ "types": "./dist/index.d.ts",
168
+ "import": "./dist/index.d.ts",
169
+ "require": "./dist/index.d.ts"
116
170
  }
117
171
  },
118
172
  "devDependencies": {
119
- "@babel/core": "^7.20.5",
120
- "@babel/preset-env": "^7.22.7",
121
- "@babel/preset-typescript": "^7.22.5",
122
- "@playwright/test": "^1.36.2",
123
- "@types/imagemin-svgo": "^10.0.4",
124
- "@types/lodash": "^4.14.197",
125
- "@types/tinycolor2": "^1.4.3",
126
- "@vheemstra/vite-plugin-imagemin": "^1.0.12",
173
+ "@babel/core": "^7.24.5",
174
+ "@babel/preset-env": "^7.24.5",
175
+ "@babel/preset-typescript": "^7.24.1",
176
+ "@playwright/test": "^1.44.0",
177
+ "@types/imagemin-svgo": "^10.0.5",
178
+ "@types/lodash": "^4.17.1",
179
+ "@types/react": "^18.3.1",
180
+ "@types/tinycolor2": "^1.4.6",
181
+ "@vheemstra/vite-plugin-imagemin": "^1.2.1",
127
182
  "imagemin-svgo": "^10.0.1",
128
- "less": "^4.1.3",
129
- "prettier": "^2.8.1",
130
- "rollup-plugin-visualizer": "^5.9.2",
131
- "svgo": "^3.0.0",
132
- "tsx": "^3.12.7",
133
- "vite": "^5.0.9",
134
- "vite-plugin-dts": "^3.6.4"
183
+ "less": "^4.2.0",
184
+ "prettier": "^2.8.8",
185
+ "react": "^18.3.1",
186
+ "react-dom": "^18.3.1",
187
+ "rollup-plugin-visualizer": "^5.12.0",
188
+ "svgo": "^3.3.0",
189
+ "tsx": "^3.14.0",
190
+ "typescript": "^5.4.5",
191
+ "vite": "^5.2.11"
135
192
  },
136
193
  "dependencies": {
137
- "dayjs": "^1.11.9",
138
- "docx-preview": "^0.1.18",
139
- "exceljs": "^4.3.0",
194
+ "dayjs": "^1.11.11",
195
+ "exceljs": "^4.4.0",
140
196
  "jszip": "^3.10.1",
141
197
  "lodash": "^4.17.21",
142
- "ranuts": "0.1.0-alpha.10",
143
- "tinycolor2": "^1.6.0",
144
- "x-data-spreadsheet": "^1.1.9"
145
- },
146
- "scripts": {
147
- "dev": "vite",
148
- "build": "sh ./bin/build.sh",
149
- "build:es": "vite build -c ./build/config.es.ts",
150
- "build:umd": "vite build -c ./build/config.umd.ts",
151
- "prepublish": "npm run build",
152
- "test": "sh ./bin/test.sh",
153
- "test:report": "playwright show-report",
154
- "test:ui": "playwright test --ui",
155
- "test:update": "playwright test --update-snapshots"
198
+ "ranuts": "workspace:^",
199
+ "tinycolor2": "^1.6.0"
156
200
  }
157
- }
201
+ }
package/readme.md CHANGED
@@ -7,14 +7,20 @@ 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/index.umd.cjs?label=brotli&compression=brotli" alt="brotli"></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
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
- - **Across the frame**: It works with `react`, `vue`, or native projects.
16
- - **Componentization**: The `shadow dom` actually implements componentization of style and functionality.
17
- - **native**: A component is like using a `div`tag.
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
 
@@ -24,7 +30,7 @@ Using npm:
24
30
  npm install ranui --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,42 @@ Support for on-demand import, which can reduce the size of loaded js
36
42
  import 'ranui/button';
37
43
  ```
38
44
 
39
- For global components like `preview` and `message`, you need to import global styles
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/types';
55
+ ```
56
+
57
+ Or
58
+
59
+ ```ts
60
+ import 'ranui/dist/typings';
61
+ ```
62
+
46
63
  Support global import
47
64
 
65
+ ```ts
66
+ import 'ranui';
67
+ ```
68
+
48
69
  - ES module
49
70
 
50
71
  ```js
51
72
  import 'ranui';
52
73
  ```
53
74
 
75
+ Or
76
+
77
+ ```js
78
+ import 'ranui/button';
79
+ ```
80
+
54
81
  - UMD, IIFE, CJS
55
82
 
56
83
  ```html
@@ -93,12 +120,6 @@ document.body.appendChild(Button);
93
120
 
94
121
  ### jsx
95
122
 
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
123
  ```jsx
103
124
  import 'ranui';
104
125
 
@@ -124,12 +145,6 @@ import 'ranui';
124
145
 
125
146
  ### tsx
126
147
 
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
148
  ```tsx
134
149
  // react 18
135
150
  import type { SyntheticEvent } from 'react';
@@ -165,49 +180,16 @@ const FilePreview = () => {
165
180
  };
166
181
  ```
167
182
 
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
183
  ## Contributors
206
184
 
207
185
  <a href="https://github.com/chaxus/ran/graphs/contributors">
208
186
  <img src="https://contrib.rocks/image?repo=chaxus/ran" />
209
187
  </a>
210
188
 
189
+ ## Visitors
190
+
191
+ ![](http://profile-counter.glitch.me/chaxus-ranui/count.svg)
192
+
211
193
  ## Meta
212
194
 
213
195
  [LICENSE (MIT)](/LICENSE)
package/typings.d.ts ADDED
@@ -0,0 +1,211 @@
1
+ declare module '*.less';
2
+ declare module '*.less?inline';
3
+ declare module '*.ts';
4
+ declare module '*.svg';
5
+ declare module 'docx-preview';
6
+ declare module 'exceljs/*';
7
+ declare module '@/assets/*';
8
+ declare module '@/public/*';
9
+ declare module '@/components/*';
10
+ declare module '@/plugins/*';
11
+
12
+ declare namespace Ran {
13
+ interface Prompt {
14
+ content: string;
15
+ duration?: number;
16
+ close?: () => void;
17
+ }
18
+ type Hint = (options: Prompt | string) => void;
19
+
20
+ interface Message {
21
+ info: Hint;
22
+ success: Hint;
23
+ error: Hint;
24
+ warning: Hint;
25
+ toast: Hint;
26
+ }
27
+ }
28
+
29
+ interface Ranui {
30
+ message: Partial<Ran.Message>;
31
+ }
32
+
33
+ interface HlsPlayer {
34
+ off: (s: string, f: Function) => void;
35
+ on: (s: string, f: Function) => void;
36
+ loadSource: (s: string) => void;
37
+ attachMedia: (v: HTMLVideoElement) => void;
38
+ destroy: () => void;
39
+ startLoad(): () => void;
40
+ }
41
+
42
+ interface Hls {
43
+ Events: {
44
+ MANIFEST_LOADED: 'hlsManifestLoaded';
45
+ ERROR: 'error';
46
+ };
47
+ isSupported: () => boolean;
48
+ }
49
+
50
+ type HLS = Hls & (new () => HlsPlayer);
51
+
52
+ interface Viewport {
53
+ width: number;
54
+ height: number;
55
+ viewBox: Array<number>;
56
+ }
57
+ interface RenderContext {
58
+ canvasContext: CanvasRenderingContext2D | null;
59
+ transform: Array<number>;
60
+ viewport: Viewport;
61
+ }
62
+
63
+ interface PDFPageProxy {
64
+ pageNumber: number;
65
+ getViewport: () => Viewport;
66
+ render: (options: RenderContext) => void;
67
+ }
68
+
69
+ interface PDFDocumentProxy {
70
+ numPages: number;
71
+ getPage: (x: number) => Promise<PDFPageProxy>;
72
+ }
73
+
74
+ interface HTMLElement {
75
+ mozRequestFullScreen: (options?: FullscreenOptions) => Promise<void>;
76
+ msRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
77
+ oRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
78
+ webkitRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
79
+ webkitEnterFullscreen: (options?: FullscreenOptions) => Promise<void>;
80
+ }
81
+ declare interface Document {
82
+ msExitFullscreen: () => Promise<void>;
83
+ mozCancelFullScreen: () => Promise<void>;
84
+ oCancelFullScreen: () => Promise<void>;
85
+ webkitExitFullscreen: () => Promise<void>;
86
+ }
87
+
88
+ interface MathJax {
89
+ texReset: () => void;
90
+ getMetricsFor: (x: HTMLElement) => object;
91
+ tex2chtmlPromise: (x: string, y: object) => Promise<Element>;
92
+ }
93
+
94
+ declare interface Window {
95
+ ranui: Partial<Ranui>;
96
+ message: Partial<Ran.Message>;
97
+ MathJax: MathJax;
98
+ katex: {
99
+ render: (x: string, y: HTMLElement, z: object) => void;
100
+ };
101
+ pdfjsLib: {
102
+ GlobalWorkerOptions: {
103
+ workerSrc: string;
104
+ };
105
+ getDocument: (x: string | ArrayBuffer) => {
106
+ promise: Promise<PDFDocumentProxy>;
107
+ };
108
+ };
109
+ Hls: HLS;
110
+ }
111
+
112
+ namespace JSX {
113
+ interface IntrinsicElements {
114
+ 'r-loading': any & {
115
+ name: NAME_AMP;
116
+ };
117
+ 'r-math': any & {
118
+ latex: string;
119
+ };
120
+ 'r-button': any & {
121
+ sheet: string;
122
+ disabled: boolean | string;
123
+ iconSize: string;
124
+ icon: string;
125
+ effect: boolean | string;
126
+ };
127
+ 'r-checkbox': any & {
128
+ disabled: boolean | string;
129
+ checked: boolean | string;
130
+ };
131
+ 'r-img': any & {
132
+ fallback: string;
133
+ src: string;
134
+ };
135
+ 'r-input': any & {
136
+ value: string;
137
+ placeholder: string;
138
+ label: string;
139
+ status: string;
140
+ name: string;
141
+ icon: string;
142
+ prefix: string;
143
+ suffix: string;
144
+ type: string;
145
+ required: boolean | string;
146
+ disabled: boolean | string;
147
+ min: number | string;
148
+ max: number | string;
149
+ step: number | string;
150
+ };
151
+ 'r-player': any & {
152
+ src: string;
153
+ debug: boolean | string;
154
+ volume: number | string;
155
+ currentTime: number | string;
156
+ playbackRate: number | string;
157
+ };
158
+ 'r-popover': any & {
159
+ placement: string;
160
+ trigger: string;
161
+ getPopupContainerId: string;
162
+ arrow: boolean | string;
163
+ };
164
+ 'r-preview': any & {
165
+ src: string;
166
+ closeable: boolean | string;
167
+ };
168
+ 'r-progress': any & {
169
+ percent: number | string;
170
+ total: number | string;
171
+ type: string;
172
+ animation: string;
173
+ dot: boolean | string;
174
+ };
175
+ 'r-radar': any & {
176
+ abilitys: string;
177
+ colorPolygon?: string;
178
+ colorLine?: string;
179
+ fillColor?: string;
180
+ strokeColor?: string;
181
+ };
182
+ 'r-select': any & {
183
+ value: string;
184
+ defaultValue?: string;
185
+ showSearch?: boolean | string;
186
+ type?: string;
187
+ placement?: string;
188
+ sheet?: string;
189
+ getPopupContainerId?: string;
190
+ dropdownclass?: string;
191
+ trigger?: string;
192
+ trigger?: string;
193
+ disabled?: boolean | string;
194
+ };
195
+ 'r-skeleton': any;
196
+ 'r-tab': any & {
197
+ label: string;
198
+ icon: string;
199
+ iconSize: string;
200
+ key: string;
201
+ disabled: boolean | string;
202
+ effect: boolean | string;
203
+ };
204
+ 'r-tabs': any & {
205
+ align: string;
206
+ type: string;
207
+ active: string;
208
+ effect: string;
209
+ };
210
+ }
211
+ }
@@ -1,3 +0,0 @@
1
- export declare const TIME_OUT = 1000;
2
- export declare const PORT = 5173;
3
- export declare const DEV_SERVER = "http://localhost:5173/";
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,35 +0,0 @@
1
- /// <reference types="node" />
2
- export declare class Button extends HTMLElement {
3
- _btn: HTMLDivElement;
4
- _btnContent: HTMLDivElement;
5
- _iconElement?: HTMLElement;
6
- _slot: HTMLSlotElement;
7
- _shadowDom: ShadowRoot;
8
- debounceTimeId?: NodeJS.Timeout;
9
- static get observedAttributes(): string[];
10
- constructor();
11
- get sheet(): string;
12
- set sheet(value: string);
13
- get disabled(): boolean | string;
14
- set disabled(value: boolean | string | undefined | null);
15
- get iconSize(): string;
16
- set iconSize(value: string | undefined | null);
17
- get icon(): string;
18
- set icon(value: string | null);
19
- get effect(): string;
20
- set effect(value: string | null);
21
- /**
22
- * @description: 设置button的icon
23
- * @return {*}
24
- */
25
- setIcon: () => void;
26
- mousedown: (event: MouseEvent) => void;
27
- mouseup: (event: MouseEvent) => void;
28
- debounceMouseEvent: () => void;
29
- handlerExternalCss: () => void;
30
- connectedCallback(): void;
31
- disconnectCallback(): void;
32
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
33
- }
34
- declare const _default: import('../../utils/index').CustomErrorType;
35
- export default _default;