lkt-vue-kernel 1.0.19 → 1.0.21
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 +252 -118
- package/dist/index.js +208 -25
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -186,7 +186,6 @@ interface TooltipConfig {
|
|
|
186
186
|
|
|
187
187
|
interface ButtonConfig {
|
|
188
188
|
type?: ButtonType;
|
|
189
|
-
checked?: boolean;
|
|
190
189
|
openTooltip?: boolean;
|
|
191
190
|
name?: string;
|
|
192
191
|
text?: string | number;
|
|
@@ -198,6 +197,11 @@ interface ButtonConfig {
|
|
|
198
197
|
disabled?: ValidIsDisabledValue;
|
|
199
198
|
loading?: boolean;
|
|
200
199
|
wrapContent?: boolean;
|
|
200
|
+
checked?: boolean;
|
|
201
|
+
textOn?: string | number | undefined;
|
|
202
|
+
textOff?: string | number | undefined;
|
|
203
|
+
iconOn?: string | number | undefined;
|
|
204
|
+
iconOff?: string | number | undefined;
|
|
201
205
|
anchor?: AnchorConfig | Anchor;
|
|
202
206
|
resource?: string;
|
|
203
207
|
resourceData?: LktObject;
|
|
@@ -265,6 +269,54 @@ declare enum FieldType {
|
|
|
265
269
|
Elements = "elements"
|
|
266
270
|
}
|
|
267
271
|
|
|
272
|
+
declare const fieldTypesWithOptions: FieldType[];
|
|
273
|
+
declare const fieldTypesWithoutClear: FieldType[];
|
|
274
|
+
declare const fieldTypesWithoutUndo: FieldType[];
|
|
275
|
+
declare const textFieldTypesWithOptions: FieldType[];
|
|
276
|
+
declare const booleanFieldTypes: FieldType[];
|
|
277
|
+
declare const fieldsWithMultipleMode: FieldType[];
|
|
278
|
+
declare const textFieldTypes: FieldType[];
|
|
279
|
+
|
|
280
|
+
declare enum AccordionToggleMode {
|
|
281
|
+
Transform = "transform",
|
|
282
|
+
Height = "height",
|
|
283
|
+
Display = "display"
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare enum AccordionType {
|
|
287
|
+
Auto = "auto",// Default accordion flow
|
|
288
|
+
Always = "always",// Always opened
|
|
289
|
+
Lazy = "lazy",// Lazy content, only after fist open
|
|
290
|
+
Ever = "ever"
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
interface AccordionConfig {
|
|
294
|
+
modelValue?: boolean;
|
|
295
|
+
type?: AccordionType;
|
|
296
|
+
toggleMode?: AccordionToggleMode;
|
|
297
|
+
actionButton?: ButtonConfig;
|
|
298
|
+
toggleButton?: ButtonConfig;
|
|
299
|
+
toggleOnClickIntro?: boolean;
|
|
300
|
+
toggleTimeout?: number;
|
|
301
|
+
title?: string;
|
|
302
|
+
icon?: string;
|
|
303
|
+
class?: string;
|
|
304
|
+
contentClass?: string;
|
|
305
|
+
iconRotation?: '90' | '180' | '-90' | '-180';
|
|
306
|
+
minHeight?: number | undefined;
|
|
307
|
+
toggleIconAtEnd?: boolean;
|
|
308
|
+
iconAtEnd?: boolean;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare enum ColumnType {
|
|
312
|
+
None = "",
|
|
313
|
+
Field = "field",
|
|
314
|
+
Button = "button",
|
|
315
|
+
Anchor = "anchor"
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
type ValidColSpan = Function | boolean | number | undefined;
|
|
319
|
+
|
|
268
320
|
type ValidOptionValue = string | number | undefined;
|
|
269
321
|
|
|
270
322
|
interface OptionConfig {
|
|
@@ -280,11 +332,11 @@ interface OptionConfig {
|
|
|
280
332
|
declare class Option extends LktItem implements OptionConfig {
|
|
281
333
|
value: ValidOptionValue;
|
|
282
334
|
label: string;
|
|
283
|
-
data
|
|
284
|
-
disabled
|
|
285
|
-
group
|
|
286
|
-
icon
|
|
287
|
-
modal
|
|
335
|
+
data?: LktObject;
|
|
336
|
+
disabled?: boolean;
|
|
337
|
+
group?: string;
|
|
338
|
+
icon?: string;
|
|
339
|
+
modal?: ValidModalName;
|
|
288
340
|
constructor(data?: Partial<OptionConfig>);
|
|
289
341
|
}
|
|
290
342
|
|
|
@@ -305,6 +357,30 @@ declare enum FieldAutoValidationTrigger {
|
|
|
305
357
|
|
|
306
358
|
type ValidFieldMinMax = number | string | undefined;
|
|
307
359
|
|
|
360
|
+
declare enum FieldValidationType {
|
|
361
|
+
Auto = "auto",
|
|
362
|
+
Remote = "remote"
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
interface FieldValidationConfig {
|
|
366
|
+
type?: FieldValidationType;
|
|
367
|
+
trigger?: FieldAutoValidationTrigger;
|
|
368
|
+
stack?: string;
|
|
369
|
+
resource?: string;
|
|
370
|
+
resourceData?: LktObject;
|
|
371
|
+
minNumbers?: ValidFieldMinMax;
|
|
372
|
+
maxNumbers?: ValidFieldMinMax;
|
|
373
|
+
minChars?: ValidFieldMinMax;
|
|
374
|
+
maxChars?: ValidFieldMinMax;
|
|
375
|
+
minUpperChars?: ValidFieldMinMax;
|
|
376
|
+
maxUpperChars?: ValidFieldMinMax;
|
|
377
|
+
minLowerChars?: ValidFieldMinMax;
|
|
378
|
+
maxLowerChars?: ValidFieldMinMax;
|
|
379
|
+
minSpecialChars?: ValidFieldMinMax;
|
|
380
|
+
maxSpecialChars?: ValidFieldMinMax;
|
|
381
|
+
checkEqualTo?: ValidFieldMinMax;
|
|
382
|
+
}
|
|
383
|
+
|
|
308
384
|
interface FieldConfig {
|
|
309
385
|
modelValue?: ValidFieldValue;
|
|
310
386
|
type?: FieldType;
|
|
@@ -342,27 +418,9 @@ interface FieldConfig {
|
|
|
342
418
|
slotData?: LktObject;
|
|
343
419
|
resource?: string;
|
|
344
420
|
resourceData?: LktObject;
|
|
345
|
-
validationResource?: string;
|
|
346
|
-
validationResourceData?: LktObject;
|
|
347
|
-
autoValidation?: boolean;
|
|
348
|
-
autoValidationType?: FieldAutoValidationTrigger;
|
|
349
|
-
validationStack?: string;
|
|
350
|
-
minNumbers?: ValidFieldMinMax;
|
|
351
|
-
maxNumbers?: ValidFieldMinMax;
|
|
352
|
-
minChars?: ValidFieldMinMax;
|
|
353
|
-
maxChars?: ValidFieldMinMax;
|
|
354
|
-
minUpperChars?: ValidFieldMinMax;
|
|
355
|
-
maxUpperChars?: ValidFieldMinMax;
|
|
356
|
-
minLowerChars?: ValidFieldMinMax;
|
|
357
|
-
maxLowerChars?: ValidFieldMinMax;
|
|
358
|
-
minSpecialChars?: ValidFieldMinMax;
|
|
359
|
-
maxSpecialChars?: ValidFieldMinMax;
|
|
360
|
-
checkEqualTo?: ValidFieldMinMax;
|
|
361
421
|
featuredButton?: string;
|
|
362
422
|
infoButtonEllipsis?: boolean;
|
|
363
423
|
fileName?: string;
|
|
364
|
-
customButtonText?: string;
|
|
365
|
-
customButtonClass?: string;
|
|
366
424
|
options?: string | Option[];
|
|
367
425
|
multiple?: boolean;
|
|
368
426
|
multipleDisplay?: MultipleOptionsDisplay;
|
|
@@ -372,7 +430,9 @@ interface FieldConfig {
|
|
|
372
430
|
optionsDownload?: string | Function;
|
|
373
431
|
optionsModal?: string | Function;
|
|
374
432
|
optionsModalData?: LktObject | Function;
|
|
433
|
+
optionsText?: string | Function;
|
|
375
434
|
optionsIcon?: string | Function;
|
|
435
|
+
optionsClass?: string | Function;
|
|
376
436
|
optionsLabelFormatter?: Function | undefined;
|
|
377
437
|
optionsResource?: string;
|
|
378
438
|
optionsResourceData?: LktObject;
|
|
@@ -384,100 +444,27 @@ interface FieldConfig {
|
|
|
384
444
|
itemType?: string;
|
|
385
445
|
optionValueType?: string;
|
|
386
446
|
prop?: LktObject;
|
|
447
|
+
validation?: FieldValidationConfig;
|
|
448
|
+
validationResource?: string;
|
|
449
|
+
validationResourceData?: LktObject;
|
|
450
|
+
autoValidation?: boolean;
|
|
451
|
+
autoValidationType?: FieldAutoValidationTrigger;
|
|
452
|
+
validationStack?: string;
|
|
453
|
+
minNumbers?: ValidFieldMinMax;
|
|
454
|
+
maxNumbers?: ValidFieldMinMax;
|
|
455
|
+
minChars?: ValidFieldMinMax;
|
|
456
|
+
maxChars?: ValidFieldMinMax;
|
|
457
|
+
minUpperChars?: ValidFieldMinMax;
|
|
458
|
+
maxUpperChars?: ValidFieldMinMax;
|
|
459
|
+
minLowerChars?: ValidFieldMinMax;
|
|
460
|
+
maxLowerChars?: ValidFieldMinMax;
|
|
461
|
+
minSpecialChars?: ValidFieldMinMax;
|
|
462
|
+
maxSpecialChars?: ValidFieldMinMax;
|
|
463
|
+
checkEqualTo?: ValidFieldMinMax;
|
|
464
|
+
customButtonText?: string;
|
|
465
|
+
customButtonClass?: string;
|
|
387
466
|
}
|
|
388
467
|
|
|
389
|
-
declare enum ItemCrudView {
|
|
390
|
-
Inline = "inline",
|
|
391
|
-
Modal = "modal"
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
declare enum ItemCrudMode {
|
|
395
|
-
Create = "create",
|
|
396
|
-
Update = "update",
|
|
397
|
-
Read = "read"
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
declare enum ItemCrudButtonNavPosition {
|
|
401
|
-
Top = "top",
|
|
402
|
-
Bottom = "bottom"
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
declare enum ItemCrudButtonNavVisibility {
|
|
406
|
-
Changed = "changed",
|
|
407
|
-
Always = "always",
|
|
408
|
-
Never = "never"
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
declare enum SaveType {
|
|
412
|
-
Manual = "manual",
|
|
413
|
-
Auto = "auto",
|
|
414
|
-
Delay = "delay"
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
interface SaveConfig {
|
|
418
|
-
type?: SaveType;
|
|
419
|
-
delay?: number;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
interface ItemCrudConfig {
|
|
423
|
-
modelValue: LktObject;
|
|
424
|
-
editing: boolean;
|
|
425
|
-
mode: ItemCrudMode;
|
|
426
|
-
view: ItemCrudView;
|
|
427
|
-
editModeButton: ButtonConfig;
|
|
428
|
-
dropButton: ButtonConfig;
|
|
429
|
-
createButton: ButtonConfig;
|
|
430
|
-
updateButton: ButtonConfig;
|
|
431
|
-
buttonNavPosition?: ItemCrudButtonNavPosition;
|
|
432
|
-
buttonNavVisibility?: ItemCrudButtonNavVisibility;
|
|
433
|
-
modalConfig: ModalConfig;
|
|
434
|
-
saveConfig: SaveConfig;
|
|
435
|
-
dataStateConfig: DataStateConfig;
|
|
436
|
-
readResource: string;
|
|
437
|
-
readData: LktObject;
|
|
438
|
-
title: string;
|
|
439
|
-
beforeEmitUpdate: Function | undefined;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
declare enum PaginatorType {
|
|
443
|
-
Pages = "pages",
|
|
444
|
-
PrevNext = "prev-next",
|
|
445
|
-
PagesPrevNext = "pages-prev-next",
|
|
446
|
-
PagesPrevNextFirstLast = "pages-prev-next-first-last",
|
|
447
|
-
LoadMore = "load-more",
|
|
448
|
-
Infinite = "infinite"
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
interface PaginatorConfig {
|
|
452
|
-
type?: PaginatorType;
|
|
453
|
-
modelValue?: number;
|
|
454
|
-
class?: string;
|
|
455
|
-
resource?: string;
|
|
456
|
-
readOnly?: boolean;
|
|
457
|
-
loading?: boolean;
|
|
458
|
-
filters?: LktObject;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
type ValidDrag = boolean | ((item: LktObject) => boolean);
|
|
462
|
-
|
|
463
|
-
interface DragConfig {
|
|
464
|
-
enabled: boolean;
|
|
465
|
-
isDraggable?: ValidDrag;
|
|
466
|
-
isValid?: ValidDrag;
|
|
467
|
-
isDisabled?: boolean | Function;
|
|
468
|
-
canRender?: boolean | Function;
|
|
469
|
-
dragKey?: string;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
declare enum ColumnType {
|
|
473
|
-
None = "",
|
|
474
|
-
Field = "field",
|
|
475
|
-
Button = "button",
|
|
476
|
-
Anchor = "anchor"
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
type ValidColSpan = Function | boolean | number | undefined;
|
|
480
|
-
|
|
481
468
|
declare class SafeString {
|
|
482
469
|
private readonly value;
|
|
483
470
|
constructor(input: ValidSafeStringValue);
|
|
@@ -508,6 +495,7 @@ declare class Field extends LktItem implements FieldConfig {
|
|
|
508
495
|
canUndo: boolean;
|
|
509
496
|
canI18n: boolean;
|
|
510
497
|
canStep: boolean;
|
|
498
|
+
canTag: boolean;
|
|
511
499
|
mandatoryMessage: string;
|
|
512
500
|
infoMessage: string;
|
|
513
501
|
errorMessage: string;
|
|
@@ -552,7 +540,9 @@ declare class Field extends LktItem implements FieldConfig {
|
|
|
552
540
|
optionsDownload: string | Function;
|
|
553
541
|
optionsModal: string | Function;
|
|
554
542
|
optionsModalData: LktObject | Function;
|
|
543
|
+
optionsText: string | Function;
|
|
555
544
|
optionsIcon: string | Function;
|
|
545
|
+
optionsClass: string | Function;
|
|
556
546
|
optionsLabelFormatter: undefined;
|
|
557
547
|
optionsResource: string;
|
|
558
548
|
optionsResourceData: LktObject;
|
|
@@ -562,6 +552,7 @@ declare class Field extends LktItem implements FieldConfig {
|
|
|
562
552
|
modalKey: string | number | Function;
|
|
563
553
|
modalData: LktObject;
|
|
564
554
|
data: LktObject;
|
|
555
|
+
validation: FieldValidationConfig;
|
|
565
556
|
constructor(data?: Partial<FieldConfig>);
|
|
566
557
|
}
|
|
567
558
|
|
|
@@ -587,7 +578,11 @@ declare class Button extends LktItem implements ButtonConfig {
|
|
|
587
578
|
confirmModalKey: ValidModalKey;
|
|
588
579
|
confirmData: Partial<ModalConfig>;
|
|
589
580
|
modalCallbacks?: Array<ModalCallbackConfig>;
|
|
590
|
-
text: string;
|
|
581
|
+
text: string | number;
|
|
582
|
+
textOn: string | number | undefined;
|
|
583
|
+
textOff: string | number | undefined;
|
|
584
|
+
iconOn: string | number | undefined;
|
|
585
|
+
iconOff: string | number | undefined;
|
|
591
586
|
icon: string;
|
|
592
587
|
iconDot: boolean;
|
|
593
588
|
iconEnd: string;
|
|
@@ -630,6 +625,89 @@ interface ColumnConfig {
|
|
|
630
625
|
action?: Function;
|
|
631
626
|
}
|
|
632
627
|
|
|
628
|
+
type ValidDrag = boolean | ((item: LktObject) => boolean);
|
|
629
|
+
|
|
630
|
+
interface DragConfig {
|
|
631
|
+
enabled: boolean;
|
|
632
|
+
isDraggable?: ValidDrag;
|
|
633
|
+
isValid?: ValidDrag;
|
|
634
|
+
isDisabled?: boolean | Function;
|
|
635
|
+
canRender?: boolean | Function;
|
|
636
|
+
dragKey?: string;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
declare enum ItemCrudView {
|
|
640
|
+
Inline = "inline",
|
|
641
|
+
Modal = "modal"
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
declare enum ItemCrudMode {
|
|
645
|
+
Create = "create",
|
|
646
|
+
Update = "update",
|
|
647
|
+
Read = "read"
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
declare enum ItemCrudButtonNavPosition {
|
|
651
|
+
Top = "top",
|
|
652
|
+
Bottom = "bottom"
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
declare enum ItemCrudButtonNavVisibility {
|
|
656
|
+
Changed = "changed",
|
|
657
|
+
Always = "always",
|
|
658
|
+
Never = "never"
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
declare enum SaveType {
|
|
662
|
+
Manual = "manual",
|
|
663
|
+
Auto = "auto",
|
|
664
|
+
Delay = "delay"
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
interface SaveConfig {
|
|
668
|
+
type?: SaveType;
|
|
669
|
+
delay?: number;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
interface ItemCrudConfig {
|
|
673
|
+
modelValue: LktObject;
|
|
674
|
+
editing: boolean;
|
|
675
|
+
mode: ItemCrudMode;
|
|
676
|
+
view: ItemCrudView;
|
|
677
|
+
editModeButton: ButtonConfig;
|
|
678
|
+
dropButton: ButtonConfig;
|
|
679
|
+
createButton: ButtonConfig;
|
|
680
|
+
updateButton: ButtonConfig;
|
|
681
|
+
buttonNavPosition?: ItemCrudButtonNavPosition;
|
|
682
|
+
buttonNavVisibility?: ItemCrudButtonNavVisibility;
|
|
683
|
+
modalConfig: ModalConfig;
|
|
684
|
+
saveConfig: SaveConfig;
|
|
685
|
+
dataStateConfig: DataStateConfig;
|
|
686
|
+
readResource: string;
|
|
687
|
+
readData: LktObject;
|
|
688
|
+
title: string;
|
|
689
|
+
beforeEmitUpdate: Function | undefined;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
declare enum PaginatorType {
|
|
693
|
+
Pages = "pages",
|
|
694
|
+
PrevNext = "prev-next",
|
|
695
|
+
PagesPrevNext = "pages-prev-next",
|
|
696
|
+
PagesPrevNextFirstLast = "pages-prev-next-first-last",
|
|
697
|
+
LoadMore = "load-more",
|
|
698
|
+
Infinite = "infinite"
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
interface PaginatorConfig {
|
|
702
|
+
type?: PaginatorType;
|
|
703
|
+
modelValue?: number;
|
|
704
|
+
class?: string;
|
|
705
|
+
resource?: string;
|
|
706
|
+
readOnly?: boolean;
|
|
707
|
+
loading?: boolean;
|
|
708
|
+
filters?: LktObject;
|
|
709
|
+
}
|
|
710
|
+
|
|
633
711
|
declare enum TableType {
|
|
634
712
|
Table = "table",
|
|
635
713
|
Item = "item",
|
|
@@ -756,6 +834,62 @@ declare class LktStrictItem extends LktItem {
|
|
|
756
834
|
lktStrictItem: boolean;
|
|
757
835
|
}
|
|
758
836
|
|
|
837
|
+
declare enum ValidationCode {
|
|
838
|
+
MinStringLength = "min-str",
|
|
839
|
+
MinNumber = "min-num",
|
|
840
|
+
MaxStringLength = "max-str",
|
|
841
|
+
MaxNumber = "max-num",
|
|
842
|
+
Email = "email",
|
|
843
|
+
Empty = "empty",
|
|
844
|
+
EqualTo = "equal-to",
|
|
845
|
+
MinNumbers = "min-numbers",
|
|
846
|
+
MaxNumbers = "max-numbers",
|
|
847
|
+
MinChars = "min-chars",
|
|
848
|
+
MaxChars = "max-chars",
|
|
849
|
+
MinUpperChars = "min-upper-chars",
|
|
850
|
+
MaxUpperChars = "max-upper-chars",
|
|
851
|
+
MinLowerChars = "min-lower-chars",
|
|
852
|
+
MaxLowerChars = "max-lower-chars",
|
|
853
|
+
MinSpecialChars = "min-special-chars",
|
|
854
|
+
MaxSpecialChars = "max-special-chars"
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
declare enum ValidationStatus {
|
|
858
|
+
Ok = "ok",
|
|
859
|
+
Ko = "ko",
|
|
860
|
+
Info = "info"
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
declare class FieldValidation {
|
|
864
|
+
code?: ValidationCode | string;
|
|
865
|
+
status: ValidationStatus;
|
|
866
|
+
min: number;
|
|
867
|
+
max: number;
|
|
868
|
+
equalToValue: number | string | undefined;
|
|
869
|
+
constructor(code: ValidationCode, status: ValidationStatus);
|
|
870
|
+
setMin(n: number): this;
|
|
871
|
+
setMax(n: number): this;
|
|
872
|
+
setEqualToValue(val: number | string): this;
|
|
873
|
+
static createEmpty(status?: ValidationStatus): FieldValidation;
|
|
874
|
+
static createEmail(status?: ValidationStatus): FieldValidation;
|
|
875
|
+
static createMinStr(min: number, status?: ValidationStatus): FieldValidation;
|
|
876
|
+
static createMaxStr(max: number, status?: ValidationStatus): FieldValidation;
|
|
877
|
+
static createMinNum(min: number, status?: ValidationStatus): FieldValidation;
|
|
878
|
+
static createMaxNum(max: number, status?: ValidationStatus): FieldValidation;
|
|
879
|
+
static createNumBetween(min: number, max: number, status?: ValidationStatus): FieldValidation;
|
|
880
|
+
static createMinNumbers(min: number, status?: ValidationStatus): FieldValidation;
|
|
881
|
+
static createMaxNumbers(max: number, status?: ValidationStatus): FieldValidation;
|
|
882
|
+
static createMinUpperChars(min: number, status?: ValidationStatus): FieldValidation;
|
|
883
|
+
static createMaxUpperChars(max: number, status?: ValidationStatus): FieldValidation;
|
|
884
|
+
static createMinLowerChars(min: number, status?: ValidationStatus): FieldValidation;
|
|
885
|
+
static createMaxLowerChars(max: number, status?: ValidationStatus): FieldValidation;
|
|
886
|
+
static createMinSpecialChars(min: number, status?: ValidationStatus): FieldValidation;
|
|
887
|
+
static createMaxSpecialChars(max: number, status?: ValidationStatus): FieldValidation;
|
|
888
|
+
static createMinChars(min: number, status?: ValidationStatus): FieldValidation;
|
|
889
|
+
static createMaxChars(max: number, status?: ValidationStatus): FieldValidation;
|
|
890
|
+
static createEqualTo(value: number | string, status?: ValidationStatus): FieldValidation;
|
|
891
|
+
}
|
|
892
|
+
|
|
759
893
|
declare class Tooltip extends LktItem implements TooltipConfig {
|
|
760
894
|
static lktDefaultValues: (keyof TooltipConfig)[];
|
|
761
895
|
modelValue: boolean;
|
|
@@ -921,4 +1055,4 @@ declare function getDefaultValues<T>(cls: {
|
|
|
921
1055
|
lktDefaultValues: (keyof T)[];
|
|
922
1056
|
}): Partial<T>;
|
|
923
1057
|
|
|
924
|
-
export { Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, getDefaultValues, lktDebug };
|
|
1058
|
+
export { type AccordionConfig, AccordionToggleMode, AccordionType, Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, FieldValidation, type FieldValidationConfig, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, ValidationCode, ValidationStatus, booleanFieldTypes, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, fieldTypesWithOptions, fieldTypesWithoutClear, fieldTypesWithoutUndo, fieldsWithMultipleMode, getDefaultValues, lktDebug, textFieldTypes, textFieldTypesWithOptions };
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,63 @@ var LktSettings = class _LktSettings {
|
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
// src/enums/FieldType.ts
|
|
116
|
+
var FieldType = /* @__PURE__ */ ((FieldType2) => {
|
|
117
|
+
FieldType2["Text"] = "text";
|
|
118
|
+
FieldType2["Email"] = "email";
|
|
119
|
+
FieldType2["Tel"] = "tel";
|
|
120
|
+
FieldType2["Password"] = "password";
|
|
121
|
+
FieldType2["Search"] = "search";
|
|
122
|
+
FieldType2["Number"] = "number";
|
|
123
|
+
FieldType2["Color"] = "color";
|
|
124
|
+
FieldType2["Range"] = "range";
|
|
125
|
+
FieldType2["Textarea"] = "textarea";
|
|
126
|
+
FieldType2["Html"] = "html";
|
|
127
|
+
FieldType2["Date"] = "date";
|
|
128
|
+
FieldType2["File"] = "file";
|
|
129
|
+
FieldType2["Image"] = "image";
|
|
130
|
+
FieldType2["Select"] = "select";
|
|
131
|
+
FieldType2["Check"] = "check";
|
|
132
|
+
FieldType2["Switch"] = "switch";
|
|
133
|
+
FieldType2["Calc"] = "calc";
|
|
134
|
+
FieldType2["Card"] = "card";
|
|
135
|
+
FieldType2["Elements"] = "elements";
|
|
136
|
+
return FieldType2;
|
|
137
|
+
})(FieldType || {});
|
|
138
|
+
|
|
139
|
+
// src/constants/field-constants.ts
|
|
140
|
+
var fieldTypesWithOptions = [
|
|
141
|
+
"text" /* Text */,
|
|
142
|
+
"search" /* Search */,
|
|
143
|
+
"select" /* Select */
|
|
144
|
+
];
|
|
145
|
+
var fieldTypesWithoutClear = [
|
|
146
|
+
"switch" /* Switch */,
|
|
147
|
+
"check" /* Check */
|
|
148
|
+
];
|
|
149
|
+
var fieldTypesWithoutUndo = [
|
|
150
|
+
"switch" /* Switch */,
|
|
151
|
+
"check" /* Check */
|
|
152
|
+
];
|
|
153
|
+
var textFieldTypesWithOptions = [
|
|
154
|
+
"text" /* Text */,
|
|
155
|
+
"search" /* Search */
|
|
156
|
+
];
|
|
157
|
+
var booleanFieldTypes = [
|
|
158
|
+
"switch" /* Switch */,
|
|
159
|
+
"check" /* Check */
|
|
160
|
+
];
|
|
161
|
+
var fieldsWithMultipleMode = [
|
|
162
|
+
"select" /* Select */,
|
|
163
|
+
"color" /* Color */,
|
|
164
|
+
"card" /* Card */
|
|
165
|
+
];
|
|
166
|
+
var textFieldTypes = [
|
|
167
|
+
"text" /* Text */,
|
|
168
|
+
"email" /* Email */,
|
|
169
|
+
"password" /* Password */
|
|
170
|
+
];
|
|
171
|
+
|
|
115
172
|
// src/instances/LktItem.ts
|
|
116
173
|
var skipDataProps = [
|
|
117
174
|
"lktDateProps",
|
|
@@ -161,30 +218,6 @@ var Option = class extends LktItem {
|
|
|
161
218
|
}
|
|
162
219
|
};
|
|
163
220
|
|
|
164
|
-
// src/enums/FieldType.ts
|
|
165
|
-
var FieldType = /* @__PURE__ */ ((FieldType2) => {
|
|
166
|
-
FieldType2["Text"] = "text";
|
|
167
|
-
FieldType2["Email"] = "email";
|
|
168
|
-
FieldType2["Tel"] = "tel";
|
|
169
|
-
FieldType2["Password"] = "password";
|
|
170
|
-
FieldType2["Search"] = "search";
|
|
171
|
-
FieldType2["Number"] = "number";
|
|
172
|
-
FieldType2["Color"] = "color";
|
|
173
|
-
FieldType2["Range"] = "range";
|
|
174
|
-
FieldType2["Textarea"] = "textarea";
|
|
175
|
-
FieldType2["Html"] = "html";
|
|
176
|
-
FieldType2["Date"] = "date";
|
|
177
|
-
FieldType2["File"] = "file";
|
|
178
|
-
FieldType2["Image"] = "image";
|
|
179
|
-
FieldType2["Select"] = "select";
|
|
180
|
-
FieldType2["Check"] = "check";
|
|
181
|
-
FieldType2["Switch"] = "switch";
|
|
182
|
-
FieldType2["Calc"] = "calc";
|
|
183
|
-
FieldType2["Card"] = "card";
|
|
184
|
-
FieldType2["Elements"] = "elements";
|
|
185
|
-
return FieldType2;
|
|
186
|
-
})(FieldType || {});
|
|
187
|
-
|
|
188
221
|
// src/instances/Field.ts
|
|
189
222
|
import { generateRandomString } from "lkt-string-tools";
|
|
190
223
|
|
|
@@ -228,6 +261,7 @@ var Field = class extends LktItem {
|
|
|
228
261
|
canUndo = false;
|
|
229
262
|
canI18n = false;
|
|
230
263
|
canStep = true;
|
|
264
|
+
canTag = true;
|
|
231
265
|
mandatoryMessage = "";
|
|
232
266
|
infoMessage = "";
|
|
233
267
|
errorMessage = "";
|
|
@@ -272,7 +306,9 @@ var Field = class extends LktItem {
|
|
|
272
306
|
optionsDownload = "";
|
|
273
307
|
optionsModal = "";
|
|
274
308
|
optionsModalData = {};
|
|
309
|
+
optionsText = "";
|
|
275
310
|
optionsIcon = "";
|
|
311
|
+
optionsClass = "";
|
|
276
312
|
optionsLabelFormatter = void 0;
|
|
277
313
|
optionsResource = "";
|
|
278
314
|
optionsResourceData = {};
|
|
@@ -282,12 +318,122 @@ var Field = class extends LktItem {
|
|
|
282
318
|
modalKey = "";
|
|
283
319
|
modalData = {};
|
|
284
320
|
data = {};
|
|
321
|
+
validation = {};
|
|
285
322
|
constructor(data = {}) {
|
|
286
323
|
super();
|
|
287
324
|
this.feed(data);
|
|
288
325
|
}
|
|
289
326
|
};
|
|
290
327
|
|
|
328
|
+
// src/enums/ValidationCode.ts
|
|
329
|
+
var ValidationCode = /* @__PURE__ */ ((ValidationCode2) => {
|
|
330
|
+
ValidationCode2["MinStringLength"] = "min-str";
|
|
331
|
+
ValidationCode2["MinNumber"] = "min-num";
|
|
332
|
+
ValidationCode2["MaxStringLength"] = "max-str";
|
|
333
|
+
ValidationCode2["MaxNumber"] = "max-num";
|
|
334
|
+
ValidationCode2["Email"] = "email";
|
|
335
|
+
ValidationCode2["Empty"] = "empty";
|
|
336
|
+
ValidationCode2["EqualTo"] = "equal-to";
|
|
337
|
+
ValidationCode2["MinNumbers"] = "min-numbers";
|
|
338
|
+
ValidationCode2["MaxNumbers"] = "max-numbers";
|
|
339
|
+
ValidationCode2["MinChars"] = "min-chars";
|
|
340
|
+
ValidationCode2["MaxChars"] = "max-chars";
|
|
341
|
+
ValidationCode2["MinUpperChars"] = "min-upper-chars";
|
|
342
|
+
ValidationCode2["MaxUpperChars"] = "max-upper-chars";
|
|
343
|
+
ValidationCode2["MinLowerChars"] = "min-lower-chars";
|
|
344
|
+
ValidationCode2["MaxLowerChars"] = "max-lower-chars";
|
|
345
|
+
ValidationCode2["MinSpecialChars"] = "min-special-chars";
|
|
346
|
+
ValidationCode2["MaxSpecialChars"] = "max-special-chars";
|
|
347
|
+
return ValidationCode2;
|
|
348
|
+
})(ValidationCode || {});
|
|
349
|
+
|
|
350
|
+
// src/enums/ValidationStatus.ts
|
|
351
|
+
var ValidationStatus = /* @__PURE__ */ ((ValidationStatus2) => {
|
|
352
|
+
ValidationStatus2["Ok"] = "ok";
|
|
353
|
+
ValidationStatus2["Ko"] = "ko";
|
|
354
|
+
ValidationStatus2["Info"] = "info";
|
|
355
|
+
return ValidationStatus2;
|
|
356
|
+
})(ValidationStatus || {});
|
|
357
|
+
|
|
358
|
+
// src/instances/FieldValidation.ts
|
|
359
|
+
var FieldValidation = class _FieldValidation {
|
|
360
|
+
code = void 0;
|
|
361
|
+
status = "info" /* Info */;
|
|
362
|
+
min = 0;
|
|
363
|
+
max = 0;
|
|
364
|
+
equalToValue = void 0;
|
|
365
|
+
constructor(code, status) {
|
|
366
|
+
this.code = code;
|
|
367
|
+
this.status = status;
|
|
368
|
+
}
|
|
369
|
+
setMin(n) {
|
|
370
|
+
this.min = n;
|
|
371
|
+
return this;
|
|
372
|
+
}
|
|
373
|
+
setMax(n) {
|
|
374
|
+
this.max = n;
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
setEqualToValue(val) {
|
|
378
|
+
this.equalToValue = val;
|
|
379
|
+
return this;
|
|
380
|
+
}
|
|
381
|
+
static createEmpty(status = "ko" /* Ko */) {
|
|
382
|
+
return new _FieldValidation("empty" /* Empty */, status);
|
|
383
|
+
}
|
|
384
|
+
static createEmail(status = "ko" /* Ko */) {
|
|
385
|
+
return new _FieldValidation("email" /* Email */, status);
|
|
386
|
+
}
|
|
387
|
+
static createMinStr(min, status = "ko" /* Ko */) {
|
|
388
|
+
return new _FieldValidation("min-str" /* MinStringLength */, status).setMin(min);
|
|
389
|
+
}
|
|
390
|
+
static createMaxStr(max, status = "ko" /* Ko */) {
|
|
391
|
+
return new _FieldValidation("max-str" /* MaxStringLength */, status).setMax(max);
|
|
392
|
+
}
|
|
393
|
+
static createMinNum(min, status = "ko" /* Ko */) {
|
|
394
|
+
return new _FieldValidation("min-num" /* MinNumber */, status).setMin(min);
|
|
395
|
+
}
|
|
396
|
+
static createMaxNum(max, status = "ko" /* Ko */) {
|
|
397
|
+
return new _FieldValidation("max-num" /* MaxNumber */, status).setMax(max);
|
|
398
|
+
}
|
|
399
|
+
static createNumBetween(min, max, status = "ko" /* Ko */) {
|
|
400
|
+
return new _FieldValidation("max-num" /* MaxNumber */, status).setMin(min).setMax(max);
|
|
401
|
+
}
|
|
402
|
+
static createMinNumbers(min, status = "ko" /* Ko */) {
|
|
403
|
+
return new _FieldValidation("min-numbers" /* MinNumbers */, status).setMin(min);
|
|
404
|
+
}
|
|
405
|
+
static createMaxNumbers(max, status = "ko" /* Ko */) {
|
|
406
|
+
return new _FieldValidation("max-numbers" /* MaxNumbers */, status).setMax(max);
|
|
407
|
+
}
|
|
408
|
+
static createMinUpperChars(min, status = "ko" /* Ko */) {
|
|
409
|
+
return new _FieldValidation("min-upper-chars" /* MinUpperChars */, status).setMin(min);
|
|
410
|
+
}
|
|
411
|
+
static createMaxUpperChars(max, status = "ko" /* Ko */) {
|
|
412
|
+
return new _FieldValidation("max-upper-chars" /* MaxUpperChars */, status).setMax(max);
|
|
413
|
+
}
|
|
414
|
+
static createMinLowerChars(min, status = "ko" /* Ko */) {
|
|
415
|
+
return new _FieldValidation("min-lower-chars" /* MinLowerChars */, status).setMin(min);
|
|
416
|
+
}
|
|
417
|
+
static createMaxLowerChars(max, status = "ko" /* Ko */) {
|
|
418
|
+
return new _FieldValidation("max-lower-chars" /* MaxLowerChars */, status).setMax(max);
|
|
419
|
+
}
|
|
420
|
+
static createMinSpecialChars(min, status = "ko" /* Ko */) {
|
|
421
|
+
return new _FieldValidation("min-special-chars" /* MinSpecialChars */, status).setMin(min);
|
|
422
|
+
}
|
|
423
|
+
static createMaxSpecialChars(max, status = "ko" /* Ko */) {
|
|
424
|
+
return new _FieldValidation("max-special-chars" /* MaxSpecialChars */, status).setMax(max);
|
|
425
|
+
}
|
|
426
|
+
static createMinChars(min, status = "ko" /* Ko */) {
|
|
427
|
+
return new _FieldValidation("min-chars" /* MinChars */, status).setMin(min);
|
|
428
|
+
}
|
|
429
|
+
static createMaxChars(max, status = "ko" /* Ko */) {
|
|
430
|
+
return new _FieldValidation("max-chars" /* MaxChars */, status).setMax(max);
|
|
431
|
+
}
|
|
432
|
+
static createEqualTo(value, status = "ko" /* Ko */) {
|
|
433
|
+
return new _FieldValidation("equal-to" /* EqualTo */, status).setEqualToValue(value);
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
|
|
291
437
|
// src/enums/ColumnType.ts
|
|
292
438
|
var ColumnType = /* @__PURE__ */ ((ColumnType2) => {
|
|
293
439
|
ColumnType2["None"] = "";
|
|
@@ -414,7 +560,11 @@ var Button = class extends LktItem {
|
|
|
414
560
|
"confirmData",
|
|
415
561
|
"modalCallbacks",
|
|
416
562
|
"text",
|
|
563
|
+
"textOn",
|
|
564
|
+
"textOff",
|
|
417
565
|
"icon",
|
|
566
|
+
"iconOn",
|
|
567
|
+
"iconOff",
|
|
418
568
|
"iconDot",
|
|
419
569
|
"iconEnd",
|
|
420
570
|
"img",
|
|
@@ -452,6 +602,10 @@ var Button = class extends LktItem {
|
|
|
452
602
|
confirmData = {};
|
|
453
603
|
modalCallbacks = [];
|
|
454
604
|
text = "";
|
|
605
|
+
textOn = void 0;
|
|
606
|
+
textOff = void 0;
|
|
607
|
+
iconOn = void 0;
|
|
608
|
+
iconOff = void 0;
|
|
455
609
|
icon = "";
|
|
456
610
|
iconDot = false;
|
|
457
611
|
iconEnd = "";
|
|
@@ -930,6 +1084,23 @@ var Table = class extends LktItem {
|
|
|
930
1084
|
}
|
|
931
1085
|
};
|
|
932
1086
|
|
|
1087
|
+
// src/enums/AccordionToggleMode.ts
|
|
1088
|
+
var AccordionToggleMode = /* @__PURE__ */ ((AccordionToggleMode2) => {
|
|
1089
|
+
AccordionToggleMode2["Transform"] = "transform";
|
|
1090
|
+
AccordionToggleMode2["Height"] = "height";
|
|
1091
|
+
AccordionToggleMode2["Display"] = "display";
|
|
1092
|
+
return AccordionToggleMode2;
|
|
1093
|
+
})(AccordionToggleMode || {});
|
|
1094
|
+
|
|
1095
|
+
// src/enums/AccordionType.ts
|
|
1096
|
+
var AccordionType = /* @__PURE__ */ ((AccordionType2) => {
|
|
1097
|
+
AccordionType2["Auto"] = "auto";
|
|
1098
|
+
AccordionType2["Always"] = "always";
|
|
1099
|
+
AccordionType2["Lazy"] = "lazy";
|
|
1100
|
+
AccordionType2["Ever"] = "ever";
|
|
1101
|
+
return AccordionType2;
|
|
1102
|
+
})(AccordionType || {});
|
|
1103
|
+
|
|
933
1104
|
// src/enums/ModalCallbackAction.ts
|
|
934
1105
|
var ModalCallbackAction = /* @__PURE__ */ ((ModalCallbackAction2) => {
|
|
935
1106
|
ModalCallbackAction2["Refresh"] = "refresh";
|
|
@@ -1017,6 +1188,8 @@ function getDefaultValues(cls) {
|
|
|
1017
1188
|
return result;
|
|
1018
1189
|
}
|
|
1019
1190
|
export {
|
|
1191
|
+
AccordionToggleMode,
|
|
1192
|
+
AccordionType,
|
|
1020
1193
|
Anchor,
|
|
1021
1194
|
AnchorType,
|
|
1022
1195
|
Button,
|
|
@@ -1026,6 +1199,7 @@ export {
|
|
|
1026
1199
|
Field,
|
|
1027
1200
|
FieldAutoValidationTrigger,
|
|
1028
1201
|
FieldType,
|
|
1202
|
+
FieldValidation,
|
|
1029
1203
|
ItemCrud,
|
|
1030
1204
|
ItemCrudButtonNavPosition,
|
|
1031
1205
|
ItemCrudButtonNavVisibility,
|
|
@@ -1053,10 +1227,19 @@ export {
|
|
|
1053
1227
|
TooltipLocationX,
|
|
1054
1228
|
TooltipLocationY,
|
|
1055
1229
|
TooltipPositionEngine,
|
|
1230
|
+
ValidationCode,
|
|
1231
|
+
ValidationStatus,
|
|
1232
|
+
booleanFieldTypes,
|
|
1056
1233
|
createColumn,
|
|
1057
1234
|
ensureButtonConfig,
|
|
1058
1235
|
extractI18nValue,
|
|
1059
1236
|
extractPropValue,
|
|
1237
|
+
fieldTypesWithOptions,
|
|
1238
|
+
fieldTypesWithoutClear,
|
|
1239
|
+
fieldTypesWithoutUndo,
|
|
1240
|
+
fieldsWithMultipleMode,
|
|
1060
1241
|
getDefaultValues,
|
|
1061
|
-
lktDebug
|
|
1242
|
+
lktDebug,
|
|
1243
|
+
textFieldTypes,
|
|
1244
|
+
textFieldTypesWithOptions
|
|
1062
1245
|
};
|