@saltcorn/data 1.0.0-beta.8 → 1.0.0-rc.1
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/base-plugin/actions.d.ts +45 -0
- package/dist/base-plugin/actions.d.ts.map +1 -1
- package/dist/base-plugin/actions.js +23 -0
- package/dist/base-plugin/actions.js.map +1 -1
- package/dist/base-plugin/index.d.ts +146 -118
- package/dist/base-plugin/index.d.ts.map +1 -1
- package/dist/base-plugin/types.d.ts +16 -1
- package/dist/base-plugin/types.d.ts.map +1 -1
- package/dist/base-plugin/types.js +53 -13
- package/dist/base-plugin/types.js.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.js +17 -19
- package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
- package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/filter.js +8 -7
- package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
- package/dist/base-plugin/viewtemplates/list.d.ts +1 -1
- package/dist/base-plugin/viewtemplates/list.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/list.js +26 -24
- package/dist/base-plugin/viewtemplates/list.js.map +1 -1
- package/dist/base-plugin/viewtemplates/room.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/room.js +0 -1
- package/dist/base-plugin/viewtemplates/room.js.map +1 -1
- package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/show.js +32 -22
- package/dist/base-plugin/viewtemplates/show.js.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/viewable_fields.js +7 -3
- package/dist/base-plugin/viewtemplates/viewable_fields.js.map +1 -1
- package/dist/db/state.d.ts +14 -9
- package/dist/db/state.d.ts.map +1 -1
- package/dist/db/state.js +107 -63
- package/dist/db/state.js.map +1 -1
- package/dist/migrate.d.ts.map +1 -1
- package/dist/migrate.js +21 -21
- package/dist/migrate.js.map +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +21 -1
- package/dist/models/config.js.map +1 -1
- package/dist/models/email.d.ts +1 -1
- package/dist/models/expression.d.ts.map +1 -1
- package/dist/models/expression.js +32 -6
- package/dist/models/expression.js.map +1 -1
- package/dist/models/field.d.ts.map +1 -1
- package/dist/models/field.js +4 -1
- package/dist/models/field.js.map +1 -1
- package/dist/models/fieldrepeat.d.ts.map +1 -1
- package/dist/models/fieldrepeat.js +6 -1
- package/dist/models/fieldrepeat.js.map +1 -1
- package/dist/models/index.d.ts +7 -3
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/internal/query.d.ts.map +1 -1
- package/dist/models/internal/query.js +6 -5
- package/dist/models/internal/query.js.map +1 -1
- package/dist/models/plugin.d.ts +2 -1
- package/dist/models/plugin.d.ts.map +1 -1
- package/dist/models/plugin.js +9 -2
- package/dist/models/plugin.js.map +1 -1
- package/dist/models/scheduler.d.ts +7 -11
- package/dist/models/scheduler.d.ts.map +1 -1
- package/dist/models/scheduler.js +26 -1
- package/dist/models/scheduler.js.map +1 -1
- package/dist/models/table.d.ts +1 -1
- package/dist/models/table.d.ts.map +1 -1
- package/dist/models/table.js +9 -7
- package/dist/models/table.js.map +1 -1
- package/dist/models/tag.d.ts.map +1 -1
- package/dist/models/tag.js +3 -0
- package/dist/models/tag.js.map +1 -1
- package/dist/models/trigger.d.ts +17 -0
- package/dist/models/trigger.d.ts.map +1 -1
- package/dist/models/trigger.js +63 -1
- package/dist/models/trigger.js.map +1 -1
- package/dist/models/user.d.ts +1 -1
- package/dist/models/user.d.ts.map +1 -1
- package/dist/models/user.js +17 -6
- package/dist/models/user.js.map +1 -1
- package/dist/plugin-helper.d.ts +25 -1
- package/dist/plugin-helper.d.ts.map +1 -1
- package/dist/plugin-helper.js +77 -7
- package/dist/plugin-helper.js.map +1 -1
- package/dist/tests/actions.test.js +66 -1
- package/dist/tests/actions.test.js.map +1 -1
- package/dist/tests/auxtest.test.js +44 -2
- package/dist/tests/auxtest.test.js.map +1 -1
- package/dist/tests/calc.test.js +26 -1
- package/dist/tests/calc.test.js.map +1 -1
- package/dist/tests/exact_views.test.js +7 -7
- package/dist/tests/exact_views.test.js.map +1 -1
- package/dist/tests/field.test.js +9 -0
- package/dist/tests/field.test.js.map +1 -1
- package/dist/tests/mocks.d.ts +13 -0
- package/dist/tests/mocks.d.ts.map +1 -1
- package/dist/tests/mocks.js +8 -0
- package/dist/tests/mocks.js.map +1 -1
- package/dist/tests/show.test.js +182 -3
- package/dist/tests/show.test.js.map +1 -1
- package/dist/tests/table.test.js +25 -0
- package/dist/tests/table.test.js.map +1 -1
- package/dist/tests/table_history.test.js +2 -0
- package/dist/tests/table_history.test.js.map +1 -1
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +32 -3
- package/dist/utils.js.map +1 -1
- package/package.json +8 -8
|
@@ -490,9 +490,21 @@ export const types: ({
|
|
|
490
490
|
required: boolean;
|
|
491
491
|
attributes: {
|
|
492
492
|
options: string[];
|
|
493
|
+
min?: undefined;
|
|
493
494
|
};
|
|
494
495
|
sublabel?: undefined;
|
|
495
496
|
showIf?: undefined;
|
|
497
|
+
} | {
|
|
498
|
+
type: string;
|
|
499
|
+
name: string;
|
|
500
|
+
label: string;
|
|
501
|
+
attributes: {
|
|
502
|
+
min: number;
|
|
503
|
+
options?: undefined;
|
|
504
|
+
};
|
|
505
|
+
sublabel?: undefined;
|
|
506
|
+
required?: undefined;
|
|
507
|
+
showIf?: undefined;
|
|
496
508
|
} | {
|
|
497
509
|
type: string;
|
|
498
510
|
name: string;
|
|
@@ -513,6 +525,7 @@ export const types: ({
|
|
|
513
525
|
};
|
|
514
526
|
attributes: {
|
|
515
527
|
options: string[];
|
|
528
|
+
min?: undefined;
|
|
516
529
|
};
|
|
517
530
|
sublabel?: undefined;
|
|
518
531
|
})[];
|
|
@@ -541,111 +554,7 @@ export const types: ({
|
|
|
541
554
|
show: {
|
|
542
555
|
isEdit: boolean;
|
|
543
556
|
description: string;
|
|
544
|
-
run: (
|
|
545
|
-
};
|
|
546
|
-
checkboxes: {
|
|
547
|
-
isEdit: boolean;
|
|
548
|
-
description: string;
|
|
549
|
-
run: (v: any) => any;
|
|
550
|
-
};
|
|
551
|
-
TrueFalse: {
|
|
552
|
-
isEdit: boolean;
|
|
553
|
-
description: string;
|
|
554
|
-
run: (v: any) => "" | "True" | "False";
|
|
555
|
-
};
|
|
556
|
-
edit: {
|
|
557
|
-
isEdit: boolean;
|
|
558
|
-
description: string;
|
|
559
|
-
configFields: ({
|
|
560
|
-
name: string;
|
|
561
|
-
label: string;
|
|
562
|
-
type: string;
|
|
563
|
-
attributes: {
|
|
564
|
-
options: string[];
|
|
565
|
-
};
|
|
566
|
-
} | {
|
|
567
|
-
name: string;
|
|
568
|
-
label: string;
|
|
569
|
-
type: string;
|
|
570
|
-
attributes?: undefined;
|
|
571
|
-
})[];
|
|
572
|
-
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
573
|
-
};
|
|
574
|
-
switch: {
|
|
575
|
-
isEdit: boolean;
|
|
576
|
-
description: string;
|
|
577
|
-
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
578
|
-
};
|
|
579
|
-
show_with_html: {
|
|
580
|
-
configFields: {
|
|
581
|
-
input_type: string;
|
|
582
|
-
name: string;
|
|
583
|
-
label: string;
|
|
584
|
-
sublabel: string;
|
|
585
|
-
default: string;
|
|
586
|
-
attributes: {
|
|
587
|
-
mode: string;
|
|
588
|
-
};
|
|
589
|
-
}[];
|
|
590
|
-
isEdit: boolean;
|
|
591
|
-
description: string;
|
|
592
|
-
run: (v: any, req: any, attrs?: {}) => any;
|
|
593
|
-
};
|
|
594
|
-
tristate: {
|
|
595
|
-
isEdit: boolean;
|
|
596
|
-
description: string;
|
|
597
|
-
configFields: {
|
|
598
|
-
name: string;
|
|
599
|
-
label: string;
|
|
600
|
-
type: string;
|
|
601
|
-
}[];
|
|
602
|
-
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
603
|
-
};
|
|
604
|
-
};
|
|
605
|
-
attributes: object[];
|
|
606
|
-
readFromFormRecord: (rec: any, name: string) => boolean | null;
|
|
607
|
-
read: (v: object) => boolean | null;
|
|
608
|
-
readFromDB: (v: object) => object;
|
|
609
|
-
listAs: (v: object) => object;
|
|
610
|
-
validate: () => boolean;
|
|
611
|
-
} | {
|
|
612
|
-
name: string;
|
|
613
|
-
description: string;
|
|
614
|
-
sql_name: string;
|
|
615
|
-
js_type: string;
|
|
616
|
-
contract: () => Function;
|
|
617
|
-
attributes: object[];
|
|
618
|
-
fieldviews: {
|
|
619
|
-
show: {
|
|
620
|
-
isEdit: boolean;
|
|
621
|
-
description: string;
|
|
622
|
-
run: (d: any, req: any, attrs?: {}) => any;
|
|
623
|
-
};
|
|
624
|
-
showDay: {
|
|
625
|
-
isEdit: boolean;
|
|
626
|
-
description: string;
|
|
627
|
-
run: (d: any, req: any) => any;
|
|
628
|
-
};
|
|
629
|
-
format: {
|
|
630
|
-
isEdit: boolean;
|
|
631
|
-
description: string;
|
|
632
|
-
configFields: {
|
|
633
|
-
name: string;
|
|
634
|
-
label: string;
|
|
635
|
-
type: string;
|
|
636
|
-
sublabel: string;
|
|
637
|
-
}[];
|
|
638
|
-
run: (d: any, req: any, options: any) => any;
|
|
639
|
-
};
|
|
640
|
-
relative: {
|
|
641
|
-
isEdit: boolean;
|
|
642
|
-
description: string;
|
|
643
|
-
run: (d: any, req: any) => string;
|
|
644
|
-
};
|
|
645
|
-
yearsAgo: {
|
|
646
|
-
isEdit: boolean;
|
|
647
|
-
description: string;
|
|
648
|
-
run: (d: any, req: any) => string;
|
|
557
|
+
run: (s: any) => any;
|
|
649
558
|
};
|
|
650
559
|
show_with_html: {
|
|
651
560
|
configFields: {
|
|
@@ -668,17 +577,9 @@ export const types: ({
|
|
|
668
577
|
description: string;
|
|
669
578
|
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
670
579
|
};
|
|
671
|
-
editDay: {
|
|
672
|
-
isEdit: boolean;
|
|
673
|
-
blockDisplay: boolean;
|
|
674
|
-
description: string;
|
|
675
|
-
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
676
|
-
};
|
|
677
580
|
};
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
};
|
|
681
|
-
read: (v: object, attrs: object) => object;
|
|
581
|
+
attributes: object[];
|
|
582
|
+
read: (v: object) => object;
|
|
682
583
|
validate: () => boolean;
|
|
683
584
|
} | {
|
|
684
585
|
name: string;
|
|
@@ -866,8 +767,20 @@ export const types: ({
|
|
|
866
767
|
required: boolean;
|
|
867
768
|
attributes: {
|
|
868
769
|
options: string[];
|
|
770
|
+
min?: undefined;
|
|
771
|
+
};
|
|
772
|
+
sublabel?: undefined;
|
|
773
|
+
showIf?: undefined;
|
|
774
|
+
} | {
|
|
775
|
+
type: string;
|
|
776
|
+
name: string;
|
|
777
|
+
label: string;
|
|
778
|
+
attributes: {
|
|
779
|
+
min: number;
|
|
780
|
+
options?: undefined;
|
|
869
781
|
};
|
|
870
782
|
sublabel?: undefined;
|
|
783
|
+
required?: undefined;
|
|
871
784
|
showIf?: undefined;
|
|
872
785
|
} | {
|
|
873
786
|
type: string;
|
|
@@ -889,6 +802,7 @@ export const types: ({
|
|
|
889
802
|
};
|
|
890
803
|
attributes: {
|
|
891
804
|
options: string[];
|
|
805
|
+
min?: undefined;
|
|
892
806
|
};
|
|
893
807
|
sublabel?: undefined;
|
|
894
808
|
})[];
|
|
@@ -920,11 +834,40 @@ export const types: ({
|
|
|
920
834
|
sql_name: string;
|
|
921
835
|
js_type: string;
|
|
922
836
|
contract: () => Function;
|
|
837
|
+
attributes: object[];
|
|
923
838
|
fieldviews: {
|
|
924
839
|
show: {
|
|
925
840
|
isEdit: boolean;
|
|
926
841
|
description: string;
|
|
927
|
-
run: (
|
|
842
|
+
run: (d: any, req: any, attrs?: {}) => any;
|
|
843
|
+
};
|
|
844
|
+
showDay: {
|
|
845
|
+
isEdit: boolean;
|
|
846
|
+
description: string;
|
|
847
|
+
run: (d: any, req: any) => any;
|
|
848
|
+
};
|
|
849
|
+
format: {
|
|
850
|
+
isEdit: boolean;
|
|
851
|
+
description: string;
|
|
852
|
+
configFields: {
|
|
853
|
+
name: string;
|
|
854
|
+
label: string;
|
|
855
|
+
type: string;
|
|
856
|
+
help: {
|
|
857
|
+
topic: string;
|
|
858
|
+
};
|
|
859
|
+
}[];
|
|
860
|
+
run: (d: any, req: any, options: any) => any;
|
|
861
|
+
};
|
|
862
|
+
relative: {
|
|
863
|
+
isEdit: boolean;
|
|
864
|
+
description: string;
|
|
865
|
+
run: (d: any, req: any) => string;
|
|
866
|
+
};
|
|
867
|
+
yearsAgo: {
|
|
868
|
+
isEdit: boolean;
|
|
869
|
+
description: string;
|
|
870
|
+
run: (d: any, req: any) => string;
|
|
928
871
|
};
|
|
929
872
|
show_with_html: {
|
|
930
873
|
configFields: {
|
|
@@ -947,9 +890,94 @@ export const types: ({
|
|
|
947
890
|
description: string;
|
|
948
891
|
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
949
892
|
};
|
|
893
|
+
editDay: {
|
|
894
|
+
isEdit: boolean;
|
|
895
|
+
blockDisplay: boolean;
|
|
896
|
+
description: string;
|
|
897
|
+
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
presets: {
|
|
901
|
+
Now: () => Date;
|
|
902
|
+
};
|
|
903
|
+
read: (v: object, attrs: object) => object;
|
|
904
|
+
validate: () => boolean;
|
|
905
|
+
} | {
|
|
906
|
+
name: string;
|
|
907
|
+
description: string;
|
|
908
|
+
sql_name: string;
|
|
909
|
+
js_type: string;
|
|
910
|
+
contract: () => Function;
|
|
911
|
+
fieldviews: {
|
|
912
|
+
show: {
|
|
913
|
+
isEdit: boolean;
|
|
914
|
+
description: string;
|
|
915
|
+
run: (v: any, req: any) => any;
|
|
916
|
+
};
|
|
917
|
+
checkboxes: {
|
|
918
|
+
isEdit: boolean;
|
|
919
|
+
description: string;
|
|
920
|
+
run: (v: any) => any;
|
|
921
|
+
};
|
|
922
|
+
TrueFalse: {
|
|
923
|
+
isEdit: boolean;
|
|
924
|
+
description: string;
|
|
925
|
+
run: (v: any) => "" | "True" | "False";
|
|
926
|
+
};
|
|
927
|
+
edit: {
|
|
928
|
+
isEdit: boolean;
|
|
929
|
+
description: string;
|
|
930
|
+
configFields: ({
|
|
931
|
+
name: string;
|
|
932
|
+
label: string;
|
|
933
|
+
type: string;
|
|
934
|
+
attributes: {
|
|
935
|
+
options: string[];
|
|
936
|
+
};
|
|
937
|
+
} | {
|
|
938
|
+
name: string;
|
|
939
|
+
label: string;
|
|
940
|
+
type: string;
|
|
941
|
+
attributes?: undefined;
|
|
942
|
+
})[];
|
|
943
|
+
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
944
|
+
};
|
|
945
|
+
switch: {
|
|
946
|
+
isEdit: boolean;
|
|
947
|
+
description: string;
|
|
948
|
+
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
949
|
+
};
|
|
950
|
+
show_with_html: {
|
|
951
|
+
configFields: {
|
|
952
|
+
input_type: string;
|
|
953
|
+
name: string;
|
|
954
|
+
label: string;
|
|
955
|
+
sublabel: string;
|
|
956
|
+
default: string;
|
|
957
|
+
attributes: {
|
|
958
|
+
mode: string;
|
|
959
|
+
};
|
|
960
|
+
}[];
|
|
961
|
+
isEdit: boolean;
|
|
962
|
+
description: string;
|
|
963
|
+
run: (v: any, req: any, attrs?: {}) => any;
|
|
964
|
+
};
|
|
965
|
+
tristate: {
|
|
966
|
+
isEdit: boolean;
|
|
967
|
+
description: string;
|
|
968
|
+
configFields: {
|
|
969
|
+
name: string;
|
|
970
|
+
label: string;
|
|
971
|
+
type: string;
|
|
972
|
+
}[];
|
|
973
|
+
run: (nm: any, v: any, attrs: any, cls: any, required: any, field: any) => any;
|
|
974
|
+
};
|
|
950
975
|
};
|
|
951
976
|
attributes: object[];
|
|
952
|
-
|
|
977
|
+
readFromFormRecord: (rec: any, name: string) => boolean | null;
|
|
978
|
+
read: (v: object) => boolean | null;
|
|
979
|
+
readFromDB: (v: object) => object;
|
|
980
|
+
listAs: (v: object) => object;
|
|
953
981
|
validate: () => boolean;
|
|
954
982
|
})[];
|
|
955
983
|
export const viewtemplates: ({
|
|
@@ -1004,7 +1032,7 @@ export const viewtemplates: ({
|
|
|
1004
1032
|
}) => {
|
|
1005
1033
|
listQuery(state: any, stateHash: any): Promise<{
|
|
1006
1034
|
rows: import("@saltcorn/db-common/internal").Row[];
|
|
1007
|
-
rowCount: number;
|
|
1035
|
+
rowCount: number | undefined;
|
|
1008
1036
|
}>;
|
|
1009
1037
|
getRowQuery(id: any): Promise<import("@saltcorn/db-common/internal").Row | null>;
|
|
1010
1038
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../base-plugin/index.js"],"names":[],"mappings":"AAuCA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../base-plugin/index.js"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA2E;;;;4CAG9D,MAAM;yCAYN,MAAM"}
|
|
@@ -703,7 +703,9 @@ export namespace date {
|
|
|
703
703
|
name: string;
|
|
704
704
|
label: string;
|
|
705
705
|
type: string;
|
|
706
|
-
|
|
706
|
+
help: {
|
|
707
|
+
topic: string;
|
|
708
|
+
};
|
|
707
709
|
}[];
|
|
708
710
|
export { configFields_20 as configFields };
|
|
709
711
|
export function run_34(d: any, req: any, options: any): any;
|
|
@@ -919,9 +921,21 @@ declare namespace to_locale_string {
|
|
|
919
921
|
required: boolean;
|
|
920
922
|
attributes: {
|
|
921
923
|
options: string[];
|
|
924
|
+
min?: undefined;
|
|
922
925
|
};
|
|
923
926
|
sublabel?: undefined;
|
|
924
927
|
showIf?: undefined;
|
|
928
|
+
} | {
|
|
929
|
+
type: string;
|
|
930
|
+
name: string;
|
|
931
|
+
label: string;
|
|
932
|
+
attributes: {
|
|
933
|
+
min: number;
|
|
934
|
+
options?: undefined;
|
|
935
|
+
};
|
|
936
|
+
sublabel?: undefined;
|
|
937
|
+
required?: undefined;
|
|
938
|
+
showIf?: undefined;
|
|
925
939
|
} | {
|
|
926
940
|
type: string;
|
|
927
941
|
name: string;
|
|
@@ -942,6 +956,7 @@ declare namespace to_locale_string {
|
|
|
942
956
|
};
|
|
943
957
|
attributes: {
|
|
944
958
|
options: string[];
|
|
959
|
+
min?: undefined;
|
|
945
960
|
};
|
|
946
961
|
sublabel?: undefined;
|
|
947
962
|
})[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../base-plugin/types.js"],"names":[],"mappings":";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;;;;;IA8Ra;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoHb;;;;IAEI,6DAoBJ"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @subcategory base-plugin
|
|
9
9
|
*/
|
|
10
10
|
const moment = require("moment");
|
|
11
|
-
const { input, select, option, text, div, h3, a, i, button, textarea, span, img, text_attr, label, script, domReady, section, pre, code, style, time, } = require("@saltcorn/markup/tags");
|
|
11
|
+
const { input, select, option, text, div, h3, a, i, button, textarea, span, img, text_attr, label, script, optgroup, domReady, section, pre, code, style, time, } = require("@saltcorn/markup/tags");
|
|
12
12
|
const { contract, is } = require("contractis");
|
|
13
13
|
const { radio_group, checkbox_group } = require("@saltcorn/markup/helpers");
|
|
14
14
|
const { getState } = require("../db/state");
|
|
@@ -21,6 +21,7 @@ const { interpolate } = require("../utils");
|
|
|
21
21
|
const { sqlFun, sqlBinOp } = require("@saltcorn/db-common/internal");
|
|
22
22
|
const isdef = (x) => (typeof x === "undefined" || x === null ? false : true);
|
|
23
23
|
const eqStr = (x, y) => `${x}` === `${y}`;
|
|
24
|
+
const or_if_undefined = (x, def) => (typeof x === "undefined" ? def : x);
|
|
24
25
|
const number_slider = (type) => ({
|
|
25
26
|
configFields: (field) => [
|
|
26
27
|
...(!isdef(field.attributes.min)
|
|
@@ -218,7 +219,9 @@ const show_with_html = {
|
|
|
218
219
|
isEdit: false,
|
|
219
220
|
description: "Show value with any HTML code",
|
|
220
221
|
run: (v, req, attrs = {}) => {
|
|
221
|
-
const
|
|
222
|
+
const ctx = { ...getState().eval_context };
|
|
223
|
+
ctx.it = v;
|
|
224
|
+
const rendered = interpolate(attrs?.code, ctx, req?.user);
|
|
222
225
|
return rendered;
|
|
223
226
|
},
|
|
224
227
|
};
|
|
@@ -414,16 +417,21 @@ const getStrOptions = (v, optsStr, exclude_values_string) => {
|
|
|
414
417
|
.map((o) => o.trim())
|
|
415
418
|
.filter((o) => eqStr(v, o) || !exclude_values.has(o))
|
|
416
419
|
.map((o) => option({ value: text_attr(o), ...(eqStr(v, o) && { selected: true }) }, text_attr(o)))
|
|
417
|
-
: optsStr.map((o, ix) => o
|
|
418
|
-
? option({
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
420
|
+
: optsStr.map((o, ix) => o?.optgroup
|
|
421
|
+
? optgroup({ label: o.label }, o.options.map((oi) => option({
|
|
422
|
+
selected: v == or_if_undefined(oi.value, oi),
|
|
423
|
+
value: or_if_undefined(oi.value, oi),
|
|
424
|
+
}, or_if_undefined(oi.label, oi))))
|
|
425
|
+
: o && typeof o.name !== "undefined" && typeof o.label !== "undefined"
|
|
426
|
+
? option({
|
|
427
|
+
value: o.name,
|
|
428
|
+
...((eqStr(v, o.name) ||
|
|
429
|
+
(ix === 0 && typeof v === "undefined" && o.disabled)) && {
|
|
430
|
+
selected: true,
|
|
431
|
+
}),
|
|
432
|
+
...(o.disabled && { disabled: true }),
|
|
433
|
+
}, o.label)
|
|
434
|
+
: option({ value: o, ...(eqStr(v, o) && { selected: true }) }, o));
|
|
427
435
|
};
|
|
428
436
|
const join_fields_in_formula = (fml) => {
|
|
429
437
|
if (!fml)
|
|
@@ -448,6 +456,22 @@ const to_locale_string = {
|
|
|
448
456
|
options: ["decimal", "currency", "percent", "unit"],
|
|
449
457
|
},
|
|
450
458
|
},
|
|
459
|
+
{
|
|
460
|
+
type: "Integer",
|
|
461
|
+
name: "maximumFractionDigits",
|
|
462
|
+
label: "Max Fraction Digits",
|
|
463
|
+
attributes: {
|
|
464
|
+
min: 0,
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
type: "Integer",
|
|
469
|
+
name: "maximumSignificantDigits",
|
|
470
|
+
label: "Max Significant Digits",
|
|
471
|
+
attributes: {
|
|
472
|
+
min: 0,
|
|
473
|
+
},
|
|
474
|
+
},
|
|
451
475
|
{
|
|
452
476
|
type: "String",
|
|
453
477
|
name: "currency",
|
|
@@ -544,6 +568,12 @@ const to_locale_string = {
|
|
|
544
568
|
currencyDisplay: attrs.currencyDisplay,
|
|
545
569
|
unit: attrs.unit,
|
|
546
570
|
unitDisplay: attrs.unitDisplay,
|
|
571
|
+
maximumSignificantDigits: attrs.maximumSignificantDigits === 0
|
|
572
|
+
? 0
|
|
573
|
+
: attrs.maximumSignificantDigits || undefined,
|
|
574
|
+
maximumFractionDigits: attrs.maximumFractionDigits == 0
|
|
575
|
+
? 0
|
|
576
|
+
: attrs.maximumFractionDigits || undefined,
|
|
547
577
|
});
|
|
548
578
|
}
|
|
549
579
|
else
|
|
@@ -579,6 +609,7 @@ const string = {
|
|
|
579
609
|
type: "String",
|
|
580
610
|
required: false,
|
|
581
611
|
sublabel: 'Use this to restrict your field to a list of options (separated by commas). For instance, enter <kbd class="fst-normal">Red, Green, Blue</kbd> here if the permissible values are Red, Green and Blue. Leave blank if the string can hold any value.',
|
|
612
|
+
attributes: { autofocus: true },
|
|
582
613
|
},
|
|
583
614
|
{
|
|
584
615
|
name: "min_length",
|
|
@@ -614,6 +645,12 @@ const string = {
|
|
|
614
645
|
required: false,
|
|
615
646
|
sublabel: "Error message when regular expression does not match",
|
|
616
647
|
},
|
|
648
|
+
{
|
|
649
|
+
name: "exact_search_only",
|
|
650
|
+
label: "Exact search only",
|
|
651
|
+
type: "Bool",
|
|
652
|
+
sublabel: "Search only on exact match, not substring match. Useful for large tables",
|
|
653
|
+
},
|
|
617
654
|
...(table
|
|
618
655
|
? [
|
|
619
656
|
{
|
|
@@ -691,6 +728,7 @@ const string = {
|
|
|
691
728
|
const copy_btn = attrs.copy_btn
|
|
692
729
|
? button({
|
|
693
730
|
class: "btn btn-secondary btn-sm monospace-copy-btn m-1 d-none-prefer",
|
|
731
|
+
type: "button",
|
|
694
732
|
onclick: "copy_monospace_block(this)",
|
|
695
733
|
}, i({ class: "fas fa-copy" }))
|
|
696
734
|
: "";
|
|
@@ -1752,7 +1790,9 @@ const date = {
|
|
|
1752
1790
|
name: "format",
|
|
1753
1791
|
label: "Format",
|
|
1754
1792
|
type: "String",
|
|
1755
|
-
|
|
1793
|
+
help: {
|
|
1794
|
+
topic: "Date format",
|
|
1795
|
+
},
|
|
1756
1796
|
},
|
|
1757
1797
|
],
|
|
1758
1798
|
run: (d, req, options) => {
|