@saltcorn/data 0.8.7-beta.3 → 0.8.7-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/base-plugin/index.d.ts +70 -0
  2. package/dist/base-plugin/index.d.ts.map +1 -1
  3. package/dist/base-plugin/types.d.ts +123 -83
  4. package/dist/base-plugin/types.d.ts.map +1 -1
  5. package/dist/base-plugin/types.js +44 -1
  6. package/dist/base-plugin/types.js.map +1 -1
  7. package/dist/base-plugin/viewtemplates/edit.d.ts.map +1 -1
  8. package/dist/base-plugin/viewtemplates/edit.js +22 -6
  9. package/dist/base-plugin/viewtemplates/edit.js.map +1 -1
  10. package/dist/base-plugin/viewtemplates/filter.d.ts.map +1 -1
  11. package/dist/base-plugin/viewtemplates/filter.js +5 -4
  12. package/dist/base-plugin/viewtemplates/filter.js.map +1 -1
  13. package/dist/base-plugin/viewtemplates/show.d.ts.map +1 -1
  14. package/dist/base-plugin/viewtemplates/show.js +1 -1
  15. package/dist/base-plugin/viewtemplates/show.js.map +1 -1
  16. package/dist/db/state.d.ts +1 -0
  17. package/dist/db/state.d.ts.map +1 -1
  18. package/dist/db/state.js +1 -0
  19. package/dist/db/state.js.map +1 -1
  20. package/dist/migrations/202307211459.d.ts +2 -0
  21. package/dist/migrations/202307211459.d.ts.map +1 -0
  22. package/dist/migrations/202307211459.js +20 -0
  23. package/dist/migrations/202307211459.js.map +1 -0
  24. package/dist/models/config.d.ts.map +1 -1
  25. package/dist/models/config.js +5 -0
  26. package/dist/models/config.js.map +1 -1
  27. package/dist/models/field.d.ts.map +1 -1
  28. package/dist/models/field.js +1 -1
  29. package/dist/models/field.js.map +1 -1
  30. package/dist/models/file.d.ts.map +1 -1
  31. package/dist/models/file.js +13 -6
  32. package/dist/models/file.js.map +1 -1
  33. package/dist/models/table.d.ts +4 -1
  34. package/dist/models/table.d.ts.map +1 -1
  35. package/dist/models/table.js +55 -5
  36. package/dist/models/table.js.map +1 -1
  37. package/dist/plugin-helper.d.ts.map +1 -1
  38. package/dist/plugin-helper.js +14 -4
  39. package/dist/plugin-helper.js.map +1 -1
  40. package/dist/tests/auxtest.test.js +24 -1
  41. package/dist/tests/auxtest.test.js.map +1 -1
  42. package/dist/tests/table.test.js +0 -135
  43. package/dist/tests/table.test.js.map +1 -1
  44. package/dist/tests/table_history.test.d.ts +2 -0
  45. package/dist/tests/table_history.test.d.ts.map +1 -0
  46. package/dist/tests/table_history.test.js +257 -0
  47. package/dist/tests/table_history.test.js.map +1 -0
  48. package/package.json +7 -7
