@saltcorn/data 1.3.1-beta.0 → 1.3.1-beta.2
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 +318 -187
- package/dist/base-plugin/actions.d.ts.map +1 -1
- package/dist/base-plugin/actions.js +173 -1
- package/dist/base-plugin/actions.js.map +1 -1
- package/dist/base-plugin/index.d.ts +21 -1
- package/dist/base-plugin/index.d.ts.map +1 -1
- package/dist/base-plugin/types.d.ts +39 -28
- package/dist/base-plugin/types.d.ts.map +1 -1
- package/dist/base-plugin/types.js +46 -11
- package/dist/base-plugin/types.js.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.d.ts +12 -1
- package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
- package/dist/base-plugin/viewtemplates/edit.js +88 -4
- package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
- package/dist/base-plugin/viewtemplates/filter.js +1 -1
- package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
- package/dist/base-plugin/viewtemplates/list.js +1 -1
- package/dist/base-plugin/viewtemplates/list.js.map +1 -1
- package/dist/base-plugin/viewtemplates/show.js +1 -1
- package/dist/base-plugin/viewtemplates/show.js.map +1 -1
- package/dist/db/fixtures.d.ts.map +1 -1
- package/dist/db/fixtures.js +1 -0
- package/dist/db/fixtures.js.map +1 -1
- package/dist/db/state.d.ts +0 -1
- package/dist/db/state.d.ts.map +1 -1
- package/dist/db/state.js +0 -5
- package/dist/db/state.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +62 -0
- package/dist/models/config.js.map +1 -1
- package/dist/models/model_instance.d.ts.map +1 -1
- package/dist/models/model_instance.js +31 -11
- package/dist/models/model_instance.js.map +1 -1
- package/dist/models/notification.d.ts.map +1 -1
- package/dist/models/notification.js +4 -3
- package/dist/models/notification.js.map +1 -1
- package/dist/models/table.d.ts.map +1 -1
- package/dist/models/table.js +2 -0
- package/dist/models/table.js.map +1 -1
- package/dist/models/trigger.d.ts +7 -0
- package/dist/models/trigger.d.ts.map +1 -1
- package/dist/models/trigger.js +32 -1
- package/dist/models/trigger.js.map +1 -1
- package/dist/models/user.d.ts +3 -1
- package/dist/models/user.d.ts.map +1 -1
- package/dist/models/user.js +35 -4
- package/dist/models/user.js.map +1 -1
- package/dist/models/view.d.ts.map +1 -1
- package/dist/models/view.js +3 -5
- package/dist/models/view.js.map +1 -1
- package/dist/models/workflow_run.d.ts.map +1 -1
- package/dist/models/workflow_run.js +11 -5
- package/dist/models/workflow_run.js.map +1 -1
- package/dist/models/workflow_step.d.ts +15 -0
- package/dist/models/workflow_step.d.ts.map +1 -1
- package/dist/models/workflow_step.js +15 -0
- package/dist/models/workflow_step.js.map +1 -1
- package/dist/tests/auxtest.test.js +1 -0
- package/dist/tests/auxtest.test.js.map +1 -1
- package/dist/tests/user.test.js +4 -0
- package/dist/tests/user.test.js.map +1 -1
- package/dist/tests/workflow.test.js +4 -0
- package/dist/tests/workflow.test.js.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +18 -1
- package/dist/utils.js.map +1 -1
- package/package.json +11 -10
|
@@ -290,6 +290,12 @@ export namespace string {
|
|
|
290
290
|
export namespace password {
|
|
291
291
|
let isEdit_15: boolean;
|
|
292
292
|
export { isEdit_15 as isEdit };
|
|
293
|
+
let configFields_10: {
|
|
294
|
+
name: string;
|
|
295
|
+
label: string;
|
|
296
|
+
type: string;
|
|
297
|
+
}[];
|
|
298
|
+
export { configFields_10 as configFields };
|
|
293
299
|
let blockDisplay_5: boolean;
|
|
294
300
|
export { blockDisplay_5 as blockDisplay };
|
|
295
301
|
let description_16: string;
|
|
@@ -359,23 +365,23 @@ export namespace int {
|
|
|
359
365
|
export { blockDisplay_6 as blockDisplay };
|
|
360
366
|
let description_19: string;
|
|
361
367
|
export { description_19 as description };
|
|
362
|
-
let
|
|
368
|
+
let configFields_11: {
|
|
363
369
|
name: string;
|
|
364
370
|
label: string;
|
|
365
371
|
type: string;
|
|
366
372
|
}[];
|
|
367
|
-
export {
|
|
373
|
+
export { configFields_11 as configFields };
|
|
368
374
|
export function run_17(nm: any, v: any, attrs: any, cls: any, required: any, field: any): string;
|
|
369
375
|
export { run_17 as run };
|
|
370
376
|
}
|
|
371
377
|
export { edit_1 as edit };
|
|
372
378
|
export namespace number_slider {
|
|
373
|
-
export function
|
|
379
|
+
export function configFields_12(field: any): {
|
|
374
380
|
name: string;
|
|
375
381
|
type: any;
|
|
376
382
|
required: boolean;
|
|
377
383
|
}[];
|
|
378
|
-
export {
|
|
384
|
+
export { configFields_12 as configFields };
|
|
379
385
|
let isEdit_18: boolean;
|
|
380
386
|
export { isEdit_18 as isEdit };
|
|
381
387
|
let description_20: string;
|
|
@@ -386,12 +392,12 @@ export namespace int {
|
|
|
386
392
|
export { run_18 as run };
|
|
387
393
|
}
|
|
388
394
|
export namespace range_interval {
|
|
389
|
-
export function
|
|
395
|
+
export function configFields_13(field: any): {
|
|
390
396
|
name: string;
|
|
391
397
|
type: any;
|
|
392
398
|
required: boolean;
|
|
393
399
|
}[];
|
|
394
|
-
export {
|
|
400
|
+
export { configFields_13 as configFields };
|
|
395
401
|
let isEdit_19: boolean;
|
|
396
402
|
export { isEdit_19 as isEdit };
|
|
397
403
|
let isFilter_1: boolean;
|
|
@@ -404,7 +410,7 @@ export namespace int {
|
|
|
404
410
|
export { run_19 as run };
|
|
405
411
|
}
|
|
406
412
|
export namespace progress_bar {
|
|
407
|
-
export function
|
|
413
|
+
export function configFields_14(field: any): ({
|
|
408
414
|
name: string;
|
|
409
415
|
type: string;
|
|
410
416
|
label: string;
|
|
@@ -442,7 +448,7 @@ export namespace int {
|
|
|
442
448
|
required?: undefined;
|
|
443
449
|
class?: undefined;
|
|
444
450
|
})[];
|
|
445
|
-
export {
|
|
451
|
+
export { configFields_14 as configFields };
|
|
446
452
|
let isEdit_20: boolean;
|
|
447
453
|
export { isEdit_20 as isEdit };
|
|
448
454
|
let description_22: string;
|
|
@@ -451,7 +457,7 @@ export namespace int {
|
|
|
451
457
|
export { run_20 as run };
|
|
452
458
|
}
|
|
453
459
|
export namespace heat_cell {
|
|
454
|
-
export function
|
|
460
|
+
export function configFields_15(field: any): ({
|
|
455
461
|
name: string;
|
|
456
462
|
type: string;
|
|
457
463
|
label: string;
|
|
@@ -503,7 +509,7 @@ export namespace int {
|
|
|
503
509
|
class?: undefined;
|
|
504
510
|
attributes?: undefined;
|
|
505
511
|
})[];
|
|
506
|
-
export {
|
|
512
|
+
export { configFields_15 as configFields };
|
|
507
513
|
let isEdit_21: boolean;
|
|
508
514
|
export { isEdit_21 as isEdit };
|
|
509
515
|
let description_23: string;
|
|
@@ -518,12 +524,12 @@ export namespace int {
|
|
|
518
524
|
export { isFilter_2 as isFilter };
|
|
519
525
|
let blockDisplay_9: boolean;
|
|
520
526
|
export { blockDisplay_9 as blockDisplay };
|
|
521
|
-
let
|
|
527
|
+
let configFields_16: {
|
|
522
528
|
name: string;
|
|
523
529
|
label: string;
|
|
524
530
|
type: string;
|
|
525
531
|
}[];
|
|
526
|
-
export {
|
|
532
|
+
export { configFields_16 as configFields };
|
|
527
533
|
export function run_22(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): string;
|
|
528
534
|
export { run_22 as run };
|
|
529
535
|
}
|
|
@@ -532,13 +538,13 @@ export namespace int {
|
|
|
532
538
|
export namespace show_star_rating {
|
|
533
539
|
let description_24: string;
|
|
534
540
|
export { description_24 as description };
|
|
535
|
-
export function
|
|
541
|
+
export function configFields_17(field: any): {
|
|
536
542
|
name: string;
|
|
537
543
|
type: string;
|
|
538
544
|
required: boolean;
|
|
539
545
|
default: number;
|
|
540
546
|
}[];
|
|
541
|
-
export {
|
|
547
|
+
export { configFields_17 as configFields };
|
|
542
548
|
let isEdit_23: boolean;
|
|
543
549
|
export { isEdit_23 as isEdit };
|
|
544
550
|
let blockDisplay_10: boolean;
|
|
@@ -549,13 +555,13 @@ export namespace int {
|
|
|
549
555
|
export namespace edit_star_rating {
|
|
550
556
|
let description_25: string;
|
|
551
557
|
export { description_25 as description };
|
|
552
|
-
export function
|
|
558
|
+
export function configFields_18(field: any): {
|
|
553
559
|
name: string;
|
|
554
560
|
type: string;
|
|
555
561
|
required: boolean;
|
|
556
562
|
default: number;
|
|
557
563
|
}[];
|
|
558
|
-
export {
|
|
564
|
+
export { configFields_18 as configFields };
|
|
559
565
|
let isEdit_24: boolean;
|
|
560
566
|
export { isEdit_24 as isEdit };
|
|
561
567
|
let blockDisplay_11: boolean;
|
|
@@ -638,7 +644,7 @@ export namespace bool {
|
|
|
638
644
|
export { isEdit_29 as isEdit };
|
|
639
645
|
let description_31: string;
|
|
640
646
|
export { description_31 as description };
|
|
641
|
-
let
|
|
647
|
+
let configFields_19: ({
|
|
642
648
|
name: string;
|
|
643
649
|
label: string;
|
|
644
650
|
type: string;
|
|
@@ -651,7 +657,7 @@ export namespace bool {
|
|
|
651
657
|
type: string;
|
|
652
658
|
attributes?: undefined;
|
|
653
659
|
})[];
|
|
654
|
-
export {
|
|
660
|
+
export { configFields_19 as configFields };
|
|
655
661
|
export function run_29(nm: any, v: any, attrs: any, cls: any, required: any, field: any): string;
|
|
656
662
|
export { run_29 as run };
|
|
657
663
|
}
|
|
@@ -671,12 +677,12 @@ export namespace bool {
|
|
|
671
677
|
export { isEdit_31 as isEdit };
|
|
672
678
|
let description_33: string;
|
|
673
679
|
export { description_33 as description };
|
|
674
|
-
let
|
|
680
|
+
let configFields_20: {
|
|
675
681
|
name: string;
|
|
676
682
|
label: string;
|
|
677
683
|
type: string;
|
|
678
684
|
}[];
|
|
679
|
-
export {
|
|
685
|
+
export { configFields_20 as configFields };
|
|
680
686
|
export function run_31(nm: any, v: any, attrs: any, cls: any, required: any, field: any): string;
|
|
681
687
|
export { run_31 as run };
|
|
682
688
|
}
|
|
@@ -728,7 +734,7 @@ export namespace date {
|
|
|
728
734
|
export { isEdit_34 as isEdit };
|
|
729
735
|
let description_37: string;
|
|
730
736
|
export { description_37 as description };
|
|
731
|
-
let
|
|
737
|
+
let configFields_21: {
|
|
732
738
|
name: string;
|
|
733
739
|
label: string;
|
|
734
740
|
type: string;
|
|
@@ -736,7 +742,7 @@ export namespace date {
|
|
|
736
742
|
topic: string;
|
|
737
743
|
};
|
|
738
744
|
}[];
|
|
739
|
-
export {
|
|
745
|
+
export { configFields_21 as configFields };
|
|
740
746
|
export function run_34(d: any, req: any, options: any): string;
|
|
741
747
|
export { run_34 as run };
|
|
742
748
|
}
|
|
@@ -788,6 +794,7 @@ export namespace date {
|
|
|
788
794
|
export { read_3 as read };
|
|
789
795
|
export function validate_3(): boolean;
|
|
790
796
|
export { validate_3 as validate };
|
|
797
|
+
export function equals(a: any, b: any): boolean;
|
|
791
798
|
}
|
|
792
799
|
export namespace float {
|
|
793
800
|
let name_4: string;
|
|
@@ -829,12 +836,12 @@ export namespace float {
|
|
|
829
836
|
export { blockDisplay_15 as blockDisplay };
|
|
830
837
|
let description_44: string;
|
|
831
838
|
export { description_44 as description };
|
|
832
|
-
let
|
|
839
|
+
let configFields_22: {
|
|
833
840
|
name: string;
|
|
834
841
|
label: string;
|
|
835
842
|
type: string;
|
|
836
843
|
}[];
|
|
837
|
-
export {
|
|
844
|
+
export { configFields_22 as configFields };
|
|
838
845
|
export function run_40(nm: any, v: any, attrs: any, cls: any, required: any, field: any): string;
|
|
839
846
|
export { run_40 as run };
|
|
840
847
|
}
|
|
@@ -870,6 +877,10 @@ export namespace float {
|
|
|
870
877
|
export { read_4 as read };
|
|
871
878
|
export function validate_4({ min, max }: object): boolean | object;
|
|
872
879
|
export { validate_4 as validate };
|
|
880
|
+
export function equals_1(a: any, b: any, { decimal_places }: {
|
|
881
|
+
decimal_places: any;
|
|
882
|
+
}): boolean;
|
|
883
|
+
export { equals_1 as equals };
|
|
873
884
|
}
|
|
874
885
|
export namespace color {
|
|
875
886
|
let name_5: string;
|
|
@@ -914,7 +925,7 @@ export namespace color {
|
|
|
914
925
|
export { validate_5 as validate };
|
|
915
926
|
}
|
|
916
927
|
declare namespace show_with_html {
|
|
917
|
-
let
|
|
928
|
+
let configFields_23: {
|
|
918
929
|
input_type: string;
|
|
919
930
|
name: string;
|
|
920
931
|
label: string;
|
|
@@ -924,7 +935,7 @@ declare namespace show_with_html {
|
|
|
924
935
|
mode: string;
|
|
925
936
|
};
|
|
926
937
|
}[];
|
|
927
|
-
export {
|
|
938
|
+
export { configFields_23 as configFields };
|
|
928
939
|
let isEdit_44: boolean;
|
|
929
940
|
export { isEdit_44 as isEdit };
|
|
930
941
|
let description_48: string;
|
|
@@ -935,7 +946,7 @@ declare namespace show_with_html {
|
|
|
935
946
|
declare namespace to_locale_string {
|
|
936
947
|
let description_49: string;
|
|
937
948
|
export { description_49 as description };
|
|
938
|
-
export function
|
|
949
|
+
export function configFields_24(field: any): ({
|
|
939
950
|
type: string;
|
|
940
951
|
name: string;
|
|
941
952
|
label: string;
|
|
@@ -989,7 +1000,7 @@ declare namespace to_locale_string {
|
|
|
989
1000
|
};
|
|
990
1001
|
sublabel?: undefined;
|
|
991
1002
|
})[];
|
|
992
|
-
export {
|
|
1003
|
+
export { configFields_24 as configFields };
|
|
993
1004
|
let isEdit_45: boolean;
|
|
994
1005
|
export { isEdit_45 as isEdit };
|
|
995
1006
|
export function run_45(v: any, req: any, attrs?: {}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../base-plugin/types.js"],"names":[],"mappings":";cA8tBa,MAAM;;kBAGN,MAAM;;IAQL,+CAsFX;IAMS;;gBAKiE;;;;;;YAelE,oCAAyB;;;;;;;YAKzB,sCACiE;;;;;;;;YAKjE,sCAA+C;;;;;;;;;;;;;;;;;;;YAc/C,4DA8CJ;;;;;;;;;;;;;;;YAcI,4DAIJ;;;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;QASD,qBAAgB;;;IAOjB,yDAWL;;IAKS,sCAA2C;;IAO7C,gDAKP;;;gBAlYU,MAAM;;;;oBAGN,MAAM;;;;IAUP;;;iBAAmD;;;;;;;;;;;;;;;;;YAkBpD,uCAAc;;;;;;;;;;;;;;;;;YAkBd,iGAoBD;;;;;;;;;;;;;;;;;;;YAl/CH,wHAaD;;;;;;;;;;sBAg/CO,MAAM,EAAE;;IAgBb,+DAYL;;IAMC,mEAKC;;IASK;;gBAEP;;;;gBAxNU,MAAM;;;;oBAGN,MAAM;;;;IAOP,uCAAY;;;;;;;;YAeb,uCAMG;;;;;;;;;;;;YAYH,iGAWD;;;;;;sBAGG,MAAM,EAAE;;IAMb,0CAOL;;IAIS,sCAET;;;;;;;;;;;;;;;;;;;IAvlDI,6DAUJ;;;;;;IAmSa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoHb;;;;IAEI,6DAoBJ"}
|
|
@@ -1244,19 +1244,32 @@ const string = {
|
|
|
1244
1244
|
*/
|
|
1245
1245
|
password: {
|
|
1246
1246
|
isEdit: true,
|
|
1247
|
+
configFields: [
|
|
1248
|
+
{
|
|
1249
|
+
name: "visibility_toggle",
|
|
1250
|
+
label: "Visibility toggle",
|
|
1251
|
+
type: "Bool",
|
|
1252
|
+
},
|
|
1253
|
+
],
|
|
1247
1254
|
blockDisplay: true,
|
|
1248
1255
|
description: "Password input type, characters are hidden when typed",
|
|
1249
|
-
run: (nm, v, attrs, cls, required, field) =>
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1256
|
+
run: (nm, v, attrs, cls, required, field) => {
|
|
1257
|
+
const pwinput = input({
|
|
1258
|
+
type: "password",
|
|
1259
|
+
disabled: attrs.disabled,
|
|
1260
|
+
readonly: attrs.readonly,
|
|
1261
|
+
class: ["form-control", cls],
|
|
1262
|
+
"data-fieldname": text_attr(field.name),
|
|
1263
|
+
onChange: attrs.onChange,
|
|
1264
|
+
name: text_attr(nm),
|
|
1265
|
+
id: `input${text_attr(nm)}`,
|
|
1266
|
+
...(isdef(v) && { value: text_attr(v) }),
|
|
1267
|
+
});
|
|
1268
|
+
if (attrs?.visibility_toggle)
|
|
1269
|
+
return div({ class: "input-group" }, pwinput, span({ class: "input-group-text toggle-password-vis" }, i({ class: "fas fa-eye toggle-password-vis-icon" })));
|
|
1270
|
+
else
|
|
1271
|
+
return pwinput;
|
|
1272
|
+
},
|
|
1260
1273
|
},
|
|
1261
1274
|
select_by_code: { ...select_by_code, type: undefined },
|
|
1262
1275
|
},
|
|
@@ -1737,6 +1750,16 @@ const float = {
|
|
|
1737
1750
|
return { error: `Must be ${max} or less` };
|
|
1738
1751
|
return true;
|
|
1739
1752
|
},
|
|
1753
|
+
/**
|
|
1754
|
+
* check if two float values are equal within a given precision
|
|
1755
|
+
* @param a
|
|
1756
|
+
* @param b
|
|
1757
|
+
* @param opts
|
|
1758
|
+
* @returns true or false
|
|
1759
|
+
*/
|
|
1760
|
+
equals: (a, b, { decimal_places }) => {
|
|
1761
|
+
return Math.abs(a - b) < Math.pow(10, -decimal_places) / 2;
|
|
1762
|
+
},
|
|
1740
1763
|
};
|
|
1741
1764
|
/**
|
|
1742
1765
|
* @param {object} req
|
|
@@ -1971,6 +1994,18 @@ const date = {
|
|
|
1971
1994
|
* @returns {boolean}
|
|
1972
1995
|
*/
|
|
1973
1996
|
validate: () => (v) => v instanceof Date && !isNaN(v),
|
|
1997
|
+
/**
|
|
1998
|
+
* check if two date values are equal
|
|
1999
|
+
* @param a
|
|
2000
|
+
* @param b
|
|
2001
|
+
* @returns true or false
|
|
2002
|
+
*/
|
|
2003
|
+
equals: (a, b) => {
|
|
2004
|
+
if (a instanceof Date && b instanceof Date) {
|
|
2005
|
+
return a.getTime() === b.getTime();
|
|
2006
|
+
}
|
|
2007
|
+
return false;
|
|
2008
|
+
},
|
|
1974
2009
|
};
|
|
1975
2010
|
/**
|
|
1976
2011
|
* Boolean Type
|