xframelib 0.7.8 → 0.8.0

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.
@@ -155,4 +155,154 @@ export default class H5Tool {
155
155
  * @param evtHandler 事件额外的处理函数
156
156
  */
157
157
  static dispatchElementEvent(element: HTMLElement | string, evtName?: string, evtHandler?: Function): void;
158
+ /**
159
+ * 生成范围随机数
160
+ * @Min 最小值
161
+ * @Max 最大值(包括)
162
+ */
163
+ static getRandomNum(Min: any, Max: any): number;
164
+ /**
165
+ * 对象融合
166
+ * @param dest 目标对象
167
+ * @param sources 要合并进去的来源对象
168
+ * @returns 目标对象dest
169
+ */
170
+ static merge(dest?: any, sources?: any): any;
171
+ /**
172
+ * @function setOptions(obj: Object, options: Object): Object
173
+ * Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`.
174
+ * @param {*} obj
175
+ * @param {*} options
176
+ */
177
+ static setOptions(obj: any, options: any): any;
178
+ /**
179
+ * 格式化小数位数
180
+ * @param num
181
+ * @param digits
182
+ * @returns {number}
183
+ */
184
+ static formatNum(num: any, digits: any): number;
185
+ /**
186
+ * 去除空格
187
+ * @param {*} str
188
+ */
189
+ static trim(str: any): any;
190
+ /**
191
+ * 去掉空白,按空格进行分割字符串
192
+ * @param {*} str
193
+ */
194
+ static splitWords(str: string): any;
195
+ /**
196
+ * Data URI string containing a base64-encoded empty GIF image.
197
+ * Used as a hack to free memory from unused images on WebKit-powered
198
+ * mobile devices (by setting image `src` to this string).
199
+ * @returns {string}
200
+ */
201
+ static emptyImageUrl(): string;
202
+ /**
203
+ * Creates a debounced function that delays invoking `fn` until after `delay`
204
+ * @param fn
205
+ * @param delay
206
+ * @returns {function(): void}
207
+ */
208
+ static debounce(fn: any, delay: any): () => void;
209
+ /**
210
+ * Creates a throttled function that only invokes `fn` at most once per
211
+ * @param fn
212
+ * @param delay
213
+ * @returns {function(): void}
214
+ */
215
+ static throttle(fn: any, delay: any): () => false | undefined;
216
+ /**
217
+ *
218
+ * @param dataUrl
219
+ * @returns {Blob}
220
+ */
221
+ static dataURLtoBlob(dataUrl: string): Blob | undefined;
222
+ /**
223
+ * Returns an element given its DOM id, or returns the element itself
224
+ * if it was passed directly.
225
+ * @param id
226
+ * @returns {HTMLElement|*}
227
+ */
228
+ static getElement(id: string | HTMLElement): HTMLElement | null;
229
+ /**
230
+ * Returns the value for a certain style attribute on an element,
231
+ * including computed values or values set through CSS.
232
+ * @param el
233
+ * @param style
234
+ * @returns {null|*}
235
+ */
236
+ static getStyle(el: HTMLElement, style: string): CSSStyleDeclaration;
237
+ /**
238
+ * Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.
239
+ * @param tagName
240
+ * @param className
241
+ * @param container
242
+ */
243
+ static create(tagName: string, className: string, container?: HTMLElement): HTMLElement;
244
+ /**
245
+ * Removes `el` from its parent element
246
+ * @param {*} el
247
+ */
248
+ static removeElement(el: HTMLElement | any): void;
249
+ /**
250
+ * Removes all of `el`'s children elements from `el`
251
+ * @param {*} el
252
+ */
253
+ static emptyElement(el: HTMLElement | any): void;
254
+ /**
255
+ * Returns `true` if the element's class attribute contains `name`.
256
+ * @param {*} el
257
+ * @param {*} name
258
+ */
259
+ static hasClass(el: HTMLElement | any, name: string): boolean;
260
+ /**
261
+ * @function Adds `name` to the element's class attribute.
262
+ * @param {*} el
263
+ * @param {*} name
264
+ */
265
+ static addClass(el: HTMLElement | any, name: string): void;
266
+ /**
267
+ * @function Removes `name` from the element's class attribute.
268
+ * @param {*} el
269
+ * @param {*} name
270
+ */
271
+ static removeClass(el: HTMLElement | any, name: string): void;
272
+ /**
273
+ * Sets the element's class.
274
+ * @param {*} el
275
+ * @param {*} name
276
+ */
277
+ static setClass(el: HTMLElement | any, name: string): void;
278
+ /**
279
+ * @function Returns the element's class.
280
+ * @param {*} el
281
+ */
282
+ static getClass(el: HTMLElement | any): any;
283
+ /**
284
+ * Creates svg
285
+ * @param width
286
+ * @param height
287
+ * @param path
288
+ * @param container
289
+ * @returns {SVGElement}
290
+ */
291
+ static createSvgElement(width: any, height: any, path: any, container: any): SVGElement;
292
+ /**
293
+ * Parses string to Dom
294
+ * @param domStr
295
+ * @param withWrapper
296
+ * @param className
297
+ * @returns {HTMLDivElement|NodeListOf<ChildNode>}
298
+ */
299
+ static parseDom(domStr: string, withWrapper?: boolean, className?: string): NodeListOf<ChildNode> | HTMLDivElement;
300
+ /**
301
+ * Creates video
302
+ * @param url
303
+ * @param className
304
+ * @param container
305
+ * @returns {HTMLElement}
306
+ */
307
+ static createVideoHTML(url: string, className: string, container?: HTMLElement): HTMLElement;
158
308
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xframelib",
3
- "version": "0.7.8",
3
+ "version": "0.8.0",
4
4
  "description": "积累的前端开发基础库",
5
5
  "main": "dist/index.js",
6
6
  "common": "dist/index.cjs",
@@ -28,10 +28,10 @@
28
28
  "@hprose/rpc-html5": "^3.0.10",
29
29
  "@iconify/vue": "^4.1.2",
30
30
  "@microsoft/signalr": "^8.0.7",
31
- "axios": "^1.7.2",
31
+ "axios": "^1.7.7",
32
32
  "localforage": "^1.10.0",
33
33
  "loglevel": "^1.9.1",
34
- "qs": "^6.12.3",
34
+ "qs": "^6.13.0",
35
35
  "spark-md5": "^3.0.2",
36
36
  "streamsaver": "^2.0.6",
37
37
  "xhr": "^2.6.0"
@@ -43,21 +43,21 @@
43
43
  "@rollup/plugin-node-resolve": "^15.2.3",
44
44
  "@rollup/plugin-typescript": "^11.1.6",
45
45
  "@types/streamsaver": "^2.0.4",
46
- "@vitejs/plugin-vue": "^5.0.5",
47
- "@vue/compiler-sfc": "^3.4.31",
48
- "esbuild": "^0.23.0",
49
- "rimraf": "^5.0.9",
46
+ "@vitejs/plugin-vue": "^5.1.3",
47
+ "@vue/compiler-sfc": "^3.4.38",
48
+ "esbuild": "^0.23.1",
49
+ "rimraf": "^5.0.10",
50
50
  "rollup-plugin-copy": "^3.5.0",
51
51
  "rollup-plugin-esbuild": "^6.1.1",
52
52
  "rollup-plugin-scss": "^4.0.0",
53
53
  "rollup-plugin-terser": "^7.0.2",
54
54
  "rollup-plugin-typescript2": "^0.36.0",
55
55
  "rollup-plugin-vue": "^6.0.0",
56
- "sass": "^1.77.7",
57
- "typescript": "^5.5.3",
58
- "vite": "^5.3.3",
59
- "vue": "^3.4.31",
60
- "vue-router": "^4.4.0",
61
- "vue-tsc": "^2.0.26"
56
+ "sass": "^1.77.8",
57
+ "typescript": "^5.5.4",
58
+ "vite": "^5.4.2",
59
+ "vue": "^3.4.38",
60
+ "vue-router": "^4.4.3",
61
+ "vue-tsc": "^2.1.4"
62
62
  }
63
63
  }