@ldmjs/ui 1.0.15 → 1.0.17
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 +11 -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) {
|
|
@@ -16222,6 +16226,9 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
|
|
|
16222
16226
|
if (resultSave) {
|
|
16223
16227
|
this.modalResult = resultSave;
|
|
16224
16228
|
}
|
|
16229
|
+
else {
|
|
16230
|
+
return;
|
|
16231
|
+
}
|
|
16225
16232
|
}
|
|
16226
16233
|
catch (e) {
|
|
16227
16234
|
/* eslint-disable no-console */
|
|
@@ -16233,6 +16240,9 @@ let DialogComponent = class DialogComponent extends (0,external_vue_class_compon
|
|
|
16233
16240
|
}
|
|
16234
16241
|
else {
|
|
16235
16242
|
modal.okLoading = false;
|
|
16243
|
+
if (!resultSave) {
|
|
16244
|
+
return;
|
|
16245
|
+
}
|
|
16236
16246
|
this.modalResult = resultSave;
|
|
16237
16247
|
}
|
|
16238
16248
|
}
|