lkt-vue-kernel 1.0.11 → 1.0.13

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
@@ -181,11 +181,11 @@ interface ButtonConfig {
181
181
  }
182
182
 
183
183
  declare class LktSettings {
184
- static debug: boolean;
185
- static version: string;
184
+ static debugEnabled: boolean;
185
+ static debugMode(enabled?: boolean): typeof LktSettings;
186
186
  static defaultConfirmButton: Partial<ButtonConfig>;
187
- static defaultCancelButton: Partial<ButtonConfig>;
188
187
  static setDefaultConfirmButton(button: Partial<ButtonConfig>): typeof LktSettings;
188
+ static defaultCancelButton: Partial<ButtonConfig>;
189
189
  static setDefaultCancelButton(button: Partial<ButtonConfig>): typeof LktSettings;
190
190
  }
191
191
 
@@ -332,6 +332,11 @@ interface FieldConfig {
332
332
  prop?: LktObject;
333
333
  }
334
334
 
335
+ declare enum ItemCrudView {
336
+ Inline = "inline",
337
+ Modal = "modal"
338
+ }
339
+
335
340
  declare enum ModalCallbackAction {
336
341
  Refresh = "refresh",
337
342
  Close = "close",
@@ -348,6 +353,96 @@ interface ModalCallbackConfig {
348
353
  args?: LktObject;
349
354
  }
350
355
 
356
+ declare enum ItemCrudType {
357
+ Create = "create",
358
+ Edit = "edit",
359
+ Read = "read"
360
+ }
361
+
362
+ declare enum ItemCrudButtonNavPosition {
363
+ Top = "top",
364
+ Bottom = "bottom"
365
+ }
366
+
367
+ declare enum ItemCrudButtonNavVisibility {
368
+ Changed = "changed",
369
+ Always = "always"
370
+ }
371
+
372
+ declare enum SaveType {
373
+ Manual = "manual",
374
+ Auto = "auto",
375
+ Delay = "delay"
376
+ }
377
+
378
+ interface SaveConfig {
379
+ type?: SaveType;
380
+ delay?: number;
381
+ }
382
+
383
+ interface ItemCrudConfig {
384
+ modelValue: LktObject;
385
+ editing: boolean;
386
+ type: ItemCrudType;
387
+ view: ItemCrudView;
388
+ editButton: ButtonConfig;
389
+ dropButton: ButtonConfig;
390
+ createButton: ButtonConfig;
391
+ updateButton: ButtonConfig;
392
+ modalConfig: ModalConfig;
393
+ saveConfig: SaveConfig;
394
+ title: string;
395
+ hiddenSave: boolean;
396
+ hiddenDrop: boolean;
397
+ hiddenButtons: boolean;
398
+ hideSwitchEdition: boolean;
399
+ readResource: string;
400
+ readData: LktObject;
401
+ saveValidator: Function;
402
+ beforeEmitUpdate: Function | undefined;
403
+ dataStateConfig: LktObject;
404
+ buttonNavPosition?: ItemCrudButtonNavPosition;
405
+ buttonNavVisibility?: ItemCrudButtonNavVisibility;
406
+ insideModal: boolean;
407
+ saveText: string;
408
+ saveIcon: string;
409
+ dropText: string;
410
+ dropIcon: string;
411
+ createResource: string;
412
+ updateResource: string;
413
+ dropResource: string;
414
+ createConfirm: string;
415
+ updateConfirm: string;
416
+ dropConfirm: string;
417
+ createConfirmData: LktObject;
418
+ updateConfirmData: LktObject;
419
+ dropConfirmData: LktObject;
420
+ createDisabled: boolean;
421
+ updateDisabled: boolean;
422
+ dropDisabled: boolean;
423
+ createData: LktObject;
424
+ updateData: LktObject;
425
+ dropData: LktObject;
426
+ editModeText: string;
427
+ onCreate: Function | undefined;
428
+ onUpdate: Function | undefined;
429
+ onCreateModalCallbacks: ModalCallbackConfig[];
430
+ onUpdateModalCallbacks: ModalCallbackConfig[];
431
+ onDropModalCallbacks: ModalCallbackConfig[];
432
+ isCreate: boolean;
433
+ size: string;
434
+ preTitle: string;
435
+ showClose: boolean;
436
+ disabledClose: boolean;
437
+ disabledVeilClick: boolean;
438
+ modalName: string;
439
+ modalKey: string;
440
+ zIndex: number;
441
+ editedCloseConfirm: string;
442
+ editedCloseConfirmKey: string | number;
443
+ beforeClose: Function | undefined;
444
+ }
445
+
351
446
  declare enum PaginatorType {
352
447
  Pages = "pages",
353
448
  PrevNext = "prev-next",
@@ -838,6 +933,8 @@ type ValidScanPropTarget = ScanPropTarget | ((...args: any[]) => ScanPropTarget)
838
933
  declare const extractPropValue: (needle: ValidScanPropTarget, haystack: LktObject) => ValidScanPropTarget;
839
934
  declare const extractI18nValue: (needle: string | number) => any;
840
935
 
936
+ declare const lktDebug: (component: string, ...args: any[]) => void;
937
+
841
938
  /**
842
939
  * Export common interfaces
843
940
  */
@@ -847,4 +944,4 @@ declare function getDefaultValues<T>(cls: {
847
944
  lktDefaultValues: (keyof T)[];
848
945
  }): Partial<T>;
849
946
 
850
- 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, LktItem, type LktObject, LktSettings, LktStrictItem, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, SafeString, 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, extractI18nValue, extractPropValue, getDefaultValues };
947
+ 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, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudType, 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, extractI18nValue, extractPropValue, getDefaultValues, lktDebug };
package/dist/index.js CHANGED
@@ -1,17 +1,20 @@
1
1
  // src/settings/LktSettings.ts
