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 +2 -2
- package/debug/data/DefaultFormManifest.json +1 -1
- package/debug/data/MathExampleForm.json +1 -1
- package/debug/input_data/Rectangles.csv +1 -1
- package/package.json +1 -1
- package/source/providers/Pict-Provider-DynamicFormSolverBehaviors.js +4 -4
- package/source/services/ManifestFactory.js +1 -1
- package/utility/csvparser/ParseCSV-Command-Inject.js +2 -0
- package/utility/csvparser/ParseCSV-Command-Parse.js +2 -0
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
|
-
|
|
7
|
-
libParseCSV.run(['node', 'Harness.js', 'intersect']);
|
|
6
|
+
libParseCSV.run(['node', 'Harness.js', 'inject']);
|
|
7
|
+
//libParseCSV.run(['node', 'Harness.js', 'intersect']);
|
package/package.json
CHANGED
|
@@ -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} [
|
|
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,
|
|
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 (
|
|
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(
|
|
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()
|
|
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(/"/g, '"');
|
|
85
87
|
tmpRecords.push(tmpRecord);
|
|
86
88
|
}
|
|
87
89
|
});
|