@ldmjs/ui 1.0.15 → 1.0.16
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/dist/index.d.ts +34 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,46 @@ import { IToasted } from './types/toasted';
|
|
|
4
4
|
import { IInput, IWatcher } from './types/validation';
|
|
5
5
|
import { Dialog } from './types/dialogs';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* awaiting any event
|
|
9
|
+
* use:
|
|
10
|
+
* async function() {
|
|
11
|
+
* let a = 0;
|
|
12
|
+
* setTimeout(() => {
|
|
13
|
+
* a = 1;
|
|
14
|
+
* }, 3000)
|
|
15
|
+
* await awaiting(() => a === 1);
|
|
16
|
+
* console.log(a) // 1;
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
7
19
|
declare function awaiting(callback: () => unknown): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* a = null (undefined, '', NaN) => isDefined(a) // false
|
|
22
|
+
*/
|
|
8
23
|
declare function isDefined(value: unknown): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* generate an unique id by a format: 'a-z', 'A-Z', '0-9', 'a-zA-Z', 'a-z0-9', all)
|
|
26
|
+
*/
|
|
9
27
|
declare function uidGen(len?: number, format?: string): string | number;
|
|
28
|
+
/**
|
|
29
|
+
* async function() {
|
|
30
|
+
* await delay(1000);
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
10
33
|
declare function delay(timeout: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* returns a deep object given a string
|
|
36
|
+
* use:
|
|
37
|
+
* Record.Key1.Key2.Key3 = Value;
|
|
38
|
+
* const value = deepValueGetter(Record, 'Key1.Key2.Key3');
|
|
39
|
+
*/
|
|
11
40
|
declare function deepValueGetter(obj: Record<string, unknown>, path: string): unknown;
|
|
41
|
+
/**
|
|
42
|
+
* const obj = {};
|
|
43
|
+
* isObjectEmpty(obj) // true
|
|
44
|
+
*/
|
|
12
45
|
declare function isObjectEmpty(obj: Record<string, unknown>): boolean;
|
|
46
|
+
|
|
13
47
|
declare module '@vue/runtime-core' {
|
|
14
48
|
export interface ComponentCustomProperties {
|
|
15
49
|
$utils: {
|
package/dist/index.js
CHANGED
|
@@ -396,7 +396,11 @@ let IconButtonComponent = class IconButtonComponent extends external_vue_class_c
|
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
get array() {
|
|
399
|
-
|
|
399
|
+
const found = this.map.icons.find((el) => el[0] === this.current);
|
|
400
|
+
if (found) {
|
|
401
|
+
return found;
|
|
402
|
+
}
|
|
403
|
+
return [this.current, this.current];
|
|
400
404
|
}
|
|
401
405
|
get className() {
|
|
402
406
|
if (this.color) {
|