ranui 0.1.9 → 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.
Files changed (199) hide show
  1. package/README.zh-CN.md +192 -0
  2. package/dist/assets/image/failImage.d.ts +2 -0
  3. package/dist/button.js +7 -0
  4. package/dist/checkbox.js +7 -0
  5. package/dist/colorpicker.js +11 -0
  6. package/dist/components/button/index.d.ts +8 -5
  7. package/dist/components/checkbox/index.d.ts +30 -0
  8. package/dist/components/colorpicker/index.d.ts +120 -0
  9. package/dist/components/dropdown/index.d.ts +34 -0
  10. package/dist/components/input/index.d.ts +66 -41
  11. package/dist/components/loading/index.d.ts +76 -0
  12. package/dist/components/math/index.d.ts +16 -0
  13. package/dist/components/message/index.d.ts +10 -7
  14. package/dist/components/player/index.d.ts +46 -9
  15. package/dist/components/popover/content/index.d.ts +16 -0
  16. package/dist/components/popover/index.d.ts +91 -0
  17. package/dist/components/preview/constant.d.ts +5 -0
  18. package/dist/components/preview/index.d.ts +1 -4
  19. package/dist/components/preview/pdf.d.ts +51 -1
  20. package/dist/components/preview/types.d.ts +11 -0
  21. package/dist/components/progress/index.d.ts +12 -7
  22. package/dist/components/radar/index.d.ts +1 -1
  23. package/dist/components/scratch/index.d.ts +7 -5
  24. package/dist/components/select/dropdown-item/index.d.ts +23 -0
  25. package/dist/components/select/index.d.ts +22 -13
  26. package/dist/components/select/option/index.d.ts +2 -0
  27. package/dist/components/tab/index.d.ts +80 -64
  28. package/dist/components/tabpane/index.d.ts +73 -57
  29. package/dist/icon.js +6 -0
  30. package/dist/iconShadowless.js +6 -0
  31. package/dist/image.js +4 -0
  32. package/dist/{index-01b17e26.js → index-BEm1a2pr.js} +3 -6
  33. package/dist/{index-e2e5d725.js → index-BSyn-jmY.js} +4734 -2976
  34. package/dist/index-BVD0qcjJ.js +656 -0
  35. package/dist/{index-e03d23e7.js → index-Bb55l8nf.js} +2 -11
  36. package/dist/{index-0d5b9435.js → index-BbW0dxzy.js} +12 -16
  37. package/dist/index-BgUpm4LA.js +103 -0
  38. package/dist/{index-458debf7.js → index-C841uRgZ.js} +16 -51
  39. package/dist/{index-4443363f.js → index-CUZna268.js} +41 -69
  40. package/dist/index-CiA5qRK3.js +381 -0
  41. package/dist/index-CoJMn8Jm.js +511 -0
  42. package/dist/{index-b7790662.js → index-DAxs7Dd2.js} +6 -13
  43. package/dist/index-D_cD4u43.js +70 -0
  44. package/dist/index-DgVgxN1s.js +309 -0
  45. package/dist/index-DghvN1MU.js +710 -0
  46. package/dist/index-DvSe_Ms7.js +494 -0
  47. package/dist/{index-7216d6b0.js → index-W52VzrXL.js} +20 -49
  48. package/dist/index-gBy2cXLV.js +140 -0
  49. package/dist/index-hdtEL8P_.js +101 -0
  50. package/dist/{index-1048a998.js → index-jVKJoKXA.js} +105 -62
  51. package/dist/{index-2d16a084.js → index-ltt3w4zP.js} +13 -23
  52. package/dist/index-n4X6wdwJ.js +156 -0
  53. package/dist/{index-3cf72afd.js → index-s0ioL3L2.js} +23 -45
  54. package/dist/index.d.ts +276 -14
  55. package/dist/index.js +24 -24
  56. package/dist/input.js +7 -0
  57. package/dist/inputShadowless.js +6 -0
  58. package/dist/katex-es-CGqSCDjs.js +14634 -0
  59. package/dist/loading-scene-BMc2wqKm.js +4 -0
  60. package/dist/loading.js +8 -0
  61. package/dist/math.js +7 -0
  62. package/dist/message.js +6 -0
  63. package/dist/modal.js +4 -0
  64. package/dist/more-2vsTDpcc.js +31 -0
  65. package/dist/pdf-Bis_tkvj.js +134 -0
  66. package/dist/player.js +8 -0
  67. package/dist/plus-DgJxWGlo.js +56799 -0
  68. package/dist/popover.js +9 -0
  69. package/dist/preview.js +7 -0
  70. package/dist/progress.js +7 -0
  71. package/dist/radar.js +6 -0
  72. package/dist/ranui.css +1 -0
  73. package/dist/search-BWdfjyP8.js +4 -0
  74. package/dist/select.js +10 -0
  75. package/dist/{index-1b73beee.js → selectShadowless.js} +159 -167
  76. package/dist/{umd/components → shadowless}/icon/index.d.ts +1 -0
  77. package/dist/{umd/components → shadowless}/input/index.d.ts +66 -41
  78. package/dist/{umd/components → shadowless}/select/index.d.ts +19 -16
  79. package/dist/shadowless/select/option/index.d.ts +2 -0
  80. package/dist/shadowless.d.ts +3 -0
  81. package/dist/shadowless.js +8 -0
  82. package/dist/skeleton.js +4 -0
  83. package/dist/sort-DWqiUONr.js +4 -0
  84. package/dist/sprite-CH2zLtZy.js +141 -0
  85. package/dist/tab.js +6 -0
  86. package/dist/tabpane.js +4 -0
  87. package/dist/tsconfig.json +31 -0
  88. package/dist/typings.d.ts +257 -0
  89. package/dist/umd/index.css +1 -0
  90. package/dist/umd/index.umd.cjs +1 -71
  91. package/dist/umd/shadowless/shadowless.css +1 -0
  92. package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
  93. package/dist/utils/color.d.ts +52 -0
  94. package/dist/utils/image.d.ts +8 -1
  95. package/dist/utils/index.d.ts +20 -5
  96. package/dist/utils/math.d.ts +3 -3
  97. package/dist/vite.config.d.ts +1 -0
  98. package/dist/without-content-CdJw7vHM.js +4 -0
  99. package/package.json +115 -64
  100. package/readme.md +41 -57
  101. package/typings.d.ts +257 -0
  102. package/dist/colz-746223ab.js +0 -241
  103. package/dist/components/button/index.js +0 -8
  104. package/dist/components/icon/index.js +0 -6
  105. package/dist/components/image/index.js +0 -4
  106. package/dist/components/input/index.js +0 -6
  107. package/dist/components/message/index.js +0 -4
  108. package/dist/components/modal/index.js +0 -4
  109. package/dist/components/option/index.d.ts +0 -2
  110. package/dist/components/option/index.js +0 -95
  111. package/dist/components/player/index.js +0 -12
  112. package/dist/components/preview/colz.d.ts +0 -72
  113. package/dist/components/preview/docx.d.ts +0 -8
  114. package/dist/components/preview/excel/excel.d.ts +0 -2
  115. package/dist/components/preview/excel/index.d.ts +0 -1
  116. package/dist/components/preview/excel/media.d.ts +0 -37
  117. package/dist/components/preview/index.js +0 -8
  118. package/dist/components/preview/pptx/index.d.ts +0 -16
  119. package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
  120. package/dist/components/preview/pptx/t_xml.d.ts +0 -1
  121. package/dist/components/preview/pptx/worker.d.ts +0 -1
  122. package/dist/components/progress/index.js +0 -8
  123. package/dist/components/radar/index.js +0 -7
  124. package/dist/components/select/index.js +0 -11
  125. package/dist/components/skeleton/index.js +0 -4
  126. package/dist/components/tab/index.js +0 -7
  127. package/dist/components/tabpane/index.js +0 -4
  128. package/dist/docx-c5d02d8c.js +0 -21
  129. package/dist/index-57492b9b.js +0 -48
  130. package/dist/index-73ce455b.js +0 -264
  131. package/dist/index-7913ec46.js +0 -239
  132. package/dist/index-7b8840f9.js +0 -18690
  133. package/dist/index-c14450a9.js +0 -662
  134. package/dist/pdf-bdb7818a.js +0 -113
  135. package/dist/style.css +0 -1
  136. package/dist/umd/build/config.d.ts +0 -3
  137. package/dist/umd/build/config.umd.d.ts +0 -2
  138. package/dist/umd/components/button/index.d.ts +0 -35
  139. package/dist/umd/components/form/index.d.ts +0 -2
  140. package/dist/umd/components/image/index.d.ts +0 -2
  141. package/dist/umd/components/message/index.d.ts +0 -14
  142. package/dist/umd/components/modal/index.d.ts +0 -2
  143. package/dist/umd/components/option/index.d.ts +0 -2
  144. package/dist/umd/components/player/index.d.ts +0 -213
  145. package/dist/umd/components/preview/colz.d.ts +0 -72
  146. package/dist/umd/components/preview/docx.d.ts +0 -8
  147. package/dist/umd/components/preview/excel/excel.d.ts +0 -2
  148. package/dist/umd/components/preview/excel/index.d.ts +0 -1
  149. package/dist/umd/components/preview/excel/media.d.ts +0 -37
  150. package/dist/umd/components/preview/index.d.ts +0 -6
  151. package/dist/umd/components/preview/pdf.d.ts +0 -1
  152. package/dist/umd/components/preview/pptx/index.d.ts +0 -16
  153. package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
  154. package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
  155. package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
  156. package/dist/umd/components/progress/index.d.ts +0 -36
  157. package/dist/umd/components/radar/index.d.ts +0 -2
  158. package/dist/umd/components/scratch/index.d.ts +0 -19
  159. package/dist/umd/components/skeleton/index.d.ts +0 -2
  160. package/dist/umd/components/tab/index.d.ts +0 -408
  161. package/dist/umd/components/tabpane/index.d.ts +0 -352
  162. package/dist/umd/index.d.ts +0 -14
  163. package/dist/umd/playwright.config.d.ts +0 -9
  164. package/dist/umd/plugins/auto-import-file.d.ts +0 -0
  165. package/dist/umd/plugins/load-style.d.ts +0 -6
  166. package/dist/umd/plugins/load-svg.d.ts +0 -9
  167. package/dist/umd/style.css +0 -1
  168. package/dist/umd/tests/button.spec.d.ts +0 -1
  169. package/dist/umd/utils/image.d.ts +0 -32
  170. package/dist/umd/utils/index.d.ts +0 -64
  171. package/dist/umd/utils/math.d.ts +0 -26
  172. package/dist/umd/utils/tween.d.ts +0 -21
  173. package/dist/umd/vite.config.d.ts +0 -6
  174. package/dist/vendor-f71e6f68.js +0 -92126
  175. /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
  176. /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
  177. /package/dist/{umd/build/config.es.d.ts → build/config.sha.d.ts} +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/{info-circle-fill-90ec9aa9.js → info-circle-fill-DjI8gXS3.js} +0 -0
  189. /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
  190. /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
  191. /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
  192. /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
  193. /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
  194. /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
  195. /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
  196. /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
  197. /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
  198. /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
  199. /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
