lkt-vue-kernel 1.0.4 → 1.0.6

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +325 -143
  2. package/dist/index.js +268 -23
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { RouteLocationRaw } from 'vue-router';
2
1
  import { VueElement } from 'vue';
2
+ import { RouteLocationRaw } from 'vue-router';
3
3
 
4
4
  interface LktObject {
5
5
  [key: string | number]: any;
@@ -60,7 +60,7 @@ declare class Option extends LktItem implements OptionConfig {
60
60
  group: string;
61
61
  icon: string;
62
62
  modal: ValidModalName;
63
- constructor(data?: LktObject);
63
+ constructor(data?: Partial<OptionConfig>);
64
64
  }
65
65
 
66
66
  type ValidFieldValue = string | number | boolean | LktObject | Option[];
@@ -158,68 +158,47 @@ interface FieldConfig {
158
158
  modal?: string | Function;
159
159
  modalKey?: string | number | Function;
160
160
  modalData?: LktObject;
161
- prop?: LktObject;
162
161
  itemType?: string;
163
162
  optionValueType?: string;
163
+ prop?: LktObject;
164
164
  }
165
165
 
166
166
  type EmptyModalKey = '_';
167
167
 
168
168
  type ValidModalKey = string | Function | EmptyModalKey;
169
169
 
170
- interface ModalConfig extends LktObject {
171
- size?: string;
172
- preTitle?: string;
173
- preTitleIcon?: string;
174
- title?: string;
175
- closeIcon?: string;
176
- closeConfirm?: ValidModalName;
177
- closeConfirmKey?: ValidModalKey;
178
- showClose?: boolean;
179
- disabledClose?: boolean;
180
- disabledVeilClick?: boolean;
181
- hiddenFooter?: boolean;
182
- modalName?: ValidModalName;
183
- modalKey?: ValidModalKey;
184
- zIndex?: number;
185
- beforeClose?: Function | undefined;
170
+ type BeforeCloseModalData = {
171
+ modalName: ValidModalKey;
172
+ modalKey: ValidModalKey;
186
173
  item?: LktObject;
187
- }
174
+ };
188
175
 
189
- declare enum TooltipLocationY {
190
- Top = "top",
191
- Bottom = "bottom",
192
- Center = "center",
193
- ReferrerCenter = "referrer-center"
194
- }
176
+ type ValidBeforeCloseModal = Function | undefined | ((data: BeforeCloseModalData) => void);
195
177
 
196
- declare enum TooltipLocationX {
197
- Left = "left",
198
- Right = "right",
199
- Center = "center",
200
- LeftCorner = "left-corner",
201
- RightCorner = "right-corner"
178
+ declare enum ModalType {
179
+ Modal = "modal",
180
+ Confirm = "confirm"
202
181
  }
203
182
 
204
- declare enum TooltipPositionEngine {
205
- Fixed = "fixed",
206
- Absolute = "absolute"
183
+ declare const enum ButtonType {
184
+ Button = "button",// Default
185
+ Submit = "submit",// Form submit
186
+ Reset = "reset",
187
+ Anchor = "anchor",// Turns on anchor mode
188
+ Content = "content",// No click event
189
+ Switch = "switch",// Has a visible boolean state
190
+ HiddenSwitch = "hidden-switch",// Has a hidden boolean state
191
+ Split = "split",// Split button, content always generated
192
+ SplitLazy = "split-lazy",// Split button, contents generated after first open
193
+ SplitEver = "split-ever",// Split button, contents generated each time it's clicked
194
+ Tooltip = "tooltip",// Tooltip button, content always generated
195
+ TooltipLazy = "tooltip-lazy",// Tooltip button, contents generated after first open
196
+ TooltipEver = "tooltip-ever"
207
197
  }
208
198
 
209
- interface TooltipConfig {
210
- modelValue?: boolean;
211
- alwaysOpen?: boolean;
212
- class?: string;
213
- text?: string;
214
- icon?: string;
215
- iconAtEnd?: boolean;
216
- engine?: TooltipPositionEngine;
217
- referrerMargin?: number | string;
218
- windowMargin?: number | string;
219
- referrerWidth?: boolean;
220
- referrer?: HTMLElement | undefined;
221
- locationY?: TooltipLocationY;
222
- locationX?: TooltipLocationX;
199
+ declare enum ToggleMode {
200
+ Lazy = "lazy",
201
+ Ever = "ever"
223
202
  }
224
203
 
225
204
  declare enum AnchorType {
@@ -246,34 +225,7 @@ interface AnchorConfig {
246
225
  confirmModalKey?: ValidModalKey;
247
226
  confirmData?: ModalConfig;
248
227
  imposter?: boolean;
249
- }
250
-
251
- interface DragConfig {
252
- isDraggable?: boolean | Function;
253
- isValid?: Function;
254
- canRender?: boolean | Function;
255
- dragKey?: string;
256
- }
257
-
258
- declare const enum ButtonType {
259
- Button = "button",// Default
260
- Submit = "submit",// Form submit
261
- Reset = "reset",
262
- Anchor = "anchor",// Turns on anchor mode
263
- Content = "content",// No click event
264
- Switch = "switch",// Has a visible boolean state
265
- HiddenSwitch = "hidden-switch",// Has a hidden boolean state
266
- Split = "split",// Split button, content always generated
267
- SplitLazy = "split-lazy",// Split button, contents generated after first open
268
- SplitEver = "split-ever",// Split button, contents generated each time it's clicked
269
- Tooltip = "tooltip",// Tooltip button, content always generated
270
- TooltipLazy = "tooltip-lazy",// Tooltip button, contents generated after first open
271
- TooltipEver = "tooltip-ever"
272
- }
273
-
274
- declare enum ToggleMode {
275
- Lazy = "lazy",
276
- Ever = "ever"
228
+ external?: boolean;
277
229
  }
278
230
 
279
231
  declare class Anchor extends LktItem implements AnchorConfig {
@@ -290,8 +242,14 @@ declare class Anchor extends LktItem implements AnchorConfig {
290
242
  confirmModalKey: ValidModalKey;
291
243
  confirmData: LktObject;
292
244
  imposter: boolean;
293
- constructor(data?: Partial<AnchorConfig>);
245
+ external: boolean;
294
246
  getHref(): string;
247
+ constructor(data?: Partial<AnchorConfig>);
248
+ }
249
+
250
+ declare enum TooltipPositionEngine {
251
+ Fixed = "fixed",
252
+ Absolute = "absolute"
295
253
  }
296
254
 
297
255
  interface ButtonConfig {
@@ -313,10 +271,10 @@ interface ButtonConfig {
313
271
  resourceData?: LktObject;
314
272
  modal?: ValidModalName;
315
273
  modalKey?: ValidModalKey;
316
- modalData?: ModalConfig;
274
+ modalData?: Partial<ModalConfig>;
317
275
  confirmModal?: ValidModalName;
318
276
  confirmModalKey?: ValidModalKey;
319
- confirmData?: ModalConfig;
277
+ confirmData?: Partial<ModalConfig>;
320
278
  iconDot?: boolean | string | number;
321
279
  iconEnd?: string;
322
280
  img?: string;
@@ -335,20 +293,101 @@ interface ButtonConfig {
335
293
  splitClass?: string;
336
294
  clickRef?: Element | VueElement;
337
295
  tabindex?: ValidTabIndex;
338
- isAnchor?: boolean;
339
- onClickTo?: string;
340
- onClickToExternal?: boolean;
341
- download?: boolean;
342
- downloadFileName?: string;
343
- newTab?: boolean;
344
- showSwitch?: boolean;
345
- hiddenSwitch?: boolean;
296
+ prop?: LktObject;
297
+ onClick?: Function | undefined;
346
298
  }
347
299
 
348
- declare class LktStrictItem extends LktItem {
349
- lktStrictItem: boolean;
300
+ interface ModalConfig extends LktObject {
301
+ type?: ModalType;
302
+ size?: string;
303
+ preTitle?: string;
304
+ preTitleIcon?: string;
305
+ title?: string;
306
+ closeIcon?: string;
307
+ closeConfirm?: ValidModalName;
308
+ closeConfirmKey?: ValidModalKey;
309
+ showClose?: boolean;
310
+ disabledClose?: boolean;
311
+ disabledVeilClick?: boolean;
312
+ hiddenFooter?: boolean;
313
+ modalName?: ValidModalName;
314
+ modalKey?: ValidModalKey;
315
+ zIndex?: number;
316
+ beforeClose?: ValidBeforeCloseModal;
317
+ item?: LktObject;
318
+ confirmButton?: Partial<ButtonConfig>;
319
+ cancelButton?: Partial<ButtonConfig>;
350
320
  }
351
321
 
322
+ declare enum TooltipLocationY {
323
+ Top = "top",
324
+ Bottom = "bottom",
325
+ Center = "center",
326
+ ReferrerCenter = "referrer-center"
327
+ }
328
+
329
+ declare enum TooltipLocationX {
330
+ Left = "left",
331
+ Right = "right",
332
+ Center = "center",
333
+ LeftCorner = "left-corner",
334
+ RightCorner = "right-corner"
335
+ }
336
+
337
+ interface TooltipConfig {
338
+ modelValue?: boolean;
339
+ alwaysOpen?: boolean;
340
+ class?: string;
341
+ text?: string;
342
+ icon?: string;
343
+ iconAtEnd?: boolean;
344
+ engine?: TooltipPositionEngine;
345
+ referrerMargin?: number | string;
346
+ windowMargin?: number | string;
347
+ referrerWidth?: boolean;
348
+ referrer?: HTMLElement | undefined;
349
+ locationY?: TooltipLocationY;
350
+ locationX?: TooltipLocationX;
351
+ }
352
+
353
+ type ValidDrag = boolean | ((item: LktObject) => boolean);
354
+
355
+ interface DragConfig {
356
+ isDraggable?: ValidDrag;
357
+ isValid?: ValidDrag;
358
+ canRender?: boolean | Function;
359
+ dragKey?: string;
360
+ }
361
+
362
+ declare enum ColumnType {
363
+ None = "",
364
+ Field = "field",
365
+ Button = "button",
366
+ Anchor = "anchor",
367
+ Text = "text",
368
+ Number = "number",
369
+ Check = "check",
370
+ Switch = "switch",
371
+ Select = "select",
372
+ Email = "email",
373
+ Tel = "tel",
374
+ File = "file",
375
+ Link = "link",
376
+ Action = "action",
377
+ Integer = "int",
378
+ Float = "float"
379
+ }
380
+
381
+ type ValidColSpan = Function | boolean | number | undefined;
382
+
383
+ declare class SafeString {
384
+ private readonly value;
385
+ constructor(input: ValidSafeStringValue);
386
+ getValue(...args: any[]): string;
387
+ }
388
+
389
+ type ValidSafeStringValue = string | ((...args: any[]) => string) | undefined | SafeString;
390
+
352
391
  declare class Field extends LktItem implements FieldConfig {
353
392
  modelValue: ValidFieldValue;
354
393
  type: FieldType;
@@ -425,45 +464,15 @@ declare class Field extends LktItem implements FieldConfig {
425
464
  modalKey: string | number | Function;
426
465
  modalData: LktObject;
427
466
  data: LktObject;
428
- constructor(data?: FieldConfig);
467
+ constructor(data?: Partial<FieldConfig>);
429
468
  }
430
469
 
431
- declare enum ColumnType {
432
- None = "",
433
- Field = "field",
434
- Button = "button",
435
- Anchor = "anchor",
436
- Text = "text",
437
- Number = "number",
438
- Check = "check",
439
- Switch = "switch",
440
- Select = "select",
441
- Email = "email",
442
- Tel = "tel",
443
- File = "file",
444
- Link = "link",
445
- Action = "action",
446
- Integer = "int",
447
- Float = "float"
448
- }
449
-
450
- type ValidSafeStringValue = string | ((...args: any[]) => string) | undefined | SafeString;
451
-
452
- declare class SafeString {
453
- private readonly value;
454
- constructor(input: ValidSafeStringValue);
455
- getValue(...args: any[]): string;
456
- }
457
-
458
- type ValidColSpan = Function | boolean | number | undefined;
459
-
460
470
  declare class Button extends LktItem implements ButtonConfig {
461
471
  lktAllowUndefinedProps: string[];
472
+ static lktDefaultValues: (keyof ButtonConfig)[];
462
473
  type: ButtonType;
463
474
  name: string;
464
475
  palette: string;
465
- onClickTo: string;
466
- onClickToExternal: boolean;
467
476
  class: string;
468
477
  containerClass: string;
469
478
  value: string;
@@ -472,23 +481,19 @@ declare class Button extends LktItem implements ButtonConfig {
472
481
  wrapContent: boolean;
473
482
  split: boolean;
474
483
  splitIcon: string;
475
- isAnchor: boolean;
476
484
  resource: string;
477
485
  resourceData: LktObject;
478
486
  modal: ValidModalName;
479
487
  modalKey: ValidModalKey;
480
- modalData: ModalConfig;
488
+ modalData: Partial<ModalConfig>;
481
489
  confirmModal: ValidModalName;
482
490
  confirmModalKey: ValidModalKey;
483
- confirmData: ModalConfig;
491
+ confirmData: Partial<ModalConfig>;
484
492
  text: string;
485
493
  icon: string;
486
494
  iconDot: boolean;
487
495
  iconEnd: string;
488
496
  img: string;
489
- newTab: boolean;
490
- download: boolean;
491
- downloadFileName: string;
492
497
  tooltip: boolean;
493
498
  showTooltipOnHoverDelay: number;
494
499
  tooltipWindowMargin: number;
@@ -505,7 +510,9 @@ declare class Button extends LktItem implements ButtonConfig {
505
510
  hideTooltipOnLeave?: boolean;
506
511
  tooltipClass?: string;
507
512
  splitClass?: string;
508
- constructor(data?: ButtonConfig);
513
+ prop?: LktObject;
514
+ onClick?: Function | undefined;
515
+ constructor(data?: Partial<ButtonConfig>);
509
516
  }
510
517
 
511
518
  interface ColumnConfig {
@@ -529,9 +536,17 @@ interface ColumnConfig {
529
536
  action?: Function;
530
537
  }
531
538
 
539
+ declare enum TableType {
540
+ Table = "table",
541
+ Item = "item",
542
+ Ul = "ul",
543
+ Ol = "ol"
544
+ }
545
+
532
546
  declare class Column extends LktItem implements ColumnConfig {
533
547
  lktExcludedProps: string[];
534
548
  lktAllowUndefinedProps: string[];
549
+ static lktDefaultValues: (keyof ColumnConfig)[];
535
550
  type: ColumnType;
536
551
  key: string;
537
552
  label: string;
@@ -550,11 +565,113 @@ declare class Column extends LktItem implements ColumnConfig {
550
565
  button: Button | ButtonConfig | undefined;
551
566
  link: ValidSafeStringValue | SafeString | undefined;
552
567
  action?: Function;
553
- constructor(data: ColumnConfig);
568
+ constructor(data?: Partial<ColumnConfig>);
554
569
  getHref(item: LktObject): string;
555
570
  doAction(item: LktObject): any;
556
571
  }
557
572
 
573
+ declare enum TablePermission {
574
+ Create = "create",
575
+ Update = "update",// Save changes
576
+ Edit = "edit",// Displays edit button
577
+ Drop = "drop",// Displays drop button
578
+ Sort = "sort",// Sort
579
+ InlineEdit = "inline-edit",// Be able to edit columns inside the table
580
+ InlineCreate = "inline-create",// Be able to append a new editable row (needs InlineEdit in order to be editable)
581
+ ModalCreate = "modal-create",// Be able to append a new row after save a modal form
582
+ InlineCreateEver = "inline-create-ever"
583
+ }
584
+
585
+ type ValidTablePermission = TablePermission | string;
586
+
587
+ interface HeaderConfig {
588
+ tag?: string;
589
+ class?: string;
590
+ text?: string;
591
+ icon?: string;
592
+ }
593
+
594
+ declare enum TableRowType {
595
+ Auto = 0,
596
+ PreferItem = 1,
597
+ PreferCustomItem = 2,
598
+ PreferColumns = 3
599
+ }
600
+
601
+ type ValidTableRowTypeValue = TableRowType | ((...args: any[]) => TableRowType) | undefined;
602
+
603
+ interface TableConfig {
604
+ modelValue: LktObject[];
605
+ type?: TableType;
606
+ columns: Column[];
607
+ resource?: string;
608
+ noResultsText?: string;
609
+ filters?: LktObject[];
610
+ hideEmptyColumns?: boolean;
611
+ itemDisplayChecker?: Function;
612
+ rowDisplayType?: ValidTableRowTypeValue;
613
+ loading?: boolean;
614
+ page?: number;
615
+ perms?: ValidTablePermission[];
616
+ editMode?: boolean;
617
+ dataStateConfig?: LktObject;
618
+ sortable?: boolean;
619
+ sorter?: Function;
620
+ initialSorting?: boolean;
621
+ draggableChecker?: Function;
622
+ checkValidDrag?: Function;
623
+ renderDrag?: boolean | Function;
624
+ disabledDrag?: boolean | Function;
625
+ draggableItemKey?: string;
626
+ header?: HeaderConfig;
627
+ title?: string;
628
+ titleTag?: string;
629
+ titleIcon?: string;
630
+ headerClass?: string;
631
+ saveButton?: ButtonConfig;
632
+ createButton?: ButtonConfig;
633
+ dropButton?: ButtonConfig;
634
+ wrapContentTag?: string;
635
+ wrapContentClass?: string;
636
+ itemsContainerClass?: string;
637
+ hiddenSave?: boolean;
638
+ saveDisabled?: boolean;
639
+ saveValidator?: Function;
640
+ saveConfirm?: string;
641
+ confirmData?: LktObject;
642
+ saveResource?: string;
643
+ saveResourceData?: LktObject;
644
+ saveTooltipEngine?: string;
645
+ splitSave?: boolean;
646
+ saveText?: string;
647
+ createText?: string;
648
+ createIcon?: string;
649
+ createRoute?: string;
650
+ dropText?: string;
651
+ dropIcon?: string;
652
+ editText?: string;
653
+ editIcon?: string;
654
+ editLink?: string;
655
+ editModeText?: string;
656
+ switchEditionEnabled?: boolean;
657
+ createDisabled?: boolean;
658
+ dropConfirm?: string;
659
+ dropResource?: string;
660
+ addNavigation?: boolean;
661
+ createEnabledValidator?: Function;
662
+ newValueGenerator?: Function;
663
+ requiredItemsForTopCreate?: number;
664
+ requiredItemsForBottomCreate?: number;
665
+ slotItemVar?: string;
666
+ modal?: string;
667
+ modalData?: LktObject;
668
+ itemMode?: boolean;
669
+ }
670
+
671
+ declare class LktStrictItem extends LktItem {
672
+ lktStrictItem: boolean;
673
+ }
674
+
558
675
  declare class Tooltip extends LktItem implements TooltipConfig {
559
676
  static lktDefaultValues: (keyof TooltipConfig)[];
560
677
  modelValue: boolean;
@@ -570,7 +687,7 @@ declare class Tooltip extends LktItem implements TooltipConfig {
570
687
  referrer: HTMLElement | undefined;
571
688
  locationY: TooltipLocationY;
572
689
  locationX: TooltipLocationX;
573
- constructor(data?: FieldConfig);
690
+ constructor(data?: Partial<TooltipConfig>);
574
691
  }
575
692
 
576
693
  declare class Modal extends LktItem implements ModalConfig {
@@ -589,14 +706,80 @@ declare class Modal extends LktItem implements ModalConfig {
589
706
  modalName: ValidModalName;
590
707
  modalKey: ValidModalKey;
591
708
  zIndex: number;
592
- beforeClose: Function | undefined;
709
+ beforeClose: ValidBeforeCloseModal;
593
710
  item: LktObject;
594
- constructor(data?: FieldConfig);
711
+ confirmButton?: Partial<ButtonConfig>;
712
+ cancelButton?: Partial<ButtonConfig>;
713
+ constructor(data?: Partial<ModalConfig>);
595
714
  }
596
715
 
597
- declare enum ModalType {
598
- Modal = "modal",
599
- Confirm = "confirm"
716
+ declare class Table extends LktItem implements TableConfig {
717
+ static lktDefaultValues: (keyof TableConfig)[];
718
+ modelValue: LktObject[];
719
+ type?: TableType;
720
+ columns: Column[];
721
+ resource?: string;
722
+ noResultsText?: string;
723
+ filters?: LktObject[];
724
+ hideEmptyColumns?: boolean;
725
+ itemDisplayChecker?: Function;
726
+ rowDisplayType?: ValidTableRowTypeValue;
727
+ loading?: boolean;
728
+ page?: number;
729
+ perms?: ValidTablePermission[];
730
+ editMode?: boolean;
731
+ dataStateConfig?: LktObject;
732
+ sortable?: boolean;
733
+ sorter?: Function;
734
+ initialSorting?: boolean;
735
+ draggableChecker?: Function;
736
+ checkValidDrag?: Function;
737
+ renderDrag?: boolean | Function;
738
+ disabledDrag?: boolean | Function;
739
+ draggableItemKey?: string;
740
+ header?: HeaderConfig;
741
+ title?: string;
742
+ titleTag?: string;
743
+ titleIcon?: string;
744
+ headerClass?: string;
745
+ saveButton?: ButtonConfig;
746
+ createButton?: ButtonConfig;
747
+ dropButton?: ButtonConfig;
748
+ wrapContentTag?: string;
749
+ wrapContentClass?: string;
750
+ itemsContainerClass?: string;
751
+ hiddenSave?: boolean;
752
+ saveDisabled?: boolean;
753
+ saveValidator?: Function;
754
+ saveConfirm?: string;
755
+ confirmData?: LktObject;
756
+ saveResource?: string;
757
+ saveResourceData?: LktObject;
758
+ saveTooltipEngine?: string;
759
+ splitSave?: boolean;
760
+ saveText?: string;
761
+ createText?: string;
762
+ createIcon?: string;
763
+ createRoute?: string;
764
+ dropText?: string;
765
+ dropIcon?: string;
766
+ editText?: string;
767
+ editIcon?: string;
768
+ editLink?: string;
769
+ editModeText?: string;
770
+ switchEditionEnabled?: boolean;
771
+ createDisabled?: boolean;
772
+ dropConfirm?: string;
773
+ dropResource?: string;
774
+ addNavigation?: boolean;
775
+ createEnabledValidator?: Function;
776
+ newValueGenerator?: Function;
777
+ requiredItemsForTopCreate?: number;
778
+ requiredItemsForBottomCreate?: number;
779
+ slotItemVar?: string;
780
+ modal?: string;
781
+ modalData?: LktObject;
782
+ constructor(data?: Partial<TableConfig>);
600
783
  }
601
784
 
602
785
  declare enum SortDirection {
@@ -604,12 +787,11 @@ declare enum SortDirection {
604
787
  Desc = "desc"
605
788
  }
606
789
 
607
- declare enum TableType {
608
- Table = "table",
609
- Item = "item",
610
- Ul = "ul",
611
- Ol = "ol"
612
- }
790
+ type ScanPropTarget = string | number | undefined | Function;
791
+
792
+ type ValidScanPropTarget = ScanPropTarget | ((...args: any[]) => ScanPropTarget);
793
+
794
+ declare const extractPropValue: (needle: ValidScanPropTarget, haystack: LktObject) => ValidScanPropTarget;
613
795
 
614
796
  /**
615
797
  * Export common interfaces
@@ -620,4 +802,4 @@ declare function getDefaultValues<T>(cls: {
620
802
  lktDefaultValues: (keyof T)[];
621
803
  }): Partial<T>;
622
804
 
623
- export { Anchor, type AnchorConfig, AnchorType, Button, type ButtonConfig, ButtonType, Column, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, LktItem, type LktObject, LktStrictItem, Modal, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, SafeString, SortDirection, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidColSpan, type ValidFieldMinMax, type ValidFieldValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidSafeStringValue, type ValidTabIndex, getDefaultValues };
805
+ export { Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, LktItem, type LktObject, LktStrictItem, Modal, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, SafeString, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidColSpan, type ValidFieldMinMax, type ValidFieldValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, extractPropValue, getDefaultValues };
package/dist/index.js CHANGED
@@ -243,7 +243,8 @@ var Anchor = class extends LktItem {
243
243
  "confirmModal",
244
244
  "confirmModalKey",
245
245
  "confirmData",
246
- "imposter"
246
+ "imposter",
247
+ "external"
247
248
  ];
248
249
  type = "router-link" /* RouterLink */;
249
250
  to = "";
@@ -256,10 +257,7 @@ var Anchor = class extends LktItem {
256
257
  confirmModalKey = "_";
257
258
  confirmData = {};
258
259
  imposter = false;
259
- constructor(data = {}) {
260
- super();
261
- this.feed(data);
262
- }
260
+ external = false;
263
261
  getHref() {
264
262
  let href = "";
265
263
  if (typeof this.to === "string") href = this.to;
@@ -277,6 +275,10 @@ var Anchor = class extends LktItem {
277
275
  if (typeof this.to === "string" && this.to !== "") return this.to;
278
276
  return "";
279
277
  }
278
+ constructor(data = {}) {
279
+ super();
280
+ this.feed(data);
281
+ }
280
282
  };
281
283
 
282
284
  // src/enums/ButtonType.ts
@@ -316,11 +318,53 @@ var Button = class extends LktItem {
316
318
  "showTooltipOnHover",
317
319
  "hideTooltipOnLeave"
318
320
  ];
321
+ static lktDefaultValues = [
322
+ "type",
323
+ "name",
324
+ "palette",
325
+ "class",
326
+ "containerClass",
327
+ "value",
328
+ "disabled",
329
+ "loading",
330
+ "wrapContent",
331
+ "split",
332
+ "splitIcon",
333
+ "resource",
334
+ "resourceData",
335
+ "modal",
336
+ "modalKey",
337
+ "modalData",
338
+ "confirmModal",
339
+ "confirmModalKey",
340
+ "confirmData",
341
+ "text",
342
+ "icon",
343
+ "iconDot",
344
+ "iconEnd",
345
+ "img",
346
+ "tooltip",
347
+ "showTooltipOnHoverDelay",
348
+ "tooltipWindowMargin",
349
+ "tooltipReferrerMargin",
350
+ "tooltipLocationY",
351
+ "tooltipLocationX",
352
+ "checked",
353
+ "clickRef",
354
+ "openTooltip",
355
+ "tabindex",
356
+ "anchor",
357
+ "tooltipEngine",
358
+ "showTooltipOnHover",
359
+ "hideTooltipOnLeave",
360
+ "tooltipClass",
361
+ "splitClass",
362
+ "prop",
363
+ "onClick"
364
+ ];
319
365
  type = "button" /* Button */;
320
366
  name = generateRandomString2(10);
321
367
  palette = "";
322
- onClickTo = "";
323
- onClickToExternal = false;
324
368
  class = "";
325
369
  containerClass = "";
326
370
  value = "";
@@ -329,23 +373,19 @@ var Button = class extends LktItem {
329
373
  wrapContent = false;
330
374
  split = false;
331
375
  splitIcon = "";
332
- isAnchor = false;
333
376
  resource = "";
334
- resourceData = () => ({});
377
+ resourceData = {};
335
378
  modal = "";
336
379
  modalKey = "_";
337
- modalData = () => ({});
380
+ modalData = {};
338
381
  confirmModal = "";
339
382
  confirmModalKey = "_";
340
- confirmData = () => ({});
383
+ confirmData = {};
341
384
  text = "";
342
385
  icon = "";
343
386
  iconDot = false;
344
387
  iconEnd = "";
345
388
  img = "";
346
- newTab = false;
347
- download = false;
348
- downloadFileName = "";
349
389
  tooltip = false;
350
390
  showTooltipOnHoverDelay = 0;
351
391
  tooltipWindowMargin = 0;
@@ -362,6 +402,9 @@ var Button = class extends LktItem {
362
402
  hideTooltipOnLeave = void 0;
363
403
  tooltipClass = "";
364
404
  splitClass = "";
405
+ prop = {};
406
+ // Event management
407
+ onClick = void 0;
365
408
  constructor(data = {}) {
366
409
  super();
367
410
  this.feed(data);
@@ -382,6 +425,26 @@ var Column = class extends LktItem {
382
425
  "link",
383
426
  "action"
384
427
  ];
428
+ static lktDefaultValues = [
429
+ "type",
430
+ "key",
431
+ "label",
432
+ "sortable",
433
+ "hidden",
434
+ "editable",
435
+ "formatter",
436
+ "checkEmpty",
437
+ "colspan",
438
+ "preferSlot",
439
+ "isForRowKey",
440
+ "extractTitleFromColumn",
441
+ "slotData",
442
+ "field",
443
+ "anchor",
444
+ "button",
445
+ "link",
446
+ "action"
447
+ ];
385
448
  type = "" /* None */;
386
449
  key = "";
387
450
  label = "";
@@ -400,7 +463,7 @@ var Column = class extends LktItem {
400
463
  button = void 0;
401
464
  link = void 0;
402
465
  action = void 0;
403
- constructor(data) {
466
+ constructor(data = {}) {
404
467
  super();
405
468
  this.feed(data);
406
469
  switch (this.type) {
@@ -519,6 +582,171 @@ var Modal = class extends LktItem {
519
582
  zIndex = 500;
520
583
  beforeClose = void 0;
521
584
  item = {};
585
+ confirmButton = {};
586
+ cancelButton = {};
587
+ constructor(data = {}) {
588
+ super();
589
+ this.feed(data);
590
+ }
591
+ };
592
+
593
+ // src/enums/TableType.ts
594
+ var TableType = /* @__PURE__ */ ((TableType2) => {
595
+ TableType2["Table"] = "table";
596
+ TableType2["Item"] = "item";
597
+ TableType2["Ul"] = "ul";
598
+ TableType2["Ol"] = "ol";
599
+ return TableType2;
600
+ })(TableType || {});
601
+
602
+ // src/enums/TableRowType.ts
603
+ var TableRowType = /* @__PURE__ */ ((TableRowType2) => {
604
+ TableRowType2[TableRowType2["Auto"] = 0] = "Auto";
605
+ TableRowType2[TableRowType2["PreferItem"] = 1] = "PreferItem";
606
+ TableRowType2[TableRowType2["PreferCustomItem"] = 2] = "PreferCustomItem";
607
+ TableRowType2[TableRowType2["PreferColumns"] = 3] = "PreferColumns";
608
+ return TableRowType2;
609
+ })(TableRowType || {});
610
+
611
+ // src/instances/Table.ts
612
+ var Table = class extends LktItem {
613
+ static lktDefaultValues = [
614
+ "modelValue",
615
+ "type",
616
+ "columns",
617
+ "resource",
618
+ "noResultsText",
619
+ "filters",
620
+ "hideEmptyColumns",
621
+ "itemDisplayChecker",
622
+ "loading",
623
+ "page",
624
+ "perms",
625
+ "editMode",
626
+ "dataStateConfig",
627
+ "sortable",
628
+ "sorter",
629
+ "initialSorting",
630
+ "draggableChecker",
631
+ "checkValidDrag",
632
+ "renderDrag",
633
+ "disabledDrag",
634
+ "draggableItemKey",
635
+ "header",
636
+ "title",
637
+ "titleTag",
638
+ "titleIcon",
639
+ "headerClass",
640
+ "saveButton",
641
+ "createButton",
642
+ "dropButton",
643
+ "wrapContentTag",
644
+ "wrapContentClass",
645
+ "itemsContainerClass",
646
+ "hiddenSave",
647
+ "saveDisabled",
648
+ "saveValidator",
649
+ "saveConfirm",
650
+ "confirmData",
651
+ "saveResource",
652
+ "saveResourceData",
653
+ "saveTooltipEngine",
654
+ "splitSave",
655
+ "saveText",
656
+ "createText",
657
+ "createIcon",
658
+ "createRoute",
659
+ "dropText",
660
+ "dropIcon",
661
+ "editText",
662
+ "editIcon",
663
+ "editLink",
664
+ "editModeText",
665
+ "switchEditionEnabled",
666
+ "createDisabled",
667
+ "dropConfirm",
668
+ "dropResource",
669
+ "addNavigation",
670
+ "createEnabledValidator",
671
+ "newValueGenerator",
672
+ "requiredItemsForTopCreate",
673
+ "requiredItemsForBottomCreate",
674
+ "slotItemVar",
675
+ "modal",
676
+ "modalData"
677
+ ];
678
+ // Data
679
+ modelValue = [];
680
+ type = "table" /* Table */;
681
+ columns = [];
682
+ resource = "";
683
+ noResultsText = "";
684
+ filters = [];
685
+ // Data visualization
686
+ hideEmptyColumns = false;
687
+ itemDisplayChecker = void 0;
688
+ rowDisplayType = 0 /* Auto */;
689
+ // State
690
+ loading = false;
691
+ page = 1;
692
+ perms = [];
693
+ editMode = false;
694
+ dataStateConfig = {};
695
+ // Sort
696
+ sortable = false;
697
+ sorter = void 0;
698
+ initialSorting = false;
699
+ // Drag (Old)
700
+ draggableChecker;
701
+ checkValidDrag;
702
+ renderDrag;
703
+ disabledDrag;
704
+ draggableItemKey;
705
+ // New proposed prop: header
706
+ header;
707
+ // Replaces:
708
+ title = "";
709
+ titleTag = "h2";
710
+ titleIcon = "";
711
+ headerClass = "";
712
+ // New proposed prop: saveButton
713
+ saveButton = {};
714
+ createButton = {};
715
+ dropButton = {};
716
+ wrapContentTag = "div";
717
+ wrapContentClass = "";
718
+ itemsContainerClass = "";
719
+ hiddenSave = false;
720
+ saveDisabled = false;
721
+ saveValidator = void 0;
722
+ saveConfirm = "";
723
+ confirmData = {};
724
+ saveResource = "";
725
+ saveResourceData = {};
726
+ saveTooltipEngine = "absolute" /* Absolute */;
727
+ splitSave = false;
728
+ saveText = "";
729
+ createText = "";
730
+ createIcon = "";
731
+ createRoute = "";
732
+ dropText = "";
733
+ dropIcon = "";
734
+ editText = "";
735
+ editIcon = "";
736
+ editLink = "";
737
+ editModeText = "";
738
+ switchEditionEnabled = false;
739
+ createDisabled = false;
740
+ dropConfirm = "";
741
+ dropResource = "";
742
+ addNavigation = false;
743
+ createEnabledValidator = void 0;
744
+ newValueGenerator = void 0;
745
+ requiredItemsForTopCreate = 0;
746
+ requiredItemsForBottomCreate = 0;
747
+ slotItemVar = "item";
748
+ modal = "";
749
+ modalData = {};
522
750
  constructor(data = {}) {
523
751
  super();
524
752
  this.feed(data);
@@ -539,14 +767,19 @@ var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
539
767
  return SortDirection2;
540
768
  })(SortDirection || {});
541
769
 
542
- // src/enums/TableType.ts
543
- var TableType = /* @__PURE__ */ ((TableType2) => {
544
- TableType2["Table"] = "table";
545
- TableType2["Item"] = "item";
546
- TableType2["Ul"] = "ul";
547
- TableType2["Ol"] = "ol";
548
- return TableType2;
549
- })(TableType || {});
770
+ // src/enums/TablePermission.ts
771
+ var TablePermission = /* @__PURE__ */ ((TablePermission2) => {
772
+ TablePermission2["Create"] = "create";
773
+ TablePermission2["Update"] = "update";
774
+ TablePermission2["Edit"] = "edit";
775
+ TablePermission2["Drop"] = "drop";
776
+ TablePermission2["Sort"] = "sort";
777
+ TablePermission2["InlineEdit"] = "inline-edit";
778
+ TablePermission2["InlineCreate"] = "inline-create";
779
+ TablePermission2["ModalCreate"] = "modal-create";
780
+ TablePermission2["InlineCreateEver"] = "inline-create-ever";
781
+ return TablePermission2;
782
+ })(TablePermission || {});
550
783
 
551
784
  // src/enums/ToggleMode.ts
552
785
  var ToggleMode = /* @__PURE__ */ ((ToggleMode2) => {
@@ -555,6 +788,14 @@ var ToggleMode = /* @__PURE__ */ ((ToggleMode2) => {
555
788
  return ToggleMode2;
556
789
  })(ToggleMode || {});
557
790
 
791
+ // src/functions/extract-data-functions.ts
792
+ var extractPropValue = (needle, haystack) => {
793
+ if (typeof needle === "string" && needle.startsWith("prop:")) {
794
+ return haystack[needle.substring(5)];
795
+ }
796
+ return needle;
797
+ };
798
+
558
799
  // src/index.ts
559
800
  function getDefaultValues(cls) {
560
801
  const instance = new cls();
@@ -587,11 +828,15 @@ export {
587
828
  Option,
588
829
  SafeString,
589
830
  SortDirection,
831
+ Table,
832
+ TablePermission,
833
+ TableRowType,
590
834
  TableType,
591
835
  ToggleMode,
592
836
  Tooltip,
593
837
  TooltipLocationX,
594
838
  TooltipLocationY,
595
839
  TooltipPositionEngine,
840
+ extractPropValue,
596
841
  getDefaultValues
597
842
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-vue-kernel",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "LKT Vue Kernel",
5
5
  "keywords": [
6
6
  "lkt",