lkt-vue-kernel 1.0.43 → 1.0.45
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 +205 -138
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,9 @@ declare const enum ButtonType {
|
|
|
20
20
|
SplitEver = "split-ever",// Split button, contents generated each time it's clicked
|
|
21
21
|
Tooltip = "tooltip",// Tooltip button, content always generated
|
|
22
22
|
TooltipLazy = "tooltip-lazy",// Tooltip button, contents generated after first open
|
|
23
|
-
TooltipEver = "tooltip-ever"
|
|
23
|
+
TooltipEver = "tooltip-ever",// Tooltip button, contents generated each time it's clicked
|
|
24
|
+
FileUpload = "file-upload",// File upload mode. Enables HTTP upload by lkt-field
|
|
25
|
+
ImageUpload = "image-upload"
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
declare enum AnchorType {
|
|
@@ -81,6 +83,8 @@ interface EventsConfig {
|
|
|
81
83
|
click?: Function | undefined;
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
type ValidTextValue = string | number | undefined;
|
|
87
|
+
|
|
84
88
|
interface AnchorConfig {
|
|
85
89
|
type?: AnchorType;
|
|
86
90
|
to?: RouteLocationRaw | string;
|
|
@@ -93,6 +97,7 @@ interface AnchorConfig {
|
|
|
93
97
|
confirmData?: ModalConfig;
|
|
94
98
|
imposter?: boolean;
|
|
95
99
|
external?: boolean;
|
|
100
|
+
text?: ValidTextValue;
|
|
96
101
|
events?: EventsConfig | undefined;
|
|
97
102
|
onClick?: Function | undefined;
|
|
98
103
|
}
|
|
@@ -125,6 +130,7 @@ declare class Anchor extends LktItem implements AnchorConfig {
|
|
|
125
130
|
confirmData: LktObject;
|
|
126
131
|
imposter: boolean;
|
|
127
132
|
external: boolean;
|
|
133
|
+
text?: ValidTextValue;
|
|
128
134
|
events?: EventsConfig | undefined;
|
|
129
135
|
getHref(): string;
|
|
130
136
|
constructor(data?: Partial<AnchorConfig>);
|
|
@@ -133,6 +139,7 @@ declare class Anchor extends LktItem implements AnchorConfig {
|
|
|
133
139
|
interface IsDisabledCheckerArgs {
|
|
134
140
|
value?: any;
|
|
135
141
|
dataState?: DataState;
|
|
142
|
+
prop: LktObject;
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
type IsDisabledChecker = ((args?: IsDisabledCheckerArgs) => boolean);
|
|
@@ -192,12 +199,11 @@ interface TooltipConfig {
|
|
|
192
199
|
showOnReferrerHover?: boolean;
|
|
193
200
|
showOnReferrerHoverDelay?: number;
|
|
194
201
|
hideOnReferrerLeave?: boolean;
|
|
202
|
+
hideOnReferrerLeaveDelay?: number;
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
type ValidButtonDot = boolean | string | number;
|
|
198
206
|
|
|
199
|
-
type ValidTextValue = string | number | undefined;
|
|
200
|
-
|
|
201
207
|
interface ButtonConfig {
|
|
202
208
|
type?: ButtonType;
|
|
203
209
|
name?: string;
|
|
@@ -225,7 +231,7 @@ interface ButtonConfig {
|
|
|
225
231
|
resourceData?: LktObject;
|
|
226
232
|
modal?: ValidModalName;
|
|
227
233
|
modalKey?: ValidModalKey;
|
|
228
|
-
modalData?: Partial<ModalConfig
|
|
234
|
+
modalData?: Partial<ModalConfig> | Function;
|
|
229
235
|
confirmModal?: ValidModalName;
|
|
230
236
|
confirmModalKey?: ValidModalKey;
|
|
231
237
|
confirmData?: Partial<ModalConfig>;
|
|
@@ -293,6 +299,22 @@ declare class LktSettings {
|
|
|
293
299
|
details?: string;
|
|
294
300
|
icon?: string;
|
|
295
301
|
}): void;
|
|
302
|
+
static defaultUploadSuccessText: string;
|
|
303
|
+
static defaultUploadSuccessDetails: string;
|
|
304
|
+
static defaultUploadSuccessIcon: string;
|
|
305
|
+
static setDefaultUploadSuccess(config: {
|
|
306
|
+
text?: string;
|
|
307
|
+
details?: string;
|
|
308
|
+
icon?: string;
|
|
309
|
+
}): void;
|
|
310
|
+
static defaultUploadErrorText: string;
|
|
311
|
+
static defaultUploadErrorDetails: string;
|
|
312
|
+
static defaultUploadErrorIcon: string;
|
|
313
|
+
static setDefaultUploadError(config: {
|
|
314
|
+
text?: string;
|
|
315
|
+
details?: string;
|
|
316
|
+
icon?: string;
|
|
317
|
+
}): void;
|
|
296
318
|
static defaultSaveButton: Partial<ButtonConfig>;
|
|
297
319
|
static setDefaultSaveButton(button: Partial<ButtonConfig>, override?: boolean): typeof LktSettings;
|
|
298
320
|
static defaultConfirmButton: Partial<ButtonConfig>;
|
|
@@ -390,6 +412,12 @@ interface AccordionConfig {
|
|
|
390
412
|
toggleIconAtEnd?: boolean;
|
|
391
413
|
}
|
|
392
414
|
|
|
415
|
+
interface BooleanFieldConfig {
|
|
416
|
+
label?: ValidTextValue;
|
|
417
|
+
icon?: ValidTextValue;
|
|
418
|
+
labelIcon?: ValidTextValue;
|
|
419
|
+
}
|
|
420
|
+
|
|
393
421
|
declare enum ColumnType {
|
|
394
422
|
None = "",
|
|
395
423
|
Field = "field",
|
|
@@ -507,6 +535,10 @@ interface OptionsConfig {
|
|
|
507
535
|
http?: HttpCallConfig;
|
|
508
536
|
}
|
|
509
537
|
|
|
538
|
+
interface FieldReadModeConfig {
|
|
539
|
+
textMaxLength?: number;
|
|
540
|
+
}
|
|
541
|
+
|
|
510
542
|
interface FieldConfig {
|
|
511
543
|
modelValue?: ValidFieldValue;
|
|
512
544
|
type?: FieldType;
|
|
@@ -520,8 +552,7 @@ interface FieldConfig {
|
|
|
520
552
|
autocomplete?: boolean;
|
|
521
553
|
disabled?: boolean | Function;
|
|
522
554
|
readonly?: boolean;
|
|
523
|
-
|
|
524
|
-
allowReadModeSwitch?: boolean;
|
|
555
|
+
hidden?: boolean;
|
|
525
556
|
tabindex?: ValidTabIndex;
|
|
526
557
|
mandatory?: boolean;
|
|
527
558
|
showPassword?: boolean;
|
|
@@ -554,13 +585,19 @@ interface FieldConfig {
|
|
|
554
585
|
download?: string | Function;
|
|
555
586
|
modal?: string | Function;
|
|
556
587
|
modalKey?: string | number | Function;
|
|
557
|
-
modalData?: LktObject;
|
|
588
|
+
modalData?: LktObject | Function;
|
|
558
589
|
itemType?: string;
|
|
559
590
|
optionValueType?: string;
|
|
591
|
+
configOn?: BooleanFieldConfig;
|
|
592
|
+
configOff?: BooleanFieldConfig;
|
|
593
|
+
readMode?: boolean;
|
|
594
|
+
allowReadModeSwitch?: boolean;
|
|
595
|
+
readModeConfig?: FieldReadModeConfig;
|
|
560
596
|
prop?: LktObject;
|
|
561
597
|
validation?: FieldValidationConfig;
|
|
562
598
|
optionsConfig?: OptionsConfig;
|
|
563
599
|
fileUploadHttp?: HttpCallConfig;
|
|
600
|
+
fileUploadButton?: ButtonConfig;
|
|
564
601
|
tooltipConfig?: TooltipConfig;
|
|
565
602
|
customButtonText?: string;
|
|
566
603
|
customButtonClass?: string;
|
|
@@ -570,122 +607,6 @@ interface FieldConfig {
|
|
|
570
607
|
};
|
|
571
608
|
}
|
|
572
609
|
|
|
573
|
-
declare class SafeString {
|
|
574
|
-
private readonly value;
|
|
575
|
-
constructor(input: ValidSafeStringValue);
|
|
576
|
-
getValue(...args: any[]): string;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
type ValidSafeStringValue = string | ((...args: any[]) => string) | undefined | SafeString;
|
|
580
|
-
|
|
581
|
-
declare class Field extends LktItem implements FieldConfig {
|
|
582
|
-
static lktDefaultValues: (keyof FieldConfig)[];
|
|
583
|
-
modelValue: ValidFieldValue;
|
|
584
|
-
type: FieldType;
|
|
585
|
-
valid: boolean | undefined;
|
|
586
|
-
placeholder: string;
|
|
587
|
-
searchPlaceholder: string;
|
|
588
|
-
label: string;
|
|
589
|
-
labelIcon: string;
|
|
590
|
-
labelIconAtEnd: boolean;
|
|
591
|
-
name: string;
|
|
592
|
-
autocomplete: boolean;
|
|
593
|
-
disabled: boolean;
|
|
594
|
-
readonly: boolean;
|
|
595
|
-
readMode: boolean;
|
|
596
|
-
allowReadModeSwitch: boolean;
|
|
597
|
-
tabindex: ValidTabIndex;
|
|
598
|
-
mandatory: boolean;
|
|
599
|
-
showPassword: boolean;
|
|
600
|
-
canClear: boolean;
|
|
601
|
-
canUndo: boolean;
|
|
602
|
-
canI18n: boolean;
|
|
603
|
-
canStep: boolean;
|
|
604
|
-
canTag: boolean;
|
|
605
|
-
mandatoryMessage: string;
|
|
606
|
-
infoMessage: string;
|
|
607
|
-
errorMessage: string;
|
|
608
|
-
min: ValidFieldMinMax;
|
|
609
|
-
max: ValidFieldMinMax;
|
|
610
|
-
step: number | string;
|
|
611
|
-
enableAutoNumberFix: boolean;
|
|
612
|
-
emptyValueSlot: string;
|
|
613
|
-
optionSlot: undefined;
|
|
614
|
-
valueSlot: undefined;
|
|
615
|
-
editSlot: undefined;
|
|
616
|
-
slotData: LktObject;
|
|
617
|
-
featuredButton: string;
|
|
618
|
-
infoButtonEllipsis: boolean;
|
|
619
|
-
fileName: string;
|
|
620
|
-
customButtonText: string;
|
|
621
|
-
customButtonClass: string;
|
|
622
|
-
options: string | Option[];
|
|
623
|
-
multiple: boolean;
|
|
624
|
-
multipleDisplay: MultipleOptionsDisplay;
|
|
625
|
-
multipleDisplayEdition: MultipleOptionsDisplay;
|
|
626
|
-
searchable: boolean;
|
|
627
|
-
icon: string | Function;
|
|
628
|
-
download: string | Function;
|
|
629
|
-
modal: string | Function;
|
|
630
|
-
modalKey: string | number | Function;
|
|
631
|
-
modalData: LktObject;
|
|
632
|
-
validation: FieldValidationConfig;
|
|
633
|
-
prop?: LktObject;
|
|
634
|
-
optionValueType: string;
|
|
635
|
-
optionsConfig?: OptionsConfig;
|
|
636
|
-
fileUploadHttp?: HttpCallConfig;
|
|
637
|
-
tooltipConfig?: TooltipConfig;
|
|
638
|
-
constructor(data?: Partial<FieldConfig>);
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
declare class Button extends LktItem implements ButtonConfig {
|
|
642
|
-
lktAllowUndefinedProps: string[];
|
|
643
|
-
static lktDefaultValues: (keyof ButtonConfig)[];
|
|
644
|
-
type: ButtonType;
|
|
645
|
-
name: string;
|
|
646
|
-
class: string;
|
|
647
|
-
containerClass: string;
|
|
648
|
-
value: string;
|
|
649
|
-
disabled: ValidIsDisabledValue;
|
|
650
|
-
loading: boolean;
|
|
651
|
-
wrapContent: boolean;
|
|
652
|
-
splitIcon: string;
|
|
653
|
-
resource: string;
|
|
654
|
-
resourceData: LktObject;
|
|
655
|
-
modal: ValidModalName;
|
|
656
|
-
modalKey: ValidModalKey;
|
|
657
|
-
modalData: Partial<ModalConfig>;
|
|
658
|
-
confirmModal: ValidModalName;
|
|
659
|
-
confirmModalKey: ValidModalKey;
|
|
660
|
-
confirmData: Partial<ModalConfig>;
|
|
661
|
-
modalCallbacks?: Array<ModalCallbackConfig>;
|
|
662
|
-
text: ValidTextValue;
|
|
663
|
-
textOn: ValidTextValue;
|
|
664
|
-
textOff: ValidTextValue;
|
|
665
|
-
iconOn: ValidTextValue;
|
|
666
|
-
iconOff: ValidTextValue;
|
|
667
|
-
iconEndOn: ValidTextValue;
|
|
668
|
-
iconEndOff: ValidTextValue;
|
|
669
|
-
icon: string;
|
|
670
|
-
dot: ValidButtonDot;
|
|
671
|
-
iconEnd: string;
|
|
672
|
-
img: string;
|
|
673
|
-
showTooltipOnHoverDelay: number;
|
|
674
|
-
checked: boolean;
|
|
675
|
-
clickRef?: Element | VueElement;
|
|
676
|
-
openTooltip: boolean;
|
|
677
|
-
tabindex: ValidTabIndex;
|
|
678
|
-
anchor?: AnchorConfig | Anchor;
|
|
679
|
-
showTooltipOnHover?: boolean;
|
|
680
|
-
hideTooltipOnLeave?: boolean;
|
|
681
|
-
splitClass?: string;
|
|
682
|
-
tooltip?: TooltipConfig;
|
|
683
|
-
prop?: LktObject;
|
|
684
|
-
events?: EventsConfig | undefined;
|
|
685
|
-
constructor(data?: Partial<ButtonConfig>);
|
|
686
|
-
isDisabled(): boolean | undefined;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
610
|
interface ColumnConfig {
|
|
690
611
|
type: ColumnType;
|
|
691
612
|
key: string;
|
|
@@ -700,11 +621,9 @@ interface ColumnConfig {
|
|
|
700
621
|
isForRowKey?: boolean;
|
|
701
622
|
extractTitleFromColumn?: string;
|
|
702
623
|
slotData?: LktObject;
|
|
703
|
-
field?:
|
|
704
|
-
anchor?:
|
|
705
|
-
button?:
|
|
706
|
-
link?: ValidSafeStringValue | SafeString;
|
|
707
|
-
action?: Function;
|
|
624
|
+
field?: FieldConfig | undefined;
|
|
625
|
+
anchor?: AnchorConfig | undefined;
|
|
626
|
+
button?: ButtonConfig | undefined;
|
|
708
627
|
}
|
|
709
628
|
|
|
710
629
|
type ValidDrag = boolean | ((item: LktObject) => boolean);
|
|
@@ -723,11 +642,17 @@ declare enum IconType {
|
|
|
723
642
|
Button = "button"
|
|
724
643
|
}
|
|
725
644
|
|
|
645
|
+
declare enum IconPosition {
|
|
646
|
+
Start = "start",
|
|
647
|
+
End = "end"
|
|
648
|
+
}
|
|
649
|
+
|
|
726
650
|
interface IconConfig {
|
|
727
651
|
icon?: ValidTextValue;
|
|
728
652
|
text?: ValidTextValue;
|
|
729
653
|
class?: ValidTextValue;
|
|
730
654
|
type?: IconType;
|
|
655
|
+
position?: IconPosition;
|
|
731
656
|
events?: EventsConfig | undefined;
|
|
732
657
|
}
|
|
733
658
|
|
|
@@ -798,11 +723,17 @@ interface ItemCrudConfig {
|
|
|
798
723
|
notificationType?: NotificationType;
|
|
799
724
|
}
|
|
800
725
|
|
|
726
|
+
declare enum MenuEntryType {
|
|
727
|
+
Anchor = "anchor"
|
|
728
|
+
}
|
|
729
|
+
|
|
801
730
|
interface MenuEntryConfig {
|
|
802
731
|
key?: string;
|
|
732
|
+
type?: MenuEntryType;
|
|
733
|
+
icon?: string;
|
|
734
|
+
anchor?: AnchorConfig;
|
|
803
735
|
href?: string;
|
|
804
736
|
label?: string;
|
|
805
|
-
icon?: string;
|
|
806
737
|
isActiveChecker?: Function | undefined;
|
|
807
738
|
isOpened?: boolean;
|
|
808
739
|
isActive?: boolean;
|
|
@@ -814,6 +745,7 @@ interface MenuEntryConfig {
|
|
|
814
745
|
|
|
815
746
|
interface MenuConfig {
|
|
816
747
|
modelValue?: MenuEntryConfig[];
|
|
748
|
+
http?: HttpCallConfig;
|
|
817
749
|
resource?: string;
|
|
818
750
|
resourceData: LktObject;
|
|
819
751
|
}
|
|
@@ -886,14 +818,10 @@ declare class Column extends LktItem implements ColumnConfig {
|
|
|
886
818
|
isForRowKey: boolean;
|
|
887
819
|
extractTitleFromColumn: string;
|
|
888
820
|
slotData: LktObject;
|
|
889
|
-
field:
|
|
890
|
-
anchor:
|
|
891
|
-
button:
|
|
892
|
-
link: ValidSafeStringValue | SafeString | undefined;
|
|
893
|
-
action?: Function;
|
|
821
|
+
field: FieldConfig | undefined;
|
|
822
|
+
anchor: AnchorConfig | undefined;
|
|
823
|
+
button: ButtonConfig | undefined;
|
|
894
824
|
constructor(data?: Partial<ColumnConfig>);
|
|
895
|
-
getHref(item: LktObject): string;
|
|
896
|
-
doAction(item: LktObject): any;
|
|
897
825
|
}
|
|
898
826
|
|
|
899
827
|
declare enum TablePermission {
|
|
@@ -1020,6 +948,17 @@ declare class LktStrictItem extends LktItem {
|
|
|
1020
948
|
lktStrictItem: boolean;
|
|
1021
949
|
}
|
|
1022
950
|
|
|
951
|
+
declare class LktColor extends LktStrictItem {
|
|
952
|
+
r: number;
|
|
953
|
+
g: number;
|
|
954
|
+
b: number;
|
|
955
|
+
a: number;
|
|
956
|
+
constructor(data: LktObject);
|
|
957
|
+
static fromHexColor(color: string): LktColor;
|
|
958
|
+
toString(): string;
|
|
959
|
+
getContrastFontColor(): "#000000" | "#ffffff";
|
|
960
|
+
}
|
|
961
|
+
|
|
1023
962
|
declare class Accordion extends LktItem implements AccordionConfig {
|
|
1024
963
|
static lktAllowUndefinedProps: string[];
|
|
1025
964
|
static lktDefaultValues: (keyof AccordionConfig)[];
|
|
@@ -1041,6 +980,119 @@ declare class Accordion extends LktItem implements AccordionConfig {
|
|
|
1041
980
|
constructor(data?: Partial<AnchorConfig>);
|
|
1042
981
|
}
|
|
1043
982
|
|
|
983
|
+
declare class Button extends LktItem implements ButtonConfig {
|
|
984
|
+
lktAllowUndefinedProps: string[];
|
|
985
|
+
static lktDefaultValues: (keyof ButtonConfig)[];
|
|
986
|
+
type: ButtonType;
|
|
987
|
+
name: string;
|
|
988
|
+
class: string;
|
|
989
|
+
containerClass: string;
|
|
990
|
+
value: string;
|
|
991
|
+
disabled: ValidIsDisabledValue;
|
|
992
|
+
loading: boolean;
|
|
993
|
+
wrapContent: boolean;
|
|
994
|
+
splitIcon: string;
|
|
995
|
+
resource: string;
|
|
996
|
+
resourceData: LktObject;
|
|
997
|
+
modal: ValidModalName;
|
|
998
|
+
modalKey: ValidModalKey;
|
|
999
|
+
modalData: Partial<ModalConfig> | Function;
|
|
1000
|
+
confirmModal: ValidModalName;
|
|
1001
|
+
confirmModalKey: ValidModalKey;
|
|
1002
|
+
confirmData: Partial<ModalConfig>;
|
|
1003
|
+
modalCallbacks?: Array<ModalCallbackConfig>;
|
|
1004
|
+
text: ValidTextValue;
|
|
1005
|
+
textOn: ValidTextValue;
|
|
1006
|
+
textOff: ValidTextValue;
|
|
1007
|
+
iconOn: ValidTextValue;
|
|
1008
|
+
iconOff: ValidTextValue;
|
|
1009
|
+
iconEndOn: ValidTextValue;
|
|
1010
|
+
iconEndOff: ValidTextValue;
|
|
1011
|
+
icon: string;
|
|
1012
|
+
dot: ValidButtonDot;
|
|
1013
|
+
iconEnd: string;
|
|
1014
|
+
img: string;
|
|
1015
|
+
showTooltipOnHoverDelay: number;
|
|
1016
|
+
checked: boolean;
|
|
1017
|
+
clickRef?: Element | VueElement;
|
|
1018
|
+
openTooltip: boolean;
|
|
1019
|
+
tabindex: ValidTabIndex;
|
|
1020
|
+
anchor?: AnchorConfig | Anchor;
|
|
1021
|
+
showTooltipOnHover?: boolean;
|
|
1022
|
+
hideTooltipOnLeave?: boolean;
|
|
1023
|
+
splitClass?: string;
|
|
1024
|
+
tooltip?: TooltipConfig;
|
|
1025
|
+
prop?: LktObject;
|
|
1026
|
+
events?: EventsConfig | undefined;
|
|
1027
|
+
constructor(data?: Partial<ButtonConfig>);
|
|
1028
|
+
isDisabled(): boolean | undefined;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
declare class Field extends LktItem implements FieldConfig {
|
|
1032
|
+
static lktDefaultValues: (keyof FieldConfig)[];
|
|
1033
|
+
modelValue: ValidFieldValue;
|
|
1034
|
+
type: FieldType;
|
|
1035
|
+
valid: boolean | undefined;
|
|
1036
|
+
placeholder: string;
|
|
1037
|
+
searchPlaceholder: string;
|
|
1038
|
+
label: string;
|
|
1039
|
+
labelIcon: string;
|
|
1040
|
+
labelIconAtEnd: boolean;
|
|
1041
|
+
name: string;
|
|
1042
|
+
autocomplete: boolean;
|
|
1043
|
+
disabled: boolean;
|
|
1044
|
+
readonly: boolean;
|
|
1045
|
+
hidden: boolean;
|
|
1046
|
+
tabindex: ValidTabIndex;
|
|
1047
|
+
mandatory: boolean;
|
|
1048
|
+
showPassword: boolean;
|
|
1049
|
+
canClear: boolean;
|
|
1050
|
+
canUndo: boolean;
|
|
1051
|
+
canI18n: boolean;
|
|
1052
|
+
canStep: boolean;
|
|
1053
|
+
canTag: boolean;
|
|
1054
|
+
mandatoryMessage: string;
|
|
1055
|
+
infoMessage: string;
|
|
1056
|
+
errorMessage: string;
|
|
1057
|
+
min: ValidFieldMinMax;
|
|
1058
|
+
max: ValidFieldMinMax;
|
|
1059
|
+
step: number | string;
|
|
1060
|
+
enableAutoNumberFix: boolean;
|
|
1061
|
+
emptyValueSlot: string;
|
|
1062
|
+
optionSlot: undefined;
|
|
1063
|
+
valueSlot: undefined;
|
|
1064
|
+
editSlot: undefined;
|
|
1065
|
+
slotData: LktObject;
|
|
1066
|
+
featuredButton: string;
|
|
1067
|
+
infoButtonEllipsis: boolean;
|
|
1068
|
+
fileName: string;
|
|
1069
|
+
customButtonText: string;
|
|
1070
|
+
customButtonClass: string;
|
|
1071
|
+
options: string | Option[];
|
|
1072
|
+
multiple: boolean;
|
|
1073
|
+
multipleDisplay: MultipleOptionsDisplay;
|
|
1074
|
+
multipleDisplayEdition: MultipleOptionsDisplay;
|
|
1075
|
+
searchable: boolean;
|
|
1076
|
+
icon: string | Function;
|
|
1077
|
+
download: string | Function;
|
|
1078
|
+
modal: string | Function;
|
|
1079
|
+
modalKey: string | number | Function;
|
|
1080
|
+
modalData: LktObject | Function;
|
|
1081
|
+
validation: FieldValidationConfig;
|
|
1082
|
+
configOn?: BooleanFieldConfig;
|
|
1083
|
+
configOff?: BooleanFieldConfig;
|
|
1084
|
+
readMode?: boolean;
|
|
1085
|
+
allowReadModeSwitch: boolean;
|
|
1086
|
+
readModeConfig?: FieldReadModeConfig;
|
|
1087
|
+
prop?: LktObject;
|
|
1088
|
+
optionValueType: string;
|
|
1089
|
+
optionsConfig?: OptionsConfig;
|
|
1090
|
+
fileUploadHttp?: HttpCallConfig;
|
|
1091
|
+
fileUploadButton: ButtonConfig;
|
|
1092
|
+
tooltipConfig?: TooltipConfig;
|
|
1093
|
+
constructor(data?: Partial<FieldConfig>);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1044
1096
|
declare enum ValidationCode {
|
|
1045
1097
|
MinStringLength = "min-str",
|
|
1046
1098
|
MinNumber = "min-num",
|
|
@@ -1103,6 +1155,7 @@ declare class Icon extends LktItem implements IconConfig {
|
|
|
1103
1155
|
text?: ValidTextValue;
|
|
1104
1156
|
class?: ValidTextValue;
|
|
1105
1157
|
type?: IconType;
|
|
1158
|
+
position?: IconPosition;
|
|
1106
1159
|
events?: EventsConfig | undefined;
|
|
1107
1160
|
constructor(data?: Partial<IconConfig>);
|
|
1108
1161
|
}
|
|
@@ -1144,6 +1197,7 @@ declare class ItemCrud extends LktItem implements ItemCrudConfig {
|
|
|
1144
1197
|
declare class Menu extends LktItem implements MenuConfig {
|
|
1145
1198
|
static lktDefaultValues: (keyof MenuConfig)[];
|
|
1146
1199
|
modelValue?: MenuEntryConfig[];
|
|
1200
|
+
http?: HttpCallConfig;
|
|
1147
1201
|
resource?: string;
|
|
1148
1202
|
resourceData: LktObject;
|
|
1149
1203
|
constructor(data?: Partial<MenuConfig>);
|
|
@@ -1152,9 +1206,11 @@ declare class Menu extends LktItem implements MenuConfig {
|
|
|
1152
1206
|
declare class MenuEntry extends LktItem implements MenuEntryConfig {
|
|
1153
1207
|
static lktDefaultValues: (keyof MenuEntryConfig)[];
|
|
1154
1208
|
key?: string;
|
|
1209
|
+
type?: MenuEntryType;
|
|
1210
|
+
icon?: string;
|
|
1211
|
+
anchor?: AnchorConfig;
|
|
1155
1212
|
href?: string;
|
|
1156
1213
|
label?: string;
|
|
1157
|
-
icon?: string;
|
|
1158
1214
|
isActiveChecker?: Function | undefined;
|
|
1159
1215
|
isOpened?: boolean;
|
|
1160
1216
|
isActive?: boolean;
|
|
@@ -1318,6 +1374,7 @@ declare class Tooltip extends LktItem implements TooltipConfig {
|
|
|
1318
1374
|
showOnReferrerHover: boolean;
|
|
1319
1375
|
showOnReferrerHoverDelay: number;
|
|
1320
1376
|
hideOnReferrerLeave: boolean;
|
|
1377
|
+
hideOnReferrerLeaveDelay: number;
|
|
1321
1378
|
constructor(data?: Partial<TooltipConfig>);
|
|
1322
1379
|
}
|
|
1323
1380
|
|
|
@@ -1335,8 +1392,18 @@ type ScanPropTarget = string | number | undefined | Function;
|
|
|
1335
1392
|
|
|
1336
1393
|
type ValidCustomSlot = string | Component | undefined;
|
|
1337
1394
|
|
|
1395
|
+
declare class SafeString {
|
|
1396
|
+
private readonly value;
|
|
1397
|
+
constructor(input: ValidSafeStringValue);
|
|
1398
|
+
getValue(...args: any[]): string;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
type ValidSafeStringValue = string | ((...args: any[]) => string) | undefined | SafeString;
|
|
1402
|
+
|
|
1338
1403
|
type ValidScanPropTarget = ScanPropTarget | ((...args: any[]) => ScanPropTarget);
|
|
1339
1404
|
|
|
1405
|
+
declare const getAnchorHref: (anchor: AnchorConfig) => string;
|
|
1406
|
+
|
|
1340
1407
|
declare const extractPropValue: (needle: ValidScanPropTarget, haystack: LktObject) => ValidScanPropTarget;
|
|
1341
1408
|
declare const extractI18nValue: (needle: ValidTextValue) => any;
|
|
1342
1409
|
declare const prepareResourceData: (resourceData: LktObject | undefined, haystack: LktObject) => LktObject;
|
|
@@ -1356,4 +1423,4 @@ declare function getDefaultValues<T>(cls: {
|
|
|
1356
1423
|
lktDefaultValues: (keyof T)[];
|
|
1357
1424
|
}): Partial<T>;
|
|
1358
1425
|
|
|
1359
|
-
export { Accordion, type AccordionConfig, AccordionToggleMode, AccordionType, Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, type EventsConfig, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, FieldValidation, type FieldValidationConfig, FieldValidationType, type HttpCallConfig, Icon, type IconConfig, IconType, Image, type ImageConfig, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Menu, type MenuConfig, MenuEntry, type MenuEntryConfig, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, NotificationType, Option, type OptionConfig, type OptionsConfig, Paginator, type PaginatorConfig, PaginatorType, Progress, type ProgressConfig, ProgressType, ProgressValueFormat, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, Tabs, type TabsConfig, Tag, type TagConfig, TagType, Toast, type ToastConfig, ToastPositionX, ToastType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidButtonDot, 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, type ValidTextValue, ValidationCode, ValidationStatus, booleanFieldTypes, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, fieldTypesWithOptions, fieldTypesWithoutClear, fieldTypesWithoutUndo, fieldsWithMultipleMode, getDefaultValues, lktDebug, prepareResourceData, textFieldTypes, textFieldTypesWithOptions };
|
|
1426
|
+
export { Accordion, type AccordionConfig, AccordionToggleMode, AccordionType, Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, type BooleanFieldConfig, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, type EventsConfig, Field, FieldAutoValidationTrigger, type FieldConfig, type FieldReadModeConfig, FieldType, FieldValidation, type FieldValidationConfig, FieldValidationType, type HttpCallConfig, Icon, type IconConfig, IconPosition, IconType, Image, type ImageConfig, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktColor, LktItem, type LktObject, LktSettings, LktStrictItem, Menu, type MenuConfig, MenuEntry, type MenuEntryConfig, MenuEntryType, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, NotificationType, Option, type OptionConfig, type OptionsConfig, Paginator, type PaginatorConfig, PaginatorType, Progress, type ProgressConfig, ProgressType, ProgressValueFormat, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, Tabs, type TabsConfig, Tag, type TagConfig, TagType, Toast, type ToastConfig, ToastPositionX, ToastType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidButtonDot, 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, type ValidTextValue, ValidationCode, ValidationStatus, booleanFieldTypes, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, fieldTypesWithOptions, fieldTypesWithoutClear, fieldTypesWithoutUndo, fieldsWithMultipleMode, getAnchorHref, getDefaultValues, lktDebug, prepareResourceData, textFieldTypes, textFieldTypesWithOptions };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var U=(u=>(u.Button="button",u.Submit="submit",u.Reset="reset",u.Anchor="anchor",u.Content="content",u.Switch="switch",u.HiddenSwitch="hidden-switch",u.Split="split",u.SplitLazy="split-lazy",u.SplitEver="split-ever",u.Tooltip="tooltip",u.TooltipLazy="tooltip-lazy",u.TooltipEver="tooltip-ever",u))(U||{});var f=(e,t)=>typeof e>"u"?t:{...t,...e};var c=class e{static debugEnabled=!1;static debugMode(t=!0){return e.debugEnabled=t,e}static defaultCreateErrorText="Creation failed";static defaultCreateErrorDetails="An error occurred while creating the item. Please try again.";static defaultCreateErrorIcon="";static setDefaultCreateError(t){e.defaultCreateErrorText=t.text??e.defaultCreateErrorText,e.defaultCreateErrorDetails=t.details??e.defaultCreateErrorDetails,e.defaultCreateErrorIcon=t.icon??e.defaultCreateErrorIcon}static defaultUpdateErrorText="Update failed";static defaultUpdateErrorDetails="An error occurred while updating the item. Please try again.";static defaultUpdateErrorIcon="";static setDefaultUpdateError(t){e.defaultUpdateErrorText=t.text??e.defaultUpdateErrorText,e.defaultUpdateErrorDetails=t.details??e.defaultUpdateErrorDetails,e.defaultUpdateErrorIcon=t.icon??e.defaultUpdateErrorIcon}static defaultDropErrorText="Drop failed";static defaultDropErrorDetails="An error occurred while removing the item. Please try again.";static defaultDropErrorIcon="";static setDefaultDropError(t){e.defaultDropErrorText=t.text??e.defaultDropErrorText,e.defaultDropErrorDetails=t.details??e.defaultDropErrorDetails,e.defaultDropErrorIcon=t.icon??e.defaultDropErrorIcon}static defaultCreateSuccessText="Item created";static defaultCreateSuccessDetails="";static defaultCreateSuccessIcon="";static setDefaultCreateSuccess(t){e.defaultCreateSuccessText=t.text??e.defaultCreateSuccessText,e.defaultCreateSuccessDetails=t.details??e.defaultCreateSuccessDetails,e.defaultCreateSuccessIcon=t.icon??e.defaultCreateSuccessIcon}static defaultUpdateSuccessText="Item updated";static defaultUpdateSuccessDetails="";static defaultUpdateSuccessIcon="";static setDefaultUpdateSuccess(t){e.defaultUpdateSuccessText=t.text??e.defaultUpdateSuccessText,e.defaultUpdateSuccessDetails=t.details??e.defaultUpdateSuccessDetails,e.defaultUpdateSuccessIcon=t.icon??e.defaultUpdateSuccessIcon}static defaultDropSuccessText="Item removed";static defaultDropSuccessDetails="";static defaultDropSuccessIcon="";static setDefaultDropSuccess(t){e.defaultDropSuccessText=t.text??e.defaultDropSuccessText,e.defaultDropSuccessDetails=t.details??e.defaultDropSuccessDetails,e.defaultDropSuccessIcon=t.icon??e.defaultDropSuccessIcon}static defaultSaveButton={text:"Save",icon:"lkt-icn-save"};static setDefaultSaveButton(t,o=!0){return o?e.defaultSaveButton=t:e.defaultSaveButton=f(t,e.defaultSaveButton),e}static defaultConfirmButton={text:"Confirm"};static setDefaultConfirmButton(t,o=!0){return o?e.defaultConfirmButton=t:e.defaultConfirmButton=f(t,e.defaultConfirmButton),e}static defaultCancelButton={text:"Cancel"};static setDefaultCancelButton(t,o=!0){return o?e.defaultCancelButton=t:e.defaultCancelButton=f(t,e.defaultCancelButton),e}static defaultCreateButton={text:"Create",icon:"lkt-icn-save"};static setDefaultCreateButton(t,o=!0){return o?e.defaultCreateButton=t:e.defaultCreateButton=f(t,e.defaultCreateButton),e}static defaultUpdateButton={text:"Update",icon:"lkt-icn-save"};static setDefaultUpdateButton(t,o=!0){return o?e.defaultUpdateButton=t:e.defaultUpdateButton=f(t,e.defaultUpdateButton),e}static defaultDropButton={text:"Drop"};static setDefaultDropButton(t,o=!0){return o?e.defaultDropButton=t:e.defaultDropButton=f(t,e.defaultDropButton),e}static defaultEditModeButton={text:"Edit mode",type:"switch"};static setDefaultEditModeButton(t,o=!0){return o?e.defaultEditModeButton=t:e.defaultEditModeButton=f(t,e.defaultEditModeButton),e}static defaultToggleButton={text:"Toggle",textOn:"Close",textOff:"Show more",type:"hidden-switch"};static setDefaultToggleButton(t,o=!0){return o?e.defaultToggleButton=t:e.defaultToggleButton=f(t,e.defaultToggleButton),e}static defaultLoadMoreButton={text:"Load more",type:"hidden-switch"};static setDefaultLoadMoreButton(t,o=!0){return o?e.defaultLoadMoreButton=t:e.defaultLoadMoreButton=f(t,e.defaultLoadMoreButton),e}static defaultCloseModalIcon="lkt-icn-cancel";static setDefaultCloseModalIcon(t){return e.defaultCloseModalIcon=t,e}static defaultCloseToastIcon="lkt-icn-cancel";static setDefaultCloseToastIcon(t){return e.defaultCloseToastIcon=t,e}static defaultTableSortAscIcon="lkt-icn-arrow-bottom";static defaultTableSortDescIcon="lkt-icn-arrow-top";static setDefaultTableSortAscIcon(t){return e.defaultTableSortAscIcon=t,e}static setDefaultTableSortDescIcon(t){return e.defaultTableSortDescIcon=t,e}static defaultPaginatorFirstButton={text:"",icon:"lkt-icn-angle-double-left"};static defaultPaginatorPrevButton={text:"",icon:"lkt-icn-angle-left"};static defaultPaginatorNextButton={text:"",iconEnd:"lkt-icn-angle-right"};static defaultPaginatorLastButton={text:"",iconEnd:"lkt-icn-angle-double-right"};static setDefaultPaginatorFirstButton(t,o=!0){return o?e.defaultPaginatorFirstButton=t:e.defaultPaginatorFirstButton=f(t,e.defaultPaginatorFirstButton),e}static setDefaultPaginatorPrevButton(t,o=!0){return o?e.defaultPaginatorPrevButton=t:e.defaultPaginatorPrevButton=f(t,e.defaultPaginatorPrevButton),e}static setDefaultPaginatorNextButton(t,o=!0){return o?e.defaultPaginatorNextButton=t:e.defaultPaginatorNextButton=f(t,e.defaultPaginatorNextButton),e}static setDefaultPaginatorLastButton(t,o=!0){return o?e.defaultPaginatorLastButton=t:e.defaultPaginatorLastButton=f(t,e.defaultPaginatorLastButton),e}};var F=(l=>(l.Text="text",l.Email="email",l.Tel="tel",l.Password="password",l.Search="search",l.Number="number",l.Color="color",l.Range="range",l.Textarea="textarea",l.Html="html",l.Date="date",l.File="file",l.Image="image",l.Select="select",l.Check="check",l.Switch="switch",l.Calc="calc",l.Card="card",l.Elements="elements",l))(F||{});var bt=["text","search","select"],ht=["switch","check"],Vt=["switch","check"],kt=["text","search"],Mt=["switch","check"],Bt=["select","color","card"],Dt=["text","email","password"];var St=["lktDateProps","lktStrictItem","lktExcludedProps"],n=class e{static lktAllowUndefinedProps=[];static lktExcludedProps=[];static lktDateProps=[];static lktStrictItem=!1;static lktDefaultValues=[];constructor(t){}feed(t={},o=this){if(typeof t=="object")for(let[r,a]of Object.entries(t))o.assignProp(r,a)}assignProp(t,o){if(!(St.includes(t)||e.lktExcludedProps.includes(t))&&!(e.lktStrictItem&&!this.hasOwnProperty(t))){if(e.lktDateProps.includes(t)){this[t]=new Date(o);return}this[t]=o}}};var k=class extends n{lktStrictItem=!0};var j=(a=>(a.Auto="auto",a.Always="always",a.Lazy="lazy",a.Ever="ever",a))(j||{});var K=(r=>(r.Transform="transform",r.Height="height",r.Display="display",r))(K||{});var M=class extends n{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["modelValue","type","toggleMode","actionButton","toggleButton","toggleOnClickIntro","toggleTimeout","title","icon","class","contentClass","iconRotation","minHeight","iconAtEnd","toggleIconAtEnd"];modelValue=!1;type="auto";toggleMode="height";actionButton={};toggleButton={};toggleOnClickIntro=!1;toggleTimeout=0;title="";icon="";class="";contentClass="";iconRotation="90";minHeight=void 0;iconAtEnd=!1;toggleIconAtEnd=!1;constructor(t={}){super(),this.feed(t)}};var R=(m=>(m.Href="href",m.RouterLink="router-link",m.RouterLinkBack="router-link-back",m.Mail="mail",m.Tel="tel",m.Tab="tab",m.Download="download",m.Action="action",m.Legacy="",m))(R||{});var p=class extends n{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","to","class","isActive","downloadFileName","disabled","onClick","confirmModal","confirmModalKey","confirmData","imposter","external","events"];type="router-link";to="";class="";isActive=!1;downloadFileName="";disabled=!1;onClick=void 0;confirmModal="";confirmModalKey="_";confirmData={};imposter=!1;external=!1;events={};getHref(){let t="";return typeof this.to=="string"&&(t=this.to),"mail"===this.type?`mailto:${t}`:"tel"===this.type?`tel:${t}`:["href","mail","tel","tab","download"].includes(this.type)?t:typeof this.to=="string"&&this.to!==""?this.to:""}constructor(t={}){super(),this.feed(t)}};import{generateRandomString as yt}from"lkt-string-tools";var C=class extends n{lktAllowUndefinedProps=["clickRef","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave"];static lktDefaultValues=["type","name","class","containerClass","value","disabled","loading","wrapContent","splitIcon","resource","resourceData","modal","modalKey","modalData","confirmModal","confirmModalKey","confirmData","modalCallbacks","text","textOn","textOff","icon","iconOn","iconOff","iconEndOn","iconEndOff","dot","iconEnd","img","showTooltipOnHoverDelay","tooltip","checked","clickRef","openTooltip","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave","splitClass","prop","events"];type="button";name=yt(10);class="";containerClass="";value="";disabled=!1;loading=!1;wrapContent=!1;splitIcon="";resource="";resourceData={};modal="";modalKey="_";modalData={};confirmModal="";confirmModalKey="_";confirmData={};modalCallbacks=[];text="";textOn=void 0;textOff=void 0;iconOn=void 0;iconOff=void 0;iconEndOn=void 0;iconEndOff=void 0;icon="";dot=!1;iconEnd="";img="";showTooltipOnHoverDelay=0;checked=!1;clickRef=void 0;openTooltip=!1;tabindex=void 0;anchor=void 0;showTooltipOnHover=void 0;hideTooltipOnLeave=void 0;splitClass="";tooltip={};prop={};events={};constructor(t={}){super(),this.feed(t),this.anchor=new p(t.anchor)}isDisabled(){return typeof this.disabled=="function"?this.disabled():this.disabled}};var H=(a=>(a.None="",a.Field="field",a.Button="button",a.Anchor="anchor",a))(H||{});import{generateRandomString as It}from"lkt-string-tools";var W=(r=>(r.List="list",r.Inline="inline",r.Count="count",r))(W||{});var x=class extends n{static lktDefaultValues=["modelValue","type","valid","placeholder","searchPlaceholder","label","labelIcon","labelIconAtEnd","name","autocomplete","disabled","readonly","readMode","allowReadModeSwitch","tabindex","mandatory","showPassword","canClear","canUndo","canI18n","canStep","canTag","mandatoryMessage","infoMessage","errorMessage","min","max","step","enableAutoNumberFix","emptyValueSlot","optionSlot","valueSlot","editSlot","slotData","featuredButton","infoButtonEllipsis","fileName","customButtonText","customButtonClass","options","multiple","multipleDisplay","multipleDisplayEdition","searchable","icon","download","modal","modalKey","modalData","validation","prop","optionValueType","optionsConfig","fileUploadHttp","tooltipConfig"];modelValue="";type="text";valid=void 0;placeholder="";searchPlaceholder="";label="";labelIcon="";labelIconAtEnd=!1;name=It(16);autocomplete=!1;disabled=!1;readonly=!1;readMode=!1;allowReadModeSwitch=!1;tabindex=void 0;mandatory=!1;showPassword=!1;canClear=!1;canUndo=!1;canI18n=!1;canStep=!0;canTag=!0;mandatoryMessage="";infoMessage="";errorMessage="";min=void 0;max=void 0;step=1;enableAutoNumberFix=!0;emptyValueSlot="";optionSlot=void 0;valueSlot=void 0;editSlot=void 0;slotData={};featuredButton="";infoButtonEllipsis=!1;fileName="";customButtonText="";customButtonClass="";options=[];multiple=!1;multipleDisplay="list";multipleDisplayEdition="inline";searchable=!1;icon="";download="";modal="";modalKey="";modalData={};validation={};prop={};optionValueType="value";optionsConfig={};fileUploadHttp={};tooltipConfig={};constructor(t={}){super(),this.feed(t)}};var b=class e{value;constructor(t){this.value=t}getValue(...t){return typeof this.value=="function"?this.value(...t):typeof this.value=="object"&&typeof this.value==typeof e?this.value.getValue(...t):typeof this.value=="string"?this.value:""}};var h=class extends n{lktExcludedProps=["link","field","anchor","button"];lktAllowUndefinedProps=["formatter","checkEmpty","colspan","field","anchor","button","link","action"];static lktDefaultValues=["type","key","label","sortable","hidden","editable","formatter","checkEmpty","colspan","preferSlot","isForRowKey","extractTitleFromColumn","slotData","field","anchor","button","link","action"];type="";key="";label="";sortable=!0;hidden=!1;editable=!1;formatter=void 0;checkEmpty=void 0;colspan=void 0;preferSlot=!0;isForRowKey=!1;extractTitleFromColumn="";slotData={};field=void 0;anchor=void 0;button=void 0;link=void 0;action=void 0;constructor(t={}){switch(super(),this.feed(t),this.type){case"field":this.field=new x(t.field);break;case"anchor":this.anchor=new p(t.anchor);break;case"button":this.button=new C(t.button);break}this.link=new b(t.link)}getHref(t){return typeof this.link!="object"?"":this.link.getValue(t)}doAction(t){if(typeof this.action=="function")return this.action(t);console.warn("No action defined")}};var z=(s=>(s.MinStringLength="min-str",s.MinNumber="min-num",s.MaxStringLength="max-str",s.MaxNumber="max-num",s.Email="email",s.Empty="empty",s.EqualTo="equal-to",s.MinNumbers="min-numbers",s.MaxNumbers="max-numbers",s.MinChars="min-chars",s.MaxChars="max-chars",s.MinUpperChars="min-upper-chars",s.MaxUpperChars="max-upper-chars",s.MinLowerChars="min-lower-chars",s.MaxLowerChars="max-lower-chars",s.MinSpecialChars="min-special-chars",s.MaxSpecialChars="max-special-chars",s))(z||{});var q=(r=>(r.Ok="ok",r.Ko="ko",r.Info="info",r))(q||{});var B=class e{code=void 0;status="info";min=0;max=0;equalToValue=void 0;constructor(t,o){this.code=t,this.status=o}setMin(t){return this.min=t,this}setMax(t){return this.max=t,this}setEqualToValue(t){return this.equalToValue=t,this}static createEmpty(t="ko"){return new e("empty",t)}static createEmail(t="ko"){return new e("email",t)}static createMinStr(t,o="ko"){return new e("min-str",o).setMin(t)}static createMaxStr(t,o="ko"){return new e("max-str",o).setMax(t)}static createMinNum(t,o="ko"){return new e("min-num",o).setMin(t)}static createMaxNum(t,o="ko"){return new e("max-num",o).setMax(t)}static createNumBetween(t,o,r="ko"){return new e("max-num",r).setMin(t).setMax(o)}static createMinNumbers(t,o="ko"){return new e("min-numbers",o).setMin(t)}static createMaxNumbers(t,o="ko"){return new e("max-numbers",o).setMax(t)}static createMinUpperChars(t,o="ko"){return new e("min-upper-chars",o).setMin(t)}static createMaxUpperChars(t,o="ko"){return new e("max-upper-chars",o).setMax(t)}static createMinLowerChars(t,o="ko"){return new e("min-lower-chars",o).setMin(t)}static createMaxLowerChars(t,o="ko"){return new e("max-lower-chars",o).setMax(t)}static createMinSpecialChars(t,o="ko"){return new e("min-special-chars",o).setMin(t)}static createMaxSpecialChars(t,o="ko"){return new e("max-special-chars",o).setMax(t)}static createMinChars(t,o="ko"){return new e("min-chars",o).setMin(t)}static createMaxChars(t,o="ko"){return new e("max-chars",o).setMax(t)}static createEqualTo(t,o="ko"){return new e("equal-to",o).setEqualToValue(t)}};var $=(o=>(o.NotDefined="",o.Button="button",o))($||{});var D=class extends n{static lktDefaultValues=["icon","text","class","type","events"];icon="";text="";class="";type="";events={};constructor(t={}){super(),this.feed(t)}};var S=class extends n{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["src","alt","text","class","imageStyle"];src="";alt="";text="";class="";imageStyle="";constructor(t={}){super(),this.feed(t)}};var G=(r=>(r.Create="create",r.Update="update",r.Read="read",r))(G||{});var X=(o=>(o.Inline="inline",o.Modal="modal",o))(X||{});var Y=(o=>(o.Top="top",o.Bottom="bottom",o))(Y||{});var J=(r=>(r.Changed="changed",r.Always="always",r.Never="never",r))(J||{});var Q=(r=>(r.Manual="manual",r.Auto="auto",r.Delay="delay",r))(Q||{});var Z=(o=>(o.Toast="toast",o.Inline="inline",o))(Z||{});var y=class extends n{static lktDefaultValues=["modelValue","editing","mode","view","editModeButton","dropButton","createButton","updateButton","modalConfig","saveConfig","title","readResource","readData","beforeEmitUpdate","dataStateConfig","buttonNavPosition","buttonNavVisibility","notificationType"];modelValue={};editing=!1;mode="read";view="inline";editModeButton={};dropButton={};createButton={};updateButton={};modalConfig={};saveConfig={type:"manual"};title="";readResource="";readData={};beforeEmitUpdate=void 0;dataStateConfig={};buttonNavPosition="top";buttonNavVisibility="always";notificationType="toast";constructor(t={}){super(),this.feed(t)}};var V=class extends n{static lktDefaultValues=["key","href","label","icon","isActiveChecker","isOpened","isActive","parent","children","events","onClick"];key="";href="";label="";icon="";isActiveChecker=void 0;isOpened=!1;isActive=!1;parent=void 0;children;events={};onClick=void 0;constructor(t={}){super(),this.feed(t)}setChildren(t){return t.forEach(o=>o.parent=this),this.children=t,this}setOnClick(t){return this.onClick=t,this}setIsActiveChecker(t){return this.isActiveChecker=t,this}setIsActive(t=!0){return this.isActive=t,this}setLabel(t){return this.label=t,this}setIcon(t){return this.icon=t,this}doClose(){this.isOpened=!1}};var I=class extends n{static lktDefaultValues=["modelValue","resource","resourceData"];modelValue=[];resource="";resourceData={};constructor(t={}){super(),this.feed(t),this.modelValue=this.modelValue?.map(o=>new V(o))||[]}};var P=class extends n{static lktDefaultValues=["size","preTitle","preTitleIcon","title","closeIcon","closeConfirm","closeConfirmKey","showClose","disabledClose","disabledVeilClick","hiddenFooter","modalName","modalKey","zIndex","beforeClose","item"];size="";preTitle="";preTitleIcon="";title="";closeIcon=c.defaultCloseModalIcon;closeConfirm="";closeConfirmKey="_";showClose=!0;disabledClose=!1;disabledVeilClick=!1;hiddenFooter=!1;modalName="";modalKey="_";zIndex=500;beforeClose=void 0;item={};confirmButton={};cancelButton={};constructor(t={}){super(),this.feed(t)}};var E=class extends n{value=void 0;label="";data={};disabled=!1;group="";icon="";modal="";tags=[];constructor(t={}){super(),this.feed(t)}};var _=(g=>(g.Pages="pages",g.PrevNext="prev-next",g.PagesPrevNext="pages-prev-next",g.PagesPrevNextFirstLast="pages-prev-next-first-last",g.LoadMore="load-more",g.Infinite="infinite",g))(_||{});var w=class extends n{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","modelValue","class","resource","readOnly","loading","resourceData"];type="pages-prev-next";modelValue=1;class="";resource="";readOnly=!1;loading=!1;resourceData={};constructor(t={}){super(),this.feed(t)}};var tt=(r=>(r.None="",r.Incremental="incremental",r.Decremental="decremental",r))(tt||{});var et=(i=>(i.NotDefined="",i.Hidden="hidden",i.Integer="integer",i.Decimal="decimal",i.Auto="auto",i))(et||{});var T=class extends n{static lktAllowUndefinedProps=[];static lktDefaultValues=["modelValue","type","duration","pauseOnHover","header","valueFormat","palette"];modelValue=0;type="";duration=4e3;pauseOnHover=!1;header="";valueFormat="auto";palette="";constructor(t={}){super(),this.feed(t)}};var ot=(i=>(i.Table="table",i.Item="item",i.Ul="ul",i.Ol="ol",i.Carousel="carousel",i))(ot||{});var rt=(a=>(a[a.Auto=0]="Auto",a[a.PreferItem=1]="PreferItem",a[a.PreferCustomItem=2]="PreferCustomItem",a[a.PreferColumns=3]="PreferColumns",a))(rt||{});var v=class extends n{static lktDefaultValues=["modelValue","type","columns","noResultsText","hideEmptyColumns","itemDisplayChecker","loading","page","perms","editMode","dataStateConfig","sortable","sorter","initialSorting","drag","paginator","header","title","titleTag","titleIcon","headerClass","editModeButton","saveButton","createButton","dropButton","editButton","wrapContentTag","wrapContentClass","itemsContainerClass","hiddenSave","addNavigation","createEnabledValidator","newValueGenerator","requiredItemsForTopCreate","requiredItemsForBottomCreate","slotItemVar","carousel"];modelValue=[];type="table";columns=[];noResultsText="";hideEmptyColumns=!1;itemDisplayChecker=void 0;rowDisplayType=0;loading=!1;page=1;perms=[];editMode=!1;dataStateConfig={};sortable=!1;sorter=void 0;initialSorting=!1;drag=void 0;paginator=void 0;carousel={};header;title="";titleTag="h2";titleIcon="";headerClass="";editModeButton={};saveButton={};createButton={};dropButton={};editButton={};hiddenSave=!1;wrapContentTag="div";wrapContentClass="";itemsContainerClass="";addNavigation=!1;createEnabledValidator=void 0;newValueGenerator=void 0;requiredItemsForTopCreate=0;requiredItemsForBottomCreate=0;slotItemVar="item";constructor(t={}){super(),this.feed(t)}};var L=class extends n{static lktDefaultValues=["modelValue","id","useSession","cacheLifetime","contentPad","titles"];modelValue="";id="";useSession=!1;cacheLifetime=5;contentPad;titles;constructor(t={}){super(),this.feed(t)}};var nt=(o=>(o.NotDefined="",o.ActionIcon="action-icon",o))(nt||{});var O=class extends n{static lktDefaultValues=["class","text","featuredText","icon","iconAtEnd","featuredAtStart","type"];class="";text="";featuredText="";icon="";iconAtEnd=!1;featuredAtStart=!1;type="";constructor(t={}){super(),this.feed(t)}};var at=(o=>(o.Message="message",o.Button="button",o))(at||{});var it=(r=>(r.Left="left",r.Center="center",r.Right="right",r))(it||{});var A=class extends n{static lktDefaultValues=["type","text","details","icon","positionX","duration","buttonConfig","zIndex"];type="message";text="";details="";icon="";positionX="right";duration=void 0;buttonConfig=void 0;zIndex=1e3;constructor(t={}){super(),this.feed(t)}};var lt=(o=>(o.Fixed="fixed",o.Absolute="absolute",o))(lt||{});var st=(a=>(a.Top="top",a.Bottom="bottom",a.Center="center",a.ReferrerCenter="referrer-center",a))(st||{});var ft=(i=>(i.Left="left",i.Right="right",i.Center="center",i.LeftCorner="left-corner",i.RightCorner="right-corner",i))(ft||{});var N=class extends n{static lktDefaultValues=["modelValue","alwaysOpen","class","text","icon","iconAtEnd","engine","referrerWidth","referrerMargin","windowMargin","referrer","locationY","locationX"];modelValue=!1;alwaysOpen=!1;class="";text="";icon="";iconAtEnd=!1;engine="fixed";referrerWidth=!1;referrerMargin=0;windowMargin=0;referrer=void 0;locationY="bottom";locationX="left-corner";showOnReferrerHover=!1;showOnReferrerHoverDelay=0;hideOnReferrerLeave=!1;constructor(t={}){super(),this.feed(t)}};var ut=(a=>(a.None="",a.Focus="focus",a.Blur="blur",a.Always="always",a))(ut||{});var dt=(r=>(r.Auto="auto",r.Local="local",r.Remote="remote",r))(dt||{});var mt=(i=>(i.Refresh="refresh",i.Close="close",i.ReOpen="reOpen",i.Exec="exec",i.Open="open",i))(mt||{});var ct=(o=>(o.Modal="modal",o.Confirm="confirm",o))(ct||{});var pt=(o=>(o.Asc="asc",o.Desc="desc",o))(pt||{});var gt=(d=>(d.Create="create",d.Update="update",d.Edit="edit",d.Drop="drop",d.Sort="sort",d.SwitchEditMode="switch-edit-mode",d.InlineEdit="inline-edit",d.InlineCreate="inline-create",d.ModalCreate="modal-create",d.InlineCreateEver="inline-create-ever",d))(gt||{});var Ct=(o=>(o.Lazy="lazy",o.Ever="ever",o))(Ct||{});import{__ as Pt}from"lkt-i18n";var xt=(e,t)=>typeof e=="string"&&e.startsWith("prop:")?t[e.substring(5)]:e,Et=e=>{if(typeof e=="string"&&e.startsWith("__:")){let t=String(e);return t.startsWith("__:")?Pt(t.substring(3)):t}return e},wt=(e,t)=>{if(!e)return{};let o={};for(let r in e)o[r]=xt(e[r],t);return o};var Tt=(e,...t)=>{c.debugEnabled&&console.info("::lkt::",`[${e}] `,...t)};var vt=e=>new h(e);function Mo(e){let t=new e,o={};if(!Array.isArray(e.lktDefaultValues))throw new Error("lktDefaultValues must be a keys array.");for(let r of e.lktDefaultValues)r in t&&(o[r]=t[r]);return o}export{M as Accordion,K as AccordionToggleMode,j as AccordionType,p as Anchor,R as AnchorType,C as Button,U as ButtonType,h as Column,H as ColumnType,x as Field,ut as FieldAutoValidationTrigger,F as FieldType,B as FieldValidation,dt as FieldValidationType,D as Icon,$ as IconType,S as Image,y as ItemCrud,Y as ItemCrudButtonNavPosition,J as ItemCrudButtonNavVisibility,G as ItemCrudMode,X as ItemCrudView,n as LktItem,c as LktSettings,k as LktStrictItem,I as Menu,V as MenuEntry,P as Modal,mt as ModalCallbackAction,ct as ModalType,W as MultipleOptionsDisplay,Z as NotificationType,E as Option,w as Paginator,_ as PaginatorType,T as Progress,tt as ProgressType,et as ProgressValueFormat,b as SafeString,Q as SaveType,pt as SortDirection,v as Table,gt as TablePermission,rt as TableRowType,ot as TableType,L as Tabs,O as Tag,nt as TagType,A as Toast,it as ToastPositionX,at as ToastType,Ct as ToggleMode,N as Tooltip,ft as TooltipLocationX,st as TooltipLocationY,lt as TooltipPositionEngine,z as ValidationCode,q as ValidationStatus,Mt as booleanFieldTypes,vt as createColumn,f as ensureButtonConfig,Et as extractI18nValue,xt as extractPropValue,bt as fieldTypesWithOptions,ht as fieldTypesWithoutClear,Vt as fieldTypesWithoutUndo,Bt as fieldsWithMultipleMode,Mo as getDefaultValues,Tt as lktDebug,wt as prepareResourceData,Dt as textFieldTypes,kt as textFieldTypesWithOptions};
|
|
1
|
+
var j=(f=>(f.Button="button",f.Submit="submit",f.Reset="reset",f.Anchor="anchor",f.Content="content",f.Switch="switch",f.HiddenSwitch="hidden-switch",f.Split="split",f.SplitLazy="split-lazy",f.SplitEver="split-ever",f.Tooltip="tooltip",f.TooltipLazy="tooltip-lazy",f.TooltipEver="tooltip-ever",f.FileUpload="file-upload",f.ImageUpload="image-upload",f))(j||{});var u=(e,t)=>typeof e>"u"?t:{...t,...e};var c=class e{static debugEnabled=!1;static debugMode(t=!0){return e.debugEnabled=t,e}static defaultCreateErrorText="Creation failed";static defaultCreateErrorDetails="An error occurred while creating the item. Please try again.";static defaultCreateErrorIcon="";static setDefaultCreateError(t){e.defaultCreateErrorText=t.text??e.defaultCreateErrorText,e.defaultCreateErrorDetails=t.details??e.defaultCreateErrorDetails,e.defaultCreateErrorIcon=t.icon??e.defaultCreateErrorIcon}static defaultUpdateErrorText="Update failed";static defaultUpdateErrorDetails="An error occurred while updating the item. Please try again.";static defaultUpdateErrorIcon="";static setDefaultUpdateError(t){e.defaultUpdateErrorText=t.text??e.defaultUpdateErrorText,e.defaultUpdateErrorDetails=t.details??e.defaultUpdateErrorDetails,e.defaultUpdateErrorIcon=t.icon??e.defaultUpdateErrorIcon}static defaultDropErrorText="Drop failed";static defaultDropErrorDetails="An error occurred while removing the item. Please try again.";static defaultDropErrorIcon="";static setDefaultDropError(t){e.defaultDropErrorText=t.text??e.defaultDropErrorText,e.defaultDropErrorDetails=t.details??e.defaultDropErrorDetails,e.defaultDropErrorIcon=t.icon??e.defaultDropErrorIcon}static defaultCreateSuccessText="Item created";static defaultCreateSuccessDetails="";static defaultCreateSuccessIcon="";static setDefaultCreateSuccess(t){e.defaultCreateSuccessText=t.text??e.defaultCreateSuccessText,e.defaultCreateSuccessDetails=t.details??e.defaultCreateSuccessDetails,e.defaultCreateSuccessIcon=t.icon??e.defaultCreateSuccessIcon}static defaultUpdateSuccessText="Item updated";static defaultUpdateSuccessDetails="";static defaultUpdateSuccessIcon="";static setDefaultUpdateSuccess(t){e.defaultUpdateSuccessText=t.text??e.defaultUpdateSuccessText,e.defaultUpdateSuccessDetails=t.details??e.defaultUpdateSuccessDetails,e.defaultUpdateSuccessIcon=t.icon??e.defaultUpdateSuccessIcon}static defaultDropSuccessText="Item removed";static defaultDropSuccessDetails="";static defaultDropSuccessIcon="";static setDefaultDropSuccess(t){e.defaultDropSuccessText=t.text??e.defaultDropSuccessText,e.defaultDropSuccessDetails=t.details??e.defaultDropSuccessDetails,e.defaultDropSuccessIcon=t.icon??e.defaultDropSuccessIcon}static defaultUploadSuccessText="Upload success";static defaultUploadSuccessDetails="";static defaultUploadSuccessIcon="";static setDefaultUploadSuccess(t){e.defaultUploadSuccessText=t.text??e.defaultUploadSuccessText,e.defaultUploadSuccessDetails=t.details??e.defaultUploadSuccessDetails,e.defaultUploadSuccessIcon=t.icon??e.defaultUploadSuccessIcon}static defaultUploadErrorText="Upload error";static defaultUploadErrorDetails="";static defaultUploadErrorIcon="";static setDefaultUploadError(t){e.defaultUploadErrorText=t.text??e.defaultUploadErrorText,e.defaultUploadErrorDetails=t.details??e.defaultUploadErrorDetails,e.defaultUploadErrorIcon=t.icon??e.defaultUploadErrorIcon}static defaultSaveButton={text:"Save",icon:"lkt-icn-save"};static setDefaultSaveButton(t,o=!0){return o?e.defaultSaveButton=t:e.defaultSaveButton=u(t,e.defaultSaveButton),e}static defaultConfirmButton={text:"Confirm"};static setDefaultConfirmButton(t,o=!0){return o?e.defaultConfirmButton=t:e.defaultConfirmButton=u(t,e.defaultConfirmButton),e}static defaultCancelButton={text:"Cancel"};static setDefaultCancelButton(t,o=!0){return o?e.defaultCancelButton=t:e.defaultCancelButton=u(t,e.defaultCancelButton),e}static defaultCreateButton={text:"Create",icon:"lkt-icn-save"};static setDefaultCreateButton(t,o=!0){return o?e.defaultCreateButton=t:e.defaultCreateButton=u(t,e.defaultCreateButton),e}static defaultUpdateButton={text:"Update",icon:"lkt-icn-save"};static setDefaultUpdateButton(t,o=!0){return o?e.defaultUpdateButton=t:e.defaultUpdateButton=u(t,e.defaultUpdateButton),e}static defaultDropButton={text:"Drop"};static setDefaultDropButton(t,o=!0){return o?e.defaultDropButton=t:e.defaultDropButton=u(t,e.defaultDropButton),e}static defaultEditModeButton={text:"Edit mode",type:"switch"};static setDefaultEditModeButton(t,o=!0){return o?e.defaultEditModeButton=t:e.defaultEditModeButton=u(t,e.defaultEditModeButton),e}static defaultToggleButton={text:"Toggle",textOn:"Close",textOff:"Show more",type:"hidden-switch"};static setDefaultToggleButton(t,o=!0){return o?e.defaultToggleButton=t:e.defaultToggleButton=u(t,e.defaultToggleButton),e}static defaultLoadMoreButton={text:"Load more",type:"hidden-switch"};static setDefaultLoadMoreButton(t,o=!0){return o?e.defaultLoadMoreButton=t:e.defaultLoadMoreButton=u(t,e.defaultLoadMoreButton),e}static defaultCloseModalIcon="lkt-icn-cancel";static setDefaultCloseModalIcon(t){return e.defaultCloseModalIcon=t,e}static defaultCloseToastIcon="lkt-icn-cancel";static setDefaultCloseToastIcon(t){return e.defaultCloseToastIcon=t,e}static defaultTableSortAscIcon="lkt-icn-arrow-bottom";static defaultTableSortDescIcon="lkt-icn-arrow-top";static setDefaultTableSortAscIcon(t){return e.defaultTableSortAscIcon=t,e}static setDefaultTableSortDescIcon(t){return e.defaultTableSortDescIcon=t,e}static defaultPaginatorFirstButton={text:"",icon:"lkt-icn-angle-double-left"};static defaultPaginatorPrevButton={text:"",icon:"lkt-icn-angle-left"};static defaultPaginatorNextButton={text:"",iconEnd:"lkt-icn-angle-right"};static defaultPaginatorLastButton={text:"",iconEnd:"lkt-icn-angle-double-right"};static setDefaultPaginatorFirstButton(t,o=!0){return o?e.defaultPaginatorFirstButton=t:e.defaultPaginatorFirstButton=u(t,e.defaultPaginatorFirstButton),e}static setDefaultPaginatorPrevButton(t,o=!0){return o?e.defaultPaginatorPrevButton=t:e.defaultPaginatorPrevButton=u(t,e.defaultPaginatorPrevButton),e}static setDefaultPaginatorNextButton(t,o=!0){return o?e.defaultPaginatorNextButton=t:e.defaultPaginatorNextButton=u(t,e.defaultPaginatorNextButton),e}static setDefaultPaginatorLastButton(t,o=!0){return o?e.defaultPaginatorLastButton=t:e.defaultPaginatorLastButton=u(t,e.defaultPaginatorLastButton),e}};var R=(l=>(l.Text="text",l.Email="email",l.Tel="tel",l.Password="password",l.Search="search",l.Number="number",l.Color="color",l.Range="range",l.Textarea="textarea",l.Html="html",l.Date="date",l.File="file",l.Image="image",l.Select="select",l.Check="check",l.Switch="switch",l.Calc="calc",l.Card="card",l.Elements="elements",l))(R||{});var Mt=["text","search","select"],St=["switch","check"],Bt=["switch","check"],Dt=["text","search"],It=["switch","check"],yt=["select","color","card"],Et=["text","email","password"];var Pt=["lktDateProps","lktStrictItem","lktExcludedProps"],a=class e{static lktAllowUndefinedProps=[];static lktExcludedProps=[];static lktDateProps=[];static lktStrictItem=!1;static lktDefaultValues=[];constructor(t){}feed(t={},o=this){if(typeof t=="object")for(let[r,n]of Object.entries(t))o.assignProp(r,n)}assignProp(t,o){if(!(Pt.includes(t)||e.lktExcludedProps.includes(t))&&!(e.lktStrictItem&&!this.hasOwnProperty(t))){if(e.lktDateProps.includes(t)){this[t]=new Date(o);return}this[t]=o}}};var g=class extends a{lktStrictItem=!0};var h=class e extends g{r=0;g=0;b=0;a=255;constructor(t){super(),this.feed(t)}static fromHexColor(t){let o=parseInt(+("0x"+t.substring(1,3)),10),r=parseInt(+("0x"+t.substring(3,5)),10),n=parseInt(+("0x"+t.substring(5,7)),10),i=255;return t.length===9&&(i=parseInt(+("0x"+t.substring(5,7)),10)),new e({r:o,g:r,b:n,a:i})}toString(){let t=parseInt(this.r).toString(16).padStart(2,"0").toUpperCase(),o=parseInt(this.g).toString(16).padStart(2,"0").toUpperCase(),r=parseInt(this.b).toString(16).padStart(2,"0").toUpperCase(),n="#"+t+o+r;if(this.a==255)return n;let i=parseInt(this.a).toString(16).padStart(2,"0").toUpperCase();return n+i}getContrastFontColor(){return(.299*this.r+.587*this.g+.114*this.b)/this.a>.5?"#000000":"#ffffff"}};var K=(n=>(n.Auto="auto",n.Always="always",n.Lazy="lazy",n.Ever="ever",n))(K||{});var H=(r=>(r.Transform="transform",r.Height="height",r.Display="display",r))(H||{});var V=class extends a{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["modelValue","type","toggleMode","actionButton","toggleButton","toggleOnClickIntro","toggleTimeout","title","icon","class","contentClass","iconRotation","minHeight","iconAtEnd","toggleIconAtEnd"];modelValue=!1;type="auto";toggleMode="height";actionButton={};toggleButton={};toggleOnClickIntro=!1;toggleTimeout=0;title="";icon="";class="";contentClass="";iconRotation="90";minHeight=void 0;iconAtEnd=!1;toggleIconAtEnd=!1;constructor(t={}){super(),this.feed(t)}};var W=(m=>(m.Href="href",m.RouterLink="router-link",m.RouterLinkBack="router-link-back",m.Mail="mail",m.Tel="tel",m.Tab="tab",m.Download="download",m.Action="action",m.Legacy="",m))(W||{});var k=e=>{let t="";if(typeof e.to=="string"&&(t=e.to),typeof e.type<"u")switch(e.type){case"mail":return`mailto:${t}`;case"tel":return`tel:${t}`;case"href":case"tab":case"download":return t}return t};var C=class extends a{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","to","class","isActive","downloadFileName","disabled","onClick","confirmModal","confirmModalKey","confirmData","imposter","external","events","text"];type="router-link";to="";class="";isActive=!1;downloadFileName="";disabled=!1;onClick=void 0;confirmModal="";confirmModalKey="_";confirmData={};imposter=!1;external=!1;text;events={};getHref(){return k(this)}constructor(t={}){super(),this.feed(t)}};import{generateRandomString as Tt}from"lkt-string-tools";var M=class extends a{lktAllowUndefinedProps=["clickRef","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave"];static lktDefaultValues=["type","name","class","containerClass","value","disabled","loading","wrapContent","splitIcon","resource","resourceData","modal","modalKey","modalData","confirmModal","confirmModalKey","confirmData","modalCallbacks","text","textOn","textOff","icon","iconOn","iconOff","iconEndOn","iconEndOff","dot","iconEnd","img","showTooltipOnHoverDelay","tooltip","checked","clickRef","openTooltip","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave","splitClass","prop","events"];type="button";name=Tt(10);class="";containerClass="";value="";disabled=!1;loading=!1;wrapContent=!1;splitIcon="";resource="";resourceData={};modal="";modalKey="_";modalData={};confirmModal="";confirmModalKey="_";confirmData={};modalCallbacks=[];text="";textOn=void 0;textOff=void 0;iconOn=void 0;iconOff=void 0;iconEndOn=void 0;iconEndOff=void 0;icon="";dot=!1;iconEnd="";img="";showTooltipOnHoverDelay=0;checked=!1;clickRef=void 0;openTooltip=!1;tabindex=void 0;anchor=void 0;showTooltipOnHover=void 0;hideTooltipOnLeave=void 0;splitClass="";tooltip={};prop={};events={};constructor(t={}){super(),this.feed(t),this.anchor=new C(t.anchor)}isDisabled(){return typeof this.disabled=="function"?this.disabled():this.disabled}};var z=(n=>(n.None="",n.Field="field",n.Button="button",n.Anchor="anchor",n))(z||{});var x=class extends a{lktExcludedProps=["field","anchor","button"];lktAllowUndefinedProps=["formatter","checkEmpty","colspan","field","anchor","button"];static lktDefaultValues=["type","key","label","sortable","hidden","editable","formatter","checkEmpty","colspan","preferSlot","isForRowKey","extractTitleFromColumn","slotData","field","anchor","button"];type="";key="";label="";sortable=!0;hidden=!1;editable=!1;formatter=void 0;checkEmpty=void 0;colspan=void 0;preferSlot=!0;isForRowKey=!1;extractTitleFromColumn="";slotData={};field=void 0;anchor=void 0;button=void 0;constructor(t={}){super(),this.feed(t)}};import{generateRandomString as wt}from"lkt-string-tools";var q=(r=>(r.List="list",r.Inline="inline",r.Count="count",r))(q||{});var S=class extends a{static lktDefaultValues=["modelValue","type","valid","placeholder","searchPlaceholder","label","labelIcon","labelIconAtEnd","name","autocomplete","disabled","readonly","hidden","readMode","allowReadModeSwitch","tabindex","mandatory","showPassword","canClear","canUndo","canI18n","canStep","canTag","mandatoryMessage","infoMessage","errorMessage","min","max","step","enableAutoNumberFix","emptyValueSlot","optionSlot","valueSlot","editSlot","slotData","featuredButton","infoButtonEllipsis","fileName","customButtonText","customButtonClass","options","multiple","multipleDisplay","multipleDisplayEdition","searchable","icon","download","modal","modalKey","modalData","validation","prop","optionValueType","optionsConfig","fileUploadHttp","tooltipConfig","readModeConfig","configOn","configOff"];modelValue="";type="text";valid=void 0;placeholder="";searchPlaceholder="";label="";labelIcon="";labelIconAtEnd=!1;name=wt(16);autocomplete=!1;disabled=!1;readonly=!1;hidden=!1;tabindex=void 0;mandatory=!1;showPassword=!1;canClear=!1;canUndo=!1;canI18n=!1;canStep=!0;canTag=!0;mandatoryMessage="";infoMessage="";errorMessage="";min=void 0;max=void 0;step=1;enableAutoNumberFix=!0;emptyValueSlot="";optionSlot=void 0;valueSlot=void 0;editSlot=void 0;slotData={};featuredButton="";infoButtonEllipsis=!1;fileName="";customButtonText="";customButtonClass="";options=[];multiple=!1;multipleDisplay="list";multipleDisplayEdition="inline";searchable=!1;icon="";download="";modal="";modalKey="";modalData={};validation={};configOn={};configOff={};readMode;allowReadModeSwitch=!1;readModeConfig;prop={};optionValueType="value";optionsConfig={};fileUploadHttp={};fileUploadButton={};tooltipConfig={};constructor(t={}){super(),this.feed(t)}};var $=(s=>(s.MinStringLength="min-str",s.MinNumber="min-num",s.MaxStringLength="max-str",s.MaxNumber="max-num",s.Email="email",s.Empty="empty",s.EqualTo="equal-to",s.MinNumbers="min-numbers",s.MaxNumbers="max-numbers",s.MinChars="min-chars",s.MaxChars="max-chars",s.MinUpperChars="min-upper-chars",s.MaxUpperChars="max-upper-chars",s.MinLowerChars="min-lower-chars",s.MaxLowerChars="max-lower-chars",s.MinSpecialChars="min-special-chars",s.MaxSpecialChars="max-special-chars",s))($||{});var G=(r=>(r.Ok="ok",r.Ko="ko",r.Info="info",r))(G||{});var B=class e{code=void 0;status="info";min=0;max=0;equalToValue=void 0;constructor(t,o){this.code=t,this.status=o}setMin(t){return this.min=t,this}setMax(t){return this.max=t,this}setEqualToValue(t){return this.equalToValue=t,this}static createEmpty(t="ko"){return new e("empty",t)}static createEmail(t="ko"){return new e("email",t)}static createMinStr(t,o="ko"){return new e("min-str",o).setMin(t)}static createMaxStr(t,o="ko"){return new e("max-str",o).setMax(t)}static createMinNum(t,o="ko"){return new e("min-num",o).setMin(t)}static createMaxNum(t,o="ko"){return new e("max-num",o).setMax(t)}static createNumBetween(t,o,r="ko"){return new e("max-num",r).setMin(t).setMax(o)}static createMinNumbers(t,o="ko"){return new e("min-numbers",o).setMin(t)}static createMaxNumbers(t,o="ko"){return new e("max-numbers",o).setMax(t)}static createMinUpperChars(t,o="ko"){return new e("min-upper-chars",o).setMin(t)}static createMaxUpperChars(t,o="ko"){return new e("max-upper-chars",o).setMax(t)}static createMinLowerChars(t,o="ko"){return new e("min-lower-chars",o).setMin(t)}static createMaxLowerChars(t,o="ko"){return new e("max-lower-chars",o).setMax(t)}static createMinSpecialChars(t,o="ko"){return new e("min-special-chars",o).setMin(t)}static createMaxSpecialChars(t,o="ko"){return new e("max-special-chars",o).setMax(t)}static createMinChars(t,o="ko"){return new e("min-chars",o).setMin(t)}static createMaxChars(t,o="ko"){return new e("max-chars",o).setMax(t)}static createEqualTo(t,o="ko"){return new e("equal-to",o).setEqualToValue(t)}};var X=(o=>(o.NotDefined="",o.Button="button",o))(X||{});var Y=(o=>(o.Start="start",o.End="end",o))(Y||{});var D=class extends a{static lktDefaultValues=["icon","text","class","type","position","events"];icon="";text="";class="";type="";position="start";events={};constructor(t={}){super(),this.feed(t)}};var I=class extends a{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["src","alt","text","class","imageStyle"];src="";alt="";text="";class="";imageStyle="";constructor(t={}){super(),this.feed(t)}};var J=(r=>(r.Create="create",r.Update="update",r.Read="read",r))(J||{});var Q=(o=>(o.Inline="inline",o.Modal="modal",o))(Q||{});var Z=(o=>(o.Top="top",o.Bottom="bottom",o))(Z||{});var _=(r=>(r.Changed="changed",r.Always="always",r.Never="never",r))(_||{});var tt=(r=>(r.Manual="manual",r.Auto="auto",r.Delay="delay",r))(tt||{});var et=(o=>(o.Toast="toast",o.Inline="inline",o))(et||{});var y=class extends a{static lktDefaultValues=["modelValue","editing","mode","view","editModeButton","dropButton","createButton","updateButton","modalConfig","saveConfig","title","readResource","readData","beforeEmitUpdate","dataStateConfig","buttonNavPosition","buttonNavVisibility","notificationType"];modelValue={};editing=!1;mode="read";view="inline";editModeButton={};dropButton={};createButton={};updateButton={};modalConfig={};saveConfig={type:"manual"};title="";readResource="";readData={};beforeEmitUpdate=void 0;dataStateConfig={};buttonNavPosition="top";buttonNavVisibility="always";notificationType="toast";constructor(t={}){super(),this.feed(t)}};var ot=(t=>(t.Anchor="anchor",t))(ot||{});var b=class extends a{static lktDefaultValues=["key","type","href","label","icon","isActiveChecker","isOpened","isActive","parent","children","events","onClick"];key="";type="anchor";icon="";anchor={};href="";label="";isActiveChecker=void 0;isOpened=!1;isActive=!1;parent=void 0;children;events={};onClick=void 0;constructor(t={}){super(),this.feed(t)}setChildren(t){return t.forEach(o=>o.parent=this),this.children=t,this}setOnClick(t){return this.onClick=t,this}setIsActiveChecker(t){return this.isActiveChecker=t,this}setIsActive(t=!0){return this.isActive=t,this}setLabel(t){return this.label=t,this}setIcon(t){return this.icon=t,this}doClose(){this.isOpened=!1}};var E=class extends a{static lktDefaultValues=["modelValue","http","resource","resourceData"];modelValue=[];http={};resource="";resourceData={};constructor(t={}){super(),this.feed(t),this.modelValue=this.modelValue?.map(o=>new b(o))||[]}};var P=class extends a{static lktDefaultValues=["size","preTitle","preTitleIcon","title","closeIcon","closeConfirm","closeConfirmKey","showClose","disabledClose","disabledVeilClick","hiddenFooter","modalName","modalKey","zIndex","beforeClose","item"];size="";preTitle="";preTitleIcon="";title="";closeIcon=c.defaultCloseModalIcon;closeConfirm="";closeConfirmKey="_";showClose=!0;disabledClose=!1;disabledVeilClick=!1;hiddenFooter=!1;modalName="";modalKey="_";zIndex=500;beforeClose=void 0;item={};confirmButton={};cancelButton={};constructor(t={}){super(),this.feed(t)}};var T=class extends a{value=void 0;label="";data={};disabled=!1;group="";icon="";modal="";tags=[];constructor(t={}){super(),this.feed(t)}};var rt=(p=>(p.Pages="pages",p.PrevNext="prev-next",p.PagesPrevNext="pages-prev-next",p.PagesPrevNextFirstLast="pages-prev-next-first-last",p.LoadMore="load-more",p.Infinite="infinite",p))(rt||{});var w=class extends a{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","modelValue","class","resource","readOnly","loading","resourceData"];type="pages-prev-next";modelValue=1;class="";resource="";readOnly=!1;loading=!1;resourceData={};constructor(t={}){super(),this.feed(t)}};var at=(r=>(r.None="",r.Incremental="incremental",r.Decremental="decremental",r))(at||{});var nt=(i=>(i.NotDefined="",i.Hidden="hidden",i.Integer="integer",i.Decimal="decimal",i.Auto="auto",i))(nt||{});var v=class extends a{static lktAllowUndefinedProps=[];static lktDefaultValues=["modelValue","type","duration","pauseOnHover","header","valueFormat","palette"];modelValue=0;type="";duration=4e3;pauseOnHover=!1;header="";valueFormat="auto";palette="";constructor(t={}){super(),this.feed(t)}};var it=(i=>(i.Table="table",i.Item="item",i.Ul="ul",i.Ol="ol",i.Carousel="carousel",i))(it||{});var lt=(n=>(n[n.Auto=0]="Auto",n[n.PreferItem=1]="PreferItem",n[n.PreferCustomItem=2]="PreferCustomItem",n[n.PreferColumns=3]="PreferColumns",n))(lt||{});var L=class extends a{static lktDefaultValues=["modelValue","type","columns","noResultsText","hideEmptyColumns","itemDisplayChecker","loading","page","perms","editMode","dataStateConfig","sortable","sorter","initialSorting","drag","paginator","header","title","titleTag","titleIcon","headerClass","editModeButton","saveButton","createButton","dropButton","editButton","wrapContentTag","wrapContentClass","itemsContainerClass","hiddenSave","addNavigation","createEnabledValidator","newValueGenerator","requiredItemsForTopCreate","requiredItemsForBottomCreate","slotItemVar","carousel"];modelValue=[];type="table";columns=[];noResultsText="";hideEmptyColumns=!1;itemDisplayChecker=void 0;rowDisplayType=0;loading=!1;page=1;perms=[];editMode=!1;dataStateConfig={};sortable=!1;sorter=void 0;initialSorting=!1;drag=void 0;paginator=void 0;carousel={};header;title="";titleTag="h2";titleIcon="";headerClass="";editModeButton={};saveButton={};createButton={};dropButton={};editButton={};hiddenSave=!1;wrapContentTag="div";wrapContentClass="";itemsContainerClass="";addNavigation=!1;createEnabledValidator=void 0;newValueGenerator=void 0;requiredItemsForTopCreate=0;requiredItemsForBottomCreate=0;slotItemVar="item";constructor(t={}){super(),this.feed(t)}};var O=class extends a{static lktDefaultValues=["modelValue","id","useSession","cacheLifetime","contentPad","titles"];modelValue="";id="";useSession=!1;cacheLifetime=5;contentPad;titles;constructor(t={}){super(),this.feed(t)}};var st=(o=>(o.NotDefined="",o.ActionIcon="action-icon",o))(st||{});var U=class extends a{static lktDefaultValues=["class","text","featuredText","icon","iconAtEnd","featuredAtStart","type"];class="";text="";featuredText="";icon="";iconAtEnd=!1;featuredAtStart=!1;type="";constructor(t={}){super(),this.feed(t)}};var ft=(o=>(o.Message="message",o.Button="button",o))(ft||{});var ut=(r=>(r.Left="left",r.Center="center",r.Right="right",r))(ut||{});var A=class extends a{static lktDefaultValues=["type","text","details","icon","positionX","duration","buttonConfig","zIndex"];type="message";text="";details="";icon="";positionX="right";duration=void 0;buttonConfig=void 0;zIndex=1e3;constructor(t={}){super(),this.feed(t)}};var dt=(o=>(o.Fixed="fixed",o.Absolute="absolute",o))(dt||{});var mt=(n=>(n.Top="top",n.Bottom="bottom",n.Center="center",n.ReferrerCenter="referrer-center",n))(mt||{});var ct=(i=>(i.Left="left",i.Right="right",i.Center="center",i.LeftCorner="left-corner",i.RightCorner="right-corner",i))(ct||{});var N=class extends a{static lktDefaultValues=["modelValue","alwaysOpen","class","text","icon","iconAtEnd","engine","referrerWidth","referrerMargin","windowMargin","referrer","locationY","locationX","showOnReferrerHover","showOnReferrerHoverDelay","hideOnReferrerLeave","hideOnReferrerLeaveDelay"];modelValue=!1;alwaysOpen=!1;class="";text="";icon="";iconAtEnd=!1;engine="fixed";referrerWidth=!1;referrerMargin=0;windowMargin=0;referrer=void 0;locationY="bottom";locationX="left-corner";showOnReferrerHover=!1;showOnReferrerHoverDelay=0;hideOnReferrerLeave=!1;hideOnReferrerLeaveDelay=0;constructor(t={}){super(),this.feed(t)}};var pt=(n=>(n.None="",n.Focus="focus",n.Blur="blur",n.Always="always",n))(pt||{});var gt=(r=>(r.Auto="auto",r.Local="local",r.Remote="remote",r))(gt||{});var Ct=(i=>(i.Refresh="refresh",i.Close="close",i.ReOpen="reOpen",i.Exec="exec",i.Open="open",i))(Ct||{});var xt=(o=>(o.Modal="modal",o.Confirm="confirm",o))(xt||{});var bt=(o=>(o.Asc="asc",o.Desc="desc",o))(bt||{});var ht=(d=>(d.Create="create",d.Update="update",d.Edit="edit",d.Drop="drop",d.Sort="sort",d.SwitchEditMode="switch-edit-mode",d.InlineEdit="inline-edit",d.InlineCreate="inline-create",d.ModalCreate="modal-create",d.InlineCreateEver="inline-create-ever",d))(ht||{});var Vt=(o=>(o.Lazy="lazy",o.Ever="ever",o))(Vt||{});var F=class e{value;constructor(t){this.value=t}getValue(...t){return typeof this.value=="function"?this.value(...t):typeof this.value=="object"&&typeof this.value==typeof e?this.value.getValue(...t):typeof this.value=="string"?this.value:""}};import{__ as vt}from"lkt-i18n";var kt=(e,t)=>typeof e=="string"&&e.startsWith("prop:")?t[e.substring(5)]:e,Lt=e=>{if(typeof e=="string"&&e.startsWith("__:")){let t=String(e);return t.startsWith("__:")?vt(t.substring(3)):t}return e},Ot=(e,t)=>{if(!e)return{};let o={};for(let r in e)o[r]=kt(e[r],t);return o};var Ut=(e,...t)=>{c.debugEnabled&&console.info("::lkt::",`[${e}] `,...t)};var At=e=>new x(e);function Eo(e){let t=new e,o={};if(!Array.isArray(e.lktDefaultValues))throw new Error("lktDefaultValues must be a keys array.");for(let r of e.lktDefaultValues)r in t&&(o[r]=t[r]);return o}export{V as Accordion,H as AccordionToggleMode,K as AccordionType,C as Anchor,W as AnchorType,M as Button,j as ButtonType,x as Column,z as ColumnType,S as Field,pt as FieldAutoValidationTrigger,R as FieldType,B as FieldValidation,gt as FieldValidationType,D as Icon,Y as IconPosition,X as IconType,I as Image,y as ItemCrud,Z as ItemCrudButtonNavPosition,_ as ItemCrudButtonNavVisibility,J as ItemCrudMode,Q as ItemCrudView,h as LktColor,a as LktItem,c as LktSettings,g as LktStrictItem,E as Menu,b as MenuEntry,ot as MenuEntryType,P as Modal,Ct as ModalCallbackAction,xt as ModalType,q as MultipleOptionsDisplay,et as NotificationType,T as Option,w as Paginator,rt as PaginatorType,v as Progress,at as ProgressType,nt as ProgressValueFormat,F as SafeString,tt as SaveType,bt as SortDirection,L as Table,ht as TablePermission,lt as TableRowType,it as TableType,O as Tabs,U as Tag,st as TagType,A as Toast,ut as ToastPositionX,ft as ToastType,Vt as ToggleMode,N as Tooltip,ct as TooltipLocationX,mt as TooltipLocationY,dt as TooltipPositionEngine,$ as ValidationCode,G as ValidationStatus,It as booleanFieldTypes,At as createColumn,u as ensureButtonConfig,Lt as extractI18nValue,kt as extractPropValue,Mt as fieldTypesWithOptions,St as fieldTypesWithoutClear,Bt as fieldTypesWithoutUndo,yt as fieldsWithMultipleMode,k as getAnchorHref,Eo as getDefaultValues,Ut as lktDebug,Ot as prepareResourceData,Et as textFieldTypes,Dt as textFieldTypesWithOptions};
|