pict-section-form 1.0.125 → 1.0.127

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/debug/Harness.js CHANGED
@@ -3,5 +3,5 @@ const libParseCSV = require('../utility/csvparser/ParseCSV-Program.js');
3
3
  // This command takes the `TabularManifestCSV.csv` file and imports it into a JSON file
4
4
  //libParseCSV.run(['node', 'Harness.js', 'import']);
5
5
  // This command takes the `data/MathExampleForm.json` file and injects any sidecare files in the `input_data` folder into the JSON file
6
- //libParseCSV.run(['node', 'Harness.js', 'inject']);
7
- libParseCSV.run(['node', 'Harness.js', 'intersect']);
6
+ libParseCSV.run(['node', 'Harness.js', 'inject']);
7
+ //libParseCSV.run(['node', 'Harness.js', 'intersect']);
@@ -868,7 +868,7 @@
868
868
  "ExtraData": ""
869
869
  },
870
870
  {
871
- "Identifier": "C",
871
+ "Identifier": "C and 4\" Nails",
872
872
  "Width": "1",
873
873
  "Height": "1",
874
874
  "Depth": "1",
@@ -868,7 +868,7 @@
868
868
  "ExtraData": ""
869
869
  },
870
870
  {
871
- "Identifier": "C",
871
+ "Identifier": "C and 4\" Nails",
872
872
  "Width": "1",
873
873
  "Height": "1",
874
874
  "Depth": "1",
@@ -1,7 +1,7 @@
1
1
  Identifier,Width,Height,Depth,ExtraData
2
2
  A,1,1,1,
3
3
  B,1,1,1,
4
- C,1,1,1,
4
+ "C and 4"" Nails",1,1,1,
5
5
  D,1,1,1,
6
6
  E,1,1,1,
7
7
  F,1,1,1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.125",
3
+ "version": "1.0.127",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -283,10 +283,10 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
283
283
  * @param {string} pInputHash - The hash of the input to color.
284
284
  * @param {string} pColor - The HTML hex color to apply (e.g. #FF0000 for red).
285
285
  * @param {string} pApplyChange - If "0", the change will not be applied.
286
- * @param {string} [pClassTarget] - Optional. If provided, the color will be applied to the closest element with this class instead of the input itself.
286
+ * @param {string} [pCSSSelector] - Optional. If provided, the color will be applied to the closest element matching this selector instead of the input itself.
287
287
  * @returns {boolean} - Returns true if the color was applied successfully or if the change was skipped for pApplyChange equal to "0", false otherwise.
288
288
  */
289
- colorInputBackground(pSectionHash, pInputHash, pColor, pApplyChange, pClassTarget)
289
+ colorInputBackground(pSectionHash, pInputHash, pColor, pApplyChange, pCSSSelector)
290
290
  {
291
291
  if (pApplyChange == "0")
292
292
  {
@@ -321,13 +321,13 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
321
321
 
322
322
  // if we passed a class target, find the closest element with that class and apply the color to it
323
323
  // otherwise, just apply it to the input element itself
324
- if (pClassTarget)
324
+ if (pCSSSelector)
325
325
  {
326
326
  // find closest target by class name and if we find it, immediately break out of the loop
327
327
  for (let i = 0; i < tmpElementSet.length; i++)
328
328
  {
329
329
  const element = tmpElementSet[i];
330
- const closest = element.closest(`.${pClassTarget}`);
330
+ const closest = element.closest(`${pCSSSelector}`);
331
331
  if (closest)
332
332
  {
333
333
  tmpElement = closest;
@@ -624,7 +624,7 @@ class ManifestFactory extends libFableServiceProviderBase
624
624
  {
625
625
  // Clean up the equation a bit to remove any leading/trailing spaces and replace HTML quotes
626
626
  // that may have been added by the CSV or other source.
627
- const tmpCleanEquation = tmpRecord['Equation'].trim().replace(/&quot;/g, '"');
627
+ const tmpCleanEquation = tmpRecord['Equation'].trim();
628
628
  this.log.trace(`Adding solver to ${tmpRecord.Form} --> ${tmpGroup.Name} for ${tmpRecord['Input Hash']}: ${tmpRecord['Equation']}`);
629
629
  if ((tmpGroup.Layout == 'Tabular') || (tmpGroup.Layout == 'RecordSet'))
630
630
  {
@@ -27,6 +27,7 @@ class ImportExtraDataCSVCommand extends libPictCommandLineUtility.ServiceCommand
27
27
  // Parse the CSV file
28
28
  const tmpRecords = [];
29
29
  const tmpCSVParser = this.fable.instantiateServiceProvider('CSVParser');
30
+ tmpCSVParser.EscapedQuoteString = '"';
30
31
  this.fable.log.info(`Parsing CSV file [${pFilePath}]...`);
31
32
 
32
33
  const tmpReadline = libReadline.createInterface(
@@ -59,6 +60,7 @@ class ImportExtraDataCSVCommand extends libPictCommandLineUtility.ServiceCommand
59
60
  // Parse the CSV file
60
61
  const tmpRecords = [];
61
62
  const tmpCSVParser = this.fable.instantiateServiceProvider('CSVParser');
63
+ tmpCSVParser.EscapedQuoteString = '"';
62
64
  this.fable.log.info(`Parsing Options CSV file [${pFilePath}]...`);
63
65
 
64
66
  const tmpReadline = libReadline.createInterface(
@@ -67,6 +67,7 @@ class ImportCSVCommand extends libPictCommandLineUtility.ServiceCommandLineComma
67
67
  // Parse the CSV file
68
68
  const tmpRecords = [];
69
69
  const tmpCSVParser = this.fable.instantiateServiceProvider('CSVParser');
70
+ tmpCSVParser.EscapedQuoteString = '"';
70
71
 
71
72
  this.fable.log.info(`Parsing CSV file [${tmpFileName}]...`);
72
73
 
@@ -82,6 +83,7 @@ class ImportCSVCommand extends libPictCommandLineUtility.ServiceCommandLineComma
82
83
  const tmpRecord = tmpCSVParser.parseCSVLine(pLine);
83
84
  if (tmpRecord)
84
85
  {
86
+ tmpRecord.Equation = tmpRecord.Equation.replace(/&quot;/g, '"');
85
87
  tmpRecords.push(tmpRecord);
86
88
  }
87
89
  });