@@ -236,6 +236,41 @@ export const types: ({
236
236
  isEdit: boolean;
237
237
  run: (v: any, req: any, attrs?: {}) => any;
238
238
  };
239
+ heat_cell: {
240
+ configFields: (field: any) => ({
241
+ name: string;
242
+ type: any;
243
+ required: boolean;
244
+ label?: undefined;
245
+ attributes?: undefined;
246
+ default?: undefined;
247
+ } | {
248
+ name: string;
249
+ type: string;
250
+ label: string;
251
+ required: boolean;
252
+ attributes: {
253
+ options: string[];
254
+ };
255
+ default?: undefined;
256
+ } | {
257
+ name: string;
258
+ type: string;
259
+ label: string;
260
+ required?: undefined;
261
+ attributes?: undefined;
262
+ default?: undefined;
263
+ } | {
264
+ name: string;
265
+ type: string;
266
+ label: string;
267
+ default: number;
268
+ required?: undefined;
269
+ attributes?: undefined;
270
+ })[];
271
+ isEdit: boolean;
272
+ run: (v: any, req: any, attrs?: {}) => any;
273
+ };
239
274
  above_input: {
240
275
  isEdit: boolean;
241
276
  isFilter: boolean;
@@ -430,6 +465,41 @@ export const types: ({
430
465
  isEdit: boolean;
431
466
  run: (v: any, req: any, attrs?: {}) => any;
432
467
  };
468
+ heat_cell: {
469
+ configFields: (field: any) => ({
470
+ name: string;
471
+ type: any;
472
+ required: boolean;
473
+ label?: undefined;
474
+ attributes?: undefined;
475
+ default?: undefined;
476
+ } | {
477
+ name: string;
478
+ type: string;
479
+ label: string;
480
+ required: boolean;
481
+ attributes: {
482
+ options: string[];
483
+ };
484
+ default?: undefined;
485
+ } | {
486
+ name: string;
487
+ type: string;
488
+ label: string;
489
+ required?: undefined;
490
+ attributes?: undefined;
491
+ default?: undefined;
492
+ } | {
493
+ name: string;
494
+ type: string;
495
+ label: string;
496
+ default: number;
497
+ required?: undefined;
498
+ attributes?: undefined;
499
+ })[];
500
+ isEdit: boolean;
501
+ run: (v: any, req: any, attrs?: {}) => any;
502
+ };
433
503
  above_input: {
434
504
  isEdit: boolean;
435
505
  isFilter: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../base-plugin/index.js"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAsD;AACtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA2E;;;;4CAG9D,MAAM;yCAYN,MAAM"}
@@ -292,52 +292,90 @@ export namespace int {
292
292
  export function run_17(v: any, req: any, attrs?: {}): any;
293
293
  export { run_17 as run };
294
294
  }
295
- export namespace above_input {
295
+ export namespace heat_cell {
296
+ export function configFields_10(field: any): ({
297
+ name: string;
298
+ type: any;
299
+ required: boolean;
300
+ label?: undefined;
301
+ attributes?: undefined;
302
+ default?: undefined;
303
+ } | {
304
+ name: string;
305
+ type: string;
306
+ label: string;
307
+ required: boolean;
308
+ attributes: {
309
+ options: string[];
310
+ };
311
+ default?: undefined;
312
+ } | {
313
+ name: string;
314
+ type: string;
315
+ label: string;
316
+ required?: undefined;
317
+ attributes?: undefined;
318
+ default?: undefined;
319
+ } | {
320
+ name: string;
321
+ type: string;
322
+ label: string;
323
+ default: number;
324
+ required?: undefined;
325
+ attributes?: undefined;
326
+ })[];
327
+ export { configFields_10 as configFields };
296
328
  const isEdit_18: boolean;
297
329
  export { isEdit_18 as isEdit };
330
+ export function run_18(v: any, req: any, attrs?: {}): any;
331
+ export { run_18 as run };
332
+ }
333
+ export namespace above_input {
334
+ const isEdit_19: boolean;
335
+ export { isEdit_19 as isEdit };
298
336
  const isFilter_2: boolean;
299
337
  export { isFilter_2 as isFilter };
300
338
  const blockDisplay_8: boolean;
301
339
  export { blockDisplay_8 as blockDisplay };
302
- const configFields_10: {
340
+ const configFields_11: {
303
341
  name: string;
304
342
  label: string;
305
343
  type: string;
306
344
  }[];
307
- export { configFields_10 as configFields };
308
- export function run_18(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
309
- export { run_18 as run };
345
+ export { configFields_11 as configFields };
346
+ export function run_19(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
347
+ export { run_19 as run };
310
348
  }
311
349
  export namespace below_input { }
312
350
  export namespace show_star_rating {
313
- export function configFields_11(field: any): {
351
+ export function configFields_12(field: any): {
314
352
  name: string;
315
353
  type: string;
316
354
  required: boolean;
317
355
  default: number;
318
356
  }[];
319
- export { configFields_11 as configFields };
320
- const isEdit_19: boolean;
321
- export { isEdit_19 as isEdit };
357
+ export { configFields_12 as configFields };
358
+ const isEdit_20: boolean;
359
+ export { isEdit_20 as isEdit };
322
360
  const blockDisplay_9: boolean;
323
361
  export { blockDisplay_9 as blockDisplay };
324
- export function run_19(v: any, req: any, attrs?: {}): any;
325
- export { run_19 as run };
362
+ export function run_20(v: any, req: any, attrs?: {}): any;
363
+ export { run_20 as run };
326
364
  }
327
365
  export namespace edit_star_rating {
328
- export function configFields_12(field: any): {
366
+ export function configFields_13(field: any): {
329
367
  name: string;
330
368
  type: string;
331
369
  required: boolean;
332
370
  default: number;
333
371
  }[];
334
- export { configFields_12 as configFields };
335
- const isEdit_20: boolean;
336
- export { isEdit_20 as isEdit };
372
+ export { configFields_13 as configFields };
373
+ const isEdit_21: boolean;
374
+ export { isEdit_21 as isEdit };
337
375
  const blockDisplay_10: boolean;
338
376
  export { blockDisplay_10 as blockDisplay };
339
- export function run_20(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
340
- export { run_20 as run };
377
+ export function run_21(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
378
+ export { run_21 as run };
341
379
  }
342
380
  }
343
381
  export { fieldviews_1 as fieldviews };
@@ -359,28 +397,28 @@ export namespace bool {
359
397
  export { contract_2 as contract };
360
398
  export namespace fieldviews_2 {
361
399
  export namespace show_1 {
362
- const isEdit_21: boolean;
363
- export { isEdit_21 as isEdit };
364
- export function run_21(v: any): any;
365
- export { run_21 as run };
366
- }
367
- export { show_1 as show };
368
- export namespace checkboxes {
369
400
  const isEdit_22: boolean;
370
401
  export { isEdit_22 as isEdit };
371
402
  export function run_22(v: any): any;
372
403
  export { run_22 as run };
373
404
  }
374
- export namespace TrueFalse {
405
+ export { show_1 as show };
406
+ export namespace checkboxes {
375
407
  const isEdit_23: boolean;
376
408
  export { isEdit_23 as isEdit };
377
- export function run_23(v: any): "" | "True" | "False";
409
+ export function run_23(v: any): any;
378
410
  export { run_23 as run };
379
411
  }
380
- export namespace edit_2 {
412
+ export namespace TrueFalse {
381
413
  const isEdit_24: boolean;
382
414
  export { isEdit_24 as isEdit };
383
- const configFields_13: {
415
+ export function run_24(v: any): "" | "True" | "False";
416
+ export { run_24 as run };
417
+ }
418
+ export namespace edit_2 {
419
+ const isEdit_25: boolean;
420
+ export { isEdit_25 as isEdit };
421
+ const configFields_14: {
384
422
  name: string;
385
423
  label: string;
386
424
  type: string;
@@ -388,24 +426,24 @@ export namespace bool {
388
426
  options: string[];
389
427
  };
390
428
  }[];
391
- export { configFields_13 as configFields };
392
- export function run_24(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
393
- export { run_24 as run };
394
- }
395
- export { edit_2 as edit };
396
- export namespace _switch {
397
- const isEdit_25: boolean;
398
- export { isEdit_25 as isEdit };
429
+ export { configFields_14 as configFields };
399
430
  export function run_25(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
400
431
  export { run_25 as run };
401
432
  }
402
- export { _switch as switch };
403
- export namespace tristate {
433
+ export { edit_2 as edit };
434
+ export namespace _switch {
404
435
  const isEdit_26: boolean;
405
436
  export { isEdit_26 as isEdit };
406
437
  export function run_26(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
407
438
  export { run_26 as run };
408
439
  }
440
+ export { _switch as switch };
441
+ export namespace tristate {
442
+ const isEdit_27: boolean;
443
+ export { isEdit_27 as isEdit };
444
+ export function run_27(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
445
+ export { run_27 as run };
446
+ }
409
447
  }
410
448
  export { fieldviews_2 as fieldviews };
411
449
  const attributes_2: object[];
@@ -429,59 +467,59 @@ export namespace date {
429
467
  export { attributes_3 as attributes };
430
468
  export namespace fieldviews_3 {
431
469
  export namespace show_2 {
432
- const isEdit_27: boolean;
433
- export { isEdit_27 as isEdit };
434
- export function run_27(d: any, req: any): any;
435
- export { run_27 as run };
436
- }
437
- export { show_2 as show };
438
- export namespace showDay {
439
470
  const isEdit_28: boolean;
440
471
  export { isEdit_28 as isEdit };
441
472
  export function run_28(d: any, req: any): any;
442
473
  export { run_28 as run };
443
474
  }
444
- export namespace format {
475
+ export { show_2 as show };
476
+ export namespace showDay {
445
477
  const isEdit_29: boolean;
446
478
  export { isEdit_29 as isEdit };
447
- const configFields_14: {
479
+ export function run_29(d: any, req: any): any;
480
+ export { run_29 as run };
481
+ }
482
+ export namespace format {
483
+ const isEdit_30: boolean;
484
+ export { isEdit_30 as isEdit };
485
+ const configFields_15: {
448
486
  name: string;
449
487
  label: string;
450
488
  type: string;
451
489
  sublabel: string;
452
490
  }[];
453
- export { configFields_14 as configFields };
454
- export function run_29(d: any, req: any, options: any): any;
455
- export { run_29 as run };
456
- }
457
- export namespace relative {
458
- const isEdit_30: boolean;
459
- export { isEdit_30 as isEdit };
460
- export function run_30(d: any, req: any): string;
491
+ export { configFields_15 as configFields };
492
+ export function run_30(d: any, req: any, options: any): any;
461
493
  export { run_30 as run };
462
494
  }
463
- export namespace yearsAgo {
495
+ export namespace relative {
464
496
  const isEdit_31: boolean;
465
497
  export { isEdit_31 as isEdit };
466
498
  export function run_31(d: any, req: any): string;
467
499
  export { run_31 as run };
468
500
  }
469
- export namespace edit_3 {
501
+ export namespace yearsAgo {
470
502
  const isEdit_32: boolean;
471
503
  export { isEdit_32 as isEdit };
504
+ export function run_32(d: any, req: any): string;
505
+ export { run_32 as run };
506
+ }
507
+ export namespace edit_3 {
508
+ const isEdit_33: boolean;
509
+ export { isEdit_33 as isEdit };
472
510
  const blockDisplay_11: boolean;
473
511
  export { blockDisplay_11 as blockDisplay };
474
- export function run_32(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
475
- export { run_32 as run };
512
+ export function run_33(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
513
+ export { run_33 as run };
476
514
  }
477
515
  export { edit_3 as edit };
478
516
  export namespace editDay {
479
- const isEdit_33: boolean;
480
- export { isEdit_33 as isEdit };
517
+ const isEdit_34: boolean;
518
+ export { isEdit_34 as isEdit };
481
519
  const blockDisplay_12: boolean;
482
520
  export { blockDisplay_12 as blockDisplay };
483
- export function run_33(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
484
- export { run_33 as run };
521
+ export function run_34(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
522
+ export { run_34 as run };
485
523
  }
486
524
  }
487
525
  export { fieldviews_3 as fieldviews };
@@ -506,19 +544,19 @@ export namespace float {
506
544
  export { contract_4 as contract };
507
545
  export namespace fieldviews_4 {
508
546
  export namespace show_3 {
509
- const isEdit_34: boolean;
510
- export { isEdit_34 as isEdit };
511
- export function run_34(s: any): string;
512
- export { run_34 as run };
547
+ const isEdit_35: boolean;
548
+ export { isEdit_35 as isEdit };
549
+ export function run_35(s: any): string;
550
+ export { run_35 as run };
513
551
  }
514
552
  export { show_3 as show };
515
553
  export namespace edit_4 {
516
- const isEdit_35: boolean;
517
- export { isEdit_35 as isEdit };
554
+ const isEdit_36: boolean;
555
+ export { isEdit_36 as isEdit };
518
556
  const blockDisplay_13: boolean;
519
557
  export { blockDisplay_13 as blockDisplay };
520
- export function run_35(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
521
- export { run_35 as run };
558
+ export function run_36(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
559
+ export { run_36 as run };
522
560
  }
523
561
  export { edit_4 as edit };
524
562
  export namespace number_slider_1 { }
@@ -527,15 +565,17 @@ export namespace float {
527
565
  export { range_interval_1 as range_interval };
528
566
  export namespace progress_bar_1 { }
529
567
  export { progress_bar_1 as progress_bar };
568
+ export namespace heat_cell_1 { }
569
+ export { heat_cell_1 as heat_cell };
530
570
  export namespace above_input_1 {
531
- const isEdit_36: boolean;
532
- export { isEdit_36 as isEdit };
571
+ const isEdit_37: boolean;
572
+ export { isEdit_37 as isEdit };
533
573
  const isFilter_3: boolean;
534
574
  export { isFilter_3 as isFilter };
535
575
  const blockDisplay_14: boolean;
536
576
  export { blockDisplay_14 as blockDisplay };
537
- export function run_36(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
538
- export { run_36 as run };
577
+ export function run_37(nm: any, v: any, attrs: {} | undefined, cls: any, required: any, field: any, state?: {}): any;
578
+ export { run_37 as run };
539
579
  }
540
580
  export { above_input_1 as above_input };
541
581
  export namespace below_input_1 { }
@@ -558,19 +598,19 @@ export namespace color {
558
598
  export { contract_5 as contract };
559
599
  export namespace fieldviews_5 {
560
600
  export namespace show_4 {
561
- const isEdit_37: boolean;
562
- export { isEdit_37 as isEdit };
563
- export function run_37(s: any): any;
564
- export { run_37 as run };
601
+ const isEdit_38: boolean;
602
+ export { isEdit_38 as isEdit };
603
+ export function run_38(s: any): any;
604
+ export { run_38 as run };
565
605
  }
566
606
  export { show_4 as show };
567
607
  export namespace edit_5 {
568
- const isEdit_38: boolean;
569
- export { isEdit_38 as isEdit };
608
+ const isEdit_39: boolean;
609
+ export { isEdit_39 as isEdit };
570
610
  const blockDisplay_15: boolean;
571
611
  export { blockDisplay_15 as blockDisplay };
572
- export function run_38(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
573
- export { run_38 as run };
612
+ export function run_39(nm: any, v: any, attrs: any, cls: any, required: any, field: any): any;
613
+ export { run_39 as run };
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M;;sBAEN,MAAM;;IAQP;;;iBAAmD;;;;;;YAY/B,uCAAc;;;;;;;;;YAUnC,8FAiBD;;;;;;;;;;;;;;;;;;;YA1+BH,qHAaD;;;;;;;;wBAs+BO,MAAM,EAAE;;IAWb,+DAYL;;IAMC,mEAKC;;;;kBA7KQ,MAAM;;sBAEN,MAAM;;IAKP,uCAAY;;;;;;YAcb,oCAMG;;;;;;;;;YAWH,8FAWD;;;;;;wBAGG,MAAM,EAAE;;IAMb,0CAOL;;IAIS,sCAET"}
@@ -122,6 +122,45 @@ const progress_bar = (type) => ({
122
122
  },
123
123
  })),
124
124
  });
125
+ const heat_cell = (type) => ({
126
+ configFields: (field) => [
127
+ ...(!isdef(field.attributes.min)
128
+ ? [{ name: "min", type, required: true }]
129
+ : []),
130
+ ...(!isdef(field.attributes.max)
131
+ ? [{ name: "max", type, required: true }]
132
+ : []),
133
+ {
134
+ name: "color_scale",
135
+ type: "String",
136
+ label: "Color scale",
137
+ required: true,
138
+ attributes: { options: ["RedAmberGreen", "Rainbow", "WhiteToRed"] },
139
+ },
140
+ { name: "reverse", type: "Bool", label: "Reverse color scale" },
141
+ { name: "em_height", type: "Integer", label: "Height in em", default: 1.5 },
142
+ ],
143
+ isEdit: false,
144
+ run: (v, req, attrs = {}) => {
145
+ if (typeof v !== "number")
146
+ return "";
147
+ const pcnt0 = (v - attrs.min) / (attrs.max - attrs.min);
148
+ const pcnt = attrs.reverse ? 1 - pcnt0 : pcnt0;
149
+ const backgroundColor = {
150
+ Rainbow: `hsl(${360 * pcnt},100%, 50%)`,
151
+ RedAmberGreen: `hsl(${100 * pcnt},100%, 50%)`,
152
+ WhiteToRed: `hsl(0,100%, ${100 * (1 - pcnt / 2)}%)`,
153
+ }[attrs.color_scale];
154
+ return div({
155
+ class: "px-2",
156
+ style: {
157
+ width: "100%",
158
+ height: `${attrs.em_height || 1}em`,
159
+ backgroundColor,
160
+ },
161
+ }, text(v));
162
+ },
163
+ });
125
164
  const number_limit = (direction) => ({
126
165
  isEdit: false,
127
166
  isFilter: true,
@@ -822,6 +861,7 @@ const int = {
822
861
  number_slider: number_slider("Integer"),
823
862
  range_interval: range_interval("Integer"),
824
863
  progress_bar: progress_bar("Integer"),
864
+ heat_cell: heat_cell("Integer"),
825
865
  above_input: number_limit("gte"),
826
866
  below_input: number_limit("lte"),
827
867
  show_star_rating: {
@@ -1039,6 +1079,7 @@ const float = {
1039
1079
  number_slider: number_slider("Float"),
1040
1080
  range_interval: range_interval("Float"),
1041
1081
  progress_bar: progress_bar("Float"),
1082
+ heat_cell: heat_cell("Float"),
1042
1083
  above_input: float_number_limit("gte"),
1043
1084
  below_input: float_number_limit("lte"),
1044
1085
  },
@@ -1433,6 +1474,8 @@ const bool = {
1433
1474
  * @returns {boolean|null}
1434
1475
  */
1435
1476
  readFromFormRecord: (rec, name) => {
1477
+ if (rec[name] === "")
1478
+ return null;
1436
1479
  if (!rec[name])
1437
1480
  return false;
1438
1481
  if (["undefined", "false", "off"].includes(rec[name]))
@@ -1450,7 +1493,7 @@ const bool = {
1450
1493
  case "string":
1451
1494
  if (["TRUE", "T", "ON"].includes(v.toUpperCase()))
1452
1495
  return true;
1453
- if (v === "?")
1496
+ if (v === "?" || v === "")
1454
1497
  return null;
1455
1498
  else
1456
1499
  return false;