lkt-vue-kernel 1.0.16 → 1.0.18

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 CHANGED
@@ -123,11 +123,6 @@ declare class Anchor extends LktItem implements AnchorConfig {
123
123
  constructor(data?: Partial<AnchorConfig>);
124
124
  }
125
125
 
126
- declare enum TooltipPositionEngine {
127
- Fixed = "fixed",
128
- Absolute = "absolute"
129
- }
130
-
131
126
  interface IsDisabledCheckerArgs {
132
127
  value?: any;
133
128
  dataState?: DataState;
@@ -153,6 +148,42 @@ interface ModalCallbackConfig {
153
148
  args?: LktObject;
154
149
  }
155
150
 
151
+ declare enum TooltipLocationY {
152
+ Top = "top",
153
+ Bottom = "bottom",
154
+ Center = "center",
155
+ ReferrerCenter = "referrer-center"
156
+ }
157
+
158
+ declare enum TooltipLocationX {
159
+ Left = "left",
160
+ Right = "right",
161
+ Center = "center",
162
+ LeftCorner = "left-corner",
163
+ RightCorner = "right-corner"
164
+ }
165
+
166
+ declare enum TooltipPositionEngine {
167
+ Fixed = "fixed",
168
+ Absolute = "absolute"
169
+ }
170
+
171
+ interface TooltipConfig {
172
+ modelValue?: boolean;
173
+ alwaysOpen?: boolean;
174
+ class?: string;
175
+ text?: string;
176
+ icon?: string;
177
+ iconAtEnd?: boolean;
178
+ engine?: TooltipPositionEngine;
179
+ referrerMargin?: number | string;
180
+ windowMargin?: number | string;
181
+ referrerWidth?: boolean;
182
+ referrer?: HTMLElement | undefined;
183
+ locationY?: TooltipLocationY;
184
+ locationX?: TooltipLocationX;
185
+ }
186
+
156
187
  interface ButtonConfig {
157
188
  type?: ButtonType;
158
189
  checked?: boolean;
@@ -181,15 +212,10 @@ interface ButtonConfig {
181
212
  iconEnd?: string;
182
213
  img?: string;
183
214
  splitIcon?: string;
184
- tooltipEngine?: TooltipPositionEngine;
185
215
  showTooltipOnHover?: boolean;
186
216
  showTooltipOnHoverDelay?: number;
187
217
  hideTooltipOnLeave?: boolean;
188
- tooltipWindowMargin?: number;
189
- tooltipReferrerMargin?: number;
190
- tooltipClass?: string;
191
- tooltipLocationY?: string;
192
- tooltipLocationX?: string;
218
+ tooltip?: TooltipConfig;
193
219
  splitClass?: string;
194
220
  clickRef?: Element | VueElement;
195
221
  tabindex?: ValidTabIndex;
@@ -201,18 +227,20 @@ interface ButtonConfig {
201
227
  declare class LktSettings {
202
228
  static debugEnabled: boolean;
203
229
  static debugMode(enabled?: boolean): typeof LktSettings;
230
+ static defaultSaveButton: Partial<ButtonConfig>;
231
+ static setDefaultSaveButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
204
232
  static defaultConfirmButton: Partial<ButtonConfig>;
205
- static setDefaultConfirmButton(button: Partial<ButtonConfig>): typeof LktSettings;
233
+ static setDefaultConfirmButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
206
234
  static defaultCancelButton: Partial<ButtonConfig>;
207
- static setDefaultCancelButton(button: Partial<ButtonConfig>): typeof LktSettings;
235
+ static setDefaultCancelButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
208
236
  static defaultCreateButton: Partial<ButtonConfig>;
209
- static setDefaultCreateButton(button: Partial<ButtonConfig>): typeof LktSettings;
237
+ static setDefaultCreateButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
210
238
  static defaultUpdateButton: Partial<ButtonConfig>;
211
- static setDefaultUpdateButton(button: Partial<ButtonConfig>): typeof LktSettings;
239
+ static setDefaultUpdateButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
212
240
  static defaultDropButton: Partial<ButtonConfig>;
213
- static setDefaultDropButton(button: Partial<ButtonConfig>): typeof LktSettings;
241
+ static setDefaultDropButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
214
242
  static defaultEditModeButton: Partial<ButtonConfig>;
215
- static setDefaultEditModeButton(button: Partial<ButtonConfig>): typeof LktSettings;
243
+ static setDefaultEditModeButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
216
244
  }
217
245
 
218
246
  declare enum FieldType {
@@ -430,37 +458,6 @@ interface PaginatorConfig {
430
458
  filters?: LktObject;
431
459
  }
432
460
 
433
- declare enum TooltipLocationY {
434
- Top = "top",
435
- Bottom = "bottom",
436
- Center = "center",
437
- ReferrerCenter = "referrer-center"
438
- }
439
-
440
- declare enum TooltipLocationX {
441
- Left = "left",
442
- Right = "right",
443
- Center = "center",
444
- LeftCorner = "left-corner",
445
- RightCorner = "right-corner"
446
- }
447
-
448
- interface TooltipConfig {
449
- modelValue?: boolean;
450
- alwaysOpen?: boolean;
451
- class?: string;
452
- text?: string;
453
- icon?: string;
454
- iconAtEnd?: boolean;
455
- engine?: TooltipPositionEngine;
456
- referrerMargin?: number | string;
457
- windowMargin?: number | string;
458
- referrerWidth?: boolean;
459
- referrer?: HTMLElement | undefined;
460
- locationY?: TooltipLocationY;
461
- locationX?: TooltipLocationX;
462
- }
463
-
464
461
  type ValidDrag = boolean | ((item: LktObject) => boolean);
465
462
 
466
463
  interface DragConfig {
@@ -608,20 +605,15 @@ declare class Button extends LktItem implements ButtonConfig {
608
605
  iconEnd: string;
609
606
  img: string;
610
607
  showTooltipOnHoverDelay: number;
611
- tooltipWindowMargin: number;
612
- tooltipReferrerMargin: number;
613
- tooltipLocationY: string;
614
- tooltipLocationX: string;
615
608
  checked: boolean;
616
609
  clickRef?: Element | VueElement;
617
610
  openTooltip: boolean;
618
611
  tabindex: ValidTabIndex;
619
612
  anchor?: AnchorConfig | Anchor;
620
- tooltipEngine?: TooltipPositionEngine;
621
613
  showTooltipOnHover?: boolean;
622
614
  hideTooltipOnLeave?: boolean;
623
- tooltipClass?: string;
624
615
  splitClass?: string;
616
+ tooltip?: TooltipConfig;
625
617
  prop?: LktObject;
626
618
  onClick?: Function | undefined;
627
619
  onConfirm?: Function | undefined;
@@ -930,6 +922,8 @@ declare const ensureButtonConfig: (buttonConfig: Partial<ButtonConfig> | undefin
930
922
 
931
923
  declare const lktDebug: (component: string, ...args: any[]) => void;
932
924
 
925
+ declare const createColumn: (data: ColumnConfig) => Column;
926
+
933
927
  /**
934
928
  * Export common interfaces
935
929
  */
@@ -939,4 +933,4 @@ declare function getDefaultValues<T>(cls: {
939
933
  lktDefaultValues: (keyof T)[];
940
934
  }): Partial<T>;
941
935
 
942
- export { Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, ensureButtonConfig, extractI18nValue, extractPropValue, getDefaultValues, lktDebug };
936
+ export { Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, getDefaultValues, lktDebug };
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;
@@ -23,47 +32,82 @@ var LktSettings = class _LktSettings {
23
32
  _LktSettings.debugEnabled = enabled;
24
33
  return _LktSettings;
25
34
  }
35
+ static defaultSaveButton = {
36
+ text: "Save"
37
+ };
38
+ static setDefaultSaveButton(button, override = true) {
39
+ if (override) {
40
+ _LktSettings.defaultSaveButton = button;
41
+ } else {
42
+ _LktSettings.defaultSaveButton = ensureButtonConfig(button, _LktSettings.defaultSaveButton);
43
+ }
44
+ return _LktSettings;
45
+ }
26
46
  static defaultConfirmButton = {
27
47
  text: "Confirm"
28
48
  };
29
- static setDefaultConfirmButton(button) {
30
- _LktSettings.defaultConfirmButton = button;
49
+ static setDefaultConfirmButton(button, override = true) {
50
+ if (override) {
51
+ _LktSettings.defaultConfirmButton = button;
52
+ } else {
53
+ _LktSettings.defaultConfirmButton = ensureButtonConfig(button, _LktSettings.defaultConfirmButton);
54
+ }
31
55
  return _LktSettings;
32
56
  }
33
57
  static defaultCancelButton = {
34
58
  text: "Cancel"
35
59
  };
36
- static setDefaultCancelButton(button) {
37
- _LktSettings.defaultCancelButton = button;
60
+ static setDefaultCancelButton(button, override = true) {
61
+ if (override) {
62
+ _LktSettings.defaultCancelButton = button;
63
+ } else {
64
+ _LktSettings.defaultCancelButton = ensureButtonConfig(button, _LktSettings.defaultCancelButton);
65
+ }
38
66
  return _LktSettings;
39
67
  }
40
68
  static defaultCreateButton = {
41
69
  text: "Create"
42
70
  };
43
- static setDefaultCreateButton(button) {
44
- _LktSettings.defaultCreateButton = button;
71
+ static setDefaultCreateButton(button, override = true) {
72
+ if (override) {
73
+ _LktSettings.defaultCreateButton = button;
74
+ } else {
75
+ _LktSettings.defaultCreateButton = ensureButtonConfig(button, _LktSettings.defaultCreateButton);
76
+ }
45
77
  return _LktSettings;
46
78
  }
47
79
  static defaultUpdateButton = {
48
80
  text: "Update"
49
81
  };
50
- static setDefaultUpdateButton(button) {
51
- _LktSettings.defaultUpdateButton = button;
82
+ static setDefaultUpdateButton(button, override = true) {
83
+ if (override) {
84
+ _LktSettings.defaultUpdateButton = button;
85
+ } else {
86
+ _LktSettings.defaultUpdateButton = ensureButtonConfig(button, _LktSettings.defaultUpdateButton);
87
+ }
52
88
  return _LktSettings;
53
89
  }
54
90
  static defaultDropButton = {
55
91
  text: "Drop"
56
92
  };
57
- static setDefaultDropButton(button) {
58
- _LktSettings.defaultDropButton = button;
93
+ static setDefaultDropButton(button, override = true) {
94
+ if (override) {
95
+ _LktSettings.defaultDropButton = button;
96
+ } else {
97
+ _LktSettings.defaultDropButton = ensureButtonConfig(button, _LktSettings.defaultDropButton);
98
+ }
59
99
  return _LktSettings;
60
100
  }
61
101
  static defaultEditModeButton = {
62
102
  text: "Edit mode",
63
103
  type: "switch" /* Switch */
64
104
  };
65
- static setDefaultEditModeButton(button) {
66
- _LktSettings.defaultEditModeButton = button;
105
+ static setDefaultEditModeButton(button, override = true) {
106
+ if (override) {
107
+ _LktSettings.defaultEditModeButton = button;
108
+ } else {
109
+ _LktSettings.defaultEditModeButton = ensureButtonConfig(button, _LktSettings.defaultEditModeButton);
110
+ }
67
111
  return _LktSettings;
68
112
  }
69
113
  };
@@ -353,15 +397,6 @@ var Anchor = class extends LktItem {
353
397
 
354
398
  // src/instances/Button.ts
355
399
  import { generateRandomString as generateRandomString2 } from "lkt-string-tools";
356
-
357
- // src/enums/TooltipPositionEngine.ts
358
- var TooltipPositionEngine = /* @__PURE__ */ ((TooltipPositionEngine2) => {
359
- TooltipPositionEngine2["Fixed"] = "fixed";
360
- TooltipPositionEngine2["Absolute"] = "absolute";
361
- return TooltipPositionEngine2;
362
- })(TooltipPositionEngine || {});
363
-
364
- // src/instances/Button.ts
365
400
  var Button = class extends LktItem {
366
401
  lktAllowUndefinedProps = [
367
402
  "clickRef",
@@ -396,19 +431,14 @@ var Button = class extends LktItem {
396
431
  "iconEnd",
397
432
  "img",
398
433
  "showTooltipOnHoverDelay",
399
- "tooltipWindowMargin",
400
- "tooltipReferrerMargin",
401
- "tooltipLocationY",
402
- "tooltipLocationX",
434
+ "tooltip",
403
435
  "checked",
404
436
  "clickRef",
405
437
  "openTooltip",
406
438
  "tabindex",
407
439
  "anchor",
408
- "tooltipEngine",
409
440
  "showTooltipOnHover",
410
441
  "hideTooltipOnLeave",
411
- "tooltipClass",
412
442
  "splitClass",
413
443
  "prop",
414
444
  "onClick",
@@ -439,20 +469,15 @@ var Button = class extends LktItem {
439
469
  iconEnd = "";
440
470
  img = "";
441
471
  showTooltipOnHoverDelay = 0;
442
- tooltipWindowMargin = 0;
443
- tooltipReferrerMargin = 0;
444
- tooltipLocationY = "bottom";
445
- tooltipLocationX = "left-corner";
446
472
  checked = false;
447
473
  clickRef = void 0;
448
474
  openTooltip = false;
449
475
  tabindex = void 0;
450
476
  anchor = void 0;
451
- tooltipEngine = "fixed" /* Fixed */;
452
477
  showTooltipOnHover = void 0;
453
478
  hideTooltipOnLeave = void 0;
454
- tooltipClass = "";
455
479
  splitClass = "";
480
+ tooltip = {};
456
481
  prop = {};
457
482
  // Event management
458
483
  onClick = void 0;
@@ -547,6 +572,13 @@ var Column = class extends LktItem {
547
572
  }
548
573
  };
549
574
 
575
+ // src/enums/TooltipPositionEngine.ts
576
+ var TooltipPositionEngine = /* @__PURE__ */ ((TooltipPositionEngine2) => {
577
+ TooltipPositionEngine2["Fixed"] = "fixed";
578
+ TooltipPositionEngine2["Absolute"] = "absolute";
579
+ return TooltipPositionEngine2;
580
+ })(TooltipPositionEngine || {});
581
+
550
582
  // src/enums/TooltipLocationY.ts
551
583
  var TooltipLocationY = /* @__PURE__ */ ((TooltipLocationY2) => {
552
584
  TooltipLocationY2["Top"] = "top";
@@ -972,20 +1004,16 @@ var extractI18nValue = (needle) => {
972
1004
  return txt;
973
1005
  };
974
1006
 
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
1007
  // src/functions/debug-functions.ts
985
1008
  var lktDebug = (component, ...args) => {
986
1009
  if (LktSettings.debugEnabled) console.info("::lkt::", `[${component}] `, ...args);
987
1010
  };
988
1011
 
1012
+ // src/functions/table-functions.ts
1013
+ var createColumn = (data) => {
1014
+ return new Column(data);
1015
+ };
1016
+
989
1017
  // src/index.ts
990
1018
  function getDefaultValues(cls) {
991
1019
  const instance = new cls();
@@ -1037,6 +1065,7 @@ export {
1037
1065
  TooltipLocationX,
1038
1066
  TooltipLocationY,
1039
1067
  TooltipPositionEngine,
1068
+ createColumn,
1040
1069
  ensureButtonConfig,
1041
1070
  extractI18nValue,
1042
1071
  extractPropValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-vue-kernel",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "LKT Vue Kernel",
5
5
  "keywords": [
6
6
  "lkt",