pict-section-form 1.0.84 → 1.0.86

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.
@@ -8,6 +8,8 @@
8
8
  "Name": "Rectangular Area Calculator",
9
9
  "Description": "Calculate the area of a Rectangle",
10
10
 
11
+ "CustomCSS": "h3 { color: #ff00ff; font-size: 1.5em; }",
12
+
11
13
  "Solvers":
12
14
  [
13
15
  "Area = Height * Width",
@@ -77,8 +79,41 @@
77
79
  {
78
80
  "Name":"Area of Rectangle",
79
81
  "Hash":"Area",
80
- "DataType":"Number"
81
- ,"PictForm": { "Section":"Area", "Row":4, "Width":2 }
82
+ "DataType":"PreciseNumber"
83
+
84
+ ,"PictForm": {"InputType": "PreciseNumberReadOnly", "DecimalPrecision": 3, "DigitsPrefix": "$", "DigitsPostfix": " DOllars", "Section":"Area", "Row":4, "Width":2 }
85
+ },
86
+
87
+ "PreciseNumberOutputExercise":
88
+ {
89
+ "Name":"DataType PreciseNumber",
90
+ "Hash":"DTPN",
91
+ "DataType":"PreciseNumber"
92
+ ,"PictForm": {"InputType": "PreciseNumberReadOnly", "Section":"Marshaling", "Row":1, "Width":3 }
93
+ },
94
+ "PreciseNumberInputOutputExercise":
95
+ {
96
+ "Name":"InputType PreciseNumberReadOnly",
97
+ "Hash":"ITPNRO",
98
+ "DataType":"PreciseNumber",
99
+ "InputType": "PreciseNumberReadOnly"
100
+ ,"PictForm": { "Section":"Marshaling", "Row":1, "Width":3 }
101
+ },
102
+ "DollarsOutputExercise":
103
+ {
104
+ "Name":"InputType DollarsReadOnly",
105
+ "Hash":"ITDRO",
106
+ "DataType":"PreciseNumber",
107
+ "InputType": "DollarsReadOnly"
108
+ ,"PictForm": { "Section":"Marshaling", "Row":1, "Width":3 }
109
+ },
110
+ "PercentOutputExercise":
111
+ {
112
+ "Name":"InputType PercentReadOnly",
113
+ "Hash":"ITPRO",
114
+ "DataType":"PreciseNumber",
115
+ "InputType": "PercentReadOnly"
116
+ ,"PictForm": { "Section":"Marshaling", "Row":1, "Width":3 }
82
117
  }
83
118
  }
84
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -180,6 +180,19 @@ Glug glug glug Oo... -->
180
180
 
181
181
  `
182
182
  },
183
+
184
+ {
185
+ "HashPostfix": "-Template-Input-InputType-PreciseNumberReadOnly",
186
+ "DefaultInputExtensions": ["Pict-Input-PreciseNumber"],
187
+ "Template": /*HTML*/`
188
+ <!-- InputType PreciseNumberReadOnly {~D:Record.Hash~} {~D:Record.DataType~} -->
189
+ <span>{~D:Record.Name~}:</span>
190
+ <input type="hidden" {~D:Record.Macro.InputFullProperties~} value="">
191
+ <input type="text" id="INPUT-FOR-{~D:Record.Macro.RawHTMLID~}" {~D:Record.Macro.InputChangeHandler~} value="" readonly="readonly">
192
+
193
+ `
194
+ },
195
+
183
196
  {
184
197
  "HashPostfix": "-Template-Input-InputType-TextArea",
185
198
  "Template": /*HTML*/`
@@ -42,6 +42,15 @@ class CustomInputHandler extends libPictSectionInputExtension
42
42
  tmpValue = this.fable.Math.roundPrecise(tmpValue, pInput.PictForm.DecimalPrecision, tmpRoundingMethod);
43
43
  }
44
44
 
45
+ if ('DigitsPrefix' in pInput.PictForm)
46
+ {
47
+ tmpValue = pInput.PictForm.DigitsPrefix + tmpValue;
48
+ }
49
+ if ('DigitsPostfix' in pInput.PictForm)
50
+ {
51
+ tmpValue = tmpValue + pInput.PictForm.DigitsPostfix;
52
+ }
53
+
45
54
  return tmpValue;
46
55
  }
47
56
 
@@ -599,6 +599,16 @@ class PictFormMetacontroller extends libPictViewClass
599
599
 
600
600
  this.manifest = tmpManifest;
601
601
 
602
+ // Now see if there is custom CSS
603
+ for (let i = 0; i < tmpSectionList.length; i++)
604
+ {
605
+ let tmpSection = tmpSectionList[i];
606
+ if (('CustomCSS' in tmpSection) && (typeof(tmpSection.CustomCSS) == 'string'))
607
+ {
608
+ this.pict.CSSMap.addCSS(`PSF-SectionCSS-${tmpSection.Hash}`, tmpSection.CustomCSS);
609
+ }
610
+ }
611
+
602
612
  return tmpSectionList;
603
613
  }
604
614
 
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-Provider-Input-PreciseNumber.d.ts","sourceRoot":"","sources":["../../../../source/providers/inputs/Pict-Provider-Input-PreciseNumber.js"],"names":[],"mappings":";AAEA;;;;;;GAMG;AACH;IAEC,2DAUC;IANA,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,6CAA6C;IAC7C,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAC/B;IACV,kBAAkB;IAClB,KADW,GAAG,CACN;IAGT,0CAsBC;IAED;;;;;;;;;;OAUG;IACH,6EAJW,GAAG,iBACH,MAAM,GACJ,OAAO,CAMnB;IAED;;;;;;;;;;OAUG;IACH,yEALW,GAAG,iBACH,MAAM,aACN,MAAM,GACJ,GAAG,CAMf;CACD"}
1
+ {"version":3,"file":"Pict-Provider-Input-PreciseNumber.d.ts","sourceRoot":"","sources":["../../../../source/providers/inputs/Pict-Provider-Input-PreciseNumber.js"],"names":[],"mappings":";AAEA;;;;;;GAMG;AACH;IAEC,2DAUC;IANA,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,6CAA6C;IAC7C,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAC/B;IACV,kBAAkB;IAClB,KADW,GAAG,CACN;IAGT,0CA+BC;IAED;;;;;;;;;;OAUG;IACH,6EAJW,GAAG,iBACH,MAAM,GACJ,OAAO,CAMnB;IAED;;;;;;;;;;OAUG;IACH,yEALW,GAAG,iBACH,MAAM,aACN,MAAM,GACJ,GAAG,CAMf;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAeC;IAPA,+BAAuC;IAEvC,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAGnC;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mCAGC;IAED;;;OAGG;IACH,6BAFW,MAAM,OAKhB;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAchB;IA2BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,gDAGC;IAED,+CAGC;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAmHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,qEAqHC;IAjGA,yBAAiD;IAmGlD;;;OAGG;IACH,gCAFW,MAAM,QAgBhB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,4BAEL,sBAAsB,CAWjC;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;oBAhoBY,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}
1
+ {"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAeC;IAPA,+BAAuC;IAEvC,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAGnC;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mCAGC;IAED;;;OAGG;IACH,6BAFW,MAAM,OAKhB;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAchB;IA2BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,gDAGC;IAED,+CAGC;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAmHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,qEA+HC;IA3GA,yBAAiD;IA6GlD;;;OAGG;IACH,gCAFW,MAAM,QAgBhB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,4BAEL,sBAAsB,CAWjC;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;oBA1oBY,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}