2
2
  var LktSettings = class _LktSettings {
3
- static debug = false;
4
- static version = "0.0.1";
3
+ static debugEnabled = false;
4
+ static debugMode(enabled = true) {
5
+ _LktSettings.debugEnabled = enabled;
6
+ return _LktSettings;
7
+ }
5
8
  static defaultConfirmButton = {
6
9
  text: "Confirm"
7
10
  };
8
- static defaultCancelButton = {
9
- text: "Cancel"
10
- };
11
11
  static setDefaultConfirmButton(button) {
12
12
  _LktSettings.defaultConfirmButton = button;
13
13
  return _LktSettings;
14
14
  }
15
+ static defaultCancelButton = {
16
+ text: "Cancel"
17
+ };
15
18
  static setDefaultCancelButton(button) {
16
19
  _LktSettings.defaultCancelButton = button;
17
20
  return _LktSettings;
@@ -780,6 +783,35 @@ var Table = class extends LktItem {
780
783
  }
781
784
  };
782
785
 
786
+ // src/enums/ItemCrudButtonNavPosition.ts
787
+ var ItemCrudButtonNavPosition = /* @__PURE__ */ ((ItemCrudButtonNavPosition2) => {
788
+ ItemCrudButtonNavPosition2["Top"] = "top";
789
+ ItemCrudButtonNavPosition2["Bottom"] = "bottom";
790
+ return ItemCrudButtonNavPosition2;
791
+ })(ItemCrudButtonNavPosition || {});
792
+
793
+ // src/enums/ItemCrudButtonNavVisibility.ts
794
+ var ItemCrudButtonNavVisibility = /* @__PURE__ */ ((ItemCrudButtonNavVisibility2) => {
795
+ ItemCrudButtonNavVisibility2["Changed"] = "changed";
796
+ ItemCrudButtonNavVisibility2["Always"] = "always";
797
+ return ItemCrudButtonNavVisibility2;
798
+ })(ItemCrudButtonNavVisibility || {});
799
+
800
+ // src/enums/ItemCrudType.ts
801
+ var ItemCrudType = /* @__PURE__ */ ((ItemCrudType2) => {
802
+ ItemCrudType2["Create"] = "create";
803
+ ItemCrudType2["Edit"] = "edit";
804
+ ItemCrudType2["Read"] = "read";
805
+ return ItemCrudType2;
806
+ })(ItemCrudType || {});
807
+
808
+ // src/enums/ItemCrudView.ts
809
+ var ItemCrudView = /* @__PURE__ */ ((ItemCrudView2) => {
810
+ ItemCrudView2["Inline"] = "inline";
811
+ ItemCrudView2["Modal"] = "modal";
812
+ return ItemCrudView2;
813
+ })(ItemCrudView || {});
814
+
783
815
  // src/enums/ModalCallbackAction.ts
784
816
  var ModalCallbackAction = /* @__PURE__ */ ((ModalCallbackAction2) => {
785
817
  ModalCallbackAction2["Refresh"] = "refresh";
@@ -797,6 +829,14 @@ var ModalType = /* @__PURE__ */ ((ModalType2) => {
797
829
  return ModalType2;
798
830
  })(ModalType || {});
799
831
 
832
+ // src/enums/SaveType.ts
833
+ var SaveType = /* @__PURE__ */ ((SaveType2) => {
834
+ SaveType2["Manual"] = "manual";
835
+ SaveType2["Auto"] = "auto";
836
+ SaveType2["Delay"] = "delay";
837
+ return SaveType2;
838
+ })(SaveType || {});
839
+
800
840
  // src/enums/SortDirection.ts
801
841
  var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
802
842
  SortDirection2["Asc"] = "asc";
@@ -841,6 +881,11 @@ var extractI18nValue = (needle) => {
841
881
  return txt;
842
882
  };
843
883
 
884
+ // src/functions/debug-functions.ts
885
+ var lktDebug = (component, ...args) => {
886
+ if (LktSettings.debugEnabled) console.info("::lkt::", `[${component}] `, ...args);
887
+ };
888
+
844
889
  // src/index.ts
845
890
  function getDefaultValues(cls) {
846
891
  const instance = new cls();
@@ -865,6 +910,10 @@ export {
865
910
  Field,
866
911
  FieldAutoValidationTrigger,
867
912
  FieldType,
913
+ ItemCrudButtonNavPosition,
914
+ ItemCrudButtonNavVisibility,
915
+ ItemCrudType,
916
+ ItemCrudView,
868
917
  LktItem,
869
918
  LktSettings,
870
919
  LktStrictItem,
@@ -876,6 +925,7 @@ export {
876
925
  Paginator,
877
926
  PaginatorType,
878
927
  SafeString,
928
+ SaveType,
879
929
  SortDirection,
880
930
  Table,
881
931
  TablePermission,
@@ -888,5 +938,6 @@ export {
888
938
  TooltipPositionEngine,
889
939
  extractI18nValue,
890
940
  extractPropValue,
891
- getDefaultValues
941
+ getDefaultValues,
942
+ lktDebug
892
943
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-vue-kernel",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "LKT Vue Kernel",
5
5
  "keywords": [
6
6
  "lkt",