package/typings.d.ts ADDED
@@ -0,0 +1,257 @@
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
+
19
+ type Hint = (options: Prompt | string | undefined | null) => void;
20
+
21
+ interface Message {
22
+ info: Hint;
23
+ success: Hint;
24
+ error: Hint;
25
+ warning: Hint;
26
+ toast: Hint;
27
+ }
28
+ }
29
+
30
+ interface Ranui {
31
+ message: Partial<Ran.Message>;
32
+ }
33
+
34
+ interface HlsPlayer {
35
+ off: (s: string, f: Function) => void;
36
+ on: (s: string, f: Function) => void;
37
+ loadSource: (s: string) => void;
38
+ attachMedia: (v: HTMLVideoElement) => void;
39
+ destroy: () => void;
40
+ startLoad(): () => void;
41
+ }
42
+
43
+ interface Hls {
44
+ Events: {
45
+ MANIFEST_LOADED: 'hlsManifestLoaded';
46
+ ERROR: 'error';
47
+ };
48
+ isSupported: () => boolean;
49
+ }
50
+
51
+ type HLS = Hls & (new () => HlsPlayer);
52
+
53
+ interface Viewport {
54
+ width: number;
55
+ height: number;
56
+ viewBox: Array<number>;
57
+ }
58
+ interface RenderContext {
59
+ canvasContext: CanvasRenderingContext2D | null;
60
+ transform: Array<number>;
61
+ viewport: Viewport;
62
+ }
63
+
64
+ interface PDFPageProxy {
65
+ pageNumber: number;
66
+ getViewport: () => Viewport;
67
+ render: (options: RenderContext) => void;
68
+ }
69
+
70
+ interface PDFDocumentProxy {
71
+ numPages: number;
72
+ getPage: (x: number) => Promise<PDFPageProxy>;
73
+ }
74
+
75
+ interface HTMLElement {
76
+ mozRequestFullScreen: (options?: FullscreenOptions) => Promise<void>;
77
+ msRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
78
+ oRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
79
+ webkitRequestFullscreen: (options?: FullscreenOptions) => Promise<void>;
80
+ webkitEnterFullscreen: (options?: FullscreenOptions) => Promise<void>;
81
+ }
82
+ declare interface Document {
83
+ msExitFullscreen: () => Promise<void>;
84
+ mozCancelFullScreen: () => Promise<void>;
85
+ oCancelFullScreen: () => Promise<void>;
86
+ webkitExitFullscreen: () => Promise<void>;
87
+ }
88
+
89
+ interface MathJax {
90
+ texReset: () => void;
91
+ getMetricsFor: (x: HTMLElement) => object;
92
+ tex2chtmlPromise: (x: string, y: object) => Promise<Element>;
93
+ }
94
+
95
+ declare global {
96
+ interface Window {
97
+ ranui: Partial<Ranui>;
98
+ message: Partial<Ran.Message>;
99
+ MathJax: MathJax;
100
+ katex: {
101
+ render: (x: string, y: HTMLElement, z: object) => void;
102
+ };
103
+ pdfjsLib: {
104
+ GlobalWorkerOptions: {
105
+ workerSrc: string;
106
+ };
107
+ getDocument: (x: string | ArrayBuffer) => {
108
+ promise: Promise<PDFDocumentProxy>;
109
+ };
110
+ };
111
+ }
112
+ }
113
+
114
+ enum ICON_NAME_AMP {
115
+ DOUBLE_BOUNCE = 'double-bounce',
116
+ ROTATE = 'rotate',
117
+ STRETCH = 'stretch',
118
+ CUBE = 'cube',
119
+ DOT = 'dot',
120
+ TRIPLE_BOUNCE = 'triple-bounce',
121
+ SCALE_OUT = 'scale-out',
122
+ CIRCLE = 'circle',
123
+ CIRCLE_LINE = 'circle-line',
124
+ SQUARE = 'square',
125
+ PULSE = 'pulse',
126
+ SOLAR = 'solar',
127
+ CUBE_FOLD = 'cube-fold',
128
+ CIRCLE_FOLD = 'circle-fold',
129
+ CUBE_GRID = 'cube-grid',
130
+ CIRCLE_TURN = 'circle-turn',
131
+ CIRCLE_ROTATE = 'circle-rotate',
132
+ CIRCLE_SPIN = 'circle-spin',
133
+ DOT_BAR = 'dot-bar',
134
+ DOT_CIRCLE = 'dot-circle',
135
+ LINE = 'line',
136
+ DOT_PULSE = 'dot-pulse',
137
+ LINE_SCALE = 'line-scale',
138
+ TEXT = 'text',
139
+ CUBE_DIM = 'cube-dim',
140
+ DOT_LINE = 'dot-line',
141
+ ARC = 'arc',
142
+ DROP = 'drop',
143
+ PACMAN = 'pacman',
144
+ }
145
+ interface BaseIntrinsicElements {
146
+ 'r-loading': any & {
147
+ name: ICON_NAME_AMP;
148
+ };
149
+ 'r-math': any & {
150
+ latex: string;
151
+ };
152
+ 'r-button': any & {
153
+ sheet: string;
154
+ disabled: boolean | string;
155
+ iconSize: string;
156
+ icon: string;
157
+ effect: boolean | string;
158
+ };
159
+ 'r-checkbox': any & {
160
+ disabled: boolean | string;
161
+ checked: boolean | string;
162
+ };
163
+ 'r-img': any & {
164
+ fallback: string;
165
+ src: string;
166
+ };
167
+ 'r-input': any & {
168
+ value: string;
169
+ placeholder: string;
170
+ label: string;
171
+ status: string;
172
+ name: string;
173
+ icon: string;
174
+ prefix: string;
175
+ suffix: string;
176
+ type: string;
177
+ required: boolean | string;
178
+ disabled: boolean | string;
179
+ min: number | string;
180
+ max: number | string;
181
+ step: number | string;
182
+ };
183
+ 'r-player': any & {
184
+ src: string;
185
+ debug: boolean | string;
186
+ volume: number | string;
187
+ currentTime: number | string;
188
+ playbackRate: number | string;
189
+ };
190
+ 'r-popover': any & {
191
+ placement: string;
192
+ trigger: string;
193
+ getPopupContainerId: string;
194
+ arrow: boolean | string;
195
+ closePopover: () => void;
196
+ };
197
+ 'r-content': any;
198
+ 'r-preview': any & {
199
+ src: string;
200
+ closeable: boolean | string;
201
+ };
202
+ 'r-progress': any & {
203
+ percent: number | string;
204
+ total: number | string;
205
+ type: string;
206
+ animation: string;
207
+ dot: boolean | string;
208
+ };
209
+ 'r-radar': any & {
210
+ abilitys: string;
211
+ colorPolygon?: string;
212
+ colorLine?: string;
213
+ fillColor?: string;
214
+ strokeColor?: string;
215
+ };
216
+ 'r-select': any & {
217
+ value: string;
218
+ defaultValue?: string;
219
+ showSearch?: boolean | string;
220
+ type?: string;
221
+ placement?: string;
222
+ sheet?: string;
223
+ getPopupContainerId?: string;
224
+ dropdownclass?: string;
225
+ trigger?: string;
226
+ disabled?: boolean | string;
227
+ };
228
+ 'r-skeleton': any;
229
+ 'r-tab': any & {
230
+ label: string;
231
+ icon: string;
232
+ iconSize: string;
233
+ key: string;
234
+ disabled: boolean | string;
235
+ effect: boolean | string;
236
+ };
237
+ 'r-tabs': any & {
238
+ align: string;
239
+ type: string;
240
+ active: string;
241
+ effect: string;
242
+ };
243
+ 'r-icon': any & {
244
+ name?: string;
245
+ size?: string;
246
+ color?: string;
247
+ };
248
+ }
249
+ namespace JSX {
250
+ interface IntrinsicElements extends BaseIntrinsicElements {}
251
+ }
252
+
253
+ namespace React {
254
+ namespace JSX {
255
+ interface IntrinsicElements extends BaseIntrinsicElements {}
256
+ }
257
+ }
@@ -1,241 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- const round = Math.round;
8
- class Rgb {
9
- constructor(col) {
10
- __publicField(this, "r");
11
- __publicField(this, "g");
12
- __publicField(this, "b");
13
- this.r = col[0];
14
- this.g = col[1];
15
- this.b = col[2];
16
- }
17
- toString() {
18
- return `rgb(${this.r},${this.g},${this.b})`;
19
- }
20
- }
21
- class Rgba extends Rgb {
22
- constructor(col) {
23
- super(col);
24
- __publicField(this, "a");
25
- this.a = col[3];
26
- }
27
- toString() {
28
- return `rgba(${this.r},${this.g},${this.b},${this.a})`;
29
- }
30
- }
31
- class Hsl {
32
- constructor(col) {
33
- __publicField(this, "h");
34
- __publicField(this, "s");
35
- __publicField(this, "l");
36
- this.h = col[0];
37
- this.s = col[1];
38
- this.l = col[2];
39
- }
40
- toString() {
41
- return `hsl(${this.h},${this.s}%,${this.l}%)`;
42
- }
43
- }
44
- class Hsla extends Hsl {
45
- constructor(col) {
46
- super(col);
47
- __publicField(this, "a");
48
- this.a = col[3];
49
- }
50
- toString() {
51
- return `hsla(${this.h},${this.s}%,${this.l}%,${this.a})`;
52
- }
53
- }
54
- class Color {
55
- constructor(r, g = 0, b = 0, a = 1) {
56
- __publicField(this, "r");
57
- __publicField(this, "g");
58
- __publicField(this, "b");
59
- __publicField(this, "a");
60
- __publicField(this, "rgb");
61
- __publicField(this, "rgba");
62
- __publicField(this, "hex");
63
- __publicField(this, "hsl");
64
- __publicField(this, "hsla");
65
- __publicField(this, "h");
66
- __publicField(this, "s");
67
- __publicField(this, "l");
68
- if (typeof r === "string") {
69
- let str = r;
70
- if (str.charAt(0) !== "#") {
71
- str = "#" + str;
72
- }
73
- if (str.length < 7) {
74
- str = "#" + str[1] + str[1] + str[2] + str[2] + str[3] + str[3];
75
- }
76
- [r, g, b] = hexToRgb(str);
77
- } else if (r instanceof Array) {
78
- a = r[3] || a;
79
- b = r[2];
80
- g = r[1];
81
- r = r[0];
82
- }
83
- this.r = Number(r);
84
- this.g = Number(g);
85
- this.b = Number(b);
86
- this.a = a;
87
- this.rgb = new Rgb([this.r, this.g, this.b]);
88
- this.rgba = new Rgba([this.r, this.g, this.b, this.a]);
89
- this.hex = rgbToHex(this.r, this.g, this.b);
90
- this.hsl = new Hsl(rgbToHsl(this.r, this.g, this.b));
91
- this.h = this.hsl.h;
92
- this.s = this.hsl.s;
93
- this.l = this.hsl.l;
94
- this.hsla = new Hsla([this.h, this.s, this.l, this.a]);
95
- }
96
- setHue(newHue) {
97
- this.h = newHue;
98
- this.hsl.h = newHue;
99
- this.hsla.h = newHue;
100
- this.updateFromHsl();
101
- }
102
- setSat(newSat) {
103
- this.s = newSat;
104
- this.hsl.s = newSat;
105
- this.hsla.s = newSat;
106
- this.updateFromHsl();
107
- }
108
- setLum(newLum) {
109
- this.l = newLum;
110
- this.hsl.l = newLum;
111
- this.hsla.l = newLum;
112
- this.updateFromHsl();
113
- }
114
- setAlpha(newAlpha) {
115
- this.a = newAlpha;
116
- this.hsla.a = newAlpha;
117
- this.rgba.a = newAlpha;
118
- }
119
- updateFromHsl() {
120
- this.rgb = new Rgb(hslToRgb(this.h, this.s, this.l));
121
- this.r = this.rgb.r;
122
- this.g = this.rgb.g;
123
- this.b = this.rgb.b;
124
- this.rgba.r = this.rgb.r;
125
- this.rgba.g = this.rgb.g;
126
- this.rgba.b = this.rgb.b;
127
- this.hex = rgbToHex([this.r, this.g, this.b]);
128
- }
129
- }
130
- const hexToRgb = function(hex) {
131
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
132
- return result ? [
133
- parseInt(result[1], 16),
134
- parseInt(result[2], 16),
135
- parseInt(result[3], 16)
136
- ] : null;
137
- };
138
- const getDarkColor = (color, level) => {
139
- const rgbc = hexToRgb(color) || [];
140
- for (let i = 0; i < 3; i++)
141
- rgbc[i] = Math.floor(Number(rgbc[i]) * (1 - level));
142
- return rgbToHex(rgbc[0], rgbc[1], rgbc[2]);
143
- };
144
- function getLightColor(color, level) {
145
- const rgbc = hexToRgb(color) || [];
146
- for (let i = 0; i < 3; i++)
147
- rgbc[i] = Math.floor((255 - Number(rgbc[i])) * level + Number(rgbc[i]));
148
- return rgbToHex(rgbc[0], rgbc[1], rgbc[2]);
149
- }
150
- const componentToHex = function(c) {
151
- const hex = c.toString(16);
152
- return hex.length === 1 ? "0" + hex : hex;
153
- };
154
- const rgbToHex = function(r, g = 0, b = 0) {
155
- if (r instanceof Array) {
156
- b = r[2];
157
- g = r[1];
158
- r = r[0];
159
- }
160
- return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
161
- };
162
- const rgbToHsl = function(r, g = 0, b = 0) {
163
- if (r instanceof Array) {
164
- b = r[2];
165
- g = r[1];
166
- r = r[0];
167
- }
168
- let s, l, d, h = 0;
169
- r /= 255;
170
- g /= 255;
171
- b /= 255;
172
- const max = Math.max(r, g, b);
173
- const min = Math.min(r, g, b);
174
- l = (max + min) / 2;
175
- if (max === min) {
176
- h = s = 0;
177
- } else {
178
- d = max - min;
179
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
180
- switch (max) {
181
- case r:
182
- h = (g - b) / d + (g < b ? 6 : 0);
183
- break;
184
- case g:
185
- h = (b - r) / d + 2;
186
- break;
187
- case b:
188
- h = (r - g) / d + 4;
189
- break;
190
- }
191
- h /= 6;
192
- }
193
- h = round(h * 360);
194
- s = round(s * 100);
195
- l = round(l * 100);
196
- return [h, s, l];
197
- };
198
- const hue2rgb = function(p, q, t) {
199
- if (t < 0) {
200
- t += 1;
201
- }
202
- if (t > 1) {
203
- t -= 1;
204
- }
205
- if (t < 1 / 6) {
206
- return p + (q - p) * 6 * t;
207
- }
208
- if (t < 1 / 2) {
209
- return q;
210
- }
211
- if (t < 2 / 3) {
212
- return p + (q - p) * (2 / 3 - t) * 6;
213
- }
214
- return p;
215
- };
216
- const hslToRgb = function(h, s, l) {
217
- if (h instanceof Array) {
218
- l = h[2];
219
- s = h[1];
220
- h = h[0];
221
- }
222
- h = Number(h) / 360;
223
- s = Number(s) / 100;
224
- l = Number(l) / 100;
225
- let r, g, b, q, p;
226
- if (s === 0) {
227
- r = g = b = l;
228
- } else {
229
- q = l < 0.5 ? l * (1 + s) : l + s - l * s;
230
- p = 2 * l - q;
231
- r = hue2rgb(p, q, h + 1 / 3);
232
- g = hue2rgb(p, q, h);
233
- b = hue2rgb(p, q, h - 1 / 3);
234
- }
235
- return [round(r * 255), round(g * 255), round(b * 255)];
236
- };
237
- export {
238
- Color as C,
239
- getDarkColor as a,
240
- getLightColor as g
241
- };
@@ -1,8 +0,0 @@
1
- import { B, a } from "../../index-2d16a084.js";
2
- import "../../index-7913ec46.js";
3
- import "../../index-57492b9b.js";
4
- import "../../vendor-f71e6f68.js";
5
- export {
6
- B as Button,
7
- a as default
8
- };
@@ -1,6 +0,0 @@
1
- import { a } from "../../index-7216d6b0.js";
2
- import "../../index-7913ec46.js";
3
- import "../../vendor-f71e6f68.js";
4
- export {
5
- a as default
6
- };
@@ -1,4 +0,0 @@
1
- import { a } from "../../index-01b17e26.js";
2
- export {
3
- a as default
4
- };
@@ -1,6 +0,0 @@
1
- import { I, a } from "../../index-1048a998.js";
2
- import "../../index-57492b9b.js";
3
- export {
4
- I as Input,
5
- a as default
6
- };
@@ -1,4 +0,0 @@
1
- import { m } from "../../index-0d5b9435.js";
2
- export {
3
- m as default
4
- };
@@ -1,4 +0,0 @@
1
- import { a } from "../../index-8e1e2573.js";
2
- export {
3
- a as default
4
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import('../../utils/index').CustomErrorType;
2
- export default _default;
@@ -1,95 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { c as createCustomError, i as isDisabled } from "../../index-57492b9b.js";
8
- const f7170ee498e0dd32cbdcb63fba8f75cc = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}@keyframes ranui-select-dropdown-down-in{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes ranui-select-dropdown-down-out{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes ranui-select-dropdown-up-in{0%{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-select-dropdown-up-out{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}}.ran-select-dropdown-down-in{animation:ranui-select-dropdown-up-in .2s;animation-fill-mode:forwards}.ran-select-dropdown-down-out{animation:ranui-select-dropdown-up-out .2s;animation-fill-mode:forwards}.ran-select-dropdown-up-in{animation:ranui-select-dropdown-down-in .2s;animation-fill-mode:forwards}.ran-select-dropdown-up-out{animation:ranui-select-dropdown-down-out .2s;animation-fill-mode:forwards}.ranui-select-dropdown{position:absolute;transform-origin:var(--ran-x, 50%) var(--ran-y, 50%);box-sizing:border-box;margin:0;padding:4px;color:#000000e0;font-size:14px;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";z-index:1050;overflow:hidden;font-variant:initial;background:#ffffff;border-radius:8px;outline:none;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;cursor:pointer}.ranui-select-dropdown-option-item{position:relative;display:block;padding:5px 12px;color:#000000e0;font-weight:400;font-size:14px;transition:background .3s ease;border-radius:4px}.ranui-select-dropdown-option-item:hover{background-color:#0000000a}.ranui-select-dropdown-option-item-content{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#000000e0;font-size:14px;line-height:1.57142857;box-sizing:border-box;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-variant:initial}.ranui-select-dropdown-option-active{background-color:#e6f7ff;font-weight:700}.ranui-select-dropdown-option-active:hover{background-color:#e6f7ff}\n';
9
- const index$1 = "";
10
- function Custom() {
11
- if (typeof document !== "undefined" && !customElements.get("r-option")) {
12
- class Option extends HTMLElement {
13
- constructor() {
14
- super();
15
- __publicField(this, "_option");
16
- __publicField(this, "_optionContent");
17
- __publicField(this, "_shadowDom");
18
- __publicField(this, "_slot");
19
- this._slot = document.createElement("slot");
20
- this._option = document.createElement("div");
21
- this._option.setAttribute("class", "ran-option");
22
- this._optionContent = document.createElement("div");
23
- this._optionContent.setAttribute("class", "ran-option-content");
24
- this._optionContent.appendChild(this._slot);
25
- this._option.appendChild(this._optionContent);
26
- const shadowRoot = this.attachShadow({ mode: "closed" });
27
- const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
28
- F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
29
- shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
30
- this._shadowDom = shadowRoot;
31
- shadowRoot.appendChild(this._option);
32
- }
33
- static get observedAttributes() {
34
- return ["disabled", "sheet", "value"];
35
- }
36
- get value() {
37
- return this.getAttribute("value");
38
- }
39
- set value(value) {
40
- this.setAttribute("value", value || "");
41
- }
42
- get sheet() {
43
- return this.getAttribute("sheet");
44
- }
45
- set sheet(value) {
46
- this.setAttribute("sheet", value || "");
47
- }
48
- get disabled() {
49
- return isDisabled(this);
50
- }
51
- set disabled(value) {
52
- if (!value || value === "false") {
53
- this.removeAttribute("disabled");
54
- } else {
55
- this.setAttribute("disabled", "");
56
- }
57
- }
58
- handlerExternalCss() {
59
- if (this.sheet) {
60
- try {
61
- const sheet = new CSSStyleSheet();
62
- sheet.insertRule(this.sheet);
63
- this._shadowDom.adoptedStyleSheets = [sheet];
64
- } catch (error) {
65
- console.error(
66
- `Failed to parse the rule in CSSStyleSheet: ${this.sheet}`
67
- );
68
- }
69
- }
70
- }
71
- connectedCallback() {
72
- }
73
- disconnectCallback() {
74
- }
75
- attributeChangedCallback(name, oldValue, newValue) {
76
- if (name === "disabled" && this._option) {
77
- if (!newValue || newValue === "false") {
78
- this._option.setAttribute("disabled", "");
79
- } else {
80
- this._option.removeAttribute("disabled");
81
- }
82
- }
83
- if (name === "sheet" && this._shadowDom && oldValue !== newValue)
84
- this.handlerExternalCss();
85
- }
86
- }
87
- return Option;
88
- } else {
89
- return createCustomError("document is undefined or r-option is exist");
90
- }
91
- }
92
- const index = Custom();
93
- export {
94
- index as default
95
- };
@@ -1,12 +0,0 @@
1
- import "../../index-7913ec46.js";
2
- import { R, a } from "../../index-e2e5d725.js";
3
- import "../../index-1b73beee.js";
4
- import "../../vendor-f71e6f68.js";
5
- import "../../index-57492b9b.js";
6
- import "../option/index.js";
7
- import "../../index-7216d6b0.js";
8
- import "../../index-1048a998.js";
9
- export {
10
- R as RanPlayer,
11
- a as default
12
- };