lkt-vue-kernel 1.0.9 → 1.0.11

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 +209 -213
  2. package/dist/index.js +42 -41
  3. package/package.json +3 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,194 @@
1
1
  import { VueElement, Component } from 'vue';
2
2
  import { RouteLocationRaw } from 'vue-router';
3
+ import { DataState } from 'lkt-data-state';
3
4
 
4
5
  interface LktObject {
5
6
  [key: string | number]: any;
6
7
  }
7
8
 
9
+ declare const enum ButtonType {
10
+ Button = "button",// Default
11
+ Submit = "submit",// Form submit
12
+ Reset = "reset",
13
+ Anchor = "anchor",// Turns on anchor mode
14
+ Content = "content",// No click event
15
+ Switch = "switch",// Has a visible boolean state
16
+ HiddenSwitch = "hidden-switch",// Has a hidden boolean state
17
+ Split = "split",// Split button, content always generated
18
+ SplitLazy = "split-lazy",// Split button, contents generated after first open
19
+ SplitEver = "split-ever",// Split button, contents generated each time it's clicked
20
+ Tooltip = "tooltip",// Tooltip button, content always generated
21
+ TooltipLazy = "tooltip-lazy",// Tooltip button, contents generated after first open
22
+ TooltipEver = "tooltip-ever"
23
+ }
24
+
25
+ declare enum AnchorType {
26
+ Href = "href",// Vanilla JS+HTML anchor
27
+ RouterLink = "router-link",// For vue-router integration
28
+ RouterLinkBack = "router-link-back",// For vue-router back navigation
29
+ Mail = "mail",// Triggers OS mail integration
30
+ Tel = "tel",// Triggers OS phone integration
31
+ Tab = "tab",// New tab, similar to target="_blank"
32
+ Download = "download",// Download link
33
+ Action = "action",// Performs an action, without route changes
34
+ Legacy = ""
35
+ }
36
+
37
+ type ValidModalName = string | Function | undefined;
38
+
39
+ type EmptyModalKey = '_';
40
+
41
+ type ValidModalKey = string | Function | EmptyModalKey;
42
+
43
+ type BeforeCloseModalData = {
44
+ modalName: ValidModalKey;
45
+ modalKey: ValidModalKey;
46
+ item?: LktObject;
47
+ };
48
+
49
+ type ValidBeforeCloseModal = Function | undefined | ((data: BeforeCloseModalData) => void);
50
+
51
+ declare enum ModalType {
52
+ Modal = "modal",
53
+ Confirm = "confirm"
54
+ }
55
+
56
+ interface ModalConfig extends LktObject {
57
+ type?: ModalType;
58
+ size?: string;
59
+ preTitle?: string;
60
+ preTitleIcon?: string;
61
+ title?: string;
62
+ closeIcon?: string;
63
+ closeConfirm?: ValidModalName;
64
+ closeConfirmKey?: ValidModalKey;
65
+ showClose?: boolean;
66
+ disabledClose?: boolean;
67
+ disabledVeilClick?: boolean;
68
+ hiddenFooter?: boolean;
69
+ modalName?: ValidModalName;
70
+ modalKey?: ValidModalKey;
71
+ zIndex?: number;
72
+ beforeClose?: ValidBeforeCloseModal;
73
+ item?: LktObject;
74
+ confirmButton?: Partial<ButtonConfig>;
75
+ cancelButton?: Partial<ButtonConfig>;
76
+ }
77
+
78
+ interface AnchorConfig {
79
+ type?: AnchorType;
80
+ to?: RouteLocationRaw | string;
81
+ class?: string;
82
+ isActive?: boolean;
83
+ downloadFileName?: string;
84
+ disabled?: boolean;
85
+ onClick?: Function | undefined;
86
+ confirmModal?: ValidModalName;
87
+ confirmModalKey?: ValidModalKey;
88
+ confirmData?: ModalConfig;
89
+ imposter?: boolean;
90
+ external?: boolean;
91
+ }
92
+
93
+ type ValidTabIndex = string | number | undefined;
94
+
95
+ declare class LktItem implements LktObject {
96
+ static lktAllowUndefinedProps: string[];
97
+ static lktExcludedProps: string[];
98
+ static lktDateProps: string[];
99
+ static lktStrictItem: boolean;
100
+ static lktDefaultValues: (keyof LktObject)[];
101
+ constructor(data?: LktObject);
102
+ feed(data?: LktObject, target?: this): void;
103
+ assignProp(key: string, value: any): void;
104
+ }
105
+
106
+ declare class Anchor extends LktItem implements AnchorConfig {
107
+ static lktAllowUndefinedProps: string[];
108
+ static lktDefaultValues: (keyof AnchorConfig)[];
109
+ type: AnchorType;
110
+ to?: RouteLocationRaw | string;
111
+ class: string;
112
+ isActive: boolean;
113
+ downloadFileName: string;
114
+ disabled: boolean;
115
+ onClick: Function | undefined;
116
+ confirmModal: ValidModalName;
117
+ confirmModalKey: ValidModalKey;
118
+ confirmData: LktObject;
119
+ imposter: boolean;
120
+ external: boolean;
121
+ getHref(): string;
122
+ constructor(data?: Partial<AnchorConfig>);
123
+ }
124
+
125
+ declare enum TooltipPositionEngine {
126
+ Fixed = "fixed",
127
+ Absolute = "absolute"
128
+ }
129
+
130
+ interface IsDisabledCheckerArgs {
131
+ value?: any;
132
+ dataState?: DataState;
133
+ }
134
+
135
+ type IsDisabledChecker = ((args?: IsDisabledCheckerArgs) => boolean);
136
+
137
+ type ValidIsDisabledValue = boolean | undefined | IsDisabledChecker;
138
+
139
+ interface ButtonConfig {
140
+ type?: ButtonType;
141
+ checked?: boolean;
142
+ openTooltip?: boolean;
143
+ name?: string;
144
+ text?: string | number;
145
+ icon?: string;
146
+ class?: string;
147
+ containerClass?: string;
148
+ palette?: string;
149
+ value?: string;
150
+ disabled?: ValidIsDisabledValue;
151
+ loading?: boolean;
152
+ wrapContent?: boolean;
153
+ anchor?: AnchorConfig | Anchor;
154
+ resource?: string;
155
+ resourceData?: LktObject;
156
+ modal?: ValidModalName;
157
+ modalKey?: ValidModalKey;
158
+ modalData?: Partial<ModalConfig>;
159
+ confirmModal?: ValidModalName;
160
+ confirmModalKey?: ValidModalKey;
161
+ confirmData?: Partial<ModalConfig>;
162
+ iconDot?: boolean | string | number;
163
+ iconEnd?: string;
164
+ img?: string;
165
+ splitIcon?: string;
166
+ tooltipEngine?: TooltipPositionEngine;
167
+ showTooltipOnHover?: boolean;
168
+ showTooltipOnHoverDelay?: number;
169
+ hideTooltipOnLeave?: boolean;
170
+ tooltipWindowMargin?: number;
171
+ tooltipReferrerMargin?: number;
172
+ tooltipClass?: string;
173
+ tooltipLocationY?: string;
174
+ tooltipLocationX?: string;
175
+ splitClass?: string;
176
+ clickRef?: Element | VueElement;
177
+ tabindex?: ValidTabIndex;
178
+ prop?: LktObject;
179
+ onClick?: Function | undefined;
180
+ onConfirm?: Function | undefined;
181
+ }
182
+
183
+ declare class LktSettings {
184
+ static debug: boolean;
185
+ static version: string;
186
+ static defaultConfirmButton: Partial<ButtonConfig>;
187
+ static defaultCancelButton: Partial<ButtonConfig>;
188
+ static setDefaultConfirmButton(button: Partial<ButtonConfig>): typeof LktSettings;
189
+ static setDefaultCancelButton(button: Partial<ButtonConfig>): typeof LktSettings;
190
+ }
191
+
8
192
  declare enum FieldType {
9
193
  Text = "text",
10
194
  Email = "email",
@@ -39,19 +223,6 @@ interface OptionConfig {
39
223
  modal?: string | Function;
40
224
  }
41
225
 
42
- declare class LktItem implements LktObject {
43
- static lktAllowUndefinedProps: string[];
44
- static lktExcludedProps: string[];
45
- static lktDateProps: string[];
46
- static lktStrictItem: boolean;
47
- static lktDefaultValues: (keyof LktObject)[];
48
- constructor(data?: LktObject);
49
- feed(data?: LktObject, target?: this): void;
50
- assignProp(key: string, value: any): void;
51
- }
52
-
53
- type ValidModalName = string | Function | undefined;
54
-
55
226
  declare class Option extends LktItem implements OptionConfig {
56
227
  value: ValidOptionValue;
57
228
  label: string;
@@ -71,8 +242,6 @@ declare enum MultipleOptionsDisplay {
71
242
  Count = "count"
72
243
  }
73
244
 
74
- type ValidTabIndex = string | number | undefined;
75
-
76
245
  declare enum FieldAutoValidationTrigger {
77
246
  None = "",
78
247
  Focus = "focus",
@@ -171,10 +340,6 @@ declare enum ModalCallbackAction {
171
340
  Open = "open"
172
341
  }
173
342
 
174
- type EmptyModalKey = '_';
175
-
176
- type ValidModalKey = string | Function | EmptyModalKey;
177
-
178
343
  interface ModalCallbackConfig {
179
344
  modalName: ValidModalName;
180
345
  modalKey?: ValidModalKey;
@@ -183,158 +348,6 @@ interface ModalCallbackConfig {
183
348
  args?: LktObject;
184
349
  }
185
350
 
186
- type BeforeCloseModalData = {
187
- modalName: ValidModalKey;
188
- modalKey: ValidModalKey;
189
- item?: LktObject;
190
- };
191
-
192
- type ValidBeforeCloseModal = Function | undefined | ((data: BeforeCloseModalData) => void);
193
-
194
- declare enum ModalType {
195
- Modal = "modal",
196
- Confirm = "confirm"
197
- }
198
-
199
- declare const enum ButtonType {
200
- Button = "button",// Default
201
- Submit = "submit",// Form submit
202
- Reset = "reset",
203
- Anchor = "anchor",// Turns on anchor mode
204
- Content = "content",// No click event
205
- Switch = "switch",// Has a visible boolean state
206
- HiddenSwitch = "hidden-switch",// Has a hidden boolean state
207
- Split = "split",// Split button, content always generated
208
- SplitLazy = "split-lazy",// Split button, contents generated after first open
209
- SplitEver = "split-ever",// Split button, contents generated each time it's clicked
210
- Tooltip = "tooltip",// Tooltip button, content always generated
211
- TooltipLazy = "tooltip-lazy",// Tooltip button, contents generated after first open
212
- TooltipEver = "tooltip-ever"
213
- }
214
-
215
- declare enum ToggleMode {
216
- Lazy = "lazy",
217
- Ever = "ever"
218
- }
219
-
220
- declare enum AnchorType {
221
- Href = "href",// Vanilla JS+HTML anchor
222
- RouterLink = "router-link",// For vue-router integration
223
- RouterLinkBack = "router-link-back",// For vue-router back navigation
224
- Mail = "mail",// Triggers OS mail integration
225
- Tel = "tel",// Triggers OS phone integration
226
- Tab = "tab",// New tab, similar to target="_blank"
227
- Download = "download",// Download link
228
- Action = "action",// Performs an action, without route changes
229
- Legacy = ""
230
- }
231
-
232
- interface AnchorConfig {
233
- type?: AnchorType;
234
- to?: RouteLocationRaw | string;
235
- class?: string;
236
- isActive?: boolean;
237
- downloadFileName?: string;
238
- disabled?: boolean;
239
- onClick?: Function | undefined;
240
- confirmModal?: ValidModalName;
241
- confirmModalKey?: ValidModalKey;
242
- confirmData?: ModalConfig;
243
- imposter?: boolean;
244
- external?: boolean;
245
- }
246
-
247
- declare class Anchor extends LktItem implements AnchorConfig {
248
- static lktAllowUndefinedProps: string[];
249
- static lktDefaultValues: (keyof AnchorConfig)[];
250
- type: AnchorType;
251
- to?: RouteLocationRaw | string;
252
- class: string;
253
- isActive: boolean;
254
- downloadFileName: string;
255
- disabled: boolean;
256
- onClick: Function | undefined;
257
- confirmModal: ValidModalName;
258
- confirmModalKey: ValidModalKey;
259
- confirmData: LktObject;
260
- imposter: boolean;
261
- external: boolean;
262
- getHref(): string;
263
- constructor(data?: Partial<AnchorConfig>);
264
- }
265
-
266
- declare enum TooltipPositionEngine {
267
- Fixed = "fixed",
268
- Absolute = "absolute"
269
- }
270
-
271
- interface ButtonConfig {
272
- type?: ButtonType;
273
- checked?: boolean;
274
- openTooltip?: boolean;
275
- name?: string;
276
- text?: string | number;
277
- icon?: string;
278
- class?: string;
279
- containerClass?: string;
280
- palette?: string;
281
- value?: string;
282
- disabled?: boolean;
283
- loading?: boolean;
284
- wrapContent?: boolean;
285
- anchor?: AnchorConfig | Anchor;
286
- resource?: string;
287
- resourceData?: LktObject;
288
- modal?: ValidModalName;
289
- modalKey?: ValidModalKey;
290
- modalData?: Partial<ModalConfig>;
291
- confirmModal?: ValidModalName;
292
- confirmModalKey?: ValidModalKey;
293
- confirmData?: Partial<ModalConfig>;
294
- iconDot?: boolean | string | number;
295
- iconEnd?: string;
296
- img?: string;
297
- split?: boolean | ToggleMode;
298
- splitIcon?: string;
299
- tooltip?: boolean | ToggleMode;
300
- tooltipEngine?: TooltipPositionEngine;
301
- showTooltipOnHover?: boolean;
302
- showTooltipOnHoverDelay?: number;
303
- hideTooltipOnLeave?: boolean;
304
- tooltipWindowMargin?: number;
305
- tooltipReferrerMargin?: number;
306
- tooltipClass?: string;
307
- tooltipLocationY?: string;
308
- tooltipLocationX?: string;
309
- splitClass?: string;
310
- clickRef?: Element | VueElement;
311
- tabindex?: ValidTabIndex;
312
- prop?: LktObject;
313
- onClick?: Function | undefined;
314
- }
315
-
316
- interface ModalConfig extends LktObject {
317
- type?: ModalType;
318
- size?: string;
319
- preTitle?: string;
320
- preTitleIcon?: string;
321
- title?: string;
322
- closeIcon?: string;
323
- closeConfirm?: ValidModalName;
324
- closeConfirmKey?: ValidModalKey;
325
- showClose?: boolean;
326
- disabledClose?: boolean;
327
- disabledVeilClick?: boolean;
328
- hiddenFooter?: boolean;
329
- modalName?: ValidModalName;
330
- modalKey?: ValidModalKey;
331
- zIndex?: number;
332
- beforeClose?: ValidBeforeCloseModal;
333
- item?: LktObject;
334
- confirmButton?: Partial<ButtonConfig>;
335
- cancelButton?: Partial<ButtonConfig>;
336
- }
337
-
338
351
  declare enum PaginatorType {
339
352
  Pages = "pages",
340
353
  PrevNext = "prev-next",
@@ -388,8 +401,10 @@ interface TooltipConfig {
388
401
  type ValidDrag = boolean | ((item: LktObject) => boolean);
389
402
 
390
403
  interface DragConfig {
404
+ enabled: boolean;
391
405
  isDraggable?: ValidDrag;
392
406
  isValid?: ValidDrag;
407
+ isDisabled?: boolean | Function;
393
408
  canRender?: boolean | Function;
394
409
  dragKey?: string;
395
410
  }
@@ -511,10 +526,9 @@ declare class Button extends LktItem implements ButtonConfig {
511
526
  class: string;
512
527
  containerClass: string;
513
528
  value: string;
514
- disabled: boolean;
529
+ disabled: ValidIsDisabledValue;
515
530
  loading: boolean;
516
531
  wrapContent: boolean;
517
- split: boolean;
518
532
  splitIcon: string;
519
533
  resource: string;
520
534
  resourceData: LktObject;
@@ -529,7 +543,6 @@ declare class Button extends LktItem implements ButtonConfig {
529
543
  iconDot: boolean;
530
544
  iconEnd: string;
531
545
  img: string;
532
- tooltip: boolean;
533
546
  showTooltipOnHoverDelay: number;
534
547
  tooltipWindowMargin: number;
535
548
  tooltipReferrerMargin: number;
@@ -547,6 +560,7 @@ declare class Button extends LktItem implements ButtonConfig {
547
560
  splitClass?: string;
548
561
  prop?: LktObject;
549
562
  onClick?: Function | undefined;
563
+ onConfirm?: Function | undefined;
550
564
  constructor(data?: Partial<ButtonConfig>);
551
565
  }
552
566
 
@@ -635,6 +649,10 @@ declare enum TableRowType {
635
649
 
636
650
  type ValidTableRowTypeValue = TableRowType | ((...args: any[]) => TableRowType) | undefined;
637
651
 
652
+ type ValidDragConfig = DragConfig | undefined;
653
+
654
+ type ValidPaginatorConfig = PaginatorConfig | undefined;
655
+
638
656
  interface TableConfig {
639
657
  modelValue: LktObject[];
640
658
  type?: TableType;
@@ -653,11 +671,8 @@ interface TableConfig {
653
671
  sortable?: boolean;
654
672
  sorter?: Function;
655
673
  initialSorting?: boolean;
656
- draggableChecker?: Function;
657
- checkValidDrag?: Function;
658
- renderDrag?: boolean | Function;
659
- disabledDrag?: boolean | Function;
660
- draggableItemKey?: string;
674
+ drag?: ValidDragConfig;
675
+ paginator?: ValidPaginatorConfig;
661
676
  header?: HeaderConfig;
662
677
  title?: string;
663
678
  titleTag?: string;
@@ -666,40 +681,29 @@ interface TableConfig {
666
681
  saveButton?: ButtonConfig;
667
682
  createButton?: ButtonConfig;
668
683
  dropButton?: ButtonConfig;
684
+ hiddenSave?: boolean;
669
685
  wrapContentTag?: string;
670
686
  wrapContentClass?: string;
671
687
  itemsContainerClass?: string;
672
- hiddenSave?: boolean;
673
- saveDisabled?: boolean;
674
- saveValidator?: Function;
675
- saveConfirm?: string;
676
- confirmData?: LktObject;
677
- saveResource?: string;
678
- saveResourceData?: LktObject;
679
- saveTooltipEngine?: string;
680
- splitSave?: boolean;
681
- saveText?: string;
682
688
  createText?: string;
683
689
  createIcon?: string;
684
690
  createRoute?: string;
691
+ createDisabled?: boolean;
692
+ createEnabledValidator?: Function;
685
693
  dropText?: string;
686
694
  dropIcon?: string;
695
+ dropConfirm?: string;
696
+ dropResource?: string;
687
697
  editText?: string;
688
698
  editIcon?: string;
689
699
  editLink?: string;
690
700
  editModeText?: string;
691
701
  switchEditionEnabled?: boolean;
692
- createDisabled?: boolean;
693
- dropConfirm?: string;
694
- dropResource?: string;
695
702
  addNavigation?: boolean;
696
- createEnabledValidator?: Function;
697
703
  newValueGenerator?: Function;
698
704
  requiredItemsForTopCreate?: number;
699
705
  requiredItemsForBottomCreate?: number;
700
706
  slotItemVar?: string;
701
- modal?: string;
702
- modalData?: LktObject;
703
707
  }
704
708
 
705
709
  declare class LktStrictItem extends LktItem {
@@ -779,11 +783,8 @@ declare class Table extends LktItem implements TableConfig {
779
783
  sortable?: boolean;
780
784
  sorter?: Function;
781
785
  initialSorting?: boolean;
782
- draggableChecker?: Function;
783
- checkValidDrag?: Function;
784
- renderDrag?: boolean | Function;
785
- disabledDrag?: boolean | Function;
786
- draggableItemKey?: string;
786
+ drag?: ValidDragConfig;
787
+ paginator?: ValidPaginatorConfig;
787
788
  header?: HeaderConfig;
788
789
  title?: string;
789
790
  titleTag?: string;
@@ -792,19 +793,10 @@ declare class Table extends LktItem implements TableConfig {
792
793
  saveButton?: ButtonConfig;
793
794
  createButton?: ButtonConfig;
794
795
  dropButton?: ButtonConfig;
796
+ hiddenSave?: boolean;
795
797
  wrapContentTag?: string;
796
798
  wrapContentClass?: string;
797
799
  itemsContainerClass?: string;
798
- hiddenSave?: boolean;
799
- saveDisabled?: boolean;
800
- saveValidator?: Function;
801
- saveConfirm?: string;
802
- confirmData?: LktObject;
803
- saveResource?: string;
804
- saveResourceData?: LktObject;
805
- saveTooltipEngine?: string;
806
- splitSave?: boolean;
807
- saveText?: string;
808
800
  createText?: string;
809
801
  createIcon?: string;
810
802
  createRoute?: string;
@@ -824,8 +816,6 @@ declare class Table extends LktItem implements TableConfig {
824
816
  requiredItemsForTopCreate?: number;
825
817
  requiredItemsForBottomCreate?: number;
826
818
  slotItemVar?: string;
827
- modal?: string;
828
- modalData?: LktObject;
829
819
  constructor(data?: Partial<TableConfig>);
830
820
  }
831
821
 
@@ -834,6 +824,11 @@ declare enum SortDirection {
834
824
  Desc = "desc"
835
825
  }
836
826
 
827
+ declare enum ToggleMode {
828
+ Lazy = "lazy",
829
+ Ever = "ever"
830
+ }
831
+
837
832
  type ScanPropTarget = string | number | undefined | Function;
838
833
 
839
834
  type ValidCustomSlot = string | Component | undefined;
@@ -841,6 +836,7 @@ type ValidCustomSlot = string | Component | undefined;
841
836
  type ValidScanPropTarget = ScanPropTarget | ((...args: any[]) => ScanPropTarget);
842
837
 
843
838
  declare const extractPropValue: (needle: ValidScanPropTarget, haystack: LktObject) => ValidScanPropTarget;
839
+ declare const extractI18nValue: (needle: string | number) => any;
844
840
 
845
841
  /**
846
842
  * Export common interfaces
@@ -851,4 +847,4 @@ declare function getDefaultValues<T>(cls: {
851
847
  lktDefaultValues: (keyof T)[];
852
848
  }): Partial<T>;
853
849
 
854
- 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, 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 ValidFieldMinMax, type ValidFieldValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, extractPropValue, getDefaultValues };
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 };
package/dist/index.js CHANGED
@@ -1,3 +1,23 @@
1
+ // src/settings/LktSettings.ts
2
+ var LktSettings = class _LktSettings {
3
+ static debug = false;
4
+ static version = "0.0.1";
5
+ static defaultConfirmButton = {
6
+ text: "Confirm"
7
+ };
8
+ static defaultCancelButton = {
9
+ text: "Cancel"
10
+ };
11
+ static setDefaultConfirmButton(button) {
12
+ _LktSettings.defaultConfirmButton = button;
13
+ return _LktSettings;
14
+ }
15
+ static setDefaultCancelButton(button) {
16
+ _LktSettings.defaultCancelButton = button;
17
+ return _LktSettings;
18
+ }
19
+ };
20
+
1
21
  // src/instances/LktItem.ts
2
22
  var skipDataProps = [
3
23
  "lktDateProps",
@@ -328,7 +348,6 @@ var Button = class extends LktItem {
328
348
  "disabled",
329
349
  "loading",
330
350
  "wrapContent",
331
- "split",
332
351
  "splitIcon",
333
352
  "resource",
334
353
  "resourceData",
@@ -343,7 +362,6 @@ var Button = class extends LktItem {
343
362
  "iconDot",
344
363
  "iconEnd",
345
364
  "img",
346
- "tooltip",
347
365
  "showTooltipOnHoverDelay",
348
366
  "tooltipWindowMargin",
349
367
  "tooltipReferrerMargin",
@@ -360,7 +378,8 @@ var Button = class extends LktItem {
360
378
  "tooltipClass",
361
379
  "splitClass",
362
380
  "prop",
363
- "onClick"
381
+ "onClick",
382
+ "onConfirm"
364
383
  ];
365
384
  type = "button" /* Button */;
366
385
  name = generateRandomString2(10);
@@ -371,7 +390,6 @@ var Button = class extends LktItem {
371
390
  disabled = false;
372
391
  loading = false;
373
392
  wrapContent = false;
374
- split = false;
375
393
  splitIcon = "";
376
394
  resource = "";
377
395
  resourceData = {};
@@ -386,7 +404,6 @@ var Button = class extends LktItem {
386
404
  iconDot = false;
387
405
  iconEnd = "";
388
406
  img = "";
389
- tooltip = false;
390
407
  showTooltipOnHoverDelay = 0;
391
408
  tooltipWindowMargin = 0;
392
409
  tooltipReferrerMargin = 0;
@@ -405,6 +422,7 @@ var Button = class extends LktItem {
405
422
  prop = {};
406
423
  // Event management
407
424
  onClick = void 0;
425
+ onConfirm = void 0;
408
426
  constructor(data = {}) {
409
427
  super();
410
428
  this.feed(data);
@@ -663,11 +681,8 @@ var Table = class extends LktItem {
663
681
  "sortable",
664
682
  "sorter",
665
683
  "initialSorting",
666
- "draggableChecker",
667
- "checkValidDrag",
668
- "renderDrag",
669
- "disabledDrag",
670
- "draggableItemKey",
684
+ "drag",
685
+ "paginator",
671
686
  "header",
672
687
  "title",
673
688
  "titleTag",
@@ -680,15 +695,6 @@ var Table = class extends LktItem {
680
695
  "wrapContentClass",
681
696
  "itemsContainerClass",
682
697
  "hiddenSave",
683
- "saveDisabled",
684
- "saveValidator",
685
- "saveConfirm",
686
- "confirmData",
687
- "saveResource",
688
- "saveResourceData",
689
- "saveTooltipEngine",
690
- "splitSave",
691
- "saveText",
692
698
  "createText",
693
699
  "createIcon",
694
700
  "createRoute",
@@ -707,9 +713,7 @@ var Table = class extends LktItem {
707
713
  "newValueGenerator",
708
714
  "requiredItemsForTopCreate",
709
715
  "requiredItemsForBottomCreate",
710
- "slotItemVar",
711
- "modal",
712
- "modalData"
716
+ "slotItemVar"
713
717
  ];
714
718
  // Data
715
719
  modelValue = [];
@@ -732,12 +736,10 @@ var Table = class extends LktItem {
732
736
  sortable = false;
733
737
  sorter = void 0;
734
738
  initialSorting = false;
735
- // Drag (Old)
736
- draggableChecker;
737
- checkValidDrag;
738
- renderDrag;
739
- disabledDrag;
740
- draggableItemKey;
739
+ // Drag
740
+ drag = void 0;
741
+ // Pagination
742
+ paginator = void 0;
741
743
  // New proposed prop: header
742
744
  header;
743
745
  // Replaces:
@@ -745,23 +747,14 @@ var Table = class extends LktItem {
745
747
  titleTag = "h2";
746
748
  titleIcon = "";
747
749
  headerClass = "";
748
- // New proposed prop: saveButton
750
+ // Buttons
749
751
  saveButton = {};
750
752
  createButton = {};
751
753
  dropButton = {};
754
+ hiddenSave = false;
752
755
  wrapContentTag = "div";
753
756
  wrapContentClass = "";
754
757
  itemsContainerClass = "";
755
- hiddenSave = false;
756
- saveDisabled = false;
757
- saveValidator = void 0;
758
- saveConfirm = "";
759
- confirmData = {};
760
- saveResource = "";
761
- saveResourceData = {};
762
- saveTooltipEngine = "absolute" /* Absolute */;
763
- splitSave = false;
764
- saveText = "";
765
758
  createText = "";
766
759
  createIcon = "";
767
760
  createRoute = "";
@@ -781,8 +774,6 @@ var Table = class extends LktItem {
781
774
  requiredItemsForTopCreate = 0;
782
775
  requiredItemsForBottomCreate = 0;
783
776
  slotItemVar = "item";
784
- modal = "";
785
- modalData = {};
786
777
  constructor(data = {}) {
787
778
  super();
788
779
  this.feed(data);
@@ -835,12 +826,20 @@ var ToggleMode = /* @__PURE__ */ ((ToggleMode2) => {
835
826
  })(ToggleMode || {});
836
827
 
837
828
  // src/functions/extract-data-functions.ts
829
+ import { __ } from "lkt-i18n";
838
830
  var extractPropValue = (needle, haystack) => {
839
831
  if (typeof needle === "string" && needle.startsWith("prop:")) {
840
832
  return haystack[needle.substring(5)];
841
833
  }
842
834
  return needle;
843
835
  };
836
+ var extractI18nValue = (needle) => {
837
+ let txt = String(needle);
838
+ if (txt.startsWith("__:")) {
839
+ return __(txt.substring(3));
840
+ }
841
+ return txt;
842
+ };
844
843
 
845
844
  // src/index.ts
846
845
  function getDefaultValues(cls) {
@@ -867,6 +866,7 @@ export {
867
866
  FieldAutoValidationTrigger,
868
867
  FieldType,
869
868
  LktItem,
869
+ LktSettings,
870
870
  LktStrictItem,
871
871
  Modal,
872
872
  ModalCallbackAction,
@@ -886,6 +886,7 @@ export {
886
886
  TooltipLocationX,
887
887
  TooltipLocationY,
888
888
  TooltipPositionEngine,
889
+ extractI18nValue,
889
890
  extractPropValue,
890
891
  getDefaultValues
891
892
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-vue-kernel",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "LKT Vue Kernel",
5
5
  "keywords": [
6
6
  "lkt",
@@ -35,6 +35,8 @@
35
35
  "node": ">=18"
36
36
  },
37
37
  "dependencies": {
38
+ "lkt-data-state": "^1.0.10",
39
+ "lkt-i18n": "^1.0.6",
38
40
  "lkt-string-tools": "^1.0.8",
39
41
  "vue": "^3.5.13",
40
42
  "vue-router": "^4.5.0"