lkt-vue-kernel 1.0.17 → 1.0.19

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,6 +227,8 @@ 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
233
  static setDefaultConfirmButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
206
234
  static defaultCancelButton: Partial<ButtonConfig>;
@@ -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 {
@@ -476,19 +473,7 @@ declare enum ColumnType {
476
473
  None = "",
477
474
  Field = "field",
478
475
  Button = "button",
479
- Anchor = "anchor",
480
- Text = "text",
481
- Number = "number",
482
- Check = "check",
483
- Switch = "switch",
484
- Select = "select",
485
- Email = "email",
486
- Tel = "tel",
487
- File = "file",
488
- Link = "link",
489
- Action = "action",
490
- Integer = "int",
491
- Float = "float"
476
+ Anchor = "anchor"
492
477
  }
493
478
 
494
479
  type ValidColSpan = Function | boolean | number | undefined;
@@ -608,20 +593,15 @@ declare class Button extends LktItem implements ButtonConfig {
608
593
  iconEnd: string;
609
594
  img: string;
610
595
  showTooltipOnHoverDelay: number;
611
- tooltipWindowMargin: number;
612
- tooltipReferrerMargin: number;
613
- tooltipLocationY: string;
614
- tooltipLocationX: string;
615
596
  checked: boolean;
616
597
  clickRef?: Element | VueElement;
617
598
  openTooltip: boolean;
618
599
  tabindex: ValidTabIndex;
619
600
  anchor?: AnchorConfig | Anchor;
620
- tooltipEngine?: TooltipPositionEngine;
621
601
  showTooltipOnHover?: boolean;
622
602
  hideTooltipOnLeave?: boolean;
623
- tooltipClass?: string;
624
603
  splitClass?: string;
604
+ tooltip?: TooltipConfig;
625
605
  prop?: LktObject;
626
606
  onClick?: Function | undefined;
627
607
  onConfirm?: Function | undefined;
@@ -632,10 +612,10 @@ declare class Button extends LktItem implements ButtonConfig {
632
612
  interface ColumnConfig {
633
613
  type: ColumnType;
634
614
  key: string;
635
- label: string;
636
- sortable: boolean;
637
- hidden: boolean;
638
- editable: boolean;
615
+ label?: string;
616
+ sortable?: boolean;
617
+ hidden?: boolean;
618
+ editable?: boolean;
639
619
  formatter?: Function | undefined;
640
620
  checkEmpty?: Function | undefined;
641
621
  colspan?: ValidColSpan;
@@ -930,6 +910,8 @@ declare const ensureButtonConfig: (buttonConfig: Partial<ButtonConfig> | undefin
930
910
 
931
911
  declare const lktDebug: (component: string, ...args: any[]) => void;
932
912
 
913
+ declare const createColumn: (data: ColumnConfig) => Column;
914
+
933
915
  /**
934
916
  * Export common interfaces
935
917
  */
@@ -939,4 +921,4 @@ declare function getDefaultValues<T>(cls: {
939
921
  lktDefaultValues: (keyof T)[];
940
922
  }): Partial<T>;
941
923
 
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 };
924
+ 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
@@ -32,6 +32,17 @@ var LktSettings = class _LktSettings {
32
32
  _LktSettings.debugEnabled = enabled;
33
33
  return _LktSettings;
34
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
+ }
35
46
  static defaultConfirmButton = {
36
47
  text: "Confirm"
37
48
  };
@@ -283,18 +294,6 @@ var ColumnType = /* @__PURE__ */ ((ColumnType2) => {
283
294
  ColumnType2["Field"] = "field";
284
295
  ColumnType2["Button"] = "button";
285
296
  ColumnType2["Anchor"] = "anchor";
286
- ColumnType2["Text"] = "text";
287
- ColumnType2["Number"] = "number";
288
- ColumnType2["Check"] = "check";
289
- ColumnType2["Switch"] = "switch";
290
- ColumnType2["Select"] = "select";
291
- ColumnType2["Email"] = "email";
292
- ColumnType2["Tel"] = "tel";
293
- ColumnType2["File"] = "file";
294
- ColumnType2["Link"] = "link";
295
- ColumnType2["Action"] = "action";
296
- ColumnType2["Integer"] = "int";
297
- ColumnType2["Float"] = "float";
298
297
  return ColumnType2;
299
298
  })(ColumnType || {});
300
299
 
@@ -386,15 +385,6 @@ var Anchor = class extends LktItem {
386
385
 
387
386
  // src/instances/Button.ts
388
387
  import { generateRandomString as generateRandomString2 } from "lkt-string-tools";
389
-
390
- // src/enums/TooltipPositionEngine.ts
391
- var TooltipPositionEngine = /* @__PURE__ */ ((TooltipPositionEngine2) => {
392
- TooltipPositionEngine2["Fixed"] = "fixed";
393
- TooltipPositionEngine2["Absolute"] = "absolute";
394
- return TooltipPositionEngine2;
395
- })(TooltipPositionEngine || {});
396
-
397
- // src/instances/Button.ts
398
388
  var Button = class extends LktItem {
399
389
  lktAllowUndefinedProps = [
400
390
  "clickRef",
@@ -429,19 +419,14 @@ var Button = class extends LktItem {
429
419
  "iconEnd",
430
420
  "img",
431
421
  "showTooltipOnHoverDelay",
432
- "tooltipWindowMargin",
433
- "tooltipReferrerMargin",
434
- "tooltipLocationY",
435
- "tooltipLocationX",
422
+ "tooltip",
436
423
  "checked",
437
424
  "clickRef",
438
425
  "openTooltip",
439
426
  "tabindex",
440
427
  "anchor",
441
- "tooltipEngine",
442
428
  "showTooltipOnHover",
443
429
  "hideTooltipOnLeave",
444
- "tooltipClass",
445
430
  "splitClass",
446
431
  "prop",
447
432
  "onClick",
@@ -472,20 +457,15 @@ var Button = class extends LktItem {
472
457
  iconEnd = "";
473
458
  img = "";
474
459
  showTooltipOnHoverDelay = 0;
475
- tooltipWindowMargin = 0;
476
- tooltipReferrerMargin = 0;
477
- tooltipLocationY = "bottom";
478
- tooltipLocationX = "left-corner";
479
460
  checked = false;
480
461
  clickRef = void 0;
481
462
  openTooltip = false;
482
463
  tabindex = void 0;
483
464
  anchor = void 0;
484
- tooltipEngine = "fixed" /* Fixed */;
485
465
  showTooltipOnHover = void 0;
486
466
  hideTooltipOnLeave = void 0;
487
- tooltipClass = "";
488
467
  splitClass = "";
468
+ tooltip = {};
489
469
  prop = {};
490
470
  // Event management
491
471
  onClick = void 0;
@@ -580,6 +560,13 @@ var Column = class extends LktItem {
580
560
  }
581
561
  };
582
562
 
563
+ // src/enums/TooltipPositionEngine.ts
564
+ var TooltipPositionEngine = /* @__PURE__ */ ((TooltipPositionEngine2) => {
565
+ TooltipPositionEngine2["Fixed"] = "fixed";
566
+ TooltipPositionEngine2["Absolute"] = "absolute";
567
+ return TooltipPositionEngine2;
568
+ })(TooltipPositionEngine || {});
569
+
583
570
  // src/enums/TooltipLocationY.ts
584
571
  var TooltipLocationY = /* @__PURE__ */ ((TooltipLocationY2) => {
585
572
  TooltipLocationY2["Top"] = "top";
@@ -1010,6 +997,11 @@ var lktDebug = (component, ...args) => {
1010
997
  if (LktSettings.debugEnabled) console.info("::lkt::", `[${component}] `, ...args);
1011
998
  };
1012
999
 
1000
+ // src/functions/table-functions.ts
1001
+ var createColumn = (data) => {
1002
+ return new Column(data);
1003
+ };
1004
+
1013
1005
  // src/index.ts
1014
1006
  function getDefaultValues(cls) {
1015
1007
  const instance = new cls();
@@ -1061,6 +1053,7 @@ export {
1061
1053
  TooltipLocationX,
1062
1054
  TooltipLocationY,
1063
1055
  TooltipPositionEngine,
1056
+ createColumn,
1064
1057
  ensureButtonConfig,
1065
1058
  extractI18nValue,
1066
1059
  extractPropValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-vue-kernel",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "LKT Vue Kernel",
5
5
  "keywords": [
6
6
  "lkt",