lkt-vue-kernel 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 +7 -7
- package/dist/index.js +45 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ type ValidModalName = string | Function | undefined;
|
|
|
38
38
|
|
|
39
39
|
type EmptyModalKey = '_';
|
|
40
40
|
|
|
41
|
-
type ValidModalKey = string | Function | EmptyModalKey;
|
|
41
|
+
type ValidModalKey = string | number | Function | EmptyModalKey;
|
|
42
42
|
|
|
43
43
|
type BeforeCloseModalData = {
|
|
44
44
|
modalName: ValidModalKey;
|
|
@@ -202,17 +202,17 @@ declare class LktSettings {
|
|
|
202
202
|
static debugEnabled: boolean;
|
|
203
203
|
static debugMode(enabled?: boolean): typeof LktSettings;
|
|
204
204
|
static defaultConfirmButton: Partial<ButtonConfig>;
|
|
205
|
-
static setDefaultConfirmButton(button: Partial<ButtonConfig
|
|
205
|
+
static setDefaultConfirmButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
206
206
|
static defaultCancelButton: Partial<ButtonConfig>;
|
|
207
|
-
static setDefaultCancelButton(button: Partial<ButtonConfig
|
|
207
|
+
static setDefaultCancelButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
208
208
|
static defaultCreateButton: Partial<ButtonConfig>;
|
|
209
|
-
static setDefaultCreateButton(button: Partial<ButtonConfig
|
|
209
|
+
static setDefaultCreateButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
210
210
|
static defaultUpdateButton: Partial<ButtonConfig>;
|
|
211
|
-
static setDefaultUpdateButton(button: Partial<ButtonConfig
|
|
211
|
+
static setDefaultUpdateButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
212
212
|
static defaultDropButton: Partial<ButtonConfig>;
|
|
213
|
-
static setDefaultDropButton(button: Partial<ButtonConfig
|
|
213
|
+
static setDefaultDropButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
214
214
|
static defaultEditModeButton: Partial<ButtonConfig>;
|
|
215
|
-
static setDefaultEditModeButton(button: Partial<ButtonConfig
|
|
215
|
+
static setDefaultEditModeButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
declare enum FieldType {
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,15 @@ var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
|
16
16
|
return ButtonType2;
|
|
17
17
|
})(ButtonType || {});
|
|
18
18
|
|
|
19
|
+
// src/functions/ensure-data-functions.ts
|
|
20
|
+
var ensureButtonConfig = (buttonConfig, settingsConfig) => {
|
|
21
|
+
if (typeof buttonConfig === "undefined") return settingsConfig;
|
|
22
|
+
return {
|
|
23
|
+
...settingsConfig,
|
|
24
|
+
...buttonConfig
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
19
28
|
// src/settings/LktSettings.ts
|
|
20
29
|
var LktSettings = class _LktSettings {
|
|
21
30
|
static debugEnabled = false;
|
|
@@ -26,44 +35,68 @@ var LktSettings = class _LktSettings {
|
|
|
26
35
|
static defaultConfirmButton = {
|
|
27
36
|
text: "Confirm"
|
|
28
37
|
};
|
|
29
|
-
static setDefaultConfirmButton(button) {
|
|
30
|
-
|
|
38
|
+
static setDefaultConfirmButton(button, override = true) {
|
|
39
|
+
if (override) {
|
|
40
|
+
_LktSettings.defaultConfirmButton = button;
|
|
41
|
+
} else {
|
|
42
|
+
_LktSettings.defaultConfirmButton = ensureButtonConfig(button, _LktSettings.defaultConfirmButton);
|
|
43
|
+
}
|
|
31
44
|
return _LktSettings;
|
|
32
45
|
}
|
|
33
46
|
static defaultCancelButton = {
|
|
34
47
|
text: "Cancel"
|
|
35
48
|
};
|
|
36
|
-
static setDefaultCancelButton(button) {
|
|
37
|
-
|
|
49
|
+
static setDefaultCancelButton(button, override = true) {
|
|
50
|
+
if (override) {
|
|
51
|
+
_LktSettings.defaultCancelButton = button;
|
|
52
|
+
} else {
|
|
53
|
+
_LktSettings.defaultCancelButton = ensureButtonConfig(button, _LktSettings.defaultCancelButton);
|
|
54
|
+
}
|
|
38
55
|
return _LktSettings;
|
|
39
56
|
}
|
|
40
57
|
static defaultCreateButton = {
|
|
41
58
|
text: "Create"
|
|
42
59
|
};
|
|
43
|
-
static setDefaultCreateButton(button) {
|
|
44
|
-
|
|
60
|
+
static setDefaultCreateButton(button, override = true) {
|
|
61
|
+
if (override) {
|
|
62
|
+
_LktSettings.defaultCreateButton = button;
|
|
63
|
+
} else {
|
|
64
|
+
_LktSettings.defaultCreateButton = ensureButtonConfig(button, _LktSettings.defaultCreateButton);
|
|
65
|
+
}
|
|
45
66
|
return _LktSettings;
|
|
46
67
|
}
|
|
47
68
|
static defaultUpdateButton = {
|
|
48
69
|
text: "Update"
|
|
49
70
|
};
|
|
50
|
-
static setDefaultUpdateButton(button) {
|
|
51
|
-
|
|
71
|
+
static setDefaultUpdateButton(button, override = true) {
|
|
72
|
+
if (override) {
|
|
73
|
+
_LktSettings.defaultUpdateButton = button;
|
|
74
|
+
} else {
|
|
75
|
+
_LktSettings.defaultUpdateButton = ensureButtonConfig(button, _LktSettings.defaultUpdateButton);
|
|
76
|
+
}
|
|
52
77
|
return _LktSettings;
|
|
53
78
|
}
|
|
54
79
|
static defaultDropButton = {
|
|
55
80
|
text: "Drop"
|
|
56
81
|
};
|
|
57
|
-
static setDefaultDropButton(button) {
|
|
58
|
-
|
|
82
|
+
static setDefaultDropButton(button, override = true) {
|
|
83
|
+
if (override) {
|
|
84
|
+
_LktSettings.defaultDropButton = button;
|
|
85
|
+
} else {
|
|
86
|
+
_LktSettings.defaultDropButton = ensureButtonConfig(button, _LktSettings.defaultDropButton);
|
|
87
|
+
}
|
|
59
88
|
return _LktSettings;
|
|
60
89
|
}
|
|
61
90
|
static defaultEditModeButton = {
|
|
62
91
|
text: "Edit mode",
|
|
63
92
|
type: "switch" /* Switch */
|
|
64
93
|
};
|
|
65
|
-
static setDefaultEditModeButton(button) {
|
|
66
|
-
|
|
94
|
+
static setDefaultEditModeButton(button, override = true) {
|
|
95
|
+
if (override) {
|
|
96
|
+
_LktSettings.defaultEditModeButton = button;
|
|
97
|
+
} else {
|
|
98
|
+
_LktSettings.defaultEditModeButton = ensureButtonConfig(button, _LktSettings.defaultEditModeButton);
|
|
99
|
+
}
|
|
67
100
|
return _LktSettings;
|
|
68
101
|
}
|
|
69
102
|
};
|
|
@@ -972,15 +1005,6 @@ var extractI18nValue = (needle) => {
|
|
|
972
1005
|
return txt;
|
|
973
1006
|
};
|
|
974
1007
|
|
|
975
|
-
// src/functions/ensure-data-functions.ts
|
|
976
|
-
var ensureButtonConfig = (buttonConfig, settingsConfig) => {
|
|
977
|
-
if (typeof buttonConfig === "undefined") return settingsConfig;
|
|
978
|
-
return {
|
|
979
|
-
...settingsConfig,
|
|
980
|
-
...buttonConfig
|
|
981
|
-
};
|
|
982
|
-
};
|
|
983
|
-
|
|
984
1008
|
// src/functions/debug-functions.ts
|
|
985
1009
|
var lktDebug = (component, ...args) => {
|
|
986
1010
|
if (LktSettings.debugEnabled) console.info("::lkt::", `[${component}] `, ...args);
|