xframelib 0.7.8 → 0.7.9
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.md +2 -2
- package/dist/controls/layoutcontainer/LayoutManager.d.ts +1 -1
- package/dist/core/IModel.d.ts +4 -0
- package/dist/core/SysEvents.d.ts +8 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +5 -5
- package/dist/utils/H5Tool.d.ts +150 -0
- package/package.json +1 -1
package/dist/utils/H5Tool.d.ts
CHANGED
|
@@ -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
|
}
|