@genesislcap/foundation-forms 15.46.2-FUI-2628.3 → 15.46.3-FUI-0-form-export.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/custom-elements.json +314 -253
- package/dist/dts/form.d.ts +25 -5
- package/dist/dts/form.d.ts.map +1 -1
- package/dist/dts/form.template.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/review-print.d.ts +16 -0
- package/dist/dts/utils/review-print.d.ts.map +1 -0
- package/dist/esm/form.js +34 -2
- package/dist/esm/form.template.js +11 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/review-print.js +74 -0
- package/dist/foundation-forms.api.json +96 -0
- package/dist/foundation-forms.d.ts +41 -5
- package/package.json +13 -13
|
@@ -278,6 +278,25 @@
|
|
|
278
278
|
"description": "Name of a top-level data field whose value is shown as an identifier next to the\nreview heading (e.g. a record's primary key). No identifier is shown when unset.",
|
|
279
279
|
"privacy": "public"
|
|
280
280
|
},
|
|
281
|
+
{
|
|
282
|
+
"kind": "field",
|
|
283
|
+
"name": "showExportButton",
|
|
284
|
+
"type": {
|
|
285
|
+
"text": "boolean"
|
|
286
|
+
},
|
|
287
|
+
"description": "When enabled, shows an export button — in both the entry and review stages — that opens the\nbrowser's print dialog with a printer-friendly copy of the form data, laid out like the review\npanel (grouped label/value pairs), from which the user can save a PDF.",
|
|
288
|
+
"privacy": "public"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"kind": "field",
|
|
292
|
+
"name": "exportButtonText",
|
|
293
|
+
"type": {
|
|
294
|
+
"text": "string"
|
|
295
|
+
},
|
|
296
|
+
"default": "'Export PDF'",
|
|
297
|
+
"description": "Text to appear on the export button.",
|
|
298
|
+
"privacy": "public"
|
|
299
|
+
},
|
|
281
300
|
{
|
|
282
301
|
"kind": "field",
|
|
283
302
|
"name": "rowSubmitStatuses",
|
|
@@ -288,6 +307,17 @@
|
|
|
288
307
|
"description": "Tracks the submission status for each row in bulk insert mode.\nKey is the row index, value is the status object.",
|
|
289
308
|
"privacy": "public"
|
|
290
309
|
},
|
|
310
|
+
{
|
|
311
|
+
"kind": "method",
|
|
312
|
+
"name": "exportReview",
|
|
313
|
+
"return": {
|
|
314
|
+
"type": {
|
|
315
|
+
"text": "Promise<void>"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"description": "Opens the browser's print dialog with a printer-friendly copy of the form's current data —\nthe same sections the review panel shows, under `reviewHeading` — for printing or saving as\nPDF. Works in both the entry and review stages; no validation is required.",
|
|
319
|
+
"privacy": "public"
|
|
320
|
+
},
|
|
291
321
|
{
|
|
292
322
|
"kind": "method",
|
|
293
323
|
"name": "clearRowSubmitStatuses",
|
|
@@ -752,6 +782,23 @@
|
|
|
752
782
|
},
|
|
753
783
|
"description": "Name of a top-level data field whose value is shown as an identifier next to the\nreview heading (e.g. a record's primary key). No identifier is shown when unset.",
|
|
754
784
|
"fieldName": "reviewIdField"
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"name": "show-export-button",
|
|
788
|
+
"type": {
|
|
789
|
+
"text": "boolean"
|
|
790
|
+
},
|
|
791
|
+
"description": "When enabled, shows an export button — in both the entry and review stages — that opens the\nbrowser's print dialog with a printer-friendly copy of the form data, laid out like the review\npanel (grouped label/value pairs), from which the user can save a PDF.",
|
|
792
|
+
"fieldName": "showExportButton"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
"name": "export-button-text",
|
|
796
|
+
"type": {
|
|
797
|
+
"text": "string"
|
|
798
|
+
},
|
|
799
|
+
"default": "'Export PDF'",
|
|
800
|
+
"description": "Text to appear on the export button.",
|
|
801
|
+
"fieldName": "exportButtonText"
|
|
755
802
|
}
|
|
756
803
|
],
|
|
757
804
|
"mixins": [
|
|
@@ -2285,6 +2332,14 @@
|
|
|
2285
2332
|
"package": "./review-utils"
|
|
2286
2333
|
}
|
|
2287
2334
|
},
|
|
2335
|
+
{
|
|
2336
|
+
"kind": "js",
|
|
2337
|
+
"name": "*",
|
|
2338
|
+
"declaration": {
|
|
2339
|
+
"name": "*",
|
|
2340
|
+
"package": "./review-print"
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2288
2343
|
{
|
|
2289
2344
|
"kind": "js",
|
|
2290
2345
|
"name": "*",
|
|
@@ -2341,6 +2396,12 @@
|
|
|
2341
2396
|
"declarations": [],
|
|
2342
2397
|
"exports": []
|
|
2343
2398
|
},
|
|
2399
|
+
{
|
|
2400
|
+
"kind": "javascript-module",
|
|
2401
|
+
"path": "src/utils/review-print.ts",
|
|
2402
|
+
"declarations": [],
|
|
2403
|
+
"exports": []
|
|
2404
|
+
},
|
|
2344
2405
|
{
|
|
2345
2406
|
"kind": "javascript-module",
|
|
2346
2407
|
"path": "src/utils/review-utils.ts",
|
|
@@ -2553,8 +2614,259 @@
|
|
|
2553
2614
|
"kind": "js",
|
|
2554
2615
|
"name": "getAnyOfErrorMessage",
|
|
2555
2616
|
"declaration": {
|
|
2556
|
-
"name": "getAnyOfErrorMessage",
|
|
2557
|
-
"module": "src/utils/validation.ts"
|
|
2617
|
+
"name": "getAnyOfErrorMessage",
|
|
2618
|
+
"module": "src/utils/validation.ts"
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
]
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
"kind": "javascript-module",
|
|
2625
|
+
"path": "src/jsonforms/testers/isArray.ts",
|
|
2626
|
+
"declarations": [
|
|
2627
|
+
{
|
|
2628
|
+
"kind": "function",
|
|
2629
|
+
"name": "isArray",
|
|
2630
|
+
"parameters": [
|
|
2631
|
+
{
|
|
2632
|
+
"name": "itemsType",
|
|
2633
|
+
"type": {
|
|
2634
|
+
"text": "ArrayItemsType"
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
]
|
|
2638
|
+
}
|
|
2639
|
+
],
|
|
2640
|
+
"exports": [
|
|
2641
|
+
{
|
|
2642
|
+
"kind": "js",
|
|
2643
|
+
"name": "isArray",
|
|
2644
|
+
"declaration": {
|
|
2645
|
+
"name": "isArray",
|
|
2646
|
+
"module": "src/jsonforms/testers/isArray.ts"
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
]
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
"kind": "javascript-module",
|
|
2653
|
+
"path": "src/jsonforms/testers/isDate.ts",
|
|
2654
|
+
"declarations": [
|
|
2655
|
+
{
|
|
2656
|
+
"kind": "variable",
|
|
2657
|
+
"name": "isOneOfDate"
|
|
2658
|
+
}
|
|
2659
|
+
],
|
|
2660
|
+
"exports": [
|
|
2661
|
+
{
|
|
2662
|
+
"kind": "js",
|
|
2663
|
+
"name": "isOneOfDate",
|
|
2664
|
+
"declaration": {
|
|
2665
|
+
"name": "isOneOfDate",
|
|
2666
|
+
"module": "src/jsonforms/testers/isDate.ts"
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
]
|
|
2670
|
+
},
|
|
2671
|
+
{
|
|
2672
|
+
"kind": "javascript-module",
|
|
2673
|
+
"path": "src/jsonforms/testers/isInvisible.ts",
|
|
2674
|
+
"declarations": [
|
|
2675
|
+
{
|
|
2676
|
+
"kind": "function",
|
|
2677
|
+
"name": "isInvisible",
|
|
2678
|
+
"return": {
|
|
2679
|
+
"type": {
|
|
2680
|
+
"text": "boolean"
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
"parameters": [
|
|
2684
|
+
{
|
|
2685
|
+
"name": "uischema",
|
|
2686
|
+
"type": {
|
|
2687
|
+
"text": "UISchemaElement"
|
|
2688
|
+
}
|
|
2689
|
+
},
|
|
2690
|
+
{
|
|
2691
|
+
"name": "schema",
|
|
2692
|
+
"type": {
|
|
2693
|
+
"text": "JsonSchema"
|
|
2694
|
+
}
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
"name": "context",
|
|
2698
|
+
"type": {
|
|
2699
|
+
"text": "TesterContext"
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
]
|
|
2703
|
+
}
|
|
2704
|
+
],
|
|
2705
|
+
"exports": [
|
|
2706
|
+
{
|
|
2707
|
+
"kind": "js",
|
|
2708
|
+
"name": "isInvisible",
|
|
2709
|
+
"declaration": {
|
|
2710
|
+
"name": "isInvisible",
|
|
2711
|
+
"module": "src/jsonforms/testers/isInvisible.ts"
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
]
|
|
2715
|
+
},
|
|
2716
|
+
{
|
|
2717
|
+
"kind": "javascript-module",
|
|
2718
|
+
"path": "src/jsonforms/testers/isOneOfBoolean.ts",
|
|
2719
|
+
"declarations": [
|
|
2720
|
+
{
|
|
2721
|
+
"kind": "variable",
|
|
2722
|
+
"name": "isOneOfBoolean"
|
|
2723
|
+
}
|
|
2724
|
+
],
|
|
2725
|
+
"exports": [
|
|
2726
|
+
{
|
|
2727
|
+
"kind": "js",
|
|
2728
|
+
"name": "isOneOfBoolean",
|
|
2729
|
+
"declaration": {
|
|
2730
|
+
"name": "isOneOfBoolean",
|
|
2731
|
+
"module": "src/jsonforms/testers/isOneOfBoolean.ts"
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
]
|
|
2735
|
+
},
|
|
2736
|
+
{
|
|
2737
|
+
"kind": "javascript-module",
|
|
2738
|
+
"path": "src/jsonforms/testers/isOneOfEnum.ts",
|
|
2739
|
+
"declarations": [
|
|
2740
|
+
{
|
|
2741
|
+
"kind": "variable",
|
|
2742
|
+
"name": "isOneOfEnum"
|
|
2743
|
+
}
|
|
2744
|
+
],
|
|
2745
|
+
"exports": [
|
|
2746
|
+
{
|
|
2747
|
+
"kind": "js",
|
|
2748
|
+
"name": "isOneOfEnum",
|
|
2749
|
+
"declaration": {
|
|
2750
|
+
"name": "isOneOfEnum",
|
|
2751
|
+
"module": "src/jsonforms/testers/isOneOfEnum.ts"
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
]
|
|
2755
|
+
},
|
|
2756
|
+
{
|
|
2757
|
+
"kind": "javascript-module",
|
|
2758
|
+
"path": "src/jsonforms/testers/isOneOfNumber.ts",
|
|
2759
|
+
"declarations": [
|
|
2760
|
+
{
|
|
2761
|
+
"kind": "function",
|
|
2762
|
+
"name": "isBigDecimal",
|
|
2763
|
+
"return": {
|
|
2764
|
+
"type": {
|
|
2765
|
+
"text": "boolean"
|
|
2766
|
+
}
|
|
2767
|
+
},
|
|
2768
|
+
"parameters": [
|
|
2769
|
+
{
|
|
2770
|
+
"name": "fieldSchema",
|
|
2771
|
+
"type": {
|
|
2772
|
+
"text": "GenesisJsonSchema"
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
]
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
"kind": "variable",
|
|
2779
|
+
"name": "isOneOfNumber"
|
|
2780
|
+
}
|
|
2781
|
+
],
|
|
2782
|
+
"exports": [
|
|
2783
|
+
{
|
|
2784
|
+
"kind": "js",
|
|
2785
|
+
"name": "isBigDecimal",
|
|
2786
|
+
"declaration": {
|
|
2787
|
+
"name": "isBigDecimal",
|
|
2788
|
+
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
"kind": "js",
|
|
2793
|
+
"name": "isOneOfNumber",
|
|
2794
|
+
"declaration": {
|
|
2795
|
+
"name": "isOneOfNumber",
|
|
2796
|
+
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
]
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
"kind": "javascript-module",
|
|
2803
|
+
"path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
|
|
2804
|
+
"declarations": [
|
|
2805
|
+
{
|
|
2806
|
+
"kind": "variable",
|
|
2807
|
+
"name": "isOneOfOptionMultiselect"
|
|
2808
|
+
}
|
|
2809
|
+
],
|
|
2810
|
+
"exports": [
|
|
2811
|
+
{
|
|
2812
|
+
"kind": "js",
|
|
2813
|
+
"name": "isOneOfOptionMultiselect",
|
|
2814
|
+
"declaration": {
|
|
2815
|
+
"name": "isOneOfOptionMultiselect",
|
|
2816
|
+
"module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
]
|
|
2820
|
+
},
|
|
2821
|
+
{
|
|
2822
|
+
"kind": "javascript-module",
|
|
2823
|
+
"path": "src/jsonforms/testers/isTime.ts",
|
|
2824
|
+
"declarations": [
|
|
2825
|
+
{
|
|
2826
|
+
"kind": "variable",
|
|
2827
|
+
"name": "isOneOfTime"
|
|
2828
|
+
}
|
|
2829
|
+
],
|
|
2830
|
+
"exports": [
|
|
2831
|
+
{
|
|
2832
|
+
"kind": "js",
|
|
2833
|
+
"name": "isOneOfTime",
|
|
2834
|
+
"declaration": {
|
|
2835
|
+
"name": "isOneOfTime",
|
|
2836
|
+
"module": "src/jsonforms/testers/isTime.ts"
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
]
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"kind": "javascript-module",
|
|
2843
|
+
"path": "src/jsonforms/testers/optionIs.ts",
|
|
2844
|
+
"declarations": [
|
|
2845
|
+
{
|
|
2846
|
+
"kind": "function",
|
|
2847
|
+
"name": "optionIs",
|
|
2848
|
+
"return": {
|
|
2849
|
+
"type": {
|
|
2850
|
+
"text": "Tester"
|
|
2851
|
+
}
|
|
2852
|
+
},
|
|
2853
|
+
"parameters": [
|
|
2854
|
+
{
|
|
2855
|
+
"name": "optionName",
|
|
2856
|
+
"type": {
|
|
2857
|
+
"text": "string"
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
]
|
|
2861
|
+
}
|
|
2862
|
+
],
|
|
2863
|
+
"exports": [
|
|
2864
|
+
{
|
|
2865
|
+
"kind": "js",
|
|
2866
|
+
"name": "optionIs",
|
|
2867
|
+
"declaration": {
|
|
2868
|
+
"name": "optionIs",
|
|
2869
|
+
"module": "src/jsonforms/testers/optionIs.ts"
|
|
2558
2870
|
}
|
|
2559
2871
|
}
|
|
2560
2872
|
]
|
|
@@ -5388,257 +5700,6 @@
|
|
|
5388
5700
|
}
|
|
5389
5701
|
}
|
|
5390
5702
|
]
|
|
5391
|
-
},
|
|
5392
|
-
{
|
|
5393
|
-
"kind": "javascript-module",
|
|
5394
|
-
"path": "src/jsonforms/testers/isArray.ts",
|
|
5395
|
-
"declarations": [
|
|
5396
|
-
{
|
|
5397
|
-
"kind": "function",
|
|
5398
|
-
"name": "isArray",
|
|
5399
|
-
"parameters": [
|
|
5400
|
-
{
|
|
5401
|
-
"name": "itemsType",
|
|
5402
|
-
"type": {
|
|
5403
|
-
"text": "ArrayItemsType"
|
|
5404
|
-
}
|
|
5405
|
-
}
|
|
5406
|
-
]
|
|
5407
|
-
}
|
|
5408
|
-
],
|
|
5409
|
-
"exports": [
|
|
5410
|
-
{
|
|
5411
|
-
"kind": "js",
|
|
5412
|
-
"name": "isArray",
|
|
5413
|
-
"declaration": {
|
|
5414
|
-
"name": "isArray",
|
|
5415
|
-
"module": "src/jsonforms/testers/isArray.ts"
|
|
5416
|
-
}
|
|
5417
|
-
}
|
|
5418
|
-
]
|
|
5419
|
-
},
|
|
5420
|
-
{
|
|
5421
|
-
"kind": "javascript-module",
|
|
5422
|
-
"path": "src/jsonforms/testers/isDate.ts",
|
|
5423
|
-
"declarations": [
|
|
5424
|
-
{
|
|
5425
|
-
"kind": "variable",
|
|
5426
|
-
"name": "isOneOfDate"
|
|
5427
|
-
}
|
|
5428
|
-
],
|
|
5429
|
-
"exports": [
|
|
5430
|
-
{
|
|
5431
|
-
"kind": "js",
|
|
5432
|
-
"name": "isOneOfDate",
|
|
5433
|
-
"declaration": {
|
|
5434
|
-
"name": "isOneOfDate",
|
|
5435
|
-
"module": "src/jsonforms/testers/isDate.ts"
|
|
5436
|
-
}
|
|
5437
|
-
}
|
|
5438
|
-
]
|
|
5439
|
-
},
|
|
5440
|
-
{
|
|
5441
|
-
"kind": "javascript-module",
|
|
5442
|
-
"path": "src/jsonforms/testers/isInvisible.ts",
|
|
5443
|
-
"declarations": [
|
|
5444
|
-
{
|
|
5445
|
-
"kind": "function",
|
|
5446
|
-
"name": "isInvisible",
|
|
5447
|
-
"return": {
|
|
5448
|
-
"type": {
|
|
5449
|
-
"text": "boolean"
|
|
5450
|
-
}
|
|
5451
|
-
},
|
|
5452
|
-
"parameters": [
|
|
5453
|
-
{
|
|
5454
|
-
"name": "uischema",
|
|
5455
|
-
"type": {
|
|
5456
|
-
"text": "UISchemaElement"
|
|
5457
|
-
}
|
|
5458
|
-
},
|
|
5459
|
-
{
|
|
5460
|
-
"name": "schema",
|
|
5461
|
-
"type": {
|
|
5462
|
-
"text": "JsonSchema"
|
|
5463
|
-
}
|
|
5464
|
-
},
|
|
5465
|
-
{
|
|
5466
|
-
"name": "context",
|
|
5467
|
-
"type": {
|
|
5468
|
-
"text": "TesterContext"
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
|
-
]
|
|
5472
|
-
}
|
|
5473
|
-
],
|
|
5474
|
-
"exports": [
|
|
5475
|
-
{
|
|
5476
|
-
"kind": "js",
|
|
5477
|
-
"name": "isInvisible",
|
|
5478
|
-
"declaration": {
|
|
5479
|
-
"name": "isInvisible",
|
|
5480
|
-
"module": "src/jsonforms/testers/isInvisible.ts"
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
]
|
|
5484
|
-
},
|
|
5485
|
-
{
|
|
5486
|
-
"kind": "javascript-module",
|
|
5487
|
-
"path": "src/jsonforms/testers/isOneOfBoolean.ts",
|
|
5488
|
-
"declarations": [
|
|
5489
|
-
{
|
|
5490
|
-
"kind": "variable",
|
|
5491
|
-
"name": "isOneOfBoolean"
|
|
5492
|
-
}
|
|
5493
|
-
],
|
|
5494
|
-
"exports": [
|
|
5495
|
-
{
|
|
5496
|
-
"kind": "js",
|
|
5497
|
-
"name": "isOneOfBoolean",
|
|
5498
|
-
"declaration": {
|
|
5499
|
-
"name": "isOneOfBoolean",
|
|
5500
|
-
"module": "src/jsonforms/testers/isOneOfBoolean.ts"
|
|
5501
|
-
}
|
|
5502
|
-
}
|
|
5503
|
-
]
|
|
5504
|
-
},
|
|
5505
|
-
{
|
|
5506
|
-
"kind": "javascript-module",
|
|
5507
|
-
"path": "src/jsonforms/testers/isOneOfEnum.ts",
|
|
5508
|
-
"declarations": [
|
|
5509
|
-
{
|
|
5510
|
-
"kind": "variable",
|
|
5511
|
-
"name": "isOneOfEnum"
|
|
5512
|
-
}
|
|
5513
|
-
],
|
|
5514
|
-
"exports": [
|
|
5515
|
-
{
|
|
5516
|
-
"kind": "js",
|
|
5517
|
-
"name": "isOneOfEnum",
|
|
5518
|
-
"declaration": {
|
|
5519
|
-
"name": "isOneOfEnum",
|
|
5520
|
-
"module": "src/jsonforms/testers/isOneOfEnum.ts"
|
|
5521
|
-
}
|
|
5522
|
-
}
|
|
5523
|
-
]
|
|
5524
|
-
},
|
|
5525
|
-
{
|
|
5526
|
-
"kind": "javascript-module",
|
|
5527
|
-
"path": "src/jsonforms/testers/isOneOfNumber.ts",
|
|
5528
|
-
"declarations": [
|
|
5529
|
-
{
|
|
5530
|
-
"kind": "function",
|
|
5531
|
-
"name": "isBigDecimal",
|
|
5532
|
-
"return": {
|
|
5533
|
-
"type": {
|
|
5534
|
-
"text": "boolean"
|
|
5535
|
-
}
|
|
5536
|
-
},
|
|
5537
|
-
"parameters": [
|
|
5538
|
-
{
|
|
5539
|
-
"name": "fieldSchema",
|
|
5540
|
-
"type": {
|
|
5541
|
-
"text": "GenesisJsonSchema"
|
|
5542
|
-
}
|
|
5543
|
-
}
|
|
5544
|
-
]
|
|
5545
|
-
},
|
|
5546
|
-
{
|
|
5547
|
-
"kind": "variable",
|
|
5548
|
-
"name": "isOneOfNumber"
|
|
5549
|
-
}
|
|
5550
|
-
],
|
|
5551
|
-
"exports": [
|
|
5552
|
-
{
|
|
5553
|
-
"kind": "js",
|
|
5554
|
-
"name": "isBigDecimal",
|
|
5555
|
-
"declaration": {
|
|
5556
|
-
"name": "isBigDecimal",
|
|
5557
|
-
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
5558
|
-
}
|
|
5559
|
-
},
|
|
5560
|
-
{
|
|
5561
|
-
"kind": "js",
|
|
5562
|
-
"name": "isOneOfNumber",
|
|
5563
|
-
"declaration": {
|
|
5564
|
-
"name": "isOneOfNumber",
|
|
5565
|
-
"module": "src/jsonforms/testers/isOneOfNumber.ts"
|
|
5566
|
-
}
|
|
5567
|
-
}
|
|
5568
|
-
]
|
|
5569
|
-
},
|
|
5570
|
-
{
|
|
5571
|
-
"kind": "javascript-module",
|
|
5572
|
-
"path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
|
|
5573
|
-
"declarations": [
|
|
5574
|
-
{
|
|
5575
|
-
"kind": "variable",
|
|
5576
|
-
"name": "isOneOfOptionMultiselect"
|
|
5577
|
-
}
|
|
5578
|
-
],
|
|
5579
|
-
"exports": [
|
|
5580
|
-
{
|
|
5581
|
-
"kind": "js",
|
|
5582
|
-
"name": "isOneOfOptionMultiselect",
|
|
5583
|
-
"declaration": {
|
|
5584
|
-
"name": "isOneOfOptionMultiselect",
|
|
5585
|
-
"module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
|
|
5586
|
-
}
|
|
5587
|
-
}
|
|
5588
|
-
]
|
|
5589
|
-
},
|
|
5590
|
-
{
|
|
5591
|
-
"kind": "javascript-module",
|
|
5592
|
-
"path": "src/jsonforms/testers/isTime.ts",
|
|
5593
|
-
"declarations": [
|
|
5594
|
-
{
|
|
5595
|
-
"kind": "variable",
|
|
5596
|
-
"name": "isOneOfTime"
|
|
5597
|
-
}
|
|
5598
|
-
],
|
|
5599
|
-
"exports": [
|
|
5600
|
-
{
|
|
5601
|
-
"kind": "js",
|
|
5602
|
-
"name": "isOneOfTime",
|
|
5603
|
-
"declaration": {
|
|
5604
|
-
"name": "isOneOfTime",
|
|
5605
|
-
"module": "src/jsonforms/testers/isTime.ts"
|
|
5606
|
-
}
|
|
5607
|
-
}
|
|
5608
|
-
]
|
|
5609
|
-
},
|
|
5610
|
-
{
|
|
5611
|
-
"kind": "javascript-module",
|
|
5612
|
-
"path": "src/jsonforms/testers/optionIs.ts",
|
|
5613
|
-
"declarations": [
|
|
5614
|
-
{
|
|
5615
|
-
"kind": "function",
|
|
5616
|
-
"name": "optionIs",
|
|
5617
|
-
"return": {
|
|
5618
|
-
"type": {
|
|
5619
|
-
"text": "Tester"
|
|
5620
|
-
}
|
|
5621
|
-
},
|
|
5622
|
-
"parameters": [
|
|
5623
|
-
{
|
|
5624
|
-
"name": "optionName",
|
|
5625
|
-
"type": {
|
|
5626
|
-
"text": "string"
|
|
5627
|
-
}
|
|
5628
|
-
}
|
|
5629
|
-
]
|
|
5630
|
-
}
|
|
5631
|
-
],
|
|
5632
|
-
"exports": [
|
|
5633
|
-
{
|
|
5634
|
-
"kind": "js",
|
|
5635
|
-
"name": "optionIs",
|
|
5636
|
-
"declaration": {
|
|
5637
|
-
"name": "optionIs",
|
|
5638
|
-
"module": "src/jsonforms/testers/optionIs.ts"
|
|
5639
|
-
}
|
|
5640
|
-
}
|
|
5641
|
-
]
|
|
5642
5703
|
}
|
|
5643
5704
|
]
|
|
5644
5705
|
}
|
package/dist/dts/form.d.ts
CHANGED
|
@@ -260,11 +260,7 @@ declare const Form_base: (new (...args: any[]) => {
|
|
|
260
260
|
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
261
261
|
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
262
262
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
263
|
-
replaceChildren(...
|
|
264
|
-
* Tracks the submission status for each row in bulk insert mode.
|
|
265
|
-
* Key is the row index, value is the status object.
|
|
266
|
-
* @public
|
|
267
|
-
*/nodes: (Node | string)[]): void;
|
|
263
|
+
replaceChildren(...nodes: (Node | string)[]): void;
|
|
268
264
|
readonly assignedSlot: HTMLSlotElement | null;
|
|
269
265
|
readonly attributeStyleMap: StylePropertyMap;
|
|
270
266
|
get style(): CSSStyleDeclaration;
|
|
@@ -650,6 +646,18 @@ export declare class Form extends Form_base {
|
|
|
650
646
|
* @public
|
|
651
647
|
*/
|
|
652
648
|
reviewIdField: string;
|
|
649
|
+
/**
|
|
650
|
+
* When enabled, shows an export button — in both the entry and review stages — that opens the
|
|
651
|
+
* browser's print dialog with a printer-friendly copy of the form data, laid out like the review
|
|
652
|
+
* panel (grouped label/value pairs), from which the user can save a PDF.
|
|
653
|
+
* @public
|
|
654
|
+
*/
|
|
655
|
+
showExportButton: boolean;
|
|
656
|
+
/**
|
|
657
|
+
* Text to appear on the export button.
|
|
658
|
+
* @public
|
|
659
|
+
*/
|
|
660
|
+
exportButtonText: string;
|
|
653
661
|
/**
|
|
654
662
|
* Tracks the submission status for each row in bulk insert mode.
|
|
655
663
|
* Key is the row index, value is the status object.
|
|
@@ -675,6 +683,18 @@ export declare class Form extends Form_base {
|
|
|
675
683
|
* @internal
|
|
676
684
|
*/
|
|
677
685
|
_submit(): Promise<void>;
|
|
686
|
+
/**
|
|
687
|
+
* Review sections for the form's current data, resolved the same way the controls display them.
|
|
688
|
+
* @internal
|
|
689
|
+
*/
|
|
690
|
+
private buildCurrentReviewSections;
|
|
691
|
+
/**
|
|
692
|
+
* Opens the browser's print dialog with a printer-friendly copy of the form's current data —
|
|
693
|
+
* the same sections the review panel shows, under `reviewHeading` — for printing or saving as
|
|
694
|
+
* PDF. Works in both the entry and review stages; no validation is required.
|
|
695
|
+
* @public
|
|
696
|
+
*/
|
|
697
|
+
exportReview(): Promise<void>;
|
|
678
698
|
/**
|
|
679
699
|
* Called from the review panel to go back to the form.
|
|
680
700
|
* @internal
|
package/dist/dts/form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,aAAa,EAGd,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB1C,OAAO,EACL,aAAa,EAOb,yBAAyB,EACzB,aAAa,EAOb,QAAQ,EACT,MAAM,SAAS,CAAC;AACjB,OAAO,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,aAAa,EAGd,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB1C,OAAO,EACL,aAAa,EAOb,yBAAyB,EACzB,aAAa,EAOb,QAAQ,EACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAaL,aAAa,EACd,MAAM,SAAS,CAAC;AAiBjB;;;GAGG;AACH,eAAO,MAAM,SAAS,OAwBrB,CAAC;;;;;;;;kBA9CU,CAAC;;;;;;;;8BAqDkB,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAUO,CAAC;4IAEvC,CAAC;wFACsB,CAAC;+IAQtB,CAAA;2FAIf,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA4BgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBAwEc,CAAC;;;;;;;;;;;;;6BAyBD,CAAC;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ACH,kBAAkB,IAAI,IAAI;IAK1B;;;OAGG;IACH,KAAK,CAAC,SAAS,UAAO;IAYtB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAW9B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAQlC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;;OAGG;IACH,kBAAkB;IAQlB;;;OAGG;IACG,kBAAkB;IAuDxB;;;;;OAKG;IACG,qBAAqB,CAAC,KAAK,EAAE,KAAK;IA4FxC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;;;OAKG;IACH,mBAAmB;CA+BpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAmBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,
|
|
1
|
+
{"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAmBnC,gBAAgB;AAChB,eAAO,MAAM,eAAe,GAAI,WAAM,8DAiLrC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,2DAElC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReviewSection } from './review-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Renders review sections as a standalone, print-only HTML document — plain black on white, one
|
|
4
|
+
* label/value table per section, no app styling or scripts. Untitled sections get the same `—`
|
|
5
|
+
* heading the review panel uses, so their fields don't read as part of the section before them.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderReviewPrintDocument(heading: string, sections: ReviewSection[], recordId?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Prints an HTML document through a hidden, `src`-less iframe — the markup is written straight in,
|
|
11
|
+
* so nothing is fetched and the app isn't reloaded, and there's no popup to be blocked. The
|
|
12
|
+
* browser's print dialog offers "Save as PDF". The iframe is removed once printing finishes.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function printHtmlDocument(markup: string): void;
|
|
16
|
+
//# sourceMappingURL=review-print.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-print.d.ts","sourceRoot":"","sources":["../../../src/utils/review-print.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAYpD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,EAAE,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CA2CR;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAYtD"}
|
package/dist/esm/form.js
CHANGED
|
@@ -29,7 +29,7 @@ import { NumberControlRendererEntry } from './jsonforms/renderers/NumberControlR
|
|
|
29
29
|
import { SegmentedControlRendererEntry } from './jsonforms/renderers/SegmentedControlRenderer';
|
|
30
30
|
import { StringArrayEntry } from './jsonforms/renderers/StringArrayControlRenderer';
|
|
31
31
|
import { StringControlRendererTemplate } from './jsonforms/renderers/StringControlRenderer';
|
|
32
|
-
import { buildReviewSections, downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, getDataValueAtPath, logger, mapCsvToSchema, mapGenesisFieldErrorsToAdditionalErrors, parseCsv, } from './utils';
|
|
32
|
+
import { buildReviewSections, downloadCsvTemplate as downloadCsvFile, extractFieldsFromUiSchema, generateCsvTemplate, getDataValueAtPath, logger, mapCsvToSchema, mapGenesisFieldErrorsToAdditionalErrors, parseCsv, printHtmlDocument, renderReviewPrintDocument, } from './utils';
|
|
33
33
|
import { findModalParent, showConfirmationDialog } from './utils/confirmation-dialog-utils';
|
|
34
34
|
import { removeDataPropertiesNotInSchema } from './utils/form-utils';
|
|
35
35
|
import { generateBulkUiSchema, isBulkUiSchema } from './utils/schema-utils';
|
|
@@ -182,6 +182,11 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
182
182
|
* @public
|
|
183
183
|
*/
|
|
184
184
|
this.reviewHeading = 'Review';
|
|
185
|
+
/**
|
|
186
|
+
* Text to appear on the export button.
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
this.exportButtonText = 'Export PDF';
|
|
185
190
|
/**
|
|
186
191
|
* Tracks the submission status for each row in bulk insert mode.
|
|
187
192
|
* Key is the row index, value is the status object.
|
|
@@ -338,13 +343,34 @@ let Form = class Form extends LifecycleMixin(FoundationElement) {
|
|
|
338
343
|
}
|
|
339
344
|
// Show review preview if enabled and the form has no validation errors.
|
|
340
345
|
if (this.showSubmitReview && !this.hasValidationErrors()) {
|
|
341
|
-
this.reviewSections = yield
|
|
346
|
+
this.reviewSections = yield this.buildCurrentReviewSections();
|
|
342
347
|
this.reviewMode = true;
|
|
343
348
|
return;
|
|
344
349
|
}
|
|
345
350
|
yield this._performSubmit();
|
|
346
351
|
});
|
|
347
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Review sections for the form's current data, resolved the same way the controls display them.
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
buildCurrentReviewSections() {
|
|
358
|
+
return buildReviewSections(this.data || {}, this.userProvidedUiSchema || this.uischema, this.originalDetailsSchema || this.jsonSchema);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Opens the browser's print dialog with a printer-friendly copy of the form's current data —
|
|
362
|
+
* the same sections the review panel shows, under `reviewHeading` — for printing or saving as
|
|
363
|
+
* PDF. Works in both the entry and review stages; no validation is required.
|
|
364
|
+
* @public
|
|
365
|
+
*/
|
|
366
|
+
exportReview() {
|
|
367
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
+
const sections = this.reviewMode
|
|
369
|
+
? this.reviewSections
|
|
370
|
+
: yield this.buildCurrentReviewSections();
|
|
371
|
+
printHtmlDocument(renderReviewPrintDocument(this.reviewHeading, sections, this.reviewRecordId));
|
|
372
|
+
});
|
|
373
|
+
}
|
|
348
374
|
/**
|
|
349
375
|
* Called from the review panel to go back to the form.
|
|
350
376
|
* @internal
|
|
@@ -1095,6 +1121,12 @@ __decorate([
|
|
|
1095
1121
|
__decorate([
|
|
1096
1122
|
attr({ attribute: 'review-id-field' })
|
|
1097
1123
|
], Form.prototype, "reviewIdField", void 0);
|
|
1124
|
+
__decorate([
|
|
1125
|
+
attr({ attribute: 'show-export-button', mode: 'boolean' })
|
|
1126
|
+
], Form.prototype, "showExportButton", void 0);
|
|
1127
|
+
__decorate([
|
|
1128
|
+
attr({ attribute: 'export-button-text' })
|
|
1129
|
+
], Form.prototype, "exportButtonText", void 0);
|
|
1098
1130
|
__decorate([
|
|
1099
1131
|
observable
|
|
1100
1132
|
], Form.prototype, "rowSubmitStatuses", void 0);
|
|
@@ -69,7 +69,7 @@ export const getPrefixedForm = (prefix) => html `
|
|
|
69
69
|
:sections=${(x) => x.reviewSections}
|
|
70
70
|
></foundation-form-review>
|
|
71
71
|
`)}
|
|
72
|
-
${when((x) => x.reviewMode || x.isSubmitHidden || x.isResetVisible, html `
|
|
72
|
+
${when((x) => x.reviewMode || x.isSubmitHidden || x.isResetVisible || x.showExportButton, html `
|
|
73
73
|
<slot name="userActions" part="userActions" class="actions">
|
|
74
74
|
${when((x) => !x.reviewMode && x.isResetVisible, html `
|
|
75
75
|
<${prefix}-button
|
|
@@ -91,6 +91,16 @@ export const getPrefixedForm = (prefix) => html `
|
|
|
91
91
|
Back
|
|
92
92
|
</${prefix}-button>
|
|
93
93
|
`)}
|
|
94
|
+
${when((x) => x.showExportButton, html `
|
|
95
|
+
<${prefix}-button
|
|
96
|
+
@click="${(x) => x.exportReview()}"
|
|
97
|
+
class="export-button"
|
|
98
|
+
appearance="neutral"
|
|
99
|
+
data-test-id="export-button"
|
|
100
|
+
>
|
|
101
|
+
${(x) => x.exportButtonText}
|
|
102
|
+
</${prefix}-button>
|
|
103
|
+
`)}
|
|
94
104
|
${when((x) => !x.reviewMode && x.isSubmitHidden, html `
|
|
95
105
|
<${prefix}-button
|
|
96
106
|
@click="${(x) => x._submit()}"
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const HTML_ESCAPES = {
|
|
2
|
+
'&': '&',
|
|
3
|
+
'<': '<',
|
|
4
|
+
'>': '>',
|
|
5
|
+
'"': '"',
|
|
6
|
+
"'": ''',
|
|
7
|
+
};
|
|
8
|
+
const escapeHtml = (value) => value.replace(/[&<>"']/g, (ch) => HTML_ESCAPES[ch]);
|
|
9
|
+
/**
|
|
10
|
+
* Renders review sections as a standalone, print-only HTML document — plain black on white, one
|
|
11
|
+
* label/value table per section, no app styling or scripts. Untitled sections get the same `—`
|
|
12
|
+
* heading the review panel uses, so their fields don't read as part of the section before them.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export function renderReviewPrintDocument(heading, sections, recordId) {
|
|
16
|
+
const title = recordId ? `${heading} ${recordId}` : heading;
|
|
17
|
+
const body = sections
|
|
18
|
+
.filter((section) => section.fields.length > 0)
|
|
19
|
+
.map((section) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return `
|
|
22
|
+
<section>
|
|
23
|
+
<h2>${escapeHtml((_a = section.title) !== null && _a !== void 0 ? _a : '—')}</h2>
|
|
24
|
+
<table>
|
|
25
|
+
${section.fields
|
|
26
|
+
.map((field) => { var _a; return `<tr><th>${escapeHtml(field.label)}</th><td>${escapeHtml((_a = field.value) !== null && _a !== void 0 ? _a : '')}</td></tr>`; })
|
|
27
|
+
.join('')}
|
|
28
|
+
</table>
|
|
29
|
+
</section>
|
|
30
|
+
`;
|
|
31
|
+
})
|
|
32
|
+
.join('');
|
|
33
|
+
return `<!doctype html>
|
|
34
|
+
<html>
|
|
35
|
+
<head>
|
|
36
|
+
<meta charset="utf-8" />
|
|
37
|
+
<title>${escapeHtml(title)}</title>
|
|
38
|
+
<style>
|
|
39
|
+
@page { margin: 16mm; }
|
|
40
|
+
body { font-family: system-ui, sans-serif; font-size: 11pt; color: #000; background: #fff; }
|
|
41
|
+
h1 { font-size: 16pt; margin: 0 0 12pt; }
|
|
42
|
+
h2 { font-size: 12pt; margin: 14pt 0 4pt; border-bottom: 1px solid #000; }
|
|
43
|
+
table { width: 100%; border-collapse: collapse; }
|
|
44
|
+
section, tr { break-inside: avoid; }
|
|
45
|
+
th, td { text-align: left; vertical-align: top; padding: 3pt 6pt; border-bottom: 1px solid #ccc; }
|
|
46
|
+
th { width: 35%; font-weight: 600; }
|
|
47
|
+
td { white-space: pre-line; }
|
|
48
|
+
</style>
|
|
49
|
+
</head>
|
|
50
|
+
<body>
|
|
51
|
+
<h1>${escapeHtml(title)}</h1>
|
|
52
|
+
${body}
|
|
53
|
+
</body>
|
|
54
|
+
</html>`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Prints an HTML document through a hidden, `src`-less iframe — the markup is written straight in,
|
|
58
|
+
* so nothing is fetched and the app isn't reloaded, and there's no popup to be blocked. The
|
|
59
|
+
* browser's print dialog offers "Save as PDF". The iframe is removed once printing finishes.
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export function printHtmlDocument(markup) {
|
|
63
|
+
const frame = document.createElement('iframe');
|
|
64
|
+
frame.setAttribute('aria-hidden', 'true');
|
|
65
|
+
frame.style.cssText = 'position: fixed; width: 0; height: 0; border: 0; visibility: hidden;';
|
|
66
|
+
document.body.appendChild(frame);
|
|
67
|
+
const frameWindow = frame.contentWindow;
|
|
68
|
+
frameWindow.document.open();
|
|
69
|
+
frameWindow.document.write(markup);
|
|
70
|
+
frameWindow.document.close();
|
|
71
|
+
frameWindow.addEventListener('afterprint', () => frame.remove(), { once: true });
|
|
72
|
+
frameWindow.focus();
|
|
73
|
+
frameWindow.print();
|
|
74
|
+
}
|
|
@@ -2354,6 +2354,72 @@
|
|
|
2354
2354
|
"isAbstract": false,
|
|
2355
2355
|
"name": "downloadCsvTemplate"
|
|
2356
2356
|
},
|
|
2357
|
+
{
|
|
2358
|
+
"kind": "Property",
|
|
2359
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#exportButtonText:member",
|
|
2360
|
+
"docComment": "/**\n * Text to appear on the export button.\n *\n * @public\n */\n",
|
|
2361
|
+
"excerptTokens": [
|
|
2362
|
+
{
|
|
2363
|
+
"kind": "Content",
|
|
2364
|
+
"text": "exportButtonText: "
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
"kind": "Content",
|
|
2368
|
+
"text": "string"
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
"kind": "Content",
|
|
2372
|
+
"text": ";"
|
|
2373
|
+
}
|
|
2374
|
+
],
|
|
2375
|
+
"isReadonly": false,
|
|
2376
|
+
"isOptional": false,
|
|
2377
|
+
"releaseTag": "Public",
|
|
2378
|
+
"name": "exportButtonText",
|
|
2379
|
+
"propertyTypeTokenRange": {
|
|
2380
|
+
"startIndex": 1,
|
|
2381
|
+
"endIndex": 2
|
|
2382
|
+
},
|
|
2383
|
+
"isStatic": false,
|
|
2384
|
+
"isProtected": false,
|
|
2385
|
+
"isAbstract": false
|
|
2386
|
+
},
|
|
2387
|
+
{
|
|
2388
|
+
"kind": "Method",
|
|
2389
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#exportReview:member(1)",
|
|
2390
|
+
"docComment": "/**\n * Opens the browser's print dialog with a printer-friendly copy of the form's current data — the same sections the review panel shows, under `reviewHeading` — for printing or saving as PDF. Works in both the entry and review stages; no validation is required.\n *\n * @public\n */\n",
|
|
2391
|
+
"excerptTokens": [
|
|
2392
|
+
{
|
|
2393
|
+
"kind": "Content",
|
|
2394
|
+
"text": "exportReview(): "
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
"kind": "Reference",
|
|
2398
|
+
"text": "Promise",
|
|
2399
|
+
"canonicalReference": "!Promise:interface"
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
"kind": "Content",
|
|
2403
|
+
"text": "<void>"
|
|
2404
|
+
},
|
|
2405
|
+
{
|
|
2406
|
+
"kind": "Content",
|
|
2407
|
+
"text": ";"
|
|
2408
|
+
}
|
|
2409
|
+
],
|
|
2410
|
+
"isStatic": false,
|
|
2411
|
+
"returnTypeTokenRange": {
|
|
2412
|
+
"startIndex": 1,
|
|
2413
|
+
"endIndex": 3
|
|
2414
|
+
},
|
|
2415
|
+
"releaseTag": "Public",
|
|
2416
|
+
"isProtected": false,
|
|
2417
|
+
"overloadIndex": 1,
|
|
2418
|
+
"parameters": [],
|
|
2419
|
+
"isOptional": false,
|
|
2420
|
+
"isAbstract": false,
|
|
2421
|
+
"name": "exportReview"
|
|
2422
|
+
},
|
|
2357
2423
|
{
|
|
2358
2424
|
"kind": "Method",
|
|
2359
2425
|
"canonicalReference": "@genesislcap/foundation-forms!Form#handleCsvFileSelected:member(1)",
|
|
@@ -2836,6 +2902,36 @@
|
|
|
2836
2902
|
"isProtected": false,
|
|
2837
2903
|
"isAbstract": false
|
|
2838
2904
|
},
|
|
2905
|
+
{
|
|
2906
|
+
"kind": "Property",
|
|
2907
|
+
"canonicalReference": "@genesislcap/foundation-forms!Form#showExportButton:member",
|
|
2908
|
+
"docComment": "/**\n * When enabled, shows an export button — in both the entry and review stages — that opens the browser's print dialog with a printer-friendly copy of the form data, laid out like the review panel (grouped label/value pairs), from which the user can save a PDF.\n *\n * @public\n */\n",
|
|
2909
|
+
"excerptTokens": [
|
|
2910
|
+
{
|
|
2911
|
+
"kind": "Content",
|
|
2912
|
+
"text": "showExportButton: "
|
|
2913
|
+
},
|
|
2914
|
+
{
|
|
2915
|
+
"kind": "Content",
|
|
2916
|
+
"text": "boolean"
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
"kind": "Content",
|
|
2920
|
+
"text": ";"
|
|
2921
|
+
}
|
|
2922
|
+
],
|
|
2923
|
+
"isReadonly": false,
|
|
2924
|
+
"isOptional": false,
|
|
2925
|
+
"releaseTag": "Public",
|
|
2926
|
+
"name": "showExportButton",
|
|
2927
|
+
"propertyTypeTokenRange": {
|
|
2928
|
+
"startIndex": 1,
|
|
2929
|
+
"endIndex": 2
|
|
2930
|
+
},
|
|
2931
|
+
"isStatic": false,
|
|
2932
|
+
"isProtected": false,
|
|
2933
|
+
"isAbstract": false
|
|
2934
|
+
},
|
|
2839
2935
|
{
|
|
2840
2936
|
"kind": "Property",
|
|
2841
2937
|
"canonicalReference": "@genesislcap/foundation-forms!Form#showReset:member",
|
|
@@ -1447,6 +1447,18 @@ export declare class Form extends Form_base {
|
|
|
1447
1447
|
* @public
|
|
1448
1448
|
*/
|
|
1449
1449
|
reviewIdField: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* When enabled, shows an export button — in both the entry and review stages — that opens the
|
|
1452
|
+
* browser's print dialog with a printer-friendly copy of the form data, laid out like the review
|
|
1453
|
+
* panel (grouped label/value pairs), from which the user can save a PDF.
|
|
1454
|
+
* @public
|
|
1455
|
+
*/
|
|
1456
|
+
showExportButton: boolean;
|
|
1457
|
+
/**
|
|
1458
|
+
* Text to appear on the export button.
|
|
1459
|
+
* @public
|
|
1460
|
+
*/
|
|
1461
|
+
exportButtonText: string;
|
|
1450
1462
|
/**
|
|
1451
1463
|
* Tracks the submission status for each row in bulk insert mode.
|
|
1452
1464
|
* Key is the row index, value is the status object.
|
|
@@ -1472,6 +1484,18 @@ export declare class Form extends Form_base {
|
|
|
1472
1484
|
* @internal
|
|
1473
1485
|
*/
|
|
1474
1486
|
_submit(): Promise<void>;
|
|
1487
|
+
/**
|
|
1488
|
+
* Review sections for the form's current data, resolved the same way the controls display them.
|
|
1489
|
+
* @internal
|
|
1490
|
+
*/
|
|
1491
|
+
private buildCurrentReviewSections;
|
|
1492
|
+
/**
|
|
1493
|
+
* Opens the browser's print dialog with a printer-friendly copy of the form's current data —
|
|
1494
|
+
* the same sections the review panel shows, under `reviewHeading` — for printing or saving as
|
|
1495
|
+
* PDF. Works in both the entry and review stages; no validation is required.
|
|
1496
|
+
* @public
|
|
1497
|
+
*/
|
|
1498
|
+
exportReview(): Promise<void>;
|
|
1475
1499
|
/**
|
|
1476
1500
|
* Called from the review panel to go back to the form.
|
|
1477
1501
|
* @internal
|
|
@@ -1871,11 +1895,7 @@ declare const Form_base: (new (...args: any[]) => {
|
|
|
1871
1895
|
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
1872
1896
|
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
1873
1897
|
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
1874
|
-
replaceChildren(...
|
|
1875
|
-
* Tracks the submission status for each row in bulk insert mode.
|
|
1876
|
-
* Key is the row index, value is the status object.
|
|
1877
|
-
* @public
|
|
1878
|
-
*/nodes: (Node | string)[]): void;
|
|
1898
|
+
replaceChildren(...nodes: (Node | string)[]): void;
|
|
1879
1899
|
readonly assignedSlot: HTMLSlotElement | null;
|
|
1880
1900
|
readonly attributeStyleMap: StylePropertyMap;
|
|
1881
1901
|
get style(): CSSStyleDeclaration;
|
|
@@ -2413,6 +2433,14 @@ export declare type NumberRendererOptions = {
|
|
|
2413
2433
|
*/
|
|
2414
2434
|
export declare function parseCsv(content: string): CsvParseResult;
|
|
2415
2435
|
|
|
2436
|
+
/**
|
|
2437
|
+
* Prints an HTML document through a hidden, `src`-less iframe — the markup is written straight in,
|
|
2438
|
+
* so nothing is fetched and the app isn't reloaded, and there's no popup to be blocked. The
|
|
2439
|
+
* browser's print dialog offers "Save as PDF". The iframe is removed once printing finishes.
|
|
2440
|
+
* @internal
|
|
2441
|
+
*/
|
|
2442
|
+
export declare function printHtmlDocument(markup: string): void;
|
|
2443
|
+
|
|
2416
2444
|
/**
|
|
2417
2445
|
* Configuration options available for the enum radio-group renderer.
|
|
2418
2446
|
* Activated when `options.radio` is `true` on a Control element.
|
|
@@ -2500,6 +2528,14 @@ export declare type RendererEntry = {
|
|
|
2500
2528
|
*/
|
|
2501
2529
|
export declare const renderers: any[];
|
|
2502
2530
|
|
|
2531
|
+
/**
|
|
2532
|
+
* Renders review sections as a standalone, print-only HTML document — plain black on white, one
|
|
2533
|
+
* label/value table per section, no app styling or scripts. Untitled sections get the same `—`
|
|
2534
|
+
* heading the review panel uses, so their fields don't read as part of the section before them.
|
|
2535
|
+
* @internal
|
|
2536
|
+
*/
|
|
2537
|
+
export declare function renderReviewPrintDocument(heading: string, sections: ReviewSection[], recordId?: string): string;
|
|
2538
|
+
|
|
2503
2539
|
/**
|
|
2504
2540
|
* For plain enum combobox fields (no options.data), applies the same `capitalCase`
|
|
2505
2541
|
* transform the renderer uses — e.g. `SEMI_ANNUAL` → `Semi Annual`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-forms",
|
|
3
3
|
"description": "Genesis Foundation Forms",
|
|
4
|
-
"version": "15.46.
|
|
4
|
+
"version": "15.46.3-FUI-0-form-export.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@genesislcap/foundation-testing": "15.46.
|
|
60
|
-
"@genesislcap/genx": "15.46.
|
|
61
|
-
"@genesislcap/ts-builder": "15.46.
|
|
62
|
-
"@genesislcap/uvu-playwright-builder": "15.46.
|
|
63
|
-
"@genesislcap/vite-builder": "15.46.
|
|
64
|
-
"@genesislcap/webpack-builder": "15.46.
|
|
59
|
+
"@genesislcap/foundation-testing": "15.46.3-FUI-0-form-export.1",
|
|
60
|
+
"@genesislcap/genx": "15.46.3-FUI-0-form-export.1",
|
|
61
|
+
"@genesislcap/ts-builder": "15.46.3-FUI-0-form-export.1",
|
|
62
|
+
"@genesislcap/uvu-playwright-builder": "15.46.3-FUI-0-form-export.1",
|
|
63
|
+
"@genesislcap/vite-builder": "15.46.3-FUI-0-form-export.1",
|
|
64
|
+
"@genesislcap/webpack-builder": "15.46.3-FUI-0-form-export.1",
|
|
65
65
|
"@types/json-schema": "^7.0.11",
|
|
66
66
|
"@types/papaparse": "^5.3.14"
|
|
67
67
|
},
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@genesislcap/foundation-comms": "15.46.
|
|
82
|
-
"@genesislcap/foundation-criteria": "15.46.
|
|
83
|
-
"@genesislcap/foundation-logger": "15.46.
|
|
84
|
-
"@genesislcap/foundation-notifications": "15.46.
|
|
85
|
-
"@genesislcap/foundation-ui": "15.46.
|
|
86
|
-
"@genesislcap/foundation-utils": "15.46.
|
|
81
|
+
"@genesislcap/foundation-comms": "15.46.3-FUI-0-form-export.1",
|
|
82
|
+
"@genesislcap/foundation-criteria": "15.46.3-FUI-0-form-export.1",
|
|
83
|
+
"@genesislcap/foundation-logger": "15.46.3-FUI-0-form-export.1",
|
|
84
|
+
"@genesislcap/foundation-notifications": "15.46.3-FUI-0-form-export.1",
|
|
85
|
+
"@genesislcap/foundation-ui": "15.46.3-FUI-0-form-export.1",
|
|
86
|
+
"@genesislcap/foundation-utils": "15.46.3-FUI-0-form-export.1",
|
|
87
87
|
"@json-schema-tools/dereferencer": "^1.6.1",
|
|
88
88
|
"@jsonforms/core": "^3.2.1",
|
|
89
89
|
"@microsoft/fast-components": "2.30.6",
|